\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{pythonhighlight}
\usepackage[type={CC}, modifier={zero}, version={1.0},]{doclicense}
%TCIDATA{OutputFilter=latex2.dll}
%TCIDATA{Version=5.50.0.2960}
%TCIDATA{LastRevised=Saturday, March 11, 2023 14:29:15}
%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{conclusion}[1][]
{\begin{warn}[#1]\begin{leftbar}}
{\end{leftbar}\end{warn}}
\newtheorem{conj}[theo]{Conjecture}
\newenvironment{conjecture}[1][]
{\begin{conj}[#1]\begin{leftbar}}
{\end{leftbar}\end{conj}}
\newtheorem{exam}[theo]{Example}
\newenvironment{example}[1][]
{\begin{exam}[#1]\begin{leftbar}}
{\end{leftbar}\end{exam}}
\newtheorem{exmp}[exer]{Exercise}
\newenvironment{exercise}[1][]
{\begin{exmp}[#1]\begin{leftbar}}
{\end{leftbar}\end{exmp}}
\newenvironment{statement}{\begin{quote}}{\end{quote}}
\newenvironment{fineprint}{\begin{small}}{\end{small}}
\iffalse
\newenvironment{proof}[1][Proof]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\newenvironment{question}[1][Question]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\newenvironment{teachingnote}[1][Teaching note]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\fi
\let\sumnonlimits\sum
\let\prodnonlimits\prod
\let\cupnonlimits\bigcup
\let\capnonlimits\bigcap
\renewcommand{\sum}{\sumnonlimits\limits}
\renewcommand{\prod}{\prodnonlimits\limits}
\renewcommand{\bigcup}{\cupnonlimits\limits}
\renewcommand{\bigcap}{\capnonlimits\limits}
\setlength\tablinesep{3pt}
\setlength\arraylinesep{3pt}
\setlength\extrarulesep{3pt}
\voffset=0cm
\hoffset=-0.7cm
\setlength\textheight{22.5cm}
\setlength\textwidth{15.5cm}
\newcommand\arxiv[1]{\href{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{\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{Enumerative Combinatorics: class notes}
\ohead{page \thepage}
\cfoot{}
\begin{document}

\title{Enumerative Combinatorics: class notes}
\author{Darij Grinberg}
\date{\today\ (unfinished!)\\
$\overline{\text{{\normalsize Status: Chapters 1 and 2 finished; Chapter 3
outlined.}}}$}
\maketitle
\tableofcontents

\doclicenseThis


\section*{Preface}

This is the text accompanying my Math 222 (Enumerative Combinatorics) class at
Drexel University in Fall 2019. The website of this class can be found at%
\[
\text{\url{http://www.cip.ifi.lmu.de/~grinberg/t/19fco}}%
\]
and includes some extra materials (such as homeworks and solutions).

\textbf{This document is a work in progress.} It might become a textbook one
day, but for now only parts of it (currently Chapters \ref{chp.intro} and
\ref{chp.binom}) are at the level of detail expected from a textbook and can
be read on a standalone basis. The later chapters are a construction zone.

\textbf{Please report any errors you find to
\texttt{\href{mailto:darijgrinberg@gmail.com}{darijgrinberg@gmail.com}} .}

\subsection*{What is this?}

These notes cover the basics of enumerative combinatorics, with an emphasis on
counting, identities and bijections. We assume that you (the reader) are well
familiar with the basics of rigorous mathematics (such as proof methods, the
constructions of integers and rationals, and basic properties of finite sets),
as covered (for example) in \cite[Chapters 1--5]{LeLeMe16}, \cite{Day-proofs},
\cite{Hammac15}, \cite[Part I and Appendices A--B]{Newste19} and
\cite{Loehr20}. We will not rely on any analysis, linear algebra or abstract
algebra except for the little that we introduce ourselves.

In terms of coverage, these notes do not set out to break any new ground.

\begin{itemize}
\item The first chapter (Chapter \ref{chp.intro}) is introductory and begins
(in Section \ref{sect.intro.domino}) with a problem (that of counting domino
tilings) that is not in itself particularly important, but serves to motivate
many basic ideas and notions (such as bijective proofs, the sum rule and the
product rule). We continue (in Section \ref{sect.intro.powersums}) with
another elementary problem (viz., finding closed-form expressions for sums of
the form $1^{k}+2^{k}+\cdots+n^{k}$), which we do not solve at this point (it
serves as a teaser for the next chapter) but which prompts us to introduce the
finite sum notation and get some passing acquaintance with certain
combinatorial numbers that will later become important. The next section
(Section \ref{sect.intro.binom}) introduces factorials and binomial
coefficients, and proves (mostly algebraically) their most basic properties,
such as the recursion, the combinatorial interpretation and the hockey-stick
formula. In the sections that follow (Sections \ref{sect.intro.count},
\ref{sect.intro.tups}, \ref{sect.intro.fubini} and \ref{sect.intro.perm}), we
start counting for real: Various problems are considered and solved, counting
(certain kinds of) subsets, tuples, maps and permutations. In the process we
gradually introduce general strategies (such as the difference rule, the
isomorphism principle, or the interchange of summations) as they become
useful. Among other things, we also provide brief introductions to the use of
modern electronic tools like the Online Encylopedia of Integer Sequences and
the SageMath CAS.

\item The second chapter (Chapter \ref{chp.binom}) focusses on binomial
coefficients and related concepts and problems. The first sections revisit
some statements made in the previous chapter, proving and re-proving them and
demonstrating some further techniques in the process. Section
\ref{sect.binom.maps} answers one of the most basic counting problems, namely
that of counting injective maps between two finite sets; the analogous problem
for surjective maps has no closed-form answer, but two recurrences are
derived. Section \ref{sect.binom.powersum} then proves the formula for
$1^{k}+2^{k}+\cdots+n^{k}$ that was left unproved in Section
\ref{sect.intro.powersums}. The next section (Section \ref{sect.binom.vander})
states, proves and applies the Vandermonde convolution theorem in several
ways, while also explaining the \textquotedblleft polynomial identity
trick\textquotedblright\ on which all of the proofs rely and which is a
versatile tool in the study of binomial coefficients (despite not being in
itself a result of combinatorics). The next sections continue with a re-proof
of the combinatorial interpretation of $\dbinom{n}{k}$ (Section
\ref{sect.binom.subsets-sheep}), a first encounter with the method of
generating functions (Section \ref{sect.binom.genfun1}), and the Principle of
Inclusion and Exclusion (Section \ref{sect.binom.pie}). Then, in Section
\ref{sect.binom.compos}, we count several kinds and variants of compositions
of an integer. In Section \ref{sect.binom.mulsub}, we introduce multisubsets
of a set, count them and show an application to an elementary (but far from
simple) counting problem. In Section \ref{sect.binom.multinom}, we introduce
multinomial coefficients and establish their basic properties.

\item $\ldots$ (Further summaries will be written as the respective chapters
will be finished.)
\end{itemize}

One particular goal of these notes is to develop at least the basics of the
theory rigorously -- i.e., without handwaving, picture \textquotedblleft
proofs\textquotedblright\ and ambiguous terminology like \textquotedblleft
ways to choose\textquotedblright\ or vaguely specified \textquotedblleft
arrangements\textquotedblright. This does not mean that we shall avoid such
semi-intuitive explanations whatsoever; but we aim to ensure that they will
never be used in a load-bearing capacity. Sometimes, a statement will be first
proved informally using such explanations, then re-proved in a rigorous language.

\bigskip

\begin{fineprint}
These notes have their origin in the handwritten class notes I made for the
Math 5705 (Enumerative Combinatorics) class at the UMN in Fall
2018\footnote{\ \ \url{http://www.cip.ifi.lmu.de/~grinberg/t/18f}}. However,
they differ noticeably (both in coverage and in the order of the topics).
\end{fineprint}

\subsection{\label{sect.nots}Notations}

The following notations will be used throughout the notes:

\begin{itemize}
\item The symbol $\mathbb{N}$ means the set of all nonnegative integers, i.e.,
the set $\left\{  0,1,2,3,\ldots\right\}  $.

\item The symbol $\operatorname*{id}$ denotes the identity map of a set $X$
(that is, the map from $X$ to $X$ that sends each element $x\in X$ to $x$).

\item For any $k\in\mathbb{Z}$, we let $\left[  k\right]  $ denote the set
$\left\{  1,2,\ldots,k\right\}  $ of the first $k$ positive integers. When
$k\leq0$, this set is understood to be empty.

\item The notation $\left\vert S\right\vert $ denotes the size (i.e., the
number of elements) of a set $S$.

\item The symbol \# stands for \textquotedblleft number\textquotedblright\ (or
\textquotedblleft the number\textquotedblright), as in \textquotedblleft the
number of all subsets of $\left\{  1,2\right\}  $ is $4$\textquotedblright.
\end{itemize}

Several further notations will be introduced over the course of these notes.
In particular, we will define

\begin{itemize}
\item the Fibonacci sequence $\left(  f_{0},f_{1},f_{2},\ldots\right)  $
(Definition \ref{def.fib});

\item the summation sign $\sum$ (Definition \ref{def.sum.sigma-sign} and
Definition \ref{def.sum.infinite});

\item the product sign $\prod$ (Definition \ref{def.prod.pi-sign});

\item the two-line notation for a map (Definition \ref{def.map.tln});

\item the factorials $n!$ (Definition \ref{def.factorial});

\item the binomial coefficients $\dbinom{n}{k}$ (Definition
\ref{def.binom.def});

\item the truth value $\left[  \mathcal{A}\right]  $ (Definition
\ref{def.iverson});

\item the notion of a lacunar set of integers (Definition
\ref{def.subsets.lacunar});

\item the floor and ceiling of a number ($\left\lfloor x\right\rfloor $ and
$\left\lceil x\right\rceil $) (Definition \ref{def.floor-ceil});

\item the notion of a permutation (Definition \ref{def.perm});

\item the notion of a composition (Definition \ref{def.compos});

\item the concept of a multisubset (Definition \ref{def.mulsub}) and the
notation $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}$
for it, along with various related notions;

\item the surjection numbers $\operatorname*{sur}\left(  m,n\right)  $
(Definition \ref{def.surmn});

\item the multinomial coefficients $\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}$
(Definition \ref{def.multinom});
\end{itemize}

\noindent and several others.

\begin{center}
\fbox{\textbf{Class of 2019-09-23}}
\end{center}

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

This is a text on \emph{enumerative combinatorics}: the part of mathematics
concerned with the sizes of finite sets, particularly their computation and
the proof of equalities between them. More precisely, here are what I consider
to be the three main threads of enumerative combinatorics:

\begin{itemize}
\item \textbf{Counting} -- i.e., finding formulas for the sizes of certain
finite sets. For example, we count the permutations of the set $\left\{
1,2,\ldots,n\right\}  $, or the $k$-element subsets of $\left\{
1,2,\ldots,n\right\}  $ that contain no two consecutive elements.
\textquotedblleft Count\textquotedblright\ means finding a formula that
expresses the number of such permutations or $k$-element subsets in terms of
$n$ and $k$.

\item \textbf{Proving polynomial identities} (such as the binomial formula
$\left(  x+y\right)  ^{n}=\sum_{k=0}^{n}\dbinom{n}{k}x^{k}y^{n-k}$ or various
deeper ones).

\item \textbf{Finding and studying interesting maps between finite sets}. A
basic example of such a map is the \textquotedblleft bit-set
encoding\textquotedblright: the bijection from the set of all subsets of
$\left\{  1,2,\ldots,n\right\}  $ (for a fixed positive integer $n$) to the
set of all $n$-tuples $\left(  i_{1},i_{2},\ldots,i_{n}\right)  \in\left\{
0,1\right\}  ^{n}$ (known as \textquotedblleft length-$n$
bitstrings\textquotedblright) which sends each subset $S$ of $\left\{
1,2,\ldots,n\right\}  $ to the $n$-tuple $\left(  i_{1},i_{2},\ldots
,i_{n}\right)  $, where $i_{k}=%
\begin{cases}
1, & \text{if }k\in S;\\
0, & \text{if }k\notin S
\end{cases}
$. We will care particularly about bijections, since they directly help in
counting, but even non-bijective maps are fundamental to enumerative combinatorics.
\end{itemize}

You will see more examples of each of these three threads all over this text,
starting with this introductory chapter.

\begin{fineprint}
We will also occasionally see some connections to linear algebra, abstract
algebra, number theory and graph theory. There are other threads in
enumerative combinatorics that we are not going to encounter (or only
tangentially): applications (mostly), connections to representation theory or
geometry, asymptotics and many more. A one-semester course needs to have its limits!
\end{fineprint}

\vspace{0.5pc}First, I will discuss some interesting (if you share my taste)
questions, in no particular order. Not all of them will be answered right away.

\subsection{\label{sect.intro.domino}Domino tilings}

\begin{teachingnote}
Looking at \cite{Sagan19} and \cite{BenQui03}, I realized that domino tilings
of $2\times n$-rectangles are inferior to domino-and-square tilings of
$1\times n$-rectangles (the combinatorics is the same, but the proofs are
significantly more complicated). Maybe it is worth rewriting this section to
use the latter instead of the former? (But on the downside, this would not
connect as nicely to domino tilings of $n\times m$-rectangles.)
\end{teachingnote}

\subsubsection{The problem}

Let $n\in\mathbb{N}$ and $m\in\mathbb{N}$. Here and in the following,
$\mathbb{N}$ means the set $\left\{  0,1,2,\ldots\right\}  $.

Let $R_{n,m}$ denote an $n\times m$\emph{-rectangle}, i.e., a rectangle with
width $n$ and height $m$. (We imagine a specific such rectangle drawn
somewhere in the plane.) For example, $R_{3,4}$ looks like this:\footnote{We
subdivide it with grid lines just to show its dimensions.}%
\begin{equation}%
\begin{array}
[c]{cc}%
\begin{tabular}
[c]{|l|l|l|}\hline
\phantom{w} & \phantom{w} & \phantom{w}\\\hline
\phantom{w} & \phantom{w} & \phantom{w}\\\hline
\phantom{w} & \phantom{w} & \phantom{w}\\\hline
\phantom{w} & \phantom{w} & \phantom{w}\\\hline
\end{tabular}
&
\begin{array}
[c]{c}%
{{\left\downarrow \vbox to 0.69cm{}\right.  \kern-\nulldelimiterspace}}\\
4\\
{{\left\uparrow \vbox to 0.69cm{}\right.  \kern-\nulldelimiterspace}}%
\end{array}
\\
\xrightarrow{\hspace*{.6cm}}3\xleftarrow{\hspace*{.6cm}} &
\end{array}
\label{eq.domino.R34}%
\end{equation}


A \emph{domino} shall mean a $1\times2$-rectangle or a $2\times1$-rectangle.
More specifically: A \emph{vertical domino} shall mean a $1\times2$-rectangle;
a \emph{horizontal domino} shall mean a $2\times1$-rectangle. Here is how they
look like:%
\[
\underbrace{\
\begin{tabular}
[c]{|l|}\hline
\phantom{w}\\\hline
\phantom{w}\\\hline
\end{tabular}
\ }_{\text{vertical domino}}\text{;}\ \ \ \ \ \ \ \ \ \ \underbrace{\
\begin{tabular}
[c]{|l|l|}\hline
\phantom{w} & \phantom{w}\\\hline
\end{tabular}
\ }_{\text{horizontal domino}}\text{.}%
\]


A \emph{domino tiling} of $R_{n,m}$ is a way to cover the rectangle $R_{n,m}$
with non-overlapping dominos.

For example, here are three domino tilings of the rectangle $R_{3,4}$ (which
rectangle you have seen in (\ref{eq.domino.R34})):%
\[%
\begin{tabular}
[c]{|lll|}\hline
\phantom{w} & \multicolumn{1}{l|}{\phantom{w}} & \phantom{w}\\\cline{1-2}%
\cline{1-2}%
\multicolumn{1}{|l|}{\phantom{w}} & \multicolumn{1}{l|}{\phantom{w}} &
\phantom{w}\\\cline{3-3}%
\multicolumn{1}{|l|}{\phantom{w}} & \multicolumn{1}{l|}{\phantom{w}} &
\phantom{w}\\\cline{1-2}\cline{2-2}%
\phantom{w} & \multicolumn{1}{l|}{\phantom{w}} & \phantom{w}\\\hline
\end{tabular}
\ \ \ ,\qquad%
\begin{tabular}
[c]{|l|l|l|}\hline
\phantom{w} & \phantom{w} & \phantom{w}\\\cline{4-4}%
\phantom{w} & \phantom{w} & \phantom{w}\\\hline
\phantom{w} & \phantom{w} & \phantom{w}\\\cline{4-4}%
\phantom{w} & \phantom{w} & \phantom{w}\\\hline
\end{tabular}
\ \ ,\qquad%
\begin{tabular}
[c]{|ll|l|}\hline
\phantom{w} & \phantom{w} & \phantom{w}\\\cline{1-2}%
\phantom{w} & \phantom{w} & \phantom{w}\\\hline
\phantom{w} & \phantom{w} & \phantom{w}\\\cline{1-2}%
\phantom{w} & \phantom{w} & \phantom{w}\\\hline
\end{tabular}
\ \ .
\]
(Now, of course, we are no longer drawing the grid lines, but only the
outlines of the dominos.)

We can now state our first enumeration (i.e., counting) problem: How many
domino tilings does $R_{n,m}$ have?

As we just saw, $R_{3,4}$ has at least $3$ domino tilings, but in fact you can
find several more. Counting them all is, at the very least, an unpleasant
exercise in carefulness. Let us try a simpler example:

\begin{example}
\label{exa.domino.R32}Here are all domino tilings of $R_{3,2}$:%
\[%
\begin{tabular}
[c]{|l|l|l|}\hline
\phantom{w} & \phantom{w} & \phantom{w}\\\cline{4-4}%
\phantom{w} & \phantom{w} & \phantom{w}\\\hline
\end{tabular}
\ \ ,\qquad%
\begin{tabular}
[c]{|ll|l|}\hline
\phantom{w} & \phantom{w} & \phantom{w}\\\cline{1-2}%
\phantom{w} & \phantom{w} & \phantom{w}\\\hline
\end{tabular}
\ \ ,\qquad%
\begin{tabular}
[c]{|l|ll|}\hline
\multicolumn{1}{|l|}{\phantom{w}} & \phantom{w} & \phantom{w}\\\cline{2-3}%
\phantom{w} & \phantom{w} & \phantom{w}\\\hline
\end{tabular}
\ \ .
\]

\end{example}

If we are to solve the above problem in general, our first step should be
making it rigorous. We said that a domino tiling should be a way to cover the
rectangle $R_{n,m}$ with non-overlapping dominos. What does \textquotedblleft
cover\textquotedblright\ mean, and what does \textquotedblleft
non-overlapping\textquotedblright\ mean? Visually, it is pretty clear, but we
do not have bulletproof mathematical definitions yet. There are two ways to
create such definitions:

\begin{itemize}
\item \textbf{The geometric way:} We really define $R_{n,m}$ as a rectangle of
width $n$ and height $m$ in the Euclidean plane; for example, let us pick the
rectangle with vertices $\left(  0,0\right)  $, $\left(  n,0\right)  $,
$\left(  n,m\right)  $ and $\left(  0,m\right)  $ (where we model the
Euclidean plane through a Cartesian coordinate system as usual).\footnote{This
rectangle contains both the points on its boundary and its interior point.} We
say that a set of dominos \emph{covers} $R_{n,m}$ if their union (as sets) is
$R_{n,m}$. It is harder to define what it means for a set of dominos to be
\emph{non-overlapping}; clearly, this is not quite the same as them being
disjoint as sets (because they are allowed to have edges or vertices in
common). There are several good ways to define
non-overlappingness\footnote{For example, you can say that two dominos are
\emph{non-overlapping} if their intersection is either the empty set or a
point or a line segment. Then you can say that a set of dominos is
\emph{non-overlapping} if any two distinct dominos in it are non-overlapping.}%
. Unfortunately, once all these definitions are made, it is still far from
clear how to \textbf{reason} about them rigorously! For example, it may seem
obvious, but why exactly must all the dominos in a domino tiling of $R_{n,m}$
be \textquotedblleft snapped to the grid\textquotedblright\ (i.e., why must
their corners be grid points\footnote{A \emph{grid point} means a point with
integer coordinates.})? This is indeed true, but proving this would take
serious work. Thus, even our previous observation that $R_{3,2}$ has three
domino tilings (shown visually in Example \ref{exa.domino.R32}) would become a
nontrivial theorem. Thus, we leave this geometric model of domino tilings
aside, and instead define things in $\ldots$

\item \textbf{The combinatorial way:} We redefine $R_{n,m}$ as the set
$\left[  n\right]  \times\left[  m\right]  $, where we set
\[
\left[  k\right]  =\left\{  1,2,\ldots,k\right\}
\ \ \ \ \ \ \ \ \ \ \text{for each }k\in\mathbb{N}.
\]


Its elements thus are the pairs $\left(  i,j\right)  $ with $i\in\left[
n\right]  $ and $j\in\left[  m\right]  $; we call these pairs
\textquotedblleft\emph{squares}\textquotedblright. Thus, $R_{n,m}$ is a
\textbf{finite} set of size\footnote{The \emph{size} of a finite set $S$ is
the number of elements of $S$. It is denoted by $\left\vert S\right\vert $.
For example, $\left\vert \left\{  1,4,6\right\}  \right\vert =3$ and
$\left\vert \left\{  -1,1,6,7\right\}  \right\vert =4$ and $\left\vert
\varnothing\right\vert =0$.} $\left\vert R_{n,m}\right\vert =nm$.

A \emph{vertical domino} shall mean a set of the form $\left\{  \left(
i,j\right)  ,\ \left(  i,j+1\right)  \right\}  $ for some $i,j\in\mathbb{Z}$.

A \emph{horizontal domino} shall mean a set of the form $\left\{  \left(
i,j\right)  ,\ \left(  i+1,j\right)  \right\}  $ for some $i,j\in\mathbb{Z}$.

A \emph{domino} shall mean a set that is either a vertical domino or a
horizontal domino.

If $S$ is a set of squares (for example, $R_{n,m}$), then a \emph{domino
tiling} of $S$ shall mean a set $\left\{  S_{1},S_{2},\ldots,S_{k}\right\}  $
of \textbf{disjoint} dominos whose union is $S$ (that is, $S_{1}\cup S_{2}%
\cup\cdots\cup S_{k}=S$).

A few words are in order about what this has to do with our visual concept of
domino tilings.

First of all, why are we suddenly considering the finite set $R_{n,m}$ to be a
\textquotedblleft rectangle\textquotedblright? Because we are no longer
thinking in terms of all points in the plane, but rather thinking in terms of
\emph{grid squares} (as in (\ref{eq.domino.R34})). Thus, the rectangle
$R_{n,m}$ is no longer an (infinite) set of points, but now becomes a (finite)
set of grid squares that lie in this rectangle. We label these grid squares by
pairs of integers (namely, we label each grid square by the pair $\left(
i,j\right)  $ of Cartesian coordinates of its northeastern
corner\footnote{Here is how $R_{3,4}$ looks like with each square labeled:%
\[%
\begin{tabular}
[c]{|c|c|c|}\hline
$\left(  1,4\right)  \vphantom{\dfrac{1}{2f}}$ & $\left(  2,4\right)
\vphantom{\dfrac{1}{2f}}$ & $\left(  3,4\right)  \vphantom{\dfrac{1}{2f}}$%
\\\hline
$\left(  1,3\right)  \vphantom{\dfrac{1}{2f}}$ & $\left(  2,3\right)
\vphantom{\dfrac{1}{2f}}$ & $\left(  3,3\right)  \vphantom{\dfrac{1}{2f}}$%
\\\hline
$\left(  1,2\right)  \vphantom{\dfrac{1}{2f}}$ & $\left(  2,2\right)
\vphantom{\dfrac{1}{2f}}$ & $\left(  3,2\right)  \vphantom{\dfrac{1}{2f}}$%
\\\hline
$\left(  1,1\right)  \vphantom{\dfrac{1}{2f}}$ & $\left(  2,1\right)
\vphantom{\dfrac{1}{2f}}$ & $\left(  3,1\right)  \vphantom{\dfrac{1}{2f}}$%
\\\hline
\end{tabular}
\ \
\]
}; thus, the southwesternmost square of $R_{n,m}$ is labeled $\left(
1,1\right)  $, and the eastern neighbor of a square $\left(  i,j\right)  $ is
$\left(  i+1,j\right)  $, whereas the northern neighbor of a square $\left(
i,j\right)  $ is $\left(  i,j+1\right)  $). In other words, the square in
column $i$ (counted from the left) and row $j$ (counted from the bottom) is
labelled by the pair $\left(  i,j\right)  $.

Having thus redefined the rectangle $R_{n,m}$ as a finite set of grid squares,
we then do the same for dominos and domino tilings. A domino, too, is not an
infinite set any more, but just a set of two adjacent grid squares. It is a
vertical domino if these grid squares differ in their y-coordinate (i.e., have
the forms $\left(  i,j\right)  $ and $\left(  i,j+1\right)  $ for some
$i,j\in\mathbb{Z}$), and it is a horizontal domino if these grid squares
differ in their x-coordinate (i.e., have the forms $\left(  i,j\right)  $ and
$\left(  i+1,j\right)  $ for some $i,j\in\mathbb{Z}$). From this point of
view, two dominos are non-overlapping if they are literally disjoint (because
they are sets of grid squares now, and thus disjointness means that they have
no grid squares in common; it does not matter if they share an edge).

So we have obtained a new model for domino tilings, with simpler definitions
and with all sets involved being finite. This kind of model is called a
\textbf{discrete model}. It is much more manageable than the geometric one,
and in particular, almost everything that is visually obvious is actually
straightforward to prove in this model (unlike in the geometric one). For
example, it is easy to rigorously reproduce our result from Example
\ref{exa.domino.R32} saying that $R_{3,2}$ has $3$ domino tilings. In the
discrete model, these domino tilings are\footnote{listed here in the same
order in which they appeared in Example \ref{exa.domino.R32}}%
\begin{align*}
&  \left\{  \underbrace{\left\{  \left(  1,1\right)  ,\left(  1,2\right)
\right\}  }_{\substack{\text{vertical domino}\\\text{covering the}%
\\\text{leftmost column}}},\ \underbrace{\left\{  \left(  2,1\right)  ,\left(
2,2\right)  \right\}  }_{\substack{\text{vertical domino}\\\text{covering
the}\\\text{middle column}}},\ \underbrace{\left\{  \left(  3,1\right)
,\left(  3,2\right)  \right\}  }_{\substack{\text{vertical domino}%
\\\text{covering the}\\\text{rightmost column}}}\right\}  ,\\
&  \left\{  \underbrace{\left\{  \left(  1,1\right)  ,\left(  2,1\right)
\right\}  }_{\substack{\text{horizontal domino}\\\text{in the bottom row}%
}},\ \underbrace{\left\{  \left(  1,2\right)  ,\left(  2,2\right)  \right\}
}_{\substack{\text{horizontal domino}\\\text{in the top row}}%
},\ \underbrace{\left\{  \left(  3,1\right)  ,\left(  3,2\right)  \right\}
}_{\substack{\text{vertical domino}\\\text{covering the}\\\text{rightmost
column}}}\right\}  ,\\
&  \left\{  \underbrace{\left\{  \left(  1,1\right)  ,\left(  1,2\right)
\right\}  }_{\substack{\text{vertical domino}\\\text{covering the}%
\\\text{leftmost column}}},\ \underbrace{\left\{  \left(  2,1\right)  ,\left(
3,1\right)  \right\}  }_{\substack{\text{horizontal domino}\\\text{in the
bottom row}}},\ \underbrace{\left\{  \left(  2,2\right)  ,\left(  3,2\right)
\right\}  }_{\substack{\text{horizontal domino}\\\text{in the top row}%
}}\right\}  .
\end{align*}
You do need a bit of work to verify that no other domino tilings of $R_{3,2}$
exist; but it is very much doable. The surefire (but boring) way is to simply
check all possibilities by \textbf{brute force}: There are only $7$ dominos
that lie inside\footnote{To \textquotedblleft lie inside\textquotedblright%
\ $R_{3,2}$ means to be a subset of $R_{3,2}$ here.} $R_{3,2}$, and clearly
any domino tiling must consist of some of these $7$ dominos; now, you can
check all the $2^{7}$ possible subsets. (This is the most brainless approach;
of course, with a bit of thinking, you can save yourself a lot of work.)
\end{itemize}

From now on, we shall always be using the discrete model when we study domino
tilings -- i.e., we define $R_{n,m}$, dominos and domino tilings via the
combinatorial way.

If $n,m\in\mathbb{N}$, then let us define an integer $d_{n,m}$ by%
\begin{equation}
d_{n,m}=\left(  \text{\# of domino tilings of }R_{n,m}\right)  .
\label{eq.domino.def-dnm}%
\end{equation}
Here and in the following, the symbol \textquotedblleft\#\textquotedblright%
\ always means \textquotedblleft number\textquotedblright\ (or
\textquotedblleft the number\textquotedblright, depending on context).

Our problem thus asks us to compute $d_{n,m}$. In Example \ref{exa.domino.R32}%
, we have seen that $d_{3,2}=3$. For any fixed $n$ and $m$, we can technically
compute $d_{n,m}$ by brute force (i.e., trying out all possible subsets of the
set of dominoes lying inside $R_{n,m}$, and counting the domino tilings among
them). But this becomes forbiddingly slow when $n$ and $m$ get even a little
bit large (say, $n=8$ and $m=8$). We are looking for something better: for an
explicit formula for $d_{n,m}$ if possible, and otherwise at least for faster
algorithms that compute $d_{n,m}$.

\subsubsection{The odd-by-odd case and the sum rule}

We begin with a particularly simple case:

\begin{proposition}
\label{prop.1.1}Assume that $n$ and $m$ are odd. Then, $d_{n,m}=0$.
\end{proposition}

\begin{proof}
[Proof sketch.]We have assumed that $n$ and $m$ are odd. Thus, the product
$nm$ is odd as well. In other words, the size $\left\vert R_{n,m}\right\vert $
is odd (since $\left\vert R_{n,m}\right\vert =nm$).

But each domino has even size (in fact, it has size $2$).

If the set $R_{n,m}$ had a domino tiling, then the size $\left\vert
R_{n,m}\right\vert $ of $R_{n,m}$ would equal the sum of the sizes of all the
dominos in the tiling (because $R_{n,m}$ is the union of the dominos, and the
dominos are disjoint). But the size $\left\vert R_{n,m}\right\vert $ is odd,
whereas the sum of the sizes of all the dominos in the tiling is even (since
each domino has even size); thus the former cannot equal the latter. This
shows that the set $R_{n,m}$ has no domino tilings. In other words, the \# of
domino tilings of $R_{n,m}$ is $0$. In other words, $d_{n,m}=0$.
\end{proof}

It is worth being a little bit more detailed once and look under the hood of
this proof. We have used the following basic fact:

\begin{theorem}
[The sum rule]\label{thm.1.2}If a finite set $S$ is the union of $k$ disjoint
sets $S_{1},S_{2},\ldots,S_{k}$, then%
\[
\left\vert S\right\vert =\left\vert S_{1}\right\vert +\left\vert
S_{2}\right\vert +\cdots+\left\vert S_{k}\right\vert .
\]

\end{theorem}

Theorem \ref{thm.1.2} is known as the \emph{sum rule} or the \emph{addition
rule}, and is so fundamental for all of mathematics that you have probably not
even noticed us tacitly using it in the proof of Proposition \ref{prop.1.1}
above. We shall not prove Theorem \ref{thm.1.2}, since this is a job for
\textquotedblleft axiomatic foundations of mathematics\textquotedblright%
\ courses and depends on the \textquotedblleft implementation
details\textquotedblright\ of your mathematical \textquotedblleft standard
library\textquotedblright\ (such as: how do you define the size of a finite
set?).\footnote{For example, if you define your sets and numbers in the
old-fashioned Bourbakist way, then you can find Theorem \ref{thm.1.2} with
proof in \cite[Chapter III, \S 3.3, Corollary]{Bourba68}. If you are using
constructivist foundations, then Theorem \ref{thm.1.2} can be proven by
induction on $k$ (see \cite[proof of 1.2]{Loehr-BC} for the details of this
induction proof), relying on the fact that any two disjoint finite sets $A$
and $B$ of $\left\vert A\cup B\right\vert =\left\vert A\right\vert +\left\vert
B\right\vert $. The latter fact (which is, of course, essentially equivalent
to the particular case of Theorem \ref{thm.1.2} for $k=2$) can be proven
directly by explicitly constructing a bijection $A\cup B\rightarrow\left[
n+m\right]  $ out of two bijections $A\rightarrow\left[  n\right]  $ and
$B\rightarrow\left[  m\right]  $ (see \cite[proof of 1.32]{Loehr-BC} for the
details of this construction). But we will not dwell on fundamental issues
like this here.}

We can restate Theorem \ref{thm.1.2} as follows: If $S_{1},S_{2},\ldots,S_{k}$
are $k$ disjoint finite sets, then the set $S_{1}\cup S_{2}\cup\cdots\cup
S_{k}$ is finite and satisfies%
\begin{equation}
\left\vert S_{1}\cup S_{2}\cup\cdots\cup S_{k}\right\vert =\left\vert
S_{1}\right\vert +\left\vert S_{2}\right\vert +\cdots+\left\vert
S_{k}\right\vert . \label{eq.thm.1.2.variant1}%
\end{equation}
(Indeed, this follows from Theorem \ref{thm.1.2}, applied to $S=S_{1}\cup
S_{2}\cup\cdots\cup S_{k}$.)

Thus, if $X$ and $Y$ are two disjoint finite sets, then the set $X\cup Y$ is
finite and satisfies%
\begin{equation}
\left\vert X\cup Y\right\vert =\left\vert X\right\vert +\left\vert
Y\right\vert . \label{eq.thm.1.2.variant1-k=2}%
\end{equation}
(Indeed, this follows from (\ref{eq.thm.1.2.variant1}), applied to $k=2$,
$S_{1}=X$ and $S_{2}=Y$.)

We have also used the visually obvious fact that $\left\vert R_{n,m}%
\right\vert =nm$ (that is, $R_{n,m}$ has $nm$ squares). Formally speaking,
this is a consequence of another basic fact:

\begin{theorem}
[The product rule for two sets]\label{thm.prodrule2}Let $X$ and $Y$ be two
finite sets. Then, $X\times Y$ is a finite set with size
\begin{equation}
\left\vert X\times Y\right\vert =\left\vert X\right\vert \cdot\left\vert
Y\right\vert . \label{eq.thm.prodrule2.size}%
\end{equation}

\end{theorem}

In other words, this theorem is saying that the number of pairs $\left(
x,y\right)  \in X\times Y$ (where $X$ and $Y$ are two given finite sets) is
$\left\vert X\right\vert \cdot\left\vert Y\right\vert $. This is intuitive,
since such a pair $\left(  x,y\right)  $ can be constructed by choosing an
element $x$ of $X$ (there are $\left\vert X\right\vert $ many options for it)
and choosing an element $y$ of $Y$ (there are $\left\vert Y\right\vert $ many
options for it); since the two choices are completely independent, it is
reasonable that they should lead to $\left\vert X\right\vert \cdot\left\vert
Y\right\vert $ many options for the whole pair $\left(  x,y\right)  $.

Again, we will not prove Theorem \ref{thm.prodrule2}, as it is sufficiently
elementary.\footnote{See \cite[1.5]{Loehr-BC} for a proof (even of a more
general statement).} It is called the \emph{product rule for two sets}, as
there is a product rule for $k$ sets as well (Theorem \ref{thm.prodrulen} below).

Let us now restate our above proof of Proposition \ref{prop.1.1} in a way that
makes the uses of Theorem \ref{thm.1.2} and of Theorem \ref{thm.prodrule2} in
it explicit:

\begin{fineprint}
\begin{proof}
[Proof of Proposition \ref{prop.1.1} (detailed version).]For each
$k\in\mathbb{N}$, we have $\left[  k\right]  =\left\{  1,2,\ldots,k\right\}  $
and thus $\left\vert \left[  k\right]  \right\vert =\left\vert \left\{
1,2,\ldots,k\right\}  \right\vert =k$. Hence, $\left\vert \left[  n\right]
\right\vert =n$ and $\left\vert \left[  m\right]  \right\vert =m$. But
$R_{n,m}=\left[  n\right]  \times\left[  m\right]  $ and thus%
\begin{align*}
\left\vert R_{n,m}\right\vert  &  =\left\vert \left[  n\right]  \times\left[
m\right]  \right\vert =\underbrace{\left\vert \left[  n\right]  \right\vert
}_{=n}\cdot\underbrace{\left\vert \left[  m\right]  \right\vert }%
_{=m}\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{eq.thm.prodrule2.size}),
applied to }X=\left[  n\right]  \text{ and }Y=\left[  m\right]  \right) \\
&  =nm.
\end{align*}


We have assumed that $n$ and $m$ are odd. Thus, the product $nm$ is odd as
well. In other words, the size $\left\vert R_{n,m}\right\vert $ is odd (since
$\left\vert R_{n,m}\right\vert =nm$).

Our next goal is to show that the set $R_{n,m}$ has no domino tilings.

Indeed, let $T$ be a domino tiling of $R_{n,m}$. We will derive a contradiction.

Write $T$ in the form $T=\left\{  S_{1},S_{2},\ldots,S_{k}\right\}  $, where
$S_{1},S_{2},\ldots,S_{k}$ are distinct dominos\footnote{Here, we are tacitly
using the fact that $T$ is finite. Why is $T$ finite? Intuitively it is
obvious. More rigorously, you can argue this as follows: There are only
finitely many dominos that are subsets of $R_{n,m}$. The set $T$, being a
domino tiling of $R_{n,m}$, must consist entirely of such dominos; thus, it
must be a subset of the (finite) set of these dominos. Hence, $T$ is itself
finite (since a subset of a finite set is always finite).
\par
We trust you to make such arguments whenever necessary; we will not dwell on
them in the future.}. Then, the sets $S_{1},S_{2},\ldots,S_{k}$ are dominos;
thus, their sizes $\left\vert S_{1}\right\vert ,\left\vert S_{2}\right\vert
,\ldots,\left\vert S_{k}\right\vert $ are even (since the size of each domino
is even\footnote{Indeed, the size of each domino is $2$.}). Hence, the sum
$\left\vert S_{1}\right\vert +\left\vert S_{2}\right\vert +\cdots+\left\vert
S_{k}\right\vert $ is even (being a sum of even integers).

But the finite set $R_{n,m}$ is a union of the $k$ disjoint sets $S_{1}%
,S_{2},\ldots,S_{k}$ (since $\left\{  S_{1},S_{2},\ldots,S_{k}\right\}  =T$ is
a domino tiling of $R_{n,m}$). Hence, Theorem \ref{thm.1.2} (applied to
$S=R_{n,m}$) yields $\left\vert R_{n,m}\right\vert =\left\vert S_{1}%
\right\vert +\left\vert S_{2}\right\vert +\cdots+\left\vert S_{k}\right\vert
$. Hence, $\left\vert R_{n,m}\right\vert $ is even (since $\left\vert
S_{1}\right\vert +\left\vert S_{2}\right\vert +\cdots+\left\vert
S_{k}\right\vert $ is even). This contradicts the fact that $\left\vert
R_{n,m}\right\vert $ is odd.

Now, forget that we fixed $T$. We thus have found a contradiction for each
domino tiling $T$ of $R_{n,m}$. This shows that there exists no domino tiling
of $R_{n,m}$. In other words, the \# of domino tilings of $R_{n,m}$ is $0$. In
other words, $d_{n,m}=0$. This proves Proposition \ref{prop.1.1}.
\end{proof}
\end{fineprint}

In the future, we will be using the sum rule (Theorem \ref{thm.1.2}) and the
product rule (Theorem \ref{thm.prodrule2}) many times, usually without even
mentioning it.

\subsubsection{The symmetry and the bijection rule}

Thus we have handled at least one case of our counting problem: the case when
$n$ and $m$ are odd. It remains to handle the case when at least one of $n$
and $m$ is even. More precisely, it suffices to handle the case when $n$ is
even, because of the following symmetry in the problem:

\begin{proposition}
\label{prop.domino.symm}Let $n,m\in\mathbb{N}$. Then, $d_{n,m}=d_{m,n}$.
\end{proposition}

\begin{proof}
[Proof sketch.]The idea is very simple: The rectangle $R_{m,n}$ can be
obtained by \textquotedblleft flipping\textquotedblright\ the rectangle
$R_{n,m}$ across the line with equation $x=y$ (in Cartesian coordinates). This
\textquotedblleft flip\textquotedblright\ operation turns domino tilings of
$R_{m,n}$ into domino tilings of $R_{n,m}$ and vice versa; here is an example:%
\[%
\begin{tabular}
[c]{|lll|}\hline
\phantom{w} & \multicolumn{1}{l|}{\phantom{w}} & \phantom{w}\\\cline{1-2}%
\cline{1-2}%
\multicolumn{1}{|l|}{\phantom{w}} & \multicolumn{1}{l|}{\phantom{w}} &
\phantom{w}\\\cline{3-3}%
\multicolumn{1}{|l|}{\phantom{w}} & \multicolumn{1}{l|}{\phantom{w}} &
\phantom{w}\\\cline{1-2}\cline{2-2}%
\phantom{w} & \multicolumn{1}{l|}{\phantom{w}} & \phantom{w}\\\hline
\end{tabular}
\ \ \ \ \ \overset{\text{flip}}{\longrightarrow}\ \ \ \
\begin{tabular}
[c]{|llll|}\hline
\phantom{w} & \multicolumn{1}{l|}{\phantom{w}} & \phantom{w} &
\phantom{w}\\\hline
\multicolumn{1}{|l|}{\phantom{w}} & \phantom{w} &
\multicolumn{1}{l|}{\phantom{w}} & \phantom{w}\\\cline{2-3}%
\multicolumn{1}{|l|}{\phantom{w}} & \phantom{w} &
\multicolumn{1}{l|}{\phantom{w}} & \phantom{w}\\\hline
\end{tabular}
\ \ \ \ .
\]
Thus, the domino tilings of $R_{m,n}$ are in 1-to-1 correspondence with the
domino tilings of $R_{n,m}$. This entails that the \# of the former equals the
\# of the latter. Since the \# of the former is $d_{m,n}$ (by the definition
of $d_{m,n}$), whereas the \# of the latter is $d_{n,m}$ (by the definition of
$d_{n,m}$), we can rewrite this as follows: $d_{m,n}=d_{n,m}$. This proves
Proposition \ref{prop.domino.symm}.
\end{proof}

It is worth expanding this proof just to see what exactly we have done; again,
the underlying principle is very basic but worth stating at least once. The
domino tilings of $R_{m,n}$ are not literally the same as the domino tilings
of $R_{n,m}$ (in general\footnote{The words \textquotedblleft in
general\textquotedblright\ here are a pedantic hedge: Of course, the domino
tilings of $R_{m,n}$ \textbf{are} literally the same as the domino tilings of
$R_{n,m}$ when $n=m$ (or when $n=0$, or when $m=0$, or when both $n$ and $m$
are odd). But they are not the same, for example, when $n=2$ and $m=3$.});
yet, we have argued that the former are in 1-to-1 correspondence with the
latter, and therefore equinumerous to the latter. Formally, a 1-to-1
correspondence between two sets of objects is given by a map from one set to
the other, but it cannot be just any map: It has to be a bijection (i.e., a
bijective map)\footnote{We refer to places like \cite[\S 4.4--4.5]{LeLeMe16},
\cite[\S 12.2]{Hammac15} or \cite[\S 3.F]{Day-proofs} for basic properties of
bijections and bijectivity. Here come some brief reminders: A map
$f:X\rightarrow Y$ between two sets $X$ and $Y$ is said to be
\par
\begin{itemize}
\item \emph{injective} if it has the property that $\left(  f\left(
x_{1}\right)  =f\left(  x_{2}\right)  \right)  \Longrightarrow\left(
x_{1}=x_{2}\right)  $ for any two elements $x_{1},x_{2}\in X$ (or,
equivalently, if it maps any two distinct elements of $X$ to two distinct
elements of $Y$);
\par
\item \emph{surjective} if it has the property that for each $y\in Y$, there
exists at least one $x\in X$ satisfying $f\left(  x\right)  =y$ (in other
words, every element of $Y$ is a value of $f$);
\par
\item \emph{bijective} if it is both injective and surjective.
\end{itemize}
\par
It is easy to see that a map is bijective if and only if it is invertible
(i.e., has an inverse).
\par
The word \textquotedblleft\emph{bijection}\textquotedblright\ is a shorthand
for \textquotedblleft bijective map\textquotedblright. Likewise, the word
\textquotedblleft\emph{injection}\textquotedblright\ is a shorthand for
\textquotedblleft injective map\textquotedblright, whereas the word
\textquotedblleft\emph{surjection}\textquotedblright\ is a shorthand for
\textquotedblleft surjective map\textquotedblright.
\par
Bijections are also known as \emph{one-to-one correspondences} or as
\emph{1-to-1 correspondences}. The elements of a set $X$ are said to be
\emph{in bijection with} (or \emph{in one-to-one correspondence with}) the
elements of a set $Y$ if there exists a bijection from $X$ to $Y$.}. Thus,
what we have used is the fact that if there is a bijection between two sets,
then these two sets have the same size. Let us state this a little bit more explicitly:

\begin{theorem}
[The bijection principle]\label{thm.bij-rule}If $X$ and $Y$ are two sets, and
if $f:X\rightarrow Y$ is a bijection (i.e., a bijective map), then
\begin{equation}
\left\vert X\right\vert =\left\vert Y\right\vert .
\label{eq.thm.bij-rule.sizes-equal}%
\end{equation}

\end{theorem}

We have not required $X$ and $Y$ to be finite in Theorem \ref{thm.bij-rule}.
The size of an infinite set is a well-defined notion in mathematics (more
commonly known as \emph{cardinality}); see, e.g., \cite[\S 8.1]{LeLeMe16} for
an introduction to this or \cite[Chapter 9]{Newste19} for a more in-depth
treatment. We will only use Theorem \ref{thm.bij-rule} in the case when at
least one of the sets $X$ and $Y$ is known to be finite (in which case its
size is a nonnegative integer). In this case, Theorem \ref{thm.bij-rule}
automatically yields that \textbf{both} sets $X$ and $Y$ are finite, and have
equal size.

Theorem \ref{thm.bij-rule} is known as the \emph{bijection principle} or the
\emph{bijection rule}, and is sufficiently basic that some authors consider it
part of the definition of the cardinality of a set; we are not going to
reference it explicitly every time we use it. But just this one time, let us
do so, and while at that, also formalize the definition of the
\textquotedblleft flip\textquotedblright\ operation that was used in our proof
of Proposition \ref{prop.domino.symm}:

\begin{fineprint}
\begin{proof}
[Proof of Proposition \ref{prop.domino.symm} (detailed version).]Define the
map%
\begin{align*}
F:R_{n,m}  &  \rightarrow R_{m,n},\\
\left(  i,j\right)   &  \mapsto\left(  j,i\right)  .
\end{align*}
(This notation is saying \textquotedblleft the map $F$ from $R_{n,m}$ to
$R_{m,n}$ that sends each element $\left(  i,j\right)  $ of $R_{n,m}$ to the
element $\left(  j,i\right)  $ of $R_{m,n}$\textquotedblright. To see why this
map is well-defined, just recall that $R_{n,m}=\left[  n\right]  \times\left[
m\right]  $ and $R_{m,n}=\left[  m\right]  \times\left[  n\right]  $, which is
why $\left(  i,j\right)  \in R_{n,m}$ will always lead to $\left(  j,i\right)
\in R_{m,n}$.)

Visually speaking, this map $F$ simply flips each square of the rectangle
$R_{n,m}$ across the line with equation $x=y$. This yields a square of the
rectangle $R_{m,n}$, of course. Thus, it is clear that the map $F$ is a
bijection. This can be proved rigorously as follows: The map%
\begin{align*}
G:R_{m,n}  &  \rightarrow R_{n,m},\\
\left(  i,j\right)   &  \mapsto\left(  j,i\right)
\end{align*}
is well-defined\footnote{This is proved in the same way as we showed that $F$
is well-defined.} and inverse to $F$\ \ \ \ \footnote{since $F\circ
G=\operatorname*{id}$ (because each $\left(  i,j\right)  \in R_{m,n}$
satisfies $\left(  F\circ G\right)  \left(  i,j\right)  =F\left(
\underbrace{G\left(  i,j\right)  }_{=\left(  j,i\right)  }\right)  =F\left(
j,i\right)  =\left(  i,j\right)  =\operatorname*{id}\left(  i,j\right)  $) and
$G\circ F=\operatorname*{id}$ (for similar reasons)}. Thus, the map $F$ is
invertible, i.e., is a bijection. Note that its inverse map $G$ was defined in
the same way as $F$, but simply with the roles of $n$ and $m$ interchanged.

The map $F$ is a bijection, but it is not the bijection that we are going to
apply Theorem \ref{thm.bij-rule} to. (If we applied Theorem \ref{thm.bij-rule}
to $f=F$, then we would conclude that $\left\vert R_{n,m}\right\vert
=\left\vert R_{m,n}\right\vert $, that is, $nm=mn$, which is reassuring but
not what we are trying to prove.)

The map $F$ merely flips the squares of $R_{n,m}$ across the $x=y$ line; we
want a map that flips domino tilings. Of course, to flip a domino tiling, we
have to flip each domino in it; and to flip a domino, we have to flip each
square in it. Thus, we define the following two maps:

\begin{itemize}
\item Define the map%
\begin{align*}
F_{\operatorname*{dom}}:\left\{  \text{dominos inside }R_{n,m}\right\}   &
\rightarrow\left\{  \text{dominos inside }R_{m,n}\right\}  ,\\
D  &  \mapsto\left\{  F\left(  d\right)  \ \mid\ d\in D\right\}  .
\end{align*}
(To spell this out: The map $F_{\operatorname*{dom}}$ sends each domino $D$ to
the domino $\left\{  F\left(  d\right)  \ \mid\ d\in D\right\}  $, which is
obtained from $D$ by flipping each square $d\in D$. In other words, it flips
each domino by applying the flip map $F$ to each square of the domino.)

It is easy to see that this map $F_{\operatorname*{dom}}$ is a bijection.
(Indeed, it has an inverse $G_{\operatorname*{dom}}$, which is defined in the
same way but with the roles of $n$ and $m$ interchanged.)

\item Define the map%
\begin{align*}
F_{\operatorname*{til}}:\left\{  \text{domino tilings of }R_{n,m}\right\}   &
\rightarrow\left\{  \text{domino tilings of }R_{m,n}\right\}  ,\\
T  &  \mapsto\left\{  F_{\operatorname*{dom}}\left(  D\right)  \ \mid\ D\in
T\right\}  .
\end{align*}
(To spell this out: The map $F_{\operatorname*{til}}$ sends each domino tiling
$T$ to the domino tiling $\left\{  F_{\operatorname*{dom}}\left(  D\right)
\ \mid\ D\in T\right\}  $, which is obtained from $T$ by flipping each domino
$D\in T$. In other words, it flips each domino tiling by applying the flip map
$F_{\operatorname*{dom}}$ to each domino of the tiling.)

It is easy to see that this map $F_{\operatorname*{til}}$ is a bijection.
(Indeed, it has an inverse $G_{\operatorname*{til}}$, which is defined in the
same way but with the roles of $n$ and $m$ interchanged.)
\end{itemize}

To be fully rigorous, we would have to check that these two maps
$F_{\operatorname*{dom}}$ and $F_{\operatorname*{til}}$ are well-defined
(i.e., that flipping a domino inside $R_{n,m}$ really results in a domino
inside $R_{m,n}$, and that flipping a domino tiling of $R_{n,m}$ really
results in a domino tiling of $R_{m,n}$), but this is intuitively clear, and
the formal proof can easily be constructed by just \textquotedblleft following
your nose\textquotedblright\footnote{For example: If $D$ is a horizontal
domino $\left\{  \left(  i,j\right)  ,\left(  i+1,j\right)  \right\}  $, then
flipping it yields the vertical domino $\left\{  \left(  j,i\right)  ,\left(
j,i+1\right)  \right\}  $. Likewise, flipping a vertical domino yields a
horizontal domino. Thus, flipping a domino yields a domino. (Note that this
would be false if our definition of dominos didn't have the symmetry built
in!)}, which is why we omit it.

Anyway, we now have constructed a map\newline$F_{\operatorname*{til}}:\left\{
\text{domino tilings of }R_{n,m}\right\}  \rightarrow\left\{  \text{domino
tilings of }R_{m,n}\right\}  $ and showed that it is a bijection. Hence,
(\ref{eq.thm.bij-rule.sizes-equal}) (applied to $X=\left\{  \text{domino
tilings of }R_{n,m}\right\}  $ and $Y=\left\{  \text{domino tilings of
}R_{m,n}\right\}  $ and $f=F_{\operatorname*{til}}$) shows that%
\begin{equation}
\left\vert \left\{  \text{domino tilings of }R_{n,m}\right\}  \right\vert
=\left\vert \left\{  \text{domino tilings of }R_{m,n}\right\}  \right\vert .
\label{pf.prop.domino.symm.at}%
\end{equation}
But the definition of $d_{n,m}$ yields%
\[
d_{n,m}=\left(  \text{\# of domino tilings of }R_{n,m}\right)  =\left\vert
\left\{  \text{domino tilings of }R_{n,m}\right\}  \right\vert .
\]
The same reasoning shows that%
\[
d_{m,n}=\left\vert \left\{  \text{domino tilings of }R_{m,n}\right\}
\right\vert .
\]
In view of the latter two equalities, we can rewrite
(\ref{pf.prop.domino.symm.at}) as $d_{n,m}=d_{m,n}$. Thus Proposition
\ref{prop.domino.symm} is proven.
\end{proof}
\end{fineprint}

For the sake of future use, we observe that Theorem \ref{thm.bij-rule} has a converse:

\begin{theorem}
\label{thm.bij-rule-conv}If $X$ and $Y$ are two sets of the same size (that
is, $\left\vert X\right\vert =\left\vert Y\right\vert $), then there exists a
bijection from $X$ to $Y$.
\end{theorem}

Again, this holds for infinite sets just as it does for finite ones, but we
will only use it for finite sets.

\subsubsection{The $m=1$ case}

Let us bite another piece off the problem:

\begin{proposition}
\label{prop.1.3}Assume that $m=1$ and that $n$ is even. Then, $d_{n,m}=1$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.1.3} (sketched).]We must show that there is
exactly one domino tiling of $R_{n,m}$. But this is visually obvious: The
rectangle $R_{n,m}$ has only one row, and this row has an even number of
squares, so we can cover it with horizontal dominos in only one way. Here is
how this domino tiling looks like:%
\[%
\begin{tabular}
[c]{|llll|ll|ll|lll|}\hline
\phantom{w} & \multicolumn{1}{l|}{\phantom{w}} & \phantom{w} &
\multicolumn{1}{l|}{\phantom{w}} & \phantom{w} & \phantom{w} & \phantom{w} &
\multicolumn{1}{l|}{\phantom{w}} &
\multicolumn{1}{|l|}{\phantom{aaaaaaa}$\cdots$\phantom{aaaaaaa}} &
\phantom{w} & \phantom{w}\\\cline{1-12}\cline{6-11}%
\end{tabular}
\ \ \ \ .
\]


\begin{fineprint}
This is not yet a rigorous proof, but it is fairly easy to turn it into one.
Rigorously speaking, the domino tiling we just described is\footnote{Pay
attention to where the set braces are! This is a set of sets of pairs of
numbers.}%
\begin{align}
&  \left\{  \left\{  \left(  1,1\right)  ,\left(  2,1\right)  \right\}
,\ \left\{  \left(  3,1\right)  ,\left(  4,1\right)  \right\}  ,\ \left\{
\left(  5,1\right)  ,\left(  6,1\right)  \right\}  ,\ \ldots,\ \left\{
\left(  n-1,1\right)  ,\left(  n,1\right)  \right\}  \right\} \nonumber\\
&  =\left\{  \left\{  \left(  2k-1,1\right)  ,\left(  2k,1\right)  \right\}
\ \mid\ k\in\left\{  1,2,\ldots,n/2\right\}  \right\}  .
\label{pf.prop.1.3.til}%
\end{align}
It is instantly clear that this is a domino tiling of $R_{n,m}$. In order to
show that this is the only domino tiling of $R_{n,m}$, we can let $T$ be any
domino tiling of $R_{n,m}$, and then argue as follows:

\begin{itemize}
\item The square $\left(  1,1\right)  $ must be contained in some domino
$A_{1}\in T$ (since $T$ is a domino tiling). This domino $A_{1}$ must be
either $\left\{  \left(  1,1\right)  ,\left(  2,1\right)  \right\}  $ or
$\left\{  \left(  0,1\right)  ,\left(  1,1\right)  \right\}  $ or $\left\{
\left(  1,1\right)  ,\left(  1,2\right)  \right\}  $ or $\left\{  \left(
1,0\right)  ,\left(  1,1\right)  \right\}  $ (since these are the only dominos
that contain $\left(  1,1\right)  $). But out of these four dominos, only
$\left\{  \left(  1,1\right)  ,\left(  2,1\right)  \right\}  $ is a subset of
$R_{n,m}$ (since $m=1$). Hence, $A_{1}$ must be the domino $\left\{  \left(
1,1\right)  ,\left(  2,1\right)  \right\}  $. Thus, $\left(  2,1\right)  $ is
also contained in $A_{1}$.

Now we know that our tiling $T$ looks like this:%
\[%
\begin{tabular}
[c]{|lllllllllll|}\hline
$A_{1}$ & \multicolumn{1}{l|}{$A_{1}$} & $?$ & $?$ & $?$ & $?$ & $?$ & $?$ &
$?\ \ ?\ \ ?\ \ ?\ \ ?\ \ ?\ \ ?\ \ \cdots\ \ ?\ \ ?\ \ ?\ \ ?\ \ ?\ \ ?\ \ ?$
& $?$ & $?$\\\cline{1-12}\cline{6-11}%
\end{tabular}
\]
(where we have labeled the leftmost two squares with \textquotedblleft$A_{1}%
$\textquotedblright\ to signify that they are contained in the domino $A_{1}$).

\item The square $\left(  3,1\right)  $ must be contained in some domino
$A_{2}\in T$. This domino $A_{2}$ must be either $\left\{  \left(  3,1\right)
,\left(  4,1\right)  \right\}  $ or $\left\{  \left(  2,1\right)  ,\left(
3,1\right)  \right\}  $ or $\left\{  \left(  3,1\right)  ,\left(  3,2\right)
\right\}  $ or $\left\{  \left(  3,0\right)  ,\left(  3,1\right)  \right\}  $
(since these are the only dominos that contain $\left(  3,1\right)  $). But
out of these four dominos, only $\left\{  \left(  3,1\right)  ,\left(
4,1\right)  \right\}  $ and $\left\{  \left(  2,1\right)  ,\left(  3,1\right)
\right\}  $ are subsets of $R_{n,m}$ (since $m=1$). Hence, $A_{2}$ must be
either $\left\{  \left(  3,1\right)  ,\left(  4,1\right)  \right\}  $ or
$\left\{  \left(  2,1\right)  ,\left(  3,1\right)  \right\}  $. But the
dominos in a domino tiling must be disjoint (by definition); hence, $A_{2}$
cannot be $\left\{  \left(  2,1\right)  ,\left(  3,1\right)  \right\}  $
(because if $A_{2}$ was $\left\{  \left(  2,1\right)  ,\left(  3,1\right)
\right\}  $, then it would fail to be disjoint from $A_{1}=\left\{  \left(
1,1\right)  ,\left(  2,1\right)  \right\}  $). Thus, $A_{2}$ must be $\left\{
\left(  3,1\right)  ,\left(  4,1\right)  \right\}  $. Hence, $\left(
4,1\right)  $ is also contained in $A_{2}$.

Now we know that our tiling $T$ looks like this:%
\[%
\begin{tabular}
[c]{|lllllllllll|}\hline
$A_{1}$ & \multicolumn{1}{l|}{$A_{1}$} & $A_{2}$ & \multicolumn{1}{l|}{$A_{2}%
$} & $?$ & $?$ & $?$ & $?$ & $?\ \ ?\ \ ?\ ?\ ?\ ?\ ?\ \ \cdots
\ \ ?\ \ ?\ \ ?\ \ ?\ \ ?\ \ ?\ \ ?$ & $?$ & $?$\\\cline{1-12}\cline{3-4}%
\cline{6-11}%
\end{tabular}
\
\]


\item The square $\left(  5,1\right)  $ must be contained in some domino
$A_{3}\in T$. This domino $A_{3}$ must be either $\left\{  \left(  5,1\right)
,\left(  6,1\right)  \right\}  $ or $\left\{  \left(  4,1\right)  ,\left(
5,1\right)  \right\}  $ or $\left\{  \left(  5,1\right)  ,\left(  5,2\right)
\right\}  $ or $\left\{  \left(  5,0\right)  ,\left(  5,1\right)  \right\}  $
(since these are the only dominos that contain $\left(  5,1\right)  $). But
out of these four dominos, only $\left\{  \left(  5,1\right)  ,\left(
6,1\right)  \right\}  $ and $\left\{  \left(  4,1\right)  ,\left(  5,1\right)
\right\}  $ are subsets of $R_{n,m}$ (since $m=1$). Hence, $A_{3}$ must be
either $\left\{  \left(  5,1\right)  ,\left(  6,1\right)  \right\}  $ or
$\left\{  \left(  4,1\right)  ,\left(  5,1\right)  \right\}  $. But the
dominos in a domino tiling must be disjoint (by definition); hence, $A_{3}$
cannot be $\left\{  \left(  4,1\right)  ,\left(  5,1\right)  \right\}  $
(because if $A_{3}$ was $\left\{  \left(  4,1\right)  ,\left(  5,1\right)
\right\}  $, then it would fail to be disjoint from $A_{2}=\left\{  \left(
3,1\right)  ,\left(  4,1\right)  \right\}  $). Thus, $A_{3}$ must be $\left\{
\left(  5,1\right)  ,\left(  6,1\right)  \right\}  $. Hence, $\left(
6,1\right)  $ is also contained in $A_{3}$.

Now we know that our tiling $T$ looks like this:%
\[%
\begin{tabular}
[c]{|lllllllllll|}\hline
$A_{1}$ & \multicolumn{1}{l|}{$A_{1}$} & $A_{2}$ & \multicolumn{1}{l|}{$A_{2}%
$} & $A_{3}$ & \multicolumn{1}{l|}{$A_{3}$} & $?$ & $?$ &
$?\ ?\ ?\ ?\ ?\ ?\ ?\ \ \cdots\ \ ?\ ?\ ?\ \ ?\ \ ?\ \ ?\ \ ?$ & $?$ &
$?$\\\cline{1-12}\cline{3-11}%
\end{tabular}
\
\]

\end{itemize}

\noindent$\ldots$ and so on, proceeding further and further right until you
hit the \textquotedblleft eastern wall\textquotedblright\ of $R_{n,m}$ (that
is, the square $\left(  n,1\right)  $). Thus, the dominos appearing in $T$ are
uniquely determined: They must be $A_{1}=\left\{  \left(  1,1\right)  ,\left(
2,1\right)  \right\}  $, $A_{2}=\left\{  \left(  3,1\right)  ,\left(
4,1\right)  \right\}  $, $A_{3}=\left\{  \left(  5,1\right)  ,\left(
6,1\right)  \right\}  $ and so on. This is precisely the one tiling that we
presented in (\ref{pf.prop.1.3.til}). Thus, that one tiling is the only domino
tiling of $R_{n,m}$.

To be fully rigorous, this argument should be formalized as an induction proof
(feel free to do so!), but even if I wake you up at night, you will know how
to construct this argument if necessary, because the idea behind it is
glaringly obvious (just walk the rectangle $R_{n,m}$ from its western wall to
its eastern wall, and observe that at each step, there is only one possible
domino that fits in the rectangle without overlapping with the previous domino).
\end{fineprint}
\end{proof}

\subsubsection{The $m=2$ case and Fibonacci numbers}

Between Proposition \ref{prop.1.1} and Proposition \ref{prop.1.3}, we have
fully covered the case $m=1$ of our problem. Let us now move on to the case
$m=2$. We compute $d_{n,m}=d_{n,2}$ for some small values of $n$ simply by
listing all domino tilings of $R_{n,m}$:%
\[%
\begin{tabular}
[c]{|c|c|l|}\hline
$n$ & $d_{n,m}$ & domino tilings\\\hline\hline
$0$ & $d_{0,2}=1$ &
\begin{tabular}
[c]{|l}%
\phantom{w}\\
\phantom{w}
\end{tabular}
\\\hline
$1$ & $d_{1,2}=1$ &
\begin{tabular}
[c]{|l|}\hline
\phantom{w}\\\cline{2-2}%
\phantom{w}\\\hline
\end{tabular}
\\\hline
$2$ & $d_{2,2}=2$ &
\begin{tabular}
[c]{|l|l|}\hline
\phantom{w} & \phantom{w}\\\cline{3-3}%
\phantom{w} & \phantom{w}\\\hline
\end{tabular}
\ \ \ $,\ \ \ $%
\begin{tabular}
[c]{|ll|}\hline
\phantom{w} & \phantom{w}\\\hline
\phantom{w} & \phantom{w}\\\hline
\end{tabular}
\\\hline
$3$ & $d_{3,2}=3$ & $%
\begin{tabular}
[c]{|l|l|l|}\hline
\phantom{w} & \phantom{w} & \phantom{w}\\\cline{4-4}%
\phantom{w} & \phantom{w} & \phantom{w}\\\hline
\end{tabular}
\ \ \ \ \ ,\ \ \
\begin{tabular}
[c]{|ll|l|}\hline
\phantom{w} & \phantom{w} & \phantom{w}\\\cline{1-2}%
\phantom{w} & \phantom{w} & \phantom{w}\\\hline
\end{tabular}
\ \ \ \ \ ,\ \ \
\begin{tabular}
[c]{|l|ll|}\hline
\multicolumn{1}{|l|}{\phantom{w}} & \phantom{w} & \phantom{w}\\\cline{2-3}%
\phantom{w} & \phantom{w} & \phantom{w}\\\hline
\end{tabular}
\ \ $\\\hline
$4$ & $d_{4,2}=5$ &
\begin{tabular}
[c]{|l|l|l|l|}\hline
\phantom{w} & \phantom{w} & \phantom{w} & \phantom{w}\\\cline{5-5}%
\phantom{w} & \phantom{w} & \phantom{w} & \phantom{w}\\\hline
\end{tabular}
\ \ \ ,\ \ \
\begin{tabular}
[c]{|ll|l|l|}\hline
\phantom{w} & \phantom{w} & \phantom{w} & \phantom{w}\\\cline{1-2}%
\phantom{w} & \phantom{w} & \phantom{w} & \phantom{w}\\\hline
\end{tabular}
\ \ \ ,\ \ \
\begin{tabular}
[c]{|l|ll|l|}\hline
\multicolumn{1}{|l|}{\phantom{w}} & \phantom{w} & \phantom{w} &
\phantom{w}\\\cline{2-3}%
\phantom{w} & \phantom{w} & \phantom{w} & \phantom{w}\\\hline
\end{tabular}
, $\vphantom{\dfrac{1}{\dfrac{1}{1}}}$\\
&  &
\begin{tabular}
[c]{|l|l|ll|}\hline
\phantom{w} & \phantom{w} & \phantom{w} & \phantom{w}\\\cline{3-4}%
\phantom{w} & \phantom{w} & \phantom{w} & \phantom{w}\\\hline
\end{tabular}
\ \ \ ,\ \ \
\begin{tabular}
[c]{|ll|ll|}\hline
\phantom{w} & \phantom{w} & \phantom{w} & \phantom{w}\\\cline{1-2}\cline{3-4}%
\phantom{w} & \phantom{w} & \phantom{w} & \phantom{w}\\\hline
\end{tabular}
$\vphantom{\dfrac{1}{\dfrac{1}{1}}}$\\\hline
\end{tabular}
\ \ \ \ .
\]
If the $n=0$ case confuses you, keep in mind that the rectangle $R_{0,2}$ is
the empty set (since $R_{0,2}=\underbrace{\left[  0\right]  }_{=\varnothing
}\times\left[  2\right]  =\varnothing\times\left[  2\right]  =\varnothing$)
and thus has exactly one domino tiling -- namely, the tiling that contains no
dominos (i.e., the empty set).

Can you find $d_{5,2}$?

Here is a quick way to the answer, at least as far as counting is concerned:

\begin{proposition}
\label{prop.1.4}For each integer $n\geq2$, we have $d_{n,2}=d_{n-1,2}%
+d_{n-2,2}$.
\end{proposition}

\begin{center}
\fbox{\textbf{Class of 2019-09-25}}
\end{center}

\begin{proof}
[Proof of Proposition \ref{prop.1.4} (sketched).]Let $n\geq2$ be an integer.
Consider the last\footnote{i.e., easternmost} column of $R_{n,2}$ (that is,
the set $\left\{  \left(  n,1\right)  ,\left(  n,2\right)  \right\}  $).

In any domino tiling $T$ of $R_{n,2}$, this last column is \textbf{either}
covered by $1$ vertical domino, \textbf{or} covered by (parts of) $2$
horizontal dominos.

In the former case, we shall call $T$ a \emph{type-1 tiling}; in the latter
case, we shall call $T$ a \emph{type-2 tiling}. Visually, these look as
follows:%
\[
\underbrace{\
\begin{tabular}
[c]{|c|l|}\hline
$???????????????$ & \phantom{w}\\\cline{3-3}%
$???????????????$ & \phantom{w}\\\hline
\end{tabular}
\ }_{\text{type-1 tiling}},\ \ \ \ \ \ \ \ \ \ \underbrace{\
\begin{tabular}
[c]{|l|ll|}\hline
$???????????????$ & \phantom{w} & \phantom{w}\\\cline{2-3}%
$???????????????$ & \phantom{w} & \phantom{w}\\\hline
\end{tabular}
\ }_{\text{type-2 tiling}}%
\]
(where the question marks mean an unknown arrangement of dominos).

Let us now analyze type-1 tilings. A type-1 tiling consists of the single
vertical domino $\left\{  \left(  n,1\right)  ,\left(  n,2\right)  \right\}  $
that covers its last column, and a bunch of dominos that cover all the
remaining $n-1$ columns. This latter bunch must thus be a domino tiling of
$R_{n-1,2}$. Thus, a type-1 tiling consists of the single vertical domino
$\left\{  \left(  n,1\right)  ,\left(  n,2\right)  \right\}  $ and an
arbitrary domino tiling of $R_{n-1,2}$. (Visually, this means that it looks as
follows: $\
\begin{tabular}
[c]{|c|l|}\hline
some domino & \phantom{w}\\\cline{3-3}%
tiling of $R_{n-1,2}$ & \phantom{w}\\\hline
\end{tabular}
\ $.) Hence,\footnote{When we say \textquotedblleft type-1
tiling\textquotedblright, we mean \textquotedblleft type-1 tiling of $R_{n,2}%
$\textquotedblright, of course. (The same will apply to \textquotedblleft
type-2 tiling\textquotedblright\ later on.)}%
\begin{align}
\left(  \text{\# of type-1 tilings}\right)   &  =\left(  \text{\# of domino
tilings of }R_{n-1,2}\right) \label{pf.prop.1.4.1}\\
&  =d_{n-1,2} \label{pf.prop.1.4.1b}%
\end{align}
(since $d_{n-1,2}$ was defined as the \# of domino tilings of $R_{n-1,2}$).

Let us next analyze type-2 tilings. In a type-2 tiling, the last column is
covered by (parts of) $2$ horizontal dominos. These $2$ dominos must extend to
the left (because there is no space for them to extend to the right), and thus
also cover the second-to-last column. Explicitly speaking, these $2$ dominos
must be $\left\{  \left(  n-1,1\right)  ,\left(  n,1\right)  \right\}  $ and
$\left\{  \left(  n-1,2\right)  ,\left(  n,2\right)  \right\}  $. All the
other dominos in the tiling must then cover the remaining $n-2$ columns, i.e.,
must form a domino tiling of $R_{n-2,2}$. Thus, a type-2 tiling consists of
the two horizontal dominos $\left\{  \left(  n-1,1\right)  ,\left(
n,1\right)  \right\}  $ and $\left\{  \left(  n-1,2\right)  ,\left(
n,2\right)  \right\}  $ and an arbitrary domino tiling of $R_{n-2,2}$.
(Visually, this means that it looks as follows:
\begin{tabular}
[c]{|l|ll|}\hline
some domino & \phantom{w} & \phantom{w}\\\cline{2-3}%
tiling of $R_{n-2,2}$ & \phantom{w} & \phantom{w}\\\hline
\end{tabular}
.) Hence,%
\begin{align}
\left(  \text{\# of type-2 tilings}\right)   &  =\left(  \text{\# of domino
tilings of }R_{n-2,2}\right) \label{pf.prop.1.4.2}\\
&  =d_{n-2,2} \label{pf.prop.1.4.2b}%
\end{align}
(since $d_{n-2,2}$ was defined as the \# of domino tilings of $R_{n-2,2}$).

Now, recall that each domino tiling of $R_{n,2}$ is either a type-1 tiling or
a type-2 tiling (but cannot be both at the same time). Hence,%
\begin{align}
&  \left(  \text{\# of domino tilings of }R_{n,2}\right) \nonumber\\
&  =\left(  \text{\# of type-1 tilings}\right)  +\left(  \text{\# of type-2
tilings}\right) \label{pf.prop.1.4.1+2}\\
&  =d_{n-1,2}+d_{n-2,2} \label{pf.prop.1.4.3}%
\end{align}
(by adding the equalities (\ref{pf.prop.1.4.1b}) and (\ref{pf.prop.1.4.2b})
together). Now, the definition of $d_{n,2}$ yields%
\[
d_{n,2}=\left(  \text{\# of domino tilings of }R_{n,2}\right)  =d_{n-1,2}%
+d_{n-2,2}%
\]
(by (\ref{pf.prop.1.4.3})). This proves Proposition \ref{prop.1.4}.
\end{proof}

\begin{fineprint}
Again, let us analyze what we have actually done in this proof:

\begin{enumerate}
\item The equality (\ref{pf.prop.1.4.1}) follows from the bijection principle.
Indeed, our argument for it boils down to the (easily established) fact that
there is a bijection%
\[
f:\left\{  \text{domino tilings of }R_{n-1,2}\right\}  \rightarrow\left\{
\text{type-1 tilings}\right\}
\]
(which takes any domino tiling of $R_{n-1,2}$, and adds the vertical domino
$\left\{  \left(  n,1\right)  ,\left(  n,2\right)  \right\}  $ to it). Once
you have convinced yourself of this fact, you can apply Theorem
\ref{thm.bij-rule} to $X=\left\{  \text{domino tilings of }R_{n-1,2}\right\}
$ and $Y=\left\{  \text{type-1 tilings}\right\}  $, and conclude that%
\[
\left\vert \left\{  \text{domino tilings of }R_{n-1,2}\right\}  \right\vert
=\left\vert \left\{  \text{type-1 tilings}\right\}  \right\vert .
\]
In other words, $\left(  \text{\# of domino tilings of }R_{n-1,2}\right)
=\left(  \text{\# of type-1 tilings}\right)  $. Thus, the equality
(\ref{pf.prop.1.4.1}) is proven. The equality (\ref{pf.prop.1.4.2}) is
obtained similarly.

\item The equality (\ref{pf.prop.1.4.1+2}) follows from the sum rule. Indeed,
the sets $\left\{  \text{type-1 tilings}\right\}  $ and $\left\{  \text{type-2
tilings}\right\}  $ are disjoint, and their union is the set $\left\{
\text{domino tilings of }R_{n,2}\right\}  $. Hence, Theorem \ref{thm.1.2}
(applied to $S=\left\{  \text{domino tilings of }R_{n,2}\right\}  $, $k=2$,
$S_{1}=\left\{  \text{type-1 tilings}\right\}  $ and $S_{2}=\left\{
\text{type-2 tilings}\right\}  $) yields%
\[
\left\vert \left\{  \text{domino tilings of }R_{n,2}\right\}  \right\vert
=\left\vert \left\{  \text{type-1 tilings}\right\}  \right\vert +\left\vert
\left\{  \text{type-2 tilings}\right\}  \right\vert .
\]
In other words,
\[
\left(  \text{\# of domino tilings of }R_{n,2}\right)  =\left(  \text{\# of
type-1 tilings}\right)  +\left(  \text{\# of type-2 tilings}\right)  .
\]
This proves (\ref{pf.prop.1.4.1+2}).
\end{enumerate}
\end{fineprint}

Proposition \ref{prop.1.4} lets us compute the numbers $d_{n,2}$ rather
easily, if we compute them in the appropriate order (i.e., start with
$d_{0,2}$ and $d_{1,2}$, then compute $d_{2,2}$, then compute $d_{3,2}$, then
compute $d_{4,2}$, and so on). For example, we get%
\begin{align*}
d_{5,2}  &  =\underbrace{d_{4,2}}_{=5}+\underbrace{d_{3,2}}_{=3}=5+3=8;\\
d_{6,2}  &  =\underbrace{d_{5,2}}_{=8}+\underbrace{d_{4,2}}_{=5}=8+5=13;\\
d_{7,2}  &  =\underbrace{d_{6,2}}_{=13}+\underbrace{d_{5,2}}_{=8}=13+8=21;\\
&  \ldots.
\end{align*}
But what if we want to compute (say) $d_{900,2}$ without having to first
compute all the previous numbers $d_{0,2},d_{1,2},\ldots,d_{899,2}$ ? Is there
an explicit formula?

Before we answer this question, let us forget for a moment about domino
tilings, and define the following sequence of integers:

\begin{definition}
\label{def.fib}The \emph{Fibonacci sequence} is the sequence $\left(
f_{0},f_{1},f_{2},\ldots\right)  $ of nonnegative integers defined recursively
by%
\[
f_{0}=0,\ \ \ \ \ \ \ \ \ \ f_{1}=1,\ \ \ \ \ \ \ \ \ \ \text{and}%
\ \ \ \ \ \ \ \ \ \ f_{n}=f_{n-1}+f_{n-2}\text{ for all }n\geq2.
\]

\end{definition}

This is a \emph{recursive definition} -- i.e., it tells us how to compute
$f_{n}$ assuming that the previous entries $f_{0},f_{1},\ldots,f_{n-1}$ of the
sequence are already known. Thus, if we want to compute $f_{5}$ using this
definition, we have to compute $f_{0},f_{1},f_{2},f_{3},f_{4}$ first. (Let us
do this: The definition yields $f_{0}=0$ and $f_{1}=1$ immediately.
Furthermore, setting $n=2$ in the equality $f_{n}=f_{n-1}+f_{n-2}$, we obtain
$f_{2}=\underbrace{f_{1}}_{=1}+\underbrace{f_{0}}_{=0}=1+0=1$. Next, setting
$n=3$ in the equality $f_{n}=f_{n-1}+f_{n-2}$, we obtain $f_{3}%
=\underbrace{f_{2}}_{=1}+\underbrace{f_{1}}_{=1}=1+1=2$. Likewise,
$f_{4}=\underbrace{f_{3}}_{=2}+\underbrace{f_{2}}_{=1}=2+1=3$. Likewise,
$f_{5}=\underbrace{f_{4}}_{=3}+\underbrace{f_{3}}_{=2}=5$.)

The entries $f_{n}$ of the Fibonacci sequence are called \emph{Fibonacci
numbers}. Here is a table of the first $10$ Fibonacci numbers:%
\[%
\begin{tabular}
[c]{|c||c|c|c|c|c|c|c|c|c|c|c}\hline
$n$ & $0$ & $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$ & $9$ &
$\ \ \ \ \ \ \cdots\ \ \ \ \ \ $\\\hline
$f_{n}$ & $0$ & $1$ & $1$ & $2$ & $3$ & $5$ & $8$ & $13$ & $21$ & $34$ &
$\ \ \ \ \ \ \cdots\ \ \ \ \ \ $\\\hline
\end{tabular}
\ \ \ \ \ .
\]


The Fibonacci sequence is famous -- just look at
\href{https://en.wikipedia.org/wiki/Fibonacci_number}{its Wikipedia page}! It
also has several books dedicated to it, such as Vorobiev's \cite{Vorobi02}
(although, to be fully honest, Vorobiev often uses it as a plug to pivot to
other mathematics); there is also \href{https://www.fq.math.ca}{a journal
called \textit{The Fibonacci Quarterly}} (again, however, its actual scope is
broader). Now, we can reduce our problem of computing $d_{n,2}$ to the problem
of computing Fibonacci numbers:

\begin{proposition}
\label{prop.1.5}We have $d_{n,2}=f_{n+1}$ for each $n\in\mathbb{N}$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.1.5} (informal version).]Here is the main idea
of the proof: We must show that the two sequences $\left(  d_{0,2}%
,d_{1,2},d_{2,2},d_{3,2},\ldots\right)  $ and $\left(  f_{1},f_{2},f_{3}%
,f_{4},\ldots\right)  $ are identical. Both of them have the property that
their first entries are $1$'s (that is, $d_{0,2}=1$ and $f_{1}=1$), their
second entries are $1$'s (that is, $d_{1,2}=1$ and $f_{2}=1$), and each of
their further entries equals the sum of the preceding two entries (because
Proposition \ref{prop.1.4} shows that the $d_{n,2}$ satisfy $d_{n,2}%
=d_{n-1,2}+d_{n-2,2}$, whereas the definition of Fibonacci numbers shows that
$f_{n+1}=f_{n}+f_{n-1}$). Thus, to put it in practical terms: Both sequences
start with the same two entries, and then are built out of these two entries
according to the same rule (namely, each further entry is the sum of the
preceding two entries). Hence, the two sequences must be the same. This proves
Proposition \ref{prop.1.5}.
\end{proof}

\begin{fineprint}
If you found this proof insufficiently rigorous, here is a formal version of
this argument:

\begin{proof}
[Proof of Proposition \ref{prop.1.5} (formal version).]We shall prove
Proposition \ref{prop.1.5} by strong induction on $n$.

A strong induction needs no induction base\footnote{See \cite[\S 2.8]%
{detnotes} for how strong induction works.}. Thus, we only do the induction step:

\textit{Induction step:} Let $m\in\mathbb{N}$. Assume (as the induction
hypothesis) that Proposition \ref{prop.1.5} holds for each $n<m$. We must
prove that Proposition \ref{prop.1.5} holds for $n=m$.

Our induction hypothesis says that Proposition \ref{prop.1.5} holds for each
$n<m$. In other words, we have%
\begin{equation}
d_{n,2}=f_{n+1}\ \ \ \ \ \ \ \ \ \ \text{for each }n\in\mathbb{N}\text{
satisfying }n<m. \label{pf.prop.1.5.IH}%
\end{equation}


Now, we must prove that Proposition \ref{prop.1.5} holds for $n=m$. In other
words, we must prove that $d_{m,2}=f_{m+1}$. If $m=0$, then this is true
(since $d_{0,2}=1=f_{1}=f_{0+1}$). If $m=1$, then this is also true (since
$d_{1,2}=1=f_{2}=f_{1+1}$). Hence, it remains to prove this in the case
$m\geq2$. So let us WLOG\footnote{\textquotedblleft WLOG\textquotedblright%
\ means \textquotedblleft without loss of generality\textquotedblright. We can
assume that $m\geq2$ without loss of generality, since we have already proven
our claim (that $d_{m,2}=f_{m+2}$) in all other cases.} assume that $m\geq2$.
Then, $m-2\in\mathbb{N}$. Hence, we can apply (\ref{pf.prop.1.5.IH}) to
$n=m-2$ (since $m-2<m$), and obtain $d_{m-2,2}=f_{\left(  m-2\right)
+1}=f_{m-1}$. Furthermore, $m-1\in\mathbb{N}$ (since $m\geq2\geq1$). Thus, we
can apply (\ref{pf.prop.1.5.IH}) to $n=m-1$ (since $m-1<m$), and obtain
$d_{m-1,2}=f_{\left(  m-1\right)  +1}=f_{m}$. However, Proposition
\ref{prop.1.4} (applied to $n=m$) shows that%
\[
d_{m,2}=\underbrace{d_{m-1,2}}_{=f_{m}}+\underbrace{d_{m-2,2}}_{=f_{m-1}%
}=f_{m}+f_{m-1}.
\]
Comparing this with%
\begin{align*}
f_{m+1}  &  =\underbrace{f_{\left(  m+1\right)  -1}}_{=f_{m}}%
+\underbrace{f_{\left(  m+1\right)  -2}}_{=f_{m-1}}\ \ \ \ \ \ \ \ \ \ \left(
\text{by the definition of the Fibonacci sequence}\right) \\
&  =f_{m}+f_{m-1},
\end{align*}
we obtain $d_{m,2}=f_{m+1}$. In other words, Proposition \ref{prop.1.5} holds
for $n=m$. This completes the induction step. Thus, Proposition \ref{prop.1.5}
is proven.
\end{proof}
\end{fineprint}

So we have identified our numbers $d_{n,2}$ as the famous Fibonacci numbers
$f_{n+1}$. Does this help us compute them directly? Yes, because there is a
famous formula for the Fibonacci numbers:

\begin{theorem}
[Binet's formula]\label{thm.1.6}For each $n\in\mathbb{N}$, we have%
\[
f_{n}=\dfrac{1}{\sqrt{5}}\left(  \varphi^{n}-\psi^{n}\right)  ,
\]
where
\[
\varphi=\dfrac{1+\sqrt{5}}{2}\approx1.618\ldots\ \ \ \ \ \ \ \ \ \ \text{and}%
\ \ \ \ \ \ \ \ \ \ \psi=\dfrac{1-\sqrt{5}}{2}\approx-0.618\ldots.
\]

\end{theorem}

A few words about this strange formula are in order. On its left hand side is
a nonnegative integer, $f_{n}$. On its right side is an expression involving
irrational numbers like $\sqrt{5}$ as well as minus signs. How could an
explicit formula for a sequence of nonnegative integers require irrational
numbers and subtraction?

Well, this is the price of asking for explicit formulas!

The numbers $\varphi$ and $\psi$ in Theorem \ref{thm.1.6} are known as the
\emph{golden ratios} (although usually only $\varphi$ is considered
\textquotedblleft the golden ratio\textquotedblright). They are the two roots
of the quadratic polynomial $x^{2}-x-1$, so they satisfy $\varphi^{2}%
=\varphi+1$ and $\psi^{2}=\psi+1$. If this looks like the Fibonacci recursion
$f_{n}=f_{n-1}+f_{n-2}$, don't be surprised! This is the reason why they show
up in the explicit formula for the Fibonacci numbers.

\medskip

\begin{fineprint}
How do you compute $f_{900}$ using Theorem \ref{thm.1.6}? You may be tempted
to just plug $n=900$ into the formula using your favorite computer algebra
system; but there is a subtlety involved: Since $\sqrt{5}$ is irrational, the
computer may try to work with approximate values, and then when you take
$n$-th powers, the rounding errors will blow up. You will probably not get an
integer as a result, and even if you try to round it to the nearest integer,
you may well get the wrong value! Such is the price of blindly trusting
floating-point arithmetic. Fortunately, $\sqrt{5}$ is an \emph{algebraic
number} (i.e., a root of a polynomial with rational coefficients), and this
means that it \textbf{is} possible to make \textbf{exact} computations with
it. You just need to restrict yourself to the \textquotedblleft$\sqrt{5}%
$-rationals\textquotedblright\ (i.e., the numbers of the form $a+b\sqrt{5}$
with $a,b\in\mathbb{Q}$), and instead of approximating them with decimals, you
just keep them in the $a+b\sqrt{5}$ form. It is easy to find rules for adding,
subtracting, multiplying and dividing $\sqrt{5}$-rationals by one
another\footnote{To wit:%
\begin{align*}
\left(  a+b\sqrt{5}\right)  +\left(  c+d\sqrt{5}\right)   &  =\left(
a+c\right)  +\left(  b+d\right)  \sqrt{5};\\
\left(  a+b\sqrt{5}\right)  -\left(  c+d\sqrt{5}\right)   &  =\left(
a-c\right)  +\left(  b-d\right)  \sqrt{5};\\
\left(  a+b\sqrt{5}\right)  \left(  c+d\sqrt{5}\right)   &  =\left(
ac+5bd\right)  +\left(  ad+bc\right)  \sqrt{5};\\
\dfrac{a+b\sqrt{5}}{c+d\sqrt{5}}  &  =\dfrac{\left(  a+b\sqrt{5}\right)
\left(  c-d\sqrt{5}\right)  }{\left(  c+d\sqrt{5}\right)  \left(  c-d\sqrt
{5}\right)  }=\dfrac{\left(  ac-5bd\right)  +\left(  bc-ad\right)  \sqrt{5}%
}{c^{2}-5d^{2}}.
\end{align*}
Note in particular the last equation: This is why they taught you to
rationalize denominators in high school!}; thus you don't need approximate
values. Using the
\href{https://en.wikipedia.org/wiki/Exponentiation_by_squaring}{\textquotedblleft
exponentiation by squaring\textquotedblright} trick, it is now easy to compute
very high powers of $\varphi$ and $\psi$, and then Theorem \ref{thm.1.6}
yields $f_{n}$. For example, a computer will readily tell you all the $188$
digits of $f_{900}$, the last six of which are $938800$; you would probably
have gotten these wrong if you relied on approximate computation.

Theorem \ref{thm.1.6} also gives a very easy answer to the question (which we
arguably haven't asked) how fast the Fibonacci numbers $f_{n}$ grow when $n$
gets large. Indeed, $\left\vert \psi\right\vert <1$, so that $\psi
^{n}\rightarrow0$ when $n\rightarrow\infty$. Hence, for high enough $n$, we
have $f_{n}\approx\dfrac{1}{\sqrt{5}}\varphi^{n}$. Of course, the sequence of
$\dfrac{1}{\sqrt{5}}\varphi^{n}$ for $n\in\mathbb{N}$ is a geometric sequence
with ratio $\varphi\approx1.618\ldots$, and grows exponentially. Thus, we see
that the Fibonacci numbers $f_{n}$ grow exponentially -- slower than the
powers of $2$ (since $1.618\ldots<2$), but still faster than any polynomial.
The Fibonacci number $f_{n}$ will have $\approx\left(  \log_{10}%
\varphi\right)  \cdot n\approx0.209\cdot n$ many digits.
\end{fineprint}

\medskip

Theorem \ref{thm.1.6} is easy to prove:

\begin{proof}
[Proof of Theorem \ref{thm.1.6} (sketched).]This can be proven by the same
argument that we used for Proposition \ref{prop.1.5}: We have to show that the
sequences $\left(  f_{0},f_{1},f_{2},\ldots\right)  $ and $\left(  \dfrac
{1}{\sqrt{5}}\left(  \varphi^{0}-\psi^{0}\right)  ,\dfrac{1}{\sqrt{5}}\left(
\varphi^{1}-\psi^{1}\right)  ,\dfrac{1}{\sqrt{5}}\left(  \varphi^{2}-\psi
^{2}\right)  ,\ldots\right)  $ are identical. Both of them have the property
that their first entries are $0$'s (this is easy to check), their second
entries are $1$'s (this is easy to check), and each of their further entries
equals the sum of the preceding two entries\footnote{Indeed, for the Fibonacci
sequence $\left(  f_{0},f_{1},f_{2},\ldots\right)  $, this is clear. For the
second sequence, this boils down to proving the identity%
\[
\dfrac{1}{\sqrt{5}}\left(  \varphi^{n}-\psi^{n}\right)  =\dfrac{1}{\sqrt{5}%
}\left(  \varphi^{n-1}-\psi^{n-1}\right)  +\dfrac{1}{\sqrt{5}}\left(
\varphi^{n-2}-\psi^{n-2}\right)  ,
\]
which however follows by subtracting the two easily verified identities%
\[
\varphi^{n}=\varphi^{n-1}+\varphi^{n-2}\ \ \ \ \ \ \ \ \ \ \text{and}%
\ \ \ \ \ \ \ \ \ \ \psi^{n}=\psi^{n-1}+\psi^{n-2}%
\]
and dividing the result by $\sqrt{5}$.}. Thus, both sequences start with the
same two entries, and then are built out of these two entries according to the
same rule. Hence, the two sequences must be the same. This proves Theorem
\ref{thm.1.6}.
\end{proof}

This proof should convince you that Theorem \ref{thm.1.6} holds, but does not
explain how you could have come up with Theorem \ref{thm.1.6}. If time allows,
we will later explain this when we explore the concept of \textit{generating
functions}.

\subsubsection{Kasteleyn's formula (teaser)}

Now we have computed $d_{n,2}$ for each $n\in\mathbb{N}$. What about $d_{n,3}$ ?

Proposition \ref{prop.1.1} shows that $d_{n,3}=0$ when $n$ is odd. But
computing $d_{n,3}$ when $n$ is even is a lot harder. You might try to find a
recursive formula such as Proposition \ref{prop.1.4}, but this isn't so easy
any more. You can still try to separate the domino tilings of $R_{n,3}$ into
types according to how the last column looks like; however, there will be
three of these types now, and two of them will not fall into a 1-to-1
correspondence with domino tilings of a smaller rectangle. For example,
consider the following domino tiling of $R_{6,3}$:%
\[%
\begin{tabular}
[c]{|cccccc|}\hline
\multicolumn{1}{|c|}{\phantom{w}} & \phantom{w} &
\multicolumn{1}{c|}{\phantom{w}} & \phantom{w} &
\multicolumn{1}{c|}{\phantom{w}} & \phantom{w}\\\cline{2-5}\cline{4-5}%
\multicolumn{1}{|c|}{\phantom{w}} & \phantom{w} &
\multicolumn{1}{c|}{\phantom{w}} & \phantom{w} &
\multicolumn{1}{c|}{\phantom{w}} & \phantom{w}\\\hline
\phantom{w} & \multicolumn{1}{c|}{\phantom{w}} & \phantom{w} &
\multicolumn{1}{c|}{\phantom{w}} & \phantom{w} & \phantom{w}\\\hline
\end{tabular}
\ \ .
\]
There is no tiling of $R_{5,3}$ anywhere in it, nor of $R_{4,3}$, nor of
$R_{3,3}$, nor of $R_{2,3}$, nor of $R_{1,3}$. This thwarts our recursive approach.

Nevertheless, there \textbf{is} a nice recursion for $d_{n,3}$:

\begin{proposition}
\label{prop.domino.dn3}We have $d_{n,3}=4d_{n-2,3}-d_{n-4,3}$ for each
$n\geq4$.
\end{proposition}

As I said, there is no proof as easy as the one we gave for Proposition
\ref{prop.1.4}. We will later learn the technique of \textit{generating
functions}, which can be used to give a reasonably simple proof (see
\cite{Read80} or \cite[\S 3.12.3]{21s}); a tricky combinatorial proof also exists.

What about $d_{n,4}$ ? There is a recursion, too, according to \cite[\S 2]%
{Read80}:%
\[
d_{n,4}=d_{n-1,4}+5d_{n-2,4}+d_{n-3,4}-d_{n-4,4}.
\]
As you see, these are getting more complicated. In theory, recurrence
relations like these have explicit formulas like Binet's formula for $f_{n}$
(Theorem \ref{thm.1.6}). However, these formulas become more and more
complicated as well, and in particular they no longer involve
\textquotedblleft nice\textquotedblright\ irrational numbers like $\sqrt{5}$,
but rather roots of higher-degree polynomials, which at some point can no
longer be expressed using rational numbers, sums, differences, products,
quotients and radicals (i.e., $\sqrt[a]{b}$ terms)\footnote{The roots of a
quadratic polynomial $x^{2}+ax+b$ can be expressed in this way: They are
$\dfrac{-a\pm\sqrt{a^{2}-4b}}{2}$. The roots of a degree-$3$ or degree-$4$
polynomial can also be expressed in this way, using complicated formulas due
to Tartaglia, Ferrari, Cardano and Descartes. But the
\href{https://en.wikipedia.org/wiki/Abel-Ruffini_theorem}{\textit{Abel--Ruffini
theorem}} says that for $k\geq5$, there is no formula that expresses the roots
of a (general) degree-$k$ polynomial using only $+$, $-$, $\cdot$, $/$ and
$\sqrt{\ }$.}. This looks like a dead end.

In the 20th Century, however, theoretical physicists studying thermodynamics
got interested in computing $d_{n,m}$, as they considered a domino tiling to
be a (rather idealized) model for a liquid consisting of \textquotedblleft
dimers\textquotedblright\ (polymers that take up two adjacent sites in a
rectangular lattice; these are exactly our dominos). Even though the
$2$-dimensionality of a rectangle makes it a somewhat unrealistic
approximation for real-world liquids, it found its use as a model for the
adsorption of molecules on a surface (see \cite{Kastel61}). In 1961, Kasteleyn
found the following surprising formula for $d_{n,m}$:

\begin{theorem}
[Kasteleyn's formula]\label{thm.1.7}Assume that $m$ is even and $n\geq1$.
Then,%
\[
d_{n,m}=2^{mn/2}\prod_{j=1}^{m/2}\ \ \prod_{k=1}^{n}\sqrt{\left(  \cos
\dfrac{j\pi}{m+1}\right)  ^{2}+\left(  \cos\dfrac{k\pi}{n+1}\right)  ^{2}}.
\]
(Here, we are using the product sign $\prod$: That is, if $a_{1},a_{2}%
,\ldots,a_{p}$ are any numbers, then $\prod_{i=1}^{p}a_{i}$ means the product
$a_{1}a_{2}\cdots a_{p}$. The presence of two product signs directly following
one another means that we are taking a product of products.)
\end{theorem}

Actually, \textquotedblleft surprising\textquotedblright\ is an
understatement; why cosines of angles would appear in a formula for the
integer $d_{n,m}$ is even less transparent than why $\sqrt{5}$ should appear
in a formula for Fibonacci numbers!

We won't even get close to proving Theorem \ref{thm.1.7}. A proof outline
appears in \cite[Theorem 12.85]{Loehr-BC}, serving as a culmination of a
graduate-level combinatorics textbook. A more self-contained exposition of the
proof has been given by Stucky in \cite{Stucky15}, but even that is only
self-contained up to some advanced linear algebra (it requires a good
understanding of eigenvectors, Pfaffians and Kronecker products of matrices).

For all its seeming extravagance, Theorem \ref{thm.1.7} actually provides a
good way of computing $d_{n,m}$. Indeed, cosines like $\cos\dfrac{j\pi}{m+1}$
and $\cos\dfrac{k\pi}{n+1}$ are algebraic numbers that lend themselves to
exact computation (using cyclotomic polynomials -- a piece of abstract algebra
we are also not coming close to), and the scary-looking products don't scare a
good computer algebra system. For example, Kasteleyn's formula can be used to
show that $d_{8,8}=12\ 988\ 816$. This wouldn't be so easy to check by a brute
force search for domino tilings!

\begin{center}
\fbox{\textbf{Class of 2019-09-27}}
\end{center}

\subsubsection{Axisymmetric domino tilings}

Let us solve a few more counting exercises around domino tilings.

\begin{exercise}
\label{exe.1.8}Let $n\in\mathbb{N}$. Say that a domino tiling $T$ of $R_{n,2}$
is \emph{axisymmetric} if reflecting it across the vertical axis of symmetry
of $R_{n,2}$ leaves it unchanged (i.e., for each domino $\left\{  \left(
i,j\right)  ,\left(  i^{\prime},j^{\prime}\right)  \right\}  \in T$, the
\textquotedblleft mirror domino\textquotedblright\ $\left\{  \left(
n+1-i,j\right)  ,\left(  n+1-i^{\prime},j^{\prime}\right)  \right\}  $ also
belongs to $T$).

For example, the tilings%
\[%
\begin{tabular}
[c]{|l|ll|l|c|}\hline
\phantom{w} & \phantom{w} & \phantom{w} & \phantom{w} &
\phantom{w}\\\cline{2-3}%
\phantom{w} & \phantom{w} & \phantom{w} & \phantom{w} & \phantom{w}\\\hline
\end{tabular}
\ \ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \
\begin{tabular}
[c]{|l|lll|c|}\hline
\multicolumn{1}{|l|}{\phantom{w}} & \multicolumn{1}{|l|}{\phantom{w}} &
\phantom{w} & \phantom{w} & \phantom{w}\\\cline{3-4}%
\phantom{w} & \multicolumn{1}{|l|}{\phantom{w}} & \phantom{w} & \phantom{w} &
\phantom{w}\\\hline
\end{tabular}
\
\]
are not axisymmetric (indeed, reflecting them across the vertical line
transforms them into one another, and they are not the same), but the tilings%
\[%
\begin{tabular}
[c]{|l|l|l|l|c|}\hline
\phantom{w} & \phantom{w} & \phantom{w} & \phantom{w} &
\phantom{w}\\\cline{6-6}%
\phantom{w} & \phantom{w} & \phantom{w} & \phantom{w} & \phantom{w}\\\hline
\end{tabular}
\ \ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \
\begin{tabular}
[c]{|clllc|}\hline
\phantom{w} & \multicolumn{1}{l|}{\phantom{w}} &
\multicolumn{1}{l|}{\phantom{w}} & \phantom{w} & \phantom{w}\\\cline{1-2}%
\cline{4-5}\cline{4-6}%
\phantom{w} & \multicolumn{1}{l|}{\phantom{w}} &
\multicolumn{1}{l|}{\phantom{w}} & \phantom{w} & \phantom{w}\\\hline
\end{tabular}
\]
are axisymmetric.

How many axisymmetric domino tilings does $R_{n,2}$ have?
\end{exercise}

\begin{example}
Let us list the axisymmetric domino tilings for $R_{n,2}$ when $n$ is small:%
\[%
\begin{tabular}
[c]{|c|l|c|}\hline
$n$ & axisymmetric domino tilings & $%
\begin{array}
[c]{c}%
\text{their}\\
\text{number}%
\end{array}
$\\\hline\hline
$0$ &
\begin{tabular}
[c]{|l}%
\phantom{w}\\
\phantom{w}
\end{tabular}
& $1$\\\hline
$1$ &
\begin{tabular}
[c]{|l|}\hline
\phantom{w}\\\cline{2-2}%
\phantom{w}\\\hline
\end{tabular}
& $1$\\\hline
$2$ &
\begin{tabular}
[c]{|l|l|}\hline
\phantom{w} & \phantom{w}\\\cline{3-3}%
\phantom{w} & \phantom{w}\\\hline
\end{tabular}
\ \ \ $,\ \ \ $%
\begin{tabular}
[c]{|ll|}\hline
\phantom{w} & \phantom{w}\\\hline
\phantom{w} & \phantom{w}\\\hline
\end{tabular}
& $2$\\\hline
$3$ & $%
\begin{tabular}
[c]{|l|l|l|}\hline
\phantom{w} & \phantom{w} & \phantom{w}\\\cline{4-4}%
\phantom{w} & \phantom{w} & \phantom{w}\\\hline
\end{tabular}
\ \ $ & $1$\\\hline
$4$ &
\begin{tabular}
[c]{|l|l|l|l|}\hline
\phantom{w} & \phantom{w} & \phantom{w} & \phantom{w}\\\cline{5-5}%
\phantom{w} & \phantom{w} & \phantom{w} & \phantom{w}\\\hline
\end{tabular}
\ \ \ ,\ \ \
\begin{tabular}
[c]{|l|ll|l|}\hline
\multicolumn{1}{|l|}{\phantom{w}} & \phantom{w} & \phantom{w} &
\phantom{w}\\\cline{2-3}%
\phantom{w} & \phantom{w} & \phantom{w} & \phantom{w}\\\hline
\end{tabular}
\ \ \ ,\ \ \
\begin{tabular}
[c]{|ll|ll|}\hline
\phantom{w} & \phantom{w} & \phantom{w} & \phantom{w}\\\cline{1-2}\cline{3-4}%
\phantom{w} & \phantom{w} & \phantom{w} & \phantom{w}\\\hline
\end{tabular}
& $3$\\\hline
\end{tabular}
\ \ \ \ \ \ \ .
\]

\end{example}

\begin{proof}
[Solution sketch to Exercise \ref{exe.1.8}.]Let us only show the main steps; a
(more) detailed solution to Exercise \ref{exe.1.8} can be found in
\cite[Exercise 5]{17f-hw1s}.

There are two cases to consider: the case when $n$ is even, and the case when
$n$ is odd.

Let us first consider the case when $n$ is even. In this case, I claim that
any axisymmetric domino tiling of $R_{n,2}$ has one of the following two forms:

\begin{itemize}
\item \textbf{Form 1:} a domino tiling $J$ of $R_{n/2,2}$ covering the left
half of $R_{n,2}$, and its mirror image across the vertical axis covering the
right half:%
\[%
\begin{tabular}
[c]{|p{4cm}|p{4cm}|}\hline
domino tiling $J$ & mirror image\\\cline{3-3}%
of $R_{n/2,2}$ & of $J$\\\hline
\end{tabular}
\ \ \ \ \ \ .
\]
(Note that the vertical axis cuts through the middle of this picture.)

\item \textbf{Form 2:} a domino tiling $J$ of $R_{n/2-1,2}$ covering the
leftmost $n/2-1$ columns of $R_{n,2}$, and two horizontal dominos covering the
$\left(  n/2\right)  $-th and $\left(  n/2+1\right)  $-th columns\footnote{We
count columns from the left.}, and the mirror image of $J$ across the vertical
axis covering the rightmost $n/2-1$ columns of $R_{n,2}$:%
\[%
\begin{tabular}
[c]{|p{3.5cm}|cc|p{3.5cm}|}\hline
domino tiling $J$ & \phantom{w} & \multicolumn{1}{c|}{\phantom{w}} & mirror
image\\\cline{2-3}%
of $R_{n/2-1,2}$ & \phantom{w} & \multicolumn{1}{c|}{\phantom{w}} & of
$J$\\\hline
\end{tabular}
\ \ \ \ \ .
\]
(Again, the vertical axis cuts through the middle of this picture.)
\end{itemize}

\noindent If you agree with me that these are the only possible forms of an
axisymmetric domino tiling of $R_{n,2}$, then it follows (by the same logic as
in the proof of Proposition \ref{prop.1.4}) that the \# of axisymmetric domino
tilings of $R_{n,2}$ is%
\begin{align*}
&  \underbrace{\left(  \text{\# of domino tilings of }R_{n/2,2}\right)
}_{\substack{=d_{n/2,2}=f_{n/2+1}\\\text{(by Proposition \ref{prop.1.5},
applied to }n/2\\\text{instead of }n\text{)}}}+\underbrace{\left(  \text{\# of
domino tilings of }R_{n/2-1,2}\right)  }_{\substack{=d_{n/2-1,2}%
=f_{n/2}\\\text{(by Proposition \ref{prop.1.5}, applied to }%
n/2-1\\\text{instead of }n\text{)}}}\\
&  =f_{n/2+1}+f_{n/2}=f_{n/2+2}%
\end{align*}
(by the recursive definition of the Fibonacci numbers). But why are the
above-mentioned two forms the only possible forms of an axisymmetric domino
tiling of $R_{n,2}$ ?

To prove this, we fix an axisymmetric domino tiling $T$ of $R_{n,2}$. We must
show that $T$ has one of the above two forms. We can consider what dominos
cover the $\left(  n/2\right)  $-th column in $T$. If this column is covered
by one vertical domino, then no domino of $T$ straddles the vertical axis, and
thus the tiling $T$ has Form 1 (indeed, the part of $T$ to the right of the
vertical axis is a mirror image of the part to the left, since $T$ is
axisymmetric). It remains to deal with the case when the $\left(  n/2\right)
$-th column is covered by two horizontal dominos in $T$. The question is now
where these horizontal dominos fall. If both of them fall into columns $n/2-1$
and $n/2$, then our tiling $T$ has Form 1. If both of them fall into columns
$n/2$ and $n/2+1$, then our tiling $T$ has Form 2. What about the remaining
\textquotedblleft rogue\textquotedblright\ possibility, that one of them falls
into columns $n/2-1$ and $n/2$, while the other falls into columns $n/2$ and
$n/2+1$ ? Here is a picture (which assumes that the former domino is in the
top row and the latter domino is in the bottom row; but the argument will be
the same in the opposite case):%
\[%
\begin{tabular}
[c]{|lllll|}\hline
some dominos & \multicolumn{1}{|l}{\phantom{w}} &
\multicolumn{1}{l|}{\phantom{w}} & \phantom{w} & some further\\\cline{2-4}%
\cline{2-4}%
$\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $ & \phantom{w} &
\multicolumn{1}{|l}{\phantom{w}} & \multicolumn{1}{l|}{\phantom{w}} &
\ \ \ \ \ \ \ \ \ dominos$\ \ \ \ \ \ \ \ \ \ \ \ \ \ $\\\hline
\end{tabular}
\ \ \ \ \ .
\]
Note, however, that the part marked \textquotedblleft some
dominos\textquotedblright\ in this picture has an odd number of squares
(namely, $2\left(  n/2-1\right)  -1$ many squares), so that it cannot actually
be covered by dominos!\footnote{This is the same logic that we used to prove
Proposition \ref{prop.1.1}.} Thus, we obtain a contradiction. Hence, this
\textquotedblleft rogue\textquotedblright\ possibility is actually impossible.
This shows that every axisymmetric domino tiling $T$ of $R_{n,2}$ either has
Form 1 or has Form 2.

Thus, we have proved that the \# of axisymmetric domino tilings of $R_{n,2}$
is $f_{n/2+2}$ in the case when $n$ is even.

What about the case when $n$ is odd? In this case, I claim that any
axisymmetric domino tiling of $R_{n,2}$ has the following form:

\begin{itemize}
\item \textbf{Form 1:} a domino tiling $J$ of $R_{\left(  n-1\right)  /2,2}$
covering the leftmost $\left(  n-1\right)  /2$ columns of $R_{n,2}$, and one
vertical domino covering the $\left(  n+1\right)  /2$-th column, and the
mirror image of $J$ across the vertical axis covering the rightmost $\left(
n-1\right)  /2$ columns of $R_{n,2}$:%
\[%
\begin{tabular}
[c]{|p{3.5cm}|l|p{3.5cm}|}\hline
domino tiling $J$ & \phantom{w} & mirror image\\\cline{4-4}%
of $R_{\left(  n-1\right)  /2,2}$ & \phantom{w} & of $J$\\\hline
\end{tabular}
\ \ \ \ \ .
\]
(Again, the vertical axis cuts through the middle of this picture, which in
this case means cutting through the middle of the vertical domino.)
\end{itemize}

\noindent This time, there is no Form 2. Again, we need to prove that this is
the only possible form. This is even easier than in the previous case; the
main idea is the following: If an axisymmetric tiling $T$ of $R_{n,2}$
contained any horizontal domino that intersects its $\left(  n+1\right)
/2$-th column, then it would also contain the mirror image of this domino
across the vertical axis (since $T$ is axisymmetric), but then this domino and
its mirror image would be distinct but overlapping\footnote{They would overlap
in the $\left(  n+1\right)  /2$-th column.}, which would contradict the
definition of a domino tiling. Thus, the $\left(  n+1\right)  /2$-th column of
any axisymmetric tiling $T$ of $R_{n,2}$ must be covered by a vertical domino.
This shows that Form 1 is the only possible form.

Thus, when $n$ is odd, the \# of axisymmetric domino tilings of $R_{n,2}$
equals the \# of domino tilings of $R_{\left(  n-1\right)  /2,2}$, which (by
Proposition \ref{prop.1.5}) is $f_{\left(  n-1\right)  /2+1}=f_{\left(
n+1\right)  /2}$.

Thus, the general formula for the \# of axisymmetric domino tilings of
$R_{n,2}$ is:%
\[
\left(  \text{\# of axisymmetric domino tilings of }R_{n,2}\right)  =%
\begin{cases}
f_{n/2+2}, & \text{if }n\text{ is even};\\
f_{\left(  n+1\right)  /2}, & \text{if }n\text{ is odd}%
\end{cases}
.
\]
Exercise \ref{exe.1.8} is thus solved.
\end{proof}

\subsubsection{\label{subsect.intro.domino.k-brick}Tiling rectangles with
$k$-bricks}

Now, let us look at another related problem.

For the rest of Subsection \ref{subsect.intro.domino.k-brick}, fix a positive
integer $k$.

A $k$\emph{-brick} shall mean a $1\times k$-rectangle or a $k\times
1$-rectangle. More specifically: A \emph{vertical }$k$\emph{-brick} shall mean
a $1\times k$-rectangle (i.e., a set of the form%
\[
\left\{  \left(  i,j\right)  ,\left(  i,j+1\right)  ,\left(  i,j+2\right)
,\ldots,\left(  i,j+k-1\right)  \right\}
\]
for some $i,j\in\mathbb{Z}$); a \emph{horizontal }$k$\emph{-brick} shall mean
a $k\times1$-rectangle (i.e., a set of the form%
\[
\left\{  \left(  i,j\right)  ,\left(  i+1,j\right)  ,\left(  i+2,j\right)
,\ldots,\left(  i+k-1,j\right)  \right\}
\]
for some $i,j\in\mathbb{Z}$). Here is how they look like:%
\[
\underbrace{\ \
\begin{tabular}
[c]{|l|}\hline
$\vphantom{\dfrac{\dfrac{1}{1}}{\dfrac{1}{1}}}\phantom{w}$\\\hline
\end{tabular}
\ \ }_{\text{vertical }k\text{-brick}}\text{;}%
\ \ \ \ \ \ \ \ \ \ \underbrace{\ \
\begin{tabular}
[c]{|l|}\hline
$\phantom{wwwwwk}$\\\hline
\end{tabular}
\ \ }_{\text{horizontal }k\text{-brick}}\text{.}%
\]


If $S$ is a set of squares, then a $k$\emph{-brick tiling} of $S$ means a way
to cover the set $S$ with non-overlapping $k$-bricks (i.e., formally speaking:
a set of disjoint $k$-bricks whose union is $S$).

Thus, $k$-brick tilings are a generalization of domino tilings. More
specifically: If $k=2$, then $k$-bricks are the same as dominos, and thus
$k$-brick tilings are the same as domino tilings.

When does a rectangle $R_{n,m}$ have a $k$-brick tiling? The answer is
surprisingly simple:

\begin{proposition}
\label{prop.1.9}Let $n,m\in\mathbb{N}$, and let $k$ be a positive integer.
Then, the rectangle $R_{n,m}$ has a $k$-brick tiling if and only if we have
$k\mid m$ or $k\mid n$.
\end{proposition}

In the case when $k=2$, Proposition \ref{prop.1.9} says that the rectangle
$R_{n,m}$ has a domino tiling if and only if we have $2\mid m$ or $2\mid n$
(that is, at least one of the numbers $m$ and $n$ is even). This should not be
surprising: One direction of this equivalence (namely, the \textquotedblleft%
$\Longrightarrow$\textquotedblright\ direction: i.e., the direction saying
that if $R_{n,m}$ has a domino tiling, then at least one of $m$ and $n$ is
even) follows from Proposition \ref{prop.1.1}, whereas the other direction is
easy. We could use a similar argument to prove Proposition \ref{prop.1.9}
whenever the number $k$ is prime. Indeed, our proof of Proposition
\ref{prop.1.1} generalizes to show that if the rectangle $R_{n,m}$ has a
$k$-brick tiling, then $k\mid mn$. When $k$ is prime, the divisibility $k\mid
mn$ implies that $k\mid m$ or $k\mid n$; thus, the \textquotedblleft%
$\Longrightarrow$\textquotedblright\ direction of Proposition \ref{prop.1.9}
would follow immediately in this case. But when $k$ is not prime, we need a
better argument.

\begin{proof}
[Proof of Proposition \ref{prop.1.9}.]The claim we want to prove is an
\textquotedblleft if and only if\textquotedblright\ claim, so it has two
directions: the \textquotedblleft$\Longleftarrow$\textquotedblright\ direction
(also known as the \textquotedblleft if\textquotedblright\ direction), and the
\textquotedblleft$\Longrightarrow$\textquotedblright\ direction (also known as
the \textquotedblleft only if\textquotedblright\ direction). The former
direction claims that if we have $k\mid m$ or $k\mid n$, then the rectangle
$R_{n,m}$ has a $k$-brick tiling. The latter claims the converse of this statement.

We shall prove these two directions separately:

$\Longleftarrow:$ Assume that $k\mid m$ or $k\mid n$.

If $k\mid m$, then $R_{n,m}$ has a $k$-brick tiling consisting entirely of
vertical $k$-bricks. It looks as follows:%
\[%
\begin{tabular}
[c]{cccc}\cline{1-2}\cline{4-4}%
\multicolumn{1}{|c}{$\vphantom{\dfrac{\dfrac{1}{1}}{\dfrac{1}{1}}}\phantom{w}$%
} &
\multicolumn{1}{|c|}{$\vphantom{\dfrac{\dfrac{1}{1}}{\dfrac{1}{1}}}\phantom{w}$%
} & \multicolumn{1}{|c}{$\cdots$} &
\multicolumn{1}{|c|}{$\vphantom{\dfrac{\dfrac{1}{1}}{\dfrac{1}{1}}}\phantom{w}$%
}\\\cline{1-2}\cline{4-4}%
\multicolumn{1}{|c}{$\vphantom{\dfrac{\dfrac{1}{1}}{\dfrac{1}{1}}}\phantom{w}$%
} &
\multicolumn{1}{|c|}{$\vphantom{\dfrac{\dfrac{1}{1}}{\dfrac{1}{1}}}\phantom{w}$%
} & \multicolumn{1}{|c}{$\cdots$} &
\multicolumn{1}{|c|}{$\vphantom{\dfrac{\dfrac{1}{1}}{\dfrac{1}{1}}}\phantom{w}$%
}\\\cline{1-2}\cline{4-4}%
$\substack{\vdots\vspace{-0.4pc} \\ \vdots\vspace{0.4pc} }$ & $\substack
{\vdots\vspace{-0.4pc} \\ \vdots\vspace{0.4pc} }$ & $\ddots$ & $\substack
{\vdots\vspace{-0.4pc} \\ \vdots\vspace{0.4pc} }$\\\cline{1-2}\cline{4-4}%
\multicolumn{1}{|c}{$\vphantom{\dfrac{\dfrac{1}{1}}{\dfrac{1}{1}}}\phantom{w}$%
} &
\multicolumn{1}{|c}{$\vphantom{\dfrac{\dfrac{1}{1}}{\dfrac{1}{1}}}\phantom{w}$%
} & \multicolumn{1}{|c}{$\cdots$} &
\multicolumn{1}{|c|}{$\vphantom{\dfrac{\dfrac{1}{1}}{\dfrac{1}{1}}}\phantom{w}$%
}\\\cline{1-2}\cline{4-4}%
\end{tabular}
\]
(with each column being covered by $m/k$ many vertical $k$-bricks). Similarly,
if $k\mid n$, then $R_{n,m}$ has a $k$-brick tiling consisting entirely of
horizontal $k$-bricks. Thus, in either case, $R_{n,m}$ has a $k$-brick tiling.
This proves the \textquotedblleft$\Longleftarrow$\textquotedblright\ direction
of Proposition \ref{prop.1.9}.

$\Longrightarrow:$ Assume that the rectangle $R_{n,m}$ has a $k$-brick tiling.
We must prove that we have $k\mid m$ or $k\mid n$.

Assume the contrary (for the sake of contradiction). Thus, $k\nmid m$ and
$k\nmid n$.

We shall use the following notations from elementary number theory: If $a$ is
an integer and $b$ is a positive integer, then

\begin{itemize}
\item we let $a\sslash b$ denote the quotient obtained when dividing $a$ by
$b$ (in the sense of division with remainder);

\item we let $a\%b$ denote the remainder obtained when dividing $a$ by $b$.
\end{itemize}

Both of these numbers $a\sslash b$ and $a\%b$ are integers, and they satisfy
$0\leq a\%b<b$ and $a=\left(  a\sslash b\right)  \cdot b+\left(  a\%b\right)
$.

Let $r=n\%k$ and $s=m\%k$. We have $r=n\%k\neq0$ (since $k\nmid n$) and thus
$0<r<k$ (since $r$ is a remainder upon division by $k$). Likewise, $0<s<k$.

Now, we are going to color the squares of $R_{n,m}$ with $k$ colors. The $k$
colors we are going to use will be numbered $0,1,\ldots,k-1$. Each square
$\left(  i,j\right)  \in R_{n,m}$ will be colored with the color $\left(
i+j-2\right)  \%k$. Here is how this coloring looks like (in the example where
$k=4$, $n=10$ and $m=7$):%
\[%
\begin{tabular}
[c]{|cccccccccc|}\hline
$2$ & $3$ & $0$ & $1$ & $2$ & $3$ & $0$ & $1$ & $2$ & $3$\\\cline{11-11}%
$1$ & $2$ & $3$ & $0$ & $1$ & $2$ & $3$ & $0$ & $1$ & $2$\\\cline{11-11}%
$0$ & $1$ & $2$ & $3$ & $0$ & $1$ & $2$ & $3$ & $0$ & $1$\\\cline{11-11}%
$3$ & $0$ & $1$ & $2$ & $3$ & $0$ & $1$ & $2$ & $3$ & $0$\\\cline{11-11}%
$2$ & $3$ & $0$ & $1$ & $2$ & $3$ & $0$ & $1$ & $2$ & $3$\\\cline{11-11}%
$1$ & $2$ & $3$ & $0$ & $1$ & $2$ & $3$ & $0$ & $1$ & $2$\\\cline{11-11}%
$0$ & $1$ & $2$ & $3$ & $0$ & $1$ & $2$ & $3$ & $0$ & $1$\\\hline
\end{tabular}
\]
(where we have written the color of each square as a number into this square).
Note that if $k=2$, then there are two colors only, numbered $0$ and $1$; in
this case, our coloring is precisely the usual chessboard coloring (if we
regard color $0$ as black and color $1$ as white).

Let us make a few observations about our coloring:

\begin{itemize}
\item The southwesternmost square of $R_{n,m}$ is $\left(  1,1\right)  $, and
thus has color $\left(  1+1-2\right)  \%k=0\%k=0$.

\item As we move eastwards, the colors of the squares increase by $1$ at each
step, until they reach $k-1$, at which point they \textquotedblleft fall back
down\textquotedblright\ to $0$ at the next step.

\item The same happens as we move northwards.

\item Along each \textquotedblleft northwest-to-southeast\textquotedblright%
\ diagonal (i.e., each line with slope $-1$), the color stays constant.
\end{itemize}

Let us say that a finite set $S$ of squares is \emph{balanced} if it has
equally many squares of each color. In other words, a finite set $S$ of
squares is \emph{balanced} if and only if for any color $h\in\left\{
0,1,\ldots,k-1\right\}  $, the \# of all squares in $S$ that have color $h$
does not depend on $h$.

Each horizontal $k$-brick has exactly $1$ square of each color. Indeed, the
colors of the $k$ squares in a horizontal $k$-brick look as follows:%
\[%
\begin{tabular}
[c]{|llllllll|}\hline
$\phantom{1}u\phantom{1}$ & $u+1$ & $\cdots$ & $k-1$ &
$\phantom{1}0\phantom{1}$ & $\phantom{1}1\phantom{1}$ & $\cdots$ &
$u-1$\\\hline
\end{tabular}
\ \
\]
(where $u$ is the color of the leftmost square of the $k$-brick). Thus, each
horizontal $k$-brick is balanced. Likewise, each vertical $k$-brick is
balanced. Thus, we have shown that each $k$-brick is balanced.

But we have assumed that the rectangle $R_{n,m}$ has a $k$-brick tiling.
Hence, $R_{n,m}$ must, too, be balanced (by the sum rule)\footnote{Here is the
argument in details (albeit using the summation sign, which we won't properly
introduce until Definition \ref{def.sum.sigma-sign} below):
\par
We have assumed that the rectangle $R_{n,m}$ has a $k$-brick tiling. Let $T$
be this $k$-brick tiling. Write $T$ in the form $T=\left\{  S_{1},S_{2}%
,\ldots,S_{j}\right\}  $, where $S_{1},S_{2},\ldots,S_{j}$ are distinct
$k$-bricks. Hence, each square in $R_{n,m}$ belongs to exactly one of
$S_{1},S_{2},\ldots,S_{j}$. Moreover, each of the $k$-bricks $S_{1}%
,S_{2},\ldots,S_{j}$ is balanced (since each $k$-brick is balanced).
\par
Now, for each color $h\in\left\{  0,1,\ldots,k-1\right\}  $, we have%
\begin{align*}
&  \left(  \text{\# of all squares in }R_{n,m}\text{ that have color }h\right)
\\
&  =\left(  \text{\# of all squares in }R_{n,m}\text{ that belong to }%
S_{1}\text{ and have color }h\right) \\
&  \ \ \ \ \ \ \ \ \ \ +\left(  \text{\# of all squares in }R_{n,m}\text{ that
belong to }S_{2}\text{ and have color }h\right) \\
&  \ \ \ \ \ \ \ \ \ \ +\cdots\\
&  \ \ \ \ \ \ \ \ \ \ +\left(  \text{\# of all squares in }R_{n,m}\text{ that
belong to }S_{j}\text{ and have color }h\right) \\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by the sum rule, since each square in }R_{n,m}\\
\text{belongs to exactly one of }S_{1},S_{2},\ldots,S_{j}%
\end{array}
\right) \\
&  =\sum_{i=1}^{j}\underbrace{\left(  \text{\# of all squares in }%
R_{n,m}\text{ that belong to }S_{i}\text{ and have color }h\right)
}_{\substack{=\left(  \text{\# of all squares in }S_{i}\text{ that have color
}h\right)  \\\text{(since }S_{i}\subseteq R_{n,m}\text{)}}}\\
&  =\sum_{i=1}^{j}\underbrace{\left(  \text{\# of all squares in }S_{i}\text{
that have color }h\right)  }_{\substack{\text{independent of }h\\\text{(since
}S_{i}\text{ is balanced)}}}.
\end{align*}
Hence, for each $h\in\left\{  0,1,\ldots,k-1\right\}  $, the \# of all squares
in $R_{n,m}$ that have color $h$ is independent of $h$ (since it is a sum of
$j$ numbers that are each independent of $h$). In other words, $R_{n,m}$ is
balanced.}.

Let us now subdivide the rectangle $R_{n,m}$ into several (disjoint)
\emph{zones} $Z_{u,v}$ by cutting it with several lines\footnote{We will give
a rigorous definition further below.}. Namely, we cut it with horizontal lines
every $k$ squares (counted from the bottom), and with vertical lines every $k$
squares (counted from the left). Thus, we obtain the following subdivision of
$R_{n,m}$:%
\[%
\begin{tabular}
[c]{|c|c|c|c|}\hline
\multicolumn{1}{|c|}{$Z_{0,2}$} & \multicolumn{1}{|c|}{$Z_{1,2}$} &
\multicolumn{1}{|c|}{$Z_{2,2}$} & $Z_{3,2}$\\\hline
$\vphantom{\dfrac{\int^\int}{\int_\int}}\ \ \ Z_{0,1}%
\ \ \ \vphantom{\dfrac{\int^\int}{\int_\int}}$ & $Z_{1,1}$ & $Z_{2,1}$ &
$Z_{3,1}$\\\hline
$\vphantom{\dfrac{\int^\int}{\int_\int}}\ \ \ Z_{0,0}%
\ \ \ \vphantom{\dfrac{\int^\int}{\int_\int}}$ &
$\vphantom{\dfrac{\int^\int}{\int_\int}}\ \ \ Z_{1,0}%
\ \ \ \vphantom{\dfrac{\int^\int}{\int_\int}}$ &
$\vphantom{\dfrac{\int^\int}{\int_\int}}\ \ \ Z_{2,0}%
\ \ \ \vphantom{\dfrac{\int^\int}{\int_\int}}$ & $Z_{3,0}$\\\hline
\end{tabular}
\ \ .
\]


Formally speaking, our zones $Z_{u,v}$ are defined as follows:%
\begin{align*}
Z_{u,v}  &  =\left\{  \left(  i,j\right)  \in R_{n,m}\ \mid\ \left(
i-1\right)  \sslash k=u\text{ and }\left(  j-1\right)  \sslash k=v\right\} \\
&  \ \ \ \ \ \ \ \ \ \ \text{for all }u\in\left\{  0,1,\ldots,\left(
n-1\right)  \sslash k\right\}  \text{ and }v\in\left\{  0,1,\ldots,\left(
m-1\right)  \sslash k\right\}  .
\end{align*}


All these zones $Z_{u,v}$ are rectangles. More precisely: Let us call a zone
$Z_{u,v}$ (with $u\in\left\{  0,1,\ldots,\left(  n-1\right)
\sslash  k\right\}  $ and $v\in\left\{  0,1,\ldots,\left(  m-1\right)
\sslash  k\right\}  $)

\begin{itemize}
\item \emph{generic} if $u<\left(  n-1\right)  \sslash  k$ and $v<\left(
m-1\right)  \sslash  k$;

\item \emph{northern} if $u<\left(  n-1\right)  \sslash  k$ and $v=\left(
m-1\right)  \sslash  k$;

\item \emph{eastern} if $u=\left(  n-1\right)  \sslash  k$ and $v<\left(
m-1\right)  \sslash  k$;

\item \emph{northeastern} if $u=\left(  n-1\right)  \sslash
k$ and $v=\left(  m-1\right)  \sslash  k$.
\end{itemize}

\noindent Then,\footnote{Recall that $r=n\%k$ and $s=m\%k$.}

\begin{itemize}
\item each generic zone is a $k\times k$-rectangle;

\item each northern zone is a $k\times s$-rectangle;

\item each eastern zone is an $r\times k$-rectangle;

\item the northeastern zone is an $r\times s$-rectangle.
\end{itemize}

\noindent Note that all these zones are nonempty, since $r>0$ and $s>0$ and
$k>0$.

Each northern zone is a $k\times s$-rectangle, and thus can be tiled with
horizontal $k$-bricks; therefore it is balanced (since each $k$-brick is
balanced). Likewise, each eastern zone is balanced, and each generic zone is
balanced. Thus, summarizing, we have shown that each zone $Z$ except for the
northeastern zone is balanced. In other words, if $Z$ is a zone that is not
the northeastern zone, then, for any color $h\in\left\{  0,1,\ldots
,k-1\right\}  $,%
\begin{equation}
\text{the \# of all squares in }Z\text{ that have color }h\text{ is
independent of }h. \label{pf.prop.1.9.indep42}%
\end{equation}


But the zones are disjoint and their union is the whole rectangle $R_{n,m}$.
Hence, it follows that the northeastern zone is balanced as
well\footnote{\textit{Proof.} For any color $h\in\left\{  0,1,\ldots
,k-1\right\}  $, we have%
\begin{align*}
&  \left(  \text{\# of all squares in }R_{n,m}\text{ that have color }h\right)
\\
&  =\sum_{Z\text{ is a zone}}\left(  \text{\# of all squares in }Z\text{ that
have color }h\right) \\
&  =\left(  \text{\# of all squares in the northeastern zone that have color
}h\right) \\
&  \ \ \ \ \ \ \ \ \ \ +\sum_{\substack{Z\text{ is a zone;}\\Z\text{ is not
the northeastern zone}}}\left(  \text{\# of all squares in }Z\text{ that have
color }h\right)  ,
\end{align*}
so that%
\begin{align*}
&  \left(  \text{\# of all squares in the northeastern zone that have color
}h\right) \\
&  =\underbrace{\left(  \text{\# of all squares in }R_{n,m}\text{ that have
color }h\right)  }_{\substack{\text{independent of }h\\\text{(since }%
R_{n,m}\text{ is balanced)}}}\\
&  \ \ \ \ \ \ \ \ \ \ -\sum_{\substack{Z\text{ is a zone;}\\Z\text{ is not
the northeastern zone}}}\underbrace{\left(  \text{\# of all squares in
}Z\text{ that have color }h\right)  }_{\substack{\text{independent of
}h\\\text{(by (\ref{pf.prop.1.9.indep42}))}}},
\end{align*}
and thus the \# of all squares in the northeastern zone that have color $h$ is
independent of $h$. In other words, the northeastern zone is balanced.}.

But let us take a closer look at the northeastern zone. We denote this zone by
$\mathfrak{Z}$. This zone $\mathfrak{Z}$ is an $r\times s$-rectangle, and
(just as for any zone) its southwestern corner has color $0$. Thus, the colors
of its squares look as follows:%
\begin{equation}%
\begin{tabular}
[c]{|cccccc|}\hline
$\vphantom{\dfrac{1}{2}}s-1$ & $s$ & $\ast$ & $\cdots$ & $\ast$ & $\ast
$\\\cline{7-7}%
$\vphantom{\dfrac{1}{2}}s-2$ & $s-1$ & $\phantom{-}s\phantom{-}$ & $\cdots$ &
$\ast$ & $\ast$\\\cline{7-7}%
$\vphantom{\dfrac{1}{2}}\vdots$ & $\vdots$ & $\vdots$ & $\ddots$ & $\vdots$ &
$\vdots$\\\cline{7-7}%
$\vphantom{\dfrac{1}{2}}1$ & $2$ & $3$ & $\cdots$ & $r-1$ & $r$\\\cline{7-7}%
$\vphantom{\dfrac{1}{2}}0$ & $1$ & $2$ & $\cdots$ & $r-2$ & $r-1$\\\hline
\end{tabular}
\ \ \ \label{pf.prop.1.9.nezone}%
\end{equation}
(where each asterisk $\ast$ stands for some entry we don't need to know about).

We shall now show that this northeastern zone is \textbf{not} balanced. This
will give us a contradiction.

We WLOG assume that $s\leq r$ (since otherwise, the argument is
similar\footnote{More precisely, the same argument applies if we interchange
the roles of rows and columns.}). Recall that $0<r<k$ and $0<s<k$. From $0<s$,
we obtain $s\geq1$, so that $s-1\leq0$. Thus, $0\leq\underbrace{s}_{\leq
r}-1\leq r-1$. Therefore, each row of $\mathfrak{Z}$ contains at least one
square with color $s-1$. Since $\mathfrak{Z}$ has $s$ rows, we thus conclude
that
\begin{equation}
\mathfrak{Z}\text{ contains at least }s\text{ squares with color }s-1.
\label{pf.prop.1.9.Z1}%
\end{equation}
(We can easily see that $\mathfrak{Z}$ contains exactly $s$ squares with color
$s-1$, but we won't need this.)

On the other hand, the bottommost row of $\mathfrak{Z}$ only contains squares
with colors $0,1,\ldots,r-1$. Hence, it does not contain a square with color
$r$ (since $r>r-1$). But each row of $\mathfrak{Z}$ has width $r<k$, and thus
contains \textbf{at most} one square with color $r$ (because if it contained
two distinct squares with color $r$, then these two squares would be a
distance of $\geq k$ apart from one another, but the row only has width
$r<k$). So we know that the zone $\mathfrak{Z}$ has $s$ rows, one of which
(the bottommost one) contains no square with color $r$, while each of the
other $s-1$ rows contains \textbf{at most} one square with color $r$. Hence,
altogether,%
\begin{equation}
\mathfrak{Z}\text{ contains at most }s-1\text{ squares with color }r.
\label{pf.prop.1.9.Z2}%
\end{equation}
Comparing this with (\ref{pf.prop.1.9.Z1}), we conclude that the \# of squares
with color $r$ contained in $\mathfrak{Z}$ is different from the \# of squares
with color $s-1$ contained in $\mathfrak{Z}$ (since the former number is $\leq
s-1$, while the latter number is $\geq s$). Hence, $\mathfrak{Z}$ is not
balanced. In other words, the northeastern zone is not balanced (since
$\mathfrak{Z}$ is the northeastern zone). This contradicts the fact that the
northeastern zone is balanced. This contradiction shows that our assumption
was false. Hence, the \textquotedblleft$\Longrightarrow$\textquotedblright%
\ direction of Proposition \ref{prop.1.9} is proven.
\end{proof}

This was just a little taste of the theory of tilings of discrete (plane)
shapes. See the survey \cite{ArdSta10} by Ardila and Stanley for an
introduction to the varied questions and ideas of this theory. See also
\cite[Exercises 4 and 5]{18f-hw1s} and \cite[Exercises 1, 2, 3]{19f-hw1s} for
further exercises on counting tilings, and \cite[\S 5.1.5]{LeLeMe16} for a
neat exercise in proving existence of tilings. Furthermore, the book
\cite{BenQui03} by Benjamin and Quinn provides a lot of applications of
tilings to enumerative combinatorics, such as proofs of identities between
Fibonacci numbers using their domino-tiling interpretation (Proposition
\ref{prop.1.5})\footnote{To be more precise, Benjamin and Quinn work not with
domino tilings of $R_{n,2}$, but rather with \textquotedblleft
square-and-domino tilings\textquotedblright\ of $R_{n,1}$. These objects
behave just as domino tilings of $R_{n,2}$ do (there is an easy bijection
between the latter and the former), but are easier to argue about.}. (See
\cite{BenQui-fib} for a \textquotedblleft best-of\textquotedblright\ of sorts.)

\begin{center}
\fbox{\textbf{Class of 2019-09-30}}
\end{center}

\subsection{\label{sect.intro.powersums}Sums of powers}

\subsubsection{\label{subsect.intro.powersums.pow1}The sum $1+2+...+n$}

We now switch the subject and recall a famous result, known colloquially as
the \emph{\textquotedblleft Little Gauss\textquotedblright\ formula} due to
the anecdote of Gauss inventing it in primary school:\footnote{In truth, this
formula was known to the Ancient Greeks.}

\begin{theorem}
[\textquotedblleft Little Gauss\textquotedblright\ formula]\label{thm.1.10}Let
$n\in\mathbb{N}$. Then,
\[
1+2+\cdots+n=\dfrac{n\left(  n+1\right)  }{2}.
\]

\end{theorem}

Keep in mind that $0\in\mathbb{N}$ according to our conventions; thus, Theorem
\ref{thm.1.10} applies to $n=0$. And indeed, Theorem \ref{thm.1.10} holds for
$n=0$, since an \emph{empty sum} (i.e., a sum that consists of no addends) is
defined to be $0$, and thus we have%
\[
1+2+\cdots+n=1+2+\cdots+0=\left(  \text{empty sum}\right)  =0=\dfrac
{0\cdot\left(  0+1\right)  }{2}.
\]


\begin{proof}
[First proof of Theorem \ref{thm.1.10}.]Induction on $n$. The details are
completely straightforward and LTTR.

(The abbreviation \textquotedblleft LTTR\textquotedblright\ stands for
\textquotedblleft left to the reader\textquotedblright. I will usually leave
arguments to the reader when they are straightforward or easy variations of
arguments shown before.)
\end{proof}

\begin{proof}
[Second proof of Theorem \ref{thm.1.10}.]We observe the following fact: If
$a_{1},a_{2},\ldots,a_{n}$ are $n$ numbers (say, real numbers), and
$b_{1},b_{2},\ldots,b_{n}$ are $n$ further numbers, then%
\begin{align}
&  \left(  a_{1}+a_{2}+\cdots+a_{n}\right)  +\left(  b_{1}+b_{2}+\cdots
+b_{n}\right) \nonumber\\
&  =\left(  a_{1}+b_{1}\right)  +\left(  a_{2}+b_{2}\right)  +\cdots+\left(
a_{n}+b_{n}\right)  . \label{pf.thm.1.10.2nd.1}%
\end{align}
(Indeed, both sides of this equality are just two ways to add all the $2n$
numbers $a_{1},a_{2},\ldots,a_{n},b_{1},b_{2},\ldots,b_{n}$. This should
convince you that they are the same, although formally speaking, this is not a
proof. See Subsection \ref{subsect.intro.powersums.what} below for some
references to a formal proof.)

Now,
\begin{align*}
&  2\cdot\left(  1+2+\cdots+n\right) \\
&  =\left(  1+2+\cdots+n\right)  +\underbrace{\left(  1+2+\cdots+n\right)
}_{\substack{=n+\left(  n-1\right)  +\cdots+1\\\text{(here, we have just
reversed}\\\text{the order of summation)}}}\\
&  =\left(  1+2+\cdots+n\right)  +\left(  n+\left(  n-1\right)  +\cdots
+1\right) \\
&  =\left(  1+n\right)  +\left(  2+\left(  n-1\right)  \right)  +\cdots
+\left(  n+1\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{pf.thm.1.10.2nd.1}), applied to
}a_{i}=i\text{ and }b_{i}=n+1-i\right) \\
&  =\underbrace{\left(  n+1\right)  +\left(  n+1\right)  +\cdots+\left(
n+1\right)  }_{n\text{ many addends}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since each of the numbers }%
1+n,\ \ 2+\left(  n-1\right)  ,\ \ \ldots,\ \ n+1\text{ equals }n+1\right) \\
&  =n\left(  n+1\right)  .
\end{align*}
Dividing this equality by $2$, we obtain $1+2+\cdots+n=\dfrac{n\left(
n+1\right)  }{2}$. This proves Theorem \ref{thm.1.10} again.
\end{proof}

\begin{proof}
[Third proof of Theorem \ref{thm.1.10} (sketched).]Here is a picture proof
(drawn for the case $n=3$):%
\[%
\begin{tabular}
[c]{cccc}\hline
\multicolumn{1}{|c}{$\ast$} & $\ast$ & $\ast$ & \multicolumn{1}{|c|}{$\ast$%
}\\\cline{3-3}%
\multicolumn{1}{|c}{$\ast$} & $\ast$ & \multicolumn{1}{|c}{$\ast$} &
\multicolumn{1}{c|}{$\ast$}\\\cline{2-2}%
\multicolumn{1}{|c}{$\ast$} & \multicolumn{1}{|c}{$\ast$} & $\ast$ &
\multicolumn{1}{c|}{$\ast$}\\\hline
$\phantom{w}$ & $\phantom{w}$ & $\phantom{w}$ & $\phantom{w}$%
\end{tabular}
\ \ \quad.\ \vspace{-1.0152pc}%
\]
This is a $4\times3$-rectangle\footnote{We have put an asterisk into each
little square of the rectangle in order to make the squares easier to
discern.} (i.e., a rectangle of width $4$ and height $3$), subdivided into two
parts by a broken line which starts in the southwestern corner and winds its
way to the northeastern corner, making steps of length $1$ eastwards and
northwards (by turns). The two parts (the one below and the one above the
broken line) have the same area, since they are symmetric to each other with
respect to the center of the rectangle.\footnote{Note that \textquotedblleft
area\textquotedblright\ is normally a geometric concept, but since both parts
consist of full squares, we can redefine it combinatorially as the number of
squares in the respective part.} Hence, the area of either part equals half
the area of the whole rectangle. Since the area of the whole rectangle is
$3\cdot4$, we thus conclude that the area of either part equals $\dfrac
{3\cdot4}{2}$.

On the other hand, here is a different way to compute this area: Let us look
at the part below the broken line. This part has $0$ squares in the $1$-st
column\footnote{We count columns from the left.}, $1$ square in the $2$-nd
column, $2$ squares in the $3$-rd column, and $3$ squares in the $4$-th
column. Hence, in total, it has $0+1+2+3$ many squares. In other words, its
area is $0+1+2+3$.

Now we know that the area of the part of the rectangle below the broken line
is $0+1+2+3$, but we also know (from before) that it equals $\dfrac{3\cdot
4}{2}$. Hence, $0+1+2+3=\dfrac{3\cdot4}{2}$. In view of $0+1+2+3=1+2+3$, this
rewrites as $1+2+3=\dfrac{3\cdot4}{2}$. This is precisely the statement of
Theorem \ref{thm.1.10} for $n=3$.

The same argument (but using an $\left(  n+1\right)  \times n$-rectangle
instead of a $4\times3$-rectangle) proves Theorem \ref{thm.1.10} for arbitrary
$n$.

\medskip

\begin{fineprint}
How can we formalize this argument? Once again (as with domino tilings), it
makes sense to think of the $\left(  n+1\right)  \times n$-rectangle as the
finite set $\left[  n+1\right]  \times\left[  n\right]  $ (where, as before,
we set $\left[  k\right]  =\left\{  1,2,\ldots,k\right\}  $ for each
$k\in\mathbb{N}$) rather than a geometric shape in the real
plane.\footnote{Again, we let $\left(  i,j\right)  $ be the square in column
$i$ (counted from the left) and row $j$ (counted from the bottom).} The two
parts into which this rectangle is divided by the broken line become the two
sets%
\begin{align*}
A  &  :=\left\{  \left(  i,j\right)  \in\left[  n+1\right]  \times\left[
n\right]  \ \mid\ i\leq j\right\}  \ \ \ \ \ \ \ \ \ \ \text{and}\\
B  &  :=\left\{  \left(  i,j\right)  \in\left[  n+1\right]  \times\left[
n\right]  \ \mid\ i>j\right\}  .
\end{align*}
(The letters $A$ and $B$ here stand for \textquotedblleft
above\textquotedblright\ and \textquotedblleft below\textquotedblright.)

So let us redo this proof from scratch, using the combinatorial model (i.e.,
finite sets) throughout it. We consider the finite set $\left[  n+1\right]
\times\left[  n\right]  $, which (according to the product rule) has $\left(
n+1\right)  \cdot n=n\left(  n+1\right)  $ many elements. Define two subsets%
\begin{align*}
A  &  :=\left\{  \left(  i,j\right)  \in\left[  n+1\right]  \times\left[
n\right]  \ \mid\ i\leq j\right\}  \ \ \ \ \ \ \ \ \ \ \text{and}\\
B  &  :=\left\{  \left(  i,j\right)  \in\left[  n+1\right]  \times\left[
n\right]  \ \mid\ i>j\right\}
\end{align*}
of $\left[  n+1\right]  \times\left[  n\right]  $. These two subsets $A$ and
$B$ are disjoint (since no $\left(  i,j\right)  \in\left[  n+1\right]
\times\left[  n\right]  $ can satisfy $i\leq j$ and $i>j$ at the same time),
and their union is $\left[  n+1\right]  \times\left[  n\right]  $ (since each
$\left(  i,j\right)  \in\left[  n+1\right]  \times\left[  n\right]  $
satisfies either $i\leq j$ or $i>j$). Hence, the sum rule shows that
$\left\vert \left[  n+1\right]  \times\left[  n\right]  \right\vert
=\left\vert A\right\vert +\left\vert B\right\vert $, so that%
\begin{align}
\left\vert A\right\vert +\left\vert B\right\vert  &  =\left\vert \left[
n+1\right]  \times\left[  n\right]  \right\vert =\underbrace{\left\vert
\left[  n+1\right]  \right\vert }_{=n+1}\cdot\underbrace{\left\vert \left[
n\right]  \right\vert }_{=n}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{eq.thm.prodrule2.size})}\right) \nonumber\\
&  =\left(  n+1\right)  \cdot n=n\left(  n+1\right)  .
\label{pf.thm.1.10.3rd.4}%
\end{align}


On the other hand, the map%
\begin{align*}
A  &  \rightarrow B,\\
\left(  i,j\right)   &  \mapsto\left(  n+2-i,n+1-j\right)
\end{align*}
(which, visually, is just the reflection around the center of the $\left(
n+1\right)  \times n$-rectangle) is a bijection\footnote{This needs to be
proven, but the proof is really straightforward. First, you need to check that
this map is well-defined. This means showing that $\left(  n+2-i,n+1-j\right)
\in B$ for each $\left(  i,j\right)  \in A$. Once this is shown, you can show
the bijectivity of this map by explicitly constructing an inverse; namely, the
inverse is the map%
\begin{align*}
B  &  \rightarrow A,\\
\left(  i,j\right)   &  \mapsto\left(  n+2-i,n+1-j\right)  .
\end{align*}
(Don't be surprised that it is given by the same formula: In order to undo a
reflection around a point, you have to reflect again around the same point.)}.
Hence, the bijection rule yields $\left\vert A\right\vert =\left\vert
B\right\vert $. Thus, $\underbrace{\left\vert A\right\vert }_{=\left\vert
B\right\vert }+\left\vert B\right\vert =\left\vert B\right\vert +\left\vert
B\right\vert =2\cdot\left\vert B\right\vert $. Comparing this with
(\ref{pf.thm.1.10.3rd.4}), we obtain $2\cdot\left\vert B\right\vert =n\left(
n+1\right)  $, so that%
\begin{equation}
\left\vert B\right\vert =\dfrac{n\left(  n+1\right)  }{2}.
\label{pf.thm.1.10.3rd.count1}%
\end{equation}


On the other hand, let us count the squares in $B$ \textquotedblleft by
column\textquotedblright. Recall that, in our combinatorial model, the
x-coordinate $i$ of a square $\left(  i,j\right)  $ tells us which column it
belongs to. Thus, the squares $c\in B$ in the $k$-th column (for any given
$k\in\left\{  1,2,\ldots,n+1\right\}  $) are precisely the squares $c\in B$
that have x-coordinate $k$. Hence, we should count the squares in $B$
according to their x-coordinate. Formally speaking, this means applying the
sum rule to the set $B$ and its $n+1$ disjoint subsets $\left\{  c\in
B\ \mid\ c\text{ has x-coordinate }k\right\}  $ for $k\in\left\{
1,2,\ldots,n+1\right\}  $. These $n+1$ subsets are disjoint (since any square
$c\in B$ has only one x-coordinate) and their union is $B$ (since each square
$c\in B$ has x-coordinate $1$ or $2$ or $\cdots$ or $n+1$). Hence, the sum
rule yields%
\begin{align}
\left\vert B\right\vert  &  =\left\vert \left\{  c\in B\ \mid\ c\text{ has
x-coordinate }1\right\}  \right\vert +\left\vert \left\{  c\in B\ \mid
\ c\text{ has x-coordinate }2\right\}  \right\vert \nonumber\\
&  \ \ \ \ \ \ \ \ \ \ +\cdots+\left\vert \left\{  c\in B\ \mid\ c\text{ has
x-coordinate }n+1\right\}  \right\vert \nonumber\\
&  =\sum_{i=1}^{n+1}\left\vert \left\{  c\in B\ \mid\ c\text{ has x-coordinate
}i\right\}  \right\vert . \label{pf.thm.1.10.3rd.5}%
\end{align}
But the addends on the right hand side of this equality are easily
computed:\footnote{This is just the formalization of our (visually obvious)
observation that the part below the broken line (which we are now calling $B$)
has $0$ squares in the $1$-st column, $1$ square in the $2$-nd column, $2$
squares in the $3$-rd column, etc..} For each $i\in\left\{  1,2,\ldots
,n+1\right\}  $, we have%
\begin{align*}
&  \left\{  c\in B\ \mid\ c\text{ has x-coordinate }i\right\} \\
&  =\left\{  c\in B\ \mid\ c=\left(  i,j\right)  \text{ for some }j\in\left[
n\right]  \right\} \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since a square of }\left[  n+1\right]  \times\left[  n\right]  \text{
has x-coordinate }i\\
\text{if and only if it has the form }\left(  i,j\right)  \text{ for some
}j\in\left[  n\right]
\end{array}
\right) \\
&  =\left\{  \left(  i,j\right)  \ \mid\ j\in\left[  n\right]  \text{ such
that }\left(  i,j\right)  \in B\right\} \\
&  =\left\{  \left(  i,j\right)  \ \mid\ j\in\left[  n\right]  \text{ such
that }i>j\right\} \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since a square }\left(  i,j\right)  \in\left[  n+1\right]  \times\left[
n\right]  \text{ satisfies }\left(  i,j\right)  \in B\\
\text{if and only if }i>j\text{ (by the definition of }B\text{)}%
\end{array}
\right) \\
&  =\left\{  \left(  i,1\right)  ,\left(  i,2\right)  ,\ldots,\left(
i,i-1\right)  \right\}
\end{align*}
and thus%
\begin{align}
\left\vert \left\{  c\in B\ \mid\ c\text{ has x-coordinate }i\right\}
\right\vert  &  =\left\vert \left\{  \left(  i,1\right)  ,\left(  i,2\right)
,\ldots,\left(  i,i-1\right)  \right\}  \right\vert \nonumber\\
&  =i-1. \label{pf.thm.1.10.3rd.6}%
\end{align}
Hence, (\ref{pf.thm.1.10.3rd.5}) becomes%
\begin{align*}
\left\vert B\right\vert  &  =\sum_{i=1}^{n+1}\underbrace{\left\vert \left\{
c\in B\ \mid\ c\text{ has x-coordinate }i\right\}  \right\vert }%
_{\substack{=i-1\\\text{(by (\ref{pf.thm.1.10.3rd.6}))}}}\\
&  =\sum_{i=1}^{n+1}\left(  i-1\right)  =0+1+2+\cdots+n=1+2+\cdots+n.
\end{align*}
Comparing this with (\ref{pf.thm.1.10.3rd.count1}), we obtain $1+2+\cdots
+n=\dfrac{n\left(  n+1\right)  }{2}$. This finally completes our formalized
picture proof of Theorem \ref{thm.1.10}.

The moral of the story: A picture is worth a thousand words!
\end{fineprint}
\end{proof}

\subsubsection{\label{subsect.intro.powersums.what}What is a sum, actually?}

Throughout Subsection \ref{subsect.intro.powersums.pow1}, we have been freely
working with expressions like $1+2+\cdots+n$ and (more generally) $a_{1}%
+a_{2}+\cdots+a_{n}$, where $a_{1},a_{2},\ldots,a_{n}$ are $n$ numbers.
Looking back, you might wonder: Why are these expressions well-defined? How is
\textquotedblleft the sum of $n$ numbers\textquotedblright\ defined to begin with?

Let me explain what I mean by this. Let \textquotedblleft
number\textquotedblright\ mean \textquotedblleft rational
number\textquotedblright, just to be specific here (although the same question
and the same answer apply to integers, real numbers and complex numbers). I
assume you know what the sum of \textbf{two} numbers is. Even when two numbers
$a$ and $b$ are given without specifying their order, their sum is
well-defined, because the \emph{commutativity of addition} (i.e., the rule
saying that $a+b=b+a$ for any two numbers $a$ and $b$) guarantees that the two
possible ways of adding them together yield the same result.

Now, suppose you are given \textbf{three} numbers $a$, $b$ and $c$. To add
them all together means to add two of them and then add the third one to the
result. How many ways are there to do this? There are $12$, as you can easily
check, namely%
\begin{align*}
&  \left(  a+b\right)  +c,\ \ \ \ \ \ \ \ \ \ \left(  a+c\right)
+b,\ \ \ \ \ \ \ \ \ \ \left(  b+a\right)  +c,\ \ \ \ \ \ \ \ \ \ \left(
b+c\right)  +a,\\
&  \left(  c+a\right)  +b,\ \ \ \ \ \ \ \ \ \ \left(  c+b\right)
+a,\ \ \ \ \ \ \ \ \ \ a+\left(  b+c\right)  ,\ \ \ \ \ \ \ \ \ \ a+\left(
c+b\right)  ,\\
&  b+\left(  a+c\right)  ,\ \ \ \ \ \ \ \ \ \ b+\left(  c+a\right)
,\ \ \ \ \ \ \ \ \ \ c+\left(  a+b\right)  ,\ \ \ \ \ \ \ \ \ \ c+\left(
b+a\right)  .
\end{align*}
If we want to make sense of a \textquotedblleft sum of three
numbers\textquotedblright\ without having to specify the precise procedure of
summation, we better hope that these $12$ ways all lead to the same result!
And indeed, they do. This is not hard to derive from the above-mentioned
commutativity of addition, combined with the \emph{associativity of addition}
(i.e., the rule saying that $\left(  a+b\right)  +c=a+\left(  b+c\right)  $
for any three numbers $a$, $b$ and $c$). For example,%
\begin{align*}
a+\left(  b+c\right)   &  =\underbrace{\left(  a+b\right)  }%
_{\substack{=b+a\\\text{(by commutativity)}}}+c\ \ \ \ \ \ \ \ \ \ \left(
\text{by associativity}\right) \\
&  =\left(  b+a\right)  +c=b+\underbrace{\left(  a+c\right)  }%
_{\substack{=c+a\\\text{(by commutativity)}}}\ \ \ \ \ \ \ \ \ \ \left(
\text{by associativity}\right) \\
&  =b+\left(  c+a\right)  =\left(  b+c\right)  +a\ \ \ \ \ \ \ \ \ \ \left(
\text{by associativity}\right)
\end{align*}
and so on (in the sense that similar reasoning shows that all $12$ ways give
equal results). Once we know that these $12$ ways all lead to the same result,
we can call the result \textquotedblleft the sum of the three numbers $a$, $b$
and $c$\textquotedblright\ with a clear conscience, and denote it by $a+b+c$
without specifying the order in which the sum is taken through well-placed parentheses.

Next, suppose you are given \textbf{four} numbers $a$, $b$, $c$ and $d$. There
are now $120$ ways of adding them together, including such ways as%
\[
\left(  \left(  a+b\right)  +c\right)  +d,\ \ \ \ \ \ \ \ \ \ \left(
a+b\right)  +\left(  c+d\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  b+d\right)
+\left(  c+a\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  b+\left(  d+a\right)
\right)  +c
\]
and many others. How can we tell that they all lead to the same result? They
do, and this can be proven as for three numbers (we don't need any new rules;
commutativity and associativity suffice), but this is of course more laborious
than the case of three numbers.

Now, suppose you are given $n$ numbers $a_{1},a_{2},\ldots,a_{n}$, and you
want to prove that all ways of adding them together give the same result. For
example, two of these ways are%
\[
\left(  \cdots\left(  \left(  \left(  a_{1}+a_{2}\right)  +a_{3}\right)
+a_{4}\right)  +\cdots\right)  +a_{n}%
\ \ \ \ \ \ \ \ \ \ \text{(\textquotedblleft left-associative
summation\textquotedblright)}%
\]
and
\[
a_{1}+\left(  \cdots+\left(  a_{n-3}+\left(  a_{n-2}+\left(  a_{n-1}%
+a_{n}\right)  \right)  \right)  \cdots\right)
\ \ \ \ \ \ \ \ \ \ \text{(\textquotedblleft right-associative
summation\textquotedblright);}%
\]
how do we know they are equivalent?

Let us close a ring around this problem. As long as we don't know that all
ways to add $n$ numbers give the same result, we cannot define
\textquotedblleft\textbf{the} sum\textquotedblright\ of $n$ numbers. But we
can define the \textbf{set of all possible sums} of $n$ numbers, i.e., the set
of all possible results that can be obtained by adding them together in all
possible orders. For example, for three numbers $a,b,c$, this set will be%
\[
\left\{  \left(  a+b\right)  +c,\ \ \left(  a+c\right)  +b,\ \ \ldots
,\ \ c+\left(  b+a\right)  \right\}
\]
(containing all the $12$ ways to add $a,b,c$ together, listed above). This
definition can easily be done by recursion:

\begin{itemize}
\item There is only one way to add $0$ numbers together. Namely, adding $0$
numbers always yields $0$.

\item There is only one way to add $1$ number together. Namely, adding $1$
number $a$ always yields $a$ itself.

\item If $n>1$, then any way of adding $n$ numbers together is given by
splitting them into two (disjoint nonempty) groups\footnote{\textquotedblleft
Groups\textquotedblright\ in the sense of \textquotedblleft
batches\textquotedblright, not in the sense of group theory. For example, if
our $n$ numbers are $a,b,c,d,e$, then the first group may be $d,b$ and the
second may be $c,a,e$.}, then adding the numbers in the first group together
(in one of the many possible ways), then adding the numbers in the second
group together, and finally adding the two results together.
\end{itemize}

\noindent Thus we can define the \textbf{set of all possible sums} of $n$
numbers. Our goal is to prove that there is only one such sum, i.e., that this
set is a $1$-element set. This is now a rigorously stated claim\footnote{known
as the \emph{general commutativity theorem} (\textquotedblleft
general\textquotedblright\ because it applies to any finite number of addends
rather than two)}, which we can try to prove! Thus, at the very least, we have
formalized our claim that we can add $n$ numbers together in a well-defined
way. Proving it is another story, but it can be done with rather elementary
tools. See \cite[\S 2.14]{detnotes} for a very detailed proof\footnote{More
precisely, the proof is in \cite[\S 2.14.1--\S 2.14.6]{detnotes}. The
remaining subsections of \cite[\S 2.14]{detnotes} prove properties of sums.}
(and \cite[lecture of 7th February 2018, pages 1--7]{18s} for a short
version). Other proofs can be found in \cite[Appendix A]{Warner71} and in
\cite[\S 3.3]{GalQua22}.

The upshot is that we have a well-defined notion of the sum of any finite
family of numbers, even if it is given without specifying an order. For
example, \textquotedblleft the sum of all prime numbers smaller than
$10$\textquotedblright\ is well-defined (and equals $2+3+5+7=17$). Likewise,
if you are given a polygon, then \textquotedblleft the sum of the sidelengths
of the polygon\textquotedblright\ is well-defined.

It is helpful to have a notation for these kinds of sums, so let us introduce
it (although we have already used it to some extent):

\begin{definition}
\label{def.sum.sigma-sign}Let $S$ be a finite set. For each $s\in S$, let
$a_{s}$ be a number (e.g., an integer or a rational number or a real number or
a complex number).

Then, $\sum_{s\in S}a_{s}$ shall denote the sum of the numbers $a_{s}$ for all
$s\in S$. This notation is read as \textquotedblleft the sum of $a_{s}$ over
all $s\in S$\textquotedblright\ or \textquotedblleft the sum of $a_{s}$ for
$s$ ranging over $S$\textquotedblright\ or \textquotedblleft the sum of
$a_{s}$ where $s$ runs through $S$\textquotedblright. The \textquotedblleft%
$\sum$\textquotedblright\ sign in this notation is called the \emph{summation
sign}.
\end{definition}

\begin{example}
\label{exa.sum.1}\textbf{(a)} We have $\sum_{s\in\left\{  1,2,3,4\right\}
}s=1+2+3+4=10$.

\textbf{(b)} We have $\sum_{s\in\left\{  1,2,3,4\right\}  }s^{2}=1^{2}%
+2^{2}+3^{2}+4^{2}=30$.

\textbf{(c)} We have $\sum_{s\in\left\{  1,2,3,4\right\}  }\dfrac{1}{s}%
=\dfrac{1}{1}+\dfrac{1}{2}+\dfrac{1}{3}+\dfrac{1}{4}=\dfrac{25}{12}$.

\textbf{(d)} We have $\sum_{s\in\left\{  3,4,9\right\}  }s=3+4+9=16$.
\end{example}

We need to note a few things about the summation sign:

\begin{itemize}
\item The letter \textquotedblleft$s$\textquotedblright\ in the notation
\textquotedblleft$\sum_{s\in S}a_{s}$\textquotedblright\ is an instance of
what is called a \emph{bound variable} (or \emph{running index}, or
\emph{dummy variable}): Its only purpose is to mark the \textquotedblleft
moving part\textquotedblright\ of the sum. So it plays the same role as the
letter \textquotedblleft$s$\textquotedblright\ in the set-comprehension
notation \textquotedblleft$\left\{  s\in\mathbb{Z}\ \mid\ s>2\right\}
$\textquotedblright, or the letter \textquotedblleft$s$\textquotedblright\ in
\textquotedblleft the map $\mathbb{Z}\rightarrow\mathbb{Z},\ s\mapsto
s+3$\textquotedblright,\ or the letter \textquotedblleft$s$\textquotedblright%
\ in the sentence \textquotedblleft There exists no $s\in\mathbb{Z}$ such that
$s^{2}=2$\textquotedblright. Thus, it is perfectly legitimate to replace it by
any other symbol (that is not used otherwise). For example, we can rewrite the
sum $\sum_{s\in\left\{  1,2,3,4\right\}  }\dfrac{1}{s}$ as $\sum_{i\in\left\{
1,2,3,4\right\}  }\dfrac{1}{i}$ or as $\sum_{k\in\left\{  1,2,3,4\right\}
}\dfrac{1}{k}$ or as $\sum_{\mathfrak{S}\in\left\{  1,2,3,4\right\}  }%
\dfrac{1}{\mathfrak{S}}$ or as $\sum_{\spadesuit\in\left\{  1,2,3,4\right\}
}\dfrac{1}{\spadesuit}$; it will still be the same sum.

\item In the notation \textquotedblleft$\sum_{s\in S}a_{s}$\textquotedblright,
the letter \textquotedblleft$s$\textquotedblright\ is called the
\emph{summation index}; the set $S$ is called the \emph{indexing set} (or
\emph{range}) of the sum; and the numbers $a_{s}$ are called the
\emph{addends} of the sum. The whole expression $\sum_{s\in S}a_{s}$ is called
a \emph{finite sum}.

\item Our definition of sums forces $\sum_{s\in\varnothing}a_{s}$ to always be
$0$. This is called an \emph{empty sum}. Thus, empty sums are $0$. If this
sounds like an arbitrary convention to you, you should check that it is the
only convention that makes (\ref{eq.sum.def.1}) hold for one-element sets $S$.

\item Sums can have equal addends. For example,%
\[
\sum_{s\in\left\{  -2,-1,0,1,2\right\}  }s^{2}=\left(  -2\right)  ^{2}+\left(
-1\right)  ^{2}+0^{2}+1^{2}+2^{2}=4+1+0+1+4=10.
\]
However,
\[
\sum_{s\in\left\{  \left(  -2\right)  ^{2},\left(  -1\right)  ^{2},0^{2}%
,1^{2},2^{2}\right\}  }s=0^{2}+1^{2}+2^{2}=0+1+4=5,
\]
because the \textbf{set} $\left\{  \left(  -2\right)  ^{2},\left(  -1\right)
^{2},0^{2},1^{2},2^{2}\right\}  $ is only a $3$-element set (with elements
$0^{2},1^{2},2^{2}$). Thus, if you want to write down a sum with some of its
entries equal, you still need to ensure that each of the addends gets a
distinct index in the indexing set. In general, the sum of $5$ numbers is not
the sum of the elements of the \textbf{set} of these $5$ numbers, because if
some of these $5$ numbers are equal, then the set \textquotedblleft
forgets\textquotedblright\ that they appear more than once.

\item The summation index does not always have to be a single letter. For
instance, if $S$ is a set of pairs, then we can write $\sum_{\left(
x,y\right)  \in S}a_{\left(  x,y\right)  }$ (meaning the same as $\sum_{s\in
S}a_{s}$). Here is an example of this notation:%
\[
\sum_{\left(  x,y\right)  \in\left\{  1,2,3\right\}  ^{2}}\dfrac{x}{y}%
=\dfrac{1}{1}+\dfrac{1}{2}+\dfrac{1}{3}+\dfrac{2}{1}+\dfrac{2}{2}+\dfrac{2}%
{3}+\dfrac{3}{1}+\dfrac{3}{2}+\dfrac{3}{3}.
\]

\end{itemize}

Here are some more examples, coming from more combinatorial questions:

\begin{example}
\label{exa.sum.2}\textbf{(a)} Let $\mathcal{P}\left(  A\right)  $ denote the
powerset of a set $A$ (that is, the set of all subsets of $A$). Then, we can
write the sum of the sizes of all subsets of $\left\{  1,2,3\right\}  $ as
follows:%
\begin{align*}
\sum_{B\in\mathcal{P}\left(  \left\{  1,2,3\right\}  \right)  }\left\vert
B\right\vert  &  =\left\vert \varnothing\right\vert +\left\vert \left\{
1\right\}  \right\vert +\left\vert \left\{  2\right\}  \right\vert +\left\vert
\left\{  3\right\}  \right\vert \\
&  \ \ \ \ \ \ \ \ \ \ +\left\vert \left\{  1,2\right\}  \right\vert
+\left\vert \left\{  1,3\right\}  \right\vert +\left\vert \left\{
2,3\right\}  \right\vert +\left\vert \left\{  1,2,3\right\}  \right\vert \\
&  =0+1+1+1+2+2+2+3=12.
\end{align*}


\textbf{(b)} If $A$ and $B$ are two sets, then $B^{A}$ denotes the set of all
maps from $A$ to $B$. For example, let $A=\left\{  1,2\right\}  $ and
$B=\left\{  1,2\right\}  $. Then, we can write the sum of the sizes of the
images of all maps from $A$ to $B$ as follows:%
\begin{align*}
&  \sum_{f\in B^{A}}\left\vert f\left(  A\right)  \right\vert \\
&  =\underbrace{\left\vert \left\{  1\right\}  \right\vert }%
_{\substack{\text{corresponding to the}\\\text{map }\left(
\begin{array}
[c]{cc}%
1 & 2\\
1 & 1
\end{array}
\right)  }}+\underbrace{\left\vert \left\{  1,2\right\}  \right\vert
}_{\substack{\text{corresponding to the}\\\text{map }\left(
\begin{array}
[c]{cc}%
1 & 2\\
1 & 2
\end{array}
\right)  }}+\underbrace{\left\vert \left\{  1,2\right\}  \right\vert
}_{\substack{\text{corresponding to the}\\\text{map }\left(
\begin{array}
[c]{cc}%
1 & 2\\
2 & 1
\end{array}
\right)  }}+\underbrace{\left\vert \left\{  2\right\}  \right\vert
}_{\substack{\text{corresponding to the}\\\text{map }\left(
\begin{array}
[c]{cc}%
1 & 2\\
2 & 2
\end{array}
\right)  }}\\
&  =1+2+2+1=6.
\end{align*}
(Here, we have written out each map in two-line notation: That is, the map
sending $1$ and $2$ to $a_{1}$ and $a_{2}$ has been written as $\left(
\begin{array}
[c]{cc}%
1 & 2\\
a_{1} & a_{2}%
\end{array}
\right)  $.)
\end{example}

There are several variants of the summation sign:

\begin{itemize}
\item The expression $\sum_{\substack{s\in\left\{  1,2,3,4,5,6\right\}
;\\s\text{ is odd}}}s^{2}$ stands for the sum of the squares of all
\textbf{odd} elements of $\left\{  1,2,3,4,5,6\right\}  $. In general, if $S$
is a set, and if $\mathcal{A}\left(  s\right)  $ is a logical statement
defined for each $s\in S$, then the notation $\sum_{\substack{s\in
S;\\\mathcal{A}\left(  s\right)  }}a_{s}$ stands for the sum $\sum
_{s\in\left\{  t\in S\ \mid\ \mathcal{A}\left(  t\right)  \right\}  }a_{s}$
(that is, the sum of $a_{s}$ not over all $s\in S$, but only over the ones
which satisfy $\mathcal{A}\left(  s\right)  $). For this sum to be
well-defined, we do not need $S$ to be finite; we only need the subset
$\left\{  t\in S\ \mid\ \mathcal{A}\left(  t\right)  \right\}  $ to be finite
(i.e., we need there to only be finitely many $s\in S$ satisfying
$\mathcal{A}\left(  s\right)  $).

\item The expression $\sum_{i=5}^{8}i^{2}$ stands for the sum $\sum
_{i\in\left\{  5,6,7,8\right\}  }i^{2}$. In general, if $p$ and $q$ are two
integers, then the notation $\sum_{i=p}^{q}a_{i}$ stands for the sum
$\sum_{i\in\left\{  p,p+1,\ldots,q\right\}  }a_{i}$. Here it should be kept in
mind that the set $\left\{  p,p+1,\ldots,q\right\}  $ is understood to be
empty if $p>q$. (Be warned that some authors have different conventions for
the latter case.)

In the notation $\sum_{i=p}^{q}a_{i}$, the integers $p$ and $q$ are called the
\emph{bounds} of the summation.

Note that the summation sign $\sum_{i=1}^{n}$ (for some $n\in\mathbb{N}$) is
thus equivalent to $\sum_{i\in\left\{  1,2,\ldots,n\right\}  }$, hence also to
$\sum_{i\in\left[  n\right]  }$.

\item The summation sign $\sum_{B\subseteq A}$ (where $A$ is a given set) is
shorthand for $\sum_{B\in\mathcal{P}\left(  A\right)  }$, where $\mathcal{P}%
\left(  A\right)  $ stands for the powerset of $A$ (that is, the set of all
subsets of $A$). Thus, the result of Example \ref{exa.sum.2} \textbf{(a)}
could be rewritten as $\sum_{B\subseteq\left\{  1,2,3\right\}  }\left\vert
B\right\vert =12$.

\item The summation sign $\sum_{f:A\rightarrow B}$ (where $A$ and $B$ are two
sets) is shorthand for $\sum_{f\in B^{A}}$. Thus, the result of Example
\ref{exa.sum.2} \textbf{(b)} could be rewritten as $\sum_{f:A\rightarrow
B}\left\vert f\left(  A\right)  \right\vert =6$.

\item Statements under the summation sign can be written out in words. For
example, \textquotedblleft$\sum_{B\text{ is a subset of }A}$\textquotedblright%
\ means the same as \textquotedblleft$\sum_{B\subseteq A}$\textquotedblright.
\end{itemize}

These notations can be mixed and matched. For example, $\sum
_{\substack{f:A\rightarrow B;\\f\text{ is injective}}}\left\vert f\left(
A\right)  \right\vert $ means the sum of the sizes of the images of all
\textbf{injective} maps from $A$ to $B$.

\subsubsection{\label{subsect.intro.powersums.sumrules}Rules for sums}

Finite sums have lots of properties, such as the identity
(\ref{pf.thm.1.10.2nd.1}) which we have used in the second proof of Theorem
\ref{thm.1.10}. See \cite[\S 1.4]{detnotes} for a long list of these
properties. Here I shall just list a few:\footnote{See \cite[\S 1.4.2 and
\S 2.14]{detnotes} for proofs of these properties.}

\begin{itemize}
\item \underline{\textbf{Splitting-off:}} Let $S$ be a finite set. Let $a_{s}$
be a number for each $s\in S$. Let $t\in S$. Then,%
\begin{equation}
\sum_{s\in S}a_{s}=a_{t}+\sum_{s\in S\setminus\left\{  t\right\}  }a_{s}.
\label{eq.sum.def.1}%
\end{equation}
In other words, we can always rewrite the sum $\sum_{s\in S}a_{s}$ as its
addend $a_{t}$ plus the sum of all remaining addends. This is called
\emph{splitting off} (or \emph{extracting})\emph{ an addend from a sum}.
Particular cases of this identity are the identities%
\[
\sum_{i=p}^{q}a_{i}=a_{p}+\sum_{i=p+1}^{q}a_{i}\ \ \ \ \ \ \ \ \ \ \text{and}%
\ \ \ \ \ \ \ \ \ \ \sum_{i=p}^{q}a_{i}=a_{q}+\sum_{i=p}^{q-1}a_{i}%
\]
that hold whenever $p\leq q$. (They do not hold for $p>q$, because we cannot
extract an addend from an empty sum.)

\item \underline{\textbf{Splitting:}} Let $S$ be a finite set. Let $X$ and $Y$
be two subsets of $S$ such that $X\cap Y=\varnothing$ and $X\cup Y=S$.
(Equivalently, $X$ and $Y$ are two subsets of $S$ such that each element of
$S$ lies in \textbf{exactly} one of $X$ and $Y$.) Let $a_{s}$ be a number for
each $s\in S$. Then,%
\begin{equation}
\sum_{s\in S}a_{s}=\sum_{s\in X}a_{s}+\sum_{s\in Y}a_{s}. \label{eq.sum.split}%
\end{equation}
(The right hand side of this equality has to be understood as $\left(
\sum_{s\in X}a_{s}\right)  +\left(  \sum_{s\in Y}a_{s}\right)  $. In general,
finite sums reach past \textquotedblleft$\cdot$\textquotedblright\ signs but
not past \textquotedblleft$+$\textquotedblright\ signs; thus, $\sum_{s\in
S}a_{s}b$ means $\sum_{s\in S}\left(  a_{s}b\right)  $, but $\sum_{s\in
S}a_{s}+b$ means $\left(  \sum_{s\in S}a_{s}\right)  +b$. This is considered
to be part of \href{https://en.wikipedia.org/wiki/Order_of_operations}{the
PEMDAS convention}, because finite sums are a form of addition. When in doubt,
always use parentheses.)

For example, we can apply (\ref{eq.sum.split}) to $S=\left\{
1,2,3,4,5\right\}  $ and $X=\left\{  1,3,5\right\}  $ and $Y=\left\{
2,4\right\}  $. We then obtain%
\begin{align*}
\sum_{s\in\left\{  1,2,3,4,5\right\}  }a_{s}  &  =\sum_{s\in\left\{
1,3,5\right\}  }a_{s}+\sum_{s\in\left\{  2,4\right\}  }a_{s}%
,\ \ \ \ \ \ \ \ \ \ \text{or, equivalently,}\\
a_{1}+a_{2}+a_{3}+a_{4}+a_{5}  &  =\left(  a_{1}+a_{3}+a_{5}\right)  +\left(
a_{2}+a_{4}\right)  .
\end{align*}
More generally, if $S$ is a finite set of integers, then
\begin{equation}
\sum_{s\in S}a_{s}=\sum_{\substack{s\in S;\\s\text{ is even}}}a_{s}%
+\sum_{\substack{s\in S;\\s\text{ is odd}}}a_{s} \label{eq.sum.split.ev-od}%
\end{equation}
(by (\ref{eq.sum.split}), applied to $X=\left\{  s\in S\ \mid\ s\text{ is
even}\right\}  $ and $Y=\left\{  s\in S\ \mid\ s\text{ is odd}\right\}  $).

More generally, let $S$ be a finite set. For each $s\in S$, let $\mathcal{A}%
\left(  s\right)  $ be a logical statement (which can be either true or false
depending on $s$; for example, $\mathcal{A}\left(  s\right)  $ could be
\textquotedblleft$s$ is even\textquotedblright\ if $S$ is a set of integers,
or \textquotedblleft$s$ is empty\textquotedblright\ if $S$ is a set of sets),
and let $a_{s}$ be a number. Then,%
\begin{equation}
\sum_{s\in S}a_{s}=\sum_{\substack{s\in S;\\\mathcal{A}\left(  s\right)
\text{ is true}}}a_{s}+\sum_{\substack{s\in S;\\\mathcal{A}\left(  s\right)
\text{ is false}}}a_{s}. \label{eq.sum.split.As}%
\end{equation}
This follows by applying (\ref{eq.sum.split}) to $X=\left\{  s\in
S\ \mid\ \mathcal{A}\left(  s\right)  \text{ is true}\right\}  $ and
\newline$Y=\left\{  s\in S\ \mid\ \mathcal{A}\left(  s\right)  \text{ is
false}\right\}  $. Of course, (\ref{eq.sum.split.ev-od}) is the particular
case of (\ref{eq.sum.split.As}) for $\mathcal{A}\left(  s\right)  =\left(
\text{\textquotedblleft}s\text{ is even\textquotedblright}\right)  $.

\item \underline{\textbf{Summing equal values:}} Let $S$ be a finite set. Let
$a$ be a number. Then,%
\begin{equation}
\sum_{s\in S}a=\left\vert S\right\vert \cdot a. \label{eq.sum.equal}%
\end{equation}
(That is, summing $n$ many copies of a number $a$ results in the number $na$.)

Applying (\ref{eq.sum.equal}) to $a=1$, we find%
\begin{equation}
\sum_{s\in S}1=\left\vert S\right\vert \cdot1=\left\vert S\right\vert .
\label{eq.sum.equal-1}%
\end{equation}
In other words, the size of a finite set is a particular case of a finite sum.
This trivial observation will prove rather useful to us below.

\item \underline{\textbf{Splitting an addend:}} Let $S$ be a finite set. For
every $s\in S$, let $a_{s}$ and $b_{s}$ be numbers. Then,%
\begin{equation}
\sum_{s\in S}\left(  a_{s}+b_{s}\right)  =\sum_{s\in S}a_{s}+\sum_{s\in
S}b_{s}. \label{eq.sum.linear1}%
\end{equation}
When $S=\left\{  1,2,\ldots,n\right\}  $, this becomes precisely the equality
(\ref{pf.thm.1.10.2nd.1}).

\item \underline{\textbf{Factoring out:}} Let $S$ be a finite set. For every
$s\in S$, let $a_{s}$ be a number. Also, let $\lambda$ be a number. Then,%
\begin{equation}
\sum_{s\in S}\lambda a_{s}=\lambda\sum_{s\in S}a_{s}. \label{eq.sum.linear2}%
\end{equation}
This is a generalization of the \emph{distributive law} $\lambda\left(
a+b\right)  =\lambda a+\lambda b$.

\item \underline{\textbf{Zeroes sum to zero:}} Let $S$ be a finite set. Then,%
\begin{equation}
\sum_{s\in S}0=0. \label{eq.sum.sum0}%
\end{equation}


\item \underline{\textbf{Renaming the index:}} Let $S$ be a finite set. Let
$a_{s}$ be a number for each $s\in S$. Then,%
\[
\sum_{s\in S}a_{s}=\sum_{t\in S}a_{t}.
\]
This is called \emph{renaming the summation index}, and is justified by the
fact that the summation index is a dummy variable.

\item \underline{\textbf{Substituting the index I:}} Let $S$ and $T$ be two
finite sets. Let $f:S\rightarrow T$ be a bijection. Let $a_{t}$ be a number
for each $t\in T$. Then,%
\begin{equation}
\sum_{t\in T}a_{t}=\sum_{s\in S}a_{f\left(  s\right)  }. \label{eq.sum.subs1}%
\end{equation}
The idea here is that the sum $\sum_{s\in S}a_{f\left(  s\right)  }$ contains
the same addends as the sum $\sum_{t\in T}a_{t}$.

When we apply (\ref{eq.sum.subs1}), we say that we are \emph{substituting}
$f\left(  s\right)  $ for $t$ in the sum $\sum_{t\in T}a_{t}$.

Applying (\ref{eq.sum.subs1}) to $a_{t}=1$, we obtain $\sum_{t\in T}%
1=\sum_{s\in S}1$, which rewrites as $\left\vert T\right\vert =\left\vert
S\right\vert $ (because of (\ref{eq.sum.equal-1})). This is precisely the
bijection principle (Theorem \ref{thm.bij-rule}). Thus, (\ref{eq.sum.subs1})
generalizes the bijection principle.

The equality (\ref{eq.sum.subs1}) also shows that we can \textquotedblleft
turn a sum around\textquotedblright, in the sense that we have%
\begin{equation}
a_{1}+a_{2}+\cdots+a_{n}=a_{n}+a_{n-1}+\cdots+a_{1}
\label{eq.sum.subs1.reverse}%
\end{equation}
for any $n\in\mathbb{N}$ and any $n$ numbers $a_{1},a_{2},\ldots,a_{n}$. (This
was used in the Second proof of Theorem \ref{thm.1.10}.) Indeed, the left hand
side of (\ref{eq.sum.subs1.reverse}) can be rewritten as $\sum_{t\in\left[
n\right]  }a_{t}$, whereas the right hand side can be rewritten as $\sum
_{s\in\left[  n\right]  }a_{n+1-s}=\sum_{s\in\left[  n\right]  }a_{f\left(
s\right)  }$, where $f:\left[  n\right]  \rightarrow\left[  n\right]  $ is the
map that sends each $s\in\left[  n\right]  $ to $n+1-s$. Since this latter map
$f:\left[  n\right]  \rightarrow\left[  n\right]  $ is a bijection, we can use
(\ref{eq.sum.subs1}) (applied to $S=\left[  n\right]  $ and $T=\left[
n\right]  $) to conclude that $\sum_{t\in\left[  n\right]  }a_{t}=\sum
_{s\in\left[  n\right]  }a_{f\left(  s\right)  }$; but this is precisely the
identity (\ref{eq.sum.subs1.reverse}).

\item \underline{\textbf{Substituting the index II:}} Let $S$ and $T$ be two
finite sets. Let $f:S\rightarrow T$ be a bijection. Let $a_{s}$ be a number
for each $s\in S$. Then,%
\begin{equation}
\sum_{s\in S}a_{s}=\sum_{t\in T}a_{f^{-1}\left(  t\right)  }.
\label{eq.sum.subs2}%
\end{equation}
This is, of course, just (\ref{eq.sum.subs1}) but applied to $T$, $S$ and
$f^{-1}$ instead of $S$, $T$ and $f$. We state it as a separate formula
because we shall be using both versions.

\item \underline{\textbf{Splitting a sum by a value of a function:}} Let $S$
and $W$ be two finite sets. Let $f:S\rightarrow W$ be a map. Let $a_{s}$ be a
number for each $s\in S$. Then,%
\begin{equation}
\sum_{s\in S}a_{s}=\sum_{w\in W}\ \ \sum_{\substack{s\in S;\\f\left(
s\right)  =w}}a_{s}. \label{eq.sum.sheph}%
\end{equation}
(There are two summation signs on the right hand side, signifying that we are
taking a finite sum of finite sums.) This equality provides a way to split a
sum $\sum_{s\in S}a_{s}$ into several batches by distributing all possible
values of the summation index $s$ into several \textquotedblleft
bins\textquotedblright\footnote{The \textquotedblleft bins\textquotedblright%
\ are the elements of $W$ here. Each value $s\in S$ goes into bin $f\left(
s\right)  $.}, and then summing each batch of addends corresponding to a bin
together and then summing the \textquotedblleft bin totals\textquotedblright.
For example, let us apply (\ref{eq.sum.sheph}) to the $11$-element set
$S=\left\{  -5,-4,\ldots,4,5\right\}  $ and the $6$-element set $W=\left\{
0,1,\ldots,5\right\}  $ and the map $f:S\rightarrow W$ that sends each $s\in
S$ to $\left\vert s\right\vert \in W$. We thus obtain%
\[
\sum_{s\in\left\{  -5,-4,\ldots,4,5\right\}  }a_{s}=\sum_{w\in\left\{
0,1,\ldots,5\right\}  }\ \ \sum_{\substack{s\in\left\{  -5,-4,\ldots
,4,5\right\}  ;\\\left\vert s\right\vert =w}}a_{s}.
\]
Explicitly, this rewrites as%
\begin{align*}
&  a_{-5}+a_{-4}+\cdots+a_{4}+a_{5}\\
&  =a_{0}+\left(  a_{-1}+a_{1}\right)  +\left(  a_{-2}+a_{2}\right)  +\left(
a_{-3}+a_{3}\right)  +\left(  a_{-4}+a_{4}\right)  +\left(  a_{-5}%
+a_{5}\right)  .
\end{align*}
Here, the \textquotedblleft bins\textquotedblright\ are $\left\{  0\right\}
$, $\left\{  -1,1\right\}  $, $\left\{  -2,2\right\}  $, $\left\{
-3,3\right\}  $, $\left\{  -4,4\right\}  $ and $\left\{  -5,5\right\}  $, and
the corresponding \textquotedblleft bin totals\textquotedblright\ are $a_{0}$,
$a_{-1}+a_{1}$, $a_{-2}+a_{2}$, $a_{-3}+a_{3}$, $a_{-4}+a_{4}$ and
$a_{-5}+a_{5}$.

\item \underline{\textbf{Splitting a sum into subsums:}} Let a finite set $S$
be the union of $k$ disjoint sets $S_{1},S_{2},\ldots,S_{k}$. Let $a_{s}$ be a
number for each $s\in S$. Then,%
\begin{equation}
\sum_{s\in S}a_{s}=\sum_{w=1}^{k}\ \ \sum_{s\in S_{w}}a_{s}.
\label{eq.sum.split-n}%
\end{equation}
(The right hand side can be rewritten in the somewhat more familiar form
$\sum_{s\in S_{1}}a_{s}+\sum_{s\in S_{2}}a_{s}+\cdots+\sum_{s\in S_{k}}a_{s}$.)

It is easy to see that (\ref{eq.sum.split-n}) follows from (\ref{eq.sum.sheph}%
) (by setting $W=\left\{  1,2,\ldots,k\right\}  $, and letting $f:S\rightarrow
W$ be the map that sends each $s\in S$ to the unique $w\in\left\{
1,2,\ldots,k\right\}  $ for which $s\in S_{w}$).

Note that if we set $a_{s}=1$ for each $s\in S$ and recall the formula
(\ref{eq.sum.equal-1}), then (\ref{eq.sum.split-n}) rewrites as $\left\vert
S\right\vert =\sum_{w=1}^{k}\left\vert S_{w}\right\vert =\left\vert
S_{1}\right\vert +\left\vert S_{2}\right\vert +\cdots+\left\vert
S_{k}\right\vert $. Thus, we have recovered the sum rule (Theorem
\ref{thm.1.2}) as a particular case of (\ref{eq.sum.split-n}).
\end{itemize}

There are further rules, such as \emph{Fubini's principle} for the interchange
of summation signs. We will not state them yet in order to keep this section
reasonably short.

However, let us state an important application of summation signs in counting:

\begin{theorem}
[The sum rule, in summation-sign form]\label{thm.sumrule2}Let $S$ and $W$ be
two finite sets. Let $f:S\rightarrow W$ be a map. Then,%
\[
\left\vert S\right\vert =\sum_{w\in W}\left(  \text{\# of }s\in S\text{
satisfying }f\left(  s\right)  =w\right)  .
\]

\end{theorem}

Theorem \ref{thm.sumrule2} is called the \emph{sum rule}, since it is a more
flexible version of Theorem \ref{thm.1.2}. Indeed, both theorems tell us how
to compute the size $\left\vert S\right\vert $ of a set $S$ that has been
split into several subsets\footnote{In Theorem \ref{thm.1.2}, the subsets are
$S_{1},S_{2},\ldots,S_{k}$; in Theorem \ref{thm.sumrule2}, the subsets are
$\left\{  s\in S\ \mid\ f\left(  s\right)  =w\right\}  $ for various $w\in
W$.}; but Theorem \ref{thm.1.2} requires the latter subsets to be numbered by
$1,2,\ldots,k$, whereas Theorem \ref{thm.sumrule2} only needs them to be
indexed by elements $w$ of $W$.

\begin{example}
Assume you have a finite set of socks, and each sock is either red or blue or
green. Then,%
\begin{align*}
\left(  \text{\# of socks}\right)   &  =\left(  \text{\# of red socks}\right)
+\left(  \text{\# of blue socks}\right)  +\left(  \text{\# of green
socks}\right) \\
&  =\sum_{w\in\left\{  \text{red},\text{blue},\text{green}\right\}  }\left(
\text{\# of socks of color }w\right)  .
\end{align*}
This is a consequence of Theorem \ref{thm.sumrule2}, applied to $S=\left\{
\text{socks}\right\}  $, $W=\left\{  \text{red},\text{blue},\text{green}%
\right\}  $ and the map $f:S\rightarrow W$ defined by $f\left(  s\right)
=\left(  \text{color of }s\right)  $.
\end{example}

\begin{proof}
[Proof of Theorem \ref{thm.sumrule2}.]From (\ref{eq.sum.equal-1}), we obtain%
\begin{equation}
\left\vert S\right\vert =\sum_{s\in S}1=\sum_{w\in W}\ \ \sum_{\substack{s\in
S;\\f\left(  s\right)  =w}}1 \label{pf.thm.sumrule2.1}%
\end{equation}
(by (\ref{eq.sum.sheph}), applied to $a_{s}=1$).

Now, for each $w\in W$, we have
\begin{align}
\sum_{\substack{s\in S;\\f\left(  s\right)  =w}}1  &  =\sum_{s\in\left\{  t\in
S\ \mid\ f\left(  t\right)  =w\right\}  }1\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{since the sign
\textquotedblleft}\sum_{\substack{s\in S;\\f\left(  s\right)  =w}%
}\text{\textquotedblright\ is shorthand for \textquotedblleft}\sum
_{s\in\left\{  t\in S\ \mid\ f\left(  t\right)  =w\right\}  }%
\text{\textquotedblright}\right) \nonumber\\
&  =\left\vert \left\{  t\in S\ \mid\ f\left(  t\right)  =w\right\}
\right\vert \nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{eq.sum.equal-1}), applied to }\left\{  t\in S\ \mid\ f\left(  t\right)
=w\right\}  \text{ instead of }S\right) \nonumber\\
&  =\left\vert \left\{  s\in S\ \mid\ f\left(  s\right)  =w\right\}
\right\vert \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have renamed the index
}t\text{ as }s\right) \nonumber\\
&  =\left(  \text{\# of }s\in S\text{ satisfying }f\left(  s\right)
=w\right)  . \label{pf.thm.sumrule2.2}%
\end{align}
Hence, (\ref{pf.thm.sumrule2.1}) becomes%
\[
\left\vert S\right\vert =\sum_{w\in W}\ \ \underbrace{\sum_{\substack{s\in
S;\\f\left(  s\right)  =w}}1}_{\substack{=\left(  \text{\# of }s\in S\text{
satisfying }f\left(  s\right)  =w\right)  \\\text{(by (\ref{pf.thm.sumrule2.2}%
))}}}=\sum_{w\in W}\left(  \text{\# of }s\in S\text{ satisfying }f\left(
s\right)  =w\right)  .
\]
This proves Theorem \ref{thm.sumrule2}.
\end{proof}

\subsubsection{\label{subsect.intro.powersums.prod}While at that, what is a
finite product?}

Similar to the notion of a finite sum is a notion of a finite product:

\begin{definition}
\label{def.prod.pi-sign}Let $S$ be a finite set. For each $s\in S$, let
$a_{s}$ be a number (e.g., an integer or a rational number or a real number or
a complex number).

Then, $\prod_{s\in S}a_{s}$ shall denote the product of the numbers $a_{s}$
for all $s\in S$. This notation is read as \textquotedblleft the product of
$a_{s}$ over all $s\in S$\textquotedblright\ or \textquotedblleft the product
of $a_{s}$ for $s$ ranging over $S$\textquotedblright\ or \textquotedblleft
the product of $a_{s}$ where $s$ runs through $S$\textquotedblright. The
\textquotedblleft$\prod$\textquotedblright\ sign in this notation is called
the \emph{product sign}.
\end{definition}

This notation is called a \emph{finite product}. For example, $\prod
_{s\in\left\{  4,5,7,9\right\}  }s^{3}=4^{3}\cdot5^{3}\cdot7^{3}\cdot9^{3}$.

Most of what we said about finite sums applies (with the obvious changes) to
finite products. In particular, finite products are well-defined (in the sense
that all ways to multiply $n$ given numbers together produce the same result)
and satisfy analogues of the properties of finite sums listed above (with the
obvious changes made: e.g., the equality (\ref{eq.sum.equal}) turns into
$\prod_{s\in S}a=a^{\left\vert S\right\vert }$), except for
(\ref{eq.sum.equal-1}). Notations like $\sum_{\substack{s\in S;\\\mathcal{A}%
\left(  s\right)  }}a_{s}$ and $\sum_{i=p}^{q}a_{i}$ have their analogues for
products, which look exactly the same (that is, $\prod_{\substack{s\in
S;\\\mathcal{A}\left(  s\right)  }}a_{s}$ and $\prod_{i=p}^{q}a_{i}$) and are
defined in the same way. We only need to be careful in defining empty products
correctly: While an empty sum was defined to be $0$, we must define an empty
product (i.e., a product with no factors\footnote{The analogue of
\textquotedblleft addend\textquotedblright\ in a finite product is
\textquotedblleft factor\textquotedblright.}) to be $1$. This is why, in
particular, we have $x^{0}=1$ for each $x\in\mathbb{R}$. (Indeed, $x^{m}$ is
defined as $\underbrace{xx\cdots x}_{m\text{ times}}$ whenever $m\in
\mathbb{N}$ and $x\in\mathbb{R}$. Thus, $x^{0}=\underbrace{xx\cdots
x}_{0\text{ times}}=\left(  \text{empty product}\right)  =1$.)

\subsubsection{\label{subsect.intro.powersums.powk}The sums $1^{k}%
+2^{k}+...+n^{k}$}

Let us now go back to Theorem \ref{thm.1.10}. That theorem gave an explicit
formula for the sum of the first $n$ positive integers. A similar formula
exists for the sum of the squares of the first $n$ positive integers:

\begin{proposition}
\label{prop.1.11}Let $n\in\mathbb{N}$. Then,
\[
1^{2}+2^{2}+\cdots+n^{2}=\dfrac{n\left(  n+1\right)  \left(  2n+1\right)  }%
{6}.
\]

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.1.11} (sketched).]Again, this can be shown by
a straightforward induction (LTTR).
\end{proof}

\begin{fineprint}
Is there a picture proof for Proposition \ref{prop.1.11} as well, similar to
the one we gave for Theorem \ref{thm.1.10}? Yes, and even several, but they
are more complicated. A proof using plane \textquotedblleft
geometry\textquotedblright\ can be found in \cite[\S I.3]{UspHea39}, while a
\textquotedblleft three-dimensional\textquotedblright\ proof can be found in
\cite{Siu84}. In truth, both of these proofs are combinatorial arguments in
geometric disguises (thus the quotation marks).

Some more combinatorial proofs of Proposition \ref{prop.1.11} can be found in
the math.stackexchange thread
\url{https://math.stackexchange.com/questions/95047/} .

Note that a direct imitation of our second proof of Theorem \ref{thm.1.10}
does not work: The numbers $1^{2}+n^{2},\ 2^{2}+\left(  n-1\right)
^{2},\ \ldots,\ n^{2}+1^{2}$ are not equal, and I don't know of a way to
reorder the addends in the (expanded) sum $6\cdot\left(  1^{2}+2^{2}%
+\cdots+n^{2}\right)  $ to obtain $n\left(  n+1\right)  \left(  2n+1\right)  $.
\end{fineprint}

\bigskip

Next, let us sum the cubes of the first $n$ positive integers:

\begin{proposition}
\label{prop.1.12}Let $n\in\mathbb{N}$. Then,
\[
1^{3}+2^{3}+\cdots+n^{3}=\dfrac{n^{2}\left(  n+1\right)  ^{2}}{4}.
\]

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.1.12} (sketched).]Again, a straightforward
induction does the trick (LTTR).
\end{proof}

\begin{fineprint}
Alternatively, a combinatorial proof can be found in
\url{https://math.stackexchange.com/a/95055} . Note that this combinatorial
proof relies on counting $4$-tuples of numbers. If we tried to visualize this
proof as a \textquotedblleft picture proof\textquotedblright\ (along the vein
of our third proof of Theorem \ref{thm.1.10}), then it would require
$4$-dimensional pictures, which would not be very easy to draw (to put it
mildly). But the combinatorics is perfectly clear in any number of dimensions.
\end{fineprint}

\bigskip

Now, a \textbf{question} suggests itself: Are Theorem \ref{thm.1.10},
Proposition \ref{prop.1.11} and Proposition \ref{prop.1.12} just the first
three pieces in a sequence of formulas? In other words, given a positive
integer $k$, is there an explicit formula for $1^{k}+2^{k}+\cdots+n^{k}$ ?
Having seen the answers for $k=1$, $k=2$ and $k=3$, we would expect the right
hand side of such a formula to be a $\left(  k+1\right)  $-st degree
polynomial in $n$.

Let us first reword the question. Recall (from Subsection
\ref{subsect.intro.powersums.what}) that we are using the shorthand notation
\[
\sum\limits_{i=p}^{q}a_{i}\ \ \ \ \ \ \ \ \ \ \text{for }\sum\limits_{i\in
\left\{  p,p+1,\ldots,q\right\}  }a_{i}=a_{p}+a_{p+1}+\cdots+a_{q}%
\]
whenever $p$ and $q$ are two integers and $a_{p},a_{p+1},\ldots,a_{q}$ are
arbitrary numbers. Thus, the sum that we are interested in, namely
$1^{k}+2^{k}+\cdots+n^{k}$, can be rewritten as $\sum\limits_{i=1}^{n}i^{k}$.

Let us list the answers to our question for small values of $k$:%
\begin{align*}
\sum\limits_{i=1}^{n}i^{1}  &  =\dfrac{n\left(  n+1\right)  }{2}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.1.10}}\right)  ;\\
\sum\limits_{i=1}^{n}i^{2}  &  =\dfrac{n\left(  n+1\right)  \left(
2n+1\right)  }{6}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.1.11}}\right)  ;\\
\sum\limits_{i=1}^{n}i^{3}  &  =\dfrac{n^{2}\left(  n+1\right)  ^{2}}%
{4}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition \ref{prop.1.12}}\right)
;\\
\sum_{i=1}^{n}i^{4}  &  =\dfrac{n\left(  2n+1\right)  \left(  n+1\right)
\left(  3n+3n^{2}-1\right)  }{30};\\
\sum_{i=1}^{n}i^{5}  &  =\dfrac{n^{2}\left(  n+1\right)  ^{2}\left(
2n+2n^{2}-1\right)  }{12};\\
&  \ldots.
\end{align*}
(We can prove each of these formulas by induction on $n$ once we know how it
looks like.) For now, we don't see much of a pattern. However, there is one --
once we rewrite the right hand sides in terms of \textit{binomial
coefficients}. We will give a more general definition of binomial coefficients
later, but for now let us just set%
\begin{equation}
\dbinom{m}{k}=\dfrac{m\left(  m-1\right)  \left(  m-2\right)  \cdots\left(
m-k+1\right)  }{k\left(  k-1\right)  \left(  k-2\right)  \cdots1}
\label{def.intro.powersums.mchoosek=}%
\end{equation}
for all $m\in\mathbb{R}$ and $k\in\mathbb{N}$. (Here, on the right hand side,
the numerator is a product of $k$ factors, the first of which is $m$ and which
decrease by $1$ from each factor to the next; the denominator is a similar
product, but starting at $k$ instead of $m$.) Furthermore, if $k$ and $m$ are
two nonnegative integers, then let us use the notation $\operatorname*{sur}%
\left(  k,i\right)  $ for the \# of all surjective maps from $\left[
k\right]  $ to $\left[  i\right]  $. (Recall that $\left[  k\right]  $ stands
for $\left\{  1,2,\ldots,k\right\}  $; in particular, $\left[  0\right]
=\varnothing$.) Now, we can answer our question by the following formula:

\begin{theorem}
\label{thm.1.13}Let $n\in\mathbb{N}$, and let $k$ be a positive integer. Then,%
\[
\sum_{i=1}^{n}i^{k}=\sum_{i=0}^{k}\operatorname*{sur}\left(  k,i\right)
\cdot\dbinom{n+1}{i+1}.
\]

\end{theorem}

We will prove this theorem in Section \ref{sect.binom.powersum}. For now, let
us say a few things about it.

First of all, why does Theorem \ref{thm.1.13} answer our question? Why does
its right hand side count as an explicit answer? Didn't we just rewrite a
finite sum as another finite sum (a more complicated one to boot)? In a sense,
yes; however, if $k$ is fixed, then the sum on the right hand side has a fixed
number of addends (namely, $k+1$), so it can indeed count as explicit, whereas
the left hand side has $n$ addends. To illustrate this point, let us see how
Proposition \ref{prop.1.11} can be straightforwardly recovered from Theorem
\ref{thm.1.13}.

We will need to know the numbers $\operatorname*{sur}\left(  2,i\right)  $ for
all $i\in\left\{  0,1,2\right\}  $, so let us agree on a notation for maps
between finite sets:

\begin{definition}
\label{def.map.tln}Let $X$ be a finite set, and let $Y$ be any set. Assume
that $X=\left\{  x_{1},x_{2},\ldots,x_{k}\right\}  $ for some distinct
elements $x_{1},x_{2},\ldots,x_{k}$. Let $y_{1},y_{2},\ldots,y_{k}$ be any $k$
elements of $Y$ (not necessarily distinct). Then, the map from $X$ to $Y$ that
sends $x_{1},x_{2},\ldots,x_{k}$ to $y_{1},y_{2},\ldots,y_{k}$, respectively,
will be called $\left(
\begin{array}
[c]{cccc}%
x_{1} & x_{2} & \cdots & x_{k}\\
y_{1} & y_{2} & \cdots & y_{k}%
\end{array}
\right)  $.

This is called the \emph{two-line notation} for maps.
\end{definition}

For example, if $X=\left\{  1,2,3\right\}  $ and $Y=\mathbb{Z}$, then the map
that sends each $m\in X$ to $m^{2}\in\mathbb{Z}$ can be written as $\left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
1^{2} & 2^{2} & 3^{2}%
\end{array}
\right)  =\left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
1 & 4 & 9
\end{array}
\right)  $ in two-line notation. It can also be written as $\left(
\begin{array}
[c]{ccc}%
2 & 1 & 3\\
4 & 1 & 9
\end{array}
\right)  $ and in four other ways, since we have freedom to decide in which
order we list the elements of $X$.

The two-line notation makes it easy to see whether a map is injective or surjective:

\begin{remark}
Let $f:X\rightarrow Y$ be a map between two sets $X$ and $Y$, where $X$ is
finite. Assume that $X=\left\{  x_{1},x_{2},\ldots,x_{k}\right\}  $ for some
distinct elements $x_{1},x_{2},\ldots,x_{k}$. Assume that $f$ is written as
$\left(
\begin{array}
[c]{cccc}%
x_{1} & x_{2} & \cdots & x_{k}\\
y_{1} & y_{2} & \cdots & y_{k}%
\end{array}
\right)  $ in two-line notation. Then:

\textbf{(a)} The map $f$ is injective if and only if $y_{1},y_{2},\ldots
,y_{k}$ are distinct.

\textbf{(b)} The map $f$ is surjective if and only if $Y=\left\{  y_{1}%
,y_{2},\ldots,y_{k}\right\}  $.
\end{remark}

With this in hand, we can easily compute $\operatorname*{sur}\left(
2,0\right)  $, $\operatorname*{sur}\left(  2,1\right)  $ and
$\operatorname*{sur}\left(  2,2\right)  $:

\begin{itemize}
\item There exist no maps $\left[  2\right]  \rightarrow\left[  0\right]  $
(since $\left[  0\right]  =\varnothing$ is the empty set, so there is nowhere
to map $1\in\left[  2\right]  $ to). Thus, a fortiori, there exist no
surjective maps $\left[  2\right]  \rightarrow\left[  0\right]  $. Hence,
$\operatorname*{sur}\left(  2,0\right)  =0$. (Similarly, $\operatorname*{sur}%
\left(  k,0\right)  =0$ for all $k>0$.)

\item There is only one map $\left[  2\right]  \rightarrow\left[  1\right]  $,
namely the map that sends both $1$ and $2$ to $1$. (In two-line notation, it
is written as $\left(
\begin{array}
[c]{cc}%
1 & 2\\
1 & 1
\end{array}
\right)  $.) This map is surjective. Hence, there is exactly $1$ surjective
map $\left[  2\right]  \rightarrow\left[  1\right]  $. Hence,
$\operatorname*{sur}\left(  2,1\right)  =1$. (Similarly, $\operatorname*{sur}%
\left(  k,1\right)  =1$ for all $k>0$.)

\item There are four maps $\left[  2\right]  \rightarrow\left[  2\right]  $.
In two-line notation, they are written as $\left(
\begin{array}
[c]{cc}%
1 & 2\\
1 & 1
\end{array}
\right)  $, $\left(
\begin{array}
[c]{cc}%
1 & 2\\
1 & 2
\end{array}
\right)  $, $\left(
\begin{array}
[c]{cc}%
1 & 2\\
2 & 1
\end{array}
\right)  $ and $\left(
\begin{array}
[c]{cc}%
1 & 2\\
2 & 2
\end{array}
\right)  $. The second and the third among them are surjective (since
$\left\{  1,2\right\}  $ and $\left\{  2,1\right\}  $ both equal $\left[
2\right]  $), whereas the first and the fourth are not. Hence, there are
exactly $2$ surjective maps $\left[  2\right]  \rightarrow\left[  2\right]  $.
Hence, $\operatorname*{sur}\left(  2,2\right)  =2$.
\end{itemize}

Now, we can apply Theorem \ref{thm.1.13} to $k=2$, and conclude that%
\begin{align*}
\sum_{i=1}^{n}i^{2}  &  =\sum_{i=0}^{2}\operatorname*{sur}\left(  2,i\right)
\cdot\dbinom{n+1}{i+1}\\
&  =\underbrace{\operatorname*{sur}\left(  2,0\right)  }_{=0}\cdot
\underbrace{\dbinom{n+1}{0+1}}_{\substack{=\dbinom{n+1}{1}=\dfrac{n+1}%
{1}\\\text{(by (\ref{def.intro.powersums.mchoosek=}), applied}\\\text{to
}m=n+1\text{ and }k=1\text{)}}}+\underbrace{\operatorname*{sur}\left(
2,1\right)  }_{=1}\cdot\underbrace{\dbinom{n+1}{1+1}}_{\substack{=\dbinom
{n+1}{2}=\dfrac{\left(  n+1\right)  n}{2\cdot1}\\\text{(by
(\ref{def.intro.powersums.mchoosek=}), applied}\\\text{to }m=n+1\text{ and
}k=2\text{)}}}\\
&  \ \ \ \ \ \ \ \ \ \ +\underbrace{\operatorname*{sur}\left(  2,2\right)
}_{=2}\cdot\underbrace{\dbinom{n+1}{2+1}}_{\substack{=\dbinom{n+1}{3}%
=\dfrac{\left(  n+1\right)  n\left(  n-1\right)  }{3\cdot2\cdot1}\\\text{(by
(\ref{def.intro.powersums.mchoosek=}), applied}\\\text{to }m=n+1\text{ and
}k=3\text{)}}}\\
&  =0\cdot\dfrac{n+1}{1}+1\cdot\dfrac{\left(  n+1\right)  n}{2\cdot1}%
+2\cdot\dfrac{\left(  n+1\right)  n\left(  n-1\right)  }{3\cdot2\cdot1}\\
&  =\dfrac{1}{3}n^{3}+\dfrac{1}{2}n^{2}+\dfrac{1}{6}%
n\ \ \ \ \ \ \ \ \ \ \left(  \text{after straightforward algebraic
manipulations}\right) \\
&  =\dfrac{n\left(  n+1\right)  \left(  2n+1\right)  }{6}%
\end{align*}
for each $n\in\mathbb{N}$. Thus, Proposition \ref{prop.1.11} is proven again.
Similarly, we can recover Theorem \ref{thm.1.10} and Proposition
\ref{prop.1.12} and similar formulas for arbitrary values of $k$.

Theorem \ref{thm.1.13} also confirms our suspicion that $1^{k}+2^{k}%
+\cdots+n^{k}$ is given by a degree-$\left(  k+1\right)  $ polynomial in $n$.
Indeed, it is easy to see that each of the terms $\dbinom{n+1}{i+1}$ on the
right hand side of Theorem \ref{thm.1.13} is a degree-$\left(  i+1\right)  $
polynomial in $n$ (this follows easily from
(\ref{def.intro.powersums.mchoosek=})).

Theorem \ref{thm.1.13} is likely an old result (18th Century?). Regrettably, I
don't know its ultimate origins, since it has been overshadowed by an even
more explicit formula for $1^{k}+2^{k}+\cdots+n^{k}$, the \textit{Faulhaber
formula} \cite{Knuth93}.

\subsection{\label{sect.intro.binom}Factorials and binomial coefficients}

\subsubsection{Factorials}

We now switch from studying sums to studying products.

\begin{definition}
\label{def.factorial}For any $n\in\mathbb{N}$, we define a positive integer
$n!$ by
\[
n!=1\cdot2\cdot\cdots\cdot n.
\]
(Using the product sign as defined in Definition \ref{def.prod.pi-sign}, this
rewrites as $n!=\prod_{i=1}^{n}i$.)

We shall refer to $n!$ as \textquotedblleft$n$ factorial\textquotedblright.
\end{definition}

We have agreed that empty products are defined to be $1$. Thus, the above
definition of $0!$ yields
\[
0!=1\cdot2\cdot\cdots\cdot0=\left(  \text{empty product}\right)  =1.
\]


Definition \ref{def.factorial} yields the following values for the first few
factorials:%
\begin{align*}
0!  &  =1,\\
1!  &  =1,\\
2!  &  =1\cdot2=2,\\
3!  &  =1\cdot2\cdot3=6,\\
4!  &  =1\cdot2\cdot3\cdot4=24,\\
5!  &  =1\cdot2\cdot3\cdot4\cdot5=120,\\
6!  &  =1\cdot2\cdot3\cdot4\cdot5\cdot6=720,\\
7!  &  =1\cdot2\cdot3\cdot4\cdot5\cdot6\cdot7=5\ 040,\\
8!  &  =1\cdot2\cdot3\cdot4\cdot5\cdot6\cdot7\cdot8=40\ 320.
\end{align*}


Factorials can be computed recursively:

\begin{proposition}
\label{prop.factorial.rec}If $n$ is a positive integer, then $n!=\left(
n-1\right)  !\cdot n$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.factorial.rec}.]Let $n$ be a positive integer.
Then, $n-1\in\mathbb{N}$, so that Definition \ref{def.factorial} yields
$\left(  n-1\right)  !=1\cdot2\cdot\cdots\cdot\left(  n-1\right)  $. But
Definition \ref{def.factorial} also yields%
\[
n!=1\cdot2\cdot\cdots\cdot n=\underbrace{\left(  1\cdot2\cdot\cdots
\cdot\left(  n-1\right)  \right)  }_{=\left(  n-1\right)  !}\cdot\,n=\left(
n-1\right)  !\cdot n.
\]
This proves Proposition \ref{prop.factorial.rec}.
\end{proof}

\begin{exercise}
\label{exe.odd-factorial}Let $n\in\mathbb{N}$. Prove that%
\[
\left(  2n-1\right)  \cdot\left(  2n-3\right)  \cdot\cdots\cdot1=\dfrac
{\left(  2n\right)  !}{2^{n}n!}.
\]
(The left hand side of this equality is understood to be the product of all
odd integers from $1$ to $2n-1$.)
\end{exercise}

\subsubsection{Definition of binomial coefficients}

From now on, the word \textquotedblleft number\textquotedblright\ (as in
\textquotedblleft Let $n$ be any number\textquotedblright, without any further
specification) will mean an integer or a rational number or a real number or a
complex number, depending on the generality in which you want to work.

Let us now define binomial coefficients.

\begin{definition}
\label{def.binom.def}Let $n$ and $k$ be any two numbers. We define a number
$\dbinom{n}{k}$ as follows:

\begin{itemize}
\item If $k\in\mathbb{N}$, then we set%
\begin{equation}
\dbinom{n}{k}=\dfrac{n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(
n-k+1\right)  }{k!}. \label{eq.def.binom.def.a}%
\end{equation}


\item If $k\notin\mathbb{N}$, then we set%
\begin{equation}
\dbinom{n}{k}=0. \label{eq.def.binom.def.b}%
\end{equation}

\end{itemize}

We call $\dbinom{n}{k}$ a \emph{binomial coefficient}, and we refer to it as
\textquotedblleft$n$ \emph{choose} $k$\textquotedblright.
\end{definition}

This definition is standard across significant parts of the literature; in
particular, it is followed in the book \cite{GKP} (whose entire Chapter 5 is
devoted to binomial coefficients), in the book \cite{Comtet74} (one of the
classics on enumerative combinatorics and binomial identities), and in
\cite{detnotes}. Some other authors use other definitions. All definitions I
am aware of are equivalent in the \textquotedblleft core
region\textquotedblright\ of the binomial coefficients -- that is, in the case
when $n\in\mathbb{N}$ and $k\in\left\{  0,1,\ldots,n\right\}  $. However, some
definitions yield values differing from ours when $n<0$. Many authors prefer
to define $\dbinom{n}{k}$ only for $n\in\mathbb{N}$, or only for
$k\in\mathbb{N}$, or even only in the most restrictive case (when
$n\in\mathbb{N}$ and $k\in\left\{  0,1,\ldots,n\right\}  $). Loehr, in
\cite{Loehr-BC}, seems to avoid defining $\dbinom{n}{k}$ for negative $n$ at
all, despite this case being rather useful (as we will see soon).

Some authors use notations like $C_{k}^{n}$ or $^{n}C_{k}$ or $_{n}C_{k}$ for
$\dbinom{n}{k}$.

We shall later see why the words \textquotedblleft binomial
coefficient\textquotedblright\ and \textquotedblleft choose\textquotedblright%
\ are appropriate for $\dbinom{n}{k}$.

Definition \ref{def.binom.def} does not contradict our earlier definition
(\ref{def.intro.powersums.mchoosek=}) of binomial coefficients (but merely
extends it to a more general setting). Indeed, the product $k\left(
k-1\right)  \left(  k-2\right)  \cdots1$ in the denominator of
(\ref{def.intro.powersums.mchoosek=}) is precisely the $k!$ in the denominator
of (\ref{eq.def.binom.def.a}) (since $k!=1\cdot2\cdot\cdots\cdot k=k\left(
k-1\right)  \left(  k-2\right)  \cdots1$).

\begin{fineprint}
\textbf{Caution:} The notation $\dbinom{n}{k}$ for a binomial coefficient
risks getting confused for the two-line notation for a map (if the domain of
the map is a $1$-element set) or for a column vector with $2$ entries. In
practice, this kind of confusion rarely happens, but its possibility should be
kept in mind.
\end{fineprint}

\begin{example}
\label{exa.binom.small}Let us see some consequences of Definition
\ref{def.binom.def}.

\textbf{(a)} For any number $n$, we have%
\begin{align}
\dbinom{n}{0}  &  =\dfrac{n\left(  n-1\right)  \left(  n-2\right)
\cdots\left(  n-0+1\right)  }{0!}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{eq.def.binom.def.a}), applied to }k=0\right) \nonumber\\
&  =\dfrac{1}{1}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since }n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(
n-0+1\right)  =\left(  \text{empty product}\right)  =1\\
\text{ and }0!=1
\end{array}
\right) \nonumber\\
&  =1. \label{eq.exa.binom.small.nC0}%
\end{align}


\textbf{(b)} For any number $n$, we have%
\begin{align}
\dbinom{n}{1}  &  =\dfrac{n\left(  n-1\right)  \left(  n-2\right)
\cdots\left(  n-1+1\right)  }{1!}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{eq.def.binom.def.a}), applied to }k=1\right) \nonumber\\
&  =\dfrac{n}{1}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }n\left(  n-1\right)
\left(  n-2\right)  \cdots\left(  n-1+1\right)  =n\text{ and }1!=1\right)
\nonumber\\
&  =n. \label{eq.exa.binom.small.nC1}%
\end{align}


\textbf{(c)} For any number $n$, we have%
\begin{align}
\dbinom{n}{2}  &  =\dfrac{n\left(  n-1\right)  \left(  n-2\right)
\cdots\left(  n-2+1\right)  }{2!}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{eq.def.binom.def.a}), applied to }k=2\right) \nonumber\\
&  =\dfrac{n\left(  n-1\right)  }{2}. \label{eq.exa.binom.small.nC2}%
\end{align}


\textbf{(d)} For any number $n$, we have
\[
\dbinom{n}{3}=\dfrac{n\left(  n-1\right)  \left(  n-2\right)  }{3!}%
=\dfrac{n\left(  n-1\right)  \left(  n-2\right)  }{6}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{likewise}\right)  .
\]


\textbf{(e)} The equality (\ref{eq.def.binom.def.a}) (applied to $n=-1$ and
$k=5$) yields%
\begin{align*}
\dbinom{-1}{5}  &  =\dfrac{\left(  -1\right)  \left(  -1-1\right)  \left(
-1-2\right)  \cdots\left(  -1-5+1\right)  }{5!}=\dfrac{\left(  -1\right)
\left(  -2\right)  \left(  -3\right)  \left(  -4\right)  \left(  -5\right)
}{5!}\\
&  =\dfrac{\left(  -1\right)  \left(  -2\right)  \left(  -3\right)  \left(
-4\right)  \left(  -5\right)  }{1\cdot2\cdot3\cdot4\cdot5}=-1.
\end{align*}


\textbf{(f)} More generally, for any $k\in\mathbb{N}$, we have%
\begin{align}
\dbinom{-1}{k}  &  =\dfrac{\left(  -1\right)  \left(  -1-1\right)  \left(
-1-2\right)  \cdots\left(  -1-k+1\right)  }{k!}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{eq.def.binom.def.a}), applied to }n=-1\right) \nonumber\\
&  =\dfrac{\left(  -1\right)  \left(  -2\right)  \cdots\left(  -k\right)
}{k!}=\dfrac{\left(  -1\right)  \left(  -2\right)  \cdots\left(  -k\right)
}{1\cdot2\cdot\cdots\cdot k}\nonumber\\
&  =\left(  -1\right)  ^{k}\label{eq.exa.binom.small.-1Ck}\\
&  =%
\begin{cases}
1, & \text{if }k\text{ is even;}\\
-1, & \text{if }k\text{ is odd}%
\end{cases}
.\nonumber
\end{align}


\textbf{(g)} The equality (\ref{eq.def.binom.def.a}) (applied to $n=\sqrt{2}$
and $k=2$) yields
\[
\dbinom{\sqrt{2}}{2}=\dfrac{\sqrt{2}\left(  \sqrt{2}-1\right)  \left(
\sqrt{2}-2\right)  \cdots\left(  \sqrt{2}-2+1\right)  }{2!}=\dfrac{\sqrt
{2}\left(  \sqrt{2}-1\right)  }{2}.
\]


\textbf{(h)} The equality (\ref{eq.def.binom.def.b}) (applied to $n=2$ and
$k=\sqrt{2}$) yields%
\[
\dbinom{2}{\sqrt{2}}=0,\ \ \ \ \ \ \ \ \ \ \text{since }\sqrt{2}%
\notin\mathbb{N}.
\]

\end{example}

\begin{remark}
\label{rmk.binom.ff}In \cite[Exercise 2]{19f-hw0s}, we have introduced the
notation $n^{\underline{k}}$ (called a \textquotedblleft falling
factorial\textquotedblright) for the product $n\left(  n-1\right)  \left(
n-2\right)  \cdots\left(  n-k+1\right)  $ whenever $n$ is a number and $k$ is
a nonnegative integer. Using this notation, we can rewrite the equality
(\ref{eq.def.binom.def.a}) as%
\begin{equation}
\dbinom{n}{k}=\dfrac{n^{\underline{k}}}{k!}\ \ \ \ \ \ \ \ \ \ \text{for all
numbers }n\text{ and all }k\in\mathbb{N}\text{.} \label{eq.rmk.binom.ff.ff}%
\end{equation}

\end{remark}

\begin{center}
\fbox{\textbf{Class of 2019-10-02}}
\end{center}

\subsubsection{Fundamental properties of the binomial coefficients}

The properties of binomial coefficients are one of the major topics in
enumerative combinatorics. We shall see many of them in this text. Before we
start, let us tabulate the binomial coefficients $\dbinom{n}{k}$ for all
$n\in\left\{  -3,-2,-1,\ldots,6\right\}  $ and some of the $k\in\left\{
0,1,2,3,4,5\right\}  $. In the following table, each row corresponds to a
value of $n$, while each southwest-northeast diagonal corresponds to a value
of $k$:%
\[
\hspace{-0.3cm}%
\begin{tabular}
[c]{ll|ccccccccccccccccc}%
\vphantom{$g^b$} &  & $\phantom{20}$ & $\phantom{20}$ & $\phantom{20}$ &
$\phantom{20}$ &  &  &  &  &  &  & $\overset{k=0}{\swarrow}$ & $\phantom{20}$
& $\overset{k=1}{\swarrow}$ & $\phantom{20}$ & $\overset{k=2}{\swarrow}$ &
$\phantom{20}$ & $\overset{k=3}{\swarrow}$\\\hline
\vphantom{$g^b$} $n=-3$ & $\rightarrow$ &  &  &  &  &  &  &  &  &  & $1$ &  &
$-3$ &  & $6$ &  & $-10$ & \\
\vphantom{$g^b$} $n=-2$ & $\rightarrow$ &  &  &  &  &  &  &  &  & $1$ &  &
$-2$ &  & $3$ &  & $-4$ &  & \\
\vphantom{$g^b$} $n=-1$ & $\rightarrow$ &  &  &  &  &  &  &  & $1$ &  & $-1$ &
& $1$ &  & $-1$ &  & $1$ & \\
\vphantom{$g^b$} $n=0$ & $\rightarrow$ &  &  &  &  &  &  & $1$ &  & $0$ &  &
$0$ &  & $0$ &  & $0$ &  & \\
\vphantom{$g^b$} $n=1$ & $\rightarrow$ &  &  &  &  &  & $1$ &  & $1$ &  & $0$
&  & $0$ &  & $0$ &  & $0$ & \\
\vphantom{$g^b$} $n=2$ & $\rightarrow$ &  &  &  &  & $1$ &  & $2$ &  & $1$ &
& $0$ &  & $0$ &  & $0$ &  & \\
\vphantom{$g^b$} $n=3$ & $\rightarrow$ &  &  &  & $1$ &  & $3$ &  & $3$ &  &
$1$ &  & $0$ &  & $0$ &  & $0$ & \\
\vphantom{$g^b$} $n=4$ & $\rightarrow$ &  &  & $1$ &  & $4$ &  & $6$ &  & $4$
&  & $1$ &  & $0$ &  & $0$ &  & \\
\vphantom{$g^b$} $n=5$ & $\rightarrow$ &  & $1$ &  & $5$ &  & $10$ &  & $10$ &
& $5$ &  & $1$ &  & $0$ &  & $0$ & \\
\vphantom{$g^b$} $n=6$ & $\rightarrow$ & $1$ &  & $6$ &  & $15$ &  & $20$ &  &
$15$ &  & $6$ &  & $1$ &  & $0$ &  &
\end{tabular}
\ \ \ \ \ \
\]


Just by staring at this table, you will discover many properties of
$\dbinom{n}{k}$. For example, all the zeroes in the right half of it suggest
the following fact:

\begin{proposition}
\label{prop.binom.0}Let $n\in\mathbb{N}$ and $k\in\mathbb{R}$ be such that
$k>n$. Then, $\dbinom{n}{k}=0$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.binom.0}.]If $k\notin\mathbb{N}$, then this
follows immediately from (\ref{eq.def.binom.def.b}). Thus, for the rest of
this proof, we WLOG assume that $k\in\mathbb{N}$. Hence,
(\ref{eq.def.binom.def.a}) yields
\begin{equation}
\dbinom{n}{k}=\dfrac{n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(
n-k+1\right)  }{k!}. \label{pf.prop.binom.0.1}%
\end{equation}
But $n\in\left\{  0,1,\ldots,k-1\right\}  $ (since $n\in\mathbb{N}$ and
$k\in\mathbb{N}$ and $k>n$). Hence, one of the factors of the product
$n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(  n-k+1\right)  $ is
$n-n=0$. Therefore, the product $n\left(  n-1\right)  \left(  n-2\right)
\cdots\left(  n-k+1\right)  $ must be $0$ (because if one of the factors of a
product is $0$, then the whole product is $0$). Thus, (\ref{pf.prop.binom.0.1}%
) rewrites as $\dbinom{n}{k}=\dfrac{0}{k!}$. In other words, $\dbinom{n}{k}%
=0$. This proves Proposition \ref{prop.binom.0}.
\end{proof}

\begin{fineprint}
This proof might remind you of the math joke \textquotedblleft simplify
$\left(  x-a\right)  \left(  x-b\right)  \cdots\left(  x-z\right)
$\textquotedblright.\ \ \ \ \footnote{Answer: $0$, because the third factor
from the right is $x-x=0$.}
\end{fineprint}

Note that Proposition \ref{prop.binom.0} no longer holds if we drop the
requirement $n\in\mathbb{N}$. For example, $1>1/2$, yet $\dbinom{1/2}%
{1}=1/2\neq0$. For another example, $1>-1$, yet $\dbinom{-1}{1}=-1\neq0$.

Another pattern that you might guess from the table above is that the binomial
coefficients in the \textquotedblleft negative rows\textquotedblright\ (i.e.,
corresponding to $n=-1$, $n=-2$ and further above) repeat the ones you find in
the nonnegative rows up to sign. More precisely:

\begin{proposition}
[Upper negation formula]\label{prop.binom.upneg}Let $n\in\mathbb{R}$ and
$k\in\mathbb{Z}$. Then,%
\begin{equation}
\dbinom{-n}{k}=\left(  -1\right)  ^{k}\dbinom{n+k-1}{k}.
\label{eq.prop.binom.upneg.claim}%
\end{equation}

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.binom.upneg}.]We must be in one of the
following two cases:

\textit{Case 1:} We have $k\notin\mathbb{N}$.

\textit{Case 2:} We have $k\in\mathbb{N}$.

Let us first consider Case 1. In this case, we have $k\notin\mathbb{N}$. Thus,
both binomial coefficients $\dbinom{-n}{k}$ and $\dbinom{n+k-1}{k}$ equal $0$
(by applying (\ref{eq.def.binom.def.b})). Hence, the equality
(\ref{eq.prop.binom.upneg.claim}) rewrites as $0=\left(  -1\right)  ^{k}%
\cdot0$, which is clearly true. Thus, we have proven
(\ref{eq.prop.binom.upneg.claim}) in Case 1. In other words, Proposition
\ref{prop.binom.upneg} is proven in Case 1.

Let us now consider Case 2. In this case, we have $k\in\mathbb{N}$. Thus,
(\ref{eq.def.binom.def.a}) (applied to $-n$ instead of $n$) yields%
\begin{equation}
\dbinom{-n}{k}=\dfrac{\left(  -n\right)  \left(  -n-1\right)  \left(
-n-2\right)  \cdots\left(  -n-k+1\right)  }{k!}. \label{pf.prop.binom.upneg.1}%
\end{equation}
Now, let us rewrite the numerator on the right hand side:%
\begin{align*}
&  \left(  -n\right)  \left(  -n-1\right)  \left(  -n-2\right)  \cdots\left(
-n-k+1\right) \\
&  =\left(  -1\right)  ^{k}\cdot\underbrace{\left(  n\left(  n+1\right)
\left(  n+2\right)  \cdots\left(  n+k-1\right)  \right)  }_{\substack{=\left(
n+k-1\right)  \left(  n+k-2\right)  \left(  n+k-3\right)  \cdots
n\\\text{(here, we have turned the product around)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have
factored out a }-1\text{ from each of the }k\text{ factors}\right) \\
&  =\left(  -1\right)  ^{k}\cdot\left(  \left(  n+k-1\right)  \left(
n+k-2\right)  \left(  n+k-3\right)  \cdots n\right)  .
\end{align*}
Thus, (\ref{pf.prop.binom.upneg.1}) rewrites as%
\begin{equation}
\dbinom{-n}{k}=\dfrac{\left(  -1\right)  ^{k}\cdot\left(  \left(
n+k-1\right)  \left(  n+k-2\right)  \left(  n+k-3\right)  \cdots n\right)
}{k!}. \label{pf.prop.binom.upneg.2}%
\end{equation}


On the other hand, (\ref{eq.def.binom.def.a}) (applied to $n+k-1$ instead of
$n$) yields%
\begin{align*}
\dbinom{n+k-1}{k}  &  =\dfrac{\left(  n+k-1\right)  \left(  n+k-2\right)
\left(  n+k-3\right)  \cdots\left(  n+k-1-k+1\right)  }{k!}\\
&  =\dfrac{\left(  n+k-1\right)  \left(  n+k-2\right)  \left(  n+k-3\right)
\cdots n}{k!}.
\end{align*}
Multiplying this equality by $\left(  -1\right)  ^{k}$, we find%
\begin{align*}
\left(  -1\right)  ^{k}\dbinom{n+k-1}{k}  &  =\left(  -1\right)  ^{k}%
\cdot\dfrac{\left(  n+k-1\right)  \left(  n+k-2\right)  \left(  n+k-3\right)
\cdots n}{k!}\\
&  =\dfrac{\left(  -1\right)  ^{k}\cdot\left(  \left(  n+k-1\right)  \left(
n+k-2\right)  \left(  n+k-3\right)  \cdots n\right)  }{k!}.
\end{align*}
Comparing this with (\ref{pf.prop.binom.upneg.2}), we obtain $\dbinom{-n}%
{k}=\left(  -1\right)  ^{k}\dbinom{n+k-1}{k}$. Thus, Proposition
\ref{prop.binom.upneg} is proven in Case 2.
\end{proof}

Proposition \ref{prop.binom.upneg} and Proposition \ref{prop.binom.0} show
that much of our above table of binomial coefficients is redundant. In order
to know all $\dbinom{n}{k}$ with $n\in\mathbb{Z}$ and $k\in\mathbb{N}$, it
suffices to tabulate the values $\dbinom{n}{k}$ for $n\in\mathbb{N}$ and
$k\in\left\{  0,1,\ldots,n\right\}  $. Let us do this here for $n\in\left\{
0,1,\ldots,8\right\}  $:%
\[
\hspace{-0.3cm}%
\begin{tabular}
[c]{ll|ccccccccccccccccc}%
\vphantom{$\overset{k=0}{\swarrow}$} &  & $\phantom{20}$ & $\phantom{20}$ &
$\phantom{20}$ & $\phantom{20}$ & $\phantom{20}$ & $\phantom{20}$ &  &  &  &
$\overset{k=0}{\swarrow}$ & $\phantom{20}$ & $\phantom{20}$ & $\phantom{20}$ &
$\phantom{20}$ & $\phantom{20}$ & $\phantom{20}$ & $\phantom{20}$\\
\vphantom{$\overset{k=0}{\swarrow}$}$n=0$ & $\rightarrow$ &  &  &  &  &  &  &
&  & $1$ &  & $\overset{k=1}{\swarrow}$ &  &  &  &  &  & \\
\vphantom{$\overset{k=0}{\swarrow}$}$n=1$ & $\rightarrow$ &  &  &  &  &  &  &
& $1$ &  & $1$ &  & $\overset{k=2}{\swarrow}$ &  &  &  &  & \\
\vphantom{$\overset{k=0}{\swarrow}$}$n=2$ & $\rightarrow$ &  &  &  &  &  &  &
$1$ &  & $2$ &  & $1$ &  & $\overset{k=3}{\swarrow}$ &  &  &  & \\
\vphantom{$\overset{k=0}{\swarrow}$}$n=3$ & $\rightarrow$ &  &  &  &  &  & $1$
&  & $3$ &  & $3$ &  & $1$ &  & $\overset{k=4}{\swarrow}$ &  &  & \\
\vphantom{$\overset{k=0}{\swarrow}$}$n=4$ & $\rightarrow$ &  &  &  &  & $1$ &
& $4$ &  & $6$ &  & $4$ &  & $1$ &  & $\overset{k=5}{\swarrow}$ &  & \\
\vphantom{$\overset{k=0}{\swarrow}$}$n=5$ & $\rightarrow$ &  &  &  & $1$ &  &
$5$ &  & $10$ &  & $10$ &  & $5$ &  & $1$ &  & $\overset{k=6}{\swarrow}$ & \\
\vphantom{$\overset{k=0}{\swarrow}$}$n=6$ & $\rightarrow$ &  &  & $1$ &  & $6$
&  & $15$ &  & $20$ &  & $15$ &  & $6$ &  & $1$ &  & $\overset{k=7}{\swarrow}%
$\\
\vphantom{$\overset{k=0}{\swarrow}$}$n=7$ & $\rightarrow$ &  & $1$ &  & $7$ &
& $21$ &  & $35$ &  & $35$ &  & $21$ &  & $7$ &  & $1$ & \\
\vphantom{$\overset{k=0}{\swarrow}$}$n=8$ & $\rightarrow$ & $1$ &  & $8$ &  &
$28$ &  & $56$ &  & $70$ &  & $56$ &  & $28$ &  & $8$ &  & $1$%
\end{tabular}
\ \ \ \ \
\]
This table is called \emph{Pascal's triangle} due to its triangular form.

One of the most fundamental properties of Pascal's triangle is that each
number in it is the sum of the two numbers above it (i.e., the number
above-left from it, and the number above-right from it). For example,
$56=21+35$. This holds even for the $1$'s on the sides of the triangle, if you
extend the triangle to include the binomial coefficients $\dbinom{n}{k}$ with
$n<0$ or $k<0$ or $k<n$. More generally, this holds for all binomial
coefficients $\dbinom{n}{k}$ -- not just for the ones that fit in Pascal's triangle:

\begin{theorem}
[Recurrence of the binomial coefficients]\label{thm.binom.rec}Let
$n\in\mathbb{R}$ and $k\in\mathbb{R}$. Then,%
\[
\dbinom{n}{k}=\dbinom{n-1}{k-1}+\dbinom{n-1}{k}.
\]

\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.binom.rec}.]We are in one of the following three cases:

\textit{Case 1:} We have $k\in\left\{  1,2,3,\ldots\right\}  $.

\textit{Case 2:} We have $k=0$.

\textit{Case 3:} We have $k\notin\mathbb{N}$.

(There are no other cases, because each $k\in\mathbb{N}$ fits either into Case
1 or into Case 2, whereas each $k\notin\mathbb{N}$ fits into Case 3.)

Let us first consider Case 3. In this case, we have $k\notin\mathbb{N}$.
Hence, $k-1\notin\mathbb{N}$. Thus, an application of
(\ref{eq.def.binom.def.b}) shows that $\dbinom{n-1}{k-1}=0$. Likewise, from
$k\notin\mathbb{N}$, we obtain $\dbinom{n}{k}=0$ and $\dbinom{n-1}{k}=0$. But
we must prove the equality $\dbinom{n}{k}=\dbinom{n-1}{k-1}+\dbinom{n-1}{k}$.
In view of the three equalities we just showed ($\dbinom{n-1}{k-1}=0$ and
$\dbinom{n}{k}=0$ and $\dbinom{n-1}{k}=0$), this rewrites as $0=0+0$, which of
course is true. Thus, Theorem \ref{thm.binom.rec} is proven in Case 3.

Let us next consider Case 2. In this case, we have $k=0$. Thus, $\dbinom{n}%
{k}=\dbinom{n}{0}=1$ (by (\ref{eq.exa.binom.small.nC0})). Likewise,
$\dbinom{n-1}{k}=1$. Also, $\underbrace{k}_{=0}-1=-1\notin\mathbb{N}$, and
thus $\dbinom{n-1}{k-1}=0$ (by an application of (\ref{eq.def.binom.def.b})).
But we must prove the equality $\dbinom{n}{k}=\dbinom{n-1}{k-1}+\dbinom
{n-1}{k}$. In view of the three equalities we just showed ($\dbinom{n-1}%
{k-1}=0$ and $\dbinom{n}{k}=1$ and $\dbinom{n-1}{k}=1$), this rewrites as
$1=0+1$, which of course is true. Thus, Theorem \ref{thm.binom.rec} is proven
in Case 2.

Let us finally consider Case 1. In this case, we have $k\in\left\{
1,2,3,\ldots\right\}  $. Hence, Proposition \ref{prop.factorial.rec} yields
$k!=\left(  k-1\right)  !\cdot k$. Furthermore, both $k$ and $k-1$ belong to
$\mathbb{N}$ (since $k\in\left\{  1,2,3,\ldots\right\}  $). Hence, all three
binomial coefficients $\dbinom{n}{k}$ and $\dbinom{n-1}{k}$ and $\dbinom
{n-1}{k-1}$ are defined using the formula (\ref{eq.def.binom.def.a}) (applied
to the appropriate numbers). Explicitly:%
\begin{align}
\dbinom{n}{k}  &  =\dfrac{n\left(  n-1\right)  \left(  n-2\right)
\cdots\left(  n-k+1\right)  }{k!}\nonumber\\
&  =\dfrac{n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(
n-k+1\right)  }{\left(  k-1\right)  !\cdot k}\label{pf.thm.binom.rec.nCk}\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{since }k!=\left(
k-1\right)  !\cdot k\right) \nonumber
\end{align}
and%
\begin{align}
\dbinom{n-1}{k}  &  =\dfrac{\left(  n-1\right)  \left(  n-2\right)  \left(
n-3\right)  \cdots\left(  \left(  n-1\right)  -k+1\right)  }{k!}\nonumber\\
&  =\dfrac{\left(  n-1\right)  \left(  n-2\right)  \left(  n-3\right)
\cdots\left(  n-k\right)  }{k!}\nonumber\\
&  =\dfrac{\left(  \left(  n-1\right)  \left(  n-2\right)  \left(  n-3\right)
\cdots\left(  n-k+1\right)  \right)  \cdot\left(  n-k\right)  }{k!}\nonumber\\
&  =\dfrac{\left(  \left(  n-1\right)  \left(  n-2\right)  \left(  n-3\right)
\cdots\left(  n-k+1\right)  \right)  \cdot\left(  n-k\right)  }{\left(
k-1\right)  !\cdot k}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{since }k!=\left(
k-1\right)  !\cdot k\right) \nonumber\\
&  =\dfrac{\left(  n-1\right)  \left(  n-2\right)  \left(  n-3\right)
\cdots\left(  n-k+1\right)  }{\left(  k-1\right)  !}\cdot\dfrac{n-k}{k}
\label{pf.thm.binom.rec.n-1Ck}%
\end{align}
and%
\begin{align}
\dbinom{n-1}{k-1}  &  =\dfrac{\left(  n-1\right)  \left(  n-2\right)  \left(
n-3\right)  \cdots\left(  \left(  n-1\right)  -\left(  k-1\right)  +1\right)
}{\left(  k-1\right)  !}\nonumber\\
&  =\dfrac{\left(  n-1\right)  \left(  n-2\right)  \left(  n-3\right)
\cdots\left(  n-k+1\right)  }{\left(  k-1\right)  !}.
\label{pf.thm.binom.rec.n-1Ck-1}%
\end{align}


Adding the equalities (\ref{pf.thm.binom.rec.n-1Ck-1}) and
(\ref{pf.thm.binom.rec.n-1Ck}) together, we obtain%
\begin{align*}
&  \dbinom{n-1}{k-1}+\dbinom{n-1}{k}\\
&  =\dfrac{\left(  n-1\right)  \left(  n-2\right)  \left(  n-3\right)
\cdots\left(  n-k+1\right)  }{\left(  k-1\right)  !}+\dfrac{\left(
n-1\right)  \left(  n-2\right)  \left(  n-3\right)  \cdots\left(
n-k+1\right)  }{\left(  k-1\right)  !}\cdot\dfrac{n-k}{k}\\
&  =\dfrac{\left(  n-1\right)  \left(  n-2\right)  \left(  n-3\right)
\cdots\left(  n-k+1\right)  }{\left(  k-1\right)  !}\underbrace{\left(
1+\dfrac{n-k}{k}\right)  }_{=\dfrac{n}{k}}\\
&  =\dfrac{\left(  n-1\right)  \left(  n-2\right)  \left(  n-3\right)
\cdots\left(  n-k+1\right)  }{\left(  k-1\right)  !}\cdot\dfrac{n}{k}\\
&  =\dfrac{n\cdot\left(  \left(  n-1\right)  \left(  n-2\right)  \left(
n-3\right)  \cdots\left(  n-k+1\right)  \right)  }{\left(  k-1\right)  !\cdot
k}\\
&  =\dfrac{n\left(  n-1\right)  \left(  n-2\right)  \left(  n-3\right)
\cdots\left(  n-k+1\right)  }{\left(  k-1\right)  !\cdot k}\\
&  =\dfrac{n\left(  n-1\right)  \left(  n-2\right)  \left(  n-3\right)
\cdots\left(  n-k+1\right)  }{k!}\ \ \ \ \ \ \ \ \ \ \left(  \text{since
}\left(  k-1\right)  !\cdot k=k!\right)  ;\\
&  =\dbinom{n}{k}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.thm.binom.rec.nCk})}\right)  .
\end{align*}
Thus, Theorem \ref{thm.binom.rec} is proven in Case 1 as well.

We have thus proven Theorem \ref{thm.binom.rec} in all three Cases 1, 2 and 3.
\end{proof}

\href{https://en.wikipedia.org/wiki/Pascal's_triangle}{The Wikipedia page for
Pascal's triangle} includes many pictures of Pascal's triangle as well as
numerous remarkable properties.

\begin{theorem}
[Factorial formula for the binomial coefficients]\label{thm.binom.fac}Let
$n\in\mathbb{N}$ and $k\in\mathbb{N}$ be such that $k\leq n$. Then,%
\[
\dbinom{n}{k}=\dfrac{n!}{k!\cdot\left(  n-k\right)  !}.
\]

\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.binom.fac}.]Multiplying the equality
(\ref{eq.def.binom.def.a}) with $k!\cdot\left(  n-k\right)  !$, we obtain%
\begin{align*}
k!\cdot\left(  n-k\right)  !\cdot\dbinom{n}{k}  &  =k!\cdot\left(  n-k\right)
!\cdot\dfrac{n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(
n-k+1\right)  }{k!}\\
&  =\underbrace{\left(  n-k\right)  !}_{\substack{=1\cdot2\cdot\cdots
\cdot\left(  n-k\right)  \\\text{(by the definition of }\left(  n-k\right)
!\text{)}}}\cdot\,\underbrace{\left(  n\left(  n-1\right)  \left(  n-2\right)
\cdots\left(  n-k+1\right)  \right)  }_{\substack{=\left(  n-k+1\right)
\cdot\left(  n-k+2\right)  \cdot\cdots\cdot n\\\text{(here, we have turned the
product around)}}}\\
&  =\left(  1\cdot2\cdot\cdots\cdot\left(  n-k\right)  \right)  \cdot\left(
\left(  n-k+1\right)  \cdot\left(  n-k+2\right)  \cdot\cdots\cdot n\right) \\
&  =1\cdot2\cdot\cdots\cdot n=n!
\end{align*}
(since $n!$ is defined to be $1\cdot2\cdot\cdots\cdot n$). Solving this for
$\dbinom{n}{k}$, we find $\dbinom{n}{k}=\dfrac{n!}{k!\cdot\left(  n-k\right)
!}$. This proves Theorem \ref{thm.binom.fac}.
\end{proof}

\textbf{Warning:} When it applies, Theorem \ref{thm.binom.fac} provides a
simple and highly convenient formula for $\dbinom{n}{k}$. However, Theorem
\ref{thm.binom.fac} only applies when $n\in\mathbb{N}$ and $k\in\mathbb{N}$
and $k\leq n$. Thus, you cannot use Theorem \ref{thm.binom.fac} to compute
$\dbinom{-3}{5}$ or $\dbinom{1/3}{4}$ or $\dbinom{\pi}{\sqrt{2}}$. (There is a
generalization of the factorial called the
\href{https://en.wikipedia.org/wiki/Gamma_function}{Gamma function}, which
does not really alleviate this problem: it would make the right hand side of
Theorem \ref{thm.binom.fac} well-defined most of the time, but the equality
would still not be true in general.)

Some authors use Theorem \ref{thm.binom.fac} as a \textbf{definition} of
$\dbinom{n}{k}$. But, as we just saw, such a definition would only work in the
case when $n\in\mathbb{N}$ and $k\in\mathbb{N}$ and $k\leq n$, so it lacks the
general applicability of our definition of $\dbinom{n}{k}$.

\begin{lemma}
\label{lem.binom.outside-pascal-triangle}Let $n\in\mathbb{N}$ and
$k\in\mathbb{R}$ be such that $k\notin\left\{  0,1,\ldots,n\right\}  $. Then,
$\dbinom{n}{k}=0$.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.binom.outside-pascal-triangle}.]If $k\notin%
\mathbb{N}$, then the claim (that $\dbinom{n}{k}=0$) follows immediately from
(\ref{eq.def.binom.def.b}). Thus, for the rest of this proof, we WLOG assume
that we do have $k\in\mathbb{N}$. Combining this with $k\notin\left\{
0,1,\ldots,n\right\}  $, we obtain $k\in\mathbb{N}\setminus\left\{
0,1,\ldots,n\right\}  =\left\{  n+1,n+2,n+3,\ldots\right\}  $. Hence, $k\geq
n+1>n$. Thus, Proposition \ref{prop.binom.0} yields $\dbinom{n}{k}=0$. This
proves Lemma \ref{lem.binom.outside-pascal-triangle}.
\end{proof}

\begin{theorem}
[Symmetry of the binomial coefficients]\label{thm.binom.sym}Let $n\in
\mathbb{N}$ and $k\in\mathbb{R}$. Then,%
\[
\dbinom{n}{k}=\dbinom{n}{n-k}.
\]

\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.binom.sym}.]We are in one of the following two cases:

\textit{Case 1:} We have $k\in\left\{  0,1,\ldots,n\right\}  $.

\textit{Case 2:} We have $k\notin\left\{  0,1,\ldots,n\right\}  $.

Let us first consider Case 1. In this case, we have $k\in\left\{
0,1,\ldots,n\right\}  $, so that $n-k\in\left\{  0,1,\ldots,n\right\}  $ as
well. Now, Theorem \ref{thm.binom.fac} yields%
\[
\dbinom{n}{k}=\dfrac{n!}{k!\cdot\left(  n-k\right)  !}.
\]
Meanwhile, Theorem \ref{thm.binom.fac} (applied to $n-k$ instead of $k$)
yields%
\begin{align*}
\dbinom{n}{n-k}  &  =\dfrac{n!}{\left(  n-k\right)  !\cdot\left(  n-\left(
n-k\right)  \right)  !}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }n-k\in\left\{
0,1,\ldots,n\right\}  \right) \\
&  =\dfrac{n!}{\left(  n-\left(  n-k\right)  \right)  !\cdot\left(
n-k\right)  !}=\dfrac{n!}{k!\cdot\left(  n-k\right)  !}%
\end{align*}
(since $n-\left(  n-k\right)  =k$). Comparing these two equalities, we obtain
$\dbinom{n}{k}=\dbinom{n}{n-k}$. Thus, Theorem \ref{thm.binom.sym} is proven
in Case 1.

Let us now consider Case 2. In this case, we have $k\notin\left\{
0,1,\ldots,n\right\}  $. Hence, we have $n-k\notin\left\{  0,1,\ldots
,n\right\}  $ as well\footnote{because otherwise, we would have $n-k\in
\left\{  0,1,\ldots,n\right\}  $ and thus $n-\left(  n-k\right)  \in\left\{
0,1,\ldots,n\right\}  $, which would contradict $n-\left(  n-k\right)
=k\notin\left\{  0,1,\ldots,n\right\}  $}. Thus, Lemma
\ref{lem.binom.outside-pascal-triangle} (applied to $n-k$ instead of $k$)
yields $\dbinom{n}{n-k}=0$. But Lemma \ref{lem.binom.outside-pascal-triangle}
also yields $\dbinom{n}{k}=0$. Comparing these two equalities, we obtain
$\dbinom{n}{k}=\dbinom{n}{n-k}$. Thus, Theorem \ref{thm.binom.sym} is proven
in Case 2.

We have now proven Theorem \ref{thm.binom.sym} in both possible cases.
\end{proof}

Theorem \ref{thm.binom.sym} is known as the \emph{symmetry of binomial
coefficients} or the \emph{symmetry of Pascal's triangle}.

\textbf{Warning:} Theorem \ref{thm.binom.sym} does not hold for negative $n$.
For example, $\dbinom{-1}{1}=-1$ does not equal $\dbinom{-1}{\left(
-1\right)  -1}=\dbinom{-1}{-2}=0$.

\begin{exercise}
\label{exe.binom.nn}Let $n\in\mathbb{N}$. Prove that $\dbinom{n}{n}=1$.
\end{exercise}

\begin{center}
\fbox{\textbf{Class of 2019-10-04}}
\end{center}

\subsubsection{Binomial coefficients count subsets}

The following theorem is one of the central properties of binomial coefficients:

\begin{theorem}
[Combinatorial interpretation of the binomial coefficients]%
\label{thm.binom.comb}Let $n\in\mathbb{N}$ and $k\in\mathbb{R}$. Let $S$ be an
$n$-element set. Then,%
\[
\dbinom{n}{k}=\left(  \text{\# of }k\text{-element subsets of }S\right)  .
\]

\end{theorem}

\begin{example}
\textbf{(a)} Let $n=4$ and $k=2$ and $S=\left\{  1,2,3,4\right\}  $. Then, the
$2$-element subsets of $S$ are $\left\{  1,2\right\}  $, $\left\{
1,3\right\}  $, $\left\{  1,4\right\}  $, $\left\{  2,3\right\}  $, $\left\{
2,4\right\}  $ and $\left\{  3,4\right\}  $. The \# of these subsets is
$6=\dbinom{4}{2}$, which is exactly what Theorem \ref{thm.binom.comb} predicts.

\textbf{(b)} Now, let $k=5$ instead (while $n$ is still $4$, and $S$ is still
$\left\{  1,2,3,4\right\}  $). Then, there are no $5$-element subsets of $S$,
since $S$ only has $4$ elements. Thus, the \# of these $5$-element subsets is
$0=\dbinom{4}{5}$, which is exactly what Theorem \ref{thm.binom.comb} predicts.
\end{example}

Theorem \ref{thm.binom.comb} is the reason why $\dbinom{n}{k}$ is called
\textquotedblleft$n$ choose $k$\textquotedblright: It is the number of ways to
\textbf{choose} $k$ distinct elements (without an order) from $n$ given
elements. The $k$-element subsets of $S$ are called the $k$%
\emph{-combinations} of $S$.

\textbf{Warning:} Theorem \ref{thm.binom.comb} says nothing about $\dbinom
{n}{k}$ when $n\notin\mathbb{N}$.

Before we prove Theorem \ref{thm.binom.comb}, let us state a simple lemma:

\begin{lemma}
\label{lem.binom.0Ck}Let $k\in\mathbb{R}$. Then, $\dbinom{0}{k}=\left[
k=0\right]  $.
\end{lemma}

Here, we are using the so-called
\href{https://en.wikipedia.org/wiki/Iverson_bracket}{\emph{Iverson bracket
notation}}:

\begin{definition}
\label{def.iverson}If $\mathcal{A}$ is any logical statement, then we define
an integer $\left[  \mathcal{A}\right]  \in\left\{  0,1\right\}  $ by%
\[
\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[  1+1=2\right]  =1$ (since $1+1=2$ is true), whereas
$\left[  1+1=1\right]  =0$ (since $1+1=1$ is false).

If $\mathcal{A}$ is any logical statement, then the integer $\left[
\mathcal{A}\right]  $ is known as the \emph{truth value} of $\mathcal{A}$.
\end{definition}

\begin{proof}
[Proof of Lemma \ref{lem.binom.0Ck}.]From (\ref{eq.exa.binom.small.nC0}), we
obtain $\dbinom{0}{0}=1$. But $\left[  0=0\right]  =1$ (since $0=0$ is true).
Comparing these two equalities, we obtain $\dbinom{0}{0}=\left[  0=0\right]
$. This shows that Lemma \ref{lem.binom.0Ck} is true for $k=0$. Hence, for the
rest of this proof, we WLOG assume that $k\neq0$. Thus, the statement $k=0$ is
false. Hence, $\left[  k=0\right]  =0$. On the other hand, from $k\neq0$, we
obtain $k\notin\left\{  0\right\}  =\left\{  0,1,\ldots,0\right\}  $.
Therefore, Lemma \ref{lem.binom.outside-pascal-triangle} (applied to $n=0$)
yields $\dbinom{0}{k}=0$. Comparing this with $\left[  k=0\right]  =0$, we
obtain $\dbinom{0}{k}=\left[  k=0\right]  $. This proves Lemma
\ref{lem.binom.0Ck}.
\end{proof}

\begin{proof}
[Proof of Theorem \ref{thm.binom.comb}.]Forget that we fixed $n$, $k$ and $S$.
(This means that instead of considering $n$ and $k$ as fixed numbers and $S$
as a fixed set, we imagine that Theorem \ref{thm.binom.comb} begins with the
words \textquotedblleft For all $n\in\mathbb{N}$ and $k\in\mathbb{R}$ and any
$n$-element set $S$\textquotedblright. Thus we are proving the same theorem,
but we have the freedom to change our value of $k$ in the proof.)

We proceed by induction on $n$:

\textit{Induction base:} If $S$ is a $0$-element set, then $S=\varnothing$ and
thus%
\begin{align*}
&  \left(  \#\text{ of }k\text{-element subsets of }S\right) \\
&  =\left(  \#\text{ of }k\text{-element subsets of }\varnothing\right) \\
&  =%
\begin{cases}
1, & \text{if }k=0;\\
0, & \text{if }k\neq0
\end{cases}
\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since the empty set }\varnothing\text{ has only one subset,}\\
\text{namely the }0\text{-element subset }\varnothing
\end{array}
\right) \\
&  =\left[  k=0\right]  \ \ \ \ \ \ \ \ \ \ \left(  \text{since the definition
of }\left[  k=0\right]  \text{ yields }\left[  k=0\right]  =%
\begin{cases}
1, & \text{if }k=0;\\
0, & \text{if }k\neq0
\end{cases}
\right) \\
&  =\dbinom{0}{k}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Lemma
\ref{lem.binom.0Ck}}\right)
\end{align*}
for each $k\in\mathbb{R}$. In other words, for any $k\in\mathbb{R}$ and any
$0$-element set $S$, we have $\dbinom{0}{k}=\left(  \#\text{ of }%
k\text{-element subsets of }S\right)  $. Thus, Theorem \ref{thm.binom.comb} is
proven for $n=0$. This completes the induction base.

\textit{Induction step:} Let $m\in\mathbb{N}$. Assume (as the induction
hypothesis) that Theorem \ref{thm.binom.comb} holds for $n=m$. (This means
\textquotedblleft for $n=m$ and for all values of $k\in\mathbb{R}$ and all
$n$-element sets $S$\textquotedblright, because $k$ and $S$ are not fixed.
This is important, since we will later apply the induction hypothesis to two
different values of $k$.)

Let $k\in\mathbb{R}$. Let $S$ be an $\left(  m+1\right)  $-element set. We
must prove that%
\[
\dbinom{m+1}{k}=\left(  \text{\# of }k\text{-element subsets of }S\right)  .
\]


The set $S$ is an $\left(  m+1\right)  $-element set; thus, its size is
$\left\vert S\right\vert =m+1\geq1>0$. Hence, the set $S$ is nonempty, i.e.,
there exists a $t\in S$. Fix such a $t$.

Now, we shall call a subset of $S$

\begin{itemize}
\item \textbf{red} if it contains $t$, and

\item \textbf{green} if it does not contain $t$.
\end{itemize}

\noindent Thus, each subset of $S$ is either red or green (but not both at the
same time). Thus, by the sum rule, we have%
\begin{align*}
&  \left(  \text{\# of }k\text{-element subsets of }S\right) \\
&  =\left(  \text{\# of }k\text{-element red subsets of }S\right)  +\left(
\text{\# of }k\text{-element green subsets of }S\right)  .
\end{align*}
We shall now compute the two addends on the right hand side.

The green subsets of $S$ are the subsets of $S$ that don't contain $t$. In
other words, the green subsets of $S$ are exactly the subsets of
$S\setminus\left\{  t\right\}  $. Hence,%
\begin{align}
&  \left(  \text{\# of }k\text{-element green subsets of }S\right) \nonumber\\
&  =\left(  \text{\# of }k\text{-element subsets of }S\setminus\left\{
t\right\}  \right)  . \label{pf.thm.binom.comb.green1}%
\end{align}


But $S$ is an $\left(  m+1\right)  $-element set, and thus $S\setminus\left\{
t\right\}  $ is an $m$-element set (since $t\in S$). Hence, our induction
hypothesis shows that Theorem \ref{thm.binom.comb} can be applied to $m$ and
$S\setminus\left\{  t\right\}  $ instead of $n$ and $S$. We thus obtain
\[
\dbinom{m}{k}=\left(  \text{\# of }k\text{-element subsets of }S\setminus
\left\{  t\right\}  \right)  .
\]
Comparing this with (\ref{pf.thm.binom.comb.green1}), we find%
\begin{equation}
\left(  \text{\# of }k\text{-element green subsets of }S\right)  =\dbinom
{m}{k}. \label{pf.thm.binom.comb.green-done}%
\end{equation}


What about the red subsets?

Informally, a similar argument works: The red subsets of $S$ are not exactly
the subsets of $S\setminus\left\{  t\right\}  $, but they \textquotedblleft
correspond to\textquotedblright\ the latter in a specific way. Namely, since
the red subsets of $S$ are required to contain $t$, the only \textquotedblleft
information\textquotedblright\ that a red subset of $S$ really
\textquotedblleft carries\textquotedblright\ is what other elements (other
than $t$) it contains. In other words, each red subset $R$ of $S$
\textquotedblleft corresponds to\textquotedblright\ the subset $R\setminus
\left\{  t\right\}  $ of $S\setminus\left\{  t\right\}  $. Note that this
correspondence changes the size of the subset: Namely, if $R$ was a
$k$-element red subset of $S$, then $R\setminus\left\{  t\right\}  $ will be a
$\left(  k-1\right)  $-element subset of $S\setminus\left\{  t\right\}  $.
Thus, the $k$-element red subsets of $S$ \textquotedblleft correspond
to\textquotedblright\ the $\left(  k-1\right)  $-element subsets of
$S\setminus\left\{  t\right\}  $.

Formally, this can be restated as follows: The map%
\begin{align*}
f:\left\{  k\text{-element red subsets of }S\right\}   &  \rightarrow\left\{
\left(  k-1\right)  \text{-element subsets of }S\setminus\left\{  t\right\}
\right\}  ,\\
R  &  \mapsto R\setminus\left\{  t\right\}
\end{align*}
is well-defined and is a bijection. (Indeed, its inverse is%
\begin{align*}
g:\left\{  \left(  k-1\right)  \text{-element subsets of }S\setminus\left\{
t\right\}  \right\}   &  \rightarrow\left\{  k\text{-element red subsets of
}S\right\}  ,\\
P  &  \mapsto P\cup\left\{  t\right\}  .
\end{align*}
It is easy to verify that both the map $f$ and its alleged inverse $g$ are
well-defined\footnote{This means proving the following claims:
\par
\begin{itemize}
\item If $R$ is any $k$-element red subset of $S$, then $R\setminus\left\{
t\right\}  $ is a $\left(  k-1\right)  $-element subset of $S\setminus\left\{
t\right\}  $.
\par
\item If $P$ is any $\left(  k-1\right)  $-element subset of $S\setminus
\left\{  t\right\}  $, then $P\cup\left\{  t\right\}  $ is a $k$-element red
subset of $S$.
\end{itemize}
\par
Both of these are simple exercises in set-theoretic basics.}, and are indeed
mutually inverse\footnote{This means proving the following claims:
\par
\begin{itemize}
\item If $R$ is any $k$-element red subset of $S$, then $\left(
R\setminus\left\{  t\right\}  \right)  \cup\left\{  t\right\}  =R$.
\par
\item If $P$ is any $\left(  k-1\right)  $-element subset of $S\setminus
\left\{  t\right\}  $, then $\left(  P\cup\left\{  t\right\}  \right)
\setminus\left\{  t\right\}  =P$.
\end{itemize}
\par
Both of these are simple exercises in set-theoretic basics.}.) Therefore, the
bijection principle (applied to the bijection $f$) yields%
\begin{align*}
&  \left\vert \left\{  k\text{-element red subsets of }S\right\}  \right\vert
\\
&  =\left\vert \left\{  \left(  k-1\right)  \text{-element subsets of
}S\setminus\left\{  t\right\}  \right\}  \right\vert .
\end{align*}
In other words,%
\begin{align}
&  \left(  \text{\# of }k\text{-element red subsets of }S\right) \nonumber\\
&  =\left(  \text{\# of }\left(  k-1\right)  \text{-element subsets of
}S\setminus\left\{  t\right\}  \right)  . \label{pf.thm.binom.comb.red1}%
\end{align}


But $S\setminus\left\{  t\right\}  $ is an $m$-element set. Hence, our
induction hypothesis shows that Theorem \ref{thm.binom.comb} can be applied to
$m$, $k-1$ and $S\setminus\left\{  t\right\}  $ instead of $n$, $k$ and $S$.
We thus obtain
\[
\dbinom{m}{k-1}=\left(  \text{\# of }\left(  k-1\right)  \text{-element
subsets of }S\setminus\left\{  t\right\}  \right)  .
\]
Comparing this with (\ref{pf.thm.binom.comb.red1}), we find%
\begin{equation}
\left(  \text{\# of }k\text{-element red subsets of }S\right)  =\dbinom
{m}{k-1}. \label{pf.thm.binom.comb.red-done}%
\end{equation}


Now, we can finish our computation of $\left(  \text{\# of }k\text{-element
subsets of }S\right)  $ that we started above:%
\begin{align}
&  \left(  \text{\# of }k\text{-element subsets of }S\right) \nonumber\\
&  =\underbrace{\left(  \text{\# of }k\text{-element red subsets of }S\right)
}_{\substack{=\dbinom{m}{k-1}\\\text{(by (\ref{pf.thm.binom.comb.red-done}))}%
}}+\underbrace{\left(  \text{\# of }k\text{-element green subsets of
}S\right)  }_{\substack{=\dbinom{m}{k}\\\text{(by
(\ref{pf.thm.binom.comb.green-done}))}}}\nonumber\\
&  =\dbinom{m}{k-1}+\dbinom{m}{k}. \label{pf.thm.binom.comb.IS-at}%
\end{align}
On the other hand, Theorem \ref{thm.binom.rec} (applied to $n=m+1$) yields
\[
\dbinom{m+1}{k}=\dbinom{\left(  m+1\right)  -1}{k-1}+\dbinom{\left(
m+1\right)  -1}{k}=\dbinom{m}{k-1}+\dbinom{m}{k}%
\]
(since $\left(  m+1\right)  -1=m$). Comparing this with
(\ref{pf.thm.binom.comb.IS-at}), we find%
\[
\dbinom{m+1}{k}=\left(  \text{\# of }k\text{-element subsets of }S\right)  .
\]


Now, forget that we fixed $k$ and $S$. We thus have shown that every
$k\in\mathbb{R}$ and every $\left(  m+1\right)  $-element set $S$ satisfy%
\[
\dbinom{m+1}{k}=\left(  \text{\# of }k\text{-element subsets of }S\right)  .
\]
In other words, Theorem \ref{thm.binom.comb} holds for $n=m+1$. This completes
the induction step, and thus the proof of Theorem \ref{thm.binom.comb}.
\end{proof}

\begin{exercise}
\label{exe.iverson-prop}Prove the following rules for truth values:

\textbf{(a)} If $\mathcal{A}$ and $\mathcal{B}$ are two equivalent logical
statements, then $\left[  \mathcal{A}\right]  =\left[  \mathcal{B}\right]  $.

\textbf{(b)} If $\mathcal{A}$ is any logical statement, then $\left[
\text{not }\mathcal{A}\right]  =1-\left[  \mathcal{A}\right]  $.

\textbf{(c)} If $\mathcal{A}$ and $\mathcal{B}$ are two logical statements,
then $\left[  \mathcal{A}\wedge\mathcal{B}\right]  =\left[  \mathcal{A}%
\right]  \left[  \mathcal{B}\right]  $.

\textbf{(d)} If $\mathcal{A}$ and $\mathcal{B}$ are two logical statements,
then $\left[  \mathcal{A}\vee\mathcal{B}\right]  =\left[  \mathcal{A}\right]
+\left[  \mathcal{B}\right]  -\left[  \mathcal{A}\right]  \left[
\mathcal{B}\right]  $.

\textbf{(e)} If $\mathcal{A}$, $\mathcal{B}$ and $\mathcal{C}$ are three
logical statements, then%
\[
\left[  \mathcal{A}\vee\mathcal{B}\vee\mathcal{C}\right]  =\left[
\mathcal{A}\right]  +\left[  \mathcal{B}\right]  +\left[  \mathcal{C}\right]
-\left[  \mathcal{A}\right]  \left[  \mathcal{B}\right]  -\left[
\mathcal{A}\right]  \left[  \mathcal{C}\right]  -\left[  \mathcal{B}\right]
\left[  \mathcal{C}\right]  +\left[  \mathcal{A}\right]  \left[
\mathcal{B}\right]  \left[  \mathcal{C}\right]  .
\]


\textbf{(f)} If $\mathcal{A}_{1},\mathcal{A}_{2},\ldots,\mathcal{A}_{k}$ are
$k$ logical statements (for some $k\in\mathbb{N}$), then%
\[
\left[  \mathcal{A}_{1}\wedge\mathcal{A}_{2}\wedge\cdots\wedge\mathcal{A}%
_{k}\right]  =\left[  \mathcal{A}_{1}\right]  \cdot\left[  \mathcal{A}%
_{2}\right]  \cdot\cdots\cdot\left[  \mathcal{A}_{k}\right]  .
\]
(This allows for the possibility of $k=0$, in which case the conjunction
$\mathcal{A}_{1}\wedge\mathcal{A}_{2}\wedge\cdots\wedge\mathcal{A}_{k}$ should
be understood as a true statement.)
\end{exercise}

\subsubsection{Integrality and some arithmetic properties}

All the numbers we have seen in our tables of binomial coefficients are
integers. This is not a coincidence:

\begin{theorem}
[Integrality of the binomial coefficients]\label{thm.binom.ZZ}Let
$n\in\mathbb{Z}$ and $k\in\mathbb{Z}$. Then, $\dbinom{n}{k}\in\mathbb{Z}$.
\end{theorem}

In order to prove this theorem, it is perhaps easiest to start with the case
when $n\in\mathbb{N}$, which we can declare a lemma:

\begin{lemma}
\label{lem.binom.NN}Let $n\in\mathbb{N}$ and $k\in\mathbb{Z}$. Then,
$\dbinom{n}{k}\in\mathbb{N}$.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.binom.NN}.]Let $S=\left\{  1,2,\ldots,n\right\}  $.
Then, $S$ is an $n$-element set. Hence, Theorem \ref{thm.binom.comb} yields
\[
\dbinom{n}{k}=\left(  \text{\# of }k\text{-element subsets of }S\right)
=\left\vert \left\{  \text{all }k\text{-element subsets of }S\right\}
\right\vert \in\mathbb{N}%
\]
(since the size of any finite set is $\in\mathbb{N}$). This proves Lemma
\ref{lem.binom.NN}.
\end{proof}

Alternatively, it is not hard to prove Lemma \ref{lem.binom.NN} by induction
on $n$, using Lemma \ref{lem.binom.0Ck} for the induction base and Theorem
\ref{thm.binom.rec} for the induction step:

\begin{exercise}
\label{exe.binom.NN}Prove Lemma \ref{lem.binom.NN} without using Theorem
\ref{thm.binom.comb}.
\end{exercise}

We can now prove Theorem \ref{thm.binom.ZZ}:

\begin{proof}
[Proof of Theorem \ref{thm.binom.ZZ}.]If $n\in\mathbb{N}$, then the claim of
Theorem \ref{thm.binom.ZZ} is true, because Lemma \ref{lem.binom.NN} yields
$\dbinom{n}{k}\in\mathbb{N}\subseteq\mathbb{Z}$ in this case. Thus, for the
rest of this proof, we WLOG assume that $n\notin\mathbb{N}$. Hence, $n$ is a
\textbf{negative} integer (since $n\in\mathbb{Z}$ but $n\notin\mathbb{N}$).
Therefore, $n\leq-1$, so that $-n\geq1$.

If $k\notin\mathbb{N}$, then the claim of Theorem \ref{thm.binom.ZZ} is true
as well (since (\ref{eq.def.binom.def.b}) yields $\dbinom{n}{k}=0\in
\mathbb{Z}$ in this case). Thus, for the rest of this proof, we WLOG assume
that $k\in\mathbb{N}$. Hence, $k\geq0$.

Now, Proposition \ref{prop.binom.upneg} (applied to $-n$ instead of $n$)
yields%
\[
\dbinom{-\left(  -n\right)  }{k}=\left(  -1\right)  ^{k}\dbinom{-n+k-1}{k}.
\]
In view of $-\left(  -n\right)  =n$, this rewrites as%
\[
\dbinom{n}{k}=\left(  -1\right)  ^{k}\dbinom{-n+k-1}{k}.
\]
But $-n+k-1$ is an integer satisfying $\underbrace{-n}_{\geq1}+\underbrace{k}%
_{\geq0}-1\geq1+0-1=0$. Hence, $-n+k-1\in\mathbb{N}$. Therefore, Lemma
\ref{lem.binom.NN} (applied to $-n+k-1$ instead of $n$) yields $\dbinom
{-n+k-1}{k}\in\mathbb{N}\subseteq\mathbb{Z}$. Hence,
\[
\dbinom{n}{k}=\left(  -1\right)  ^{k}\underbrace{\dbinom{-n+k-1}{k}}%
_{\in\mathbb{Z}}\in\mathbb{Z}%
\]
(since multiplying an integer by $\left(  -1\right)  ^{k}$ clearly results in
an integer). Theorem \ref{thm.binom.ZZ} is thus proven.
\end{proof}

Theorem \ref{thm.binom.ZZ} tells us that the binomial coefficients $\dbinom
{n}{k}$ are integers, as long as $n$ and $k$ are integers\footnote{Of course,
it suffices to assume that $n$ is an integer, since non-integer values of $k$
lead to $\dbinom{n}{k}=0$ anyway. But we won't have much use for this
generality here.}. Thus, it makes sense to ask arithmetical questions about
them, such as questions of divisibility and modular congruence\footnote{See,
e.g., \cite[\S 5.2]{Hammac15}, \cite[\S 9.6]{LeLeMe16} or \cite[\S 2.2]%
{detnotes} for the definition and basic properties of modular congruence
(\textquotedblleft congruence modulo $n$\textquotedblright).}. And there is a
lot to say about such questions:

\begin{theorem}
\label{thm.binom.pmidpCk}Let $p$ be a prime. Let $k\in\left\{  1,2,\ldots
,p-1\right\}  $. Then, $p\mid\dbinom{p}{k}$.
\end{theorem}

Theorem \ref{thm.binom.pmidpCk} says that if $p$ is a prime, then all entries
in the $p$-th row of Pascal's triangle (i.e., all $\dbinom{n}{k}$ with $n=p$)
are divisible by $p$, except for the two entries $\dbinom{p}{0}$ and
$\dbinom{p}{p}$ (which are equal to $1$). This property actually characterizes
primes: If $n>1$ is a composite integer (i.e., not a prime), then at least one
entry in the $n$-th row of Pascal's triangle (except for the entries equal to
$1$) is not divisible by $n$. For example, $\dbinom{4}{2}=6$ is not divisible
by $4$.

We shall not prove Theorem \ref{thm.binom.pmidpCk} here. See, e.g.,
\cite[\S 2.9]{Vorobi02} or \cite[Theorem 2.17.19]{19s} for a proof. We shall
likewise not prove the following two propositions, which provide two quick
recursive algorithms for telling whether a binomial coefficient is even or odd:

\begin{proposition}
\label{prop.binom.2aC2b}Let $a\in\mathbb{N}$ and $b\in\mathbb{N}$. Then:

\textbf{(a)} We have $\dbinom{2a}{2b}\equiv\dbinom{a}{b}\operatorname{mod}2$.

\textbf{(b)} We have $\dbinom{2a+1}{2b}\equiv\dbinom{a}{b}\operatorname{mod}2$.

\textbf{(c)} We have $\dbinom{2a}{2b+1}\equiv0\operatorname{mod}2$.

\textbf{(d)} We have $\dbinom{2a+1}{2b+1}\equiv\dbinom{a}{b}\operatorname{mod}%
2$.
\end{proposition}

\begin{proposition}
\label{prop.binom.2n+aCb}Let $n\in\mathbb{N}$. Let $a,b\in\left\{
0,1,\ldots,2^{n}-1\right\}  $. Then:

\textbf{(a)} We have $\dbinom{2^{n}+a}{b}\equiv\dbinom{a}{b}\operatorname{mod}%
2$.

\textbf{(b)} We have $\dbinom{2^{n}+a}{2^{n}+b}\equiv\dbinom{a}{b}%
\operatorname{mod}2$.
\end{proposition}

Proposition \ref{prop.binom.2aC2b} appears (with proof) in \cite[Exercise
3]{18s-hw1s}; Proposition \ref{prop.binom.2n+aCb} appears (with proof) in
\cite[Exercise 4]{18s-hw1s}. Let us briefly mention a curious consequence of
these propositions, though. Consider Pascal's triangle again, but replace
every odd entry with a \textquotedblleft$\ast$\textquotedblright\ and every
even entry with an empty space:%
\[
\hspace{-0.3cm}%
\begin{tabular}
[c]{ll|ccccccccccccccccc}%
\vphantom{$\overset{k=0}{\swarrow}$} &  & $\phantom{20}$ & $\phantom{20}$ &
$\phantom{20}$ & $\phantom{20}$ & $\phantom{20}$ & $\phantom{20}$ &
$\phantom{20}$ & $\phantom{20}$ & $\phantom{20}$ & $\overset{k=0}{\swarrow}$ &
$\phantom{20}$ & $\phantom{20}$ & $\phantom{20}$ & $\phantom{20}$ &
$\phantom{20}$ & $\phantom{20}$ & $\phantom{20}$\\
\vphantom{$\overset{k=0}{\swarrow}$} $n=0$ & $\rightarrow$ &  &  &  &  &  &  &
&  & $\ast$ &  & $\overset{k=1}{\swarrow}$ &  &  &  &  &  & \\
\vphantom{$\overset{k=0}{\swarrow}$} $n=1$ & $\rightarrow$ &  &  &  &  &  &  &
& $\ast$ &  & $\ast$ &  & $\overset{k=2}{\swarrow}$ &  &  &  &  & \\
\vphantom{$\overset{k=0}{\swarrow}$} $n=2$ & $\rightarrow$ &  &  &  &  &  &  &
$\ast$ &  &  &  & $\ast$ &  & $\overset{k=3}{\swarrow}$ &  &  &  & \\
\vphantom{$\overset{k=0}{\swarrow}$} $n=3$ & $\rightarrow$ &  &  &  &  &  &
$\ast$ &  & $\ast$ &  & $\ast$ &  & $\ast$ &  &  &  &  & \\
\vphantom{$\overset{k=0}{\swarrow}$} $n=4$ & $\rightarrow$ &  &  &  &  &
$\ast$ &  &  &  &  &  &  &  & $\ast$ &  &  &  & \\
\vphantom{$\overset{k=0}{\swarrow}$} $n=5$ & $\rightarrow$ &  &  &  & $\ast$ &
& $\ast$ &  &  &  &  &  & $\ast$ &  & $\ast$ &  &  & \\
\vphantom{$\overset{k=0}{\swarrow}$} $n=6$ & $\rightarrow$ &  &  & $\ast$ &  &
&  & $\ast$ &  &  &  & $\ast$ &  &  &  & $\ast$ &  & \\
\vphantom{$\overset{k=0}{\swarrow}$} $n=7$ & $\rightarrow$ &  & $\ast$ &  &
$\ast$ &  & $\ast$ &  & $\ast$ &  & $\ast$ &  & $\ast$ &  & $\ast$ &  & $\ast$
& \\
\vphantom{$\overset{k=0}{\swarrow}$} $n=8$ & $\rightarrow$ & $\ast$ &  &  &  &
&  &  &  &  &  &  &  &  &  &  &  & $\ast$%
\end{tabular}
\ \ \ \ \ \
\]
If you are familiar with some fractals, you might recognize this picture as a
(finite step towards)
\href{https://en.wikipedia.org/wiki/Sierpinski_triangle}{the Sierpinski
triangle}, with the \textquotedblleft$\ast$\textquotedblright s corresponding
to the non-removed points in the triangle. And this is indeed the case: For
any $r\in\mathbb{N}$, the first $2^{r}$ rows of Pascal's triangle (i.e., the
rows from $n=0$ to $n=2^{r}-1$) form the image obtained after $r$ steps in the
construction of the Sierpinski triangle. This can be proved by induction on
$r$, and the induction step requires understanding how the parity of the
binomial coefficients $\dbinom{n}{k}$ with $n\in\left\{  2^{r},2^{r}%
+1,\ldots,2^{r+1}-1\right\}  $ is connected with the parity of the binomial
coefficients $\dbinom{n}{k}$ with $n\in\left\{  0,1,\ldots,2^{r}-1\right\}  $.
Proposition \ref{prop.binom.2n+aCb} yields an easy answer to this question.

Here are two more results we shall not prove:

\begin{theorem}
[Lucas's congruence]\label{thm.binom.lucas}Let $p$ be a prime. Let
$a,b\in\mathbb{Z}$. Let $c,d\in\left\{  0,1,\ldots,p-1\right\}  $. Then,%
\[
\dbinom{pa+c}{pb+d}\equiv\dbinom{a}{b}\dbinom{c}{d}\operatorname{mod}p.
\]

\end{theorem}

\begin{theorem}
[Babbage's congruence]\label{thm.binom.babbage}Let $p$ be a prime. Let
$a,b\in\mathbb{Z}$. Then,%
\[
\dbinom{pa}{pb}\equiv\dbinom{a}{b}\operatorname{mod}p^{2}.
\]

\end{theorem}

Elementary proofs of Theorem \ref{thm.binom.lucas} and Theorem
\ref{thm.binom.babbage} can be found in \cite{lucas}. Note that Theorem
\ref{thm.binom.lucas} generalizes Proposition \ref{prop.binom.2aC2b}.

\begin{remark}
Lucas's congruence has the following consequence: Let $p$ be a prime. Let
$a,b\in\mathbb{N}$. Write $a$ and $b$ in base $p$ as follows:%
\begin{align*}
a  &  =a_{k}p^{k}+a_{k-1}p^{k-1}+\cdots+a_{0}p^{0}%
\ \ \ \ \ \ \ \ \ \ \text{and}\\
b  &  =b_{k}p^{k}+b_{k-1}p^{k-1}+\cdots+b_{0}p^{0}%
\end{align*}
with $k\in\mathbb{N}$ and $a_{k},a_{k-1},\ldots,a_{0},b_{k},b_{k-1}%
,\ldots,b_{0}\in\left\{  0,1,\ldots,p-1\right\}  $. (Note that we allow
\textquotedblleft leading zeroes\textquotedblright\ -- i.e., any of $a_{k}$
and $b_{k}$ can be $0$.) Then,%
\[
\dbinom{a}{b}\equiv\dbinom{a_{k}}{b_{k}}\dbinom{a_{k-1}}{b_{k-1}}\cdots
\dbinom{a_{0}}{b_{0}}\operatorname{mod}p.
\]
(This can be easily proven by induction on $k$, using Theorem
\ref{thm.binom.lucas} in the induction step.) This allows for quick
computation of remainders of $\dbinom{a}{b}$ modulo prime numbers.
\end{remark}

See \cite{Mestro14} and \cite{Granvi05} for overviews of more complicated
divisibilities and congruences for binomial coefficients.

\subsubsection{The binomial formula}

You have likely seen the following fact:

\begin{theorem}
[the binomial formula]\label{thm.binom.binom}Let $x,y\in\mathbb{R}$. Let
$n\in\mathbb{N}$. Then,%
\[
\left(  x+y\right)  ^{n}=\sum_{k=0}^{n}\dbinom{n}{k}x^{k}y^{n-k}.
\]

\end{theorem}

This is why the $\dbinom{n}{k}$ are called the \textquotedblleft binomial
coefficients\textquotedblright\ -- they appear as coefficients in the binomial formula.

\begin{example}
If $n=3$, then the claim of Theorem \ref{thm.binom.binom} becomes%
\begin{align*}
\left(  x+y\right)  ^{3}  &  =\sum_{k=0}^{3}\dbinom{3}{k}x^{k}y^{3-k}\\
&  =\underbrace{\dbinom{3}{0}}_{=1}\underbrace{x^{0}}_{=1}\underbrace{y^{3-0}%
}_{=y^{3}}+\underbrace{\dbinom{3}{1}}_{=3}\underbrace{x^{1}}_{=x}%
\underbrace{y^{3-1}}_{=y^{2}}+\underbrace{\dbinom{3}{2}}_{=3}x^{2}%
\underbrace{y^{3-2}}_{=y}+\underbrace{\dbinom{3}{3}}_{=1}x^{3}%
\underbrace{y^{3-3}}_{=1}\\
&  =y^{3}+3xy^{2}+3x^{2}y+x^{3}.
\end{align*}

\end{example}

\begin{proof}
[Proof of Theorem \ref{thm.binom.binom}.]Let me first \textquotedblleft
simplify\textquotedblright\ the claim: I will rewrite the finite sum
$\sum\limits_{k=0}^{n}\dbinom{n}{k}x^{k}y^{n-k}$ as the \textbf{infinite} sum
$\sum\limits_{k\in\mathbb{Z}}\dbinom{n}{k}x^{k}y^{n-k}$ (that is, a sum over
\textbf{all} integers $k$).

In order to do so, I need to justify two things:

\begin{itemize}
\item I need to explain why the infinite sum $\sum\limits_{k\in\mathbb{Z}%
}\dbinom{n}{k}x^{k}y^{n-k}$ is well-defined. (We have seen why finite sums are
well-defined in Subsection \ref{subsect.intro.powersums.what}, but infinite
sums are a different beast. You can easily write down nonsensical infinite
sums like $\sum_{k\in\mathbb{N}}1=1+1+1+\cdots$ or $\sum_{k\in\mathbb{N}%
}k=0+1+2+3+\cdots$ that will quickly lead you into contradiction-land. If we
want to use an infinite sum, we thus have to explain what it means.)

\item I need to explain why this infinite sum equals the finite sum
$\sum\limits_{k=0}^{n}\dbinom{n}{k}x^{k}y^{n-k}$.
\end{itemize}

Let me begin with the first justification: Why is the sum $\sum\limits_{k\in
\mathbb{Z}}\dbinom{n}{k}x^{k}y^{n-k}$ well-defined?

If you think about this question very carefully, you will discover that there
is another question underneath it: Why are the addends $\dbinom{n}{k}%
x^{k}y^{n-k}$ of this sum well-defined? This is clear when $k\in\left\{
0,1,\ldots,n\right\}  $, because in this case both exponents $k$ and $n-k$ are
nonnegative integers. However, if $k<0$ or $k>n$, then one of these exponents
will be negative, and this may cause trouble if $x$ or $y$ is $0$ (because
$0^{j}$ is undefined when $j$ is negative). We fix this problem by decree: We
just \textbf{decree} that an expression of the form $ab$ is always to be
understood as $0$ when $a=0$, even if $b$ is undefined. Thus, $0\cdot0^{-1}%
=0$, despite $0^{-1}$ being undefined.\footnote{Still skeptical? Alright,
there are a few more things to check. Conventions like this may lead to errors
if applied improperly; for example, after having made this particular
convention, we cannot also decree $aa^{-1}$ to always equal $1$ when $a^{-1}$
is potentially undefined (since this would lead to $0\cdot0^{-1}=1\neq0$). We
need to check what exactly we are going to do with our convention. This is
easy: The only situation to which we will apply our $ab=0$ convention is when
$a=0$ and $b=x^{k}y^{n-k}$, and it is easy to check that the only properties
we are going to use from this notation are that $x\cdot\left(  ax^{k}%
y^{n-k}\right)  =ax^{k+1}y^{n-k}$ and $y\cdot\left(  ax^{k}y^{n-k}\right)
=ax^{k}y^{n-k+1}$ and $a_{1}b+a_{2}b=\left(  a_{1}+a_{2}\right)  b$;
obviously, all three of these properties are true when $a=0$ (resp. $a_{1}=0$
or $a_{2}=0$), even if the other factors are undefined.}

Having convinced ourselves that the addends of the sum $\sum\limits_{k\in
\mathbb{Z}}\dbinom{n}{k}x^{k}y^{n-k}$ are well-defined, we can now discuss the
existence of the sum itself. Let us look at the case $n=3$. In this case, this
sum has the form%
\[
\underbrace{\cdots+0+0+0}_{\substack{\text{addends}\\\text{for }%
k<0}}+\underbrace{y^{3}}_{\substack{\text{addend}\\\text{for }k=0}%
}+\underbrace{3xy^{2}}_{\substack{\text{addend}\\\text{for }k=1}%
}+\underbrace{3x^{2}y}_{\substack{\text{addend}\\\text{for }k=2}%
}+\underbrace{x^{3}}_{\substack{\text{addend}\\\text{for }k=3}%
}+\underbrace{0+0+0+\cdots}_{\substack{\text{addends}\\\text{for }k>3}}\ \ ,
\]
because Lemma \ref{lem.binom.outside-pascal-triangle} renders all addends
$\dbinom{n}{k}x^{k}y^{n-k}$ with $k\notin\left\{  0,1,\ldots,n\right\}  $
equal to $0$. This is an infinite sum, but only finitely many of its addends
are nonzero. Thus, it is clear how to give it a meaningful value: Just add the
nonzero addends together and drop the zero addends. The philosophy behind this
is that zero addends are not supposed to contribute to sums (no matter how
many of them are present): for example, $0+0+0+0+\cdots=0$.

The same is true for any $n\in\mathbb{N}$. Indeed, for any given
$n\in\mathbb{N}$, we can easily see from Lemma
\ref{lem.binom.outside-pascal-triangle} that the only nonzero addends in the
sum $\sum\limits_{k\in\mathbb{Z}}\dbinom{n}{k}x^{k}y^{n-k}$ are the ones for
which $k\in\left\{  0,1,\ldots,n\right\}  $ (which is not saying that all of
these addends must be nonzero). Hence, this sum has only finitely many nonzero
addends, and thus is well-defined.

This also explains why this sum equals the finite sum $\sum\limits_{k=0}%
^{n}\dbinom{n}{k}x^{k}y^{n-k}$: Indeed, the only difference between the
infinite and the finite sum is the presence of the addends with $k\notin%
\left\{  0,1,\ldots,n\right\}  $; but these addends do not contribute
anything, because they all equal $0$. Hence, the two sums are equal. In other
words,%
\begin{equation}
\sum\limits_{k\in\mathbb{Z}}\dbinom{n}{k}x^{k}y^{n-k}=\sum\limits_{k=0}%
^{n}\dbinom{n}{k}x^{k}y^{n-k}. \label{pf.thm.binom.binom.inf=fin}%
\end{equation}


Thus, it remains to prove that%
\begin{equation}
\left(  x+y\right)  ^{n}=\sum\limits_{k\in\mathbb{Z}}\dbinom{n}{k}x^{k}%
y^{n-k}. \label{pf.thm.binom.binom.inf-ver}%
\end{equation}


We will prove (\ref{pf.thm.binom.binom.inf-ver}) by induction on $n$:

\textit{Induction base:} If $n=0$, then both sides of the equality
(\ref{pf.thm.binom.binom.inf-ver}) are equal to $1$ (since $\left(
x+y\right)  ^{n}=\left(  x+y\right)  ^{0}=1$ and
\begin{align*}
\sum\limits_{k\in\mathbb{Z}}\dbinom{n}{k}x^{k}y^{n-k}  &  =\sum\limits_{k=0}%
^{n}\dbinom{n}{k}x^{k}y^{n-k}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.thm.binom.binom.inf=fin})}\right) \\
&  =\sum\limits_{k=0}^{0}\dbinom{0}{k}x^{k}y^{0-k}\ \ \ \ \ \ \ \ \ \ \left(
\text{since }n=0\right) \\
&  =\underbrace{\dbinom{0}{0}}_{\substack{=1\\\text{(by
(\ref{eq.exa.binom.small.nC0}))}}}\underbrace{x^{0}}_{=1}\underbrace{y^{0-0}%
}_{=1}=1
\end{align*}
in this case). Hence, (\ref{pf.thm.binom.binom.inf-ver}) holds if $n=0$. This
completes the induction base.

\textit{Induction step:} Fix $m\in\mathbb{N}$. Assume that
(\ref{pf.thm.binom.binom.inf-ver}) holds for $n=m$. We must prove that
(\ref{pf.thm.binom.binom.inf-ver}) holds for $n=m+1$.

We have assumed that (\ref{pf.thm.binom.binom.inf-ver}) holds for $n=m$. In
other words,%
\begin{equation}
\left(  x+y\right)  ^{m}=\sum\limits_{k\in\mathbb{Z}}\dbinom{m}{k}x^{k}%
y^{m-k}. \label{pf.thm.binom.binom.IH}%
\end{equation}


Now, for each $k\in\mathbb{R}$, we have%
\begin{align}
\dbinom{m+1}{k}  &  =\dbinom{\left(  m+1\right)  -1}{k-1}+\dbinom{\left(
m+1\right)  -1}{k}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.binom.rec} (applied
to }n=m+1\text{)}\right) \nonumber\\
&  =\dbinom{m}{k-1}+\dbinom{m}{k} \label{pf.thm.binom.binom.2}%
\end{align}
(since $\left(  m+1\right)  -1=m$). But%
\begin{align}
\left(  x+y\right)  ^{m+1}  &  =\left(  x+y\right)  \underbrace{\left(
x+y\right)  ^{m}}_{\substack{=\sum\limits_{k\in\mathbb{Z}}\dbinom{m}{k}%
x^{k}y^{m-k}\\\text{(by (\ref{pf.thm.binom.binom.IH}))}}}=\left(  x+y\right)
\left(  \sum\limits_{k\in\mathbb{Z}}\dbinom{m}{k}x^{k}y^{m-k}\right)
\nonumber\\
&  =\underbrace{x\sum\limits_{k\in\mathbb{Z}}\dbinom{m}{k}x^{k}y^{m-k}%
}_{\substack{=\sum\limits_{k\in\mathbb{Z}}x\dbinom{m}{k}x^{k}y^{m-k}%
\\\text{(by (\ref{eq.sum.linear2}), or rather}\\\text{its analogue for
infinite sums)}}}+\underbrace{y\sum\limits_{k\in\mathbb{Z}}\dbinom{m}{k}%
x^{k}y^{m-k}}_{\substack{=\sum\limits_{k\in\mathbb{Z}}y\dbinom{m}{k}%
x^{k}y^{m-k}\\\text{(by (\ref{eq.sum.linear2}), or rather}\\\text{its analogue
for infinite sums)}}}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the distributive law}\right)
\nonumber\\
&  =\sum\limits_{k\in\mathbb{Z}}\underbrace{x\dbinom{m}{k}x^{k}y^{m-k}%
}_{=\dbinom{m}{k}x^{k+1}y^{m-k}}+\sum\limits_{k\in\mathbb{Z}}%
\underbrace{y\dbinom{m}{k}x^{k}y^{m-k}}_{=\dbinom{m}{k}x^{k}y^{m-k+1}%
}\nonumber\\
&  =\sum\limits_{k\in\mathbb{Z}}\dbinom{m}{k}x^{k+1}y^{m-k}+\sum
\limits_{k\in\mathbb{Z}}\dbinom{m}{k}x^{k}y^{m-k+1}%
\label{pf.thm.binom.binom.c5}\\
&  =\sum\limits_{k\in\mathbb{Z}}\dbinom{m}{k-1}\underbrace{x^{\left(
k-1\right)  +1}}_{=x^{k}}\underbrace{y^{m-\left(  k-1\right)  }}_{=y^{m+1-k}%
}+\sum\limits_{k\in\mathbb{Z}}\dbinom{m}{k}x^{k}\underbrace{y^{m-k+1}%
}_{=y^{m+1-k}}\label{pf.thm.binom.binom.c6}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we substituted }k-1\text{ for }k\text{ in the first sum}\\
\text{(since the map }\mathbb{Z}\rightarrow\mathbb{Z},\ k\mapsto k-1\text{ is
a bijection)}%
\end{array}
\right) \nonumber\\
&  =\sum\limits_{k\in\mathbb{Z}}\dbinom{m}{k-1}x^{k}y^{m+1-k}+\sum
\limits_{k\in\mathbb{Z}}\dbinom{m}{k}x^{k}y^{m+1-k}%
\label{pf.thm.binom.binom.c8}\\
&  =\sum\limits_{k\in\mathbb{Z}}\underbrace{\left(  \dbinom{m}{k-1}%
x^{k}y^{m+1-k}+\dbinom{m}{k}x^{k}y^{m+1-k}\right)  }_{=\left(  \dbinom{m}%
{k-1}+\dbinom{m}{k}\right)  x^{k}y^{m+1-k}}\label{pf.thm.binom.binom.c9}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{eq.sum.linear1}), or rather its
analogue for infinite sums}\right) \nonumber\\
&  =\sum\limits_{k\in\mathbb{Z}}\underbrace{\left(  \dbinom{m}{k-1}+\dbinom
{m}{k}\right)  }_{\substack{=\dbinom{m+1}{k}\\\text{(by
(\ref{pf.thm.binom.binom.2}))}}}x^{k}y^{m+1-k}=\sum\limits_{k\in\mathbb{Z}%
}\dbinom{m+1}{k}x^{k}y^{m+1-k}.\nonumber
\end{align}
Thus, (\ref{pf.thm.binom.binom.inf-ver}) holds for $n=m+1$. This completes the
induction step.

This completes the induction proof of (\ref{pf.thm.binom.binom.inf-ver}). In
view of (\ref{pf.thm.binom.binom.inf=fin}), this equality
(\ref{pf.thm.binom.binom.inf-ver}) rewrites as $\left(  x+y\right)  ^{n}%
=\sum_{k=0}^{n}\dbinom{n}{k}x^{k}y^{n-k}$. Thus, Theorem \ref{thm.binom.binom}
is proven.
\end{proof}

It is instructive to try and prove Theorem \ref{thm.binom.binom} without
taking the detour through infinite sums that we did in our above proof. Such a
proof would actually be slightly shorter, but not by much: We would avoid
having to explain why an infinite sum is well-defined (and what it means), but
we would have to jump a few extra hurdles in our computation. Namely, instead
of (\ref{pf.thm.binom.binom.c5}), we would get the equality%
\[
\left(  x+y\right)  ^{m}=\sum\limits_{k=0}^{m}\dbinom{m}{k}x^{k+1}y^{m-k}%
+\sum\limits_{k=0}^{m}\dbinom{m}{k}x^{k}y^{m-k+1}.
\]
Hence, instead of (\ref{pf.thm.binom.binom.c8}), we would get the equality%
\[
\left(  x+y\right)  ^{m}=\sum\limits_{k=1}^{m+1}\dbinom{m}{k-1}x^{k}%
y^{m+1-k}+\sum\limits_{k=0}^{m}\dbinom{m}{k}x^{k}y^{m+1-k}%
\]
(where the first sum has bounds $1$ and $m+1$ because it originates from
substituting $k-1$ for $k$ in the sum $\sum\limits_{k=0}^{m}\dbinom{m}%
{k}x^{k+1}y^{m-k}$). At this point, we would not be able to combine the two
sums on the right hand side using (\ref{eq.sum.linear1}), since these two sums
have (slightly) different bounds of summation. We would have to fix this by
\textquotedblleft manually\textquotedblright\ moving the bounds of summations
so that both sums become $\sum_{k=0}^{m+1}$ sums:%
\begin{align*}
\sum\limits_{k=1}^{m+1}\dbinom{m}{k-1}x^{k}y^{m+1-k}  &  =\sum\limits_{k=0}%
^{m+1}\dbinom{m}{k-1}x^{k}y^{m+1-k}-\underbrace{\dbinom{m}{0-1}}%
_{\substack{=0\\\text{(by (\ref{eq.def.binom.def.b}))}}}x^{0}y^{0+1-k}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we extended the sum by adding an}\\
\text{extra addend for }k=0\text{, and then promptly}\\
\text{subtracted this new addend back}%
\end{array}
\right) \\
&  =\sum\limits_{k=0}^{m+1}\dbinom{m}{k-1}x^{k}y^{m+1-k}%
\end{align*}
and%
\begin{align*}
\sum\limits_{k=0}^{m}\dbinom{m}{k}x^{k}y^{m+1-k}  &  =\sum\limits_{k=0}%
^{m+1}\dbinom{m}{k}x^{k}y^{m+1-k}-\underbrace{\dbinom{m}{m+1}}%
_{\substack{=0\\\text{(by Lemma \ref{lem.binom.outside-pascal-triangle})}%
}}x^{m+1}y^{m+1-\left(  m+1\right)  }\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we extended the sum by adding an}\\
\text{extra addend for }k=m+1\text{, and then promptly}\\
\text{subtracted this new addend back}%
\end{array}
\right) \\
&  =\sum\limits_{k=0}^{m+1}\dbinom{m}{k}x^{k}y^{m+1-k}.
\end{align*}
After these transformations, we could combine these two sums and proceed as in
the proof above. (A slightly different but similar proof of Theorem
\ref{thm.binom.binom} can be found in \cite[Exercise 3.6]{detnotes}.)

So why did we take the trouble to turn our finite sum into an infinite sum, if
we could have just as easily gotten away without it? Because this trick is
helpful not merely in proving Theorem \ref{thm.binom.binom}. Graham, Knuth and
Patashnik (\cite[\S 5.1]{GKP}) frequently apply this trick, in order to avoid
having \textquotedblleft to fuss over boundary conditions\textquotedblright%
\ (i.e., over the bounds of the sums). Of course, this is not always possible;
sometimes, when you extend a sum to a larger index set, the new addends you
get will not all be $0$, and the new sum will either fail to be well-defined
or at least differ from the original sum. Thus, as in our proof of Theorem
\ref{thm.binom.binom}, the trick can only be applied after checking that the
newly added addends are $0$. (You can often do this checking in your head, but
it needs to be done nevertheless.)

For the sake of future reference, let us summarize what we have learned about
infinite sums in the above proof of Theorem \ref{thm.binom.binom}:

\begin{definition}
\label{def.sum.infinite}Let $S$ be a set (not necessarily infinite). For each
$s\in S$, let $a_{s}$ be a number.

Assume that only finitely many of these numbers are nonzero (i.e., only
finitely many $s\in S$ satisfy $a_{s}\neq0$). Then, the sum $\sum_{s\in
S}a_{s}$ is well-defined (even if $S$ is infinite): Its value is just defined
to be the finite sum $\sum_{\substack{s\in S;\\a_{s}\neq0}}a_{s}$.
\end{definition}

We refer to \cite[\S 2.14.15]{detnotes} for a rigorous treatment of such sums
(called \textquotedblleft finitely supported sums\textquotedblright). In a
nutshell, all their properties can be derived from the analogous properties of
finite sums simply by restricting oneself to certain finite subsets of $S$.

The following corollary from Theorem \ref{thm.binom.binom} is perhaps the most famous:

\begin{corollary}
\label{cor.binom.2pown}Let $n\in\mathbb{N}$. Then, $\sum\limits_{k=0}%
^{n}\dbinom{n}{k}=2^{n}$.
\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.binom.2pown}.]Theorem \ref{thm.binom.binom}
(applied to $x=1$ and $y=1$) yields $\left(  1+1\right)  ^{n}=\sum_{k=0}%
^{n}\dbinom{n}{k}\underbrace{1^{k}}_{=1}\underbrace{1^{n-k}}_{=1}=\sum
_{k=0}^{n}\dbinom{n}{k}$. Hence, $\sum_{k=0}^{n}\dbinom{n}{k}=\left(
1+1\right)  ^{n}=2^{n}$. Corollary \ref{cor.binom.2pown} follows.
\end{proof}

The following fact (\cite[Proposition 3.39 \textbf{(c)}]{detnotes}) can be
regarded as a counterpart to Corollary \ref{cor.binom.2pown}:

\begin{proposition}
\label{prop.binom.sum-alt-row}Let $n\in\mathbb{N}$. Then,%
\begin{equation}
\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n}{k}=\left[  n=0\right]  .
\label{eq.prop.binom.sum-alt-row.1}%
\end{equation}

\end{proposition}

(See Definition \ref{def.iverson} for the meaning of $\left[  n=0\right]  $ in
this proposition.)

\begin{proof}
[Proof of Proposition \ref{prop.binom.sum-alt-row}.]If $n\neq0$, then $n$ is a
positive integer (since $n\in\mathbb{N}$) and thus satisfies $0^{n}=0$. On the
other hand, if $n=0$, then $0^{n}=0^{0}=1$. Combining these two observations,
we obtain%
\begin{equation}
0^{n}=%
\begin{cases}
1, & \text{if }n=0;\\
0, & \text{if }n\neq0
\end{cases}
. \label{pf.prop.binom.sum-alt-row.0n}%
\end{equation}
On the other hand, the definition of $\left[  n=0\right]  $ yields $\left[
n=0\right]  =%
\begin{cases}
1, & \text{if }n=0;\\
0, & \text{if }n\neq0
\end{cases}
$. Comparing this with (\ref{pf.prop.binom.sum-alt-row.0n}), we find%
\begin{equation}
0^{n}=\left[  n=0\right]  . \label{pf.prop.binom.sum-alt-row.0n-iv}%
\end{equation}


Theorem \ref{thm.binom.binom} (applied to $x=-1$ and $y=1$) yields
\[
\left(  \left(  -1\right)  +1\right)  ^{n}=\sum_{k=0}^{n}\underbrace{\dbinom
{n}{k}\left(  -1\right)  ^{k}}_{=\left(  -1\right)  ^{k}\dbinom{n}{k}%
}\underbrace{1^{n-k}}_{=1}=\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n}%
{k}.
\]
Thus,%
\[
\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n}{k}=\left(  \underbrace{\left(
-1\right)  +1}_{=0}\right)  ^{n}=0^{n}=\left[  n=0\right]  \qquad\left(
\text{by (\ref{pf.prop.binom.sum-alt-row.0n-iv})}\right)  .
\]
This proves Proposition \ref{prop.binom.sum-alt-row}.
\end{proof}

\subsubsection{\label{subsect.intro.binom.other}Other properties of binomial
coefficients}

Let us see more properties of binomial coefficients, mostly without proof. We
will prove some of these later (see also \cite[Chapter 3]{detnotes}, or
\cite[Chapter 5]{GKP}, or essentially any other text on combinatorics). We
begin with a summation identity that is known as the \emph{hockey-stick
identity}:

\begin{theorem}
[\textquotedblleft Hockey-stick identity\textquotedblright]%
\label{thm.binom.hock}Let $n\in\mathbb{N}$ and $k\in\mathbb{N}$. Then,%
\[
\dbinom{0}{k}+\dbinom{1}{k}+\dbinom{2}{k}+\cdots+\dbinom{n}{k}=\dbinom
{n+1}{k+1}.
\]

\end{theorem}

\begin{proof}
[First proof of Theorem \ref{thm.binom.hock}.]Recall the notation
$n^{\underline{k}}$ introduced in \cite[Exercise 2]{19f-hw0s} (and also in
Remark \ref{rmk.binom.ff}). Now, \cite[Exercise 2]{19f-hw0s} says that%
\[
\sum_{i=0}^{n}i^{\underline{k}}=\dfrac{1}{k+1}\left(  n+1\right)
^{\underline{k+1}}.
\]
Multiplying this equality by $\dfrac{1}{k!}$ yields%
\begin{equation}
\dfrac{1}{k!}\sum_{i=0}^{n}i^{\underline{k}}=\dfrac{1}{k!}\cdot\dfrac{1}%
{k+1}\left(  n+1\right)  ^{\underline{k+1}}=\dfrac{\left(  n+1\right)
^{\underline{k+1}}}{k!\cdot\left(  k+1\right)  }.
\label{pf.thm.binom.hock.1st.1}%
\end{equation}


But (\ref{eq.rmk.binom.ff.ff}) (applied to $n+1$ and $k+1$ instead of $n$ and
$k$) yields
\[
\dbinom{n+1}{k+1}=\dfrac{\left(  n+1\right)  ^{\underline{k+1}}}{\left(
k+1\right)  !}=\dfrac{\left(  n+1\right)  ^{\underline{k+1}}}{k!\cdot\left(
k+1\right)  }%
\]
(since Proposition \ref{prop.factorial.rec} (applied to $k+1$ instead of $n$)
yields $\left(  k+1\right)  !=k!\cdot\left(  k+1\right)  $). Comparing this
with (\ref{pf.thm.binom.hock.1st.1}), we obtain%
\[
\dbinom{n+1}{k+1}=\dfrac{1}{k!}\sum_{i=0}^{n}i^{\underline{k}}=\sum_{i=0}%
^{n}\dfrac{1}{k!}i^{\underline{k}}=\sum_{i=0}^{n}\dfrac{i^{\underline{k}}}%
{k!}.
\]
Comparing this with%
\[
\dbinom{0}{k}+\dbinom{1}{k}+\dbinom{2}{k}+\cdots+\dbinom{n}{k}=\sum_{i=0}%
^{n}\underbrace{\dbinom{i}{k}}_{\substack{=\dfrac{i^{\underline{k}}}%
{k!}\\\text{(by (\ref{eq.rmk.binom.ff.ff}), applied}\\\text{to }i\text{
instead of }n\text{)}}}=\sum_{i=0}^{n}\dfrac{i^{\underline{k}}}{k!},
\]
we obtain
\[
\dbinom{0}{k}+\dbinom{1}{k}+\dbinom{2}{k}+\cdots+\dbinom{n}{k}=\dbinom
{n+1}{k+1}.
\]
This proves Theorem \ref{thm.binom.hock}.
\end{proof}

Alternatively, Theorem \ref{thm.binom.hock} can be proven by induction or
combinatorially; we will see those proofs in Section \ref{sect.binom.hockey}.

Here is an alternative way to express Theorem \ref{thm.binom.hock}:

\begin{corollary}
[\textquotedblleft Hockey-stick identity\textquotedblright, take
2]\label{cor.binom.hock2}Let $n\in\mathbb{N}$ and $k\in\mathbb{N}$. Then,%
\[
\dbinom{k}{k}+\dbinom{k+1}{k}+\dbinom{k+2}{k}+\cdots+\dbinom{n}{k}%
=\dbinom{n+1}{k+1}.
\]
(Here, the left-hand side means the sum $\sum_{m=k}^{n}\dbinom{m}{k}$. When
$n<k$, this sum is empty and thus equals $0$.)
\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.binom.hock2}.]We have%
\begin{equation}
\dbinom{m}{k}=0\ \ \ \ \ \ \ \ \ \ \text{for every }m\in\mathbb{N}\text{
satisfying }k>m \label{pf.cor.binom.hock2.=0}%
\end{equation}
(by Proposition \ref{prop.binom.0}, applied to $m$ instead of $n$).

Now, we would like to make the following argument: Splitting the sum
$\dbinom{0}{k}+\dbinom{1}{k}+\dbinom{2}{k}+\cdots+\dbinom{n}{k}$ into two
parts (with the first part comprising its first $k$ addends, and the second
part comprising everything else), we obtain%
\begin{align*}
&  \dbinom{0}{k}+\dbinom{1}{k}+\dbinom{2}{k}+\cdots+\dbinom{n}{k}\\
&  =\underbrace{\left(  \dbinom{0}{k}+\dbinom{1}{k}+\dbinom{2}{k}%
+\cdots+\dbinom{k-1}{k}\right)  }_{\substack{=0\\\text{(since
(\ref{pf.cor.binom.hock2.=0}) shows that all}\\\text{the addends in this sum
are }0\text{)}}}+\left(  \dbinom{k}{k}+\dbinom{k+1}{k}+\dbinom{k+2}{k}%
+\cdots+\dbinom{n}{k}\right) \\
&  =\dbinom{k}{k}+\dbinom{k+1}{k}+\dbinom{k+2}{k}+\cdots+\dbinom{n}{k},
\end{align*}
so that%
\begin{align*}
&  \dbinom{k}{k}+\dbinom{k+1}{k}+\dbinom{k+2}{k}+\cdots+\dbinom{n}{k}\\
&  =\dbinom{0}{k}+\dbinom{1}{k}+\dbinom{2}{k}+\cdots+\dbinom{n}{k}%
=\dbinom{n+1}{k+1}%
\end{align*}
(by Theorem \ref{thm.binom.hock}).

Did you spot the (minor) hole in this argument? We split the sum $\dbinom
{0}{k}+\dbinom{1}{k}+\dbinom{2}{k}+\cdots+\dbinom{n}{k}$ after its first $k$
addends; but there is no guarantee that this sum has $k$ addends to begin
with. Namely, if $n<k-1$, then it has fewer than $k$ addends. In this case,
our splitting argument does not work. This can be a source of real
errors\footnote{For example, $1+2+\cdots+k=\left(  1+2\right)  +\left(
3+4+\cdots+k\right)  $ does not hold for $k=1$.}. Fortunately, our proof can
be easily salvaged. Namely, our argument above worked fine in the case when
$n\geq k-1$; thus, we only need to deal with the case when $n<k-1$ now. So let
us assume that $n<k-1$. Hence, $n+1<k<k+1$, so that $k+1>n+1$ and thus
$\dbinom{n+1}{k+1}=0$ (by Proposition \ref{prop.binom.0}, applied to $n+1$ and
$k+1$ instead of $n$ and $k$). Comparing this with%
\begin{align*}
\dbinom{k}{k}+\dbinom{k+1}{k}+\dbinom{k+2}{k}+\cdots+\dbinom{n}{k}  &
=\left(  \text{empty sum}\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{since
}n<k-1<k\right) \\
&  =0,
\end{align*}
we obtain $\dbinom{k}{k}+\dbinom{k+1}{k}+\dbinom{k+2}{k}+\cdots+\dbinom{n}%
{k}=\dbinom{n+1}{k+1}$ again. This completes our proof of Corollary
\ref{cor.binom.hock2}.
\end{proof}

\begin{example}
Applying Corollary \ref{cor.binom.hock2} to $k=1$, we obtain%
\[
\dbinom{1}{1}+\dbinom{2}{1}+\dbinom{3}{1}+\cdots+\dbinom{n}{1}=\dbinom
{n+1}{1+1}=\dbinom{n+1}{2}%
\]
for each $n\in\mathbb{N}$. In view of (\ref{eq.exa.binom.small.nC1}) and
(\ref{eq.exa.binom.small.nC2}), this equality rewrites as%
\[
1+2+3+\cdots+n=\dfrac{\left(  n+1\right)  \left(  \left(  n+1\right)
-1\right)  }{2}=\dfrac{\left(  n+1\right)  n}{2}=\dfrac{n\left(  n+1\right)
}{2}.
\]
Thus, we have obtained a new proof of Theorem \ref{thm.1.10}.
\end{example}

Let us illustrate Corollary \ref{cor.binom.hock2} on a picture of Pascal's
triangle. On the following graphic (which shows the case $n=3$ and $k=1$), the
addends on the left hand side of Corollary \ref{cor.binom.hock2} are the ones
surrounded by the oblong green ellipse, whereas the single binomial
coefficient on the right hand side is in the red circle:%

\[
\begin{tikzpicture}
\draw[fill=green!50, rotate=-45] (1.4, 4.2) ellipse (0.7 and 2);
\draw[fill=red!50] (4, 0) ellipse (0.7 and 0.7);
\tikzstyle{every node} = [circle]
\node (a00) at (0, 0) {1};
\node (a01) at (2, 0) {4};
\node (a02) at (4, 0) {6};
\node (a03) at (6, 0) {4};
\node (a04) at (8, 0) {1};
\node (a10) at (1, 1) {1};
\node (a11) at (3, 1) {3};
\node (a12) at (5, 1) {3};
\node (a13) at (7, 1) {1};
\node (a20) at (2, 2) {1};
\node (a21) at (4, 2) {2};
\node (a22) at (6, 2) {1};
\node (a30) at (3, 3) {1};
\node (a31) at (5, 3) {1};
\node (a40) at (4, 4) {1};
\end{tikzpicture}\ \ .
\]
This picture explains where the \textquotedblleft hockey-stick
identity\textquotedblright\ got its name.

Next, we are going to express the Fibonacci numbers of Definition
\ref{def.fib} as sums of binomial coefficients:

\begin{proposition}
\label{prop.binom.fib}Let $n\in\mathbb{N}$. Then, the Fibonacci number
$f_{n+1}$ is%
\[
f_{n+1}=\sum_{k=0}^{n}\dbinom{n-k}{k}=\dbinom{n-0}{0}+\dbinom{n-1}{1}%
+\dbinom{n-2}{2}+\cdots+\dbinom{n-n}{n}.
\]

\end{proposition}

We shall prove this later (in Subsection
\ref{subsect.intro.count.lacunar.k-elt}). For now, let us remark that roughly
half the addends on the right hand side of Proposition \ref{prop.binom.fib}
are $0$ (indeed, Proposition \ref{prop.binom.0} shows that $\dbinom{n-k}{k}=0$
for any $k\in\left\{  0,1,\ldots,n\right\}  $ satisfying $k>n/2$) and thus can
be discarded; nevertheless it is easier to have the sum end at $k=n$ rather
than figure out where exactly its nonzero addends stop.

Here are some more examples of binomial identities (i.e., identities involving
binomial coefficients):

\begin{proposition}
\label{prop.binom.-1/2Cn}Let $n\in\mathbb{N}$. Then,%
\[
\dbinom{-1/2}{n}=\left(  \dfrac{-1}{4}\right)  ^{n}\dbinom{2n}{n}.
\]

\end{proposition}

\begin{exercise}
\label{exe.prop.binom.-1/2Cn}Prove Proposition \ref{prop.binom.-1/2Cn}.
\end{exercise}

The following fact is a neat way to restate Proposition
\ref{prop.binom.sum-alt-row}:

\begin{proposition}
\label{prop.binom.sum-alt-row-alt}Let $n$ be a positive integer. Then,%
\[
\dbinom{n}{0}+\dbinom{n}{2}+\dbinom{n}{4}+\cdots=\dbinom{n}{1}+\dbinom{n}%
{3}+\dbinom{n}{5}+\cdots=2^{n-1}.
\]
(Here, both sums are infinite, but they are well-defined, since only finitely
many of their addends are nonzero.)
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.binom.sum-alt-row-alt}.]For each
$k\in\mathbb{N}$ satisfying $k\notin\left\{  0,1,\ldots,n\right\}  $, we have
$\dbinom{n}{k}=0$ (by Lemma \ref{lem.binom.outside-pascal-triangle}). Thus,
all addends of the sum $\sum_{k\in\mathbb{N}}\left(  -1\right)  ^{k}\dbinom
{n}{k}$ with $k\notin\left\{  0,1,\ldots,n\right\}  $ are $0$ (since they
contain the $\dbinom{n}{k}$ factor, which is $0$ when $k\notin\left\{
0,1,\ldots,n\right\}  $). Thus, this sum $\sum_{k\in\mathbb{N}}\left(
-1\right)  ^{k}\dbinom{n}{k}$ has only finitely many nonzero addends (namely,
the ones for $k\in\left\{  0,1,\ldots,n\right\}  $), and is therefore
well-defined. We can transform this sum as follows:%
\begin{align*}
\sum_{k\in\mathbb{N}}\left(  -1\right)  ^{k}\dbinom{n}{k}  &  =\sum
_{\substack{k\in\mathbb{N};\\k\leq n}}\left(  -1\right)  ^{k}\dbinom{n}%
{k}+\sum_{\substack{k\in\mathbb{N};\\k>n}}\left(  -1\right)  ^{k}%
\underbrace{\dbinom{n}{k}}_{\substack{=0\\\text{(by Proposition
\ref{prop.binom.0})}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since each }k\in\mathbb{N}\text{ satisfies either }k\leq n\text{ or
}k>n\text{,}\\
\text{but not both at the same time}%
\end{array}
\right) \\
&  =\sum_{\substack{k\in\mathbb{N};\\k\leq n}}\left(  -1\right)  ^{k}%
\dbinom{n}{k}+\underbrace{\sum_{\substack{k\in\mathbb{N};\\k>n}}\left(
-1\right)  ^{k}0}_{=0}=\sum_{\substack{k\in\mathbb{N};\\k\leq n}}\left(
-1\right)  ^{k}\dbinom{n}{k}\\
&  =\sum_{k\in\left\{  0,1,\ldots,n\right\}  }\left(  -1\right)  ^{k}%
\dbinom{n}{k}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since the elements }k\in\mathbb{N}\text{ satisfying }k\leq n\\
\text{are precisely the elements of }\left\{  0,1,\ldots,n\right\}
\end{array}
\right) \\
&  =\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n}{k}=\left[  n=0\right]
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition \ref{prop.binom.sum-alt-row}%
}\right) \\
&  =0
\end{align*}
(since we don't have $n=0$ (because $n$ is positive)). Hence,%
\begin{align*}
0  &  =\sum_{k\in\mathbb{N}}\left(  -1\right)  ^{k}\dbinom{n}{k}%
=\sum_{\substack{k\in\mathbb{N};\\k\text{ is even}}}\ \ \underbrace{\left(
-1\right)  ^{k}}_{\substack{=1\\\text{(since }k\text{ is even)}}}\dbinom{n}%
{k}+\sum_{\substack{k\in\mathbb{N};\\k\text{ is odd}}}\ \ \underbrace{\left(
-1\right)  ^{k}}_{\substack{=-1\\\text{(since }k\text{ is odd)}}}\dbinom{n}%
{k}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since each }k\in\mathbb{N}\text{ is either even or odd,}\\
\text{but not both at the same time}%
\end{array}
\right) \\
&  =\sum_{\substack{k\in\mathbb{N};\\k\text{ is even}}}\dbinom{n}%
{k}+\underbrace{\sum_{\substack{k\in\mathbb{N};\\k\text{ is odd}}}\left(
-1\right)  \dbinom{n}{k}}_{=-\sum_{\substack{k\in\mathbb{N};\\k\text{ is odd}%
}}\dbinom{n}{k}}\\
&  =\underbrace{\sum_{\substack{k\in\mathbb{N};\\k\text{ is even}}}\dbinom
{n}{k}}_{=\dbinom{n}{0}+\dbinom{n}{2}+\dbinom{n}{4}+\cdots}-\underbrace{\sum
_{\substack{k\in\mathbb{N};\\k\text{ is odd}}}\dbinom{n}{k}}_{=\dbinom{n}%
{1}+\dbinom{n}{3}+\dbinom{n}{5}+\cdots}\\
&  =\left(  \dbinom{n}{0}+\dbinom{n}{2}+\dbinom{n}{4}+\cdots\right)  -\left(
\dbinom{n}{1}+\dbinom{n}{3}+\dbinom{n}{5}+\cdots\right)  .
\end{align*}
In other words,%
\begin{equation}
\dbinom{n}{0}+\dbinom{n}{2}+\dbinom{n}{4}+\cdots=\dbinom{n}{1}+\dbinom{n}%
{3}+\dbinom{n}{5}+\cdots. \label{pf.prop.binom.sum-alt-row-alt.1}%
\end{equation}


Now,
\begin{align*}
&  2\cdot\left(  \dbinom{n}{0}+\dbinom{n}{2}+\dbinom{n}{4}+\cdots\right) \\
&  =\left(  \dbinom{n}{0}+\dbinom{n}{2}+\dbinom{n}{4}+\cdots\right)
+\underbrace{\left(  \dbinom{n}{0}+\dbinom{n}{2}+\dbinom{n}{4}+\cdots\right)
}_{\substack{=\dbinom{n}{1}+\dbinom{n}{3}+\dbinom{n}{5}+\cdots\\\text{(by
(\ref{pf.prop.binom.sum-alt-row-alt.1}))}}}\\
&  =\left(  \dbinom{n}{0}+\dbinom{n}{2}+\dbinom{n}{4}+\cdots\right)  +\left(
\dbinom{n}{1}+\dbinom{n}{3}+\dbinom{n}{5}+\cdots\right) \\
&  =\dbinom{n}{0}+\dbinom{n}{1}+\dbinom{n}{2}+\cdots=\sum_{k\in\mathbb{N}%
}\dbinom{n}{k}\\
&  =\sum_{\substack{k\in\mathbb{N};\\k\leq n}}\dbinom{n}{k}+\sum
_{\substack{k\in\mathbb{N};\\k>n}}\underbrace{\dbinom{n}{k}}%
_{\substack{=0\\\text{(by Proposition \ref{prop.binom.0})}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since each }k\in\mathbb{N}\text{ satisfies either }k\leq n\text{ or
}k>n\text{,}\\
\text{but not both at the same time}%
\end{array}
\right) \\
&  =\sum_{\substack{k\in\mathbb{N};\\k\leq n}}\dbinom{n}{k}+\underbrace{\sum
_{\substack{k\in\mathbb{N};\\k>n}}0}_{=0}=\sum_{\substack{k\in\mathbb{N}%
;\\k\leq n}}\dbinom{n}{k}=\sum_{k\in\left\{  0,1,\ldots,n\right\}  }\dbinom
{n}{k}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since the elements }k\in\mathbb{N}\text{ satisfying }k\leq n\\
\text{are precisely the elements of }\left\{  0,1,\ldots,n\right\}
\end{array}
\right) \\
&  =\sum_{k=0}^{n}\dbinom{n}{k}=2^{n}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
Corollary \ref{cor.binom.2pown}}\right)  .
\end{align*}
Dividing this equality by $2$, we obtain%
\[
\dbinom{n}{0}+\dbinom{n}{2}+\dbinom{n}{4}+\cdots=2^{n}/2=2^{n-1}.
\]
Combining this with (\ref{pf.prop.binom.sum-alt-row-alt.1}), we obtain%
\[
\dbinom{n}{0}+\dbinom{n}{2}+\dbinom{n}{4}+\cdots=\dbinom{n}{1}+\dbinom{n}%
{3}+\dbinom{n}{5}+\cdots=2^{n-1}.
\]
This proves Proposition \ref{prop.binom.sum-alt-row-alt}.
\end{proof}

The next fact is highly useful (we will see some of its uses later on):

\begin{proposition}
[Trinomial revision formula]\label{prop.binom.trin-rev}Let $n,a,b\in
\mathbb{R}$. Then,%
\[
\dbinom{n}{a}\dbinom{a}{b}=\dbinom{n}{b}\dbinom{n-b}{a-b}.
\]

\end{proposition}

Proposition \ref{prop.binom.trin-rev} is the \emph{trinomial revision
formula}, and is not hard to prove.\footnote{See \cite[Exercise 2
\textbf{(c)}]{17f-hw1s} for the most interesting case.} We shall prove it in
the next chapter.

\begin{proposition}
[Absorption formula I]\label{prop.binom.X-1}Let $n\in\left\{  1,2,3,\ldots
\right\}  $ and $m\in\mathbb{R}$. Then,%
\[
\dbinom{m}{n}=\dfrac{m}{n}\dbinom{m-1}{n-1}.
\]

\end{proposition}

Proposition \ref{prop.binom.X-1} is the \emph{absorption formula}, and is one
of the major tools for transforming binomial coefficients into more convenient
forms. It is straightforward to prove. The following proof of Proposition
\ref{prop.binom.X-1} is taken from \cite[proof of Proposition 3.22]%
{detnotes}\footnote{where it is stated only for $m\in\mathbb{Q}$, but this
makes no difference to the proof}:

\begin{fineprint}
\begin{proof}
[Proof of Proposition \ref{prop.binom.X-1}.]We have $n\in\left\{
1,2,3,\ldots\right\}  \subseteq\mathbb{N}$. Thus, (\ref{eq.def.binom.def.a})
(applied to $m$ and $n$ instead of $n$ and $k$) yields%
\begin{align}
\dbinom{m}{n}  &  =\dfrac{m\left(  m-1\right)  \left(  m-2\right)
\cdots\left(  m-n+1\right)  }{n!}\nonumber\\
&  =\dfrac{m\left(  m-1\right)  \left(  m-2\right)  \cdots\left(
m-n+1\right)  }{n\cdot\left(  n-1\right)  !} \label{pf.prop.binom.X-1.mCn=}%
\end{align}
(since Proposition \ref{prop.factorial.rec} yields $n!=\left(  n-1\right)
!\cdot n=n\cdot\left(  n-1\right)  !$).

We have $n-1\in\mathbb{N}$ (since $n\in\left\{  1,2,3,\ldots\right\}  $).
Thus, (\ref{eq.def.binom.def.a}) (applied to $m-1$ and $n-1$ instead of $n$
and $k$) yields%
\begin{align*}
\dbinom{m-1}{n-1}  &  =\dfrac{\left(  m-1\right)  \left(  \left(  m-1\right)
-1\right)  \left(  \left(  m-1\right)  -2\right)  \cdots\left(  \left(
m-1\right)  -\left(  n-1\right)  +1\right)  }{\left(  n-1\right)  !}\\
&  =\dfrac{\left(  m-1\right)  \left(  m-2\right)  \left(  m-3\right)
\cdots\left(  m-n+1\right)  }{\left(  n-1\right)  !}%
\end{align*}
(since $\left(  m-1\right)  -1=m-2$ and $\left(  m-1\right)  -2=m-3$ and
$\left(  m-1\right)  -\left(  n-1\right)  +1=m-n+1$). Multiplying both sides
of this equality by $\dfrac{m}{n}$, we obtain%
\begin{align*}
\dfrac{m}{n}\dbinom{m-1}{n-1}  &  =\dfrac{m}{n}\cdot\dfrac{\left(  m-1\right)
\left(  m-2\right)  \left(  m-3\right)  \cdots\left(  m-n+1\right)  }{\left(
n-1\right)  !}\\
&  =\dfrac{m\cdot\left(  \left(  m-1\right)  \left(  m-2\right)  \left(
m-3\right)  \cdots\left(  m-n+1\right)  \right)  }{n\cdot\left(  n-1\right)
!}\\
&  =\dfrac{m\left(  m-1\right)  \left(  m-2\right)  \cdots\left(
m-n+1\right)  }{n\cdot\left(  n-1\right)  !}%
\end{align*}
(since $m\cdot\left(  \left(  m-1\right)  \left(  m-2\right)  \left(
m-3\right)  \cdots\left(  m-n+1\right)  \right)  =m\left(  m-1\right)  \left(
m-2\right)  \cdots\left(  m-n+1\right)  $). Compared with
(\ref{pf.prop.binom.X-1.mCn=}), this yields $\dbinom{m}{n}=\dfrac{m}{n}%
\dbinom{m-1}{n-1}$. This proves Proposition \ref{prop.binom.X-1}.
\end{proof}
\end{fineprint}

\begin{theorem}
\label{thm.vandermonde.RR}Let $n\in\mathbb{N}$, $x\in\mathbb{R}$ and
$y\in\mathbb{R}$. Then,%
\[
\dbinom{x+y}{n}=\sum_{k=0}^{n}\dbinom{x}{k}\dbinom{y}{n-k}.
\]

\end{theorem}

Theorem \ref{thm.vandermonde.RR} is the \emph{Chu--Vandermonde identity} (aka
the \emph{Vandermonde convolution identity}). Note its resemblance to Theorem
\ref{thm.binom.binom}; it is like a binomial formula for binomial coefficients
instead of powers. We will prove it later (in Section \ref{sect.binom.vander}%
). For now, see \cite[Theorem 3.29]{detnotes} for a proof (which is stated
only for $x,y\in\mathbb{Q}$, but applies just as well to any numbers $x$ and
$y$).

The next two theorems appear in \cite[Exercise 1]{18f-mt3s}:

\begin{theorem}
[Cauchy's binomial formula]\label{thm.binom.cauchy}Let $n\in\mathbb{N}$ and
$x,y,z\in\mathbb{R}$. Then,%
\[
\sum_{k=0}^{n}\dbinom{n}{k}\left(  x+kz\right)  ^{k}\left(  y-kz\right)
^{n-k}=\sum_{k=0}^{n}\dfrac{n!}{k!}\left(  x+y\right)  ^{k}z^{n-k}.
\]

\end{theorem}

\begin{theorem}
[Abel's binomial formula]\label{thm.binom.abel} Let $n\in\mathbb{N}$ and
$x,y,z\in\mathbb{R}$. Then,%
\[
\sum_{k=0}^{n}\dbinom{n}{k}\underbrace{x\left(  x+kz\right)  ^{k-1}%
}_{\substack{\text{This should be read}\\\text{as }1\text{ if }k=0}}\left(
y-kz\right)  ^{n-k}=\left(  x+y\right)  ^{n}.
\]

\end{theorem}

(More precisely, \cite[Exercise 1]{18f-mt3s} states these theorems in the
particular case when $z=1$. The general case can easily be deduced from this
particular case, however.)

Note that both Theorem \ref{thm.binom.cauchy} and Theorem \ref{thm.binom.abel}
generalize the binomial formula; indeed, Theorem \ref{thm.binom.binom} can be
recovered from either of them by setting $z=0$.

\begin{exercise}
\label{exe.binom.knCk}Let $n\in\mathbb{N}$. Prove that $\sum_{k=0}^{n}%
k\dbinom{n}{k}=n\cdot2^{n-1}$.
\end{exercise}

\begin{center}
\fbox{\textbf{Class of 2019-10-07}}
\end{center}

\subsection{\label{sect.intro.count}Counting subsets}

\subsubsection{All subsets}

Theorem \ref{thm.binom.comb} tells us how many $k$-element subsets a given
$n$-element set has, where $n$ and $k$ are fixed. What if we don't fix $k$,
and simply ask for the number of all subsets of an $n$-element set? The
following theorem gives the answer:

\begin{theorem}
\label{thm.subsets.2pown}Let $n\in\mathbb{N}$. Let $S$ be an $n$-element set.
Then,%
\[
\left(  \text{\# of subsets of }S\right)  =2^{n}.
\]

\end{theorem}

\begin{exercise}
\label{exe.subsets.2pown}Prove Theorem \ref{thm.subsets.2pown}.

[\textbf{Hint:} Imitate the proof of Theorem \ref{thm.binom.comb}.]
\end{exercise}

We will later give two other proofs of Theorem \ref{thm.subsets.2pown}: an
algebraic proof in Subsection \ref{subsect.intro.count.subsets} and a
combinatorial proof in Subsection \ref{subsect.intro.tups.apps}.\footnote{The
impatient reader can find the latter proof in \cite[Exercise 1 \textbf{(a)}%
]{19f-hw0s}. (More precisely, \cite[Exercise 1 \textbf{(a)}]{19f-hw0s} is the
particular case of Theorem \ref{thm.subsets.2pown} when $S=\left[  n\right]
$. But it can easily be adapted to the general case.)}

\subsubsection{\label{subsect.intro.count.subsets}Lacunar subsets: the basics}

We have now seen the following examples of counting:

\begin{itemize}
\item An $n$-element set has $2^{n}$ subsets. (This is Theorem
\ref{thm.subsets.2pown}.)

\item An $n$-element set has $\dbinom{n}{k}$ many $k$-element subsets. (This
is Theorem \ref{thm.binom.comb}.)
\end{itemize}

Let us now ask subtler questions.

\begin{definition}
\label{def.subsets.lacunar}A set $S$ of integers is said to be \emph{lacunar}
if it contains no two consecutive integers (i.e., there is no integer $i$ such
that both $i\in S$ and $i+1\in S$).
\end{definition}

For example, the set $\left\{  1,5,7\right\}  $ is lacunar, whereas $\left\{
1,5,6\right\}  $ is not. Note that any $1$-element subset of $\mathbb{Z}$ is
lacunar, and so is the empty set.

Some people say \textquotedblleft sparse\textquotedblright\ instead of
\textquotedblleft lacunar\textquotedblright. I will use \textquotedblleft
lacunar\textquotedblright, since the word \textquotedblleft
sparse\textquotedblright\ has a different meaning in computer science.

It is not hard to list the lacunar subsets of $\left[  5\right]  $: They are
\begin{align*}
&  \varnothing,\ \ \ \ \ \ \ \ \ \ \left\{  1\right\}
,\ \ \ \ \ \ \ \ \ \ \left\{  2\right\}  ,\ \ \ \ \ \ \ \ \ \ \left\{
3\right\}  ,\ \ \ \ \ \ \ \ \ \ \left\{  4\right\}
,\ \ \ \ \ \ \ \ \ \ \left\{  5\right\}  ,\ \ \ \ \ \ \ \ \ \ \left\{
1,3\right\}  ,\\
&  \left\{  1,4\right\}  ,\ \ \ \ \ \ \ \ \ \ \left\{  1,5\right\}
,\ \ \ \ \ \ \ \ \ \ \left\{  2,4\right\}  ,\ \ \ \ \ \ \ \ \ \ \left\{
2,5\right\}  ,\ \ \ \ \ \ \ \ \ \ \left\{  3,5\right\}
,\ \ \ \ \ \ \ \ \ \ \left\{  1,3,5\right\}  .
\end{align*}


We can now ask several natural questions:

\begin{question}
\label{quest.subsets.lacunar.abc}For given $n,k\in\mathbb{N}$:

\textbf{(a)} How many lacunar subsets does $\left[  n\right]  $ have?

\textbf{(b)} How many $k$-element lacunar subsets does $\left[  n\right]  $ have?

\textbf{(c)} What is the largest size of a lacunar subset of $\left[
n\right]  $ ?
\end{question}

Let us start with \textbf{(c)}:

\begin{definition}
\label{def.floor-ceil}Let $x\in\mathbb{R}$. Then:

\begin{itemize}
\item We let $\left\lfloor x\right\rfloor $ denote the largest integer $\leq
x$. This integer $\left\lfloor x\right\rfloor $ is called the \emph{floor} of
$x$, or \textquotedblleft\emph{rounding down} $x$\textquotedblright.

\item We let $\left\lceil x\right\rceil $ denote the smallest integer $\geq
x$. This integer $\left\lceil x\right\rceil $ is called the \emph{ceiling} of
$x$, or \textquotedblleft\emph{rounding up} $x$\textquotedblright.
\end{itemize}
\end{definition}

\begin{example}
We have
\begin{align*}
\left\lfloor 3\right\rfloor  &  =3;\ \ \ \ \ \ \ \ \ \ \left\lfloor \sqrt
{2}\right\rfloor =1;\ \ \ \ \ \ \ \ \ \ \left\lfloor \pi\right\rfloor
=3;\ \ \ \ \ \ \ \ \ \ \left\lfloor -\pi\right\rfloor =-4;\\
\left\lceil 3\right\rceil  &  =3;\ \ \ \ \ \ \ \ \ \ \left\lceil \sqrt
{2}\right\rceil =2;\ \ \ \ \ \ \ \ \ \ \left\lceil \pi\right\rceil
=4;\ \ \ \ \ \ \ \ \ \ \left\lceil -\pi\right\rceil =-3.
\end{align*}

\end{example}

Let us note that each $x\in\mathbb{R}$ satisfies $\left\lfloor x\right\rfloor
\leq x\leq\left\lceil x\right\rceil $.

It is intuitively clear that there is no way to pick more than $\left\lceil
n/2\right\rceil $ distinct numbers from the set $\left\{  1,2,\ldots
,n\right\}  $ without picking two consecutive integers. Let us state and
rigorously prove this:

\begin{proposition}
\label{prop.subsets.lacunar.maxsize}Let $n\in\mathbb{N}$. Then, the largest
size of a lacunar subset of $\left[  n\right]  $ is $\left\lceil
n/2\right\rceil $.
\end{proposition}

Our proof of this will rely on the following basic fact:

\begin{theorem}
\label{thm.subset-leq}Let $A$ be a finite set. Let $B$ be a subset of $A$. Then:

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

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

\textbf{(c)} If $\left\vert B\right\vert =\left\vert A\right\vert $, then
$B=A$.
\end{theorem}

This theorem is fundamental. Theorem \ref{thm.subset-leq} \textbf{(a)} is
known as the \emph{difference rule}, and is part of the reason why $A\setminus
B$ is called the \textquotedblleft set difference\textquotedblright\ of $A$
and $B$\ \ \ \ \footnote{although this terminology persists even in the case
when $B$ is not a subset of $A$, despite the fact that $\left\vert A\setminus
B\right\vert $ is usually not $\left\vert A\right\vert -\left\vert
B\right\vert $ in this case}. Parts \textbf{(b)} and \textbf{(c)} of Theorem
\ref{thm.subset-leq} are (in a sense) the combinatorial manifestation of the
principle \textquotedblleft the whole is greater than its
part\textquotedblright. But before you declare them completely obvious, keep
in mind that Theorem \ref{thm.subset-leq} \textbf{(c)} is not true for
infinite sets! Indeed, if we set $B=\mathbb{N}$ and $A=\mathbb{Z}$, then
$B\subseteq A$ holds, and so does $\left\vert B\right\vert =\left\vert
A\right\vert $ (in the sense that the infinite sets $B$ and $A$ have the same
cardinality), but it is not true that $B=A$. Thus, it is worth proving the
theorem. Fortunately, it is a simple application of the sum rule:

\begin{fineprint}
\begin{proof}
[Proof of Theorem \ref{thm.subset-leq}.]We know that $B\subseteq A$. Hence,
the set $A$ is the union of the two disjoint sets $B$ and $A\setminus B$.
Hence, Theorem \ref{thm.1.2} (applied to $S=A$, $k=2$, $S_{1}=B$ and
$S_{2}=A\setminus B$) yields $\left\vert A\right\vert =\left\vert B\right\vert
+\left\vert A\setminus B\right\vert $. Thus, $\left\vert A\setminus
B\right\vert =\left\vert A\right\vert -\left\vert B\right\vert $. This proves
Theorem \ref{thm.subset-leq} \textbf{(a)}.

\textbf{(b)} We have $\left\vert A\right\vert =\left\vert B\right\vert
+\underbrace{\left\vert A\setminus B\right\vert }_{\geq0}\geq\left\vert
B\right\vert $. In other words, $\left\vert B\right\vert \leq\left\vert
A\right\vert $. This proves Theorem \ref{thm.subset-leq} \textbf{(b)}.

\textbf{(c)} Assume that $\left\vert B\right\vert =\left\vert A\right\vert $.
Hence, $\left\vert B\right\vert =\left\vert A\right\vert =\left\vert
B\right\vert +\left\vert A\setminus B\right\vert $. Subtracting $\left\vert
B\right\vert $ from both sides of this equation, we obtain $0=\left\vert
A\setminus B\right\vert $, so that $\left\vert A\setminus B\right\vert =0$.
But this shows that $A\setminus B$ is the empty set. Hence, $A\subseteq B$, so
that $A=B$ (because $B\subseteq A$). In other words, $B=A$. This proves
Theorem \ref{thm.subset-leq} \textbf{(c)}.
\end{proof}
\end{fineprint}

\begin{proof}
[Proof of Proposition \ref{prop.subsets.lacunar.maxsize}.]The lacunar
set\footnote{We are using the notation $\left\{  a_{1}<a_{2}<\cdots
<a_{k}\right\}  $ (where $a_{1},a_{2},\ldots,a_{k}$ are some integers) to mean
the set $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  $ when we want to
simultaneously assert that $a_{1}<a_{2}<\cdots<a_{k}$. For example, $\left\{
2<5<8\right\}  $ means the set $\left\{  2,5,8\right\}  $, whereas $\left\{
4<2<7\right\}  $ is not well-defined.}%
\begin{align*}
\left\{  \text{all odd elements of }\left[  n\right]  \right\}   &  =\left\{
1,3,5,\ldots,\left(  n\text{ or }n-1\right)  \right\} \\
&  =\left\{  1<3<5<\cdots<\left(  n\text{ or }n-1\right)  \right\}
\end{align*}
(where the last element is $n$ if $n$ is odd, and $n-1$ if $n$ is even) is a
subset of $\left[  n\right]  $ and has size $\left\lceil n/2\right\rceil $.
Thus, there exists a lacunar subset of $\left[  n\right]  $ having size
$\left\lceil n/2\right\rceil $. Hence, we only need to prove that no higher
size is possible.

Let us prove this. Let $L$ be a lacunar subset of $\left[  n\right]  $. We
shall prove that $\left\vert L\right\vert \leq\left\lceil n/2\right\rceil $.

Indeed, let $L^{+}$ be the set $\left\{  s+1\ \mid\ s\in L\right\}  $. (In
other words, $L^{+}$ is the set $L$ \textquotedblleft shifted by $1$ to the
right\textquotedblright, in the sense that $L^{+}$ is obtained from $L$ by
adding $1$ to each element. For example, if $L=\left\{  2,4,7,10\right\}  $,
then $L^{+}=\left\{  3,5,8,11\right\}  $.)

It is clear that $\left\vert L\right\vert =\left\vert L^{+}\right\vert $.
(Formally speaking, this is a consequence of the bijection principle, because
the map $L\rightarrow L^{+},\ s\mapsto s+1$ is clearly a bijection.)

We have $L\subseteq\left[  n\right]  =\left\{  1,2,\ldots,n\right\}  $ and
therefore $L^{+}\subseteq\left\{  2,3,\ldots,n+1\right\}  \subseteq\left[
n+1\right]  $. Also, $L\subseteq\left[  n\right]  \subseteq\left[  n+1\right]
$. Thus, we know that both $L$ and $L^{+}$ are subsets of $\left[  n+1\right]
$. Hence, their union $L\cup L^{+}$ is a subset of $\left[  n+1\right]  $ as
well. Therefore, Theorem \ref{thm.subset-leq} \textbf{(b)} (applied to $L\cup
L^{+}$ and $\left[  n+1\right]  $ instead of $B$ and $A$) yields
\[
\left\vert L\cup L^{+}\right\vert \leq\left\vert \left[  n+1\right]
\right\vert =n+1\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left[  n+1\right]
=\left\{  1,2,\ldots,n+1\right\}  \right)  .
\]


On the other hand, recall that $L$ is lacunar. Thus, the sets $L$ and $L^{+}$
are disjoint\footnote{\textit{Proof.} Let $t\in L\cap L^{+}$. Thus, $t\in
L\cap L^{+}\subseteq L$ and $t\in L\cap L^{+}\subseteq L^{+}=\left\{
s+1\ \mid\ s\in L\right\}  $. In other words, there exists some $s\in L$ such
that $t=s+1$. Consider this $s$. Now, the set $L$ contains the two consecutive
integers $s$ and $s+1$ (since $s\in L$ and $s+1=t\in L$). But $L$ contains no
two consecutive integers (since $L$ is lacunar). These two statements clearly
contradict each other. Thus we have obtained a contradiction.
\par
Now, forget that we fixed $t$. We thus have found a contradiction for each
$t\in L\cap L^{+}$. Hence, there exists no $t\in L\cap L^{+}$. In other words,
the sets $L$ and $L^{+}$ are disjoint.}. Hence, (\ref{eq.thm.1.2.variant1-k=2}%
) (applied to $X=L$ and $Y=L^{+}$) yields%
\[
\left\vert L\cup L^{+}\right\vert =\left\vert L\right\vert
+\underbrace{\left\vert L^{+}\right\vert }_{\substack{=\left\vert L\right\vert
\\\text{(since }\left\vert L\right\vert =\left\vert L^{+}\right\vert \text{)}%
}}=\left\vert L\right\vert +\left\vert L\right\vert =2\cdot\left\vert
L\right\vert .
\]
Hence,%
\[
2\cdot\left\vert L\right\vert =\left\vert L\cup L^{+}\right\vert \leq n+1.
\]
Thus,
\[
\left\vert L\right\vert \leq\left(  n+1\right)  /2=\underbrace{n/2}%
_{\leq\left\lceil n/2\right\rceil }+\underbrace{1/2}_{<1}<\left\lceil
n/2\right\rceil +1.
\]
Hence,\footnote{We are using the following basic fact here: If $a$ and $b$ are
two integers satisfying $a<b$, then $a\leq b-1$.}
\begin{align*}
\left\vert L\right\vert  &  \leq\left(  \left\lceil n/2\right\rceil +1\right)
-1\ \ \ \ \ \ \ \ \ \ \left(  \text{because }\left\vert L\right\vert \text{
and }\left\lceil n/2\right\rceil +1\text{ are integers}\right) \\
&  =\left\lceil n/2\right\rceil .
\end{align*}


Now, forget that we fixed $L$. We thus have shown that any lacunar subset $L$
of $\left[  n\right]  $ satisfies $\left\vert L\right\vert \leq\left\lceil
n/2\right\rceil $. In other words, any lacunar subset of $\left[  n\right]  $
has size $\leq\left\lceil n/2\right\rceil $. Then, the largest size of a
lacunar subset of $\left[  n\right]  $ is $\left\lceil n/2\right\rceil $
(because we already know that there exists a lacunar subset of $\left[
n\right]  $ having size $\left\lceil n/2\right\rceil $). This proves
Proposition \ref{prop.subsets.lacunar.maxsize}.
\end{proof}

\begin{fineprint}
As another application of Theorem \ref{thm.subset-leq}, let us prove Theorem
\ref{thm.subsets.2pown} again:\footnote{The first proof was given in the
solution to Exercise \ref{exe.subsets.2pown}.}

\begin{proof}
[Second proof of Theorem \ref{thm.subsets.2pown}.]We have $\left\vert
S\right\vert =n$, since $S$ is an $n$-element set. If $B$ is any subset of
$S$, then Theorem \ref{thm.subset-leq} \textbf{(b)} (applied to $A=S$) yields
$\left\vert B\right\vert \leq\left\vert S\right\vert =n$ and therefore
$\left\vert B\right\vert \in\left\{  0,1,\ldots,n\right\}  $. Hence, the sum
rule yields\footnote{The sum rule that we are using here is Theorem
\ref{thm.sumrule2}. (Namely, we are applying Theorem \ref{thm.sumrule2} to
$\left\{  \text{subsets of }S\right\}  $ and $\left\{  0,1,\ldots,n\right\}  $
instead of $S$ and $W$, where the map $f:\left\{  \text{subsets of }S\right\}
\rightarrow\left\{  0,1,\ldots,n\right\}  $ is defined by $f\left(  B\right)
=\left\vert B\right\vert $ for all $B\in\left\{  \text{subsets of }S\right\}
$.)}%
\begin{align*}
&  \left(  \text{\# of subsets of }S\right) \\
&  =\sum_{k\in\left\{  0,1,\ldots,n\right\}  }\underbrace{\left(  \text{\# of
subsets }B\text{ of }S\text{ satisfying }\left\vert B\right\vert =k\right)
}_{\substack{=\left(  \text{\# of }k\text{-element subsets of }S\right)
\\=\dbinom{n}{k}\\\text{(by Theorem \ref{thm.binom.comb})}}}\\
&  =\sum_{k\in\left\{  0,1,\ldots,n\right\}  }\dbinom{n}{k}=\sum_{k=0}%
^{n}\dbinom{n}{k}\ \ \ \ \ \ \ \ \ \ \left(  \text{since the symbol }%
\sum_{k=0}^{n}\text{ stands for }\sum_{k\in\left\{  0,1,\ldots,n\right\}
}\right) \\
&  =2^{n}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Corollary \ref{cor.binom.2pown}%
}\right)  .
\end{align*}
This proves Theorem \ref{thm.subsets.2pown}.
\end{proof}
\end{fineprint}

\subsubsection{\label{subsect.intro.count.sage}Intermezzo: SageMath}

\paragraph{Counting using SageMath.}

Our next goal is to address Question \ref{quest.subsets.lacunar.abc}
\textbf{(b)}. A good way to start is by collecting some data. For example,
counting the lacunar subsets of $\left[  n\right]  $ for the first (say) $10$
positive integer values of $n$ is a straightforward task best left to a
computer. The easiest way to do so is to use
\href{https://www.sagemath.org}{the SageMath computer algebra system}
\cite{sage}, since it has almost all of the necessary functionality built in
already. You can either install SageMath on your computer (see
\href{https://www.sagemath.org/download.html}{here} for Linux binaries,
\href{https://www.sagemath.org/download-latest.html}{here} for Linux sources,
and \href{https://github.com/sagemath/sage-windows/releases}{here} for less
up-to-date Windows installers), or run it on
\href{https://cocalc.com/?utm_source=sagemath.org&utm_medium=landingpage}{the
CoCalc cloud}, or (if your computations are quick) use the
\href{https://sagecell.sagemath.org}{SageMathCell} browser interface. The
latter option is the easiest one, in my experience.

First, let us find all $3$-element subsets of $\left[  5\right]  =\left\{
1,2,3,4,5\right\}  $. Typing in \begin{python}
Subsets({1, 2, 3, 4, 5}, 3)
\end{python}returns:

\qquad\texttt{Subsets of \{1, 2, 3, 4, 5\} of size 3}

\noindent Okay, but how do we list them? For that, we use \begin{python}
list(Subsets({1, 2, 3, 4, 5}, 3))
\end{python} and obtain

\qquad\texttt{[\{1, 2, 3\},}

\qquad\texttt{ \{1, 2, 4\},}

\qquad\texttt{ \{1, 2, 5\},}

\qquad\texttt{ \{1, 3, 4\},}

\qquad\texttt{ \{1, 3, 5\},}

\qquad\texttt{ \{1, 4, 5\},}

\qquad\texttt{ \{2, 3, 4\},}

\qquad\texttt{ \{2, 3, 5\},}

\qquad\texttt{ \{2, 4, 5\},}

\qquad\texttt{ \{3, 4, 5\}]}

\noindent These are our subsets indeed.\footnote{Square brackets
\texttt{[...]} delimit lists in SageMath.} Likewise, we can get SageMath to
list all subsets of $\left[  4\right]  $ (of all sizes): \begin{python}
list(Subsets({1, 2, 3, 4}))
\end{python}


\noindent This results in SageMath printing all $16$ subsets of $\left[
4\right]  $.

Now, let us see which of them are lacunar -- more precisely, let us make
SageMath figure that out. For this, we need to define a function that checks
whether a given subset is lacunar. We call it \pyth{is_lacunar}, and define it
as follows:\footnote{The second line in this definition is unnecessary; it is
just a comment explaining to us humans what the function is supposed to do.}
\begin{python}
def is_lacunar(I):
	# Check whether a set `I` of integers is lacunar.
	return all( e + 1 not in I for e in I )
\end{python}


\noindent\footnote{When pasting this code, don't forget the indentation: The
second and third lines need to be indented, or else SageMath will not
recognize that they are part of the definition of the function!} The
\pyth{all} function here stands for the logical \textquotedblleft for
all\textquotedblright\ quantifier, so you should read \textquotedblleft%
\pyth{all( e + 1 not in I for e in I )}\textquotedblright\ as
\textquotedblleft for all $e\in I$, we have $e+1\notin I$\textquotedblright%
\ (which is indeed a way to say that $I$ is lacunar).

You can check that this function works as intended: \begin{python}
is_lacunar({1, 4, 6})
\end{python}returns \texttt{True}, whereas \begin{python}
is_lacunar({1, 4, 5})
\end{python}returns \texttt{False}.

If you are using the SageMathCell browser interface, you need to put
\textbf{both} the definition of the function and these tests into the input
box\footnote{and, generally, you must keep the definition in the input box
whenever you want to use it -- as SageMathCell won't remember it for you}. So
you have to write: \begin{python}
def is_lacunar(I):
	# Check whether a set `I` of integers is lacunar.
	return all( e + 1 not in I for e in I )
	
is_lacunar({1, 4, 6})
\end{python}


Better yet, you can use the \texttt{print} instruction to do both of these
tests at once: \begin{python}
def is_lacunar(I):
	# Check whether a set `I` of integers is lacunar.
	return all( e + 1 not in I for e in I )
	
print(is_lacunar({1, 4, 6}))
print(is_lacunar({1, 4, 5}))
\end{python}


\noindent(Without the \texttt{print} instruction, SageMathCell would only give
you the output of the very last line.)

Now, let us make SageMath list the lacunar subsets of $\left[  4\right]  $. We
shall ask it to do so by walking through all the subsets of $\left[  4\right]
$, and filtering them for lacunarity. Having defined the \pyth{is_lacunar}
function, this is easy: \begin{python}
[A for A in Subsets({1, 2, 3, 4}) if is_lacunar(A)]
\end{python}


\noindent The meaning of this expression is very similar to the mathematical
set-builder notation $\left\{  A\ \mid\ A\in\mathcal{P}\left(  \left\{
1,2,3,4\right\}  \right)  \text{ and }A\text{ is lacunar}\right\}  $; the main
difference is that we are using square brackets rather than set-braces and
therefore obtain a list rather than a set. The result is what we would expect:

\qquad\texttt{[\{\}, \{1\}, \{2\}, \{3\}, \{4\}, \{1, 3\}, \{1, 4\}, \{2,
4\}]}

\noindent This is a list of all lacunar subsets of $\left[  4\right]  $, each
listed only once. Thus, the length of the list is the number of said subsets.
We can let SageMath compute this length as follows: \begin{python}
len([A for A in Subsets({1, 2, 3, 4}) if is_lacunar(A)])
\end{python}\noindent As expected, we get $8$. In general, the SageMath
function \pyth{len} can be applied both to lists and to sets, yielding the
length of the former and the size of the latter.

We can now put these to use and compute the number of lacunar subsets of
$\left[  n\right]  $ for any $n\in\mathbb{N}$ that is not too high. For
example, for $n=7$, we just need to ask SageMath the following:
\begin{python}
len([A for A in Subsets({1, 2, 3, 4, 5, 6, 7}) if is_lacunar(A)])
\end{python}\noindent and we quickly obtain $34$.

A bit of typing thus lets us build the following table of numbers of lacunar
subsets:%
\[%
\begin{tabular}
[c]{|c||c|c|c|c|c|c|c|c|c|c|c}\hline
$n$ & $0$ & $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$ & $9$ &
$\ \ \ \ \ \ \cdots\ \ \ \ \ \ $\\\hline
$\#$ & $1$ & $2$ & $3$ & $5$ & $8$ & $13$ & $21$ & $34$ & $55$ & $89$ &
$\ \ \ \ \ \ \cdots\ \ \ \ \ \ $\\\hline
\end{tabular}
\]
(where each entry in the bottom row is the \# of lacunar subsets of $\left[
n\right]  $ for the appropriate value of $n$).

At this point, you may have a good guess of what the general answer is. We
will get to it, but beforehand, let me say a few words about how we could have
used SageMath better than we did above, because otherwise I would feel bad for
teaching you bad programming habits.

\paragraph{Working with general $n$.}

The way I showed above required me to type in a new command for each new value
of $n$. Why not have the computer calculate the whole table at once? For this,
we need to define a function which takes a number $n$ as input and returns the
\# of lacunar subsets of $n$. Let me call this function \texttt{num\_lacs},
and define it as follows: \begin{python}
def num_lacs(n):
	# Return the number of all lacunar subsets of `[n]`.
	N = set(range(1, n+1)) # This is the set of `1, 2, ..., n`.
	return len([A for A in Subsets(N) if is_lacunar(A)])
\end{python}


\noindent\ Here is what this function does: It first constructs the set
$\left[  n\right]  $ (which it calls $N$). It does this by first constructing
the list $\left(  1,2,\ldots,n\right)  $ (which is done via
\pyth{range(1, n+1)} because in general, \pyth{range(a, b)} returns the list
$\left(  a,a+1,\ldots,b-1\right)  $), and then making a set out of this list
using the \pyth{set} function. Then, it returns the number of all lacunar
subsets of this set $N=\left[  n\right]  $ (in the same way as we did above).

Having defined this function, we can make SageMath list its values for all
$n\in\left\{  0,1,\ldots,9\right\}  $ as follows:\footnote{The following code
fragment has only two lines. The linebreak between \pyth{str(} and
\pyth{num_lacs(n))} is a consequence of lack of space on this page.}
\begin{python}
for n in range(0, 10):
	print("The number of lacunar subsets of [" + str(n) + "] is " + str(num_lacs(n)))
\end{python}\noindent This code runs through all elements $n$ of
\pyth{range(0, 10)}, which means all elements of $\left\{  0,1,\ldots
,9\right\}  $, and prints a certain piece of text for each of them, which
always has the form \textquotedblleft The number of lacunar subsets of
[\textquotedblright, followed by the value of $n$, followed by the text
\textquotedblleft] is \textquotedblright, followed by the \# of lacunar
subsets of $\left[  n\right]  $. Here is the output:

\vspace{0.5pc}

\texttt{\qquad The number of lacunar subsets of [0] is 1}

\texttt{\qquad The number of lacunar subsets of [1] is 2}

\texttt{\qquad The number of lacunar subsets of [2] is 3}

\texttt{\qquad The number of lacunar subsets of [3] is 5}

\texttt{\qquad The number of lacunar subsets of [4] is 8}

\texttt{\qquad The number of lacunar subsets of [5] is 13}

\texttt{\qquad The number of lacunar subsets of [6] is 21}

\texttt{\qquad The number of lacunar subsets of [7] is 34}

\texttt{\qquad The number of lacunar subsets of [8] is 55}

\texttt{\qquad The number of lacunar subsets of [9] is 89}

\vspace{0.5pc}

\noindent This is essentially our above table, in text form, generated all at
once. (We could go further and have SageMath generate the LaTeX sourcecode of
the whole table, but this would distract us here.)

\paragraph{Optimizing the code.}

Our code now looks like this: \begin{python}
def is_lacunar(I):
	# Check whether a set `I` of integers is lacunar.
	return all( e + 1 not in I for e in I )
	
def num_lacs(n):
	# Return the number of all lacunar subsets of `[n]`.
	N = set(range(1, n+1)) # This is the set of `1, 2, ..., n`.
	return len([A for A in Subsets(N) if is_lacunar(A)])
	
for n in range(0, 10):
	print("The number of lacunar subsets of [" + str(n) + "] is " + str(num_lacs(n)))
\end{python}


\noindent It is good enough for computing the required values for all
$n\in\left\{  0,1,\ldots,18\right\}  $, but higher $n$'s will bring SageMath
to its knees. (The SageMathCell browser interface has a timeout -- if your
computation takes longer than 30 seconds\footnote{I believe it is 30
seconds.}, it will stop. But even on your own machine, you don't want to wait
for days.)

It turns out that we can speed up our code a bit by optimizing the
\pyth{num_lacs} function. In its current form, this function first computes
the \textbf{list} of all lacunar subsets of $\left[  n\right]  $ and then
returns the length of this list. Thus, it walks through all subsets of
$\left[  n\right]  $, and whenever it encounters a lacunar one, it
\textquotedblleft writes it down\textquotedblright\ into a list (in memory).
It would be faster to simply \textbf{count} these lacunar subsets, without
writing them down, since we only want to know their number. The easiest way to
do so is to simply start with the number $0$ and then add $1$ to it every time
a lacunar subset is encountered. This suggests the following modified version
of the \pyth{num_lacs} function: \begin{python}
def num_lacs(n):
	# Return the number of all lacunar subsets of `[n]`.
	N = set(range(1, n+1)) # This is the set of `1, 2, ..., n`.
	return sum(1 for A in Subsets(N) if is_lacunar(A))
\end{python}


\noindent The line \begin{python}
sum(1 for A in Subsets(N) if is_lacunar(A))
\end{python} here corresponds to the mathematical expression $\sum
\limits_{\substack{A\subseteq\left[  n\right]  ;\\A\text{ is lacunar}}}1$,
which is exactly the \# of lacunar subsets of $\left[  n\right]  $ (by the
identity (\ref{eq.sum.equal-1})).

This speeds up our code, but only by a little, because the true bulk of the
time is taken by walking through all the $2^{n}$ subsets of $\left[  n\right]
$. Nevertheless, it is worth remembering this tactic for reducing needless
busywork. There are many situations where it does make a major difference.

\paragraph{The manual.}

You have now seen a few pieces of SageMath's functionality and a few examples
of how to use it. Of course, there is a lot more. Since this text is not a
SageMath reference book, you will need other sources to discover what else
SageMath can do for you. An overview is given in the text \cite{SageBook}. In
order to systematically explore the abilities of SageMath, you will have to
consult the SageMath reference manual, which can currently be found at
\url{https://doc.sagemath.org/html/en/reference/} . In particular,
\href{https://doc.sagemath.org/html/en/reference/combinat/index.html}{the
Combinatorics page} is of most relevance to us.

\subsubsection{Counting lacunar subsets}

Let us now return to theorems and proofs. As our SageMath computations heavily
suggest, we should expect the \# of lacunar subsets of $\left[  n\right]  $ to
be a Fibonacci number, namely $f_{n+2}$. And this holds for all $n\in
\mathbb{N}$ indeed. Moreover, it holds for $n=-1$ as well, if we extend our
notation $\left[  k\right]  $ for $\left\{  1,2,\ldots,k\right\}  $ to
encompass the case when $k$ is negative in the following way:

\begin{definition}
Let $k\in\mathbb{Z}$. Then, $\left[  k\right]  $ shall denote the set
$\left\{  1,2,\ldots,k\right\}  $. This is understood to be the empty set
$\varnothing$ when $k\leq0$.
\end{definition}

Let us state our claim about the \# of lacunar subsets of $\left[  n\right]  $
as a proposition:

\begin{proposition}
\label{prop.1.35}Let $n\in\left\{  -1,0,1,\ldots\right\}  $. Then,%
\[
\left(  \text{\# of lacunar subsets of }\left[  n\right]  \right)  =f_{n+2}.
\]

\end{proposition}

There are several ways to prove Proposition \ref{prop.1.35}.

\begin{proof}
[First proof of Proposition \ref{prop.1.35} (sketched).]The following proof is
similar to that of Theorem \ref{thm.binom.comb} above, so we will be brief and
leave parts of it to the reader. A complete version of this proof can be found
in \cite[solution to Exercise 4.3]{detnotes}\footnote{Keep in mind that
\cite[Exercise 4.3]{detnotes} is an equivalent restatement of our Proposition
\ref{prop.1.35} (more precisely, our Proposition \ref{prop.1.35} is
\cite[Exercise 4.3]{detnotes}, applied to $n+2$ instead of $n$).} or in
\cite[Exercise 4 \textbf{(c)}]{17f-hw1s}\footnote{Note that \cite[Exercise 4
\textbf{(c)}]{17f-hw1s} only covers the case when $n\in\mathbb{N}$. But the
remaining case (viz., the case $n=-1$) is trivial.}.

Forget that we fixed $n$. For each $n\in\left\{  -1,0,1,\ldots\right\}  $, we
define the integer $\ell_{n}$ by%
\[
\ell_{n}=\left(  \text{\# of lacunar subsets of }\left[  n\right]  \right)  .
\]
Note that $\ell_{0}=1$ (since the only lacunar subset of the empty set
$\left[  0\right]  $ is the empty set itself) and $\ell_{-1}=1$ (for similar reasons).

Now, we claim that%
\begin{equation}
\ell_{n}=\ell_{n-1}+\ell_{n-2}\ \ \ \ \ \ \ \ \ \ \text{for each integer
}n\geq1. \label{pf.prop.1.35.1st.rec}%
\end{equation}


[\textit{Proof of (\ref{pf.prop.1.35.1st.rec}):} Let $n\geq1$ be an integer.
We shall call a subset of $\left[  n\right]  $

\begin{itemize}
\item \textbf{red} if it contains $n$, and

\item \textbf{green} if it does not contain $n$.
\end{itemize}

\noindent Thus, each subset of $\left[  n\right]  $ is either red or green
(but not both at the same time). Thus, by the sum rule, we have%
\begin{align*}
&  \left(  \text{\# of lacunar subsets of }\left[  n\right]  \right) \\
&  =\left(  \text{\# of lacunar red subsets of }\left[  n\right]  \right)
+\left(  \text{\# of lacunar green subsets of }\left[  n\right]  \right)  .
\end{align*}
We shall now compute the two addends on the right hand side.

First of all, we observe that the green subsets of $\left[  n\right]  $ are
precisely the subsets of $\left[  n-1\right]  $. Hence,%
\begin{align}
&  \left(  \text{\# of lacunar green subsets of }\left[  n\right]  \right)
\nonumber\\
&  =\left(  \text{\# of lacunar subsets of }\left[  n-1\right]  \right)
=\ell_{n-1} \label{pf.prop.1.35.1st.rec.pf.green-done}%
\end{align}
(since $\ell_{n-1}$ was defined to be the \# of lacunar subsets of $\left[
n-1\right]  $).

What about the red subsets?

A lacunar red subset of $\left[  n\right]  $ must contain $n$ (since it is
red), and thus cannot contain $n-1$ (since it is lacunar, but $n-1$ and $n$
are two consecutive integers). Hence, if $R$ is a lacunar red subset of
$\left[  n\right]  $, then $R\setminus\left\{  n\right\}  $ is not only a
subset of $\left[  n-1\right]  $ but actually a subset of $\left[  n-2\right]
$. Hence, the map%
\begin{align*}
f:\left\{  \text{lacunar red subsets of }\left[  n\right]  \right\}   &
\rightarrow\left\{  \text{lacunar subsets of }\left[  n-2\right]  \right\}
,\\
R  &  \mapsto R\setminus\left\{  n\right\}
\end{align*}
is well-defined. Moreover, it is easy to see that this map is a bijection
(because if $P$ is a lacunar subset of $\left[  n-2\right]  $, then
$P\cup\left\{  n\right\}  $ is a lacunar subset of $\left[  n\right]  $).
Therefore, the bijection principle (applied to the bijection $f$) yields%
\[
\left\vert \left\{  \text{lacunar red subsets of }\left[  n\right]  \right\}
\right\vert =\left\vert \left\{  \text{lacunar subsets of }\left[  n-2\right]
\right\}  \right\vert .
\]
In other words,%
\begin{align}
&  \left(  \text{\# of lacunar red subsets of }\left[  n\right]  \right)
\nonumber\\
&  =\left(  \text{\# of lacunar subsets of }\left[  n-2\right]  \right)
=\ell_{n-2} \label{pf.prop.1.35.1st.rec.pf.red-done}%
\end{align}
(since $\ell_{n-2}$ was defined to be the \# of lacunar subsets of $\left[
n-2\right]  $).

Now,%
\begin{align*}
&  \left(  \text{\# of lacunar subsets of }\left[  n\right]  \right) \\
&  =\underbrace{\left(  \text{\# of lacunar red subsets of }\left[  n\right]
\right)  }_{=\ell_{n-2}}+\underbrace{\left(  \text{\# of lacunar green subsets
of }\left[  n\right]  \right)  }_{=\ell_{n-1}}\\
&  =\ell_{n-2}+\ell_{n-1}=\ell_{n-1}+\ell_{n-2}.
\end{align*}
This proves (\ref{pf.prop.1.35.1st.rec}).]

The rest of the proof proceeds by the same argument that we used for
Proposition \ref{prop.1.5}: We have to show that
\[
\left(  \text{\# of lacunar subsets of }\left[  n\right]  \right)
=f_{n+2}\ \ \ \ \ \ \ \ \ \ \text{for each }n\in\left\{  -1,0,1,\ldots
\right\}  .
\]
In other words, we have to show that%
\[
\ell_{n}=f_{n+2}\ \ \ \ \ \ \ \ \ \ \text{for each }n\in\left\{
-1,0,1,\ldots\right\}
\]
(since $\ell_{n}=\left(  \text{\# of lacunar subsets of }\left[  n\right]
\right)  $). In other words, we have to show that the sequences $\left(
\ell_{-1},\ell_{0},\ell_{1},\ldots\right)  $ and $\left(  f_{1},f_{2}%
,f_{3},\ldots\right)  $ are identical. Both of them have the property that
their first entries are $1$'s (since $\ell_{-1}=1$ and $f_{1}=1$), their
second entries are $1$'s (since $\ell_{0}=1$ and $f_{2}=1$), and each of their
further entries equals the sum of the preceding two entries\footnote{Indeed,
for the shifted Fibonacci sequence $\left(  f_{1},f_{2},f_{3},\ldots\right)
$, this is clear. For the sequence $\left(  \ell_{-1},\ell_{0},\ell_{1}%
,\ldots\right)  $, this follows from (\ref{pf.prop.1.35.1st.rec}).}. Thus,
both sequences start with the same two entries, and then are built out of
these two entries according to the same rule. Hence, the two sequences must be
the same. This proves Proposition \ref{prop.1.35}.
\end{proof}

The next proof of Proposition \ref{prop.1.35} we shall give is an example of a
\emph{bijective proof}: a proof that uses the bijection principle to show that
two numbers are equal. (Previous examples of such proofs are our proofs of
Proposition \ref{prop.domino.symm} and of Proposition \ref{prop.1.4}, as well
as our third proof of Theorem \ref{thm.1.10}.)

\begin{proof}
[Second proof of Proposition \ref{prop.1.35} (sketched).]Let us consider
domino tilings of the rectangle $R_{n+1,2}$. The \# of such tilings is
$d_{n+1,2}$ (because we defined $d_{n+1,2}$ to be this \#). Hence,%
\begin{align}
&  \left(  \text{\# of domino tilings of }R_{n+1,2}\right) \nonumber\\
&  =d_{n+1,2}=f_{\left(  n+1\right)  +1}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
Proposition \ref{prop.1.5}, applied to }n+1\text{ instead of }n\right)
\nonumber\\
&  =f_{n+2}. \label{pf.prop.1.35.2nd.1}%
\end{align}


If $D=\left\{  \left(  i,j\right)  ,\left(  i+1,j\right)  \right\}  $ is a
horizontal domino, then we say that $D$ \emph{starts} in column $i$. In other
words, a horizontal domino starts in its western column.

We want to define a map%
\[
h:\left\{  \text{domino tilings of }R_{n+1,2}\right\}  \rightarrow\left\{
\text{lacunar subsets of }\left[  n\right]  \right\}
\]
as follows: If $T$ is any domino tiling of $R_{n+1,2}$, then $h\left(
T\right)  $ shall be the set of all $i\in\left[  n+1\right]  $ such that at
least one horizontal domino of $T$ starts in column $i$.

Before we do anything with this map $h$, we need to check that it is
well-defined. First, let us illustrate it with an example: If $n=13$ and if
$T$ is the domino tiling%
\[%
\begin{tabular}
[c]{cccccccccccccc}%
$1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$ & $9$ & $10$ & $11$ & $12$ &
$13$ & $14$\\\hline
\multicolumn{1}{|l|}{\phantom{w}} & \multicolumn{1}{l}{\phantom{w}} &
\multicolumn{1}{l|}{\phantom{w}} & \multicolumn{1}{l}{\phantom{w}} &
\multicolumn{1}{l|}{\phantom{w}} & \multicolumn{1}{l|}{\phantom{w}} &
\multicolumn{1}{l}{\phantom{w}} & \multicolumn{1}{l|}{\phantom{w}} &
\multicolumn{1}{l}{\phantom{w}} & \multicolumn{1}{l|}{\phantom{w}} &
\multicolumn{1}{l|}{\phantom{w}} & \multicolumn{1}{l|}{\phantom{w}} &
\multicolumn{1}{l}{\phantom{w}} & \multicolumn{1}{l|}{\phantom{w}}%
\\\cline{2-5}\cline{4-5}\cline{7-10}\cline{9-10}\cline{13-14}%
\multicolumn{1}{|l|}{\phantom{w}} & \multicolumn{1}{l}{\phantom{w}} &
\multicolumn{1}{l|}{\phantom{w}} & \multicolumn{1}{l}{\phantom{w}} &
\multicolumn{1}{l|}{\phantom{w}} & \multicolumn{1}{l|}{\phantom{w}} &
\multicolumn{1}{l}{\phantom{w}} & \multicolumn{1}{l|}{\phantom{w}} &
\multicolumn{1}{l}{\phantom{w}} & \multicolumn{1}{l|}{\phantom{w}} &
\multicolumn{1}{l|}{\phantom{w}} & \multicolumn{1}{l|}{\phantom{w}} &
\multicolumn{1}{l}{\phantom{w}} & \multicolumn{1}{l|}{\phantom{w}}\\\hline
\end{tabular}
\]
(where the numbers on the top are just the numbers of the columns), then
$h\left(  T\right)  =\left\{  2,4,7,9,13\right\}  $, since the horizontal
dominos of $T$ start in columns $2,4,7,9,13$.

The proof that $h$ is well-defined will rest on the following two observations:

\begin{statement}
\textit{Observation 1:} Let $T$ be a domino tiling of $R_{n+1,2}$. Then, no
horizontal domino of $T$ starts in column $n+1$.
\end{statement}

[\textit{Proof of Observation 1:} This is clear, since any horizontal domino
that starts in column $n+1$ would continue into column $n+2$ and thus fail to
stay inside $R_{n+1,2}$.]

\begin{statement}
\textit{Observation 2:} Let $T$ be a domino tiling of $R_{n+1,2}$. Then, no
two horizontal dominos of $T$ start in consecutive columns.
\end{statement}

[\textit{Proof of Observation 2:} This is easy to see by induction on $n$ (as
in the proof of Proposition \ref{prop.1.4}). An alternative proof proceeds as
follows: Assume the contrary. Thus, there are two horizontal dominos of $T$
that start in consecutive columns. In other words, there are two consecutive
columns of $R_{n+1,2}$, each of which has a horizontal domino of $T$ start in
it. In other words, there exists an $i\in\left[  n\right]  $ such that each of
the two consecutive columns $i$ and $i+1$ has a horizontal domino of $T$ start
in it. Let us pick the \textbf{smallest} such $i$. Therefore, the column $i-1$
has no horizontal domino of $T$ start in it (since otherwise, $i-1$ would be a
smaller candidate than $i$, because each of the two consecutive columns $i-1$
and $\left(  i-1\right)  +1=i$ would have a horizontal domino of $T$ start in it).

We know that column $i$ has a horizontal domino of $T$ start in it, and that
column $i+1$ has a horizontal domino of $T$ start in it. Let these dominos be
$D$ and $E$ (labeled in such a way that $D$ starts in column $i$, and $E$
starts in column $i+1$). Clearly, the dominos $D$ and $E$ cannot lie in the
same row, since otherwise they would overlap. Thus, one of $D$ and $E$ lies in
row $1$, and the other lies in row $2$ (where we number rows from the bottom,
so that row $1$ is the bottom row of $R_{n+1,2}$). Let us WLOG assume that $D$
lies in row $1$ and $E$ lies in row $2$ (since the opposite case is
analogous). Thus, $D=\left\{  \left(  i,1\right)  ,\left(  i+1,1\right)
\right\}  $ and $E=\left\{  \left(  i+1,2\right)  ,\left(  i+2,2\right)
\right\}  $. Here is how $D$ and $E$ look like:%
\[%
%TCIMACRO{\TeXButton{two dominos}{\begin{tikzpicture}[scale=0.7]
%\draw(0, 0) -- (0, 2) -- (4, 2) -- (4, 0) -- cycle;
%\draw(2, 2) -- (6, 2) -- (6, 4) -- (2, 4) -- cycle;
%\node at (2, 1) {$D$};
%\node at (4, 3) {$E$};
%\node at (1, 5) {$i$};
%\node at (3, 5) {$i+1$};
%\node at (5, 5) {$i+2$};
%\end{tikzpicture}}}%
%BeginExpansion
\begin{tikzpicture}[scale=0.7]
\draw(0, 0) -- (0, 2) -- (4, 2) -- (4, 0) -- cycle;
\draw(2, 2) -- (6, 2) -- (6, 4) -- (2, 4) -- cycle;
\node at (2, 1) {$D$};
\node at (4, 3) {$E$};
\node at (1, 5) {$i$};
\node at (3, 5) {$i+1$};
\node at (5, 5) {$i+2$};
\end{tikzpicture}%
%EndExpansion
\ \ .
\]


Now, the square $\left(  i,2\right)  $ must belong to some domino $F\in T$.
This domino $F$ cannot be vertical (since it would otherwise overlap with
$D$), and thus is horizontal. Moreover, this horizontal domino $F$ cannot
start in column $i$ (since it would otherwise overlap with $E$), and thus must
start in column $i-1$. This contradicts the fact that the column $i-1$ has no
horizontal domino of $T$ start in it. This contradiction shows that our
assumption was false; hence, Observation 2 is proven.]

Now, we can confirm that the map $h$ defined above is well-defined: If $T$ is
a domino tiling of $R_{n+1,2}$, then the set that we wanted to call $h\left(
T\right)  $ is actually a subset of $\left[  n\right]  $ (since it is a subset
of $\left[  n+1\right]  $, but Observation 1 shows that it does not contain
$n+1$), and is lacunar (by Observation 2). Thus, $h$ is well-defined.

Next, I claim that $h$ is a bijection. Indeed, let me construct an inverse to
$h$: Consider the map%
\[
g:\left\{  \text{lacunar subsets of }\left[  n\right]  \right\}
\rightarrow\left\{  \text{domino tilings of }R_{n+1,2}\right\}
\]
that sends each lacunar subset $S$ of $\left[  n\right]  $ to the domino
tiling of $R_{n+1,2}$ that is constructed by placing two horizontal dominos
into columns $i$ and $i+1$ for each $i\in S$, and filling the rest of
$R_{n+1,2}$ with vertical dominos. It is easy to see that $h\circ
g=\operatorname*{id}$. It is somewhat trickier to see that $g\circ
h=\operatorname*{id}$; this requires the following two observations:

\begin{statement}
\textit{Observation 3:} Let $T$ be a domino tiling of $R_{n+1,2}$. Let
$i\in\left[  n+1\right]  $ be such that a horizontal domino of $T$ starts in
column $i$. Then, \textbf{two} horizontal dominos of $T$ start in column $i$,
and these two dominos cover both columns $i$ and $i+1$.
\end{statement}

\begin{statement}
\textit{Observation 4:} Let $T$ be a domino tiling of $R_{n+1,2}$. Let
$i\in\left[  n+1\right]  $ be such that no horizontal domino of $T$ starts in
column $i$ and no horizontal domino of $T$ starts in column $i-1$ either.
Then, column $i$ is covered by a vertical domino of $T$.
\end{statement}

It is not hard to prove these two observations. In a nutshell: Observation 3
follows from Observation 2 (because a horizontal domino only covers one square
of column $i$, and the other square must be covered by another domino, which
must also be horizontal in order to avoid overlap). Observation 4 follows by
noticing that any horizontal domino that contains $\left(  i,1\right)  $ or
$\left(  i,2\right)  $ must start either in column $i$ or in column $i-1$.

Together, Observation 3 and Observation 4 show that $g\circ
h=\operatorname*{id}$ (make sure you understand how), and thus the maps $g$
and $h$ are mutually inverse (since $h\circ g=\operatorname*{id}$ holds as
well). Hence, the map $h$ is invertible, i.e., a bijection. Thus, the
bijection principle yields%
\[
\left\vert \left\{  \text{domino tilings of }R_{n+1,2}\right\}  \right\vert
=\left\vert \left\{  \text{lacunar subsets of }\left[  n\right]  \right\}
\right\vert .
\]
In other words,%
\[
\left(  \text{\# of domino tilings of }R_{n+1,2}\right)  =\left(  \text{\# of
lacunar subsets of }\left[  n\right]  \right)  .
\]
Comparing this with (\ref{pf.prop.1.35.2nd.1}), we find%
\[
\left(  \text{\# of lacunar subsets of }\left[  n\right]  \right)  =f_{n+2}.
\]
This proves Proposition \ref{prop.1.35} again.
\end{proof}

\subsubsection{\label{subsect.intro.count.lacunar.k-elt}Counting $k$-element
lacunar subsets}

Proposition \ref{prop.1.35} has answered Question
\ref{quest.subsets.lacunar.abc} \textbf{(a)}. It remains to answer Question
\ref{quest.subsets.lacunar.abc} \textbf{(b)}. This is done by the following proposition:

\begin{proposition}
\label{prop.1.36}Let $n\in\mathbb{Z}$ and $k\in\mathbb{N}$ be such that $k\leq
n+1$. Then,
\[
\left(  \text{\# of }k\text{-element lacunar subsets of }\left[  n\right]
\right)  =\dbinom{n+1-k}{k}.
\]

\end{proposition}

(To be pedantic, Proposition \ref{prop.1.36} only answers Question
\ref{quest.subsets.lacunar.abc} \textbf{(b)} in the case when $k\leq n+1$. But
the remaining case is trivial: If $k>n+1$, then $k>n+1>n$, and thus the set
$\left[  n\right]  $ has no $k$-element subsets\footnote{by Theorem
\ref{thm.subset-leq} \textbf{(b)}}, let alone $k$-element lacunar subsets.)

Proposition \ref{prop.1.36} appears in \cite[Exercise 3 \textbf{(a)}%
]{17f-hw2s}, with two proofs\footnote{To be \textbf{very} pedantic:
\cite[Exercise 3 \textbf{(a)}]{17f-hw2s} only states Proposition
\ref{prop.1.36} in the case when $n\in\mathbb{N}$. But the remaining case is
trivial (since $k\leq n+1$ leads to $k=0$ when $n$ is negative, and thus we
have to count $0$-element subsets of an empty set, which is not a challenge at
this point).}. One way to prove it is by strong induction on $n$, similar to
the first proof of Proposition \ref{prop.1.35}. (This is the second solution
of \cite[Exercise 3 \textbf{(a)}]{17f-hw2s}.) There is, however, a more
enlightening proof than that, which is bijective and explains the binomial
coefficient on the right hand side combinatorially. This latter proof will
rely on the following fact:\footnote{We use the word \textquotedblleft
tuple\textquotedblright\ as a synonym for \textquotedblleft finite
list\textquotedblright.}

\begin{proposition}
\label{prop.intset.inclist} Let $S$ be a finite set of integers. Then, there
exists a unique tuple $\left(  s_{1},s_{2},\ldots,s_{k}\right)  $ of integers
satisfying $\left\{  s_{1},s_{2},\ldots,s_{k}\right\}  =S$ and $s_{1}%
<s_{2}<\cdots<s_{k}$.
\end{proposition}

Proposition \ref{prop.intset.inclist} is just saying that any finite set of
integers can be uniquely listed in increasing order (with no repetitions).
This is sufficiently self-evident that I have never seen a combinatorics
textbook that proves it. A detailed proof can be found in \cite[proof of
Theorem 2.46]{detnotes}\footnote{In \cite[\S 2.6]{detnotes}, a tuple $\left(
s_{1},s_{2},\ldots,s_{k}\right)  $ of integers satisfying $\left\{
s_{1},s_{2},\ldots,s_{k}\right\}  =S$ and $s_{1}<s_{2}<\cdots<s_{k}$ is called
an \emph{increasing list} of $S$. Thus, our Proposition
\ref{prop.intset.inclist} is simply saying that any finite set $S$ of integers
has a unique increasing list.}, and a sketch at \cite[Outline of a proof of
Proposition 1.3]{19f-hw0s}.

Let us furthermore make the following convention (which we have already made
in our proof of Proposition \ref{prop.subsets.lacunar.maxsize}):

\begin{definition}
\label{def.intset.inccomp}Let $a_{1},a_{2},\ldots,a_{k}$ be $k$ numbers
(integers, rational numbers or real numbers). The notation \textquotedblleft%
$\left\{  a_{1}<a_{2}<\cdots<a_{k}\right\}  $\textquotedblright\ shall denote
the set $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  $ and simultaneously
assert that $a_{1}<a_{2}<\cdots<a_{k}$. In other words, it means the set
$\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  $ when $a_{1}<a_{2}<\cdots<a_{k}$,
and otherwise is meaningless. Thus, for example, $\left\{  2<5<8\right\}  $
means the set $\left\{  2,5,8\right\}  $, whereas $\left\{  5<2<8\right\}  $
is meaningless.
\end{definition}

Thus, Proposition \ref{prop.intset.inclist} can be restated as follows: Each
finite set of integers can be uniquely expressed in the form $\left\{
s_{1}<s_{2}<\cdots<s_{k}\right\}  $. Of course, the $k$ here is the size of
this set.

The following proposition is a variant of Proposition
\ref{prop.intset.inclist} for the case when $\left\vert S\right\vert $ is known:

\begin{proposition}
\label{prop.intset.inclist-k} Let $m\in\mathbb{N}$. Let $S$ be an $m$-element
set of integers. Then, there exists a unique $m$-tuple $\left(  s_{1}%
,s_{2},\ldots,s_{m}\right)  $ of integers satisfying $\left\{  s_{1}%
,s_{2},\ldots,s_{m}\right\}  =S$ and $s_{1}<s_{2}<\cdots<s_{m}$.
\end{proposition}

The subtle difference between Proposition \ref{prop.intset.inclist} and
Proposition \ref{prop.intset.inclist-k} is that the size of the tuple in
Proposition \ref{prop.intset.inclist-k} is specified in advance (viz., it must
be $m=\left\vert S\right\vert $), whereas Proposition
\ref{prop.intset.inclist-k} is a statement about tuples of all possible sizes.

The overly skeptical reader may want to solve the following exercise:

\begin{exercise}
\label{exe.intset.inclist-k}Derive Proposition \ref{prop.intset.inclist-k}
from Proposition \ref{prop.intset.inclist}.
\end{exercise}

Now, we can give a bijective proof of Proposition \ref{prop.1.36}:

\begin{proof}
[Proof of Proposition \ref{prop.1.36} (sketched).]We have $n+1-k\in\mathbb{N}$
(since $k\leq n+1$). Hence, the set $\left\{  0,1,\ldots,n-k\right\}  $ is an
$\left(  n+1-k\right)  $-element set. Theorem \ref{thm.binom.comb} (applied to
$n+1-k$ and $\left\{  0,1,\ldots,n-k\right\}  $ instead of $n$ and $S$) thus
shows that%
\begin{equation}
\left(  \text{\# of }k\text{-element subsets of }\left\{  0,1,\ldots
,n-k\right\}  \right)  =\dbinom{n+1-k}{k}. \label{pf.prop.1.36.1}%
\end{equation}
We shall put this equality to use by finding a bijection between
\newline$\left\{  k\text{-element lacunar subsets of }\left[  n\right]
\right\}  $ and $\left\{  k\text{-element subsets of }\left\{  0,1,\ldots
,n-k\right\}  \right\}  $.

Proposition \ref{prop.intset.inclist-k} (applied to $m=k$) shows that if $S$
is any $k$-element set of integers, then there exists a unique $k$-tuple
$\left(  s_{1},s_{2},\ldots,s_{k}\right)  $ of integers satisfying $\left\{
s_{1},s_{2},\ldots,s_{k}\right\}  =S$ and $s_{1}<s_{2}<\cdots<s_{k}$. In other
words, if $S$ is any $k$-element set of integers, then $S$ can be uniquely
expressed in the form $\left\{  s_{1}<s_{2}<s_{3}<\cdots<s_{k}\right\}  $.

Hence, if $S$ is any $k$-element lacunar subset of $\left[  n\right]  $, then
$S$ can be uniquely expressed in the form $\left\{  s_{1}<s_{2}<s_{3}%
<\cdots<s_{k}\right\}  $. Moreover, the integers $s_{1},s_{2},\ldots,s_{k}$ in
this expression must satisfy not only $s_{i}<s_{i+1}$ for each $i\in\left[
k-1\right]  $, but also the stronger inequality $s_{i}+1<s_{i+1}$ for each
$i\in\left[  k-1\right]  $ (since otherwise, we would have $s_{i}+1=s_{i+1}$
for some $i\in\left[  k-1\right]  $, and thus the subset $S$ would contain the
two consecutive integers $s_{i}$ and $s_{i+1}$, which would contradict its
lacunarity). Hence, they must satisfy $s_{1}-1<s_{2}-2<s_{3}-3<\cdots<s_{k}-k$
(because the inequality $s_{i}+1<s_{i+1}$ can be equivalently rewritten as
$s_{i}-i<s_{i+1}-\left(  i+1\right)  $, and these inequalities can be spliced
together to form the chain $s_{1}-1<s_{2}-2<s_{3}-3<\cdots<s_{k}-k$).
Furthermore, they must satisfy $s_{1}-1\geq0$ (since $s_{1}\geq1$) and
$s_{k}-k\leq n-k$ (since $s_{k}\leq n$), and therefore the set $\left\{
s_{1}-1<s_{2}-2<s_{3}-3<\cdots<s_{k}-k\right\}  $ is a well-defined
$k$-element subset of $\left\{  0,1,\ldots,n-k\right\}  $.

Thus, we can define a map%
\begin{align*}
A:\left\{  k\text{-element lacunar subsets of }\left[  n\right]  \right\}   &
\rightarrow\left\{  k\text{-element subsets of }\left\{  0,1,\ldots
,n-k\right\}  \right\}  ,\\
\left\{  s_{1}<s_{2}<s_{3}<\cdots<s_{k}\right\}   &  \mapsto\left\{
s_{1}-1<s_{2}-2<s_{3}-3<\cdots<s_{k}-k\right\}  .
\end{align*}


Conversely, it is easy to see that we can define a map%
\begin{align*}
B:\left\{  k\text{-element subsets of }\left\{  0,1,\ldots,n-k\right\}
\right\}   &  \rightarrow\left\{  k\text{-element lacunar subsets of }\left[
n\right]  \right\}  ,\\
\left\{  t_{1}<t_{2}<t_{3}<\cdots<t_{k}\right\}   &  \mapsto\left\{
t_{1}+1<t_{2}+2<t_{3}+3<\cdots<t_{k}+k\right\}  .
\end{align*}


It is fairly obvious that the maps $A$ and $B$ are mutually inverse. Hence,
the map $A$ is invertible, i.e., is a bijection. Thus, the bijection principle
yields%
\begin{align*}
&  \left\vert \left\{  k\text{-element lacunar subsets of }\left[  n\right]
\right\}  \right\vert \\
&  =\left\vert \left\{  k\text{-element subsets of }\left\{  0,1,\ldots
,n-k\right\}  \right\}  \right\vert .
\end{align*}
In other words,%
\begin{align*}
&  \left(  \text{\# of }k\text{-element lacunar subsets of }\left[  n\right]
\right) \\
&  =\left(  \text{\# of }k\text{-element subsets of }\left\{  0,1,\ldots
,n-k\right\}  \right) \\
&  =\dbinom{n+1-k}{k}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.prop.1.36.1})}\right)  .
\end{align*}
This proves Proposition \ref{prop.1.36}.
\end{proof}

(The above proof of Proposition \ref{prop.1.36} can also be rewritten in terms
of domino tilings instead of lacunar subsets, since we know a bijection
between the former and the latter from our second proof of Proposition
\ref{prop.1.35}.)

By combining Proposition \ref{prop.1.35} and Proposition \ref{prop.1.36}, we
can now obtain a bijective proof of Proposition \ref{prop.binom.fib}:

\begin{proof}
[Proof of Proposition \ref{prop.binom.fib}.]Let $m=n-1$. Then, $m\in\left\{
-1,0,1,\ldots\right\}  $ (since $n\in\mathbb{N}=\left\{  0,1,2,\ldots\right\}
$) and $m+1=n$. Hence, it is easy to see that $\left\vert \left[  m\right]
\right\vert \leq n$\ \ \ \ \footnote{\textit{Proof.} If $m\in\mathbb{N}$, then
$\left\vert \left[  m\right]  \right\vert =m=n-1\leq n$. Hence, if
$m\in\mathbb{N}$, then we are done. Thus, we WLOG assume that $m\notin%
\mathbb{N}$. Combining this with $m\in\left\{  -1,0,1,\ldots\right\}  $, we
obtain $m\in\left\{  -1,0,1,\ldots\right\}  \setminus\mathbb{N}=\left\{
-1\right\}  $, so that $m=-1$. Thus, $m+1=0$, so that $n=m+1=0$. But $m=-1$
and thus $\left[  m\right]  =\varnothing$ and therefore $\left\vert \left[
m\right]  \right\vert =\left\vert \varnothing\right\vert =0=n$ (since $n=0$).
Hence, $\left\vert \left[  m\right]  \right\vert \leq n$, qed.}.

If $B$ is any subset of $\left[  m\right]  $, then Theorem
\ref{thm.subset-leq} \textbf{(b)} (applied to $A=\left[  m\right]  $) yields
$\left\vert B\right\vert \leq\left\vert \left[  m\right]  \right\vert \leq n$
and therefore $\left\vert B\right\vert \in\left\{  0,1,\ldots,n\right\}  $.
Hence, the sum rule yields\footnote{Again, the sum rule that we are using here
is Theorem \ref{thm.sumrule2}.}
\begin{align*}
&  \left(  \text{\# of lacunar subsets of }\left[  m\right]  \right) \\
&  =\sum_{k\in\left\{  0,1,\ldots,n\right\}  }\underbrace{\left(  \text{\# of
lacunar subsets }B\text{ of }\left[  m\right]  \text{ satisfying }\left\vert
B\right\vert =k\right)  }_{\substack{=\left(  \text{\# of }k\text{-element
lacunar subsets of }\left[  m\right]  \right)  \\=\dbinom{m+1-k}{k}\\\text{(by
Proposition \ref{prop.1.36}, applied to }m\text{ instead of }n\text{)}}}\\
&  =\sum_{k\in\left\{  0,1,\ldots,n\right\}  }\dbinom{m+1-k}{k}=\sum_{k=0}%
^{n}\dbinom{m+1-k}{k}=\sum_{k=0}^{n}\dbinom{n-k}{k}%
\end{align*}
(since $m+1=n$). Comparing this with%
\begin{align*}
&  \left(  \text{\# of lacunar subsets of }\left[  m\right]  \right) \\
&  =f_{m+2}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition \ref{prop.1.35},
applied to }m\text{ instead of }n\right) \\
&  =f_{n+1}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }m+2=\underbrace{\left(
m+1\right)  }_{=n}+1=n+1\right)  ,
\end{align*}
we obtain%
\[
f_{n+1}=\sum_{k=0}^{n}\dbinom{n-k}{k}=\dbinom{n-0}{0}+\dbinom{n-1}{1}%
+\dbinom{n-2}{2}+\cdots+\dbinom{n-n}{n}.
\]
This proves Proposition \ref{prop.binom.fib}.
\end{proof}

This is not the only known proof of Proposition \ref{prop.binom.fib}. There is
also a (more straightforward) proof by strong induction on $n$ using Theorem
\ref{thm.binom.rec}. (See \cite[\S 1.15]{Vorobi02} for the details of this
proof, or find it yourself.)

\subsubsection{Counting subsets with $a$ odd and $b$ even elements}

Question \ref{quest.subsets.lacunar.abc} is resolved. Here is another one, to
illustrate a principle we shall use more often later: Given $n,a,b\in
\mathbb{N}$, how many subsets of $\left[  n\right]  $ have exactly $a$ even
elements and exactly $b$ odd elements? Here is the answer in the case when $n$
is even:

\begin{proposition}
\label{prop.count.subsets.a-ev-b-od-n-ev}Let $n\in\mathbb{N}$ be even. Let
$a\in\mathbb{N}$ and $b\in\mathbb{N}$. Then,%
\begin{align*}
&  \left(  \text{\# of subsets of }\left[  n\right]  \text{ that contain
}a\text{ even elements and }b\text{ odd elements}\right) \\
&  =\dbinom{n/2}{a}\dbinom{n/2}{b}.
\end{align*}
(Here, \textquotedblleft$a$ even elements\textquotedblright\ means
\textquotedblleft exactly $a$ even elements\textquotedblright, and
\textquotedblleft$b$ odd elements\textquotedblright\ means \textquotedblleft
exactly $b$ odd elements\textquotedblright.)
\end{proposition}

The following proof is essentially copied from \cite[Exercise 6 \textbf{(a)}%
]{18s-hw1s}:

\begin{proof}
[Proof of Proposition \ref{prop.count.subsets.a-ev-b-od-n-ev}.]Informally, our
argument is as follows: Let $E$ be the set of all even elements of $\left[
n\right]  $; let $O$ be the set of all odd elements of $\left[  n\right]  $.
We want to find the \# of subsets of $\left[  n\right]  $ that contain $a$
even elements and $b$ odd elements. In order to construct such a subset, we
can choose its $a$ even elements and its $b$ odd elements separately. The $a$
even elements must be chosen from the set $E$; thus, choosing them means
choosing an $a$-element subset of $E$. There are $\dbinom{\left\vert
E\right\vert }{a}$ ways to make this choice (by Theorem \ref{thm.binom.comb},
applied to $E$, $\left\vert E\right\vert $ and $a$ instead of $S$, $n$ and
$k$). The $b$ odd elements must be chosen from the set $O$; thus, choosing
them means choosing a $b$-element subset of $O$. There are $\dbinom{\left\vert
O\right\vert }{b}$ ways to make this choice (by Theorem \ref{thm.binom.comb},
applied to $O$, $\left\vert O\right\vert $ and $b$ instead of $S$, $n$ and
$k$). Hence, altogether, our choices can be made in $\dbinom{\left\vert
E\right\vert }{a}\dbinom{\left\vert O\right\vert }{b}$ many ways; thus,%
\begin{align}
&  \left(  \text{\# of subsets of }\left[  n\right]  \text{ that contain
}a\text{ even elements and }b\text{ odd elements}\right) \nonumber\\
&  =\dbinom{\left\vert E\right\vert }{a}\dbinom{\left\vert O\right\vert }{b}.
\label{pf.prop.count.subsets.a-ev-b-od-n-ev.1}%
\end{align}
But $n$ is even, and thus%
\[
E=\left\{  2,4,6,\ldots,n\right\}  \ \ \ \ \ \ \ \ \ \ \text{and}%
\ \ \ \ \ \ \ \ \ \ O=\left\{  1,3,5,\ldots,n-1\right\}  .
\]
Hence, each of the two sets $E$ and $O$ has exactly $n/2$ elements. In other
words, $\left\vert E\right\vert =n/2$ and $\left\vert O\right\vert =n/2$.
Thus, the equality (\ref{pf.prop.count.subsets.a-ev-b-od-n-ev.1}) rewrites as
\begin{align*}
&  \left(  \text{\# of subsets of }\left[  n\right]  \text{ that contain
}a\text{ even elements and }b\text{ odd elements}\right) \\
&  =\dbinom{n/2}{a}\dbinom{n/2}{b}.
\end{align*}
This proves Proposition \ref{prop.count.subsets.a-ev-b-od-n-ev}.

Here is a more rigorous way to write up the same proof (without speaking of
\textquotedblleft choices\textquotedblright, which arguably is not a
well-defined mathematical notion). Let $E$ be the set of all even elements of
$\left[  n\right]  $; let $O$ be the set of all odd elements of $\left[
n\right]  $. Let $\mathcal{N}$ be the set of all subsets of $\left[  n\right]
$ that contain exactly $a$ even elements and exactly $b$ odd elements. Thus,
\begin{align}
&  \left(  \text{\# of subsets of }\left[  n\right]  \text{ that contain
}a\text{ even elements and }b\text{ odd elements}\right) \nonumber\\
&  =\left\vert \mathcal{N}\right\vert .
\label{pf.prop.count.subsets.a-ev-b-od-n-ev.3}%
\end{align}
Hence, we need to show that $\left\vert \mathcal{N}\right\vert =\dbinom
{n/2}{a}\dbinom{n/2}{b}$.

For any set $X$ and every $k\in\mathbb{N}$, we let $\mathcal{P}_{k}\left(
X\right)  $ denote the set of all $k$-element subsets of $X$. Now, the two
maps%
\begin{align*}
\mathcal{N}  &  \rightarrow\mathcal{P}_{a}\left(  E\right)  \times
\mathcal{P}_{b}\left(  O\right)  ,\\
S  &  \mapsto\left(  S\cap E,S\cap O\right)
\end{align*}
and
\begin{align*}
\mathcal{P}_{a}\left(  E\right)  \times\mathcal{P}_{b}\left(  O\right)   &
\rightarrow\mathcal{N},\\
\left(  U,V\right)   &  \mapsto U\cup V
\end{align*}
are well-defined and mutually inverse\footnote{Instead of proving this in
detail (which is straightforward), let me unfold the notations and explain
what the two maps do:
\par
\begin{itemize}
\item The first map sends any $S\in\mathcal{N}$ (that is, any subset $S$ of
$\left[  n\right]  $ that contains $a$ even elements and $b$ odd elements) to
the pair $\left(  S\cap E,S\cap O\right)  $, which consists of
\par
\begin{itemize}
\item the set $S\cap E$ (this is the set of all even elements of $S$; it is an
$a$-element set, because $S$ contains exactly $a$ even elements) and
\par
\item the set $S\cap O$ (this is the set of all odd elements of $S$; it is a
$b$-element set).
\end{itemize}
\par
In other words, the first map splits any $S\in\mathcal{N}$ into its set of
even elements and its set of odd elements.
\par
\item The second map sends any pair $\left(  U,V\right)  \in\mathcal{P}%
_{a}\left(  E\right)  \times\mathcal{P}_{b}\left(  O\right)  $ to the union
$U\cup V\in\mathcal{N}$. In other words, the second map takes a pair $\left(
U,V\right)  $ consisting of an $a$-element set of even numbers and a
$b$-element set of odd numbers, and combines them to the set $U\cup V$ (which
belongs to $\mathcal{N}$, because it has $a$ even elements and $b$ odd
elements).
\end{itemize}
\par
From this point of view, it should be clear that the two maps are well-defined
and mutually inverse.}. Hence, these two maps are bijections. Thus, there
exists a bijection $\mathcal{N}\rightarrow\mathcal{P}_{a}\left(  E\right)
\times\mathcal{P}_{b}\left(  O\right)  $. Therefore, the bijection principle
shows that%
\begin{equation}
\left\vert \mathcal{N}\right\vert =\left\vert \mathcal{P}_{a}\left(  E\right)
\times\mathcal{P}_{b}\left(  O\right)  \right\vert =\left\vert \mathcal{P}%
_{a}\left(  E\right)  \right\vert \cdot\left\vert \mathcal{P}_{b}\left(
O\right)  \right\vert \label{pf.prop.count.subsets.a-ev-b-od-n-ev.modN}%
\end{equation}
(by the product rule, i.e., by (\ref{eq.thm.prodrule2.size}), applied to
$X=\mathcal{P}_{a}\left(  E\right)  $ and $Y=\mathcal{P}_{b}\left(  O\right)
$).

But every finite set $S$ and every $k\in\mathbb{N}$ satisfy%
\[
\mathcal{P}_{k}\left(  S\right)  =\left\{  k\text{-element subsets of
}S\right\}  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of
}\mathcal{P}_{k}\left(  S\right)  \right)
\]
and thus%
\begin{align}
\left\vert \mathcal{P}_{k}\left(  S\right)  \right\vert  &  =\left(  \text{\#
of }k\text{-element subsets of }S\right) \nonumber\\
&  =\dbinom{\left\vert S\right\vert }{k}
\label{pf.prop.count.subsets.a-ev-b-od-n-ev.PkS}%
\end{align}
(by Theorem \ref{thm.binom.comb}, applied to $\left\vert S\right\vert $
instead of $n$).

Now, (\ref{pf.prop.count.subsets.a-ev-b-od-n-ev.modN}) becomes%
\[
\left\vert \mathcal{N}\right\vert =\underbrace{\left\vert \mathcal{P}%
_{a}\left(  E\right)  \right\vert }_{\substack{=\dbinom{\left\vert
E\right\vert }{a}\\\text{(by (\ref{pf.prop.count.subsets.a-ev-b-od-n-ev.PkS}%
))}}}\cdot\underbrace{\left\vert \mathcal{P}_{b}\left(  O\right)  \right\vert
}_{\substack{=\dbinom{\left\vert O\right\vert }{b}\\\text{(by
(\ref{pf.prop.count.subsets.a-ev-b-od-n-ev.PkS}))}}}=\dbinom{\left\vert
E\right\vert }{a}\dbinom{\left\vert O\right\vert }{b}.
\]


Now, recall that $n$ is even. Thus, there are exactly $n/2$ even numbers in
the set $\left[  n\right]  $ (namely, $2,4,6,\ldots,n$). In other words, the
set of all even elements of $\left[  n\right]  $ has size $n/2$. In other
words, the set $E$ has size $n/2$ (since $E$ is the set of all even elements
of $\left[  n\right]  $). In other words, $\left\vert E\right\vert =n/2$.
Similarly, $\left\vert O\right\vert =n/2$. Now,%
\[
\left\vert \mathcal{N}\right\vert =\dbinom{\left\vert E\right\vert }{a}%
\dbinom{\left\vert O\right\vert }{b}=\dbinom{n/2}{a}\dbinom{n/2}{b}%
\]
(since $\left\vert E\right\vert =n/2$ and $\left\vert O\right\vert =n/2$).
Hence, (\ref{pf.prop.count.subsets.a-ev-b-od-n-ev.3}) becomes%
\begin{align*}
&  \left(  \text{\# of subsets of }\left[  n\right]  \text{ that contain
}a\text{ even elements and }b\text{ odd elements}\right) \\
&  =\left\vert \mathcal{N}\right\vert =\dbinom{n/2}{a}\dbinom{n/2}{b}.
\end{align*}
This proves Proposition \ref{prop.count.subsets.a-ev-b-od-n-ev}.
\end{proof}

The relation between the above informal proof and its formalized version is
worth pointing out explicitly: Informally, we argued that choosing a subset
with $a$ even and $b$ odd elements is tantamount to independently choosing $a$
elements from $E$ and $b$ elements from $O$. We formalized this argument as a
bijection from $\mathcal{N}$ to $\mathcal{P}_{a}\left(  E\right)
\times\mathcal{P}_{b}\left(  O\right)  $, and then used the product rule along
with the bijection principle to conclude that $\left\vert \mathcal{N}%
\right\vert =\left\vert \mathcal{P}_{a}\left(  E\right)  \right\vert
\cdot\left\vert \mathcal{P}_{b}\left(  O\right)  \right\vert $. Thus,
\textquotedblleft independent choices\textquotedblright\ in informal arguments
correspond to an application of the product rule and the bijection principle
when formalized.

The analogue of Proposition \ref{prop.count.subsets.a-ev-b-od-n-ev} in the
case of odd $n$ can be proven in the same way:

\begin{proposition}
\label{prop.count.subsets.a-ev-b-od-n-od}Let $n\in\mathbb{N}$ be odd. Let
$a\in\mathbb{N}$ and $b\in\mathbb{N}$. Then,%
\begin{align*}
&  \left(  \text{\# of subsets of }\left[  n\right]  \text{ that contain
}a\text{ even elements and }b\text{ odd elements}\right) \\
&  =\dbinom{\left(  n-1\right)  /2}{a}\dbinom{\left(  n+1\right)  /2}{b}.
\end{align*}

\end{proposition}

We leave the proof to the reader.

\begin{center}
\fbox{\textbf{Class of 2019-10-09}}
\end{center}

\subsubsection{The addition formula for Fibonacci numbers}

Let us see some of these tactics being used again in proving an identity for
Fibonacci numbers:

\begin{theorem}
\label{thm.1.37}Let $m,n\in\mathbb{N}$. Then, the Fibonacci sequence satisfies
$f_{m+n+1}=f_{m}f_{n}+f_{m+1}f_{n+1}$.
\end{theorem}

This is not a-priori a combinatorial result; it is just an algebraic identity
for the elements of a recursively defined sequence. Consequently, we should
expect it to have a purely algebraic proof. And this is indeed the case:
Theorem \ref{thm.1.37} can easily be proven by induction on $n$. For such
proofs, see \cite[solution to Exercise 3 \textbf{(e)}]{18s-mt1s} or (in a
slightly more general setting) \cite[proof of Theorem 2.26 \textbf{(a)}%
]{detnotes}\footnote{To recover Theorem \ref{thm.1.37} from \cite[Theorem 2.26
\textbf{(a)}]{detnotes}, set $a=1$ and $b=1$. Then, the sequence $\left(
x_{0},x_{1},x_{2},\ldots\right)  $ in \cite[Theorem 2.26 \textbf{(a)}%
]{detnotes} becomes the Fibonacci sequence $\left(  f_{0},f_{1},f_{2}%
,\ldots\right)  $.}. We shall, instead, derive Theorem \ref{thm.1.37} from the
combinatorial interpretation of the Fibonacci numbers.

To simplify this proof, we shall front-load a little argument into a separate
proposition (Proposition \ref{prop.1.35-interval}). We begin with a fairly
standard piece of notation:

\begin{definition}
\label{def.int-interval}Let $a$ and $b$ be two integers. Then, the subset
$\left\{  a,a+1,\ldots,b\right\}  $ of $\mathbb{Z}$ (this is the set of all
integers $i$ satisfying $a\leq i\leq b$) will be denoted by $\left[
a,b\right]  $. (Recall that this subset is understood to be $\varnothing$ when
$b<a$.)

The subset $\left[  a,b\right]  $ is called the \emph{integer interval from
}$a$ \emph{to }$b$. (It is not an interval in the sense of real analysis,
since it only contains integers; but it is the combinatorial analogue of an interval.)
\end{definition}

For example, using this notation, we have $\left[  2,5\right]  =\left\{
2,3,4,5\right\}  $ and $\left[  3,3\right]  =\left\{  3\right\}  $. Note that
we have $\left[  k\right]  =\left[  1,k\right]  $ for each $k\in\mathbb{Z}$.

\begin{proposition}
\label{prop.1.35-interval}Let $n\in\left\{  -1,0,1,\ldots\right\}  $ and
$a\in\mathbb{Z}$. Then,%
\[
\left(  \text{\# of lacunar subsets of }\left[  a+1,a+n\right]  \right)
=f_{n+2}.
\]

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.1.35-interval}.]Here is an outline: The
integer interval $\left[  a+1,a+n\right]  $ is just the integer interval
$\left[  n\right]  $ shifted by $a$. Hence, the lacunar subsets of the former
interval are in 1-to-1 correspondence with the lacunar subsets of the latter
interval. Hence, the number of lacunar subsets of the former interval equals
the number of lacunar subsets of the latter interval. Thus,%
\[
\left(  \text{\# of lacunar subsets of }\left[  a+1,a+n\right]  \right)
=\left(  \text{\# of lacunar subsets of }\left[  n\right]  \right)  =f_{n+2}%
\]
(by Proposition \ref{prop.1.35}). This proves Proposition
\ref{prop.1.35-interval}.

\bigskip

\begin{fineprint}
Formally speaking, the argument we have just made is a bijective proof, which
can be made rigorous as follows: For each subset $S$ of $\left[  n\right]  $,
we let $S+a$ denote the set $\left\{  s+a\ \mid\ s\in S\right\}  $. This set
$S+a$ is clearly a subset of $\left[  a+1,a+n\right]  $. (Informally speaking,
$S+a$ is just the set $S$ shifted by $a$ units on the number line.)
Conversely, for each subset $T$ of $\left[  a+1,a+n\right]  $, we let $T-a$
denote the set $\left\{  t-a\ \mid\ t\in T\right\}  $. \ \ \ \ \footnote{Minor
annoying caveat: Some people use the minus sign $-$ for set-theoretic
difference (so they write $P-Q$ for $P\setminus Q$). This is not what we mean
when we write $T-a$.} This set $T-a$ is clearly a subset of $\left[  n\right]
$. (Informally speaking, $T-a$ is just the set $T$ shifted by $-a$ units on
the number line.) Now, it is easy to see that the maps%
\begin{align*}
\left\{  \text{lacunar subsets of }\left[  n\right]  \right\}   &
\rightarrow\left\{  \text{lacunar subsets of }\left[  a+1,a+n\right]
\right\}  ,\\
S  &  \mapsto S+a
\end{align*}
and%
\begin{align*}
\left\{  \text{lacunar subsets of }\left[  a+1,a+n\right]  \right\}   &
\rightarrow\left\{  \text{lacunar subsets of }\left[  n\right]  \right\}  ,\\
T  &  \mapsto T-a
\end{align*}
are well-defined\footnote{This means, in particular, that if a subset $S$ of
$\left[  n\right]  $ is lacunar, then so is $S+a$. This is all
straightforward.} and mutually inverse. Hence, they are bijections. Thus, the
bijection principle yields%
\[
\left\vert \left\{  \text{lacunar subsets of }\left[  a+1,a+n\right]
\right\}  \right\vert =\left\vert \left\{  \text{lacunar subsets of }\left[
n\right]  \right\}  \right\vert .
\]
In other words,%
\[
\left(  \text{\# of lacunar subsets of }\left[  a+1,a+n\right]  \right)
=\left(  \text{\# of lacunar subsets of }\left[  n\right]  \right)  =f_{n+2}%
\]
(by Proposition \ref{prop.1.35}). This proves Proposition
\ref{prop.1.35-interval}.
\end{fineprint}
\end{proof}

We now come to our combinatorial proof of Theorem \ref{thm.1.37}:

\begin{proof}
[Proof of Theorem \ref{thm.1.37} (sketched).]If $m=0$, then the claim of
Theorem \ref{thm.1.37} boils down to the equality $f_{n+1}=f_{0}f_{n}%
+f_{1}f_{n+1}$, which is obvious (since $f_{0}=0$ and $f_{1}=1$). Hence, for
the rest of this proof, we WLOG assume that $m\neq0$. For a similar reason, we
WLOG assume that $n\neq0$. From $m\neq0$, we obtain $m\geq1$ (since
$m\in\mathbb{N}$). Hence, $m-2\geq1-2=-1$, so that $m-2\in\left\{
-1,0,1,\ldots\right\}  $. Similarly, $n-2\in\left\{  -1,0,1,\ldots\right\}  $.
Furthermore, $\underbrace{m}_{\geq1}+\underbrace{n}_{\geq1}-1\geq1+1-1=1$, so
that $m+n-1\in\mathbb{N}\subseteq\left\{  -1,0,1,\ldots\right\}  $.

Now, let us count the lacunar subsets of $\left[  m+n-1\right]  $ in two
different ways:

\textit{First way:} Proposition \ref{prop.1.35} (applied to $m+n-1$ instead of
$n$) yields%
\begin{equation}
\left(  \text{\# of lacunar subsets of }\left[  m+n-1\right]  \right)
=f_{\left(  m+n-1\right)  +2}=f_{m+n+1}. \label{pf.thm.1.37.way1}%
\end{equation}


\textit{Second way:} We shall call a subset of $\left[  m+n-1\right]  $

\begin{itemize}
\item \textbf{red} if it contains $m$, and

\item \textbf{green} if it does not contain $m$.
\end{itemize}

\noindent Thus, each subset of $\left[  m+n-1\right]  $ is either red or green
(but not both at the same time). Thus, by the sum rule, we have%
\begin{align}
&  \left(  \text{\# of lacunar subsets of }\left[  m+n-1\right]  \right)
\nonumber\\
&  =\left(  \text{\# of lacunar red subsets of }\left[  m+n-1\right]  \right)
\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ +\left(  \text{\# of lacunar green subsets of }\left[
m+n-1\right]  \right)  . \label{pf.thm.1.37.way2}%
\end{align}
We shall now compute the two addends on the right hand side.

A lacunar green subset $S$ of $\left[  m+n-1\right]  $ does not contain $m$,
and thus is the union of its two subsets $\left\{  s\in S\ \mid\ s<m\right\}
$ and $\left\{  s\in S\ \mid\ s>m\right\}  $. The former of these two subsets
is a lacunar subset of $\left[  m-1\right]  $, while the latter is a lacunar
subset of $\left[  m+1,m+n-1\right]  $. Hence, a lacunar green subset of
$\left[  m+n-1\right]  $ is just the union of a lacunar subset of $\left[
m-1\right]  $ with a lacunar subset of $\left[  m+1,m+n-1\right]  $.
Conversely, any such union must be a lacunar green subset of $\left[
m+n-1\right]  $ (since an element of $\left[  m-1\right]  $ and an element of
$\left[  m+1,m+n-1\right]  $ cannot be consecutive\footnote{because $m$
separates them}). Summarizing this discussion, we conclude that the map%
\begin{align*}
&  \left\{  \text{lacunar green subsets of }\left[  m+n-1\right]  \right\} \\
&  \rightarrow\left\{  \text{lacunar subsets of }\left[  m-1\right]  \right\}
\times\left\{  \text{lacunar subsets of }\left[  m+1,m+n-1\right]  \right\}
\end{align*}
that sends any lacunar green subset $S$ of $\left[  m+n-1\right]  $ to the
pair
\[
\left(  \left\{  s\in S\ \mid\ s<m\right\}  ,\left\{  s\in S\ \mid
\ s>m\right\}  \right)
\]
is well-defined and is a bijection (and the inverse of this map simply sends
each pair $\left(  P,Q\right)  $ to $P\cup Q$). Thus, the bijection principle
yields%
\begin{align*}
&  \left\vert \left\{  \text{lacunar green subsets of }\left[  m+n-1\right]
\right\}  \right\vert \\
&  =\left\vert \left\{  \text{lacunar subsets of }\left[  m-1\right]
\right\}  \times\left\{  \text{lacunar subsets of }\left[  m+1,m+n-1\right]
\right\}  \right\vert \\
&  =\left\vert \left\{  \text{lacunar subsets of }\left[  m-1\right]
\right\}  \right\vert \cdot\left\vert \left\{  \text{lacunar subsets of
}\left[  m+1,m+n-1\right]  \right\}  \right\vert
\end{align*}
(by the product rule). In other words,%
\begin{align}
&  \left(  \text{\# of lacunar green subsets of }\left[  m+n-1\right]  \right)
\nonumber\\
&  =\underbrace{\left(  \text{\# of lacunar subsets of }\left[  m-1\right]
\right)  }_{\substack{=f_{\left(  m-1\right)  +2}\\\text{(by Proposition
\ref{prop.1.35},}\\\text{applied to }m-1\text{ instead of }n\text{)}}%
}\cdot\underbrace{\left(  \text{\# of lacunar subsets of }\left[
m+1,m+n-1\right]  \right)  }_{\substack{=f_{\left(  n-1\right)  +2}\\\text{(by
Proposition \ref{prop.1.35-interval},}\\\text{applied to }m\text{ and
}n-1\text{ instead of }a\text{ and }n\text{)}}}\nonumber\\
&  =\underbrace{f_{\left(  m-1\right)  +2}}_{=f_{m+1}}\cdot
\underbrace{f_{\left(  n-1\right)  +2}}_{=f_{n+1}}=f_{m+1}f_{n+1}.
\label{pf.thm.1.37.green}%
\end{align}


Now, let us take a look at lacunar red subsets.

A lacunar red subset $S$ of $\left[  m+n-1\right]  $ contains $m$, and thus
contains neither $m-1$ nor $m+1$ (since it is lacunar); hence, it is the union
of its two subsets $\left\{  s\in S\ \mid\ s<m-1\right\}  $ and $\left\{  s\in
S\ \mid\ s>m+1\right\}  $ and the one-element set $\left\{  m\right\}  $. The
former of these two subsets is a lacunar subset of $\left[  m-2\right]  $,
while the latter is a lacunar subset of $\left[  m+2,m+n-1\right]  $. Hence, a
lacunar red subset of $\left[  m+n-1\right]  $ is just the union of the
following three sets: a lacunar subset of $\left[  m-2\right]  $, a lacunar
subset of $\left[  m+2,m+n-1\right]  $, and the one-element set $\left\{
m\right\}  $. Conversely, any such union must be a lacunar red subset of
$\left[  m+n-1\right]  $ (since an element of $\left[  m-2\right]  $ and an
element of $\left[  m+2,m+n-1\right]  $ cannot be consecutive, and furthermore
no such element can be consecutive to $m$). Summarizing this discussion, we
conclude that the map%
\begin{align*}
&  \left\{  \text{lacunar red subsets of }\left[  m+n-1\right]  \right\} \\
&  \rightarrow\left\{  \text{lacunar subsets of }\left[  m-2\right]  \right\}
\times\left\{  \text{lacunar subsets of }\left[  m+2,m+n-1\right]  \right\}
\end{align*}
that sends any lacunar red subset $S$ of $\left[  m+n-1\right]  $ to the pair
\[
\left(  \left\{  s\in S\ \mid\ s<m-1\right\}  ,\left\{  s\in S\ \mid
\ s>m+1\right\}  \right)
\]
is well-defined and is a bijection (and the inverse of this map simply sends
each pair $\left(  P,Q\right)  $ to $P\cup Q\cup\left\{  m\right\}  $). Thus,
the bijection principle yields%
\begin{align*}
&  \left\vert \left\{  \text{lacunar red subsets of }\left[  m+n-1\right]
\right\}  \right\vert \\
&  =\left\vert \left\{  \text{lacunar subsets of }\left[  m-2\right]
\right\}  \times\left\{  \text{lacunar subsets of }\left[  m+2,m+n-1\right]
\right\}  \right\vert \\
&  =\left\vert \left\{  \text{lacunar subsets of }\left[  m-2\right]
\right\}  \right\vert \cdot\left\vert \left\{  \text{lacunar subsets of
}\left[  m+2,m+n-1\right]  \right\}  \right\vert
\end{align*}
(by the product rule). In other words,%
\begin{align}
&  \left(  \text{\# of lacunar red subsets of }\left[  m+n-1\right]  \right)
\nonumber\\
&  =\underbrace{\left(  \text{\# of lacunar subsets of }\left[  m-2\right]
\right)  }_{\substack{=f_{\left(  m-2\right)  +2}\\\text{(by Proposition
\ref{prop.1.35},}\\\text{applied to }m-2\text{ instead of }n\text{)}}%
}\cdot\underbrace{\left(  \text{\# of lacunar subsets of }\left[
m+2,m+n-1\right]  \right)  }_{\substack{=f_{\left(  n-2\right)  +2}\\\text{(by
Proposition \ref{prop.1.35-interval},}\\\text{applied to }m+1\text{ and
}n-2\text{ instead of }a\text{ and }n\text{)}}}\nonumber\\
&  =\underbrace{f_{\left(  m-2\right)  +2}}_{=f_{m}}\cdot
\underbrace{f_{\left(  n-2\right)  +2}}_{=f_{n}}=f_{m}f_{n}.
\label{pf.thm.1.37.red}%
\end{align}
Hence, (\ref{pf.thm.1.37.way2}) becomes%
\begin{align}
&  \left(  \text{\# of lacunar subsets of }\left[  m+n-1\right]  \right)
\nonumber\\
&  =\underbrace{\left(  \text{\# of lacunar red subsets of }\left[
m+n-1\right]  \right)  }_{\substack{=f_{m}f_{n}\\\text{(by
(\ref{pf.thm.1.37.red}))}}}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ +\underbrace{\left(  \text{\# of lacunar green subsets
of }\left[  m+n-1\right]  \right)  }_{\substack{=f_{m+1}f_{n+1}\\\text{(by
(\ref{pf.thm.1.37.green}))}}}\nonumber\\
&  =f_{m}f_{n}+f_{m+1}f_{n+1}. \label{pf.thm.1.37.way22}%
\end{align}


Comparing (\ref{pf.thm.1.37.way1}) with (\ref{pf.thm.1.37.way22}), we obtain
$f_{m+n+1}=f_{m}f_{n}+f_{m+1}f_{n+1}$. Thus, Theorem \ref{thm.1.37} is proven.
\end{proof}

The proof we just gave is an example of a \emph{proof by double counting}: We
have counted the lacunar subsets of $\left[  m+n-1\right]  $ (that is,
computed their number) in two different ways. In the first way, we obtained
(\ref{pf.thm.1.37.way1}); in the second, we found (\ref{pf.thm.1.37.way22}).
Comparing the results, we then obtained the equality $f_{m+n+1}=f_{m}%
f_{n}+f_{m+1}f_{n+1}$, which we had set out to prove.

Such proofs often look like magic, but they are not always hard to find: If
you want to prove an identity of the form $A=B$ by double counting, all you
have to do is come up with a counting problem that can be solved in two ways,
one of which gives $A$ as a result while the other gives $B$. The specifics of
$A$ and $B$ often give away how the problem could look like. For example,
because the identity we were proving was $f_{m+n+1}=f_{m}f_{n}+f_{m+1}f_{n+1}%
$, it stood to reason that the counting problem should be \textquotedblleft
how many lacunar subsets does $\left[  m+n-1\right]  $ have?\textquotedblright%
. This way, it is immediately clear that one answer is $f_{m+n+1}$ (by
Proposition \ref{prop.1.35}); it remained to find a second way to solve the
counting problem and get $f_{m}f_{n}+f_{m+1}f_{n+1}$ instead. The form of this
expression suggests using the sum rule, so that the lacunar subsets of
$\left[  m+n-1\right]  $ had to somehow be subdivided into two categories (the
\textquotedblleft red\textquotedblright\ and the \textquotedblleft
green\textquotedblright\ ones in the above proof) numbering $f_{m}f_{n}$ and
$f_{m+1}f_{n+1}$, respectively. Furthermore, each of these categories should
have a product-like structure (i.e., a lacunar red subset should fall apart
into two independent parts, and likewise for a lacunar green subset), so that
the products $f_{m}f_{n}$ and $f_{m+1}f_{n+1}$ could be explained by the
product rule. With these heuristics, it is not hard to come up with the exact
argument given above. This kind of reverse-engineering strategy does not
always work (it is an art, not a science, and it relies heavily on your
preknowledge), but when it does, the result is usually worth it.

Our proof of Proposition \ref{prop.binom.fib} was also a proof by double counting.

Benjamin and Quinn have devoted a whole book \cite{BenQui03} to proofs by
double counting; it has many more examples. In particular, they give a proof
of Theorem \ref{thm.1.37} (\textquotedblleft Identity 3\textquotedblright\ in
their book) which uses domino tilings, but essentially is the same as our
proof.\footnote{Recall that domino tilings and lacunar subsets are more or
less interchangeable, as our Second proof of Proposition \ref{prop.1.35} has
shown.}

\subsubsection{More subset counting}

Let us explore some more classes of subsets, each time asking ourselves have
many there are. We begin with the following:

\begin{exercise}
\label{exe.count.subsets.self-count} A set $S$ of integers is said to be
\emph{self-counting} if the size $\left\vert S\right\vert $ is an element of
$S$. (For example, $\left\{  1,3,5\right\}  $ is self-counting, since
$\left\vert \left\{  1,3,5\right\}  \right\vert =3\in\left\{  1,3,5\right\}
$; but $\left\{  1,2,5\right\}  $ is not self-counting.)

Let $n$ be a positive integer.

\textbf{(a)} For each $k\in\left[  n\right]  $, find the \# of self-counting
$k$-element subsets of $\left[  n\right]  $.

\textbf{(b)} Find the \# of all self-counting subsets of $\left[  n\right]  $.
\end{exercise}

This exercise is essentially \cite[Exercise 8]{17f-hw1s}.

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.count.subsets.self-count} (sketched).]%
\textbf{(a)} Fix $k\in\left[  n\right]  $. For any $k$-element subset $S$ of
$\left[  n\right]  $, we have the following chain of logical equivalences:%
\begin{align*}
&  \ \left(  S\text{ is self-counting}\right) \\
&  \Longleftrightarrow\ \left(  \text{the size }\left\vert S\right\vert \text{
is an element of }S\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the
definition of \textquotedblleft self-counting\textquotedblright}\right) \\
&  \Longleftrightarrow\ \left(  \left\vert S\right\vert \in S\right) \\
&  \Longleftrightarrow\ \left(  k\in S\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{since }\left\vert S\right\vert =k\text{ (because }S\text{ is a
}k\text{-element set)}\right) \\
&  \Longleftrightarrow\ \left(  S\text{ contains }k\right)  .
\end{align*}
Thus, the self-counting $k$-element subsets of $\left[  n\right]  $ are
precisely the $k$-element subsets of $\left[  n\right]  $ that contain $k$.
Hence,%
\begin{align}
&  \left(  \text{\# of self-counting }k\text{-element subsets of }\left[
n\right]  \right) \nonumber\\
&  =\left(  \text{\# of }k\text{-element subsets of }\left[  n\right]  \text{
that contain }k\right)  . \label{sol.count.subsets.self-count.a.1}%
\end{align}
But the maps
\begin{align*}
\left\{  k\text{-element subsets of }\left[  n\right]  \text{ that contain
}k\right\}   &  \rightarrow\left\{  \left(  k-1\right)  \text{-element subsets
of }\left[  n\right]  \setminus\left\{  k\right\}  \right\}  ,\\
S  &  \mapsto S\setminus\left\{  k\right\}
\end{align*}
and
\begin{align*}
\left\{  \left(  k-1\right)  \text{-element subsets of }\left[  n\right]
\setminus\left\{  k\right\}  \right\}   &  \rightarrow\left\{  k\text{-element
subsets of }\left[  n\right]  \text{ that contain }k\right\}  ,\\
T  &  \mapsto T\cup\left\{  k\right\}
\end{align*}
are well-defined\footnote{This means the following:
\par
\begin{itemize}
\item If $S$ is a $k$-element subset of $\left[  n\right]  $ that contains
$k$, then $S\setminus\left\{  k\right\}  $ is a $\left(  k-1\right)  $-element
subset of $\left[  n\right]  \setminus\left\{  k\right\}  $.
\par
\item If $T$ is a $\left(  k-1\right)  $-element subset of $\left[  n\right]
\setminus\left\{  k\right\}  $, then $T\cup\left\{  k\right\}  $ is a
$k$-element subset of $\left[  n\right]  $ that contains $k$.
\end{itemize}
\par
Checking this is straightforward; you can do it in your head, but don't forget
to do this!} and mutually inverse\footnote{For this, you need to show that
\par
\begin{itemize}
\item If $S$ is a $k$-element subset of $\left[  n\right]  $ that contains
$k$, then $\left(  S\setminus\left\{  k\right\}  \right)  \cup\left\{
k\right\}  =S$.
\par
\item If $T$ is a $\left(  k-1\right)  $-element subset of $\left[  n\right]
\setminus\left\{  k\right\}  $, then $\left(  T\cup\left\{  k\right\}
\right)  \setminus\left\{  k\right\}  =T$.
\end{itemize}
\par
This is again entirely straightforward.}, and thus are bijections. Hence, the
bijection principle yields
\begin{align}
&  \left\vert \left\{  k\text{-element subsets of }\left[  n\right]  \text{
that contain }k\right\}  \right\vert \nonumber\\
&  =\left\vert \left\{  \left(  k-1\right)  \text{-element subsets of }\left[
n\right]  \setminus\left\{  k\right\}  \right\}  \right\vert \nonumber\\
&  =\left(  \text{\# of }\left(  k-1\right)  \text{-element subsets of
}\left[  n\right]  \setminus\left\{  k\right\}  \right)  .
\label{sol.count.subsets.self-count.4}%
\end{align}
But $\left[  n\right]  $ is an $n$-element set; hence, $\left[  n\right]
\setminus\left\{  k\right\}  $ is an $\left(  n-1\right)  $-element set (since
$k\in\left[  n\right]  $). Therefore, $n-1\in\mathbb{N}$, and furthermore,
Theorem \ref{thm.binom.comb} (applied to $n-1$, $k-1$ and $\left[  n\right]
\setminus\left\{  k\right\}  $ instead of $n$, $k$ and $S$) shows that%
\[
\dbinom{n-1}{k-1}=\left(  \text{\# of }\left(  k-1\right)  \text{-element
subsets of }\left[  n\right]  \setminus\left\{  k\right\}  \right)  .
\]
Comparing this with (\ref{sol.count.subsets.self-count.4}), we obtain%
\[
\left\vert \left\{  k\text{-element subsets of }\left[  n\right]  \text{ that
contain }k\right\}  \right\vert =\dbinom{n-1}{k-1}.
\]
Now, (\ref{sol.count.subsets.self-count.a.1}) becomes%
\begin{align}
&  \left(  \text{\# of self-counting }k\text{-element subsets of }\left[
n\right]  \right) \nonumber\\
&  =\left(  \text{\# of }k\text{-element subsets of }\left[  n\right]  \text{
that contain }k\right) \nonumber\\
&  =\left\vert \left\{  k\text{-element subsets of }\left[  n\right]  \text{
that contain }k\right\}  \right\vert =\dbinom{n-1}{k-1}.
\label{sol.count.subsets.self-count.a.done}%
\end{align}
This solves Exercise \ref{exe.count.subsets.self-count} \textbf{(a)}.

\textbf{(b)} Let $S$ be a self-counting subset of $\left[  n\right]  $. Then,
$\left\vert S\right\vert \in S$ (since $S$ is self-counting), and thus the set
$S$ has at least one element (namely, $\left\vert S\right\vert $). Thus,
$\left\vert S\right\vert \geq1$. But Theorem \ref{thm.subset-leq} \textbf{(b)}
(applied to $A=\left[  n\right]  $ and $B=S$) yields $\left\vert S\right\vert
\leq\left\vert \left[  n\right]  \right\vert =n$. Hence, $\left\vert
S\right\vert \in\left[  n\right]  $ (since $\left\vert S\right\vert $ is an
integer satisfying $\left\vert S\right\vert \geq1$ and $\left\vert
S\right\vert \leq n$).

Now, forget that we fixed $S$. We thus have shown that each self-counting
subset $S$ of $\left[  n\right]  $ satisfies $\left\vert S\right\vert
\in\left[  n\right]  $. Hence, by the sum rule, we have%
\begin{align*}
&  \left(  \text{\# of self-counting subsets of }\left[  n\right]  \right) \\
&  =\sum_{k\in\left[  n\right]  }\underbrace{\left(  \text{\# of self-counting
subsets }S\text{ of }\left[  n\right]  \text{ such that }\left\vert
S\right\vert =k\right)  }_{\substack{=\left(  \text{\# of self-counting
}k\text{-element subsets of }\left[  n\right]  \right)  \\=\dbinom{n-1}%
{k-1}\\\text{(by (\ref{sol.count.subsets.self-count.a.done}))}}}=\sum
_{k\in\left[  n\right]  }\dbinom{n-1}{k-1}\\
&  =\sum_{k=1}^{n}\dbinom{n-1}{k-1}\ \ \ \ \ \ \ \ \ \ \left(  \text{since the
summation sign }\sum_{k\in\left[  n\right]  }\text{ means the same as }%
\sum_{k=1}^{n}\right) \\
&  =\sum_{k=0}^{n-1}\dbinom{n-1}{k}\ \ \ \ \ \ \ \ \ \ \left(  \text{here, we
have substituted }k\text{ for }k-1\text{ in the sum}\right)  .
\end{align*}


But $n-1\in\mathbb{N}$ (since $n$ is a positive integer). Thus, Corollary
\ref{cor.binom.2pown} (applied to $n-1$ instead of $n$) yields $\sum
\limits_{k=0}^{n-1}\dbinom{n-1}{k}=2^{n-1}$. Hence,%
\[
\left(  \text{\# of self-counting subsets of }\left[  n\right]  \right)
=\sum\limits_{k=0}^{n-1}\dbinom{n-1}{k}=2^{n-1}.
\]
This solves Exercise \ref{exe.count.subsets.self-count} \textbf{(b)}.
\end{proof}
\end{fineprint}

Our next exercise is a slight variation on this one, in which we count subsets
of $\left[  n\right]  $ whose size is not just some element but in fact the
smallest one:

\begin{exercise}
\label{exe.count.subsets.self-start} A set $S$ of integers is said to be
\emph{self-starting} if the size $\left\vert S\right\vert $ is the smallest
element of $S$. (For example, the set $\left\{  3,4,6\right\}  $ is
self-starting, since $\left\vert \left\{  3,4,6\right\}  \right\vert =3$ is
its smallest element; but $\left\{  1,3,6\right\}  $ and $\left\{
1,2,6\right\}  $ are not self-starting.)

Let $n$ be a positive integer.

\textbf{(a)} For each $k\in\left[  n\right]  $, find the \# of self-starting
$k$-element subsets of $\left[  n\right]  $.

\textbf{(b)} Find the \# of all self-starting subsets of $\left[  n\right]  $.
\end{exercise}

This exercise is essentially \cite[Exercise 7]{18s-hw1s}. Note that
self-starting sets are called \textquotedblleft maximal sets\textquotedblright%
\ in \cite{Chu19}.

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.count.subsets.self-start} (sketched).]Recall
the notation from Definition \ref{def.int-interval}; in particular, if
$k\in\mathbb{Z}$, then $\left[  k+1,n\right]  $ will mean the integer interval
$\left\{  k+1,k+2,\ldots,n\right\}  $.

\textbf{(a)} Fix $k\in\left[  n\right]  $. For any $k$-element subset $S$ of
$\left[  n\right]  $, we have the following chain of logical equivalences:%
\begin{align*}
&  \ \left(  S\text{ is self-starting}\right) \\
&  \Longleftrightarrow\ \left(  \left\vert S\right\vert \text{ is the smallest
element of }S\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of
\textquotedblleft self-starting\textquotedblright}\right) \\
&  \Longleftrightarrow\ \left(  k\text{ is the smallest element of }S\right)
\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left\vert
S\right\vert =k\text{ (because }S\text{ is a }k\text{-element set)}\right) \\
&  \Longleftrightarrow\ \left(  k\in S\text{, but all elements of }S\text{
other than }k\text{ are larger than }k\right) \\
&  \Longleftrightarrow\ \left(  k\in S\text{, but all elements of }S\text{
other than }k\text{ belong to }\left[  k+1,n\right]  \right) \\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{because an element of }S\text{ is larger than }k\text{ if and only if}\\
\text{it belongs to }\left[  k+1,n\right]  \text{ (since it belongs to
}\left[  n\right]  \text{)}%
\end{array}
\right) \\
&  \Longleftrightarrow\ \left(  k\in S\text{, but all elements of }%
S\setminus\left\{  k\right\}  \text{ belong to }\left[  k+1,n\right]  \right)
\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since the elements of }S\text{ other than }k\\
\text{are precisely the elements of }S\setminus\left\{  k\right\}
\end{array}
\right) \\
&  \Longleftrightarrow\ \left(  k\in S\text{ and }S\setminus\left\{
k\right\}  \subseteq\left[  k+1,n\right]  \right)
\end{align*}
(since the statement \textquotedblleft all elements of $S\setminus\left\{
k\right\}  $ belong to $\left[  k+1,n\right]  $\textquotedblright\ means the
same as \textquotedblleft$S\setminus\left\{  k\right\}  \subseteq\left[
k+1,n\right]  $\textquotedblright). Thus, the self-starting $k$-element
subsets of $\left[  n\right]  $ are precisely the $k$-element subsets of
$\left[  n\right]  $ that contain $k$ and satisfy $S\setminus\left\{
k\right\}  \subseteq\left[  k+1,n\right]  $. Hence, the maps
\begin{align*}
\left\{  \text{self-starting }k\text{-element subsets of }\left[  n\right]
\right\}   &  \rightarrow\left\{  \left(  k-1\right)  \text{-element subsets
of }\left[  k+1,n\right]  \right\}  ,\\
S  &  \mapsto S\setminus\left\{  k\right\}
\end{align*}
and
\begin{align*}
\left\{  \left(  k-1\right)  \text{-element subsets of }\left[  k+1,n\right]
\right\}   &  \rightarrow\left\{  \text{self-starting }k\text{-element subsets
of }\left[  n\right]  \right\}  ,\\
T  &  \mapsto T\cup\left\{  k\right\}
\end{align*}
are well-defined\footnote{As in the solution to Exercise
\ref{exe.count.subsets.self-count}, all these claims need to be thoroughly
checked, but this can be quickly done in your head.} and mutually inverse, and
thus are bijections. Hence, the bijection principle yields
\begin{align}
&  \left\vert \left\{  \text{self-starting }k\text{-element subsets of
}\left[  n\right]  \right\}  \right\vert \nonumber\\
&  =\left\vert \left\{  \left(  k-1\right)  \text{-element subsets of }\left[
k+1,n\right]  \right\}  \right\vert \nonumber\\
&  =\left(  \text{\# of }\left(  k-1\right)  \text{-element subsets of
}\left[  k+1,n\right]  \right)  . \label{sol.count.subsets.self-start.4}%
\end{align}
But $\left[  k+1,n\right]  =\left\{  k+1,k+2,\ldots,n\right\}  $ is an
$\left(  n-k\right)  $-element set (since $k\in\left[  n\right]  $ yields
$k\leq n$). Therefore, $n-k\in\mathbb{N}$, and furthermore, Theorem
\ref{thm.binom.comb} (applied to $n-k$, $k-1$ and $\left[  k+1,n\right]  $
instead of $n$, $k$ and $S$) shows that%
\[
\dbinom{n-k}{k-1}=\left(  \text{\# of }\left(  k-1\right)  \text{-element
subsets of }\left[  k+1,n\right]  \right)  .
\]
Comparing this with (\ref{sol.count.subsets.self-start.4}), we obtain%
\[
\left\vert \left\{  \text{self-starting }k\text{-element subsets of }\left[
n\right]  \right\}  \right\vert =\dbinom{n-k}{k-1}.
\]
In other words,%
\begin{equation}
\left(  \text{\# of self-starting }k\text{-element subsets of }\left[
n\right]  \right)  =\dbinom{n-k}{k-1}.
\label{sol.count.subsets.self-start.a.done}%
\end{equation}
This solves Exercise \ref{exe.count.subsets.self-start} \textbf{(a)}.

\textbf{(b)} Let $S$ be a self-starting subset of $\left[  n\right]  $. Then,
$\left\vert S\right\vert $ is the smallest element of $S$ (since $S$ is
self-starting), and thus the set $S$ has at least one element (namely,
$\left\vert S\right\vert $). Thus, $\left\vert S\right\vert \geq1$. But
Theorem \ref{thm.subset-leq} \textbf{(b)} (applied to $A=\left[  n\right]  $
and $B=S$) yields $\left\vert S\right\vert \leq\left\vert \left[  n\right]
\right\vert =n$. Hence, $\left\vert S\right\vert \in\left[  n\right]  $ (since
$\left\vert S\right\vert $ is an integer satisfying $\left\vert S\right\vert
\geq1$ and $\left\vert S\right\vert \leq n$).

Now, forget that we fixed $S$. We thus have shown that each self-starting
subset $S$ of $\left[  n\right]  $ satisfies $\left\vert S\right\vert
\in\left[  n\right]  $. Hence, by the sum rule, we have%
\begin{align}
&  \left(  \text{\# of self-starting subsets of }\left[  n\right]  \right)
\nonumber\\
&  =\sum_{k\in\left[  n\right]  }\underbrace{\left(  \text{\# of self-starting
subsets }S\text{ of }\left[  n\right]  \text{ such that }\left\vert
S\right\vert =k\right)  }_{\substack{=\left(  \text{\# of self-starting
}k\text{-element subsets of }\left[  n\right]  \right)  \\=\dbinom{n-k}%
{k-1}\\\text{(by (\ref{sol.count.subsets.self-start.a.done}))}}}\nonumber\\
&  =\sum_{k\in\left[  n\right]  }\underbrace{\dbinom{n-k}{k-1}}%
_{\substack{=\dbinom{\left(  n-1\right)  -\left(  k-1\right)  }{k-1}%
\\\text{(since }n-k=\left(  n-1\right)  -\left(  k-1\right)  \text{)}}%
}=\sum_{k\in\left[  n\right]  }\dbinom{\left(  n-1\right)  -\left(
k-1\right)  }{k-1}=\sum_{k=1}^{n}\dbinom{\left(  n-1\right)  -\left(
k-1\right)  }{k-1}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{since the summation
sign }\sum_{k\in\left[  n\right]  }\text{ means the same as }\sum_{k=1}%
^{n}\right)  \nonumber\\
&  =\sum_{k=0}^{n-1}\dbinom{\left(  n-1\right)  -k}{k}%
\label{sol.count.subsets.self-start.b.1}%
\end{align}
(here, we have substituted $k$ for $k-1$ in the sum).

We now assume (for the time being) that $n\neq0$. Hence, $n$ is a positive
integer. Thus, $n-1\in\mathbb{N}$. Therefore, the first equality sign of
Proposition \ref{prop.binom.fib} (applied to $n-1$ instead of $n$) yields
\[
f_{\left(  n-1\right)  +1}=\sum_{k=0}^{n-1}\dbinom{\left(  n-1\right)  -k}{k}.
\]
Comparing this with (\ref{sol.count.subsets.self-start.b.1}), we obtain%
\[
\left(  \text{\# of self-starting subsets of }\left[  n\right]  \right)
=f_{\left(  n-1\right)  +1}=f_{n}.
\]
We have proved this formula in the case when $n\neq0$. But it is easy to check
directly that it holds for $n=0$ as well (because there are no self-starting
subsets of $\left[  0\right]  $, but the Fibonacci number $f_{0}$ is also
$0$). Thus, this formula holds for all $n\in\mathbb{N}$. So our answer is%
\begin{equation}
\left(  \text{\# of self-starting subsets of }\left[  n\right]  \right)
=f_{n}.\label{sol.count.subsets.self-start.b.done}%
\end{equation}
This solves Exercise \ref{exe.count.subsets.self-start} \textbf{(b)}. \medskip
\end{proof}

The answers we obtained for this exercise might make you wonder whether there
is a direct connection between self-starting subsets and lacunar subsets --
after all, their numbers are both given by Fibonacci numbers! More precisely,
a comparison of (\ref{sol.count.subsets.self-start.b.done}) with Proposition
\ref{prop.1.35} may suggest that there might be a bijection%
\[
\left\{  \text{self-starting subsets of }\left[  n\right]  \right\}
\rightarrow\left\{  \text{lacunar subsets of }\left[  n-2\right]  \right\}
\]
whenever $n$ is positive (since both of these sets have size $f_{n}$);
furthermore, a comparison of (\ref{sol.count.subsets.self-start.a.done}) with
Proposition \ref{prop.1.36} may suggest that there might be a bijection%
\[
\left\{  k\text{-element self-starting subsets of }\left[  n\right]  \right\}
\rightarrow\left\{  \left(  k-1\right)  \text{-element lacunar subsets of
}\left[  n-2\right]  \right\}
\]
for each $k\in\left[  n\right]  $. And indeed, such bijections exist, and both
of them are given by the same formula:%
\[
\left\{  k<i_{1}<i_{2}<\cdots<i_{k-1}\right\}  \mapsto\underbrace{\left\{
i_{1}-k<i_{2}-\left(  k-1\right)  <i_{3}-\left(  k-2\right)  <\cdots
<i_{k-1}-2\right\}  }_{=\left\{  i_{j}-\left(  k-j+1\right)  \ \mid
\ j\in\left[  k-1\right]  \right\}  }.
\]
(We leave it to the reader to verify that this defines a valid bijection.)
\end{fineprint}

\vspace{0.5019pc}

We can mutate Exercise \ref{exe.count.subsets.self-start} into yet another
similar-looking counting problem by replacing \textquotedblleft smallest
element\textquotedblright\ by \textquotedblleft largest
element\textquotedblright:

\begin{exercise}
\label{exe.count.subsets.self-end} A set $S$ of integers is said to be
\emph{self-ending} if the size $\left\vert S\right\vert $ is the largest
element of $S$. (For example, the set $\left\{  1,2,3\right\}  $ is
self-ending, since $\left\vert \left\{  1,2,3\right\}  \right\vert =3$ is its
largest element; but $\left\{  1,3,6\right\}  $ and $\left\{  1,2,6\right\}  $
are not self-ending.)

Let $n$ be a positive integer.

\textbf{(a)} For each $k\in\left[  n\right]  $, find the \# of self-ending
$k$-element subsets of $\left[  n\right]  $.

\textbf{(b)} Find the \# of all self-ending subsets of $\left[  n\right]  $.
\end{exercise}

This exercise is essentially \cite[Exercise 6 \textbf{(a)}]{18f-hw1s}. It
looks analogous to Exercise \ref{exe.count.subsets.self-start}, but is its
answer also analogous to the answer of the latter exercise?

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.count.subsets.self-end} (sketched).]%
\textbf{(a)} Let $k\in\left[  n\right]  $. We claim the following:

\begin{statement}
\textit{Claim 1:} The only self-ending $k$-element subset of $\left[
n\right]  $ is $\left[  k\right]  $.
\end{statement}

[\textit{Proof of Claim 1:} The set $\left[  k\right]  =\left\{
1,2,\ldots,k\right\}  $ has size $k$, but its largest element is also $k$.
Thus, $\left[  k\right]  $ is self-ending. Consequently, $\left[  k\right]  $
is a self-ending $k$-element subset of $\left[  n\right]  $. It remains to
show that $\left[  k\right]  $ is the \textbf{only} self-ending $k$-element
subset of $\left[  n\right]  $.

Let $S$ be a self-ending $k$-element subset of $\left[  n\right]  $. Thus,
$\left\vert S\right\vert =k$ (since $S$ is a $k$-element set). But $\left\vert
S\right\vert $ is the largest element of $S$ (since $S$ is self-ending). In
other words, $k$ is the largest element of $S$ (since $\left\vert S\right\vert
=k$). Hence, all elements of $S$ are $\leq k$ and thus belong to the set
$\left[  k\right]  $. In other words, $S$ is a subset of $\left[  k\right]  $.
Therefore, Theorem \ref{thm.subset-leq} \textbf{(c)} (applied to $A=\left[
k\right]  $ and $B=S$) shows that $S=\left[  k\right]  $ (since $\left\vert
S\right\vert =k=\left\vert \left[  k\right]  \right\vert $).

Now, forget that we fixed $S$. We thus have shown that each self-ending
$k$-element subset $S$ of $\left[  n\right]  $ satisfies $S=\left[  k\right]
$. In other words, each self-ending $k$-element subset $S$ of $\left[
n\right]  $ must equal $\left[  k\right]  $. Hence, $\left[  k\right]  $ is
the \textbf{only} self-ending $k$-element subset of $\left[  n\right]  $
(since we already know that $\left[  k\right]  $ is such a subset). This
proves Claim 1.]

Claim 1 obviously yields that%
\begin{equation}
\left(  \text{\# of self-ending }k\text{-element subsets of }\left[  n\right]
\right)  =1. \label{sol.count.subsets.self-end.a.done}%
\end{equation}
This solves Exercise \ref{exe.count.subsets.self-end} \textbf{(a)}.

\textbf{(b)} It is easy to see that each self-ending subset $S$ of $\left[
n\right]  $ satisfies $\left\vert S\right\vert \in\left[  n\right]
$\ \ \ \ \footnote{Indeed, you can prove this in the same way as we showed the
analogous claim about self-starting subsets in our solution to Exercise
\ref{exe.count.subsets.self-start} \textbf{(b)}.}. Hence, by the sum rule, we
have%
\begin{align}
&  \left(  \text{\# of self-ending subsets of }\left[  n\right]  \right)
\nonumber\\
&  =\sum_{k\in\left[  n\right]  }\underbrace{\left(  \text{\# of self-ending
subsets }S\text{ of }\left[  n\right]  \text{ such that }\left\vert
S\right\vert =k\right)  }_{\substack{=\left(  \text{\# of self-ending
}k\text{-element subsets of }\left[  n\right]  \right)  \\=1\\\text{(by
(\ref{sol.count.subsets.self-end.a.done}))}}}\nonumber\\
&  =\sum_{k\in\left[  n\right]  }1=\left\vert \left[  n\right]  \right\vert
\cdot1=\left\vert \left[  n\right]  \right\vert =n.\nonumber
\end{align}
This solves Exercise \ref{exe.count.subsets.self-end} \textbf{(b)}.
\end{proof}
\end{fineprint}

The moral of this story is: similar-looking counting problems don't always
have similar answers. Counting problems can vary wildly in difficulty and
method of solution. Eventually, we will see some where no good formula for the
answer is known!

\bigskip

\begin{fineprint}
Have you been experimenting in SageMath along with the above? In that case,
you have probably defined functions to check whether a set of integers is
self-counting, resp. self-starting, resp. self-ending. Here is one way to do so:

\begin{python}
def is_self_counting(S):
	# Check whether a set `S` of integers is self-counting.
	return S.cardinality() in S
	# Note: "S.cardinality()" is the size of `S`.
	
def is_self_starting(S):
	# Check whether a set `S` of integers is self-starting.
	c = S.cardinality()
	return c in S and all(c <= i for i in S)
	# This is checking that the size `c` of `S` is in `S`
	# and is smaller or equal to all elements of `S`.
	
def is_self_ending(S):
	# Check whether a set `S` of integers is self-ending.
	c = S.cardinality()
	return c in S and all(c >= i for i in S)
\end{python}


\noindent With these functions, you can ask SageMath to compute (for example)
the \# of self-starting $3$-element subsets of $\left[  8\right]  $ as
follows: \begin{python}
sum(1 for S in Subsets(8, 3) if is_self_starting(S))
\end{python}


\noindent(Note that \pyth{Subsets(8, 3)} is a shorthand for
\texttt{Subsets(\{1, 2, 3, 4, 5, 6, 7, 8\}, 3)} that SageMath understands.)
\end{fineprint}

\begin{exercise}
\label{exe.subset-OE}A set $S$ of integers is said to be \emph{O<E<O<E<...}
(this is an adjective) if it can be written in the form $S=\left\{
s_{1},s_{2},\ldots,s_{k}\right\}  $ where

\begin{itemize}
\item $s_{1}<s_{2}<\cdots<s_{k}$;

\item the integer $s_{i}$ is even whenever $i$ is even;

\item the integer $s_{i}$ is odd whenever $i$ is odd.
\end{itemize}

(For example, $\left\{  1,4,5,8,11\right\}  $ is an O%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
$<$%
%EndExpansion
E%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
$<$%
%EndExpansion
O%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
$<$%
%EndExpansion
E%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
$<$%
%EndExpansion
... set, while $\left\{  2,3\right\}  $ and $\left\{  1,4,6\right\}  $ are
not. Note that $k$ is allowed to be $0$, whence $\varnothing$ is an O%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
$<$%
%EndExpansion
E%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
$<$%
%EndExpansion
O%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
$<$%
%EndExpansion
E%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
$<$%
%EndExpansion
... set.)

For each $n \in\mathbb{N}$, we let $a\left(  n\right)  $ denote the number of
all O<E<O<E<... subsets of $\left[  n\right]  $, and let $b \left(  n\right)
$ denote the number of all O<E<O<E<... subsets of $\left[  n\right]  $ that
contain $n$.

\textbf{(a)} Show that $a \left(  n\right)  = a\left(  n-1\right)  + b\left(
n\right)  $ for each $n > 0$.

\textbf{(b)} Show that $a\left(  n\right)  =1+\sum_{k=0}^{n}b\left(  k\right)
$ for each $n\in\mathbb{N}$.

\textbf{(c)} Show that $b\left(  n\right)  =\sum_{\substack{k\in\left\{
0,1,\ldots,n-1\right\}  ;\\k\equiv n-1\operatorname{mod}2}}b\left(  k\right)
+\left[  n\text{ is odd}\right]  $ for each $n\in\mathbb{N}$. (Here, we are
using the Iverson bracket notation, defined in Definition \ref{def.iverson}.)

\textbf{(d)} Show that $b\left(  n\right)  +b\left(  n-1\right)  =1+\sum
_{k=0}^{n-1}b\left(  k\right)  $ for each $n>0$.

\textbf{(e)} Show that $b\left(  n\right)  =1+\sum_{k=0}^{n-2}b\left(
k\right)  $ for each $n>0$.

\textbf{(f)} Show that $b\left(  n\right)  = a\left(  n-2\right)  $ for each
$n \geq2$.

\textbf{(g)} Show that $a\left(  n\right)  =f_{n+2}$ for each $n\in\mathbb{N}$.
\end{exercise}

\begin{exercise}
\label{exe.subset-lacunar-OE} For each $n\in\mathbb{N}$, we let $c\left(
n\right)  $ denote the number of all subsets of $\left[  n\right]  $ that are
simultaneously lacunar and O%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
$<$%
%EndExpansion
E%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
$<$%
%EndExpansion
O%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
$<$%
%EndExpansion
E%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
$<$%
%EndExpansion
....

Prove that $c\left(  n\right)  =c\left(  n-2\right)  +c\left(  n-3\right)  $
for all $n\geq3$.
\end{exercise}

\begin{remark}
The sequence $\left(  c\left(  0\right)  ,c\left(  1\right)  ,c\left(
2\right)  ,c\left(  3\right)  ,\ldots\right)  $ from
Exercise~\ref{exe.subset-lacunar-OE} is \href{https://oeis.org/A000931}{the
\emph{Padovan sequence}} (starting with $1,2,2,3,4,5,7,9,12,16,21,28,37,49$).
\end{remark}

\begin{exercise}
\label{exe.2lac}A set $S$ of integers is said to be $2$\emph{-lacunar} if
every $i\in S$ satisfies $i+1\notin S$ and $i+2\notin S$. (That is, any two
distinct elements of $S$ are at least a distance of $3$ apart on the real
axis.) For example, $\left\{  1,5,8\right\}  $ is $2$-lacunar, but $\left\{
1,5,7\right\}  $ and $\left\{  1,5,6\right\}  $ are not.

For any $n\in\mathbb{N}$, we let $h\left(  n\right)  $ denote the number of
all $2$-lacunar subsets of $\left[  n\right]  $.

\textbf{(a)} Prove that $h\left(  n\right)  =h\left(  n-1\right)  +h\left(
n-3\right)  $ for each $n\geq3$.

\textbf{(b)} Prove that $h\left(  n\right)  =\sum_{\substack{k\in
\mathbb{N};\\2k\leq n+2}}\dbinom{n+2-2k}{k}$ for each $n\in\mathbb{N}$.
\end{exercise}

\subsubsection{Counting subsets containing a given subset}

For a given $k\in\mathbb{N}$, how many $k$-element subsets of a given set $N$
contain a given subset $D$ as a subset? The following proposition gives an
answer to this question:

\begin{proposition}
\label{prop.count.subsets.Dsub}Let $n\in\mathbb{N}$, $d\in\mathbb{N}$ and
$k\in\mathbb{R}$. Let $N$ be an $n$-element set. Let $D$ be a $d$-element
subset of $N$. Then,%
\[
\left(  \text{\# of }k\text{-element subsets }A\text{ of }N\text{ satisfying
}D\subseteq A\right)  =\dbinom{n-d}{k-d}.
\]

\end{proposition}

\begin{example}
Let $N=\left\{  1,2,3,4\right\}  $ and $D=\left\{  1,2\right\}  $. Then, the
subsets $A$ of $N$ satisfying $D\subseteq A$ are $\left\{  1,2\right\}  $,
$\left\{  1,2,3\right\}  $, $\left\{  1,2,4\right\}  $ and $\left\{
1,2,3,4\right\}  $. Thus, $1$ of them has $2$ elements; $2$ have $3$ elements;
and $1$ has $4$ elements. This agrees with Proposition
\ref{prop.count.subsets.Dsub} (for $n=4$ and $d=2$).
\end{example}

\begin{proof}
[Proof of Proposition \ref{prop.count.subsets.Dsub} (informal version).]As
usual, let me first show the informal idea, and then its formalization.

Informally, how can we construct a $k$-element subset $A$ of $N$ satisfying
$D\subseteq A$ ? We need to choose $k$ elements of $N$ to go into $A$; but we
cannot choose them freely, because we must ensure that $D\subseteq A$. Thus,
the $d$ elements of $D$ must necessarily go into $A$; the only freedom that we
have is to decide which of the remaining $n-d$ elements of $N$ will go into
$A$. More precisely, we need to choose $k-d$ many of these $n-d$ elements,
because the total size of $A$ has to be $k$ (and $d$ of its elements have
already been decided). Thus, our decision boils down to choosing a $\left(
k-d\right)  $-element subset of the $\left(  n-d\right)  $-element set
$N\setminus D$. According to Theorem \ref{thm.binom.comb} (applied to $n-d$,
$k-d$ and $N\setminus D$ instead of $n$, $k$ and $S$), there are $\dbinom
{n-d}{k-d}$ many such subsets. Thus, the total \# of $k$-element subsets $A$
of $N$ satisfying $D\subseteq A$ is $\dbinom{n-d}{k-d}$.
\end{proof}

\begin{fineprint}
To formalize this argument, we have to replace our \textquotedblleft boils
down\textquotedblright\ handwaving with a bijection. Here is how the result
looks like:

\begin{proof}
[Proof of Proposition \ref{prop.count.subsets.Dsub} (formal version).]We have
$\left\vert D\right\vert =d$ (since $D$ is a $d$-element set) and $\left\vert
N\right\vert =n$ (since $N$ is an $n$-element set). Also, $D$ is a subset of
$N$. Thus, Theorem \ref{thm.subset-leq} \textbf{(a)} (applied to $A=N$ and
$B=D$) yields $\left\vert N\setminus D\right\vert =\underbrace{\left\vert
N\right\vert }_{=n}-\underbrace{\left\vert D\right\vert }_{=d}=n-d$. Hence,
$N\setminus D$ is an $\left(  n-d\right)  $-element set. Thus, Theorem
\ref{thm.binom.comb} (applied to $n-d$, $k-d$ and $N\setminus D$ instead of
$n$, $k$ and $S$) yields%
\begin{equation}
\dbinom{n-d}{k-d}=\left(  \text{\# of }\left(  k-d\right)  \text{-element
subsets of }N\setminus D\right)  . \label{pf.prop.count.subsets.Dsub.1}%
\end{equation}


If $A$ is a $k$-element subset of $N$ satisfying $D\subseteq A$, then
$A\setminus D$ is a $\left(  k-d\right)  $-element subset of $N\setminus
D$\ \ \ \ \footnote{\textit{Proof.} Let $A$ be a $k$-element subset of $N$
satisfying $D\subseteq A$. Then, $\left\vert A\right\vert =k$ (since $A$ is a
$k$-element set). But $D$ is a subset of $A$ (since $D\subseteq A$). Hence,
Theorem \ref{thm.subset-leq} \textbf{(a)} (applied to $B=D$) yields
$\left\vert A\setminus D\right\vert =\underbrace{\left\vert A\right\vert
}_{=k}-\underbrace{\left\vert D\right\vert }_{=d}=k-d$. In other words,
$A\setminus D$ is a $\left(  k-d\right)  $-element set. Hence, $A\setminus D$
is a $\left(  k-d\right)  $-element subset of $N\setminus D$ (because
$\underbrace{A}_{\subseteq N}\setminus D\subseteq N\setminus D$).}. Hence, the
map%
\begin{align*}
\left\{  k\text{-element subsets }A\text{ of }N\text{ satisfying }D\subseteq
A\right\}   &  \rightarrow\left\{  \left(  k-d\right)  \text{-element subsets
of }N\setminus D\right\}  ,\\
A  &  \mapsto A\setminus D
\end{align*}
is well-defined.

On the other hand, if $B$ is a $\left(  k-d\right)  $-element subset of
$N\setminus D$, then $B\cup D$ is a $k$-element subset $A$ of $N$ that
satisfies $D\subseteq A$\ \ \ \ \footnote{\textit{Proof.} Let $B$ be a
$\left(  k-d\right)  $-element subset of $N\setminus D$. Thus, $B\subseteq
N\setminus D$ and $\left\vert B\right\vert =k-d$ (since $B$ is a $\left(
k-d\right)  $-element set). From $B\subseteq N\setminus D$, we conclude that
the sets $B$ and $D$ are disjoint. Thus, (\ref{eq.thm.1.2.variant1-k=2})
(applied to $X=B$ and $Y=D$) yields $\left\vert B\cup D\right\vert
=\underbrace{\left\vert B\right\vert }_{=k-d}+\underbrace{\left\vert
D\right\vert }_{=d}=\left(  k-d\right)  +d=k$. Hence, $B\cup D$ is a
$k$-element set. Moreover, combining $B\subseteq N\setminus D\subseteq N$ with
$D\subseteq N$, we obtain $B\cup D\subseteq N$. Hence, $B\cup D$ is a
$k$-element subset of $N$ (since $B\cup D$ is a $k$-element set). Thus, $B\cup
D$ is a $k$-element subset $A$ of $N$ that satisfies $D\subseteq A$ (since
$D\subseteq B\cup D$).}. Hence, the map%
\begin{align*}
\left\{  \left(  k-d\right)  \text{-element subsets of }N\setminus D\right\}
&  \rightarrow\left\{  k\text{-element subsets }A\text{ of }N\text{ satisfying
}D\subseteq A\right\}  ,\\
B  &  \mapsto B\cup D
\end{align*}
is well-defined.

It is easy to see that these two maps are mutually inverse\footnote{Indeed,
this relies on the following two observations:
\par
\begin{itemize}
\item If $A$ is any $k$-element subset of $N$ satisfying $D\subseteq A$, then
$\left(  A\setminus D\right)  \cup D=A$. (This follows from $D\subseteq A$.)
\par
\item If $B$ is any $\left(  k-d\right)  $-element subset of $N\setminus D$,
then $\left(  B\cup D\right)  \setminus D=B$. (This follows from $B\subseteq
N\setminus D$.)
\end{itemize}
}. Thus, they are bijections. Hence, the bijection principle yields%
\begin{align*}
&  \left(  \text{\# of }k\text{-element subsets }A\text{ of }N\text{
satisfying }D\subseteq A\right) \\
&  =\left(  \text{\# of }\left(  k-d\right)  \text{-element subsets of
}N\setminus D\right)  =\dbinom{n-d}{k-d}%
\end{align*}
(by (\ref{pf.prop.count.subsets.Dsub.1})). This proves Proposition
\ref{prop.count.subsets.Dsub}.
\end{proof}
\end{fineprint}

\subsection{\label{sect.intro.tups}Counting tuples and maps}

\subsubsection{\label{subsect.intro.tups.tups}Tuples}

Before we continue with counting problems, let us recall the notion of the
Cartesian product of several sets:

\begin{definition}
\label{def.sets.cartprod}Let $A_{1},A_{2},\ldots,A_{n}$ be any $n$ sets. Then,
the \emph{Cartesian product} $A_{1}\times A_{2}\times\cdots\times A_{n}$ of
these $n$ sets is defined to be the set of all $n$-tuples $\left(  a_{1}%
,a_{2},\ldots,a_{n}\right)  $ for which $a_{i}\in A_{i}$ for all $i\in\left[
n\right]  $. In other words,%
\begin{align*}
&  A_{1}\times A_{2}\times\cdots\times A_{n}\\
&  =\left\{  \left(  a_{1},a_{2},\ldots,a_{n}\right)  \ \mid\ a_{i}\in
A_{i}\text{ for all }i\in\left[  n\right]  \right\} \\
&  =\left\{  \left(  a_{1},a_{2},\ldots,a_{n}\right)  \ \mid\ a_{1}\in
A_{1}\text{ and }a_{2}\in A_{2}\text{ and }\cdots\text{ and }a_{n}\in
A_{n}\right\}  .
\end{align*}

\end{definition}

Applying Definition \ref{def.sets.cartprod} to $n=2$, we obtain the Cartesian
product $A_{1}\times A_{2}$ of two sets $A_{1}$ and $A_{2}$; it consists of
pairs of an element of $A_{1}$ and an element of $A_{2}$. For instance, the
Cartesian product $\left\{  1,2\right\}  \times\left\{  5,6,7\right\}  $
consists of the six pairs $\left(  1,5\right)  $, $\left(  1,6\right)  $,
$\left(  1,7\right)  $, $\left(  2,5\right)  $, $\left(  2,6\right)  $ and
$\left(  2,7\right)  $.

Applying Definition \ref{def.sets.cartprod} to $n=1$, we obtain the Cartesian
product $A_{1}$ of a single set $A_{1}$; this is the set of all $1$-tuples
$\left(  a_{1}\right)  $ of a single element $a_{1}\in A_{1}$. The notation
hides a minor discrepancy: Strictly speaking, a $1$-tuple $\left(
a_{1}\right)  $ is not the same as its underlying element $a_{1}$, and thus
the Cartesian product of the single set $A_{1}$ is not the same as the set
$A_{1}$ itself, despite looking precisely the same in our notation.
Fortunately, the sets are \textquotedblleft as good as equal\textquotedblright%
: The map%
\begin{align*}
\left(  \text{the original set }A_{1}\right)   &  \rightarrow\left(  \text{the
Cartesian product of the single set }A_{1}\right)  ,\\
a_{1}  &  \mapsto\left(  a_{1}\right)
\end{align*}
(sending each element $a_{1}$ of $A_{1}$ to the $1$-tuple $\left(
a_{1}\right)  $) is a bijection. Thus, the two sets denoted $A_{1}$ have the
same size, at least, and it is rare that anything bad comes out of equating them.

Applying Definition \ref{def.sets.cartprod} to $n=0$, we obtain the Cartesian
product of $0$ sets; this is called the \emph{empty Cartesian product}, and
consists of all $0$-tuples. There is only one $0$-tuple, namely the empty list
$\left(  {}\right)  $; thus, this Cartesian product is the $1$-element set
$\left\{  \left(  {}\right)  \right\}  $.

The Cartesian product of sets is not quite associative! For example, if $A$,
$B$ and $C$ are three sets, then the three Cartesian products $A\times B\times
C$, $\left(  A\times B\right)  \times C$ and $A\times\left(  B\times C\right)
$ are not literally the same. The first of them consists of
triples\footnote{Recall that the word \textquotedblleft\emph{triple}%
\textquotedblright\ means a $3$-tuple. Tuples are always ordered by
definition.} $\left(  a,b,c\right)  $; the second consists of nested pairs
$\left(  \left(  a,b\right)  ,c\right)  $; the third consists of nested pairs
$\left(  a,\left(  b,c\right)  \right)  $. These are different things, and
should not be equated\footnote{For example, the first entry of the triple
$\left(  a,b,c\right)  $ is $a$, while the first entry of the pair $\left(
\left(  a,b\right)  ,c\right)  $ is the pair $\left(  a,b\right)  $.}. Again,
however, there are bijections between these products: The maps%
\begin{align*}
A\times B\times C  &  \rightarrow\left(  A\times B\right)  \times C,\\
\left(  a,b,c\right)   &  \mapsto\left(  \left(  a,b\right)  ,c\right)
\end{align*}
and%
\begin{align*}
A\times B\times C  &  \rightarrow A\times\left(  B\times C\right)  ,\\
\left(  a,b,c\right)   &  \mapsto\left(  a,\left(  b,c\right)  \right)
\end{align*}
are bijections. More generally:

\begin{proposition}
\label{prop.sets.cartprod.assbij}Let $A_{1},A_{2},\ldots,A_{n}$ be any $n$ sets.

\textbf{(a)} If $n>0$, then the map%
\begin{align*}
A_{1}\times A_{2}\times\cdots\times A_{n}  &  \rightarrow\left(  A_{1}\times
A_{2}\times\cdots\times A_{n-1}\right)  \times A_{n},\\
\left(  a_{1},a_{2},\ldots,a_{n}\right)   &  \mapsto\left(  \left(
a_{1},a_{2},\ldots,a_{n-1}\right)  ,a_{n}\right)
\end{align*}
is a bijection.

\textbf{(b)} If $k\in\left\{  0,1,\ldots,n\right\}  $ is arbitrary, then the
map
\begin{align*}
A_{1}\times A_{2}\times\cdots\times A_{n}  &  \rightarrow\left(  A_{1}\times
A_{2}\times\cdots\times A_{k}\right)  \times\left(  A_{k+1}\times
A_{k+2}\times\cdots\times A_{n}\right)  ,\\
\left(  a_{1},a_{2},\ldots,a_{n}\right)   &  \mapsto\left(  \left(
a_{1},a_{2},\ldots,a_{k}\right)  ,\left(  a_{k+1},a_{k+2},\ldots,a_{n}\right)
\right)
\end{align*}
is a bijection.
\end{proposition}

I consider Proposition \ref{prop.sets.cartprod.assbij} obvious (or, more
precisely, to be part of an introductory course in axiomatic set theory that I
am not giving here). From an algorithmic viewpoint, the bijection in
Proposition \ref{prop.sets.cartprod.assbij} \textbf{(b)} splits a list into
two sublists (the one formed by its first $k$ entries, and the one formed by
its remaining entries).

Using Proposition \ref{prop.sets.cartprod.assbij}, we can generalize our
product rule for two sets (Theorem \ref{thm.prodrule2}) to $n$ sets:

\begin{theorem}
[The product rule for $n$ sets]\label{thm.prodrulen}Let $A_{1},A_{2}%
,\ldots,A_{n}$ be any $n$ finite sets. Then, $A_{1}\times A_{2}\times
\cdots\times A_{n}$ is a finite set with size%
\[
\left\vert A_{1}\times A_{2}\times\cdots\times A_{n}\right\vert =\left\vert
A_{1}\right\vert \cdot\left\vert A_{2}\right\vert \cdot\cdots\cdot\left\vert
A_{n}\right\vert .
\]

\end{theorem}

The intuition behind Theorem \ref{thm.prodrulen} is the following: In order to
choose an $n$-tuple $\left(  a_{1},a_{2},\ldots,a_{n}\right)  \in A_{1}\times
A_{2}\times\cdots\times A_{n}$, it suffices to choose an element $a_{1}$ of
$A_{1}$, an element $a_{2}$ of $A_{2}$, and so on (a total of $n$ choices).
These $n$ choices are mutually independent (e.g., the value of $a_{1}$ we
choose does not constrain us in our choice of $a_{2}$), and thus the total
number of options should be the product of the total numbers of options for
each of the $n$ choices (which numbers are $\left\vert A_{1}\right\vert
,\left\vert A_{2}\right\vert ,\ldots,\left\vert A_{n}\right\vert $). In this
form, Theorem \ref{thm.prodrulen} is usually considered obvious and called the
\textquotedblleft rule of product\textquotedblright\ or \textquotedblleft
multiplication principle\textquotedblright. We nevertheless give a rigorous
proof in order to get some feeling for Cartesian products:

\begin{fineprint}
\begin{proof}
[Proof of Theorem \ref{thm.prodrulen}.]We will prove Theorem
\ref{thm.prodrulen} by induction on $n$:

\textit{Induction base:} We have%
\[
A_{1}\times A_{2}\times\cdots\times A_{0}=\left(  \text{empty Cartesian
product}\right)  =\left\{  \left(  {}\right)  \right\}
\]
(this is a one-element set) and therefore
\[
\left\vert A_{1}\times A_{2}\times\cdots\times A_{0}\right\vert =\left\vert
\left\{  \left(  {}\right)  \right\}  \right\vert =1.
\]
Comparing this with%
\[
\left\vert A_{1}\right\vert \cdot\left\vert A_{2}\right\vert \cdot\cdots
\cdot\left\vert A_{0}\right\vert =\left(  \text{empty product}\right)  =1,
\]
we obtain $\left\vert A_{1}\times A_{2}\times\cdots\times A_{0}\right\vert
=\left\vert A_{1}\right\vert \cdot\left\vert A_{2}\right\vert \cdot\cdots
\cdot\left\vert A_{0}\right\vert $. In other words, Theorem
\ref{thm.prodrulen} is true for $n=0$. This completes the induction base.

\textit{Induction step:} Let $m\in\mathbb{N}$. Assume that Theorem
\ref{thm.prodrulen} holds for $n=m$. We must prove that Theorem
\ref{thm.prodrulen} holds for $n=m+1$.

Let $A_{1},A_{2},\ldots,A_{m+1}$ be any $m+1$ finite sets. Recall that we
assumed that Theorem \ref{thm.prodrulen} holds for $n=m$. Hence,%
\[
\left\vert A_{1}\times A_{2}\times\cdots\times A_{m}\right\vert =\left\vert
A_{1}\right\vert \cdot\left\vert A_{2}\right\vert \cdot\cdots\cdot\left\vert
A_{m}\right\vert .
\]
But Proposition \ref{prop.sets.cartprod.assbij} \textbf{(a)} (applied to
$n=m+1$) yields that the map%
\begin{align*}
A_{1}\times A_{2}\times\cdots\times A_{m+1}  &  \rightarrow\left(  A_{1}\times
A_{2}\times\cdots\times A_{\left(  m+1\right)  -1}\right)  \times A_{m+1},\\
\left(  a_{1},a_{2},\ldots,a_{m+1}\right)   &  \mapsto\left(  \left(
a_{1},a_{2},\ldots,a_{\left(  m+1\right)  -1}\right)  ,a_{m+1}\right)
\end{align*}
is a bijection. Hence, the bijection principle shows that%
\begin{align*}
&  \left\vert A_{1}\times A_{2}\times\cdots\times A_{m+1}\right\vert \\
&  =\left\vert \left(  A_{1}\times A_{2}\times\cdots\times A_{\left(
m+1\right)  -1}\right)  \times A_{m+1}\right\vert \\
&  =\underbrace{\left\vert A_{1}\times A_{2}\times\cdots\times A_{\left(
m+1\right)  -1}\right\vert }_{\substack{=\left\vert A_{1}\times A_{2}%
\times\cdots\times A_{m}\right\vert \\=\left\vert A_{1}\right\vert
\cdot\left\vert A_{2}\right\vert \cdot\cdots\cdot\left\vert A_{m}\right\vert
}}\cdot\left\vert A_{m+1}\right\vert \\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{eq.thm.prodrule2.size}), applied to }X=A_{1}\times A_{2}\times
\cdots\times A_{\left(  m+1\right)  -1}\text{ and }Y=A_{m+1}\right) \\
&  =\left(  \left\vert A_{1}\right\vert \cdot\left\vert A_{2}\right\vert
\cdot\cdots\cdot\left\vert A_{m}\right\vert \right)  \cdot\left\vert
A_{m+1}\right\vert \\
&  =\left\vert A_{1}\right\vert \cdot\left\vert A_{2}\right\vert \cdot
\cdots\cdot\left\vert A_{m+1}\right\vert .
\end{align*}
In particular, this shows that the set $A_{1}\times A_{2}\times\cdots\times
A_{m+1}$ is finite.

Forget that we fixed $A_{1},A_{2},\ldots,A_{m+1}$. We thus have proven that if
$A_{1},A_{2},\ldots,A_{m+1}$ are any $m+1$ finite sets, then $A_{1}\times
A_{2}\times\cdots\times A_{m+1}$ is a finite set with size%
\[
\left\vert A_{1}\times A_{2}\times\cdots\times A_{m+1}\right\vert =\left\vert
A_{1}\right\vert \cdot\left\vert A_{2}\right\vert \cdot\cdots\cdot\left\vert
A_{m+1}\right\vert .
\]
In other words, Theorem \ref{thm.prodrulen} holds for $n=m+1$. This completes
the induction step, and with it the proof of Theorem \ref{thm.prodrulen}.
\end{proof}
\end{fineprint}

A particular case of a Cartesian product is obtained when all the
\textquotedblleft factors\textquotedblright\ are equal:

\begin{definition}
\label{def.sets.cartpow}Let $A$ be a set, and let $n\in\mathbb{N}$. Then, the
$n$-th\emph{ (Cartesian) power }$A^{n}$ of $A$ is defined to be the Cartesian
product $\underbrace{A\times A\times\cdots\times A}_{n\text{ times}}$.
\end{definition}

This Cartesian power $A^{n}$ is often denoted by $A^{\times n}$ as well.

For example, if $A$ is any set, then $A^{0}=\left\{  \left(  {}\right)
\right\}  $, whereas $A^{1}$ is \textquotedblleft more or less the same
as\textquotedblright\ $A$ (as explained before, not exactly the same, but
there is an obvious bijection).

\begin{corollary}
\label{cor.powruleAn}Let $A$ be a finite set. Let $n\in\mathbb{N}$. Then,
$A^{n}$ is a finite set with size $\left\vert A^{n}\right\vert =\left\vert
A\right\vert ^{n}$.
\end{corollary}

\begin{fineprint}
\begin{proof}
[Proof of Corollary \ref{cor.powruleAn}.]Definition \ref{def.sets.cartpow}
yields $A^{n}=\underbrace{A\times A\times\cdots\times A}_{n\text{ times}}$.
But Theorem \ref{thm.prodrulen} (applied to $A_{i}=A$) shows that
$\underbrace{A\times A\times\cdots\times A}_{n\text{ times}}$ is a finite set
with size $\left\vert \underbrace{A\times A\times\cdots\times A}_{n\text{
times}}\right\vert =\underbrace{\left\vert A\right\vert \cdot\left\vert
A\right\vert \cdot\cdots\cdot\left\vert A\right\vert }_{n\text{ times}}$. In
view of $\underbrace{A\times A\times\cdots\times A}_{n\text{ times}}=A^{n}$
and $\underbrace{\left\vert A\right\vert \cdot\left\vert A\right\vert
\cdot\cdots\cdot\left\vert A\right\vert }_{n\text{ times}}=\left\vert
A\right\vert ^{n}$, we can rewrite this as follows: The set $A^{n}$ is a
finite set with size $\left\vert A^{n}\right\vert =\left\vert A\right\vert
^{n}$. This proves Corollary \ref{cor.powruleAn}.
\end{proof}
\end{fineprint}

\subsubsection{\label{subsect.intro.tups.maps}Counting maps}

Let us now use these results to count maps between two sets. First, we
introduce a notation for them:

\begin{definition}
Let $A$ and $B$ be two sets. Then, $B^{A}$ shall mean the set of all maps from
$A$ to $B$.
\end{definition}

This notation $B^{A}$ is somewhat counterintuitive (who in their right mind
would put the target $B$ first?), but it is explained by the following property:

\begin{theorem}
\label{thm.maps.power}Let $A$ and $B$ be two finite sets. Then, the set
$B^{A}$ is finite, and its size is%
\[
\left\vert B^{A}\right\vert =\left\vert B\right\vert ^{\left\vert A\right\vert
}.
\]

\end{theorem}

\begin{example}
Theorem \ref{thm.maps.power} (applied to $A=\left[  2\right]  $ and $B=\left[
3\right]  $) says that the set $\left[  3\right]  ^{\left[  2\right]  }$ is
finite, and that its size is $\left\vert \left[  3\right]  ^{\left[  2\right]
}\right\vert =\left\vert \left[  3\right]  \right\vert ^{\left\vert \left[
2\right]  \right\vert }=3^{2}=9$. In other words, there are exactly $9$ maps
from $\left[  2\right]  $ to $\left[  3\right]  $. Here are these $9$ maps
(written in two-line notation, as explained in Definition \ref{def.map.tln}):%
\begin{align*}
&  \left(
\begin{array}
[c]{cc}%
1 & 2\\
1 & 1
\end{array}
\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{cc}%
1 & 2\\
1 & 2
\end{array}
\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{cc}%
1 & 2\\
1 & 3
\end{array}
\right) \\
&  \left(
\begin{array}
[c]{cc}%
1 & 2\\
2 & 1
\end{array}
\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{cc}%
1 & 2\\
2 & 2
\end{array}
\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{cc}%
1 & 2\\
2 & 3
\end{array}
\right) \\
&  \left(
\begin{array}
[c]{cc}%
1 & 2\\
3 & 1
\end{array}
\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{cc}%
1 & 2\\
3 & 2
\end{array}
\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{cc}%
1 & 2\\
3 & 3
\end{array}
\right)  .
\end{align*}

\end{example}

\begin{proof}
[Proof of Theorem \ref{thm.maps.power}.]Let $\left(  a_{1},a_{2},\ldots
,a_{k}\right)  $ be a list of all elements of $A$ in some order (with no
repetitions). Thus, $a_{1},a_{2},\ldots,a_{k}$ are distinct and satisfy
$A=\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  $. Hence, $\left\vert
A\right\vert =k$.

Recall that $B^{A}$ is the set of all maps from $A$ to $B$. In other words,
$B^{A}$ is the set of all functions from $A$ to $B$. (The nouns
\textquotedblleft map\textquotedblright\ and \textquotedblleft
function\textquotedblright\ are synonyms in mathematics. I usually prefer
\textquotedblleft map\textquotedblright\ for its shortness, but here, I am
using \textquotedblleft function\textquotedblright\ in order to separate the
maps from $A$ to $B$ (which I call \textquotedblleft
functions\textquotedblright) from maps between $B^{A}$ and $B^{k}$ (which I
shall consider soon, and will call \textquotedblleft maps\textquotedblright).)

Consider the map%
\begin{align*}
\Phi:B^{A}  &  \rightarrow B^{k},\\
f  &  \mapsto\left(  f\left(  a_{1}\right)  ,f\left(  a_{2}\right)
,\ldots,f\left(  a_{k}\right)  \right)  .
\end{align*}
This map $\Phi$ sends each function $f:A\rightarrow B$ to its list of values
at the points\footnote{I am just using \textquotedblleft
point\textquotedblright\ as just a suggestive way of saying \textquotedblleft
element of $A$\textquotedblright\ here.} $a_{1},a_{2},\ldots,a_{k}$. This list
of values clearly determines $f$ uniquely (since $A=\left\{  a_{1}%
,a_{2},\ldots,a_{k}\right\}  $, so that each value of $f$ appears somewhere in
the list\footnote{And we know where exactly it appears in the list, because
$a_{1},a_{2},\ldots,a_{k}$ are fixed.}); thus, the map $\Phi$ is injective.
Furthermore, for each $k$-tuple $\left(  b_{1},b_{2},\ldots,b_{k}\right)  \in
B^{k}$, there exists a function $f:A\rightarrow B$ such that $\left(  f\left(
a_{1}\right)  ,f\left(  a_{2}\right)  ,\ldots,f\left(  a_{k}\right)  \right)
=\left(  b_{1},b_{2},\ldots,b_{k}\right)  $ (indeed, this latter function $f$
is given by%
\[
f=\left(
\begin{array}
[c]{cccc}%
a_{1} & a_{2} & \cdots & a_{k}\\
b_{1} & b_{2} & \cdots & b_{k}%
\end{array}
\right)
\]
in two-line notation). Hence, the map $\Phi$ is surjective. Thus, we know that
the map $\Phi$ is both injective and surjective. Therefore, $\Phi$ is
bijective, i.e., is a bijection. Hence, the bijection principle yields
$\left\vert B^{A}\right\vert =\left\vert B^{k}\right\vert $.

Corollary \ref{cor.powruleAn} (applied to $B$ and $k$ instead of $A$ and $n$)
shows that $B^{k}$ is a finite set with size $\left\vert B^{k}\right\vert
=\left\vert B\right\vert ^{k}$. Hence, $\left\vert B^{A}\right\vert
=\left\vert B^{k}\right\vert =\left\vert B\right\vert ^{k}=\left\vert
B\right\vert ^{\left\vert A\right\vert }$ (since $k=\left\vert A\right\vert
$). Thus, in particular, $B^{A}$ is a finite set. This proves Theorem
\ref{thm.maps.power}.
\end{proof}

In one of the next chapters, we will count certain restricted types of maps
(injective maps, surjective maps, etc.).

\subsubsection{\label{subsect.intro.tups.apps}Applications}

Theorem \ref{thm.maps.power} and Theorem \ref{thm.prodrulen} can be used not
only in the kind of problems that are visibly concerned with subsets or
tuples. In fact, often one can discover a bijection between the objects one
wants to count and some kind of maps or tuples. The most famous example is a
combinatorial proof of Theorem \ref{thm.subsets.2pown}:

\begin{proof}
[Third proof of Theorem \ref{thm.subsets.2pown}.]The set $S$ is an $n$-element
set. Let us denote its $n$ elements by $s_{1},s_{2},\ldots,s_{n}$ (in an
arbitrary order, with no repetitions). Thus, $s_{1},s_{2},\ldots,s_{n}$ are
$n$ distinct elements of $S$ and satisfy $S=\left\{  s_{1},s_{2},\ldots
,s_{n}\right\}  $.

We will construct a bijection from the set $\left\{  \text{subsets of
}S\right\}  $ to $\left\{  0,1\right\}  ^{n}$. This will then let us apply
Corollary \ref{cor.powruleAn} (and the bijection principle) and obtain
$\left\vert \left\{  \text{subsets of }S\right\}  \right\vert =2^{n}$. So let
us construct such a bijection:

We define the map $A:\left\{  \text{subsets of }S\right\}  \rightarrow\left\{
0,1\right\}  ^{n}$ by setting\footnote{We are using the Iverson bracket
notation (defined in Definition \ref{def.iverson}).}%
\[
A\left(  T\right)  =\left(  \left[  s_{1}\in T\right]  ,\left[  s_{2}\in
T\right]  ,\ldots,\left[  s_{n}\in T\right]  \right)  \qquad\text{for each
subset }T\text{ of }S.
\]
(This is well-defined, since each of the truth values $\left[  s_{1}\in
T\right]  ,\left[  s_{2}\in T\right]  ,\ldots,\left[  s_{n}\in T\right]  $
belongs to $\left\{  0,1\right\}  $.) For example, if $n=5$ and $T=\left\{
s_{2},s_{4},s_{5}\right\}  $, then $A\left(  T\right)  =\left(
0,1,0,1,1\right)  $. (Some call $A\left(  T\right)  $ the \emph{indicator
vector} of $T$, since its $i$-th entry indicates whether $s_{i}$ belongs to
$T$ or not.)

In order to prove that $A$ is a bijection, we shall next construct a map $B$
in the other direction, and then show that it is inverse to $A$.

We define the map $B:\left\{  0,1\right\}  ^{n}\rightarrow\left\{
\text{subsets of }S\right\}  $ by setting
\begin{align*}
B\left(  \left(  i_{1},i_{2},\ldots,i_{n}\right)  \right)   &  =\left\{
s_{k}\ \mid\ k\in\left[  n\right]  \text{ and }i_{k}=1\right\} \\
&  \ \ \ \ \ \ \ \ \ \ \text{for each }\left(  i_{1},i_{2},\ldots
,i_{n}\right)  \in\left\{  0,1\right\}  ^{n}.
\end{align*}
(Note that $\left\{  s_{k}\ \mid\ k\in\left[  n\right]  \text{ and }%
i_{k}=1\right\}  $ is always a subset of $S$, since $s_{1},s_{2},\ldots,s_{n}$
are elements of $S$.)

We want to show that the maps $A$ and $B$ are mutually inverse. In order to do
this, we must show that $A\circ B=\operatorname{id}$ and that $B\circ
A=\operatorname{id}$.

Intuitively, this is fairly obvious: The map $A$ encodes a subset of $S$ as an
$n$-tuple, each of whose entries equals either $0$ or $1$ depending on whether
the corresponding element of $S$ belongs to the subset or not.\footnote{The
\textquotedblleft corresponding element of $S$\textquotedblright\ to the
$k$-th entry is understood to be $s_{k}$. This correspondence between the $n$
positions in the $n$-tuple and the elements of $S$ is fixed (since we have
fixed $s_{1},s_{2},\ldots,s_{n}$).} The map $B$, in turn, decodes such an
$n$-tuple back into a subset of $S$, by gathering the elements of $S$
corresponding to those positions at which the $n$-tuple has a $1$. It is thus
clear that the maps $A$ and $B$ undo one another, i.e., they satisfy the two
equalities $A\circ B=\operatorname{id}$ and $B\circ A=\operatorname*{id}$.

\begin{fineprint}
Here is a more formal way to prove these equalities:

\begin{itemize}
\item In order to show that $A \circ B = \operatorname{id}$, we fix some
$\left(  i_{1}, i_{2}, \ldots, i_{n} \right)  \in\left\{  0, 1 \right\}  ^{n}%
$. We shall show that $\left(  A \circ B \right)  \left(  \left(  i_{1},
i_{2}, \ldots, i_{n} \right)  \right)  = \left(  i_{1}, i_{2}, \ldots, i_{n}
\right)  $.

Set $T=B\left(  \left(  i_{1},i_{2},\ldots,i_{n}\right)  \right)  $. Thus,
$T=B\left(  \left(  i_{1},i_{2},\ldots,i_{n}\right)  \right)  =\left\{
s_{k}\ \mid\ k\in\left[  n\right]  \text{ and }i_{k}=1\right\}  $ (by the
definition of $B$). Now,
\begin{align}
\left(  A\circ B\right)  \left(  \left(  i_{1},i_{2},\ldots,i_{n}\right)
\right)   &  =A\left(  \underbrace{B\left(  \left(  i_{1},i_{2},\ldots
,i_{n}\right)  \right)  }_{=T}\right)  =A\left(  T\right) \nonumber\\
&  =\left(  \left[  s_{1}\in T\right]  ,\left[  s_{2}\in T\right]
,\ldots,\left[  s_{n}\in T\right]  \right)
\label{pf.thm.subsets.2pown.3rd.AB.1}%
\end{align}
(by the definition of $A$). Now, we shall show that each $j\in\left[
n\right]  $ satisfies $\left[  s_{j}\in T\right]  =i_{j}$.

Indeed, let $j\in\left[  n\right]  $. Thus, $i_{j}\in\left\{  0,1\right\}  $
(since $\left(  i_{1},i_{2},\ldots,i_{n}\right)  \in\left\{  0,1\right\}
^{n}$). Recall that $T=\left\{  s_{k}\ \mid\ k\in\left[  n\right]  \text{ and
}i_{k}=1\right\}  $. Hence, if $i_{j}=1$, then $s_{j}\in T$ and therefore
$\left[  s_{j}\in T\right]  =1=i_{j}$. Therefore, we have proved $\left[
s_{j}\in T\right]  =i_{j}$ in the case when $i_{j}=1$. On the other hand, if
$i_{j}\neq1$, then $i_{j}=0$ (since $i_{j}\in\left\{  0,1\right\}  $) and
$s_{j}\notin T$\ \ \ \ \footnote{\textit{Proof.} Assume that $i_{j}\neq1$. We
must prove that $s_{j}\notin T$.
\par
Assume the contrary. Thus, $s_{j}\in T=\left\{  s_{k}\ \mid\ k\in\left[
n\right]  \text{ and }i_{k}=1\right\}  $. In other words, there exists some
$k\in\left[  n\right]  $ such that $i_{k}=1$ and $s_{j}=s_{k}$. Consider this
$k$. From $s_{j}=s_{k}$, we obtain $j=k$ (since $s_{1},s_{2},\ldots,s_{n}$ are
distinct). Thus, $i_{j}=i_{k}=1$. This contradicts $i_{j}\neq1$. This
contradiction shows that our assumption was false, qed.} and therefore
$\left[  s_{j}\in T\right]  =0=i_{j}$. Thus, we have proved $\left[  s_{j}\in
T\right]  =i_{j}$ in the case when $i_{j}\neq1$. We have now proved $\left[
s_{j}\in T\right]  =i_{j}$ both in the case when $i_{j}=1$ and in the case
when $i_{j}\neq1$. These two cases cover all possibilities; thus, we always
have $\left[  s_{j}\in T\right]  =i_{j}$.

Forget that we fixed $j$. We thus have shown that $\left[  s_{j}\in T\right]
=i_{j}$ for each $j\in\left[  n\right]  $. Hence,
\[
\left(  \left[  s_{1}\in T\right]  ,\left[  s_{2}\in T\right]  ,\ldots,\left[
s_{n}\in T\right]  \right)  =\left(  i_{1},i_{2},\ldots,i_{n}\right)  .
\]
Hence, (\ref{pf.thm.subsets.2pown.3rd.AB.1}) becomes
\begin{align}
\left(  A\circ B\right)  \left(  \left(  i_{1},i_{2},\ldots,i_{n}\right)
\right)   &  =\left(  \left[  s_{1}\in T\right]  ,\left[  s_{2}\in T\right]
,\ldots,\left[  s_{n}\in T\right]  \right)  =\left(  i_{1},i_{2},\ldots
,i_{n}\right) \nonumber\\
&  =\operatorname{id}\left(  \left(  i_{1},i_{2},\ldots,i_{n}\right)  \right)
. \label{pf.thm.subsets.2pown.3rd.AB.2}%
\end{align}


Now, forget that we fixed $\left(  i_{1},i_{2},\ldots,i_{n}\right)  $. We thus
have proven (\ref{pf.thm.subsets.2pown.3rd.AB.2}) for each $\left(
i_{1},i_{2},\ldots,i_{n}\right)  \in\left\{  0,1\right\}  ^{n}$. Hence,
$A\circ B=\operatorname{id}$.

\item In order to prove that $B\circ A=\operatorname{id}$, we fix
$T\in\left\{  \text{subsets of }S\right\}  $. We are going to show that
$\left(  B\circ A\right)  \left(  T\right)  =T$.

We know that $T$ is a subset of $S$ (since $T\in\left\{  \text{subsets of
}S\right\}  $). In other words, $T\subseteq S$.

We have $A\left(  T\right)  =\left(  \left[  s_{1}\in T\right]  ,\left[
s_{2}\in T\right]  ,\ldots,\left[  s_{n}\in T\right]  \right)  $ by the
definition of $A$. Now,
\begin{align}
\left(  B\circ A\right)  \left(  T\right)   &  =B\left(  \underbrace{A\left(
T\right)  }_{=\left(  \left[  s_{1}\in T\right]  ,\left[  s_{2}\in T\right]
,\ldots,\left[  s_{n}\in T\right]  \right)  }\right) \nonumber\\
&  =B\left(  \left(  \left[  s_{1}\in T\right]  ,\left[  s_{2}\in T\right]
,\ldots,\left[  s_{n}\in T\right]  \right)  \right) \nonumber\\
&  =\left\{  s_{k}\ \mid\ k\in\left[  n\right]  \text{ and }\left[  s_{k}\in
T\right]  =1\right\}  \label{pf.thm.subsets.2pown.3rd.AB.3}%
\end{align}
(by the definition of $B$).

From this, we can easily conclude that $\left(  B\circ A\right)  \left(
T\right)  \subseteq T$\ \ \ \ \footnote{\textit{Proof.} Let $s\in\left(
B\circ A\right)  \left(  T\right)  $. Thus, $s\in\left(  B\circ A\right)
\left(  T\right)  =\left\{  s_{k}\ \mid\ k\in\left[  n\right]  \text{ and
}\left[  s_{k}\in T\right]  =1\right\}  $. In other words, $s=s_{k}$ for some
$k\in\left[  n\right]  $ satisfying $\left[  s_{k}\in T\right]  =1$. Consider
this $k$. From $\left[  s_{k}\in T\right]  =1$, we conclude that $s_{k}\in T$
must be true (by the definition of the Iverson bracket notation). Hence,
$s=s_{k}\in T$.
\par
Forget that we fixed $s$. We thus have proved that $s\in T$ for each
$s\in\left(  B\circ A\right)  \left(  T\right)  $. In other words, $\left(
B\circ A\right)  \left(  T\right)  \subseteq T$.} and $T\subseteq\left(
B\circ A\right)  \left(  T\right)  $\ \ \ \ \footnote{\textit{Proof.} Let
$s\in T$. Then, $s\in T\subseteq S=\left\{  s_{1},s_{2},\ldots,s_{n}\right\}
$. In other words, $s=s_{j}$ for some $j\in\left[  n\right]  $. Consider this
$j$. Then, $s_{j}=s\in T$. Hence, $\left[  s_{j}\in T\right]  =1$. Thus, $j$
is a $k\in\left[  n\right]  $ satisfying $\left[  s_{k}\in T\right]  =1$
(because $j\in\left[  n\right]  $ and $\left[  s_{j}\in T\right]  =1$). Hence,
$s_{j}\in\left\{  s_{k}\ \mid\ k\in\left[  n\right]  \text{ and }\left[
s_{k}\in T\right]  =1\right\}  $. In view of
(\ref{pf.thm.subsets.2pown.3rd.AB.3}), this rewrites as $s_{j}\in\left(
B\circ A\right)  \left(  T\right)  $. Thus, $s=s_{j}\in\left(  B\circ
A\right)  \left(  T\right)  $.
\par
Forget that we fixed $s$. We thus have proved that $s\in\left(  B\circ
A\right)  \left(  T\right)  $ for each $s\in T$. In other words,
$T\subseteq\left(  B\circ A\right)  \left(  T\right)  $.}. Combining these two
relations, we obtain $\left(  B\circ A\right)  \left(  T\right)  =T$. In other
words, $\left(  B\circ A\right)  \left(  T\right)  =\operatorname*{id}\left(
T\right)  $ (since $\operatorname*{id}\left(  T\right)  =T$).

Now, forget that we fixed $T$. We thus have shown that $\left(  B\circ
A\right)  \left(  T\right)  =\operatorname*{id}\left(  T\right)  $ for each
$T\in\left\{  \text{subsets of }S\right\}  $. In other words, $B\circ
A=\operatorname{id}$.
\end{itemize}
\end{fineprint}

We now know that $A\circ B=\operatorname{id}$ and $B\circ A=\operatorname{id}%
$. Combining these equalities, we conclude that the maps $A$ and $B$ are
mutually inverse. Hence, the map $A$ is invertible, i.e., bijective. In other
words, $A:\left\{  \text{subsets of }S\right\}  \rightarrow\left\{
0,1\right\}  ^{n}$ is a bijection. Thus, Theorem \ref{thm.bij-rule} (applied
to $X=\left\{  \text{subsets of }S\right\}  $, $Y=\left\{  0,1\right\}  ^{n}$
and $f=A$) yields
\begin{align*}
\left\vert \left\{  \text{subsets of }S\right\}  \right\vert  &  =\left\vert
\left\{  0,1\right\}  ^{n}\right\vert =\left\vert \left\{  0,1\right\}
\right\vert ^{n}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Corollary \ref{cor.powruleAn}, applied
to }\left\{  0,1\right\}  \text{ instead of }A\right) \\
&  =2^{n}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left\vert \left\{
0,1\right\}  \right\vert =2\right)  .
\end{align*}
Hence, $2^{n}=\left\vert \left\{  \text{subsets of }S\right\}  \right\vert
=\left(  \text{\# of subsets of }S\right)  $. This proves Theorem
\ref{thm.subsets.2pown} once again.\footnote{This proof has been taken from
\cite[solution to Exercise 1 \textbf{(a)}]{19f-hw0s} (but slightly adapted for
the fact that we are using the set $S$ rather than $\left[  n\right]  $
here).}
\end{proof}

The key idea in the above proof of Theorem \ref{thm.subsets.2pown} was to
encode any subset of the $n$-element set $S$ as an $n$-tuple $\left(
i_{1},i_{2},\ldots,i_{n}\right)  \in\left\{  0,1\right\}  ^{n}$. Instead of
using an $n$-tuple, we could have just as well used a map from $\left[
n\right]  $ to $\left\{  0,1\right\}  $, since we learned to translate between
tuples and maps in the above proof of Theorem \ref{thm.maps.power}. The reader
can easily restate our above proof of Theorem \ref{thm.subsets.2pown} using
maps instead of tuples.

Here are some other counting exercises that can easily be reduced to counting
tuples or maps:

\begin{exercise}
\label{exe.ABC}Let $n\in\mathbb{N}$.

\textbf{(a)} Find the number of all triples $\left(  A,B,C\right)  $ of
subsets of $\left[  n\right]  $ satisfying $A\cup B\cup C=\left[  n\right]  $
and $A\cap B\cap C=\varnothing$.

\textbf{(b)} Find the number of all triples $\left(  A,B,C\right)  $ of
subsets of $\left[  n\right]  $ satisfying $B\cap C=C\cap A=A\cap B$.

\textbf{(c)} Find the number of all triples $\left(  A,B,C\right)  $ of
subsets of $\left[  n\right]  $ satisfying $A\cap B=A\cap C$.

\textbf{(d)} Find the number of $4$-tuples $\left(  A,B,C,D\right)  $ of
subsets of $\left[  n\right]  $ satisfying $A\cap B=C\cap D$.

\textbf{(e)} Find the number of $4$-tuples $\left(  A,B,C,D\right)  $ of
subsets of $\left[  n\right]  $ satisfying $A\cap B=C\cup D$.
\end{exercise}

\begin{exercise}
\label{exe.if2i}A set $S$ of integers is said to be \emph{shadowed} if it has
the following property: Whenever an \textbf{odd} integer $i$ belongs to $S$,
the next integer $i+1$ must also belong to $S$. (For example, $\varnothing$,
$\left\{  2,4\right\}  $ and $\left\{  1,2,5,6,8\right\}  $ are shadowed, but
$\left\{  1,5,6\right\}  $ is not, since $1$ belongs to $\left\{
1,5,6\right\}  $ but $2$ does not.)

\textbf{(a)} Let $n\in\mathbb{N}$ be even. How many shadowed subsets of
$\left[  n\right]  $ exist?

\textbf{(b)} Let $n\in\mathbb{N}$ be odd. How many shadowed subsets of
$\left[  n\right]  $ exist?
\end{exercise}

\begin{center}
\fbox{\textbf{Class of 2019-10-11}}
\end{center}

\subsection{\label{sect.intro.fubini}Interchange of summations}

\subsubsection{The finite Fubini principle}

In Subsection \ref{subsect.intro.powersums.sumrules}, we have seen a few rules
for manipulating finite sums. Let me now show another: the \emph{(finite)}
\emph{Fubini principle}. Let us first state it; we will see it in action soon:

\begin{theorem}
[(Finite) Fubini principle]\label{thm.fubini}Let $X$ and $Y$ be two finite
sets. Let $a_{\left(  x,y\right)  }$ be a number for each pair $\left(
x,y\right)  \in X\times Y$. Then,%
\begin{equation}
\sum_{x\in X}\ \ \sum_{y\in Y}a_{\left(  x,y\right)  }=\sum_{\left(
x,y\right)  \in X\times Y}a_{\left(  x,y\right)  }=\sum_{y\in Y}\ \ \sum_{x\in
X}a_{\left(  x,y\right)  }. \label{eq.sum.fubini}%
\end{equation}

\end{theorem}

Theorem \ref{thm.fubini} is called the \emph{finite Fubini principle} or
\emph{Fubini's theorem for finite sums}, since it is a discrete analogue of
Fubini's principle for double integrals. A proof of Theorem \ref{thm.fubini}
is outlined in \cite[\S 1.4.2]{detnotes} (and an alternative proof can easily
be obtained by induction on $\left\vert X\right\vert $); here I shall restrict
myself to illustrating it on an example:

\begin{example}
Let $n\in\mathbb{N}$ and $m\in\mathbb{N}$. Let $a_{\left(  x,y\right)  }$ be a
number for each pair $\left(  x,y\right)  \in\left[  n\right]  \times\left[
m\right]  $. Then, (\ref{eq.sum.fubini}) (applied to $X=\left[  n\right]  $
and $Y=\left[  m\right]  $) yields%
\begin{equation}
\sum_{x=1}^{n}\ \ \sum_{y=1}^{m}a_{\left(  x,y\right)  }=\sum_{\left(
x,y\right)  \in\left[  n\right]  \times\left[  m\right]  }a_{\left(
x,y\right)  }=\sum_{y=1}^{m}\ \ \sum_{x=1}^{n}a_{\left(  x,y\right)  }.
\label{eq.sum.fubini.nm}%
\end{equation}
This equality, when rewritten to avoid the use of summation signs, looks as
follows:%
\begin{align*}
&  \left(  a_{\left(  1,1\right)  }+a_{\left(  1,2\right)  }+\cdots+a_{\left(
1,m\right)  }\right) \\
&  \ \ \ \ \ \ \ \ \ \ +\left(  a_{\left(  2,1\right)  }+a_{\left(
2,2\right)  }+\cdots+a_{\left(  2,m\right)  }\right) \\
&  \ \ \ \ \ \ \ \ \ \ +\cdots\\
&  \ \ \ \ \ \ \ \ \ \ +\left(  a_{\left(  n,1\right)  }+a_{\left(
n,2\right)  }+\cdots+a_{\left(  n,m\right)  }\right) \\
&  =a_{\left(  1,1\right)  }+a_{\left(  1,2\right)  }+\cdots+a_{\left(
n,m\right)  }\ \ \ \ \ \ \ \ \ \ \left(  \text{this is the sum of all
}nm\text{ numbers }a_{\left(  x,y\right)  }\right) \\
&  =\left(  a_{\left(  1,1\right)  }+a_{\left(  2,1\right)  }+\cdots
+a_{\left(  n,1\right)  }\right) \\
&  \ \ \ \ \ \ \ \ \ \ +\left(  a_{\left(  1,2\right)  }+a_{\left(
2,2\right)  }+\cdots+a_{\left(  n,2\right)  }\right) \\
&  \ \ \ \ \ \ \ \ \ \ +\cdots\\
&  \ \ \ \ \ \ \ \ \ \ +\left(  a_{\left(  1,m\right)  }+a_{\left(
2,m\right)  }+\cdots+a_{\left(  n,m\right)  }\right)  .
\end{align*}
So this equality says that if we have a rectangular $n\times m$-table of
numbers:%
\[%
\begin{tabular}
[c]{|cccc|}\hline
$a_{\left(  1,1\right)  }$ & $a_{\left(  1,2\right)  }$ & $\cdots$ &
$a_{\left(  1,m\right)  }$\\
$a_{\left(  2,1\right)  }$ & $a_{\left(  2,2\right)  }$ & $\cdots$ &
$a_{\left(  2,m\right)  }$\\
$\vdots$ & $\vdots$ & $\ddots$ & $\vdots$\\
$a_{\left(  n,1\right)  }$ & $a_{\left(  n,2\right)  }$ & $\cdots$ &
$a_{\left(  n,m\right)  }$\\\hline
\end{tabular}
\ \ \ \ ,
\]
then the following three procedures all produce the same result:

\begin{itemize}
\item[\textbf{(a)}] summing up the $m$ numbers in each row of the table
separately, and then summing up these $n$ \textquotedblleft row
tallies\textquotedblright;

\item[\textbf{(b)}] summing up all the $nm$ numbers in the table;

\item[\textbf{(c)}] summing up the $n$ numbers in each column of the table
separately, and then summing up these $m$ \textquotedblleft column
tallies\textquotedblright.
\end{itemize}

\noindent This is, of course, exactly how you would expect sums to behave.
\end{example}

I like to abbreviate the equality (\ref{eq.sum.fubini}) as follows:%
\[
\sum_{x\in X}\ \ \sum_{y\in Y}=\sum_{\left(  x,y\right)  \in X\times Y}%
=\sum_{y\in Y}\ \ \sum_{x\in X}.
\]
This is an \textquotedblleft equality between summation
signs\textquotedblright; it should be understood as follows: Every time you
see an \textquotedblleft$\sum_{x\in X}\ \ \sum_{y\in Y}$\textquotedblright\ in
an expression, you can replace it by a \textquotedblleft$\sum_{\left(
x,y\right)  \in X\times Y}$\textquotedblright\ or by a \textquotedblleft%
$\sum_{y\in Y}\ \ \sum_{x\in X}$\textquotedblright, and similarly the other
ways round. Thus, in particular, you can replace the sequence
\textquotedblleft$\sum_{x\in X}\ \ \sum_{y\in Y}$\textquotedblright\ of two
summation signs by the reverse sequence \textquotedblleft$\sum_{y\in
Y}\ \ \sum_{x\in X}$\textquotedblright\ and vice versa.\footnote{Of course,
you can do this only if $X$ and $Y$ are finite sets that have a well-defined
meaning independent of $x$ and $y$. Thus, you cannot replace the sequence
\textquotedblleft$\sum_{x\in\left[  n\right]  }\ \ \sum_{y\in\left[  x\right]
}$\textquotedblright\ by \textquotedblleft$\sum_{y\in\left[  x\right]
}\ \ \sum_{x\in\left[  n\right]  }$\textquotedblright: The latter sequence
would be meaningless, since the \textquotedblleft$x$\textquotedblright\ under
the first summation sign now refers to nothing. We will soon see how such
double summations can be transformed.} This is called \emph{interchange of
summations} or \emph{interchanging the order of summation}.

As a first example of how (\ref{eq.sum.fubini}) can be applied, let us solve a
simple exercise:

\begin{exercise}
\label{exe.sum.fubini-exam1}Let $n\in\mathbb{N}$. Let $S$ be an $n$-element
set. Find the sum of the sizes of all subsets of $S$; in other words, find the
sum%
\[
\sum_{T\subseteq S}\left\vert T\right\vert .
\]

\end{exercise}

We shall solve this using the following simple fact:\footnote{For the meaning
of the square brackets on the right hand side, see Definition
\ref{def.iverson}.}

\begin{proposition}
[\textquotedblleft Counting by roll call\textquotedblright]%
\label{prop.count.rollcall}Let $S$ be a finite set.

\textbf{(a)} If $T$ is a subset of $S$, then%
\[
\left\vert T\right\vert =\sum_{s\in S}\left[  s\in T\right]  .
\]


\textbf{(b)} For each $s\in S$, let $\mathcal{A}\left(  s\right)  $ be a
logical statement (which can be either true or false depending on $s$; for
example, $\mathcal{A}\left(  s\right)  $ could be \textquotedblleft$s$ is
even\textquotedblright\ if $S$ is a set of integers, or \textquotedblleft$s$
is empty\textquotedblright\ if $S$ is a set of sets). Then,%
\[
\left(  \text{\# of }s\in S\text{ that satisfy }\mathcal{A}\left(  s\right)
\right)  =\sum_{s\in S}\left[  \mathcal{A}\left(  s\right)  \right]  .
\]

\end{proposition}

\begin{example}
\textbf{(a)} Applying Proposition \ref{prop.count.rollcall} \textbf{(a)} to
$S=\left[  5\right]  $ and $T=\left\{  1,3,5\right\}  $, we obtain%
\[
\left\vert \left\{  1,3,5\right\}  \right\vert =\sum_{s\in\left[  5\right]
}\left[  s\in\left\{  1,3,5\right\}  \right]  =1+0+1+0+1.
\]


\textbf{(b)} Applying Proposition \ref{prop.count.rollcall} \textbf{(b)} to
$S=\left[  5\right]  $ and $\mathcal{A}\left(  s\right)  =\left(
\text{\textquotedblleft}s\text{ is odd\textquotedblright}\right)  $, we obtain%
\[
\left(  \text{\# of }s\in\left[  5\right]  \text{ that are odd}\right)
=\sum_{s\in\left[  5\right]  }\left[  s\text{ is odd}\right]  =1+0+1+0+1.
\]

\end{example}

Why am I calling this \textquotedblleft counting by roll
call\textquotedblright? Because Proposition \ref{prop.count.rollcall}
\textbf{(a)} formalizes a way to count the elements of the subset $T$ by
\textquotedblleft calling the roll\textquotedblright\ of all elements of $S$
and adding a $1$ every time an element of $T$ is encountered. Proposition
\ref{prop.count.rollcall} \textbf{(b)} does the same thing, except we are no
longer counting the elements of $T$, but instead are counting the elements $s$
of $S$ that satisfy $\mathcal{A}\left(  s\right)  $. The two parts of
Proposition \ref{prop.count.rollcall} are easily seen to be equivalent to each
other, since any subset $T$ of $S$ gives rise to a logical statement
$\mathcal{A}\left(  s\right)  =\left(  \text{\textquotedblleft}s\in
T\text{\textquotedblright}\right)  $ for each $s\in S$, and conversely, any
logical statement $\mathcal{A}\left(  s\right)  $ defined for each $s\in S$
can be used to carve out a subset $\left\{  s\in S\ \mid\ \mathcal{A}\left(
s\right)  \text{ holds}\right\}  $ of $S$.

The formal proof is not much more complicated:

\begin{proof}
[Proof of Proposition \ref{prop.count.rollcall}.]\textbf{(b)} Let $Q$ be the
set of all $s\in S$ that satisfy $\mathcal{A}\left(  s\right)  $. Then,%
\[
\left\vert Q\right\vert =\left(  \text{\# of }s\in S\text{ that satisfy
}\mathcal{A}\left(  s\right)  \right)  .
\]
Furthermore, the elements $s\in S$ for which $\mathcal{A}\left(  s\right)  $
is true are precisely the elements of $Q$ (because this is how $Q$ is defined).

Now, apply the formula (\ref{eq.sum.split.As}) to $a_{s}=\left[
\mathcal{A}\left(  s\right)  \right]  $. Thus, we obtain%
\begin{align*}
\sum_{s\in S}\left[  \mathcal{A}\left(  s\right)  \right]   &  =\sum
_{\substack{s\in S;\\\mathcal{A}\left(  s\right)  \text{ is true}%
}}\ \ \underbrace{\left[  \mathcal{A}\left(  s\right)  \right]  }%
_{\substack{=1\\\text{(since }\mathcal{A}\left(  s\right)  \text{ is true)}%
}}+\sum_{\substack{s\in S;\\\mathcal{A}\left(  s\right)  \text{ is false}%
}}\ \ \underbrace{\left[  \mathcal{A}\left(  s\right)  \right]  }%
_{\substack{=0\\\text{(since }\mathcal{A}\left(  s\right)  \text{ is false)}%
}}\\
&  =\sum_{\substack{s\in S;\\\mathcal{A}\left(  s\right)  \text{ is true}%
}}1+\underbrace{\sum_{\substack{s\in S;\\\mathcal{A}\left(  s\right)  \text{
is false}}}0}_{=0}=\sum_{\substack{s\in S;\\\mathcal{A}\left(  s\right)
\text{ is true}}}1=\sum_{s\in Q}1\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since the elements }s\in S\text{ for which }\mathcal{A}\left(  s\right)
\text{ is true}\\
\text{are precisely the elements of }Q
\end{array}
\right) \\
&  =\left\vert Q\right\vert \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{eq.sum.equal-1}), applied to }Q\text{ instead of }S\right) \\
&  =\left(  \text{\# of }s\in S\text{ that satisfy }\mathcal{A}\left(
s\right)  \right)  .
\end{align*}
This proves Proposition \ref{prop.count.rollcall} \textbf{(b)}.

\textbf{(a)} Let $T$ be a subset of $S$. Thus, $S\cap T=T$. Applying
Proposition \ref{prop.count.rollcall} \textbf{(b)} to the statements
$\mathcal{A}\left(  s\right)  =\left(  \text{\textquotedblleft}s\in
T\text{\textquotedblright}\right)  $, we obtain%
\[
\left(  \text{\# of }s\in S\text{ that satisfy }s\in T\right)  =\sum_{s\in
S}\left[  s\in T\right]  .
\]
Comparing this with%
\[
\left(  \text{\# of }s\in S\text{ that satisfy }s\in T\right)  =\left\vert
\underbrace{\left\{  s\in S\ \mid\ s\in T\right\}  }_{=S\cap T=T}\right\vert
=\left\vert T\right\vert ,
\]
we obtain $\left\vert T\right\vert =\sum_{s\in S}\left[  s\in T\right]  $.
This proves Proposition \ref{prop.count.rollcall} \textbf{(a)}.
\end{proof}

\begin{proof}
[First solution to Exercise \ref{exe.sum.fubini-exam1}.]Let $\mathcal{P}%
\left(  S\right)  $ denote the powerset of $S$. This is a finite set, since
$S$ is finite.

We have $\left\vert S\right\vert =n$ (since $S$ is an $n$-element set). But%
\begin{equation}
\sum_{T\subseteq S}\underbrace{\left\vert T\right\vert }_{\substack{=\sum
_{s\in S}\left[  s\in T\right]  \\\text{(by Proposition
\ref{prop.count.rollcall} \textbf{(a)})}}}=\sum_{T\subseteq S}\ \ \sum_{s\in
S}\left[  s\in T\right]  =\sum_{s\in S}\ \ \sum_{T\subseteq S}\left[  s\in
T\right]  , \label{sol.sum.fubini-exam1.1}%
\end{equation}
where the last equality has been obtained by interchanging the two summation
signs (using the Fubini principle)\footnote{In more detail: Theorem
\ref{thm.fubini} (applied to $X=\mathcal{P}\left(  S\right)  $, $Y=S$ and
$a_{\left(  x,y\right)  }=\left[  y\in x\right]  $) yields%
\[
\sum_{x\in\mathcal{P}\left(  S\right)  }\ \ \sum_{y\in S}\left[  y\in
x\right]  =\sum_{\left(  x,y\right)  \in\mathcal{P}\left(  S\right)  \times
S}\left[  y\in x\right]  =\sum_{y\in S}\ \ \sum_{x\in\mathcal{P}\left(
S\right)  }\left[  y\in x\right]  .
\]
Renaming the summation indices $x$ and $y$ as $T$ and $s$ (in order to match
the notations in (\ref{sol.sum.fubini-exam1.1})), we rewrite this as%
\[
\sum_{T\in\mathcal{P}\left(  S\right)  }\ \ \sum_{s\in S}\left[  s\in
T\right]  =\sum_{\left(  T,s\right)  \in\mathcal{P}\left(  S\right)  \times
S}\left[  s\in T\right]  =\sum_{s\in S}\ \ \sum_{T\in\mathcal{P}\left(
S\right)  }\left[  s\in T\right]  .
\]
Since the summation sign $\sum_{T\in\mathcal{P}\left(  S\right)  }$ is
synonymous to $\sum_{T\subseteq S}$, we can further rewrite this as follows:%
\[
\sum_{T\subseteq S}\ \ \sum_{s\in S}\left[  s\in T\right]  =\sum_{\left(
T,s\right)  \in\mathcal{P}\left(  S\right)  \times S}\left[  s\in T\right]
=\sum_{s\in S}\ \ \sum_{T\subseteq S}\left[  s\in T\right]  .
\]
This justifies the last equality sign in (\ref{sol.sum.fubini-exam1.1}).}.
Hence,%
\begin{equation}
\sum_{T\subseteq S}\left\vert T\right\vert =\sum_{s\in S}\ \ \sum_{T\subseteq
S}\left[  s\in T\right]  =\sum_{x\in S}\ \ \sum_{T\subseteq S}\left[  x\in
T\right]  \label{sol.sum.fubini-exam1.2}%
\end{equation}
(here, we have renamed the summation index $s$ as $x$ in the outer sum).

Now, fix $x\in S$. We shall simplify the sum $\sum_{T\subseteq S}\left[  x\in
T\right]  $. Indeed, an application of Proposition \ref{prop.count.rollcall}
\textbf{(b)} yields%
\begin{equation}
\sum_{T\subseteq S}\left[  x\in T\right]  =\left(  \text{\# of subsets
}T\text{ of }S\text{ that satisfy }x\in T\right)
\label{sol.sum.fubini-exam1.3}%
\end{equation}
\footnote{In more detail: We can apply Proposition \ref{prop.count.rollcall}
\textbf{(b)} to $\mathcal{P}\left(  S\right)  $ and $\left(
\text{\textquotedblleft}x\in s\text{\textquotedblright}\right)  $ instead of
$S$ and $\mathcal{A}\left(  s\right)  $. This results in the equality%
\[
\left(  \text{\# of }s\in\mathcal{P}\left(  S\right)  \text{ that satisfy
}x\in s\right)  =\sum_{s\in\mathcal{P}\left(  S\right)  }\left[  x\in
s\right]  .
\]
Renaming the \textquotedblleft$s$\textquotedblright\ here as $T$, we can
rewrite this as
\[
\left(  \text{\# of }T\in\mathcal{P}\left(  S\right)  \text{ that satisfy
}x\in T\right)  =\sum_{T\in\mathcal{P}\left(  S\right)  }\left[  x\in
T\right]  .
\]
Since the summation sign $\sum_{T\in\mathcal{P}\left(  S\right)  }$ is a
synonym for $\sum_{T\subseteq S}$, this further rewrites as%
\[
\left(  \text{\# of }T\in\mathcal{P}\left(  S\right)  \text{ that satisfy
}x\in T\right)  =\sum_{T\subseteq S}\left[  x\in T\right]  .
\]
Hence,%
\begin{align*}
\sum_{T\subseteq S}\left[  x\in T\right]   &  =\left(  \text{\# of }%
T\in\mathcal{P}\left(  S\right)  \text{ that satisfy }x\in T\right) \\
&  =\left(  \text{\# of subsets }T\text{ of }S\text{ that satisfy }x\in
T\right)  ,
\end{align*}
because the $T\in\mathcal{P}\left(  S\right)  $ are precisely the subsets of
$S$.}. But there is a bijection%
\begin{align*}
\left\{  \text{subsets }T\text{ of }S\text{ that satisfy }x\in T\right\}   &
\rightarrow\left\{  \text{subsets of }S\setminus\left\{  x\right\}  \right\}
,\\
R  &  \mapsto R\setminus\left\{  x\right\}
\end{align*}
\footnote{Indeed, this map is easily seen to be well-defined, and it has an
inverse map which sends each $Q\in\left\{  \text{subsets of }S\setminus
\left\{  x\right\}  \right\}  $ to $Q\cup\left\{  x\right\}  \in\left\{
\text{subsets }T\text{ of }S\text{ that satisfy }x\in T\right\}  $. This is
essentially the same construction that we used to count red subsets in the
proof of Theorem \ref{thm.binom.comb}, except that this time we are not fixing
the size of our subsets but considering all subsets together.}. By the
bijection principle, this entails that%
\[
\left\vert \left\{  \text{subsets }T\text{ of }S\text{ that satisfy }x\in
T\right\}  \right\vert =\left\vert \left\{  \text{subsets of }S\setminus
\left\{  x\right\}  \right\}  \right\vert .
\]
In other words,%
\[
\left(  \text{\# of subsets }T\text{ of }S\text{ that satisfy }x\in T\right)
=\left(  \text{\# of subsets of }S\setminus\left\{  x\right\}  \right)  .
\]
Furthermore, $S\setminus\left\{  x\right\}  $ is an $\left(  n-1\right)
$-element set (since $S$ is an $n$-element set, and $x\in S$), and thus
$n-1=\left\vert S\setminus\left\{  x\right\}  \right\vert \in\mathbb{N}$;
hence, Theorem \ref{thm.subsets.2pown} (applied to $n-1$ and $S\setminus
\left\{  x\right\}  $ instead of $n$ and $S$) yields%
\[
\left(  \text{\# of subsets of }S\setminus\left\{  x\right\}  \right)
=2^{n-1}.
\]


Thus, (\ref{sol.sum.fubini-exam1.3}) becomes%
\begin{align}
\sum_{T\subseteq S}\left[  x\in T\right]   &  =\left(  \text{\# of subsets
}T\text{ of }S\text{ that satisfy }x\in T\right) \nonumber\\
&  =\left(  \text{\# of subsets of }S\setminus\left\{  x\right\}  \right)
=2^{n-1}. \label{sol.sum.fubini-exam1.6}%
\end{align}


Now, forget that we fixed $x$. We thus have proved that
(\ref{sol.sum.fubini-exam1.6}) holds for each $x\in S$. Hence,
(\ref{sol.sum.fubini-exam1.2}) becomes%
\[
\sum_{T\subseteq S}\left\vert T\right\vert =\sum_{x\in S}\ \ \underbrace{\sum
_{T\subseteq S}\left[  x\in T\right]  }_{\substack{=2^{n-1}\\\text{(by
(\ref{sol.sum.fubini-exam1.6}))}}}=\sum_{s\in S}2^{n-1}=\underbrace{\left\vert
S\right\vert }_{=n}\cdot\, 2^{n-1}=n\cdot2^{n-1}.
\]
This solves Exercise \ref{exe.sum.fubini-exam1}.
\end{proof}

In the future, we will no longer explicitly cite the Fubini principle whenever
we interchange summation signs, let alone rename our summation indices to
match those in Theorem \ref{thm.fubini} and rewrite signs like $\sum
_{T\subseteq S}$ in the standard form $\sum_{T\in\mathcal{P}\left(  S\right)
}$. We will also cut down on the details when invoking Proposition
\ref{prop.count.rollcall}. Thus, the solution we just gave will take the
following short form:

\begin{proof}
[First solution to Exercise \ref{exe.sum.fubini-exam1} (short version).]We
have $\left\vert S\right\vert =n$ (since $S$ is an $n$-element set). But%
\begin{align}
\sum_{T\subseteq S}\underbrace{\left\vert T\right\vert }_{\substack{=\sum
_{s\in S}\left[  s\in T\right]  \\\text{(by Proposition
\ref{prop.count.rollcall} \textbf{(a)})}}}  &  =\underbrace{\sum_{T\subseteq
S}\ \ \sum_{s\in S}}_{=\sum_{s\in S}\ \ \sum_{T\subseteq S}}\left[  s\in
T\right]  =\sum_{s\in S}\ \ \sum_{T\subseteq S}\left[  s\in T\right]
\nonumber\\
&  =\sum_{x\in S}\ \ \sum_{T\subseteq S}\left[  x\in T\right]
\label{sol.sum.fubini-exam1.sh3}%
\end{align}
(here, we have renamed the summation index $s$ as $x$ in the outer sum).

Now, for each $x\in S$, we have%
\begin{align}
\sum_{T\subseteq S}\left[  x\in T\right]   &  =\left(  \text{\# of subsets
}T\text{ of }S\text{ that satisfy }x\in T\right) \nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{by an application of
Proposition \ref{prop.count.rollcall} \textbf{(b)}}\right) \nonumber\\
&  =\left(  \text{\# of subsets of }S\setminus\left\{  x\right\}  \right)
\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by the bijection principle,}\\
\text{since there is a bijection}\\
\text{from }\left\{  \text{subsets }T\text{ of }S\text{ that satisfy }x\in
T\right\} \\
\text{to }\left\{  \text{subsets of }S\setminus\left\{  x\right\}  \right\} \\
\text{that sends each }R\text{ to }R\setminus\left\{  x\right\}
\end{array}
\right) \nonumber\\
&  =2^{n-1}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Theorem \ref{thm.subsets.2pown}, applied to }n-1\\
\text{and }S\setminus\left\{  x\right\}  \text{ instead of }n\text{ and }S
\end{array}
\right)  . \label{sol.sum.fubini-exam1.sh6}%
\end{align}
Hence, (\ref{sol.sum.fubini-exam1.sh3}) becomes%
\[
\sum_{T\subseteq S}\left\vert T\right\vert =\sum_{x\in S}\ \ \underbrace{\sum
_{T\subseteq S}\left[  x\in T\right]  }_{\substack{=2^{n-1}\\\text{(by
(\ref{sol.sum.fubini-exam1.sh6}))}}}=\sum_{s\in S}2^{n-1}%
=\underbrace{\left\vert S\right\vert }_{=n}\cdot\, 2^{n-1}=n\cdot2^{n-1}.
\]
This solves Exercise \ref{exe.sum.fubini-exam1}.
\end{proof}

Thus, interchanging summations (even if it requires strategically introducing
extra summation signs) can lead to short and slick proofs.

Our solution to Exercise \ref{exe.sum.fubini-exam1} resulted in the expression
$n\cdot2^{n-1}$, which is rather obviously the simplest possible answer (it
cannot be simplified any further). Nevertheless, it is worth seeing a
different solution to Exercise \ref{exe.sum.fubini-exam1}, which results in a
different (more complicated) expression for the answer. This is not a bad
thing, because as a consequence we will immediately conclude the equality
between the two expressions (once again, a proof by double counting!).

\begin{proof}
[Second solution to Exercise \ref{exe.sum.fubini-exam1}.]Let $\mathcal{P}%
\left(  S\right)  $ denote the powerset of $S$. This is a finite set, since
$S$ is finite. For each $T\in\mathcal{P}\left(  S\right)  $, we have
$\left\vert T\right\vert \in\left\{  0,1,\ldots,n\right\}  $%
\ \ \ \ \footnote{\textit{Proof.} Let $T\in\mathcal{P}\left(  S\right)  $.
Thus, $T$ is a subset of $S$ (by the definition of $\mathcal{P}\left(
S\right)  $). Hence, Theorem \ref{thm.subset-leq} \textbf{(b)} (applied to
$A=S$ and $B=T$) yields $\left\vert T\right\vert \leq\left\vert S\right\vert
=n$ (since $S$ is an $n$-element set). Hence, $\left\vert T\right\vert
\in\left\{  0,1,\ldots,n\right\}  $ (since $\left\vert T\right\vert $ is
clearly a nonnegative integer).}. Hence, we can define a map%
\begin{align*}
f:\mathcal{P}\left(  S\right)   &  \rightarrow\left\{  0,1,\ldots,n\right\}
,\\
T  &  \mapsto\left\vert T\right\vert .
\end{align*}
Consider this map $f$. Now, (\ref{eq.sum.sheph}) (applied to $\mathcal{P}%
\left(  S\right)  $, $\left\{  0,1,\ldots,n\right\}  $ and $\left\vert
s\right\vert $ instead of $S$, $W$ and $a_{s}$) yields%
\[
\sum_{s\in\mathcal{P}\left(  S\right)  }\left\vert s\right\vert =\sum
_{w\in\left\{  0,1,\ldots,n\right\}  }\ \ \sum_{\substack{s\in\mathcal{P}%
\left(  S\right)  ;\\f\left(  s\right)  =w}}\left\vert s\right\vert .
\]
Renaming the summation index $s$ as $T$ everywhere in this equality, we can
rewrite this as%
\[
\sum_{T\in\mathcal{P}\left(  S\right)  }\left\vert T\right\vert =\sum
_{w\in\left\{  0,1,\ldots,n\right\}  }\ \ \sum_{\substack{T\in\mathcal{P}%
\left(  S\right)  ;\\f\left(  T\right)  =w}}\left\vert T\right\vert .
\]
In other words,%
\[
\sum_{T\subseteq S}\left\vert T\right\vert =\sum_{w\in\left\{  0,1,\ldots
,n\right\}  }\ \ \sum_{\substack{T\subseteq S;\\f\left(  T\right)
=w}}\left\vert T\right\vert
\]
(since \textquotedblleft$T\in\mathcal{P}\left(  S\right)  $\textquotedblright%
\ under a summation sign can always be abbreviated as \textquotedblleft%
$T\subseteq S$\textquotedblright). Renaming the summation index $w$ as $k$ on
the right hand side, we can further rewrite this as%
\begin{equation}
\sum_{T\subseteq S}\left\vert T\right\vert =\sum_{k\in\left\{  0,1,\ldots
,n\right\}  }\ \ \sum_{\substack{T\subseteq S;\\f\left(  T\right)
=k}}\left\vert T\right\vert . \label{sol.sum.fubini-exam1.2nd.1}%
\end{equation}
The left hand side of this equality is the sum we want to find; let us get a
better understanding of the right hand side.

Let $k\in\left\{  0,1,\ldots,n\right\}  $. The definition of $f$ shows that
$f\left(  T\right)  =\left\vert T\right\vert $ for each subset $T$ of $S$.
Hence,%
\begin{align}
\sum_{\substack{T\subseteq S;\\f\left(  T\right)  =k}}\left\vert T\right\vert
&  =\sum_{\substack{T\subseteq S;\\\left\vert T\right\vert =k}%
}\underbrace{\left\vert T\right\vert }_{=k}=\sum_{\substack{T\subseteq
S;\\\left\vert T\right\vert =k}}k=\sum_{T\in\left\{  k\text{-element subsets
of }S\right\}  }k\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since the subsets }T\text{ of }S\text{ satisfying }\left\vert
T\right\vert =k\\
\text{are precisely the }k\text{-element subsets of }S
\end{array}
\right) \nonumber\\
&  =\underbrace{\left\vert \left\{  k\text{-element subsets of }S\right\}
\right\vert }_{\substack{=\left(  \text{\# of }k\text{-element subsets of
}S\right)  \\=\dbinom{n}{k}\\\text{(by Theorem \ref{thm.binom.comb})}}%
}\cdot\,k\ \ \ \ \ \ \ \ \ \ \left(  \text{by an application of
(\ref{eq.sum.equal})}\right) \nonumber\\
&  =\dbinom{n}{k}\cdot k=k\dbinom{n}{k}. \label{sol.sum.fubini-exam1.2nd.2}%
\end{align}
Forget that we fixed $k$. We thus have proven
(\ref{sol.sum.fubini-exam1.2nd.2}) for each $k\in\left\{  0,1,\ldots
,n\right\}  $. Hence, (\ref{sol.sum.fubini-exam1.2nd.1}) becomes%
\[
\sum_{T\subseteq S}\left\vert T\right\vert =\sum_{k\in\left\{  0,1,\ldots
,n\right\}  }\ \ \underbrace{\sum_{\substack{T\subseteq S;\\f\left(  T\right)
=k}}\left\vert T\right\vert }_{\substack{=k\dbinom{n}{k}\\\text{(by
(\ref{sol.sum.fubini-exam1.2nd.2}))}}}=\sum_{k\in\left\{  0,1,\ldots
,n\right\}  }k\dbinom{n}{k}=\sum_{k=0}^{n}k\dbinom{n}{k}.
\]
Thus we have solved Exercise \ref{exe.sum.fubini-exam1} again.
\end{proof}

The solution we just gave illustrates another method of dealing with sums:
namely, by splitting them into batches using (\ref{eq.sum.sheph}). (We chose
the batches in such a way that all addends in any given batch are equal, which
means that the sum of the batch simplifies to a product: $\sum
_{\substack{T\subseteq S;\\\left\vert T\right\vert =k}}k=\left\vert \left\{
k\text{-element subsets of }S\right\}  \right\vert \cdot k$. This is not the
only strategy to split a sum, but it is one of the simplest strategies.) In
the future, we will not explicitly mention the formula (\ref{eq.sum.sheph})
(let alone explain how exactly it is being applied) when we perform such a
splitting; we will simply say that we are \textquotedblleft splitting the sum
$\sum_{T\subseteq S}\left\vert T\right\vert $ according to the value of
$\left\vert T\right\vert $\textquotedblright. Thus, our Second solution to
Exercise \ref{exe.sum.fubini-exam1} takes the following short form:

\begin{proof}
[Second solution to Exercise \ref{exe.sum.fubini-exam1} (short version).]If
$T$ is any subset of $S$, then $\left\vert T\right\vert \in\left\{
0,1,\ldots,n\right\}  $\ \ \ \ \footnote{because Theorem \ref{thm.subset-leq}
\textbf{(b)} (applied to $A=S$ and $B=T$) yields $\left\vert T\right\vert
\leq\left\vert S\right\vert =n$ (since $S$ is an $n$-element set)}. Hence, we
can split the sum $\sum_{T\subseteq S}\left\vert T\right\vert $ according to
the value of $\left\vert T\right\vert $ as follows:%
\begin{equation}
\sum_{T\subseteq S}\left\vert T\right\vert =\sum_{k\in\left\{  0,1,\ldots
,n\right\}  }\ \ \sum_{\substack{T\subseteq S;\\\left\vert T\right\vert
=k}}\left\vert T\right\vert . \label{sol.sum.fubini-exam1.2nd.sh1}%
\end{equation}
However, for each $k\in\left\{  0,1,\ldots,n\right\}  $, we have%
\begin{equation}
\sum_{\substack{T\subseteq S;\\\left\vert T\right\vert =k}%
}\underbrace{\left\vert T\right\vert }_{=k}=\sum_{\substack{T\subseteq
S;\\\left\vert T\right\vert =k}}k=\underbrace{\left(  \text{\# of all
}T\subseteq S\text{ satisfying }\left\vert T\right\vert =k\right)
}_{\substack{=\left(  \text{\# of }k\text{-element subsets of }S\right)
\\=\dbinom{n}{k}\\\text{(by Theorem \ref{thm.binom.comb})}}}\cdot\,
k=\dbinom{n}{k}\cdot k=k\dbinom{n}{k}.\nonumber
\end{equation}
Hence, (\ref{sol.sum.fubini-exam1.2nd.sh1}) becomes%
\[
\sum_{T\subseteq S}\left\vert T\right\vert =\sum_{k\in\left\{  0,1,\ldots
,n\right\}  }\ \ \underbrace{\sum_{\substack{T\subseteq S;\\\left\vert
T\right\vert =k}}\left\vert T\right\vert }_{=k\dbinom{n}{k}}=\sum
_{k\in\left\{  0,1,\ldots,n\right\}  }k\dbinom{n}{k}=\sum_{k=0}^{n}k\dbinom
{n}{k}.
\]
Thus we have solved Exercise \ref{exe.sum.fubini-exam1} again.
\end{proof}

Now, by comparing the results of the two solutions of Exercise
\ref{exe.sum.fubini-exam1}, we get the following identity for free:

\begin{corollary}
\label{cor.sum.fubini-exam1.cor}Let $n\in\mathbb{N}$. Then,%
\[
\sum_{k=0}^{n}k\dbinom{n}{k}=n\cdot2^{n-1}.
\]

\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.sum.fubini-exam1.cor}.]Let $S=\left[  n\right]
$. Then, $S$ is an $n$-element set.

In the first solution to Exercise \ref{exe.sum.fubini-exam1}, we have shown
that%
\[
\sum_{T\subseteq S}\left\vert T\right\vert =n\cdot2^{n-1}.
\]
In the second solution to Exercise \ref{exe.sum.fubini-exam1}, we have shown
that%
\[
\sum_{T\subseteq S}\left\vert T\right\vert =\sum_{k=0}^{n}k\dbinom{n}{k}.
\]
Comparing these two equalities, we obtain $\sum_{k=0}^{n}k\dbinom{n}{k}%
=n\cdot2^{n-1}$. This proves Corollary \ref{cor.sum.fubini-exam1.cor}.
\end{proof}

There are easier ways to prove Corollary \ref{cor.sum.fubini-exam1.cor} as
well; in particularly, it can be proven purely algebraically using Proposition
\ref{prop.binom.X-1} and Corollary \ref{cor.binom.2pown} (exercise!).

\subsubsection{The Fubini principle with a predicate}

Theorem \ref{thm.fubini} is a useful tool for interchanging summation signs
that are independent of one another -- i.e., the indexing set of the inner
summation sign must not depend on the summation index of the other. Thus, for
example, we can use Theorem \ref{thm.fubini} to interchange the two summation
signs in $\sum_{x=1}^{5}\ \ \sum_{y=1}^{6}$, but not in $\sum_{x=1}%
^{5}\ \ \sum_{y=1}^{x}$. Nevertheless, in the latter situation, we would still
like to bring the $y$ \textquotedblleft out\textquotedblright, i.e., to
transform $\sum_{x=1}^{5}\ \ \sum_{y=1}^{x}$ into $\sum_{x=?}^{?}%
\ \ \sum_{y=?}^{?}$ for some values of the question marks. There is a
Fubini-like rule for this, which we will see soon (Corollary
\ref{cor.fubini.tri2}). (The answer is: $\sum_{x=1}^{5}\ \ \sum_{y=1}^{x}$
transforms into $\sum_{y=1}^{5}\ \ \sum_{x=y}^{5}$.)

First, let us state the most general version of this rule, which is a
generalization of Fubini's principle to tables that have \textquotedblleft
gaps\textquotedblright:

\begin{theorem}
[Finite Fubini's principle with a predicate]\label{thm.fubini.pred}Let $X$ and
$Y$ be two finite sets. For each pair $\left(  x,y\right)  \in X\times Y$, let
$\mathcal{A}\left(  x,y\right)  $ be some statement (for example,
\textquotedblleft$x+y$ is even\textquotedblright\ or \textquotedblleft%
$x<y$\textquotedblright, if $X$ and $Y$ are sets of numbers). For each pair
$\left(  x,y\right)  \in X\times Y$ satisfying $\mathcal{A}\left(  x,y\right)
$, let $a_{\left(  x,y\right)  }$ be a number. Then,%
\begin{equation}
\sum_{x\in X}\ \ \sum_{\substack{y\in Y;\\\mathcal{A}\left(  x,y\right)
}}a_{\left(  x,y\right)  }=\sum_{\substack{\left(  x,y\right)  \in X\times
Y;\\\mathcal{A}\left(  x,y\right)  }}a_{\left(  x,y\right)  }=\sum_{y\in
Y}\ \ \sum_{\substack{x\in X;\\\mathcal{A}\left(  x,y\right)  }}a_{\left(
x,y\right)  }. \label{eq.sum.fubini.pred}%
\end{equation}
(Here, the \textquotedblleft$\mathcal{A}\left(  x,y\right)  $%
\textquotedblright\ under the summation signs means \textquotedblleft%
$\mathcal{A}\left(  x,y\right)  $ is true\textquotedblright.)
\end{theorem}

For example, if $n,m\in\mathbb{N}$, and if $a_{\left(  x,y\right)  }$ is a
number for each pair $\left(  x,y\right)  \in\left[  n\right]  \times\left[
m\right]  $, then Theorem \ref{thm.fubini.pred} (applied to $X=\left[
n\right]  $ and $Y=\left[  m\right]  $ and $\mathcal{A}\left(  x,y\right)
=\left(  \text{\textquotedblleft}x+y\text{ is even\textquotedblright}\right)
$) shows that%
\[
\sum_{x\in\left[  n\right]  }\ \ \sum_{\substack{y\in\left[  m\right]
;\\x+y\text{ is even}}}a_{\left(  x,y\right)  }=\sum_{\substack{\left(
x,y\right)  \in\left[  n\right]  \times\left[  m\right]  ;\\x+y\text{ is
even}}}a_{\left(  x,y\right)  }=\sum_{y\in\left[  m\right]  }\ \ \sum
_{\substack{x\in\left[  n\right]  ;\\x+y\text{ is even}}}a_{\left(
x,y\right)  }.
\]


The idea behind Theorem \ref{thm.fubini.pred} is the same as the one behind
Theorem \ref{thm.fubini}: We have a table of numbers, and we can add up the
numbers in this table in three different ways (row by row, in a random order,
or column by column). The difference is that this time, the table can have
empty cells (more precisely, only the cells $\left(  x,y\right)  $ for which
$\mathcal{A}\left(  x,y\right)  $ is true have a number in them); of course,
these empty cells don't contribute to the sums.\footnote{We remark that
Theorem \ref{thm.fubini.pred} can easily be derived from Theorem
\ref{thm.fubini}. Indeed, if we define the (hitherto undefined) number
$a_{\left(  x,y\right)  }$ to be $0$ whenever $\left(  x,y\right)  \in X\times
Y$ does \textbf{not} satisfy $\mathcal{A}\left(  x,y\right)  $, then we can
apply Theorem \ref{thm.fubini}, and the equality (\ref{eq.sum.fubini}) we
obtain quickly rewrites as (\ref{eq.sum.fubini.pred}).}

The formula (\ref{eq.sum.fubini.pred}) allows us to replace a sequence
\textquotedblleft$\sum_{x\in X}\ \ \sum_{\substack{y\in Y;\\\mathcal{A}\left(
x,y\right)  }}$\textquotedblright\ of summation signs by \textquotedblleft%
$\sum_{y\in Y}\ \ \sum_{\substack{x\in X;\\\mathcal{A}\left(  x,y\right)  }%
}$\textquotedblright. This is still considered to be an interchange of
summations -- with the only caveat that the statement $\mathcal{A}\left(
x,y\right)  $ has to stay put under the inner sum, whatever this inner sum is.

By choosing appropriate statements $\mathcal{A}\left(  x,y\right)  $ in
Theorem \ref{thm.fubini.pred}, we can obtain various templates for interchange
of non-independent summation signs. Here is one such template:

\begin{corollary}
[Triangular Fubini's principle I]\label{cor.fubini.tri1}Let $n\in\mathbb{N}$.
For each pair $\left(  x,y\right)  \in\left[  n\right]  \times\left[
n\right]  $ with $x+y\leq n$, let $a_{\left(  x,y\right)  }$ be a number.
Then,%
\[
\sum_{x=1}^{n}\ \ \sum_{y=1}^{n-x}a_{\left(  x,y\right)  }=\sum
_{\substack{\left(  x,y\right)  \in\left[  n\right]  \times\left[  n\right]
;\\x+y\leq n}}a_{\left(  x,y\right)  }=\sum_{y=1}^{n}\ \ \sum_{x=1}%
^{n-y}a_{\left(  x,y\right)  }.
\]

\end{corollary}

\begin{example}
If we set $n=4$ in Corollary \ref{cor.fubini.tri1} and rewrite the result
without using summation signs, then we obtain%
\begin{align*}
&  \left(  a_{\left(  1,1\right)  }+a_{\left(  1,2\right)  }+a_{\left(
1,3\right)  }\right)  +\left(  a_{\left(  2,1\right)  }+a_{\left(  2,2\right)
}\right)  +a_{\left(  3,1\right)  }+\left(  \text{empty sum}\right) \\
&  =a_{\left(  1,1\right)  }+a_{\left(  1,2\right)  }+\cdots+a_{\left(
3,1\right)  }\ \ \ \ \ \ \ \ \ \ \left(  \text{this is the sum of all the
numbers }a_{\left(  x,y\right)  }\right) \\
&  =\left(  a_{\left(  1,1\right)  }+a_{\left(  2,1\right)  }+a_{\left(
3,1\right)  }\right)  +\left(  a_{\left(  1,2\right)  }+a_{\left(  2,2\right)
}\right)  +a_{\left(  1,3\right)  }+\left(  \text{empty sum}\right)  .
\end{align*}
In other words, if we are given a triangular table of numbers:%
\[%
\begin{tabular}
[c]{|ccc}\hline
$a_{\left(  1,1\right)  }$ & $a_{\left(  1,2\right)  }$ &
\multicolumn{1}{c|}{$a_{\left(  1,3\right)  }$}\\\cline{3-3}%
$a_{\left(  2,1\right)  }$ & $a_{\left(  2,2\right)  }$ &
\multicolumn{1}{|c}{}\\\cline{2-2}%
$a_{\left(  3,1\right)  }$ & \multicolumn{1}{|c}{} & \\\cline{1-1}%
\end{tabular}
\ \ \ ,
\]
then the following three procedures all produce the same result:

\begin{itemize}
\item[\textbf{(a)}] summing up the numbers in each row of the table
separately, and then summing up these \textquotedblleft row
tallies\textquotedblright;

\item[\textbf{(b)}] summing up all the $6$ numbers in the table;

\item[\textbf{(c)}] summing up the numbers in each column of the table
separately, and then summing up these \textquotedblleft column
tallies\textquotedblright.
\end{itemize}
\end{example}

\begin{fineprint}


\begin{proof}
[Proof of Corollary \ref{cor.fubini.tri1}.]Theorem \ref{thm.fubini.pred}
(applied to $X=\left[  n\right]  $, $Y=\left[  n\right]  $ and $\mathcal{A}%
\left(  x,y\right)  =\left(  \text{\textquotedblleft}x+y\leq
n\text{\textquotedblright}\right)  $) yields%
\begin{equation}
\sum_{x\in\left[  n\right]  }\ \ \sum_{\substack{y\in\left[  n\right]
;\\x+y\leq n}}a_{\left(  x,y\right)  }=\sum_{\substack{\left(  x,y\right)
\in\left[  n\right]  \times\left[  n\right]  ;\\x+y\leq n}}a_{\left(
x,y\right)  }=\sum_{y\in\left[  n\right]  }\ \ \sum_{\substack{x\in\left[
n\right]  ;\\x+y\leq n}}a_{\left(  x,y\right)  }. \label{pf.cor.fubini.tri1.1}%
\end{equation}
We shall now rewrite the two inner sums in this chain of equalities.

Let $x\in\left[  n\right]  $. Then, $x\geq1\geq0$, so that $n-x\leq n$. Thus,
$\left[  n-x\right]  \subseteq\left[  n\right]  $, so that $\left[
n-x\right]  \cap\left[  n\right]  =\left[  n-x\right]  $. Hence, the elements
$y\in\left[  n\right]  $ that satisfy $y\leq n-x$ are precisely the elements
of $\left[  n-x\right]  $ (indeed, they are clearly the elements of $\left[
n-x\right]  \cap\left[  n\right]  $; but we just showed that $\left[
n-x\right]  \cap\left[  n\right]  =\left[  n-x\right]  $).

However, the statement \textquotedblleft$x+y\leq n$\textquotedblright\ for an
integer $y$ is equivalent to \textquotedblleft$y\leq n-x$\textquotedblright,
and thus can be replaced by the latter statement whenever it appears under a
summation sign. Thus,%
\begin{align}
\sum_{\substack{y\in\left[  n\right]  ;\\x+y\leq n}}a_{\left(  x,y\right)  }
&  =\sum_{\substack{y\in\left[  n\right]  ;\\y\leq n-x}}a_{\left(  x,y\right)
}\nonumber\\
&  =\sum_{y\in\left[  n-x\right]  }a_{\left(  x,y\right)  }%
\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since the elements }y\in\left[  n\right]  \text{ that satisfy }y\leq
n-x\\
\text{are precisely the elements of }\left[  n-x\right]
\end{array}
\right) \nonumber\\
&  =\sum_{y=1}^{n-x}a_{\left(  x,y\right)  }. \label{pf.cor.fubini.tri1.2}%
\end{align}


Forget that we fixed $x$. We thus have proved (\ref{pf.cor.fubini.tri1.2}) for
each $x\in\left[  n\right]  $. Likewise, we can prove that%
\begin{equation}
\sum_{\substack{x\in\left[  n\right]  ;\\x+y\leq n}}a_{\left(  x,y\right)
}=\sum_{x=1}^{n-y}a_{\left(  x,y\right)  } \label{pf.cor.fubini.tri1.3}%
\end{equation}
for each $y\in\left[  n\right]  $. In light of the two equalities
(\ref{pf.cor.fubini.tri1.2}) and (\ref{pf.cor.fubini.tri1.3}), we can rewrite
the chain of equalities (\ref{pf.cor.fubini.tri1.1}) as follows:%
\[
\sum_{x\in\left[  n\right]  }\ \ \sum_{y=1}^{n-x}a_{\left(  x,y\right)  }%
=\sum_{\substack{\left(  x,y\right)  \in\left[  n\right]  \times\left[
n\right]  ;\\x+y\leq n}}a_{\left(  x,y\right)  }=\sum_{y\in\left[  n\right]
}\ \ \sum_{x=1}^{n-y}a_{\left(  x,y\right)  }.
\]
In other words,%
\[
\sum_{x=1}^{n}\ \ \sum_{y=1}^{n-x}a_{\left(  x,y\right)  }=\sum
_{\substack{\left(  x,y\right)  \in\left[  n\right]  \times\left[  n\right]
;\\x+y\leq n}}a_{\left(  x,y\right)  }=\sum_{y=1}^{n}\ \ \sum_{x=1}%
^{n-y}a_{\left(  x,y\right)  }%
\]
(since the summation sign $\sum_{x\in\left[  n\right]  }$ is synonymous to
$\sum_{x=1}^{n}$, whereas the summation sign $\sum_{y\in\left[  n\right]  }$
is synonymous to $\sum_{y=1}^{n}$). This proves Corollary
\ref{cor.fubini.tri1}.
\end{proof}
\end{fineprint}

Let us apply Corollary \ref{cor.fubini.tri1} to solving an exercise (arguably,
one that could be more easily solved by other means, but this does not
preclude it from being a useful illustration):

\begin{exercise}
\label{exe.fubini.tri1-app1}Let $n\in\mathbb{N}$. Prove that%
\[
\sum_{k=1}^{n}k\left(  n-k\right)  =\dbinom{n+1}{3}.
\]

\end{exercise}

\begin{proof}
[Solution to Exercise \ref{exe.fubini.tri1-app1}.]For each $x\in\left[
n\right]  $, we have $n-x\in\mathbb{N}$ (since $x\in\left[  n\right]  $
entails $x\leq n$ and thus $n-x\geq0$), so that%
\begin{equation}
\sum_{y=1}^{n-x}1=\left(  n-x\right)  \cdot1=n-x.
\label{sol.fubini.tri1-app1.1}%
\end{equation}


Renaming the index $k$ as $x$ in the sum $\sum_{k=1}^{n}k\left(  n-k\right)
$, we obtain%
\begin{align}
\sum_{k=1}^{n}k\left(  n-k\right)   &  =\sum_{x=1}^{n}x\underbrace{\left(
n-x\right)  }_{\substack{=\sum_{y=1}^{n-x}1\\\text{(by
(\ref{sol.fubini.tri1-app1.1}))}}}=\sum_{x=1}^{n}\underbrace{x\sum_{y=1}%
^{n-x}1}_{\substack{=\sum_{y=1}^{n-x}x\cdot1\\\text{(by (\ref{eq.sum.linear2}%
))}}}\nonumber\\
&  =\sum_{x=1}^{n}\ \ \sum_{y=1}^{n-x}\underbrace{x\cdot1}_{=x}=\sum_{x=1}%
^{n}\ \ \sum_{y=1}^{n-x}x. \label{sol.fubini.tri1-app1.2}%
\end{align}
But Corollary \ref{cor.fubini.tri1} (applied to $a_{\left(  x,y\right)  }=x$)
yields%
\begin{equation}
\sum_{x=1}^{n}\ \ \sum_{y=1}^{n-x}x=\sum_{\substack{\left(  x,y\right)
\in\left[  n\right]  \times\left[  n\right]  ;\\x+y\leq n}}x=\sum_{y=1}%
^{n}\ \ \sum_{x=1}^{n-y}x. \label{sol.fubini.tri1-app1.3}%
\end{equation}
Furthermore, each $y\in\left[  n\right]  $ satisfies $n-y\in\mathbb{N}$ (since
$y\in\left[  n\right]  $ entails $y\leq n$ and thus $n-y\geq0$), so that%
\begin{align}
\sum_{x=1}^{n-y}x  &  =1+2+\cdots+\left(  n-y\right)  =\dfrac{\left(
n-y\right)  \left(  \left(  n-y\right)  +1\right)  }{2}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem
\ref{thm.1.10}, applied to }n-y\text{ instead of }n\right) \nonumber\\
&  =\dfrac{\left(  n+1-y\right)  \left(  n-y\right)  }{2}=\dbinom{n+1-y}{2}
\label{sol.fubini.tri1-app1.4}%
\end{align}
(since (\ref{eq.exa.binom.small.nC2}) (applied to $n+1-y$ instead of $n$)
yields
\[
\dbinom{n+1-y}{2}=\dfrac{\left(  n+1-y\right)  \left(  \left(  n+1-y\right)
-1\right)  }{2}=\dfrac{\left(  n+1-y\right)  \left(  n-y\right)  }{2}%
\]
). Hence, (\ref{sol.fubini.tri1-app1.2}) becomes%
\begin{align*}
\sum_{k=1}^{n}k\left(  n-k\right)   &  =\sum_{x=1}^{n}\ \ \sum_{y=1}%
^{n-x}x=\sum_{y=1}^{n}\ \ \underbrace{\sum_{x=1}^{n-y}x}_{\substack{=\dbinom
{n+1-y}{2}\\\text{(by (\ref{sol.fubini.tri1-app1.4}))}}%
}\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{sol.fubini.tri1-app1.3})}\right)
\\
&  =\sum_{y=1}^{n}\dbinom{n+1-y}{2}=\sum_{i=1}^{n}\dbinom{i}{2}\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have substituted }i\text{ for }n+1-y\text{ in the sum}\\
\text{(since the map }\left[  n\right]  \rightarrow\left[  n\right]
,\ y\mapsto n+1-y\text{ is a bijection)}%
\end{array}
\right) \\
&  =\dbinom{1}{2}+\dbinom{2}{2}+\cdots+\dbinom{n}{2}\\
&  =\underbrace{\left(  \dbinom{0}{2}+\dbinom{1}{2}+\dbinom{2}{2}%
+\cdots+\dbinom{n}{2}\right)  }_{\substack{=\dbinom{n+1}{2+1}\\\text{(by
Theorem \ref{thm.binom.hock}, applied to }k=2\text{)}}}-\underbrace{\dbinom
{0}{2}}_{\substack{=\dfrac{0\left(  0-1\right)  }{2}\\\text{(by
(\ref{eq.exa.binom.small.nC2}))}}}\\
&  =\dbinom{n+1}{2+1}-\underbrace{\dfrac{0\left(  0-1\right)  }{2}}%
_{=0}=\dbinom{n+1}{2+1}=\dbinom{n+1}{3}.
\end{align*}
This solves Exercise \ref{exe.fubini.tri1-app1}.
\end{proof}

In the future, of course, we won't be as detailed as in the solution we just
gave; instead of explicitly invoking Corollary \ref{cor.fubini.tri1}, we will
simply write the following:%
\[
\underbrace{\sum_{x=1}^{n}\ \ \sum_{y=1}^{n-x}}_{=\sum_{y=1}^{n}\ \ \sum
_{x=1}^{n-y}}x=\sum_{y=1}^{n}\ \ \sum_{x=1}^{n-y}x.
\]


Here is another template for interchanging summation signs:

\begin{corollary}
[Triangular Fubini's principle II]\label{cor.fubini.tri2}Let $n\in\mathbb{N}$.
For each pair $\left(  x,y\right)  \in\left[  n\right]  \times\left[
n\right]  $ with $x\leq y$, let $a_{\left(  x,y\right)  }$ be a number. Then,%
\[
\sum_{x=1}^{n}\ \ \sum_{y=x}^{n}a_{\left(  x,y\right)  }=\sum
_{\substack{\left(  x,y\right)  \in\left[  n\right]  \times\left[  n\right]
;\\x\leq y}}a_{\left(  x,y\right)  }=\sum_{y=1}^{n}\ \ \sum_{x=1}%
^{y}a_{\left(  x,y\right)  }.
\]

\end{corollary}

\begin{example}
If we set $n=4$ in Corollary \ref{cor.fubini.tri2} and rewrite the result
without using summation signs, then we obtain%
\begin{align*}
&  \left(  a_{\left(  1,1\right)  }+a_{\left(  1,2\right)  }+a_{\left(
1,3\right)  }+a_{\left(  1,4\right)  }\right) \\
&  \ \ \ \ \ \ \ \ \ \ +\left(  a_{\left(  2,2\right)  }+a_{\left(
2,3\right)  }+a_{\left(  2,4\right)  }\right) \\
&  \ \ \ \ \ \ \ \ \ \ +\left(  a_{\left(  3,3\right)  }+a_{\left(
3,4\right)  }\right) \\
&  \ \ \ \ \ \ \ \ \ \ +a_{\left(  4,4\right)  }\\
&  =a_{\left(  1,1\right)  }+a_{\left(  1,2\right)  }+\cdots+a_{\left(
4,4\right)  }\ \ \ \ \ \ \ \ \ \ \left(  \text{this is the sum of all the
numbers }a_{\left(  x,y\right)  }\right) \\
&  =a_{\left(  1,1\right)  }\\
&  \ \ \ \ \ \ \ \ \ \ +\left(  a_{\left(  1,2\right)  }+a_{\left(
2,2\right)  }\right) \\
&  \ \ \ \ \ \ \ \ \ \ +\left(  a_{\left(  1,3\right)  }+a_{\left(
2,3\right)  }+a_{\left(  3,3\right)  }\right) \\
&  \ \ \ \ \ \ \ \ \ \ +\left(  a_{\left(  1,4\right)  }+a_{\left(
2,4\right)  }+a_{\left(  3,4\right)  }+a_{\left(  4,4\right)  }\right)  .
\end{align*}
In other words, if we are given a triangular table of numbers:%
\[%
\begin{tabular}
[c]{cccc|}\hline
\multicolumn{1}{|c}{$a_{\left(  1,1\right)  }$} & $a_{\left(  1,2\right)  }$ &
$a_{\left(  1,3\right)  }$ & $a_{\left(  1,4\right)  }$\\\cline{1-1}
& \multicolumn{1}{|c}{$a_{\left(  2,2\right)  }$} & $a_{\left(  2,3\right)  }$
& $a_{\left(  2,4\right)  }$\\\cline{2-2}
&  & \multicolumn{1}{|c}{$a_{\left(  3,3\right)  }$} & $a_{\left(  3,4\right)
}$\\\cline{3-3}
&  &  & \multicolumn{1}{|c|}{$a_{\left(  4,4\right)  }$}\\\cline{4-4}%
\end{tabular}
\ \ \ ,
\]
then the following three procedures all produce the same result:

\begin{itemize}
\item[\textbf{(a)}] summing up the numbers in each row of the table
separately, and then summing up these \textquotedblleft row
tallies\textquotedblright;

\item[\textbf{(b)}] summing up all the $10$ numbers in the table;

\item[\textbf{(c)}] summing up the numbers in each column of the table
separately, and then summing up these \textquotedblleft column
tallies\textquotedblright.
\end{itemize}
\end{example}

\begin{fineprint}


\begin{proof}
[Proof of Corollary \ref{cor.fubini.tri2}.]This is similar to the proof of
Corollary \ref{cor.fubini.tri1}; we just need to define the statements
$\mathcal{A}\left(  x,y\right)  $ differently. Theorem \ref{thm.fubini.pred}
(applied to $X=\left[  n\right]  $, $Y=\left[  n\right]  $ and $\mathcal{A}%
\left(  x,y\right)  =\left(  \text{\textquotedblleft}x\leq
y\text{\textquotedblright}\right)  $) yields%
\begin{equation}
\sum_{x\in\left[  n\right]  }\ \ \sum_{\substack{y\in\left[  n\right]
;\\x\leq y}}a_{\left(  x,y\right)  }=\sum_{\substack{\left(  x,y\right)
\in\left[  n\right]  \times\left[  n\right]  ;\\x\leq y}}a_{\left(
x,y\right)  }=\sum_{y\in\left[  n\right]  }\ \ \sum_{\substack{x\in\left[
n\right]  ;\\x\leq y}}a_{\left(  x,y\right)  }. \label{pf.cor.fubini.tri2.1}%
\end{equation}
We shall now rewrite the two inner sums in this chain of equalities.

Let $x\in\left[  n\right]  $. Then, $1\leq x\leq n$. Hence, the elements
$y\in\left[  n\right]  $ that satisfy $x\leq y$ are precisely the elements of
$\left\{  x,x+1,\ldots,n\right\}  $. Thus,%
\begin{equation}
\sum_{\substack{y\in\left[  n\right]  ;\\x\leq y}}a_{\left(  x,y\right)
}=\sum_{y\in\left\{  x,x+1,\ldots,n\right\}  }a_{\left(  x,y\right)  }%
=\sum_{y=x}^{n}a_{\left(  x,y\right)  }. \label{pf.cor.fubini.tri2.2}%
\end{equation}


Forget that we fixed $x$. We thus have proved (\ref{pf.cor.fubini.tri2.2}) for
each $x\in\left[  n\right]  $.

Next, let $y\in\left[  n\right]  $. Then, $1\leq y\leq n$. Hence, the elements
$x\in\left[  n\right]  $ that satisfy $x\leq y$ are precisely the elements of
$\left\{  1,2,\ldots,y\right\}  $. Thus,%
\begin{equation}
\sum_{\substack{x\in\left[  n\right]  ;\\x\leq y}}a_{\left(  x,y\right)
}=\sum_{x\in\left\{  1,2,\ldots,y\right\}  }a_{\left(  x,y\right)  }%
=\sum_{x=1}^{y}a_{\left(  x,y\right)  }. \label{pf.cor.fubini.tri2.3}%
\end{equation}


Forget that we fixed $y$. We thus have proved (\ref{pf.cor.fubini.tri2.3}) for
each $y\in\left[  n\right]  $.

In light of the two equalities (\ref{pf.cor.fubini.tri2.2}) and
(\ref{pf.cor.fubini.tri2.3}), we can rewrite the chain of equalities
(\ref{pf.cor.fubini.tri2.1}) as follows:%
\[
\sum_{x\in\left[  n\right]  }\ \ \sum_{y=x}^{n}a_{\left(  x,y\right)  }%
=\sum_{\substack{\left(  x,y\right)  \in\left[  n\right]  \times\left[
n\right]  ;\\x\leq y}}a_{\left(  x,y\right)  }=\sum_{y\in\left[  n\right]
}\ \ \sum_{x=1}^{y}a_{\left(  x,y\right)  }.
\]
In other words,%
\[
\sum_{x=1}^{n}\ \ \sum_{y=x}^{n}a_{\left(  x,y\right)  }=\sum
_{\substack{\left(  x,y\right)  \in\left[  n\right]  \times\left[  n\right]
;\\x\leq y}}a_{\left(  x,y\right)  }=\sum_{y=1}^{n}\ \ \sum_{x=1}%
^{y}a_{\left(  x,y\right)  }%
\]
(since the summation sign $\sum_{x\in\left[  n\right]  }$ is synonymous to
$\sum_{x=1}^{n}$, whereas the summation sign $\sum_{y\in\left[  n\right]  }$
is synonymous to $\sum_{y=1}^{n}$). This proves Corollary
\ref{cor.fubini.tri2}.
\end{proof}
\end{fineprint}

Let us illustrate Corollary \ref{cor.fubini.tri2} on two examples of its use.
The first is an exercise (\cite[Exercise 1]{19f-hw2s}) about harmonic numbers:

\begin{exercise}
\label{exe.harmonic-sum-sum}For each $n\in\mathbb{N}$, we define the
$n$\emph{-th harmonic number }$H_{n}$ by
\[
H_{n}=\dfrac{1}{1}+\dfrac{1}{2}+\cdots+\dfrac{1}{n}=\sum_{k=1}^{n}\dfrac{1}%
{k}.
\]
Prove that
\[
H_{1}+H_{2}+\cdots+H_{n}=\left(  n+1\right)  \left(  H_{n+1}-1\right)
\]
for each $n\in\mathbb{N}$.
\end{exercise}

It is not hard to solve this exercise by induction on $n$ (see \cite[First
solution to Exercise 1]{19f-hw2s}); but here is a different solution, using
Corollary \ref{cor.fubini.tri2}:

\begin{proof}
[Solution to Exercise \ref{exe.harmonic-sum-sum}.]Each $n\in\mathbb{N}$
satisfies
\[
H_{n}=\sum_{k=1}^{n}\dfrac{1}{k}%
\]
(by the definition of $H_{n}$). Renaming $n$ as $m$ in this statement, we
obtain the following: Each $m\in\mathbb{N}$ satisfies%
\begin{equation}
H_{m}=\sum_{k=1}^{m}\dfrac{1}{k}. \label{sol.harmonic-sum-sum.2nd.Hn=}%
\end{equation}


Now, let $n\in\mathbb{N}$. Then,
\begin{equation}
H_{1}+H_{2}+\cdots+H_{n}=\sum_{m=1}^{n}\underbrace{H_{m}}_{\substack{=\sum
_{k=1}^{m}\dfrac{1}{k}\\\text{(by \eqref{sol.harmonic-sum-sum.2nd.Hn=})}%
}}=\sum_{m=1}^{n}\ \ \sum_{k=1}^{m}\dfrac{1}{k}.
\label{sol.harmonic-sum-sum.2nd.2}%
\end{equation}
Now, Corollary \ref{cor.fubini.tri2} (applied to $a_{\left(  x,y\right)
}=\dfrac{1}{x}$) yields%
\[
\sum_{x=1}^{n}\ \ \sum_{y=x}^{n}\dfrac{1}{x}=\sum_{\substack{\left(
x,y\right)  \in\left[  n\right]  \times\left[  n\right]  ;\\x\leq y}}\dfrac
{1}{x}=\sum_{y=1}^{n}\ \ \sum_{x=1}^{y}\dfrac{1}{x}.
\]
Renaming the summation indices $x$ and $y$ as $k$ and $m$ in this equality, we
obtain%
\[
\sum_{k=1}^{n}\ \ \sum_{m=k}^{n}\dfrac{1}{k}=\sum_{\substack{\left(
k,m\right)  \in\left[  n\right]  \times\left[  n\right]  ;\\k\leq m}}\dfrac
{1}{k}=\sum_{m=1}^{n}\ \ \sum_{k=1}^{m}\dfrac{1}{k}.
\]
Comparing this with (\ref{sol.harmonic-sum-sum.2nd.2}), we obtain
\[
H_{1}+H_{2}+\cdots+H_{n}=\sum_{k=1}^{n}\underbrace{\sum_{m=k}^{n}\dfrac{1}{k}%
}_{\substack{=\left(  n-k+1\right)  \cdot\dfrac{1}{k}\\\text{(since this is a
sum of }n-k+1\\\text{ many equal addends)}}}=\sum_{k=1}^{n}\left(
n-k+1\right)  \cdot\dfrac{1}{k}.
\]
Comparing this with
\begin{align*}
&  \left(  n+1\right)  \left(  H_{n+1}-1\right) \\
&  =\left(  n+1\right)  \underbrace{H_{n+1}}_{\substack{=\sum_{k=1}%
^{n+1}\dfrac{1}{k}\\\text{(by \eqref{sol.harmonic-sum-sum.2nd.Hn=}, applied to
}m=n+1\text{)}}}-\underbrace{\left(  n+1\right)  }_{\substack{=\sum
_{k=1}^{n+1}1\\\text{(since $\sum_{k=1}^{n+1}1=\left(  n+1\right)  \cdot
1=n+1$)}}}\\
&  =\left(  n+1\right)  \sum_{k=1}^{n+1}\dfrac{1}{k}-\sum_{k=1}^{n+1}%
1=\sum_{k=1}^{n+1}\underbrace{\left(  \left(  n+1\right)  \cdot\dfrac{1}%
{k}-1\right)  }_{\substack{=\left(  n-k+1\right)  \cdot\dfrac{1}{k}}%
}=\sum_{k=1}^{n+1}\left(  n-k+1\right)  \cdot\dfrac{1}{k}\\
&  =\underbrace{\left(  n-\left(  n+1\right)  +1\right)  }_{\substack{=0}%
}\cdot\,\dfrac{1}{n+1}+\sum_{k=1}^{n}\left(  n-k+1\right)  \cdot\dfrac{1}{k}\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have split
off the addend for }k=n+1\text{ from the sum}\right) \\
&  =\sum_{k=1}^{n}\left(  n-k+1\right)  \cdot\dfrac{1}{k},
\end{align*}
we obtain $H_{1}+H_{2}+\cdots+H_{n}=\left(  n+1\right)  \left(  H_{n+1}%
-1\right)  $. This solves Exercise \ref{exe.harmonic-sum-sum}.
\end{proof}

A more intricate application of Corollary \ref{cor.fubini.tri2} is the
following identity for binomial coefficients:

\begin{exercise}
\label{exe.fubini.tri2-app1}Let $n\in\mathbb{N}$. Then,%
\[
\sum_{k=1}^{n}\dfrac{\left(  -1\right)  ^{k-1}}{k}\dbinom{n}{k}=\dfrac{1}%
{1}+\dfrac{1}{2}+\cdots+\dfrac{1}{n}.
\]

\end{exercise}

Exercise \ref{exe.fubini.tri2-app1} is not too hard to solve by induction (see
\cite[Exercise 3.19]{detnotes} for such a solution); but for illustrative
purposes, let me solve it using Corollary \ref{cor.fubini.tri2} here:

\begin{proof}
[Solution to Exercise \ref{exe.fubini.tri2-app1}.]Let $k\in\left[  n\right]
$. Then, $1\leq k\leq n$, so that $k\geq1$ and thus $k-1\in\mathbb{N}$. Note
that $k\geq1$ also entails $k\in\left\{  1,2,3,\ldots\right\}  $. Furthermore,
$n\geq1$ (since $1\leq n$) and thus $n-1\in\mathbb{N}$. Hence, Corollary
\ref{cor.binom.hock2} (applied to $n-1$ and $k-1$ instead of $n$ and $k$)
yields%
\begin{align*}
&  \dbinom{k-1}{k-1}+\dbinom{\left(  k-1\right)  +1}{k-1}+\dbinom{\left(
k-1\right)  +2}{k-1}+\cdots+\dbinom{n-1}{k-1}\\
&  =\dbinom{\left(  n-1\right)  +1}{\left(  k-1\right)  +1}=\dbinom{n}%
{k}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left(  n-1\right)  +1=n\text{ and
}\left(  k-1\right)  +1=k\right)  .
\end{align*}
Hence,%
\begin{align*}
\dbinom{n}{k}  &  =\dbinom{k-1}{k-1}+\dbinom{\left(  k-1\right)  +1}%
{k-1}+\dbinom{\left(  k-1\right)  +2}{k-1}+\cdots+\dbinom{n-1}{k-1}\\
&  =\dbinom{k-1}{k-1}+\dbinom{k}{k-1}+\dbinom{k+1}{k-1}+\cdots+\dbinom
{n-1}{k-1}=\sum_{i=k}^{n}\dbinom{i-1}{k-1}.
\end{align*}
Multiplying both sides of this equality by $\dfrac{\left(  -1\right)  ^{k-1}%
}{k}$, we obtain%
\begin{align}
\dfrac{\left(  -1\right)  ^{k-1}}{k}\dbinom{n}{k}  &  =\dfrac{\left(
-1\right)  ^{k-1}}{k}\sum_{i=k}^{n}\dbinom{i-1}{k-1}\nonumber\\
&  =\sum_{i=k}^{n}\underbrace{\dfrac{\left(  -1\right)  ^{k-1}}{k}%
}_{\substack{=\dfrac{\left(  -1\right)  ^{k-1}}{i}\cdot\dfrac{i}%
{k}\\\text{(since }i\neq0\text{ (because }i\geq k\geq1>0\text{))}}%
}\dbinom{i-1}{k-1}\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{eq.sum.linear2}%
)}\right) \nonumber\\
&  =\sum_{i=k}^{n}\dfrac{\left(  -1\right)  ^{k-1}}{i}\cdot\underbrace{\dfrac
{i}{k}\dbinom{i-1}{k-1}}_{\substack{=\dbinom{i}{k}\\\text{(since Proposition
\ref{prop.binom.X-1}}\\\text{(applied to }i\text{ and }k\text{ instead of
}m\text{ and }n\text{)}\\\text{yields }\dbinom{i}{k}=\dfrac{i}{k}\dbinom
{i-1}{k-1}\text{)}}}\nonumber\\
&  =\sum_{i=k}^{n}\dfrac{\left(  -1\right)  ^{k-1}}{i}\dbinom{i}{k}.
\label{sol.fubini.tri2-app1.1}%
\end{align}


Now forget that we fixed $k$. We thus have proved
(\ref{sol.fubini.tri2-app1.1}) for each $k\in\left[  n\right]  $. Hence,%
\begin{align}
\sum_{k=1}^{n}\underbrace{\dfrac{\left(  -1\right)  ^{k-1}}{k}\dbinom{n}{k}%
}_{\substack{=\sum_{i=k}^{n}\dfrac{\left(  -1\right)  ^{k-1}}{i}\dbinom{i}%
{k}\\\text{(by (\ref{sol.fubini.tri2-app1.1}))}}}  &  =\sum_{k=1}^{n}%
\ \ \sum_{i=k}^{n}\dfrac{\left(  -1\right)  ^{k-1}}{i}\dbinom{i}{k}\nonumber\\
&  =\sum_{i=1}^{n}\ \ \sum_{k=1}^{i}\dfrac{\left(  -1\right)  ^{k-1}}%
{i}\dbinom{i}{k}. \label{sol.fubini.tri2-app1.2}%
\end{align}
Here, the last equality sign has been obtained by applying Corollary
\ref{cor.fubini.tri2} to $a_{\left(  x,y\right)  }=\dfrac{\left(  -1\right)
^{x-1}}{y}\dbinom{y}{x}$ (and then renaming the summation indices $x$ and $y$
as $k$ and $i$).

Now, fix $i\in\left[  n\right]  $. Thus, $1\leq i\leq n$, so that $i\geq1>0$
and therefore $i\neq0$. Hence, $\left[  i=0\right]  =0$. But
(\ref{eq.prop.binom.sum-alt-row.1}) (applied to $i$ instead of $n$) yields%
\[
\sum_{k=0}^{i}\left(  -1\right)  ^{k}\dbinom{i}{k}=\left[  i=0\right]  =0.
\]
Hence,%
\begin{align*}
0  &  =\sum_{k=0}^{i}\left(  -1\right)  ^{k}\dbinom{i}{k}=\underbrace{\left(
-1\right)  ^{0}}_{=1}\underbrace{\dbinom{i}{0}}_{\substack{=1\\\text{(by
(\ref{eq.exa.binom.small.nC0}))}}}+\sum_{k=1}^{i}\left(  -1\right)
^{k}\dbinom{i}{k}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have split off the addend for
}k=0\text{ from the sum}\right) \\
&  =1+\sum_{k=1}^{i}\underbrace{\left(  -1\right)  ^{k}}_{=-\left(  -1\right)
^{k-1}}\dbinom{i}{k}=1+\underbrace{\sum_{k=1}^{i}\left(  -\left(  -1\right)
^{k-1}\right)  \dbinom{i}{k}}_{=-\sum_{k=1}^{i}\left(  -1\right)
^{k-1}\dbinom{i}{k}}\\
&  =1-\sum_{k=1}^{i}\left(  -1\right)  ^{k-1}\dbinom{i}{k}.
\end{align*}
In other words,%
\begin{equation}
\sum_{k=1}^{i}\left(  -1\right)  ^{k-1}\dbinom{i}{k}=1.
\label{sol.fubini.tri2-app1.3}%
\end{equation}


Now, forget that we fixed $i$. We thus have proven
(\ref{sol.fubini.tri2-app1.3}) for each $i\in\left[  n\right]  $. Thus,
(\ref{sol.fubini.tri2-app1.2}) becomes%
\begin{align*}
\sum_{k=1}^{n}\dfrac{\left(  -1\right)  ^{k-1}}{k}\dbinom{n}{k}  &
=\sum_{i=1}^{n}\ \ \sum_{k=1}^{i}\underbrace{\dfrac{\left(  -1\right)  ^{k-1}%
}{i}}_{=\dfrac{1}{i}\cdot\left(  -1\right)  ^{k-1}}\dbinom{i}{k}=\sum
_{i=1}^{n}\ \ \underbrace{\sum_{k=1}^{i}\dfrac{1}{i}\cdot\left(  -1\right)
^{k-1}\dbinom{i}{k}}_{\substack{=\dfrac{1}{i}\sum_{k=1}^{i}\left(  -1\right)
^{k-1}\dbinom{i}{k}\\\text{(by (\ref{eq.sum.linear2}))}}}\\
&  =\sum_{i=1}^{n}\dfrac{1}{i}\underbrace{\sum_{k=1}^{i}\left(  -1\right)
^{k-1}\dbinom{i}{k}}_{\substack{=1\\\text{(by (\ref{sol.fubini.tri2-app1.3}%
))}}}=\sum_{i=1}^{n}\dfrac{1}{i}\cdot1=\sum_{i=1}^{n}\dfrac{1}{i}=\dfrac{1}%
{1}+\dfrac{1}{2}+\cdots+\dfrac{1}{n}.
\end{align*}
This solves Exercise \ref{exe.fubini.tri2-app1}.
\end{proof}

\subsubsection{A cautionary tale about infinite sums}

In Definition \ref{def.sum.infinite}, I claimed that infinite sums (i.e., sums
of the form $\sum_{x\in X}a_{x}$ where the indexing set $X$ is infinite) are
still well-defined as long as they only have finitely many nonzero addends;
moreover, I claimed that they satisfy the same rules as finite sums. This is
true for all the rules listed above (including the Fubini principle in all its
forms) \textbf{as long as} we assume that \textbf{each} of the sums appearing
in the rule has only finitely many nonzero addends. Usually, it suffices to
assume that \textbf{some} of the sums have only finitely many nonzero addends,
and then it follows that so do the others.

Let us illustrate this on the example of (\ref{eq.sum.linear1}). If $S$ is an
arbitrary set (not necessarily finite), and if $a_{s}$ and $b_{s}$ are two
numbers for each $s\in S$, then the equality (\ref{eq.sum.linear1}) holds as
long as we assume that the two sums $\sum_{s\in S}a_{s}$ and $\sum_{s\in
S}b_{s}$ have only finitely many nonzero addends (i.e., there are only
finitely many $s\in S$ satisfying $a_{s}\neq0$, and there are only finitely
many $s\in S$ satisfying $b_{s}\neq0$). We don't need to assume that the sum
$\sum_{s\in S}\left(  a_{s}+b_{s}\right)  $ has only finitely many nonzero
addends, because this follows \textquotedblleft for free\textquotedblright%
\ from the analogous assumptions on the sums $\sum_{s\in S}a_{s}$ and
$\sum_{s\in S}b_{s}$. However, it does not suffice to assume that the sum
$\sum_{s\in S}\left(  a_{s}+b_{s}\right)  $ has only finitely many nonzero
addends, if we don't also make the analogous assumptions on $\sum_{s\in
S}a_{s}$ and $\sum_{s\in S}b_{s}$. For example, if $S$ is an infinite set,
then the following transformation makes no sense:%
\[
\sum_{s\in S}\underbrace{0}_{=1+\left(  -1\right)  }=\sum_{s\in S}\left(
1+\left(  -1\right)  \right)  =\sum_{s\in S}1+\sum_{s\in S}\left(  -1\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{eq.sum.linear1})}\right)  .
\]
The formula (\ref{eq.sum.linear1}) is being misapplied here, since the sums
$\sum_{s\in S}1$ and $\sum_{s\in S}\left(  -1\right)  $ have infinitely many
nonzero addends.

Something similar needs to be taken into account when extending Theorem
\ref{thm.fubini} to infinite sums. It suffices to assume that the sum
$\sum_{\left(  x,y\right)  \in X\times Y}a_{\left(  x,y\right)  }$ has only
finitely many nonzero addends (i.e., that only finitely many pairs $\left(
x,y\right)  \in X\times Y$ satisfy $a_{\left(  x,y\right)  }\neq0$). In other
words, the following analogue of Theorem \ref{thm.fubini} holds for infinite sums:

\begin{theorem}
\label{thm.fubini-inf}Let $X$ and $Y$ be two sets. Let $a_{\left(  x,y\right)
}$ be a number for each pair $\left(  x,y\right)  \in X\times Y$. Assume that
only finitely many pairs $\left(  x,y\right)  \in X\times Y$ satisfy
$a_{\left(  x,y\right)  }\neq0$. Then, we have%
\[
\sum_{x\in X}\ \ \sum_{y\in Y}a_{\left(  x,y\right)  }=\sum_{\left(
x,y\right)  \in X\times Y}a_{\left(  x,y\right)  }=\sum_{y\in Y}\ \ \sum_{x\in
X}a_{\left(  x,y\right)  },
\]
and in particular, each of the five sums in this equality has only finitely
many nonzero addends.
\end{theorem}

See \cite[proof of Proposition 7.2.11 (specifically, the proof of (227))]{19s}
for a rigorous proof of this theorem (but the idea is obvious: reduce it to
the case of finite $X$ and $Y$ by restricting the sums appropriately).

Thus, in order to make Theorem \ref{thm.fubini} work for infinite sums, it
suffices to assume the middle sum $\sum_{\left(  x,y\right)  \in X\times
Y}a_{\left(  x,y\right)  }$ to have only finitely many nonzero addends.
However, it is tempting to think that even if this middle sum has infinitely
many nonzero addends, we may still get the equality $\sum_{x\in X}%
\ \ \sum_{y\in Y}a_{\left(  x,y\right)  }=\sum_{y\in Y}\ \ \sum_{x\in
X}a_{\left(  x,y\right)  }$ as long as all the four sums appearing in this
equality have only finitely many nonzero addends. In other words, it is
tempting to use the following \textquotedblleft fact\textquotedblright:

\begin{statement}
\textbf{Incorrect Fubini rule.} Let $X$ and $Y$ be two sets. Let $a_{\left(
x,y\right)  }$ be a number for each pair $\left(  x,y\right)  \in X\times Y$.
Then,%
\begin{equation}
\sum_{x\in X}\ \ \sum_{y\in Y}a_{\left(  x,y\right)  }=\sum_{y\in Y}%
\ \ \sum_{x\in X}a_{\left(  x,y\right)  }, \label{eq.fubini.false}%
\end{equation}
as long as all four sums appearing in this equality have only finitely many
nonzero addends.
\end{statement}

This, however, is false. Here is a counterexample:\Needspace{6cm}

\begin{example}
[\textquotedblleft the serial debtor\textquotedblright]%
\label{exa.fubini.inf-serial-debtor}Let $X=\left\{  1,2,3,\ldots\right\}  $
and $Y=\left\{  1,2,3,\ldots\right\}  $. Define a number $a_{\left(
x,y\right)  }$ for each pair $\left(  x,y\right)  \in X\times Y$ by setting
\[
a_{\left(  x,y\right)  }=\left[  y=x\right]  -\left[  y=x+1\right]  .
\]
Here is a table showing these numbers:
\begin{equation}%
\begin{tabular}
[c]{|c||c|c|c|c|c|c|}\hline
$a_{\left(  x,y\right)  }$ & $y=1$ & $y=2$ & $y=3$ & $y=4$ & $y=5$ & $\cdots
$\\\hline\hline
$x=1$ & $1$ & $-1$ &  &  &  & $\cdots$\\\hline
$x=2$ &  & $1$ & $-1$ &  &  & $\cdots$\\\hline
$x=3$ &  &  & $1$ & $-1$ &  & $\cdots$\\\hline
$x=4$ &  &  &  & $1$ & $-1$ & $\cdots$\\\hline
$x=5$ &  &  &  &  & $1$ & $\cdots$\\\hline
$\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ & $\ddots
$\\\hline
\end{tabular}
\ \ \ \ \ \ , \label{eq.exa.fubini.inf-serial-debtor.tab}%
\end{equation}
where empty slots are understood to contain the number $0$. It is easy to see
that all four sums in (\ref{eq.fubini.false}) have only finitely many nonzero
addends. Indeed, for each $x\in X$, we have%
\begin{equation}
\sum_{y\in Y}a_{\left(  x,y\right)  }=0
\label{eq.exa.fubini.inf-serial-debtor.1o}%
\end{equation}
(since the only nonzero addends of this sum are $1$ and $-1$, which clearly
sum up to $0$). Hence,%
\begin{equation}
\sum_{x\in X}\underbrace{\sum_{y\in Y}a_{\left(  x,y\right)  }}_{=0}%
=\sum_{x\in X}0=0. \label{eq.exa.fubini.inf-serial-debtor.1}%
\end{equation}
On the other hand, for each $y\in Y$, we have%
\[
\sum_{x\in X}a_{\left(  x,y\right)  }=%
\begin{cases}
1, & \text{if }y=1;\\
0, & \text{if }y\neq1
\end{cases}
\]
(since the only nonzero addends of this sum are $1$ and $-1$, except that
there is no $-1$ when $y=1$). Hence,%
\begin{equation}
\sum_{y\in Y}\ \ \underbrace{\sum_{x\in X}a_{\left(  x,y\right)  }}_{=%
\begin{cases}
1, & \text{if }y=1;\\
0, & \text{if }y\neq1
\end{cases}
}=\sum_{y\in Y}%
\begin{cases}
1, & \text{if }y=1;\\
0, & \text{if }y\neq1
\end{cases}
=1. \label{eq.exa.fubini.inf-serial-debtor.2}%
\end{equation}
Comparing this with (\ref{eq.exa.fubini.inf-serial-debtor.1}), we see that
(\ref{eq.fubini.false}) becomes $0=1$, which is clearly false. Hence, the
Incorrect Fubini rule is false. But Theorem \ref{thm.fubini-inf} does not
apply here, since infinitely many pairs $\left(  x,y\right)  \in X\times Y$
satisfy $a_{\left(  x,y\right)  }\neq0$.
\end{example}

(Example \ref{exa.fubini.inf-serial-debtor} can be thought of as a
mathematical model of \href{https://en.wikipedia.org/wiki/Check_kiting}{check
kiting}, or more generally of paying back a debt by opening a new line of
credit. In this metaphor, each row of the table
(\ref{eq.exa.fubini.inf-serial-debtor.tab}) represents a line of credit, while
each column represents a day, with the entry $1$ standing for incurring debt
and the entry $-1$ standing for paying it back. The equality
(\ref{eq.exa.fubini.inf-serial-debtor.1o}) says that each single debt gets
eventually paid back, but the equality
(\ref{eq.exa.fubini.inf-serial-debtor.2}) shows that the debtor has an extra
(\textquotedblleft undeserved\textquotedblright) unit of money at his
disposal. This paradox would not work if there were only finitely many lines
of credit; one day the debtor would have to pay back his last debt.)

Note that we are only considering the simplest kind of infinite sums here: the
ones that have only finitely many nonzero addends. In analysis, more general
situations are studied in which an infinite sum can have a well-defined
(finite) value. In those situations, there are much subtler criteria for when
summation signs can be interchanged (such as absolute summability). But this
is a combinatorics course, so we will not need them.

\subsection{\label{sect.intro.perm}Counting permutations: an introduction}

We now come back to take another look at counting maps. Namely, we restrict
ourselves to a special class of maps: the \textit{permutations}.

\subsubsection{Permutations and derangements}

There are two different things called \textquotedblleft
permutations\textquotedblright\ in mathematics. One is a kind of maps
(\textquotedblleft active permutations\textquotedblright); the other is a kind
of lists (\textquotedblleft passive permutations\textquotedblright). We are
always going to use the word \textquotedblleft permutation\textquotedblright%
\ for the former, at least when we are speaking of permutations of a set. Here
is how it is defined:

\begin{definition}
\label{def.perm}A \emph{permutation} of a set $X$ means a bijection from $X$
to $X$.
\end{definition}

We shall use the two-line notation for maps (see Definition \ref{def.map.tln}%
). Thus, for example,%
\[
\left(
\begin{array}
[c]{ccccc}%
0 & 1 & 5 & 7 & 9\\
1 & 7 & 5 & 0 & 9
\end{array}
\right)
\]
denotes the map from $\left\{  0,1,5,7,9\right\}  $ to $\left\{
0,1,5,7,9\right\}  $ that sends $0,1,5,7,9$ to $1,7,5,0,9$, respectively. This
map is a permutation of the set $\left\{  0,1,5,7,9\right\}  $. On the other
hand, the map%
\[
\left(
\begin{array}
[c]{ccccc}%
0 & 1 & 5 & 7 & 9\\
1 & 7 & 0 & 0 & 9
\end{array}
\right)
\]
is not a permutation, since it fails to be injective (indeed, it sends both
$5$ and $7$ to $0$) and therefore also fails to be bijective. Also, the map%
\[
\left(
\begin{array}
[c]{ccccc}%
0 & 1 & 5 & 7 & 9\\
1 & 2 & 3 & 4 & 5
\end{array}
\right)
\]
is not a permutation, since it is a map between two different sets (while a
permutation must be a map from a set to itself).

The most obvious counting question you can now ask has a simple answer:

\begin{theorem}
\label{thm.count.perms}Let $n\in\mathbb{N}$. Let $X$ be an $n$-element set.
Then,%
\[
\left(  \text{\# of permutations of }X\right)  =n!.
\]

\end{theorem}

We shall prove this theorem later (in Subsection \ref{subsect.binom.maps.per}%
). (The idea of the proof is simple, but formalizing it is tricky at this point.)

\begin{example}
\label{exa.count.perms.S3}The set $\left[  3\right]  =\left\{  1,2,3\right\}
$ has $3!=6$ many permutations; they are (written in two-line notation)%
\begin{align*}
&  \left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
1 & 2 & 3
\end{array}
\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
1 & 3 & 2
\end{array}
\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
2 & 1 & 3
\end{array}
\right)  ,\\
&  \left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
2 & 3 & 1
\end{array}
\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
3 & 1 & 2
\end{array}
\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
3 & 2 & 1
\end{array}
\right)  .
\end{align*}

\end{example}

Let us next focus on a specific kind of permutations.

\begin{definition}
\label{def.count.dera}Let $X$ be a set.

\textbf{(a)} If $f:X\rightarrow X$ is a map, then a \emph{fixed point} of $f$
means an element $x\in X$ such that $f\left(  x\right)  =x$.

\textbf{(b)} A \emph{derangement} of $X$ means a permutation of $X$ that has
no fixed points.
\end{definition}

\begin{example}
\textbf{(a)} The fixed points of the map%
\[
\left(
\begin{array}
[c]{ccccc}%
0 & 1 & 5 & 7 & 9\\
1 & 7 & 5 & 0 & 9
\end{array}
\right)
\]
are $5$ and $9$. Thus, this map is not a derangement of $\left\{
0,1,5,7,9\right\}  $ (even though it is a permutation of $\left\{
0,1,5,7,9\right\}  $).

\textbf{(b)} The map
\[
\left(
\begin{array}
[c]{ccccc}%
0 & 1 & 5 & 7 & 9\\
1 & 7 & 9 & 0 & 5
\end{array}
\right)
\]
has no fixed points, and thus is a derangement of $\left\{  0,1,5,7,9\right\}
$ (since it is a permutation of $\left\{  0,1,5,7,9\right\}  $).
\end{example}

We can restate Definition \ref{def.count.dera} as follows: A
\emph{derangement} of a set $X$ means a permutation $f$ of $X$ such that%
\[
f\left(  x\right)  \neq x\ \ \ \ \ \ \ \ \ \ \text{for all }x\in X.
\]


\subsubsection{Only the size counts}

How many derangements does an $n$-element set have?

A first simplification is to restrict our focus to a specific $n$-element set,
namely $\left[  n\right]  $, because all $n$-element sets should be
interchangeable as far as this question is concerned. This relies on the
following lemma:

\begin{lemma}
\label{lem.count.dera.X=n}Let $n\in\mathbb{N}$. Let $X$ be any $n$-element
set. Then,%
\[
\left(  \text{\# of derangements of }X\right)  =\left(  \text{\# of
derangements of }\left[  n\right]  \right)  .
\]

\end{lemma}

This lemma might be so obvious to you that you would wonder what there is to
be proven about it; shouldn't it be clear that the \# of derangements of a set
only depends on the size of that set? The following proof, which we shall
first give in an informal version, just spells out this idea:

\begin{proof}
[Proof of Lemma \ref{lem.count.dera.X=n} (informal version).]We have
$\left\vert X\right\vert =n$ (since $X$ is an $n$-element set) and $\left\vert
\left[  n\right]  \right\vert =n$, so that $\left\vert X\right\vert
=n=\left\vert \left[  n\right]  \right\vert $. Thus, the sets $X$ and $\left[
n\right]  $ have the same size. Hence, Theorem \ref{thm.bij-rule-conv}
(applied to $Y=\left[  n\right]  $) shows that there is a bijection
$\phi:X\rightarrow\left[  n\right]  $. Fix such a $\phi$.

We can regard this bijection $\phi$ as a way to label the elements of $X$ by
the numbers $1,2,\ldots,n$ (with each element $a\in X$ getting the label
$\phi\left(  a\right)  \in\left[  n\right]  $). For example, if $X$ is a
$3$-element set $\left\{  x,y,z\right\}  $, and $\phi:X\rightarrow\left[
3\right]  $ is the bijection\footnote{In this version of this proof, all maps
will be written in two-line notation.} $\left(
\begin{array}
[c]{ccc}%
x & y & z\\
1 & 2 & 3
\end{array}
\right)  $, then we can think of $\phi$ as labeling the elements $x,y,z$ as
$1,2,3$, respectively.

Now, we claim that any derangement of $X$ can be transformed into a
derangement of $\left[  n\right]  $. Indeed, if a derangement of $X$ is
written in two-line notation, then we can simply replace each $a\in X$
appearing in this two-line notation by its \textquotedblleft
label\textquotedblright\ $\phi\left(  a\right)  \in\left[  n\right]  $, and
thus obtain a derangement of $\left[  n\right]  $ written in two-line
notation. For example, if $X$ is a $3$-element set $\left\{  x,y,z\right\}  $,
and $\phi$ is the bijection $\left(
\begin{array}
[c]{ccc}%
x & y & z\\
1 & 2 & 3
\end{array}
\right)  :X\rightarrow\left[  3\right]  $, then the derangement%
\[
\left(
\begin{array}
[c]{ccc}%
x & y & z\\
y & z & x
\end{array}
\right)  \ \ \ \ \ \ \ \ \ \ \text{of }X
\]
becomes the derangement%
\[
\left(
\begin{array}
[c]{ccc}%
\phi\left(  x\right)  & \phi\left(  y\right)  & \phi\left(  z\right) \\
\phi\left(  y\right)  & \phi\left(  z\right)  & \phi\left(  x\right)
\end{array}
\right)  =\left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
2 & 3 & 1
\end{array}
\right)  \ \ \ \ \ \ \ \ \ \ \text{of }\left[  3\right]  .
\]
This way, we have assigned a derangement of $\left[  n\right]  $ to each
derangement of $X$. This assignment is \textquotedblleft
obviously\textquotedblright\footnote{See below for a rigorous point of view.}
a bijection from the set $\left\{  \text{derangements of }X\right\}  $ to the
set $\left\{  \text{derangements of }\left[  n\right]  \right\}  $. The
bijection principle thus yields that
\[
\left\vert \left\{  \text{derangements of }X\right\}  \right\vert =\left\vert
\left\{  \text{derangements of }\left[  n\right]  \right\}  \right\vert ,
\]
and this quickly yields Lemma \ref{lem.count.dera.X=n}.
\end{proof}

This proof was somewhat informal: We have not shown that our assignment is a
well-defined map from $\left\{  \text{derangements of }X\right\}  $ to
$\left\{  \text{derangements of }\left[  n\right]  \right\}  $ (and this is
not obvious, because a map usually can be written in two-line notation in
several ways); nor have we shown that it is a bijection. I shall thus rewrite
this proof in a more rigorous and formal way below.

First of all, let me recall some basic notations regarding maps. Recall that
if $g:A\rightarrow B$ and $f:B\rightarrow C$ are two maps (between some sets
$A$, $B$ and $C$), then the \emph{composition} $f\circ g$ of these two maps is
defined to be the map
\begin{align*}
A  &  \rightarrow C,\\
a  &  \mapsto f\left(  g\left(  a\right)  \right)  .
\end{align*}
(I pronounce \textquotedblleft$f\circ g$\textquotedblright\ as
\textquotedblleft$f$ after $g$\textquotedblright, because this composition
$f\circ g$ acts on an element $a\in A$ by first applying $g$ and afterwards
applying $f$ to the result.)

The composition of maps is associative: i.e., if $f$, $g$ and $h$ are three
maps for which the compositions $\left(  f\circ g\right)  \circ h$ and
$f\circ\left(  g\circ h\right)  $ make sense\footnote{This means that the
target of $h$ is the domain of $g$, and that the target of $g$ is the domain
of $f$.}, then these two compositions $\left(  f\circ g\right)  \circ h$ and
$f\circ\left(  g\circ h\right)  $ are equal, and thus both of them can be
called $f\circ g\circ h$. (See \cite[Proposition 2.82]{detnotes} for a proof
of this fact, and \cite[Theorem 2.86]{detnotes} for its analogue for more than
three maps.)

It is easy to see that any composition of bijections is again a bijection. In
particular, if $f$, $g$ and $h$ are three bijections for which the composition
$f\circ g\circ h$ makes sense, then this composition $f\circ g\circ h$ is a bijection.

Now, the bijection from $\left\{  \text{derangements of }X\right\}  $ to
$\left\{  \text{derangements of }\left[  n\right]  \right\}  $ that we have
constructed in our above proof of Lemma \ref{lem.count.dera.X=n} can be viewed
in a new light: This bijection sends any derangement $\omega$ of $X$ to the
composition%
\[
\phi\circ\omega\circ\phi^{-1}:\left[  n\right]  \rightarrow\left[  n\right]
\]
(where $\phi^{-1}:\left[  n\right]  \rightarrow X$ is the inverse of the
bijection $\phi:X\rightarrow\left[  n\right]  $). Indeed, if a derangement
$\omega$ of $X$ is given by
\[
\omega=\left(
\begin{array}
[c]{cccc}%
a_{1} & a_{2} & \cdots & a_{n}\\
b_{1} & b_{2} & \cdots & b_{n}%
\end{array}
\right)  \ \ \ \ \ \ \ \ \ \ \text{in two-line notation,}%
\]
then%
\[
\phi\circ\omega\circ\phi^{-1}=\left(
\begin{array}
[c]{cccc}%
\phi\left(  a_{1}\right)  & \phi\left(  a_{2}\right)  & \cdots & \phi\left(
a_{n}\right) \\
\phi\left(  b_{1}\right)  & \phi\left(  b_{2}\right)  & \cdots & \phi\left(
b_{n}\right)
\end{array}
\right)  \ \ \ \ \ \ \ \ \ \ \text{in two-line notation}%
\]
\footnote{because each $i\in\left[  n\right]  $ satisfies
\begin{align*}
\left(  \phi\circ\omega\circ\phi^{-1}\right)  \left(  \phi\left(
a_{i}\right)  \right)   &  =\phi\left(  \omega\left(  \underbrace{\phi
^{-1}\left(  \phi\left(  a_{i}\right)  \right)  }_{=a_{i}}\right)  \right)
=\phi\left(  \omega\left(  a_{i}\right)  \right)  =\phi\left(  b_{i}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }\omega=\left(
\begin{array}
[c]{cccc}%
a_{1} & a_{2} & \cdots & a_{n}\\
b_{1} & b_{2} & \cdots & b_{n}%
\end{array}
\right)  \text{ shows that }\omega\left(  a_{i}\right)  =b_{i}\right)
\end{align*}
}, which is precisely what we obtain when we replace each $a\in X$ appearing
in the two-line notation of $\omega$ by its \textquotedblleft
label\textquotedblright\ $\phi\left(  a\right)  \in\left[  n\right]  $. Thus,
we don't need to speak about two-line notations at all when defining our
bijection; we can simply define it as the map that sends each derangement
$\omega$ of $X$ to the derangement $\phi\circ\omega\circ\phi^{-1}$ of $\left[
n\right]  $. Thus, our above proof of Lemma \ref{lem.count.dera.X=n} takes the
following rigorous shape:

\begin{proof}
[Proof of Lemma \ref{lem.count.dera.X=n} (formal version).]We have $\left\vert
X\right\vert =n$ (since $X$ is an $n$-element set) and $\left\vert \left[
n\right]  \right\vert =n$, so that $\left\vert X\right\vert =n=\left\vert
\left[  n\right]  \right\vert $. Thus, the sets $X$ and $\left[  n\right]  $
have the same size. Hence, Theorem \ref{thm.bij-rule-conv} (applied to
$Y=\left[  n\right]  $) shows that there is a bijection $\phi:X\rightarrow
\left[  n\right]  $. Fix such a $\phi$.

Now, the map $\phi:X\rightarrow\left[  n\right]  $ is a bijection; thus, it
has an inverse map $\phi^{-1}:\left[  n\right]  \rightarrow X$. Hence, for any
map $\omega:X\rightarrow X$, we can form the composition%
\[
\phi\circ\omega\circ\phi^{-1}:\left[  n\right]  \rightarrow\left[  n\right]
.
\]
Moreover, if $\omega$ is a derangement of $X$, then $\phi\circ\omega\circ
\phi^{-1}$ is a derangement of $\left[  n\right]  $%
\ \ \ \ \footnote{\textit{Proof.} Let $\omega$ be a derangement of $X$. Thus,
$\omega$ is a permutation of $X$ that has no fixed points (by the definition
of a derangement). If the map $\phi\circ\omega\circ\phi^{-1}$ had a fixed
point $y\in\left[  n\right]  $, then $\phi^{-1}\left(  y\right)  \in X$ would
be a fixed point of $\omega$ (since it would satisfy%
\[
\phi\left(  \omega\left(  \phi^{-1}\left(  y\right)  \right)  \right)
=\left(  \phi\circ\omega\circ\phi^{-1}\right)  \left(  y\right)
=y\ \ \ \ \ \ \ \ \ \ \left(  \text{since }y\text{ is a fixed point of }%
\phi\circ\omega\circ\phi^{-1}\right)
\]
and therefore $\omega\left(  \phi^{-1}\left(  y\right)  \right)  =\phi
^{-1}\left(  y\right)  $); but this would contradict the fact that $\omega$
has no fixed points. Hence, the map $\phi\circ\omega\circ\phi^{-1}$ has no
fixed points either. Furthermore, the map $\omega$ is a permutation of $X$,
that is, a bijection from $X$ to $X$. Moreover, the maps $\phi$ and $\phi
^{-1}$ are bijections. Hence, the composition $\phi\circ\omega\circ\phi
^{-1}:\left[  n\right]  \rightarrow\left[  n\right]  $ is also a bijection
(because it is a composition of the three bijections $\phi$, $\omega$ and
$\phi^{-1}$). Thus, $\phi\circ\omega\circ\phi^{-1}$ is a bijection from
$\left[  n\right]  $ to $\left[  n\right]  $. In other words, $\phi\circ
\omega\circ\phi^{-1}$ is a permutation of $\left[  n\right]  $. Thus,
$\phi\circ\omega\circ\phi^{-1}$ is a permutation of $\left[  n\right]  $ that
has no fixed points (since we have previously shown that $\phi\circ\omega
\circ\phi^{-1}$ has no fixed points). In other words, $\phi\circ\omega
\circ\phi^{-1}$ is a derangement of $\left[  n\right]  $ (by the definition of
a derangement). Qed.}. Hence, we can define a map%
\begin{align*}
A:\left\{  \text{derangements of }X\right\}   &  \rightarrow\left\{
\text{derangements of }\left[  n\right]  \right\}  ,\\
\omega &  \mapsto\phi\circ\omega\circ\phi^{-1}.
\end{align*}
A similar argument shows that we can define a map%
\begin{align*}
B:\left\{  \text{derangements of }\left[  n\right]  \right\}   &
\rightarrow\left\{  \text{derangements of }X\right\}  ,\\
\eta &  \mapsto\phi^{-1}\circ\eta\circ\phi.
\end{align*}
It is easy to see that these two maps $A$ and $B$ are mutually
inverse\footnote{\textit{Proof.} We need to check that $A\circ
B=\operatorname*{id}$ and $B\circ A=\operatorname*{id}$. We shall only prove
that $A\circ B=\operatorname*{id}$, and leave the analogous proof of $B\circ
A=\operatorname*{id}$ to the reader.
\par
Let $\eta$ be a derangement of $\left[  n\right]  $. Then, $B\left(
\eta\right)  =\phi^{-1}\circ\eta\circ\phi$ (by the definition of $B$).
Applying the map $A$ to both sides of this equality, we find%
\begin{align*}
A\left(  B\left(  \eta\right)  \right)   &  =A\left(  \phi^{-1}\circ\eta
\circ\phi\right)  =\phi\circ\left(  \phi^{-1}\circ\eta\circ\phi\right)
\circ\phi^{-1}\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }A\right)
\\
&  =\underbrace{\phi\circ\phi^{-1}}_{=\operatorname*{id}}\circ\eta
\circ\underbrace{\phi\circ\phi^{-1}}_{=\operatorname*{id}}=\operatorname*{id}%
\circ\eta\circ\operatorname*{id}=\eta.
\end{align*}
Thus, $\left(  A\circ B\right)  \left(  \eta\right)  =A\left(  B\left(
\eta\right)  \right)  =\eta=\operatorname*{id}\left(  \eta\right)  $.
\par
Forget that we fixed $\eta$. We thus have proved that $\left(  A\circ
B\right)  \left(  \eta\right)  =\operatorname*{id}\left(  \eta\right)  $ for
each derangement $\eta$ of $\left[  n\right]  $. In other words, $A\circ
B=\operatorname*{id}$. As we said, the proof of $B\circ A=\operatorname*{id}$
is analogous. Thus, it follows that the maps $A$ and $B$ are mutually
inverse.}. Hence, the map $A$ is invertible, and thus a bijection. Therefore,
the bijection principle yields%
\[
\left\vert \left\{  \text{derangements of }X\right\}  \right\vert =\left\vert
\left\{  \text{derangements of }\left[  n\right]  \right\}  \right\vert .
\]
In other words,%
\[
\left(  \text{\# of derangements of }X\right)  =\left(  \text{\# of
derangements of }\left[  n\right]  \right)  .
\]
This proves Lemma \ref{lem.count.dera.X=n}.
\end{proof}

Lemma \ref{lem.count.dera.X=n} is not specific to derangements; it is merely
an instance of a far-ranging principle, which I will not state in its general
form because that would require a detour into category theory. Roughly
speaking, the principle says the following:

\begin{statement}
\textbf{\textquotedblleft Isomorphism principle\textquotedblright%
\ (informal):} Assume that we are given a way to assign a number $f\left(
S\right)  $ to any finite set $S$, and this way does not depend on what the
elements of $S$ are (i.e., it has a definition that works the same no matter
whether the elements of $S$ are numbers or tuples or maps or anything else).
Let $n\in\mathbb{N}$. Let $X$ be any $n$-element set. Then, $f\left(
X\right)  =f\left(  \left[  n\right]  \right)  $.
\end{statement}

Of course, this is not rigorous until we formalize what \textquotedblleft does
not depend on what the elements of $S$ are\textquotedblright\ means. This I am
not going to do; but let me delineate it through a few examples:

We can apply the \textquotedblleft isomorphism principle\textquotedblright\ to
$f\left(  S\right)  =\left(  \text{\# of derangements of }S\right)  $, because
the \# of derangements of $S$ is defined in a way that does not depend on what
the elements of $S$ are. Thus, we obtain Lemma \ref{lem.count.dera.X=n}.

Likewise, we can apply the \textquotedblleft isomorphism
principle\textquotedblright\ to \newline$f\left(  S\right)  =\left(  \text{\#
of permutations of }S\right)  $. Thus, we obtain the fact that if
$n\in\mathbb{N}$, and if $X$ is an $n$-element set, then%
\begin{equation}
\left(  \text{\# of permutations of }X\right)  =\left(  \text{\# of
permutations of }\left[  n\right]  \right)  .
\label{eq.lem.count.dera.X=n.perm}%
\end{equation}


Likewise, we can apply the \textquotedblleft isomorphism
principle\textquotedblright\ to $f\left(  S\right)  =\left(  \text{\# of
subsets of }S\right)  $. Thus, we obtain the fact that if $n\in\mathbb{N}$,
and if $X$ is an $n$-element set, then%
\begin{equation}
\left(  \text{\# of subsets of }X\right)  =\left(  \text{\# of subsets of
}\left[  n\right]  \right)  . \label{eq.lem.count.dera.X=n.subs}%
\end{equation}


Likewise, we can apply the \textquotedblleft isomorphism
principle\textquotedblright\ to \newline$f\left(  S\right)  =\left(  \text{\#
of subsets of }S\text{ having even size}\right)  $. Thus, we obtain the fact
that if $n\in\mathbb{N}$, and if $X$ is an $n$-element set, then%
\[
\left(  \text{\# of subsets of }X\text{ having even size}\right)  =\left(
\text{\# of subsets of }\left[  n\right]  \text{ having even size}\right)  .
\]


The number $f\left(  S\right)  $ in the \textquotedblleft isomorphism
principle\textquotedblright\ doesn't have to be the \# of some objects. We can
just as well apply the \textquotedblleft isomorphism
principle\textquotedblright\ to $f\left(  S\right)  =\sum_{T\subseteq
S}\left\vert T\right\vert $ (that is, the sum of the sizes of all subsets of
$S$). Thus, we obtain the fact that if $n\in\mathbb{N}$, and if $X$ is an
$n$-element set, then%
\[
\sum_{T\subseteq X}\left\vert T\right\vert =\sum_{T\subseteq\left[  n\right]
}\left\vert T\right\vert .
\]


What we \textbf{cannot} do is apply the \textquotedblleft isomorphism
principle\textquotedblright\ to \newline$f\left(  S\right)  =\left(  \text{\#
of lacunar subsets of }S\right)  $. Indeed, the word \textquotedblleft
lacunar\textquotedblright\ is only defined for sets of integers, and whether a
subset of $S$ is lacunar depends on what its elements are. And unsurprisingly,
it is \textbf{not} true that if $n\in\mathbb{N}$, and if $X$ is an $n$-element
set of integers, then%
\[
\left(  \text{\# of lacunar subsets of }X\right)  =\left(  \text{\# of lacunar
subsets of }\left[  n\right]  \right)  .
\]
For example, if $n=3$ and $X=\left\{  1,3,5\right\}  $, then all $8$ subsets
of $X$ are lacunar, but only $5$ subsets of $\left[  n\right]  =\left[
3\right]  $ are lacunar.

Likewise, we \textbf{cannot} apply the \textquotedblleft isomorphism
principle\textquotedblright\ to \newline$f\left(  S\right)  =\left(  \text{\#
of self-counting subsets of }S\right)  $. Indeed, for example, if we relabel
the elements $1$ and $2$ of the set $\left[  2\right]  $ as $8$ and $9$, then
the self-counting subset $\left[  1\right]  $ will no longer be self-counting.

\medskip

\begin{fineprint}
Since I am not proving the \textquotedblleft isomorphism
principle\textquotedblright\ in its general form, let me say a few words on
how to prove its specific instances. Essentially, every instance of the
\textquotedblleft isomorphism principle\textquotedblright\ can be proven by
the same strategy that we used in our proof of Lemma \ref{lem.count.dera.X=n}:
Namely, we fix a bijection $\phi:X\rightarrow\left[  n\right]  $, and we use
it to construct a bijection from $\left\{  \text{the objects counted by
}f\left(  X\right)  \right\}  $ to $\left\{  \text{the objects counted by
}f\left(  \left[  n\right]  \right)  \right\}  $, which proceeds by replacing
each element $a\in X$ by its \textquotedblleft label\textquotedblright%
\ $\phi\left(  a\right)  \in\left[  n\right]  $. When formalized, these proofs
may look rather different, but the underlying idea is always this one. In
particular, the formal proof of (\ref{eq.lem.count.dera.X=n.perm}) resembles
our formal proof of Lemma \ref{lem.count.dera.X=n} very closely (but is
shorter, because we don't have to show that $\phi\circ\omega\circ\phi^{-1}$
and $\phi^{-1}\circ\eta\circ\phi$ are derangements), whereas the formal proof
of (\ref{eq.lem.count.dera.X=n.subs}) requires a different formula for the
maps $A$ and $B$\ \ \ \ \footnote{namely,
\begin{align*}
A:\left\{  \text{subsets of }X\right\}   &  \rightarrow\left\{  \text{subsets
of }\left[  n\right]  \right\}  ,\\
U  &  \mapsto\phi\left(  U\right)  =\left\{  \phi\left(  u\right)
\ \mid\ u\in U\right\}
\end{align*}
and%
\begin{align*}
B:\left\{  \text{subsets of }\left[  n\right]  \right\}   &  \rightarrow
\left\{  \text{subsets of }X\right\}  ,\\
V  &  \mapsto\phi^{-1}\left(  V\right)  =\left\{  \phi^{-1}\left(  v\right)
\ \mid\ v\in V\right\}
\end{align*}
} (but otherwise, again, proceeds in the same way). I hope it is clear enough
how these formal proofs can be constructed more or less mechanically whenever
the need arises.
\end{fineprint}

\subsubsection{\label{subsect.intro.perm.oeis}Intermezzo: OEIS}

Lemma \ref{lem.count.dera.X=n} shows that, in order to count the derangements
of any finite set $X$, it suffices to count the derangements of $\left[
n\right]  $ for any $n\in\mathbb{N}$. Let us do this now.

\begin{definition}
\label{def.count.dera.Dn}For each $n\in\mathbb{N}$, let
\[
D_{n}=\left(  \text{\# of derangements of }\left[  n\right]  \right)  .
\]

\end{definition}

\begin{example}
Let us compute $D_{3}$. Indeed, we know from Example \ref{exa.count.perms.S3}
that the set $\left[  3\right]  $ has $6$ permutations (which are all listed
in Example \ref{exa.count.perms.S3}). Among these $6$ permutations, only $2$
are derangements, namely
\[
\left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
2 & 3 & 1
\end{array}
\right)  \ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
3 & 1 & 2
\end{array}
\right)
\]
(written in two-line notation). Thus, the \# of derangements of $\left[
3\right]  $ is $2$. In other words, $D_{3}=2$.
\end{example}

In a similar manner, we can count the derangements of any other given finite
set. In particular, we thus obtain%
\begin{align*}
D_{0}  &  =1\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\operatorname*{id}%
:\varnothing\rightarrow\varnothing\text{ is a derangement}\right)  ;\\
D_{1}  &  =0\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\operatorname*{id}%
:\left[  1\right]  \rightarrow\left[  1\right]  \text{ is \textbf{not} a
derangement}\right)  ;\\
D_{2}  &  =1\ \ \ \ \ \ \ \ \ \ \left(  \text{since the only derangement of
}\left[  2\right]  \text{ is }\left(
\begin{array}
[c]{cc}%
1 & 2\\
2 & 1
\end{array}
\right)  \right)  ;\\
D_{3}  &  =2\ \ \ \ \ \ \ \ \ \ \left(  \text{as we have just seen}\right)
;\\
D_{4}  &  =9.
\end{align*}


These days, when you have a sequence of integers you want to learn more about,
and you know a few of its values, you can look it up at the OEIS (the Online
Encyclopedia of Integer Sequences, available at \url{https://oeis.org} ). Let
us try this on the sequence $\left(  D_{0},D_{1},D_{2},D_{3},\ldots\right)  $.
We know its first five values $D_{0}=1,\ D_{1}=0,\ D_{2}=1,\ D_{3}%
=2,\ D_{4}=9$, so let us enter \textquotedblleft\texttt{1,0,1,2,9}%
\textquotedblright\ into the input field of the OEIS. We press
\textquotedblleft Search\textquotedblright\ and are greeted with a list of
several\footnote{currently 45, but quite possibly more by the time you are
reading this} known sequences that contain these five values somewhere in them
(in five consecutive positions). The first hit is
\href{https://oeis.org/A000166}{a sequence labeled A000166}, and named
\textquotedblleft Subfactorial or rencontres numbers, or derangements: number
of permutations of n elements with no fixed points\textquotedblright. This is,
of course, precisely our sequence (no wonder that such a simple concept as
derangements is well-known). The OEIS has collected a lot of information on
this sequence, including a long list of entries, combinatorial
interpretations, formulas (including many we don't yet understand), references
and links. Here is only a small selection of the formulas that are claimed in
the OEIS for this sequence:

\Needspace{5cm}

\begin{theorem}
\label{thm.count.dera.teasers}\textbf{(a)} We have $D_{n}=\left(  n-1\right)
\left(  D_{n-1}+D_{n-2}\right)  $ for all $n\geq2$.

\textbf{(b)} We have $D_{n}=nD_{n-1}+\left(  -1\right)  ^{n}$ for all integers
$n\geq1$.

\textbf{(c)} We have%
\[
n!=\sum_{k=0}^{n}\dbinom{n}{k}D_{n-k}\ \ \ \ \ \ \ \ \ \ \text{for all }%
n\in\mathbb{N}\text{.}%
\]


\textbf{(d)} We have%
\[
D_{n}=\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dfrac{n!}{k!}%
\ \ \ \ \ \ \ \ \ \ \text{for all }n\in\mathbb{N}\text{.}%
\]


\textbf{(e)} Set $\operatorname*{round}\left(  x\right)  =\left\lfloor
x+\dfrac{1}{2}\right\rfloor $ for each $x\in\mathbb{R}$. Then,%
\[
D_{n}=\operatorname*{round}\left(  \dfrac{n!}{e}\right)
\ \ \ \ \ \ \ \ \ \ \text{for all }n\geq1,
\]
where $e=\sum_{k=0}^{\infty}\dfrac{1}{k!}\approx2.718\ldots$ is the base of
the natural logarithm.
\end{theorem}

Some of these formulas will be proven in Subsection
\ref{subsect.binom.pie.app-der}. (Theorem \ref{thm.count.dera.teasers}
\textbf{(b)} follows from Theorem \ref{thm.count.dera.teasers} \textbf{(a)}
via \cite[Exercise 5]{19f-hw1s}.) Note that parts \textbf{(a)} and
\textbf{(b)} of Theorem \ref{thm.count.dera.teasers} are two recurrences for
the sequence $\left(  D_{0},D_{1},D_{2},\ldots\right)  $ that make its
computation rather easy; both are due to Euler.

\medskip

\begin{fineprint}
The OEIS can be used in many ways. It knows thousands of sequences that have
appeared in mathematics (not only combinatorics). You can search for them both
by entries (as we did above) and by keywords (such as \textquotedblleft
permutations\textquotedblright\ or \textquotedblleft
derangements\textquotedblright). It even acts as a bare-bones social network:
If two mathematicians encounter the same sequence in their work, and the first
one records it in the OEIS, the second can then find it and contact the first.
This has led to a number of collaborations between mathematicians working in
rather different disciplines; often, the appearance of the same integer
sequence in different places hints at a deeper connection between the theories.

It is known from basic set theory that there exists a bijection between
$\mathbb{N}$ and $\mathbb{N}^{2}$. Thus, a \textquotedblleft$2$-dimensional
sequence\textquotedblright\ (i.e., a family $\left(  a_{i,j}\right)  _{\left(
i,j\right)  \in\mathbb{N}^{2}}$ of numbers whose entries are indexed by two
rather than one nonnegative integers) can be re-parametrized as a (regular,
i.e., $1$-dimensional) sequence. Thus, such \textquotedblleft$2$-dimensional
sequences\textquotedblright\ and similar families of numbers can also be found
in the OEIS. For example, Pascal's triangle (i.e., the family $\left(
\dbinom{n}{k}\right)  _{\left(  n,k\right)  \in\mathbb{N}^{2};\ k\leq n}$)
appears as \href{https://oeis.org/A007318}{sequence A007318}.
\end{fineprint}

\subsubsection{The one-line notation}

If $\sigma$ is a permutation of the set $\left[  n\right]  $ (for some
$n\in\mathbb{N}$), then we can write $\sigma$ in two-line notation as follows:%
\[
\sigma=\left(
\begin{array}
[c]{cccc}%
1 & 2 & \cdots & n\\
\sigma\left(  1\right)  & \sigma\left(  2\right)  & \cdots & \sigma\left(
n\right)
\end{array}
\right)  .
\]
But you'll quickly tire of this notation, since its whole top row is useless:
It just contains the numbers $1,2,\ldots,n$ in increasing order. Thus, we can
omit this top row and only write the bottom row down\footnote{Of course, we
can only do this if we agree that the top row is $1,2,\ldots,n$ rather than
some other ordering of the elements of $\left[  n\right]  $.}. The bottom row
is usually written as an $n$-tuple (so the elements $\sigma\left(  1\right)
,\sigma\left(  2\right)  ,\ldots,\sigma\left(  n\right)  $ are separated by
commas). This is the so-called \emph{one-line notation} of $\sigma$:

\begin{definition}
\label{def.count.perm.OLN}Let $n\in\mathbb{N}$. Let $\sigma$ be a permutation
of $\left[  n\right]  $. Then, the \emph{one-line notation} of $\sigma$ is
defined to be the $n$-tuple $\left(  \sigma\left(  1\right)  ,\sigma\left(
2\right)  ,\ldots,\sigma\left(  n\right)  \right)  $.
\end{definition}

\textbf{Warning:} This notation clashes with a different notation (the
\textit{cycle notation}), which is used in many textbooks. We shall avoid this
conflict by using a different notation for cycles, but you should keep this in
mind when consulting other texts. Other authors often avoid this conflict by
using square brackets instead of parentheses in the one-line
notation\footnote{i.e., they write the one-line notation of $\sigma$ as
$\left[  \sigma\left(  1\right)  ,\sigma\left(  2\right)  ,\ldots
,\sigma\left(  n\right)  \right]  $}; but we prefer not to do so, since we are
already using square brackets for myriad other things.

\begin{example}
The $6$ permutations of the set $\left[  3\right]  $ have been listed in
Example \ref{exa.count.perms.S3}. In one-line notation, they look as follows:%
\[
\left(  1,2,3\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  1,3,2\right)
,\ \ \ \ \ \ \ \ \ \ \left(  2,1,3\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
2,3,1\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  3,1,2\right)
,\ \ \ \ \ \ \ \ \ \ \left(  3,2,1\right)  .
\]

\end{example}

Let us observe that the one-line notation (as defined in Definition
\ref{def.count.perm.OLN}) can be used not only for permutations of $\left[
n\right]  $, but for any maps from $\left[  n\right]  $ to an arbitrary set
$X$.

Perhaps the most useful thing about one-line notations is that they turn
permutations (a somewhat abstract object) into $n$-tuples of numbers (a much
more tangible object). Usually, it is easier to manipulate tuples (e.g., by
inserting or removing elements) than to manipulate permutations. Using the
one-line notation, we can substitute the former for the latter. This relies on
the following simple fact:

\begin{proposition}
\label{prop.count.perm.OLN-tup}Let $n\in\mathbb{N}$. Then:

\textbf{(a)} If $\sigma$ is any permutation of $\left[  n\right]  $, then the
one-line notation of $\sigma$ is an $n$-tuple of distinct elements of $\left[
n\right]  $ that contains all elements of $\left[  n\right]  $.

\textbf{(b)} If $\left(  i_{1},i_{2},\ldots,i_{n}\right)  $ is an $n$-tuple of
distinct elements of $\left[  n\right]  $ that contains all elements of
$\left[  n\right]  $, then there exists a unique permutation $\sigma$ of
$\left[  n\right]  $ such that the one-line notation of $\sigma$ is $\left(
i_{1},i_{2},\ldots,i_{n}\right)  $.

\textbf{(c)} Let
\[
T_{n}=\left\{  n\text{-tuples of distinct elements of }\left[  n\right]
\text{ that contain all elements of }\left[  n\right]  \right\}  .
\]
The map%
\begin{align*}
\left\{  \text{permutations of }\left[  n\right]  \right\}   &  \rightarrow
T_{n},\\
\sigma &  \mapsto\left(  \text{one-line notation of }\sigma\right)  =\left(
\sigma\left(  1\right)  ,\sigma\left(  2\right)  ,\ldots,\sigma\left(
n\right)  \right)
\end{align*}
is well-defined and is a bijection.
\end{proposition}

\begin{fineprint}


\begin{proof}
[Proof of Proposition \ref{prop.count.perm.OLN-tup}.]This is a simple exercise
in understanding what bijectivity means:

\textbf{(a)} Let $\sigma$ be a permutation of $\left[  n\right]  $. Thus,
$\sigma$ is a bijection from $\left[  n\right]  $ to $\left[  n\right]  $ (by
the definition of a permutation). Hence, the map $\sigma$ is bijective, i.e.,
both injective and surjective.

The one-line notation of $\sigma$ is defined to be the $n$-tuple $\left(
\sigma\left(  1\right)  ,\sigma\left(  2\right)  ,\ldots,\sigma\left(
n\right)  \right)  $. This $n$-tuple consists of $n$ distinct
entries\footnote{\textit{Proof.} If $i$ and $j$ are two distinct elements of
$\left[  n\right]  $, then $i\neq j$ and thus $\sigma\left(  i\right)
\neq\sigma\left(  j\right)  $ (since $\sigma$ is injective). In other words,
the $n$ entries of the $n$-tuple $\left(  \sigma\left(  1\right)
,\sigma\left(  2\right)  ,\ldots,\sigma\left(  n\right)  \right)  $ are
distinct. Qed.}, all of which are elements of $\left[  n\right]  $.
Furthermore, this $n$-tuple contains all elements of $\left[  n\right]
$\ \ \ \ \footnote{\textit{Proof.} Let $x\in\left[  n\right]  $. We must prove
that this $n$-tuple $\left(  \sigma\left(  1\right)  ,\sigma\left(  2\right)
,\ldots,\sigma\left(  n\right)  \right)  $ contains $x$. In other words, we
must prove that there exists a $y\in\left[  n\right]  $ such that
$\sigma\left(  y\right)  =x$. But this follows from the fact that $\sigma$ is
surjective. Qed.}. Hence, the one-line notation of $\sigma$ is an $n$-tuple of
distinct elements of $\left[  n\right]  $ that contains all elements of
$\left[  n\right]  $. This proves Proposition \ref{prop.count.perm.OLN-tup}
\textbf{(a)}.

\textbf{(b)} Let $\left(  i_{1},i_{2},\ldots,i_{n}\right)  $ be an $n$-tuple
of distinct elements of $\left[  n\right]  $ that contains all elements of
$\left[  n\right]  $. Then, $i_{1},i_{2},\ldots,i_{n}$ are elements of
$\left[  n\right]  $. Hence, we can define a map%
\begin{align*}
f:\left[  n\right]   &  \rightarrow\left[  n\right]  ,\\
j  &  \mapsto i_{j}.
\end{align*}
This map $f$ is injective\footnote{\textit{Proof.} The elements of the
$n$-tuple $\left(  i_{1},i_{2},\ldots,i_{n}\right)  $ are distinct (by the
definition of this $n$-tuple). Now, let $a$ and $b$ be two distinct elements
of $\left[  n\right]  $. Thus, $a\neq b$, so that $i_{a}\neq i_{b}$ (since the
elements of the $n$-tuple $\left(  i_{1},i_{2},\ldots,i_{n}\right)  $ are
distinct). The definition of $f$ yields $f\left(  a\right)  =i_{a}$ and
$f\left(  b\right)  =i_{b}$. Hence, $f\left(  a\right)  =i_{a}\neq
i_{b}=f\left(  b\right)  $.
\par
Forget that we fixed $a$ and $b$. We thus have shown that if $a$ and $b$ are
two distinct elements of $\left[  n\right]  $, then $f\left(  a\right)  \neq
f\left(  b\right)  $. In other words, the map $f$ is injective.} and
surjective\footnote{\textit{Proof.} Let $x\in\left[  n\right]  $. The
$n$-tuple $\left(  i_{1},i_{2},\ldots,i_{n}\right)  $ contains all elements of
$\left[  n\right]  $. Thus, in particular, it contains $x$. In other words,
there exists some $j\in\left[  n\right]  $ such that $i_{j}=x$. Consider this
$j$. The definition of $f$ now yields $f\left(  j\right)  =i_{j}=x$, so that
$x=f\left(  j\right)  $. In other words, $x$ is an image under $f$.
\par
Forget that we fixed $x$. We thus have shown that each $x\in\left[  n\right]
$ is an image under $f$. In other words, the map $f$ is surjective.}. Hence,
$f$ is bijective. In other words, $f$ is a bijection from $\left[  n\right]  $
to $\left[  n\right]  $. In other words, $f$ is a permutation of $\left[
n\right]  $ (by the definition of a permutation). Moreover, the one-line
notation of $f$ is%
\begin{align*}
&  \left(  f\left(  1\right)  ,f\left(  2\right)  ,\ldots,f\left(  n\right)
\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of the one-line
notation}\right) \\
&  =\left(  i_{1},i_{2},\ldots,i_{n}\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{since }f\left(  j\right)  =i_{j}\text{ for each }j\in\left[  n\right]
\text{ (by the definition of }f\text{)}\right)  .
\end{align*}
Hence, there is \textbf{at least one} permutation $\sigma$ of $\left[
n\right]  $ such that the one-line notation of $\sigma$ is $\left(
i_{1},i_{2},\ldots,i_{n}\right)  $ (namely, $\sigma=f$). Moreover, it is easy
to see that there is \textbf{at most one} such
permutation\footnote{\textit{Proof.} Let $\alpha$ be any such permutation. We
shall prove that $\alpha=f$.
\par
Indeed, $\alpha$ is a permutation $\sigma$ of $\left[  n\right]  $ such that
the one-line notation of $\sigma$ is $\left(  i_{1},i_{2},\ldots,i_{n}\right)
$. In other words, $\alpha$ is a permutation of $\left[  n\right]  $, and its
one-line notation is $\left(  i_{1},i_{2},\ldots,i_{n}\right)  $. Hence,%
\[
\left(  i_{1},i_{2},\ldots,i_{n}\right)  =\left(  \text{the one-line notation
of }\alpha\right)  =\left(  \alpha\left(  1\right)  ,\alpha\left(  2\right)
,\ldots,\alpha\left(  n\right)  \right)  ,
\]
so that%
\[
\left(  \alpha\left(  1\right)  ,\alpha\left(  2\right)  ,\ldots,\alpha\left(
n\right)  \right)  =\left(  i_{1},i_{2},\ldots,i_{n}\right)  =\left(  f\left(
1\right)  ,f\left(  2\right)  ,\ldots,f\left(  n\right)  \right)
\]
(since $\left(  f\left(  1\right)  ,f\left(  2\right)  ,\ldots,f\left(
n\right)  \right)  =\left(  i_{1},i_{2},\ldots,i_{n}\right)  $). In other
words, $\alpha\left(  x\right)  =f\left(  x\right)  $ for each $x\in\left[
n\right]  $. Since both $\alpha$ and $f$ are maps from $\left[  n\right]  $ to
$\left[  n\right]  $ (being permutations of $\left[  n\right]  $), we thus
conclude that $\alpha=f$.
\par
Now, forget that we fixed $\alpha$. We thus have shown that if $\alpha$ is any
permutation $\sigma$ of $\left[  n\right]  $ such that the one-line notation
of $\sigma$ is $\left(  i_{1},i_{2},\ldots,i_{n}\right)  $, then $\alpha=f$.
Hence, there is \textbf{at most one} permutation $\sigma$ of $\left[
n\right]  $ such that the one-line notation of $\sigma$ is $\left(
i_{1},i_{2},\ldots,i_{n}\right)  $.}. Combining these two observations, we
conclude that there is a \textbf{unique} permutation $\sigma$ of $\left[
n\right]  $ such that the one-line notation of $\sigma$ is $\left(
i_{1},i_{2},\ldots,i_{n}\right)  $. This proves Proposition
\ref{prop.count.perm.OLN-tup} \textbf{(b)}.

\textbf{(c)} If $\sigma$ is a permutation of $\left[  n\right]  $, then the
one-line notation of $\sigma$ is an $n$-tuple of distinct elements of $\left[
n\right]  $ that contains all elements of $\left[  n\right]  $ (by Proposition
\ref{prop.count.perm.OLN-tup} \textbf{(a)}). In other words, if $\sigma$ is a
permutation of $\left[  n\right]  $, then the one-line notation of $\sigma$
belongs to $T_{n}$ (because of how $T_{n}$ was defined). Thus, the map%
\begin{align*}
\left\{  \text{permutations of }\left[  n\right]  \right\}   &  \rightarrow
T_{n},\\
\sigma &  \mapsto\left(  \text{one-line notation of }\sigma\right)  =\left(
\sigma\left(  1\right)  ,\sigma\left(  2\right)  ,\ldots,\sigma\left(
n\right)  \right)
\end{align*}
is well-defined. It remains to prove that this map is a bijection.

Let us denote this map by $\operatorname*{OLN}$ (which is short for
\textquotedblleft one-line notation\textquotedblright). We thus must prove
that $\operatorname*{OLN}$ is a bijection.

The map $\operatorname*{OLN}$ is injective\footnote{\textit{Proof.} Let
$\sigma$ and $\tau$ be two permutations of $\left[  n\right]  $ such that
$\operatorname*{OLN}\left(  \sigma\right)  =\operatorname*{OLN}\left(
\tau\right)  $. Thus, the definition of $\operatorname*{OLN}$ yields
$\operatorname*{OLN}\left(  \sigma\right)  =\left(  \text{one-line notation of
}\sigma\right)  =\left(  \sigma\left(  1\right)  ,\sigma\left(  2\right)
,\ldots,\sigma\left(  n\right)  \right)  $ and similarly $\operatorname*{OLN}%
\left(  \tau\right)  =\left(  \tau\left(  1\right)  ,\tau\left(  2\right)
,\ldots,\tau\left(  n\right)  \right)  $. Hence,
\[
\left(  \sigma\left(  1\right)  ,\sigma\left(  2\right)  ,\ldots,\sigma\left(
n\right)  \right)  =\operatorname*{OLN}\left(  \sigma\right)
=\operatorname*{OLN}\left(  \tau\right)  =\left(  \tau\left(  1\right)
,\tau\left(  2\right)  ,\ldots,\tau\left(  n\right)  \right)  .
\]
In other words, $\sigma\left(  x\right)  =\tau\left(  x\right)  $ for each
$x\in\left[  n\right]  $. Hence, $\sigma=\tau$ (since both $\sigma$ and $\tau$
are maps from $\left[  n\right]  $ to $\left[  n\right]  $).
\par
Forget that we fixed $\sigma$ and $\tau$. We thus have shown that if $\sigma$
and $\tau$ are two permutations of $\left[  n\right]  $ such that
$\operatorname*{OLN}\left(  \sigma\right)  =\operatorname*{OLN}\left(
\tau\right)  $, then $\sigma=\tau$. In other words, the map
$\operatorname*{OLN}$ is injective.} and surjective\footnote{\textit{Proof.}
Let $\mathbf{x}\in T_{n}$. Thus, $\mathbf{x}\in T_{n}=\left\{  n\text{-tuples
of distinct elements of }\left[  n\right]  \text{ that contain all elements of
}\left[  n\right]  \right\}  $; in other words, $\mathbf{x}$ is an $n$-tuple
of distinct elements of $\left[  n\right]  $ that contains all elements of
$\left[  n\right]  $. Hence, we can write $\mathbf{x}$ in the form
$\mathbf{x}=\left(  i_{1},i_{2},\ldots,i_{n}\right)  $. Thus, $\left(
i_{1},i_{2},\ldots,i_{n}\right)  =\mathbf{x}$ is an $n$-tuple of distinct
elements of $\left[  n\right]  $ that contains all elements of $\left[
n\right]  $. Therefore, Proposition \ref{prop.count.perm.OLN-tup} \textbf{(b)}
shows that there exists a unique permutation $\sigma$ of $\left[  n\right]  $
such that the one-line notation of $\sigma$ is $\left(  i_{1},i_{2}%
,\ldots,i_{n}\right)  $. Consider this $\sigma$. The definition of
$\operatorname*{OLN}$ yields%
\begin{align*}
\operatorname*{OLN}\left(  \sigma\right)   &  =\left(  \text{one-line notation
of }\sigma\right) \\
&  =\left(  i_{1},i_{2},\ldots,i_{n}\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{since the one-line notation of }\sigma\text{ is }\left(  i_{1}%
,i_{2},\ldots,i_{n}\right)  \right) \\
&  =\mathbf{x}.
\end{align*}
Hence, $\mathbf{x}$ is an image under the map $\operatorname*{OLN}$.
\par
Now, forget that we fixed $\mathbf{x}$. We thus have shown that every
$\mathbf{x}\in T_{n}$ is an image under the map $\operatorname*{OLN}$. In
other words, the map $\operatorname*{OLN}$ is surjective.}. Hence,
$\operatorname*{OLN}$ is bijective. In other words, $\operatorname*{OLN}$ is a
bijection. This completes the proof of Proposition
\ref{prop.count.perm.OLN-tup} \textbf{(c)}.
\end{proof}
\end{fineprint}

\begin{center}
\fbox{\textbf{Class of 2019-10-16}}
\end{center}

\subsubsection{Short-legged permutations}

Derangements are just one special type of permutations. Many others can be
defined. For example, let me define what I call the \textit{short-legged
permutations}:

\begin{definition}
Let $n\in\mathbb{N}$. A permutation $\sigma$ of $\left[  n\right]  $ is said
to be \emph{short-legged} if each $i\in\left[  n\right]  $ satisfies
$\left\vert \sigma\left(  i\right)  -i\right\vert \leq1$.
\end{definition}

The word \textquotedblleft short-legged\textquotedblright\ is my own creation
(and refers to the idea that a short-legged permutation of $\left[  n\right]
$ \textquotedblleft carries no $i\in\left[  n\right]  $ any further than $1$
step\textquotedblright, a way of visualizing the inequality $\left\vert
\sigma\left(  i\right)  -i\right\vert \leq1$). But this type of permutations
has a long history, and appears naturally in the study of determinants
(specifically, of determinants of tridiagonal matrices -- see, e.g.,
\cite[Second solution to Exercise 6.27]{detnotes}).

\begin{example}
\textbf{(a)} Among the $6$ permutations of $\left[  3\right]  $, exactly $3$
are short-legged, namely%
\[
\left(  1,2,3\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  1,3,2\right)
,\ \ \ \ \ \ \ \ \ \ \left(  2,1,3\right)
\]
(in one-line notation). Indeed, for example, the permutation $\sigma=\left(
1,3,2\right)  $ is short-legged (since it has $\left\vert \sigma\left(
1\right)  -1\right\vert =\left\vert 1-1\right\vert =0\leq1$ and $\left\vert
\sigma\left(  2\right)  -2\right\vert =\left\vert 3-2\right\vert =1\leq1$ and
$\left\vert \sigma\left(  3\right)  -3\right\vert =\left\vert 2-3\right\vert
=1\leq1$), whereas the permutation $\sigma=\left(  2,3,1\right)  $ is not
short-legged (since it has $\left\vert \sigma\left(  3\right)  -3\right\vert
=\left\vert 1-3\right\vert =2>1$).

\textbf{(b)} Among the $24$ permutations of $\left[  4\right]  $, exactly $5$
are short-legged, namely%
\[
\left(  1,2,3,4\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  1,2,4,3\right)
,\ \ \ \ \ \ \ \ \ \ \left(  1,3,2,4\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
2,1,3,4\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  2,1,4,3\right)  .
\]

\end{example}

We can now wonder: How many permutations of $\left[  n\right]  $ are short-legged?

\begin{proposition}
\label{prop.1.33}Let $n\in\mathbb{N}$. Then,%
\[
\left(  \text{\# of short-legged permutations of }\left[  n\right]  \right)
=f_{n+1}.
\]
(Here, $\left(  f_{0},f_{1},f_{2},\ldots\right)  $ again denotes the Fibonacci
sequence, as defined in Definition \ref{def.fib}.)
\end{proposition}

That makes yet another question answered by the Fibonacci numbers! I will not
prove this proposition in full detail, but let me sketch the main ideas of two proofs:

\begin{proof}
[First proof of Proposition \ref{prop.1.33} (sketched).]Let $w_{n}$ denote the
\# of short-legged permutations of $\left[  n\right]  $. Then, it suffices to
show that $w_{n}=w_{n-1}+w_{n-2}$ for each $n\geq2$ (because we can then argue
as in the proof of Proposition \ref{prop.1.5}).

So let $n\geq2$. How do we prove $w_{n}=w_{n-1}+w_{n-2}$ ?

If $\sigma$ is any short-legged permutation of $\left[  n\right]  $, then
$\left\vert \sigma\left(  n\right)  -n\right\vert \leq1$ (by the definition of
\textquotedblleft short-legged\textquotedblright), so that $\sigma\left(
n\right)  \in\left\{  n-1,n,n+1\right\}  $ and therefore either $\sigma\left(
n\right)  =n-1$ or $\sigma\left(  n\right)  =n$ (since $\sigma\left(
n\right)  $ has to belong to $\left[  n\right]  $). We shall call $\sigma$
\textbf{red} if $\sigma\left(  n\right)  =n$, and \textbf{green} if
$\sigma\left(  n\right)  =n-1$. Thus, each short-legged permutation of
$\left[  n\right]  $ is either red or green (but never both at the same time).

Our goal will be to show that%
\[
\left(  \text{\# of red short-legged permutations of }\left[  n\right]
\right)  =w_{n-1}%
\]
and%
\[
\left(  \text{\# of green short-legged permutations of }\left[  n\right]
\right)  =w_{n-2}.
\]


Proposition \ref{prop.count.perm.OLN-tup} \textbf{(c)} allows us to identify
each permutation $\sigma$ of $\left[  n\right]  $ with its one-line notation
$\left(  \sigma\left(  1\right)  ,\sigma\left(  2\right)  ,\ldots
,\sigma\left(  n\right)  \right)  $, which is an $n$-tuple of distinct
elements of $\left[  n\right]  $. Let us do so.\footnote{Actually, if you
\textbf{define} an $n$-tuple of elements of a set $X$ to be a map from
$\left[  n\right]  $ to $X$, then there is nothing to identify here: In this
case, a permutation of $\left[  n\right]  $ is already identical to its
one-line notation. But I don't want to make assumptions about your definition
of tuples.} Thus:

\begin{itemize}
\item A permutation of $\left[  n\right]  $ is the same as an $n$-tuple of
distinct elements of $\left[  n\right]  $ that contains all elements of
$\left[  n\right]  $.

\item A short-legged permutation of $\left[  n\right]  $ is the same as an
$n$-tuple of distinct elements of $\left[  n\right]  $ that contains all
elements of $\left[  n\right]  $ and whose $i$-th entry is either $i-1$ or $i$
or $i+1$ for each $i\in\left[  n\right]  $.

\item A red short-legged permutation of $\left[  n\right]  $ is the same as a
short-legged permutation whose last entry is $n$.

\item A green short-legged permutation of $\left[  n\right]  $ is the same as
a short-legged permutation whose last entry is $n-1$.
\end{itemize}

We similarly identify permutations of $\left[  n-1\right]  $ with certain
$\left(  n-1\right)  $-tuples, and permutations of $\left[  n-2\right]  $ with
certain $\left(  n-2\right)  $-tuples. However, the words \textquotedblleft
red\textquotedblright\ and \textquotedblleft green\textquotedblright\ will be
used for permutations of $\left[  n\right]  $ only (so \textquotedblleft green
short-legged permutation\textquotedblright\ will mean \textquotedblleft green
short-legged permutation of $\left[  n\right]  $\textquotedblright, and
likewise for red).

So we know that a red short-legged permutation of $\left[  n\right]  $ is the
same as a short-legged permutation of $\left[  n\right]  $ whose last entry is
$n$. If we remove said last entry, then we obtain an $\left(  n-1\right)
$-tuple of elements of $\left[  n-1\right]  $, which is easily seen to be a
short-legged permutation of $\left[  n-1\right]  $. In other words, if
$\sigma=\left(  \sigma\left(  1\right)  ,\sigma\left(  2\right)
,\ldots,\sigma\left(  n\right)  \right)  $ is a red short-legged permutation
of $\left[  n\right]  $, then $\left(  \sigma\left(  1\right)  ,\sigma\left(
2\right)  ,\ldots,\sigma\left(  n-1\right)  \right)  $ is a short-legged
permutation of $\left[  n-1\right]  $. Thus, the map%
\begin{align*}
\left\{  \text{red short-legged permutations}\right\}   &  \rightarrow\left\{
\text{short-legged permutations of }\left[  n-1\right]  \right\}  ,\\
\sigma &  \mapsto\left(  \sigma\left(  1\right)  ,\sigma\left(  2\right)
,\ldots,\sigma\left(  n-1\right)  \right)
\end{align*}
is well-defined. It is easy to see that this map is a
bijection\footnote{Indeed, its inverse simply appends an $n$ to the end of a
short-legged permutation of $\left[  n-1\right]  $ (where the latter is
regarded as an $\left(  n-1\right)  $-tuple).}. Thus, the bijection principle
yields%
\begin{align*}
&  \left(  \text{\# of red short-legged permutations}\right) \\
&  =\left(  \text{\# of short-legged permutations of }\left[  n-1\right]
\right) \\
&  =w_{n-1}%
\end{align*}
(since $w_{n-1}$ was defined as the \# of short-legged permutations of
$\left[  n-1\right]  $).

Next, we analyze the green short-legged permutations of $\left[  n\right]  $.
Each green short-legged permutation $\sigma$ is an $n$-tuple whose last entry
is $n-1$. This entails that its second-to-last entry must be $n$. Indeed,
$\sigma$ must contain $n$ somewhere (since it is a permutation of $\left[
n\right]  $), but the only positions in which a short-legged permutation can
contain $n$ are its $\left(  n-1\right)  $-st and $n$-th entries (because any
other position of $n$ would violate the \textquotedblleft
short-legged\textquotedblright\ condition), and the $n$-th entry is already
taken by $n-1$. Thus, each green short-legged permutation $\sigma$ is an
$n$-tuple that ends with the two entries $n$ and $n-1$ (in this order). If we
remove these two entries, then we obtain an $\left(  n-2\right)  $-tuple of
elements of $\left[  n-2\right]  $, which is easily seen to be a short-legged
permutation of $\left[  n-2\right]  $. In other words, if $\sigma=\left(
\sigma\left(  1\right)  ,\sigma\left(  2\right)  ,\ldots,\sigma\left(
n\right)  \right)  $ is a green short-legged permutation of $\left[  n\right]
$, then $\left(  \sigma\left(  1\right)  ,\sigma\left(  2\right)
,\ldots,\sigma\left(  n-2\right)  \right)  $ is a short-legged permutation of
$\left[  n-2\right]  $. Thus, the map%
\begin{align*}
\left\{  \text{green short-legged permutations}\right\}   &  \rightarrow
\left\{  \text{short-legged permutations of }\left[  n-2\right]  \right\}  ,\\
\sigma &  \mapsto\left(  \sigma\left(  1\right)  ,\sigma\left(  2\right)
,\ldots,\sigma\left(  n-2\right)  \right)
\end{align*}
is well-defined. It is easy to see that this map is a
bijection\footnote{Indeed, its inverse simply appends an $n$ and then an $n-1$
to the end of a short-legged permutation of $\left[  n-2\right]  $ (where the
latter is regarded as an $\left(  n-2\right)  $-tuple).}. Thus, the bijection
principle yields%
\begin{align*}
&  \left(  \text{\# of green short-legged permutations}\right) \\
&  =\left(  \text{\# of short-legged permutations of }\left[  n-2\right]
\right) \\
&  =w_{n-2}%
\end{align*}
(since $w_{n-2}$ was defined as the \# of short-legged permutations of
$\left[  n-2\right]  $).

Now, recall that each short-legged permutation of $\left[  n\right]  $ is
either red or green (but never both at the same time). Hence, the sum rule
shows that%
\begin{align*}
&  \left(  \text{\# of short-legged permutations of }\left[  n\right]  \right)
\\
&  =\underbrace{\left(  \text{\# of red short-legged permutations}\right)
}_{=w_{n-1}}+\underbrace{\left(  \text{\# of green short-legged permutations}%
\right)  }_{=w_{n-2}}\\
&  =w_{n-1}+w_{n-2}.
\end{align*}
Thus, the definition of $w_{n}$ yields%
\[
w_{n}=\left(  \text{\# of short-legged permutations of }\left[  n\right]
\right)  =w_{n-1}+w_{n-2}.
\]
As we already know, this quickly completes the proof of Proposition
\ref{prop.1.33}.
\end{proof}

\begin{proof}
[Second proof of Proposition \ref{prop.1.33} (sketched).]Here is the outline
of a different proof.

Recall Definition \ref{def.subsets.lacunar}. I claim that the map%
\begin{align*}
F:\left\{  \text{short-legged permutations of }\left[  n\right]  \right\}   &
\rightarrow\left\{  \text{lacunar subsets of }\left[  n-1\right]  \right\}
,\\
\sigma &  \mapsto\left\{  i\in\left[  n-1\right]  \ \mid\ \sigma\left(
i\right)  =i+1\right\}
\end{align*}
is well-defined and is a bijection. Once we have proven this, the bijection
principle will yield%
\begin{align*}
&  \left(  \text{\# of short-legged permutations of }\left[  n\right]  \right)
\\
&  =\left(  \text{\# of lacunar subsets of }\left[  n-1\right]  \right) \\
&  =f_{\left(  n-1\right)  +2}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.1.35}, applied to }n-1\text{ instead of }n\right) \\
&  =f_{n+1},
\end{align*}
and thus Proposition \ref{prop.1.33} will be proven.

Why is the map $F$ well-defined and a bijection? In order to prove that $F$ is
well-defined, we only need to check the following statement:

\begin{statement}
\textit{Statement 1:} If $\sigma$ is a short-legged permutation of $\left[
n\right]  $, then \newline$\left\{  i\in\left[  n-1\right]  \ \mid
\ \sigma\left(  i\right)  =i+1\right\}  $ is a lacunar subset of $\left[
n-1\right]  $.
\end{statement}

I leave this to you, dear reader, with the following hint: If $\sigma$ is a
short-legged permutation, and some $a\in\left[  n-2\right]  $ satisfies
$\sigma\left(  a\right)  =a+1$ and $\sigma\left(  a+1\right)  =a+2$, then
prove that $\sigma\left(  a+2\right)  =a+3$ (because the values $a+1$ and
$a+2$ are already taken) and $\sigma\left(  a+3\right)  =a+4$ (because the
values $a+2$ and $a+3$ are already taken) and $\sigma\left(  a+4\right)  =a+5$
(likewise) and so on... but this eventually leads to $\sigma\left(  n\right)
=n+1$, which is absurd.

Statement 1 shows that $F$ is well-defined. In order to show that $F$ is
bijective, we need to prove the following two facts:

\begin{statement}
\textit{Statement 2:} If $\sigma$ and $\tau$ are two short-legged permutations
of $\left[  n\right]  $ satisfying $F\left(  \sigma\right)  =F\left(
\tau\right)  $, then $\sigma=\tau$.
\end{statement}

\begin{statement}
\textit{Statement 3:} If $J$ is a lacunar subset of $\left[  n-1\right]  $,
then there exists a short-legged permutation $\sigma$ of $\left[  n\right]  $
satisfying $F\left(  \sigma\right)  =J$.
\end{statement}

To prove Statement 2, you need to find a way to reconstruct a short-legged
permutation $\sigma$ from the lacunar subset $F\left(  \sigma\right)  $. Here
is such a way: The permutation $\sigma$ will send each $j\in\left[  n\right]
$ to $%
\begin{cases}
j+1, & \text{if }j\in F\left(  \sigma\right)  ;\\
j-1, & \text{if }j-1\in F\left(  \sigma\right)  ;\\
j, & \text{otherwise}%
\end{cases}
$. Of course, this needs to be proven -- again, LTTR. Same applies for
Statement 3.

\vspace{0.5pc}

\begin{fineprint}
Alternatively, this proof can be restated in terms of domino tilings of
$R_{n,2}$. Indeed, we already know from the Second proof of Proposition
\ref{prop.1.35} that there is a bijection%
\[
h:\left\{  \text{domino tilings of }R_{n+1,2}\right\}  \rightarrow\left\{
\text{lacunar subsets of }\left[  n\right]  \right\}  .
\]
Applying this to $n-1$ instead of $n$, we obtain a bijection%
\[
h^{\prime}:\left\{  \text{domino tilings of }R_{n,2}\right\}  \rightarrow
\left\{  \text{lacunar subsets of }\left[  n-1\right]  \right\}  .
\]
Composing the inverse of this bijection $h^{\prime}$ with the bijection $F$
above, we obtain a bijection%
\[
\left\{  \text{short-legged permutations of }\left[  n\right]  \right\}
\rightarrow\left\{  \text{domino tilings of }R_{n,2}\right\}  .
\]
We leave it to the reader to describe this bijection more directly and prove
its bijectivity without the detour through lacunar subsets.
\end{fineprint}
\end{proof}

\subsubsection{Long-legged permutations}

If short-legged permutations were so easy to count, what about the
\textquotedblleft opposite\textquotedblright\ notion?

\begin{definition}
Let $n\in\mathbb{N}$. A permutation $\sigma$ of $\left[  n\right]  $ is said
to be \emph{long-legged} if each $i\in\left[  n\right]  $ satisfies
$\left\vert \sigma\left(  i\right)  -i\right\vert >1$.
\end{definition}

How many long-legged permutations does $\left[  n\right]  $ have?

As in Subsection \ref{subsect.intro.count.sage}, we can compute these \#s
using SageMath for small $n$. As in Subsection \ref{subsect.intro.perm.oeis},
we can then enter the results into the OEIS and hope that the sequence will be
recognized. Here is the SageMath code:\footnote{This computes the \#s for
$n\in\left\{  0,1,\ldots,9\right\}  $. You can try to go further, but keep in
mind that the \# of permutations of $\left[  n\right]  $ is $n!$, which grows
a lot faster than $2^{n}$ (the \# of subsets of $\left[  n\right]  $).}
\begin{python}
def is_longlegged(s):
	# Check whether a permutation `s` is long-legged.
	n = len(s)
	# This finds the `n` such that
	# `s` is a permutation of `[n]`.
	return all( abs(s(i) - i) > 1 for i in range(1, n+1) )
	
def num_of_longlegged(n):
	# Return the number of long-legged permutations
	# of `[n]`.
	return sum(1 for s in Permutations(n) if is_longlegged(s))
	
for n in range(10):
	print("The number of long-legged permutations of [" + str(n) + "] is " + str(num_of_longlegged(n)))
\end{python}


Its output is:

\vspace{0.5pc}

\texttt{\qquad The number of long-legged permutations of [0] is 1}

\texttt{\qquad The number of long-legged permutations of [1] is 0}

\texttt{\qquad The number of long-legged permutations of [2] is 0}

\texttt{\qquad The number of long-legged permutations of [3] is 0}

\texttt{\qquad The number of long-legged permutations of [4] is 1}

\texttt{\qquad The number of long-legged permutations of [5] is 4}

\texttt{\qquad The number of long-legged permutations of [6] is 29}

\texttt{\qquad The number of long-legged permutations of [7] is 206}

\texttt{\qquad The number of long-legged permutations of [8] is 1708}

\texttt{\qquad The number of long-legged permutations of [9] is 15702}

\vspace{0.5pc}

So we enter these values $1,0,0,0,1,4,29,206,1708,15702$ into OEIS and
instantly obtain the result: \href{https://oeis.org/A001883}{OEIS sequence
A001883}, described as \textquotedblleft Number of permutations s of
\{1,2,...,n\} such that
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
$\vert$%
%EndExpansion
s(i)-i%
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
$\vert$%
%EndExpansion%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
$>$%
%EndExpansion
1 for each i=1,2,...,n\textquotedblright, which clears any doubts as to
whether it is the right sequence.

In the \textquotedblleft Formula\textquotedblright\ section of the OEIS page,
we spot the following recursion:

\qquad\texttt{a(n) = n*a(n-1) + 4*a(n-2) - 3*(n-3)*a(n-3) + (n-4)*a(n-4)}

\qquad\texttt{ + 2*(n-5)*a(n-5) - (n-7)*a(n-6) - a(n-7).}

In other words:

\begin{proposition}
\label{prop.intro.perm.longleg.rec}For each $n\in\mathbb{N}$, let%
\[
a_{n}=\left(  \text{\# of long-legged permutations of }\left[  n\right]
\right)  .
\]
Then, for each integer $n\geq7$, we have%
\begin{align*}
a_{n}  &  =na_{n-1}+4a_{n-2}-3\left(  n-3\right)  a_{n-3}+\left(  n-4\right)
a_{n-4}\\
&  \ \ \ \ \ \ \ \ \ \ +2\left(  n-5\right)  a_{n-5}-\left(  n-7\right)
a_{n-6}-a_{n-7}.
\end{align*}

\end{proposition}

This recurrence is credited to Vaclav Kotesovec (2017), and probably has been
proved by reducing it to another recurrence (by J. Riordan, in an unpublished
Bell Labs memorandum from 1963), which involves
\href{https://oeis.org/A000204}{the Lucas sequence} (a variant of the
Fibonacci sequence: same recursion, but different starting values). The latter
recurrence has been proved (in said memorandum, which can be downloaded from
the OEIS page) using \textit{generating functions} and an enumerative
technique known as \textit{rook theory} (see \cite{BCHR11} for an
introduction). The argument would be both too advanced and too intricate to
present at this point.

There is probably no hope of finding a \textquotedblleft
closed-form\textquotedblright\ expression for the $a_{n}$ in Proposition
\ref{prop.intro.perm.longleg.rec}. Not every counting problem has a
closed-form solution; even a recurrent formula such as Proposition
\ref{prop.intro.perm.longleg.rec} is sometimes too much to ask for!\footnote{A
famous counting problem that has neither a known closed-form solution nor a
known recurrence is counting
\href{https://en.wikipedia.org/wiki/Latin_square}{Latin squares}. The
corresponding number sequence is \href{https://oeis.org/A002860}{A002860 in
the OEIS}.}

Thus ends our introductory tour of enumerative combinatorics. We shall next
focus on one of the most basic topics: the binomial coefficients.

\section{\label{chp.binom}Binomial coefficients}

We have already started exploring the binomial coefficients in Section
\ref{sect.intro.binom}. In this chapter, we shall explore them further, with a
focus on proving identities involving them. We will build up a toolbox of
techniques for this, some combinatorial and some algebraic.

\subsection{\label{sect.binom.-1}The alternating sum of a row of Pascal's
triangle}

Recall Proposition \ref{prop.binom.sum-alt-row}, which says that%

\[
\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n}{k}=\left[  n=0\right]
\ \ \ \ \ \ \ \ \ \ \text{for each }n\in\mathbb{N}.
\]


We have previously proved this proposition using the binomial formula. Let us
now give two more proofs for it, as they involve techniques worth seeing.

\subsubsection{\label{subsect.binom.-1.telescope}Telescoping sums}

For the second proof, we will use the \emph{telescope principle} -- or, more
precisely, the \emph{telescoping sum principle} (as there is an analogous
version for products):

\begin{theorem}
[Telescoping sum principle]\label{thm.sum.telesc-sum}Let $u$ and $v$ be two
integers with $u\leq v+1$. Let $a_{u},a_{u+1},\ldots,a_{v+1}$ be any numbers.
Then,%
\[
\sum_{j=u}^{v}\left(  a_{j+1}-a_{j}\right)  =a_{v+1}-a_{u}.
\]

\end{theorem}

\begin{proof}
[First proof of Theorem \ref{thm.sum.telesc-sum} (informal version).]If
$u=v+1$, then%
\begin{align*}
\sum_{j=u}^{v}\left(  a_{j+1}-a_{j}\right)   &  =\sum_{j=v+1}^{v}\left(
a_{j+1}-a_{j}\right)  =\left(  \text{empty sum}\right)  =0\\
&  =\underbrace{a_{u}}_{\substack{=a_{v+1}\\\text{(since }u=v+1\text{)}%
}}-a_{u}=a_{v+1}-a_{u}.
\end{align*}
Hence, Theorem \ref{thm.sum.telesc-sum} is proved in the case when $u=v+1$.
Thus, for the rest of this proof, we WLOG assume that $u\neq v+1$. Hence,
$u<v+1$ (since $u\leq v+1$), so that $u+1\leq v+1$ (since $u$ and $v+1$ are
integers). In other words, $u\leq v$.

Now, here is an informal version of how the proof proceeds from here: We have
\begin{align*}
&  \sum_{j=u}^{v}\underbrace{\left(  a_{j+1}-a_{j}\right)  }_{=-a_{j}+a_{j+1}%
}\\
&  =\sum_{j=u}^{v}\left(  -a_{j}+a_{j+1}\right) \\
&  =\left(  -a_{u}+a_{u+1}\right)  +\left(  -a_{u+1}+a_{u+2}\right)  +\left(
-a_{u+2}+a_{u+3}\right)  +\cdots+\left(  -a_{v}+a_{v+1}\right)  .
\end{align*}
The right hand side of this equality is a sum of $2\cdot\left(  v-u+1\right)
$ addends (once expanded out), but all but $2$ of them cancel out (indeed, the
second addend in each parenthesis cancels the first addend in the next
parenthesis). The $2$ addends left over are $-a_{u}$ and $a_{v+1}$. Thus, the
sum \textquotedblleft contracts\textquotedblright\ like a telescope (thus the
name \textquotedblleft telescoping sum principle\textquotedblright):%
\begin{align*}
&  \left(  -a_{u}+a_{u+1}\right)  +\left(  -a_{u+1}+a_{u+2}\right)  +\left(
-a_{u+2}+a_{u+3}\right)  +\cdots+\left(  -a_{v}+a_{v+1}\right) \\
&  =-a_{u}+a_{v+1}=a_{v+1}-a_{u}.
\end{align*}
Combining, we obtain%
\begin{align*}
&  \sum_{j=u}^{v}\left(  a_{j+1}-a_{j}\right) \\
&  =\left(  -a_{u}+a_{u+1}\right)  +\left(  -a_{u+1}+a_{u+2}\right)  +\left(
-a_{u+2}+a_{u+3}\right)  +\cdots+\left(  -a_{v}+a_{v+1}\right) \\
&  =a_{v+1}-a_{u}.
\end{align*}
This proves Theorem \ref{thm.sum.telesc-sum}.
\end{proof}

\begin{fineprint}
You might not like how we waved our hands talking of cancelling addends in the
proof above. But formalizing the proof is a simple matter of reframing it as
an induction argument:

\begin{proof}
[First proof of Theorem \ref{thm.sum.telesc-sum} (formal version).]From $u\leq
v+1$, we obtain $v+1-u\geq0$ and thus $v+1-u\in\mathbb{N}$. Hence, we can
prove Theorem \ref{thm.sum.telesc-sum} by induction on $v+1-u$:

\textit{Induction base:} It is easy to see that Theorem
\ref{thm.sum.telesc-sum} holds if $v+1-u=0$\ \ \ \ \footnote{\textit{Proof.}
Let $u$, $v$ and $a_{u},a_{u+1},\ldots,a_{v+1}$ be as in Theorem
\ref{thm.sum.telesc-sum}, and assume that $v+1-u=0$. Thus, $u=v+1$ (since
$v+1-u=0$). Therefore,%
\[
\sum_{j=u}^{v}\left(  a_{j+1}-a_{j}\right)  =\sum_{j=v+1}^{v}\left(
a_{j+1}-a_{j}\right)  =\left(  \text{empty sum}\right)  =0=\underbrace{a_{u}%
}_{\substack{=a_{v+1}\\\text{(since }u=v+1\text{)}}}-a_{u}=a_{v+1}-a_{u}.
\]
This is precisely the claim of Theorem \ref{thm.sum.telesc-sum}. Hence, we
have showed that Theorem \ref{thm.sum.telesc-sum} holds if $v+1-u=0$.}. This
completes the induction base.

\textit{Induction step:} Let $m\in\mathbb{N}$. Assume (as the induction
hypothesis) that Theorem \ref{thm.sum.telesc-sum} holds if $v+1-u=m$. We must
prove that Theorem \ref{thm.sum.telesc-sum} holds if $v+1-u=m+1$.

We have assumed that Theorem \ref{thm.sum.telesc-sum} holds if $v+1-u=m$. In
other words, the following claim holds:

\begin{statement}
\textit{Claim 1:} Let $u$ and $v$ be two integers with $u\leq v+1$ and
$v+1-u=m$. Let $a_{u},a_{u+1},\ldots,a_{v+1}$ be any numbers. Then,%
\[
\sum_{j=u}^{v}\left(  a_{j+1}-a_{j}\right)  =a_{v+1}-a_{u}.
\]

\end{statement}

We must prove that Theorem \ref{thm.sum.telesc-sum} holds if $v+1-u=m+1$. In
other words, we must prove the following claim:

\begin{statement}
\textit{Claim 2:} Let $u$ and $v$ be two integers with $u\leq v+1$ and
$v+1-u=m+1$. Let $a_{u},a_{u+1},\ldots,a_{v+1}$ be any numbers. Then,%
\[
\sum_{j=u}^{v}\left(  a_{j+1}-a_{j}\right)  =a_{v+1}-a_{u}.
\]

\end{statement}

[\textit{Proof of Claim 2:} We have $v-u=\underbrace{\left(  v+1-u\right)
}_{=m+1}-1=\left(  m+1\right)  -1=m\geq0$ (since $m\in\mathbb{N}$) and thus
$v\geq u$. Hence, we can split off the addend for $j=v$ from the sum
$\sum_{j=u}^{v}\left(  a_{j+1}-a_{j}\right)  $. We thus obtain%
\begin{equation}
\sum_{j=u}^{v}\left(  a_{j+1}-a_{j}\right)  =\left(  a_{v+1}-a_{v}\right)
+\sum_{j=u}^{v-1}\left(  a_{j+1}-a_{j}\right)  .
\label{pf.thm.sum.telesc-sum.1st.c2.pf.2}%
\end{equation}
But $u\leq\left(  v-1\right)  +1$ (since $\left(  v-1\right)  +1=v\geq u$) and
$\left(  v-1\right)  +1-u=v-u=m$. Hence, we can apply Claim 1 to $v-1$ instead
of $v$. We thus obtain%
\[
\sum_{j=u}^{v-1}\left(  a_{j+1}-a_{j}\right)  =\underbrace{a_{\left(
v-1\right)  +1}}_{=a_{v}}-a_{u}=a_{v}-a_{u}.
\]
Thus, (\ref{pf.thm.sum.telesc-sum.1st.c2.pf.2}) becomes%
\[
\sum_{j=u}^{v}\left(  a_{j+1}-a_{j}\right)  =\left(  a_{v+1}-a_{v}\right)
+\underbrace{\sum_{j=u}^{v-1}\left(  a_{j+1}-a_{j}\right)  }_{=a_{v}-a_{u}%
}=\left(  a_{v+1}-a_{v}\right)  +\left(  a_{v}-a_{u}\right)  =a_{v+1}-a_{u}.
\]
This proves Claim 2.]

Now, we have proved Claim 2. In other words, we have proved that Theorem
\ref{thm.sum.telesc-sum} holds if $v+1-u=m+1$. This completes the induction
step. Thus, Theorem \ref{thm.sum.telesc-sum} is proved by induction.
\end{proof}

There is also a different proof of Theorem \ref{thm.sum.telesc-sum}, relying
on basic manipulations of sums:

\begin{proof}
[Second proof of Theorem \ref{thm.sum.telesc-sum}.]We have%
\begin{equation}
\sum_{j=u}^{v}\left(  a_{j+1}-a_{j}\right)  =\sum_{j=u}^{v}a_{j+1}-\sum
_{j=u}^{v}a_{j}=\sum_{j=u+1}^{v+1}a_{j}-\sum_{j=u}^{v}a_{j}
\label{pf.thm.sum.telesc-sum.2nd.1}%
\end{equation}
(here, we have substituted $j$ for $j+1$ in the first sum).

Now, it is tempting to argue that
\[
\sum_{j=u+1}^{v+1}a_{j}=a_{v+1}+\sum_{j=u+1}^{v}a_{j}%
\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \sum_{j=u}^{v}a_{j}%
=a_{u}+\sum_{j=u+1}^{v}a_{j}%
\]
(and then subtract these two equalities). Unfortunately, these two equalities
are false in the border case $u=v+1$, because you cannot split off a
(non-existing) addend from an empty sum. Of course, we could get around this
issue by treating this border case separately (it is trivial). But it is a bit
easier to make a similar argument that avoids this nuisance altogether:
Instead of making the sums $\sum_{j=u+1}^{v+1}a_{j}$ and $\sum_{j=u}^{v}a_{j}$
equal by splitting off an addend from each, we make them equal by adding an
extra addend to each. This can be done as follows:

We have $u\leq v+1$. Thus, we can split off the addend for $j=v+1$ from the
sum $\sum_{j=u}^{v+1}a_{j}$, and obtain
\[
\sum_{j=u}^{v+1}a_{j}=a_{v+1}+\sum_{j=u}^{v}a_{j}.
\]
Thus,%
\[
\sum_{j=u}^{v}a_{j}=\sum_{j=u}^{v+1}a_{j}-a_{v+1}.
\]
But we can also split off the addend for $j=u$ from the sum $\sum_{j=u}%
^{v+1}a_{j}$, and obtain
\[
\sum_{j=u}^{v+1}a_{j}=a_{u}+\sum_{j=u+1}^{v+1}a_{j}.
\]
Thus,%
\[
\sum_{j=u+1}^{v+1}a_{j}=\sum_{j=u}^{v+1}a_{j}-a_{u}.
\]
Hence, (\ref{pf.thm.sum.telesc-sum.2nd.1}) becomes%
\begin{align*}
\sum_{j=u}^{v}\left(  a_{j+1}-a_{j}\right)   &  =\underbrace{\sum
_{j=u+1}^{v+1}a_{j}}_{=\sum_{j=u}^{v+1}a_{j}-a_{u}}-\underbrace{\sum_{j=u}%
^{v}a_{j}}_{=\sum_{j=u}^{v+1}a_{j}-a_{v+1}}\\
&  =\left(  \sum_{j=u}^{v+1}a_{j}-a_{u}\right)  -\left(  \sum_{j=u}^{v+1}%
a_{j}-a_{v+1}\right)  =a_{v+1}-a_{u}.
\end{align*}
This proves Theorem \ref{thm.sum.telesc-sum} again.
\end{proof}

\begin{remark}
Equivalent versions of Theorem \ref{thm.sum.telesc-sum} abound all across the
literature. For example, \cite[Proposition 2.2]{19f-hw0s} says that if
$m\in\mathbb{N}$ and if $a_{0},a_{1},\ldots,a_{m}$ are any $m+1$ numbers,
then
\[
\sum_{i=1}^{m}\left(  a_{i}-a_{i-1}\right)  =a_{m}-a_{0}.
\]
This follows from Theorem \ref{thm.sum.telesc-sum}, because substituting $j+1$
for $i$ in the sum $\sum_{i=1}^{m}\left(  a_{i}-a_{i-1}\right)  $ yields%
\begin{align*}
\sum_{i=1}^{m}\left(  a_{i}-a_{i-1}\right)   &  =\sum_{j=0}^{m-1}\left(
a_{j+1}-a_{j}\right)  =\underbrace{a_{\left(  m-1\right)  +1}}_{=a_{m}}%
-a_{0}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.sum.telesc-sum},
applied to }u=0\text{ and }v=m-1\right) \\
&  =a_{m}-a_{0}.
\end{align*}
Also, \cite[(16)]{detnotes} says that if $u$ and $v$ are two integers such
that $u-1\leq v$, and $a_{s}$ is a number for each $s\in\left\{
u-1,u,\ldots,v\right\}  $, then%
\[
\sum_{s=u}^{v}\left(  a_{s}-a_{s-1}\right)  =a_{v}-a_{u-1}.
\]
This is precisely Theorem \ref{thm.sum.telesc-sum}, applied to $a_{j-1}$
instead of $a_{j}$.
\end{remark}
\end{fineprint}

\begin{fineprint}
Let us note that Theorem \ref{thm.sum.telesc-sum} is a discrete version of the
famous \textquotedblleft Second Fundamental Theorem of
Calculus\textquotedblright, which says that any two real numbers $u$ and $v$
with $u\leq v$ and any differentiable function $F:\left[  u,v\right]
_{\mathbb{R}}\rightarrow\mathbb{R}$ satisfy\footnote{Here, $\left[
u,v\right]  _{\mathbb{R}}$ denotes the \textbf{real} interval from $u$ to
$v$.}%
\[
\int_{u}^{v}F^{\prime}\left(  x\right)  dx=F\left(  v\right)  -F\left(
u\right)  .
\]
Indeed, the summation sign $\sum$ is a discrete analogue of the integral sign
$\int$, whereas the differences $a_{j+1}-a_{j}$ of consecutive entries of the
sequence $a_{u},a_{u+1},\ldots,a_{v+1}$ are a discrete analogue of (the values
of) the derivative of a function.
\end{fineprint}

\bigskip

We can now re-prove Proposition \ref{prop.binom.sum-alt-row}:

\begin{proof}
[Second proof of Proposition \ref{prop.binom.sum-alt-row}.]If $n=0$, then
Proposition \ref{prop.binom.sum-alt-row} boils down to the identity $1=1$,
which is true. Thus, for the rest of this proof, we WLOG assume that $n\neq0$.
Hence, $\left[  n=0\right]  =0$ and $n\geq1$ (since $n\in\mathbb{N}$). From
$n\geq1$, we obtain $n-1\in\mathbb{N}$. Hence, Proposition \ref{prop.binom.0}
(applied to $n-1$ and $n$ instead of $n$ and $k$) yields $\dbinom{n-1}{n}=0$
(since $n-1<n$). Now, for each $k\in\mathbb{N}$, we have%
\begin{align*}
&  \left(  -1\right)  ^{k}\underbrace{\dbinom{n}{k}}_{\substack{=\dbinom
{n-1}{k-1}+\dbinom{n-1}{k}\\\text{(by Theorem \ref{thm.binom.rec})}}}\\
&  =\left(  -1\right)  ^{k}\left(  \dbinom{n-1}{k-1}+\dbinom{n-1}{k}\right)
=\underbrace{\left(  -1\right)  ^{k}}_{=-\left(  -1\right)  ^{k-1}}%
\dbinom{n-1}{k-1}+\left(  -1\right)  ^{k}\dbinom{n-1}{k}\\
&  =-\left(  -1\right)  ^{k-1}\dbinom{n-1}{k-1}+\left(  -1\right)  ^{k}%
\dbinom{n-1}{k}=\left(  -1\right)  ^{k}\dbinom{n-1}{k}-\left(  -1\right)
^{k-1}\dbinom{n-1}{k-1}.
\end{align*}
Hence,%
\begin{align*}
&  \sum_{k=0}^{n}\underbrace{\left(  -1\right)  ^{k}\dbinom{n}{k}}_{=\left(
-1\right)  ^{k}\dbinom{n-1}{k}-\left(  -1\right)  ^{k-1}\dbinom{n-1}{k-1}}\\
&  =\sum_{k=0}^{n}\left(  \left(  -1\right)  ^{k}\dbinom{n-1}{k}-\left(
-1\right)  ^{k-1}\dbinom{n-1}{k-1}\right) \\
&  =\sum_{j=-1}^{n-1}\left(  \left(  -1\right)  ^{j+1}\dbinom{n-1}%
{j+1}-\left(  -1\right)  ^{j}\dbinom{n-1}{j}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have substituted }j+1\text{ for
}k\text{ in the sum}\right) \\
&  =\left(  -1\right)  ^{\left(  n-1\right)  +1}\underbrace{\dbinom
{n-1}{\left(  n-1\right)  +1}}_{=\dbinom{n-1}{n}=0}-\left(  -1\right)
^{-1}\underbrace{\dbinom{n-1}{-1}}_{\substack{=0\\\text{(by
(\ref{eq.def.binom.def.b}), applied to }n-1\text{ and }-1\\\text{instead of
}n\text{ and }k\text{)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.sum.telesc-sum},
applied to }u=-1\text{, }v=n-1\text{ and }a_{j}=\left(  -1\right)  ^{j}%
\dbinom{n-1}{j}\right) \\
&  =0-0=0=\left[  n=0\right]  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left[
n=0\right]  =0\right)  .
\end{align*}
This proves Proposition \ref{prop.binom.sum-alt-row} again.
\end{proof}

When applying Theorem \ref{thm.sum.telesc-sum}, one usually does not directly
mention Theorem \ref{thm.sum.telesc-sum}; instead, one says that the sum
$\sum_{j=u}^{v}\left(  a_{j+1}-a_{j}\right)  $ \textquotedblleft%
\emph{telescopes to}\textquotedblright\ $a_{v+1}-a_{u}$. Thus, for example, in
the proof of Proposition \ref{prop.binom.sum-alt-row} we just gave, the sum
\newline$\sum_{j=-1}^{n-1}\left(  \left(  -1\right)  ^{j+1}\dbinom{n-1}%
{j+1}-\left(  -1\right)  ^{j}\dbinom{n-1}{j}\right)  $ telescoped to $\left(
-1\right)  ^{\left(  n-1\right)  +1}\dbinom{n-1}{\left(  n-1\right)
+1}-\left(  -1\right)  ^{-1}\dbinom{n-1}{-1}$.

\begin{exercise}
\label{exe.binom.altsum-partial}\textbf{(a)} Let $n\in\mathbb{R}$. Let
$m\in\mathbb{N}$. Prove that
\[
\sum_{k=0}^{m}\left(  -1\right)  ^{k}\dbinom{n}{k}=\left(  -1\right)
^{m}\dbinom{n-1}{m}.
\]


\textbf{(b)} Explain why Proposition \ref{prop.binom.sum-alt-row} is a
particular case of Exercise \ref{exe.binom.altsum-partial} \textbf{(a)}.
\end{exercise}

Let us illustrate the telescoping sum principle on another application: a new
proof of the hockey-stick identity (Theorem \ref{thm.binom.hock}):

\begin{proof}
[Second proof of Theorem \ref{thm.binom.hock}.]For each $j\in\mathbb{Z}$, we
have%
\begin{align*}
\dbinom{j+1}{k+1}  &  =\dbinom{\left(  j+1\right)  -1}{\left(  k+1\right)
-1}+\dbinom{\left(  j+1\right)  -1}{k+1}\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Theorem \ref{thm.binom.rec}, applied to }j+1\text{ and }k+1\\
\text{instead of }n\text{ and }k
\end{array}
\right) \\
&  =\dbinom{j}{k}+\dbinom{j}{k+1}\ \ \ \ \ \ \ \ \ \ \left(  \text{since
}\left(  j+1\right)  -1=j\text{ and }\left(  k+1\right)  -1=k\right)
\end{align*}
and therefore%
\begin{equation}
\dbinom{j}{k}=\dbinom{j+1}{k+1}-\dbinom{j}{k+1}.
\label{pf.thm.binom.hock.2nd.1}%
\end{equation}


But $n\in\mathbb{N}$, thus $0\leq n\leq n+1$. Also, $k\in\mathbb{N}$, thus
$k+1>0$ and therefore $k+1\neq0$. Hence, $\left[  k+1=0\right]  =0$. Now,
Lemma \ref{lem.binom.0Ck} (applied to $k+1$ instead of $k$) yields $\dbinom
{0}{k+1}=\left[  k+1=0\right]  =0$.

But%
\begin{align*}
&  \dbinom{0}{k}+\dbinom{1}{k}+\dbinom{2}{k}+\cdots+\dbinom{n}{k}\\
&  =\sum_{j=0}^{n}\underbrace{\dbinom{j}{k}}_{\substack{=\dbinom{j+1}%
{k+1}-\dbinom{j}{k+1}\\\text{(by (\ref{pf.thm.binom.hock.2nd.1}))}}%
}=\sum_{j=0}^{n}\left(  \dbinom{j+1}{k+1}-\dbinom{j}{k+1}\right)
=\dbinom{n+1}{k+1}-\underbrace{\dbinom{0}{k+1}}_{\substack{=0}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.sum.telesc-sum},
applied to }u=0\text{ and }v=n\text{ and }a_{j}=\dbinom{j}{k+1}\right) \\
&  =\dbinom{n+1}{k+1}.
\end{align*}
This proves Theorem \ref{thm.binom.hock} again.
\end{proof}

\subsubsection{A war between the odd and the even}

Proposition \ref{prop.binom.sum-alt-row} does not seem vulnerable to bijective
proof strategies: The sum $\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n}{k}$
contains both positive and negative numbers, and of course negative numbers
cannot be interpreted as sizes of sets. Nevertheless, it turns out that there
is a bijective proof of Proposition \ref{prop.binom.sum-alt-row}, and a rather
slick and simple one:

\begin{proof}
[Third proof of Proposition \ref{prop.binom.sum-alt-row} (sketched).]As in the
Second proof of Proposition \ref{prop.binom.sum-alt-row} above, we see that
Proposition \ref{prop.binom.sum-alt-row} holds for $n=0$. Thus, we WLOG assume
that $n\neq0$. Hence, $\left[  n=0\right]  =0$. We thus need to show that
\[
\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n}{k}=0.
\]
But the left hand side of this equality is%
\begin{align*}
\sum\limits_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n}{k}  &  =\sum
_{k\in\left\{  0,1,\ldots,n\right\}  }\left(  -1\right)  ^{k}\dbinom{n}{k}\\
&  =\sum_{\substack{k\in\left\{  0,1,\ldots,n\right\}  ;\\k\text{ is even}%
}}\ \ \underbrace{\left(  -1\right)  ^{k}}_{\substack{=1\\\text{(since
}k\text{ is even)}}}\dbinom{n}{k}+\sum_{\substack{k\in\left\{  0,1,\ldots
,n\right\}  ;\\k\text{ is odd}}}\ \ \underbrace{\left(  -1\right)  ^{k}%
}_{\substack{=-1\\\text{(since }k\text{ is odd)}}}\dbinom{n}{k}\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since each }k\in\left\{  0,1,\ldots,n\right\}  \text{ is either even or
odd,}\\
\text{but not both at the same time}%
\end{array}
\right) \\
&  =\sum_{\substack{k\in\left\{  0,1,\ldots,n\right\}  ;\\k\text{ is even}%
}}\dbinom{n}{k}+\underbrace{\sum_{\substack{k\in\left\{  0,1,\ldots,n\right\}
;\\k\text{ is odd}}}\left(  -1\right)  \dbinom{n}{k}}_{=-\sum_{\substack{k\in
\left\{  0,1,\ldots,n\right\}  ;\\k\text{ is odd}}}\dbinom{n}{k}}\\
&  =\sum_{\substack{k\in\left\{  0,1,\ldots,n\right\}  ;\\k\text{ is even}%
}}\dbinom{n}{k}-\sum_{\substack{k\in\left\{  0,1,\ldots,n\right\}  ;\\k\text{
is odd}}}\dbinom{n}{k}.
\end{align*}
Thus, we only need to prove that%
\begin{equation}
\sum_{\substack{k\in\left\{  0,1,\ldots,n\right\}  ;\\k\text{ even}}%
}\dbinom{n}{k}=\sum_{\substack{k\in\left\{  0,1,\ldots,n\right\}  ;\\k\text{
odd}}}\dbinom{n}{k}. \label{pf.prop.binom.sum-alt-row.3rd.ev=od}%
\end{equation}


We can prove this bijectively:

The left-hand side of (\ref{pf.prop.binom.sum-alt-row.3rd.ev=od}) is the \# of
subsets of $\left[  n\right]  $ of even size\footnote{\textit{Proof.} We have
$\left\vert \left[  n\right]  \right\vert =n$. If $B$ is any subset of
$\left[  n\right]  $, then Theorem \ref{thm.subset-leq} \textbf{(b)} (applied
to $A=\left[  n\right]  $) yields $\left\vert B\right\vert \leq\left\vert
\left[  n\right]  \right\vert =n$ and therefore $\left\vert B\right\vert
\in\left\{  0,1,\ldots,n\right\}  $. Furthermore, if $B$ is any subset of
$\left[  n\right]  $ of even size, then $\left\vert B\right\vert $ is an even
element of $\left\{  0,1,\ldots,n\right\}  $ (because we just saw that
$\left\vert B\right\vert \in\left\{  0,1,\ldots,n\right\}  $, but we also know
now that $\left\vert B\right\vert $ is even). Hence, the sum rule yields
\begin{align*}
&  \left(  \text{\# of subsets of }\left[  n\right]  \text{ of even
size}\right) \\
&  =\sum_{\substack{k\in\left\{  0,1,\ldots,n\right\}  ;\\k\text{ is even}%
}}\underbrace{\left(  \text{\# of subsets }B\text{ of }\left[  n\right]
\text{ satisfying }\left\vert B\right\vert =k\right)  }_{\substack{=\left(
\text{\# of }k\text{-element subsets of }\left[  n\right]  \right)
\\=\dbinom{n}{k}\\\text{(by Theorem \ref{thm.binom.comb},}\\\text{applied to
}S=\left[  n\right]  \text{)}}}\\
&  =\sum_{\substack{k\in\left\{  0,1,\ldots,n\right\}  ;\\k\text{ is even}%
}}\dbinom{n}{k}=\left(  \text{the left-hand side of
(\ref{pf.prop.binom.sum-alt-row.3rd.ev=od})}\right)  .
\end{align*}
}. The right-hand side of (\ref{pf.prop.binom.sum-alt-row.3rd.ev=od}) is the
\# of subsets of $\left[  n\right]  $ of odd size\footnote{for an analogous
reason}. Hence, the equality (\ref{pf.prop.binom.sum-alt-row.3rd.ev=od}) is
equivalent to%
\[
\left(  \text{\# of subsets of }\left[  n\right]  \text{ of even size}\right)
=\left(  \text{\# of subsets of }\left[  n\right]  \text{ of odd size}\right)
.
\]
This will follow immediately from the bijection principle, once we can find a
bijection%
\[
\left\{  \text{subsets of }\left[  n\right]  \text{ of even size}\right\}
\rightarrow\left\{  \text{subsets of }\left[  n\right]  \text{ of odd
size}\right\}  .
\]
Here is such a bijection:
\begin{align*}
\left\{  \text{subsets of }\left[  n\right]  \text{ of even size}\right\}   &
\rightarrow\left\{  \text{subsets of }\left[  n\right]  \text{ of odd
size}\right\}  ,\\
A  &  \mapsto%
\begin{cases}
A\cup\left\{  1\right\}  , & \text{if }1\notin A;\\
A\setminus\left\{  1\right\}  , & \text{if }1\in A
\end{cases}
.
\end{align*}
We need to actually convince ourselves that this map is
well-defined\footnote{This means proving that if $A$ is any subset of $\left[
n\right]  $ of even size, then $%
\begin{cases}
A\cup\left\{  1\right\}  , & \text{if }1\notin A;\\
A\setminus\left\{  1\right\}  , & \text{if }1\in A
\end{cases}
$ is a subset of $\left[  n\right]  $ of odd size. This relies on the
following facts:
\par
\begin{itemize}
\item We have $1\in\left[  n\right]  $ (since $n\neq0$).
\par
\item If $1\notin A$, then $\left\vert A\cup\left\{  1\right\}  \right\vert
=\left\vert A\right\vert +1$ is odd (since $\left\vert A\right\vert $ is
even).
\par
\item If $1\in A$, then $\left\vert A\setminus\left\{  1\right\}  \right\vert
=\left\vert A\right\vert -1$ is odd (since $\left\vert A\right\vert $ is
even).
\end{itemize}
} and actually a bijection\footnote{To prove this, we need to find an inverse
to it. This is easy: The inverse is given by the exact same formula! That is,
the inverse is the map%
\begin{align*}
\left\{  \text{subsets of }\left[  n\right]  \text{ of odd size}\right\}   &
\rightarrow\left\{  \text{subsets of }\left[  n\right]  \text{ of even
size}\right\}  ,\\
A  &  \mapsto%
\begin{cases}
A\cup\left\{  1\right\}  , & \text{if }1\notin A;\\
A\setminus\left\{  1\right\}  , & \text{if }1\in A
\end{cases}
.
\end{align*}
In order to see that this is really an inverse to our map, we need to show the
following:
\par
\begin{itemize}
\item If $1\notin A$, then $1\in A\cup\left\{  1\right\}  $ and $\left(
A\cup\left\{  1\right\}  \right)  \setminus\left\{  1\right\}  =A$.
\par
\item If $1\in A$, then $1\notin A\setminus\left\{  1\right\}  $ and $\left(
A\setminus\left\{  1\right\}  \right)  \cup\left\{  1\right\}  =A$.
\end{itemize}
\par
Of course, both of these claims are completely obvious.}. Thus,
(\ref{pf.prop.binom.sum-alt-row.3rd.ev=od}) is proved. As we have said, this
entails Proposition \ref{prop.binom.sum-alt-row}.
\end{proof}

The bijection we have used in this proof can be rewritten in an even simpler
way using a basic set-theoretical operation (almost as basic as union and
intersection of sets), called
\href{https://en.wikipedia.org/wiki/Symmetric_difference}{the \emph{symmetric
difference}}:

\begin{definition}
\label{def.symmdiff}Let $X$ and $Y$ be two sets. Then, the \emph{symmetric
difference} of $X$ and $Y$ is the set
\begin{align*}
&  \left\{  \text{all elements that lie in exactly one of the two sets
}X\text{ and }Y\right\} \\
&  =\left(  X\setminus Y\right)  \cup\left(  Y\setminus X\right)  =\left(
X\cup Y\right)  \setminus\left(  X\cap Y\right)  .
\end{align*}
This set is denoted by $X\bigtriangleup Y$.
\end{definition}

The Venn diagram for $X\bigtriangleup Y$ is%
\[
\begin{tikzpicture}
\fill[even odd rule, fill=gray] (0,0) circle (1) (1,0) circle (1);
\end{tikzpicture}
\]
(where the two circles represent $X$ and $Y$).

\begin{example}
We have $\left\{  1,2,3,4\right\}  \bigtriangleup\left\{  3,4,5,6\right\}
=\left\{  1,2,5,6\right\}  $.
\end{example}

The notion of symmetric difference has the following properties (which are all
straightforward to check using Venn diagrams or elementwise verification):

\begin{proposition}
\label{prop.symmdiff.props}\textbf{(a)} We have $X\bigtriangleup
X=\varnothing$ for any set $X$.

\textbf{(b)} We have $X\bigtriangleup\varnothing=X$ for any set $X$.

\textbf{(c)} We have $X\bigtriangleup Y=Y\bigtriangleup X$ for any two sets
$X$ and $Y$.

\textbf{(d)} We have $\left(  X\bigtriangleup Y\right)  \bigtriangleup
Z=X\bigtriangleup\left(  Y\bigtriangleup Z\right)  $ for any three sets $X$,
$Y$ and $Z$.

\textbf{(e)} We have $X\cap\left(  Y\bigtriangleup Z\right)  =\left(  X\cap
Y\right)  \bigtriangleup\left(  X\cap Z\right)  $ for any three sets $X$, $Y$
and $Z$.

\textbf{(f)} If $X$ and $Y$ are two finite sets, then $\left\vert
X\bigtriangleup Y\right\vert =\left\vert X\right\vert +\left\vert Y\right\vert
-2\left\vert X\cap Y\right\vert \equiv\left\vert X\right\vert +\left\vert
Y\right\vert \operatorname{mod}2$.
\end{proposition}

Using symmetric differences, we can now rewrite the bijection that we used in
the above Third proof of Proposition \ref{prop.binom.sum-alt-row} as%
\begin{align*}
\left\{  \text{subsets of }\left[  n\right]  \text{ of even size}\right\}   &
\rightarrow\left\{  \text{subsets of }\left[  n\right]  \text{ of odd
size}\right\}  ,\\
A  &  \mapsto A\bigtriangleup\left\{  1\right\}  .
\end{align*}
This makes it even easier to check that this map is well-defined and a bijection.

\subsection{\label{sect.binom.trinom}The trinomial revision formula}

\subsubsection{\label{subsect.binom.trinom.algpf}An algebraic proof}

Recall the trinomial revision formula (Proposition \ref{prop.binom.trin-rev}),
which states that%
\[
\dbinom{n}{a}\dbinom{a}{b}=\dbinom{n}{b}\dbinom{n-b}{a-b}%
\ \ \ \ \ \ \ \ \ \ \text{for all }n,a,b\in\mathbb{R}.
\]
We have previously stated this without proof; let us prove it now:

\begin{proof}
[Proof of Proposition \ref{prop.binom.trin-rev}.]We must be in one of the
following four cases:

\textit{Case 1:} We have $b\notin\mathbb{N}$.

\textit{Case 2:} We have $b\in\mathbb{N}$ and $a\notin\mathbb{N}$.

\textit{Case 3:} We have $b\in\mathbb{N}$ and $a\in\mathbb{N}$ but $a<b$.

\textit{Case 4:} We have $b\in\mathbb{N}$ and $a\in\mathbb{N}$ and $a\geq b$.

Let us first consider Case 1. In this case, we have $b\notin\mathbb{N}$.
Hence, (\ref{eq.def.binom.def.b}) (applied to $a$ and $b$ instead of $n$ and
$k$) yields $\dbinom{a}{b}=0$. Also, (\ref{eq.def.binom.def.b}) (applied to
$k=b$) yields $\dbinom{n}{b}=0$. Now, comparing%
\[
\dbinom{n}{a}\underbrace{\dbinom{a}{b}}_{=0}=0\ \ \ \ \ \ \ \ \ \ \text{with}%
\ \ \ \ \ \ \ \ \ \ \underbrace{\dbinom{n}{b}}_{=0}\dbinom{n-b}{a-b}=0,
\]
we obtain $\dbinom{n}{a}\dbinom{a}{b}=\dbinom{n}{b}\dbinom{n-b}{a-b}$. Thus,
Proposition \ref{prop.binom.trin-rev} is proven in Case 1.

Let us now consider Case 2. In this case, we have $b\in\mathbb{N}$ and
$a\notin\mathbb{N}$. Hence, (\ref{eq.def.binom.def.b}) (applied to $k=a$)
yields $\dbinom{n}{a}=0$. Also, $a-b\notin\mathbb{N}$%
\ \ \ \ \footnote{\textit{Proof.} Assume the contrary. Thus, $a-b\in
\mathbb{N}$. Hence, $a=\underbrace{a-b}_{\in\mathbb{N}}+\underbrace{b}%
_{\in\mathbb{N}}\in\mathbb{N}$ (since the sum of two elements of $\mathbb{N}$
is always an element of $\mathbb{N}$), which contradicts $a\notin\mathbb{N}$.
Hence, we have obtained a contradiction. This shows that our assumption was
false, qed.}. Hence, (\ref{eq.def.binom.def.b}) (applied to $n-b$ and $a-b$
instead of $n$ and $k$) yields $\dbinom{n-b}{a-b}=0$. Now, comparing%
\[
\underbrace{\dbinom{n}{a}}_{=0}\dbinom{a}{b}=0\ \ \ \ \ \ \ \ \ \ \text{with}%
\ \ \ \ \ \ \ \ \ \ \dbinom{n}{b}\underbrace{\dbinom{n-b}{a-b}}_{=0}=0,
\]
we obtain $\dbinom{n}{a}\dbinom{a}{b}=\dbinom{n}{b}\dbinom{n-b}{a-b}$. Thus,
Proposition \ref{prop.binom.trin-rev} is proven in Case 2.

Let us now consider Case 3. In this case, we have $b\in\mathbb{N}$ and
$a\in\mathbb{N}$ but $a<b$. From $a<b$, we obtain $a-b<0$, so that
$a-b\notin\mathbb{N}$. Hence, (\ref{eq.def.binom.def.b}) (applied to $n-b$ and
$a-b$ instead of $n$ and $k$) yields $\dbinom{n-b}{a-b}=0$. Also, $b>a$ (since
$a<b$). Hence, Proposition \ref{prop.binom.0} (applied to $a$ and $b$ instead
of $n$ and $k$) yields $\dbinom{a}{b}=0$. Now, comparing%
\[
\dbinom{n}{a}\underbrace{\dbinom{a}{b}}_{=0}=0\ \ \ \ \ \ \ \ \ \ \text{with}%
\ \ \ \ \ \ \ \ \ \ \dbinom{n}{b}\underbrace{\dbinom{n-b}{a-b}}_{=0}=0,
\]
we obtain $\dbinom{n}{a}\dbinom{a}{b}=\dbinom{n}{b}\dbinom{n-b}{a-b}$. Thus,
Proposition \ref{prop.binom.trin-rev} is proven in Case 3.

Let us finally consider Case 4. In this case, we have $b\in\mathbb{N}$ and
$a\in\mathbb{N}$ and $a\geq b$. From this, we conclude that $a-b\in\mathbb{N}$
and $b\leq a$. Hence, Theorem \ref{thm.binom.fac} (applied to $a$ and $b$
instead of $n$ and $k$) yields
\begin{equation}
\dbinom{a}{b}=\dfrac{a!}{b!\cdot\left(  a-b\right)  !}.
\label{pf.prop.binom.trin-rev.c4.1}%
\end{equation}
Also, (\ref{eq.def.binom.def.a}) (applied to $k=a$) yields%
\[
\dbinom{n}{a}=\dfrac{n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(
n-a+1\right)  }{a!}.
\]
Multiplying this equality by (\ref{pf.prop.binom.trin-rev.c4.1}), we obtain%
\begin{align}
\dbinom{n}{a}\dbinom{a}{b}  &  =\dfrac{n\left(  n-1\right)  \left(
n-2\right)  \cdots\left(  n-a+1\right)  }{a!}\cdot\dfrac{a!}{b!\left(
a-b\right)  !}\nonumber\\
&  =\dfrac{n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(
n-a+1\right)  }{b!\cdot\left(  a-b\right)  !}.
\label{pf.prop.binom.trin-rev.c4.lhs}%
\end{align}


On the other hand, (\ref{eq.def.binom.def.a}) (applied to $k=b$) yields%
\[
\dbinom{n}{b}=\dfrac{n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(
n-b+1\right)  }{b!}.
\]
Furthermore, (\ref{eq.def.binom.def.a}) (applied to $n-b$ and $a-b$ instead of
$n$ and $k$) yields
\begin{align*}
\dbinom{n-b}{a-b}  &  =\dfrac{\left(  n-b\right)  \left(  n-b-1\right)
\left(  n-b-2\right)  \cdots\left(  \left(  n-b\right)  -\left(  a-b\right)
+1\right)  }{\left(  a-b\right)  !}\\
&  =\dfrac{\left(  n-b\right)  \left(  n-b-1\right)  \left(  n-b-2\right)
\cdots\left(  n-a+1\right)  }{\left(  a-b\right)  !}.
\end{align*}
Multiplying these two equalities, we find%
\begin{align*}
&  \dbinom{n}{b}\dbinom{n-b}{a-b}\\
&  =\dfrac{n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(
n-b+1\right)  }{b!}\cdot\dfrac{\left(  n-b\right)  \left(  n-b-1\right)
\left(  n-b-2\right)  \cdots\left(  n-a+1\right)  }{\left(  a-b\right)  !}\\
&  =\dfrac{\left(  n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(
n-b+1\right)  \right)  \cdot\left(  \left(  n-b\right)  \left(  n-b-1\right)
\left(  n-b-2\right)  \cdots\left(  n-a+1\right)  \right)  }{b!\cdot\left(
a-b\right)  !}\\
&  =\dfrac{n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(
n-a+1\right)  }{b!\cdot\left(  a-b\right)  !}%
\end{align*}
(because
\begin{align*}
&  \left(  n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(
n-b+1\right)  \right)  \cdot\left(  \left(  n-b\right)  \left(  n-b-1\right)
\left(  n-b-2\right)  \cdots\left(  n-a+1\right)  \right) \\
&  =n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(  n-a+1\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since }0\leq b\leq a\text{, and thus the}\\
\text{product }n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(
n-a+1\right)  \text{ can be split into}\\
\left(  n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(  n-b+1\right)
\right)  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \\
\ \ \ \ \ \ \ \ \ \ \cdot\left(  \left(  n-b\right)  \left(  n-b-1\right)
\left(  n-b-2\right)  \cdots\left(  n-a+1\right)  \right)
\end{array}
\right)
\end{align*}
). Comparing this with (\ref{pf.prop.binom.trin-rev.c4.lhs}), we obtain%
\[
\dbinom{n}{a}\dbinom{a}{b}=\dbinom{n}{b}\dbinom{n-b}{a-b}.
\]
Thus, Proposition \ref{prop.binom.trin-rev} is proven in Case 4.

We have now proved Proposition \ref{prop.binom.trin-rev} in each of the four
Cases 1, 2, 3 and 4. Hence, Proposition \ref{prop.binom.trin-rev} always holds.
\end{proof}

It is worth taking a second look at the structure of our above proof of
Proposition \ref{prop.binom.trin-rev}: This proof was subdivided into four
cases. In the first three of these cases, the proposition boiled down to $0=0$
(but for different reasons in each case). Only in the fourth case did we end
up proving anything interesting. This suggests that the generality in which we
stated Proposition \ref{prop.binom.trin-rev} (allowing all of $n,a,b$ to be
arbitrary reals) was perhaps more of a handicap than a helpful feature.
Nevertheless, this generality pays off: We only need to prove the proposition
once, and then we get to use it as often as we want, so a few extra cases are
worth the trouble.

As an application of Proposition \ref{prop.binom.trin-rev}, let us prove a
slight generalization of the absorption formula (Proposition
\ref{prop.binom.X-1}):

\begin{corollary}
[Absorption formula II]\label{cor.binom.absorp2}Let $n\in\mathbb{R}%
\setminus\left\{  0\right\}  $ and $m\in\mathbb{R}$. Then,%
\[
\dbinom{m}{n}=\dfrac{m}{n}\dbinom{m-1}{n-1}.
\]

\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.binom.absorp2}.]Proposition
\ref{prop.binom.trin-rev} (applied to $m$, $n$ and $1$ instead of $n$, $a$ and
$b$) yields%
\begin{equation}
\dbinom{m}{n}\dbinom{n}{1}=\dbinom{m}{1}\dbinom{m-1}{n-1}.
\label{pf.cor.binom.absorp2.1}%
\end{equation}
But we have $\dbinom{n}{1}=n$ (by (\ref{eq.exa.binom.small.nC1})) and
$\dbinom{m}{1}=m$ (likewise). Hence, the formula (\ref{pf.cor.binom.absorp2.1}%
) rewrites as%
\[
\dbinom{m}{n}n=m\dbinom{m-1}{n-1}.
\]
Dividing both sides of this equality by $n$, we find%
\[
\dbinom{m}{n}=\dfrac{m\dbinom{m-1}{n-1}}{n}=\dfrac{m}{n}\dbinom{m-1}{n-1}.
\]
This proves Corollary \ref{cor.binom.absorp2}.
\end{proof}

\begin{exercise}
\label{exe.rewr-prod}Let $n\in\mathbb{Q}$, $a\in\mathbb{N}$ and $b\in
\mathbb{N}$.

\textbf{(a)} Prove that every integer $j\geq a$ satisfies%
\[
\dbinom{n}{j}\dbinom{j}{a}\dbinom{n-j}{b}=\dbinom{n}{a}\dbinom{n-a}{b}%
\dbinom{n-a-b}{j-a}.
\]


\textbf{(b)} Compute the sum $\sum_{j=a}^{n}\dbinom{n}{j}\dbinom{j}{a}%
\dbinom{n-j}{b}$ for every integer $n\geq a$. (The result should contain no
summation signs.)
\end{exercise}

\begin{center}
\fbox{\textbf{Class of 2019-10-18}}
\end{center}

\subsubsection{\label{subsect.binom.trinom.dcproof}A double counting proof}

Let us give a different proof of Proposition \ref{prop.binom.trin-rev} -- or,
more precisely, a partial proof, since it will only work in the case when
$n\in\mathbb{N}$. (In Subsection \ref{subsect.binom.vander.salvage-more}, we
will learn a trick that will allow us to extend this proof to a complete proof
of Proposition \ref{prop.binom.trin-rev}; essentially, we will learn a way to
(rigorously) argue that if an identity such as $\dbinom{n}{a}\dbinom{a}%
{b}=\dbinom{n}{b}\dbinom{n-b}{a-b}$ holds for all $n\in\mathbb{N}$, then it
must also hold for all $n\in\mathbb{R}$, and therefore it suffices to prove it
for $n\in\mathbb{N}$ only. This is called the \textquotedblleft polynomial
identity trick\textquotedblright, and, in a nutshell, the thing that makes it
work is that both $\dbinom{n}{a}\dbinom{a}{b}$ and $\dbinom{n}{b}\dbinom
{n-b}{a-b}$ are polynomials in $n$. But for now, let us just prove Proposition
\ref{prop.binom.trin-rev} in the case when $n\in\mathbb{N}$.)

Let us first present our partial proof in an informal way:

\begin{proof}
[Second proof of Proposition \ref{prop.binom.trin-rev} for $n\in\mathbb{N}$
(informal version).]Assume that $n\in\mathbb{N}$.

Fix a set $N$ of $n$ people.

We consider pairs $\left(  A,B\right)  $, where $A$ is a committee consisting
of $a$ people from $N$ (that is, an $a$-element subset of $N$) and where $B$
is a subcommittee consisting of $b$ people from this committee $A$ (that is, a
$b$-element subset of $A$).\ \ \ \ \footnote{Here is a symbolic picture of
this situation:%
\[
\begin{tikzpicture}
\draw[fill=yellow!50] (0.5, 0.5) rectangle +(6, 3);
\draw[fill=green!50] (3, 2) ellipse (2 and 1);
\draw[fill=red!50] (2, 2) ellipse (0.5 and 0.5);
\node at (2, 2) {$B$};
\node at (4, 2) {$A$};
\node at (6, 3) {$N$};
\end{tikzpicture}\ \ .
\]
} Formally speaking, these are simply pairs $\left(  A,B\right)  $ of sets
satisfying $B\subseteq A\subseteq N$ and $\left\vert A\right\vert =a$ and
$\left\vert B\right\vert =b$. How many such pairs $\left(  A,B\right)  $ are
there? We shall refer to such pairs as \emph{CS pairs\footnote{short for
\textquotedblleft committee-subcommittee pairs\textquotedblright}}, and we
shall count their \# in two ways\footnote{We will be using Theorem
\ref{thm.binom.comb} in both of these ways.}:

\textit{First way:} In order to construct a CS pair $\left(  A,B\right)  $, we
first choose the committee $A$ and then choose its subcommittee $B$. We have
$\dbinom{n}{a}$ many options for $A$ (because $A$ has to be an $a$-element
subset of the $n$-element set $N$), and after choosing $A$, we have
$\dbinom{a}{b}$ many options for $B$ (because $B$ has to be a $b$-element
subset of $A$). Thus, the total \# of CS pairs is a sum of $\dbinom{n}{a}$
many copies of $\dbinom{a}{b}$. In other words, this \# is $\dbinom{n}%
{a}\dbinom{a}{b}$.

\textit{Second way:} In order to construct a CS pair $\left(  A,B\right)  $,
we first choose the subcommittee $B$ and then choose the committee $A$. We
have $\dbinom{n}{b}$ many options for $B$ (because $B$ has to be a $b$-element
subset of the $n$-element set $N$). After choosing $B$, how many options do we
have for $A$ ? The committee $A$ has to be an $a$-element subset of $N$, but
it is also required to contain the (already chosen) subcommittee $B$ as a
subset, so that $b$ of its $a$ elements are already decided. We only need to
choose the remaining $a-b$ elements of $A$. These elements have to come from
the $\left(  n-b\right)  $-element set $N\setminus B$ (because the elements of
$B$ have already been chosen to lie in $A$). Thus, we are choosing an $\left(
a-b\right)  $-element subset of the $\left(  n-b\right)  $-element set
$N\setminus B$. Thus, we have $\dbinom{n-b}{a-b}$ many options for choosing
$A$. Hence, the total \# of CS pairs is a sum of $\dbinom{n}{b}$ many copies
of $\dbinom{n-b}{a-b}$. In other words, this \# is $\dbinom{n}{b}\dbinom
{n-b}{a-b}$.

Now, we have computed the \# of CS pairs in two different ways. The first way
gave us the result $\dbinom{n}{a}\dbinom{a}{b}$, while the second way gave us
the result $\dbinom{n}{b}\dbinom{n-b}{a-b}$. Comparing these results, we find
$\dbinom{n}{a}\dbinom{a}{b}=\dbinom{n}{b}\dbinom{n-b}{a-b}$. Thus, Proposition
\ref{prop.binom.trin-rev} is proven (in the case when $n\in\mathbb{N}$).
\end{proof}

How can we formalize this argument? It is clear how to formalize the notion of
a CS pair (just replace \textquotedblleft$n$ people\textquotedblright\ by $n$
mathematical objects, such as the numbers $1,2,\ldots,n$). But how do we
formalize our two ways of counting the \# of CS pairs?

Let us look at the first way. On its surface, it may seem like we have applied
the product rule (Theorem \ref{thm.prodrule2}) in order to obtain $\dbinom
{n}{a}\dbinom{a}{b}$ (similarly to how we applied it back in the proof of
Proposition \ref{prop.count.subsets.a-ev-b-od-n-ev}). But this appearance is
misleading. If we wanted to apply Theorem \ref{thm.prodrule2}, we would have
to interpret $\dbinom{n}{a}\dbinom{a}{b}$ as $\left\vert X\right\vert
\cdot\left\vert Y\right\vert $ for two sets $X$ and $Y$. Thus, we would need
two sets $X$ and $Y$ such that the CS pairs are elements of $X\times Y$ (or at
least are in obvious bijection to the latter\footnote{We are using some basic
combinatorial slang here: We say that objects of some type are \emph{in
bijection with} objects of another type if there exists a bijection from
$\left\{  \text{objects of the first type}\right\}  $ to $\left\{
\text{objects of the second type}\right\}  $.}). The obvious choice would be
$X=\left\{  a\text{-element subsets of }N\right\}  $ and $Y=\left\{
b\text{-element subsets of }A\right\}  $, but this does not work: The set $Y$
needs to be defined independently of $A$; but here it clearly is not. This is
no surprise: If we choose a CS pair $\left(  A,B\right)  $ by first choosing
$A$, then the options available for $B$ will depend on which $A$ we have
chosen (because we must have $B\subseteq A$). We are in luck because the
\textbf{number} of these options does not depend on $A$ (but always is
$\dbinom{a}{b}$); but the \textbf{set} of these options does depend on $A$.
Theorem \ref{thm.prodrule2} is not general enough to accommodate this situation.

There are two ways to resolve this problem. One is to generalize Theorem
\ref{thm.prodrule2} to cover dependent choices. This results in a
\textquotedblleft dependent product rule\textquotedblright, which (informally)
says the following:

\begin{statement}
\textbf{\textquotedblleft Dependent product rule\textquotedblright\ for two
sets:} Consider a situation in which you have to make two choices
(sequentially). Assume that you have $a_{1}$ options available in choice $1$,
and then (after making choice $1$) you have $a_{2}$ options available in
choice $2$ (no matter which option you chose in choice $1$). Then, the total
\# of ways to make both choices\footnote{i.e., of pairs $\left(  x,y\right)
$, where $x$ is an option you can choose in choice $1$, and $y$ is an option
you can choose in choice $2$ after choosing $x$ in choice $1$} is $a_{1}a_{2}$.
\end{statement}

To formalize this, we can let $X$ be the set of all available options in
choice $1$, and let $Y$ be the set of all options that may be available in
choice $2$ (including the ones whose availability depends on what you chose in
choice $1$), and let $S$ be the set of all ways to make both choices. Then,
our \textquotedblleft dependent product rule\textquotedblright\ turns into the
following rigorous fact:

\begin{theorem}
\label{thm.deprodrule2}Let $a_{1}$ and $a_{2}$ be two numbers. Let $X$ and $Y$
be finite sets. Let $S$ be a subset of $X\times Y$. Assume that $\left\vert
X\right\vert =a_{1}$. Assume further that for each $x\in X$, there are
precisely $a_{2}$ many elements $y\in Y$ such that $\left(  x,y\right)  \in S$
(even though the set of these $y$ may depend on $x$). Then, $\left\vert
S\right\vert =a_{1}a_{2}$.
\end{theorem}

We leave the proof of this theorem to the reader, as we will not use it:

\begin{exercise}
\label{exe.deprodrule2}Prove Theorem \ref{thm.deprodrule2}.
\end{exercise}

More generally, Theorem \ref{thm.prodrulen} can be generalized to cover
several dependent choices:

\begin{statement}
\textbf{\textquotedblleft Dependent product rule\textquotedblright\ for }%
$n$\textbf{ sets:} Consider a situation in which you have to make $n$ choices
(sequentially). Assume that you have $a_{1}$ options available in choice $1$,
and then (after making choice $1$) you have $a_{2}$ options available in
choice $2$ (no matter which option you chose in choice $1$), and then (after
both choices $1$ and $2$) you have $a_{3}$ options available in choice $3$ (no
matter which options you chose in choices $1$ and $2$), and so on. Then, the
total \# of ways to make all $n$ choices is $a_{1}a_{2}\cdots a_{n}$.
\end{statement}

Formal versions of this rule can be found in \cite[\S 1.8]{Loehr-BC} and in
\cite[Theorem 7.2.19]{Newste19}.

However, all of this is entirely optional, because there is a simpler way to
formalize our proof of Proposition \ref{prop.binom.trin-rev}. Instead of
adapting the product rule, we can simply apply the sum rule (more precisely,
Theorem \ref{thm.sumrule2}) and observe that all addends of the resulting sum
are equal (which means that the sum simplifies to a product). This leads to
the following proof:

\begin{proof}
[Second proof of Proposition \ref{prop.binom.trin-rev} for $n\in\mathbb{N}$
(formal version).]Let $N=\left[  n\right]  $. Thus, $N$ is an $n$-element set.

A \emph{CS pair} shall mean a pair $\left(  A,B\right)  $ of sets satisfying
$B\subseteq A\subseteq N$ and $\left\vert A\right\vert =a$ and $\left\vert
B\right\vert =b$. Hence, if $\left(  A,B\right)  $ is a CS pair, then $A$ is
an $a$-element subset of $N$ (since $A\subseteq N$ and $\left\vert
A\right\vert =a$), and $B$ is a $b$-element subset of $N$ (since $B\subseteq
N$ and $\left\vert B\right\vert =b$).

We shall compute the number $\left\vert \left\{  \text{CS pairs}\right\}
\right\vert $ in two ways.

\textit{First way:} Let $f:\left\{  \text{CS pairs}\right\}  \rightarrow
\left\{  a\text{-element subsets of }N\right\}  $ be the map that sends each
CS pair $\left(  A,B\right)  $ to its first entry $A$. (This is well-defined,
because if $\left(  A,B\right)  $ is a CS pair, then $A$ is an $a$-element
subset of $N$.)

Theorem \ref{thm.sumrule2} (applied to $S=\left\{  \text{CS pairs}\right\}  $
and $W=\left\{  a\text{-element subsets of }N\right\}  $) yields%
\begin{align}
&  \left\vert \left\{  \text{CS pairs}\right\}  \right\vert \nonumber\\
&  =\sum_{w\in\left\{  a\text{-element subsets of }N\right\}  }\left(
\text{\# of }s\in\left\{  \text{CS pairs}\right\}  \text{ satisfying }f\left(
s\right)  =w\right) \nonumber\\
&  =\sum_{C\in\left\{  a\text{-element subsets of }N\right\}  }%
\underbrace{\left(  \text{\# of }s\in\left\{  \text{CS pairs}\right\}  \text{
satisfying }f\left(  s\right)  =C\right)  }_{\substack{=\left(  \text{\# of CS
pairs }s\text{ satisfying }f\left(  s\right)  =C\right)  \\=\left(  \text{\#
of CS pairs whose first entry is }C\right)  \\\text{(because if }s\text{ is a
CS pair, then }f\left(  s\right)  \text{ is the first entry of }s\\\text{(by
the definition of }f\text{))}}}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have renamed the index }w\text{
as }C\right) \nonumber\\
&  =\sum_{C\in\left\{  a\text{-element subsets of }N\right\}  }\left(
\text{\# of CS pairs whose first entry is }C\right)  .
\label{pf.prop.binom.trin-rev.2nd.fml.1}%
\end{align}


Now, fix $C\in\left\{  a\text{-element subsets of }N\right\}  $. Thus, $C$ is
an $a$-element subset of $N$. Thus, $\left\vert C\right\vert =a$, so that
$a=\left\vert C\right\vert \in\mathbb{N}$. Now, what are the CS pairs whose
first entry is $C$ ? They are precisely the CS pairs of the form $\left(
C,B\right)  $ for some $b$-element subset $B$ of $C$. Thus, the map%
\begin{align*}
\left\{  \text{CS pairs whose first entry is }C\right\}   &  \rightarrow
\left\{  b\text{-element subsets of }C\right\}  ,\\
\left(  C,B\right)   &  \mapsto B
\end{align*}
is well-defined. In the other direction, there is a map%
\begin{align*}
\left\{  b\text{-element subsets of }C\right\}   &  \rightarrow\left\{
\text{CS pairs whose first entry is }C\right\}  ,\\
B  &  \mapsto\left(  C,B\right)  .
\end{align*}
Clearly, these two maps are mutually inverse. Thus, they are bijections.
Hence, the bijection principle yields%
\begin{align}
&  \left(  \text{\# of CS pairs whose first entry is }C\right) \nonumber\\
&  =\left(  \text{\# of }b\text{-element subsets of }C\right)  =\dbinom{a}{b}
\label{pf.prop.binom.trin-rev.2nd.fml.2}%
\end{align}
(by Theorem \ref{thm.binom.comb}, applied to $a$, $C$ and $b$ instead of $n$,
$S$ and $k$).

Now, forget that we fixed $C$. We thus have shown that
(\ref{pf.prop.binom.trin-rev.2nd.fml.2}) holds for every $C\in\left\{
a\text{-element subsets of }N\right\}  $. Thus,
(\ref{pf.prop.binom.trin-rev.2nd.fml.1}) becomes%
\begin{align}
&  \left\vert \left\{  \text{CS pairs}\right\}  \right\vert \nonumber\\
&  =\sum_{C\in\left\{  a\text{-element subsets of }N\right\}  }%
\underbrace{\left(  \text{\# of CS pairs whose first entry is }C\right)
}_{\substack{=\dbinom{a}{b}\\\text{(by (\ref{pf.prop.binom.trin-rev.2nd.fml.2}%
))}}}\label{pf.prop.binom.trin-rev.2nd.fml.3o}\\
&  =\sum_{C\in\left\{  a\text{-element subsets of }N\right\}  }\dbinom{a}%
{b}=\underbrace{\left\vert \left\{  a\text{-element subsets of }N\right\}
\right\vert }_{\substack{=\left(  \text{\# of }a\text{-element subsets of
}N\right)  \\=\dbinom{n}{a}\\\text{(by Theorem \ref{thm.binom.comb}, applied
to }S=N\text{ and }k=a\text{)}}}\cdot\,\dbinom{a}{b}\nonumber\\
&  =\dbinom{n}{a}\dbinom{a}{b}. \label{pf.prop.binom.trin-rev.2nd.fml.3}%
\end{align}


\textit{Second way:} Forget about the map $f$ defined previously.

Instead, let $f:\left\{  \text{CS pairs}\right\}  \rightarrow\left\{
b\text{-element subsets of }N\right\}  $ be the map that sends each CS pair
$\left(  A,B\right)  $ to its second entry $B$. (This is well-defined, because
if $\left(  A,B\right)  $ is a CS pair, then $B$ is a $b$-element subset of
$N$.)

Theorem \ref{thm.sumrule2} (applied to $S=\left\{  \text{CS pairs}\right\}  $
and $W=\left\{  b\text{-element subsets of }N\right\}  $) yields%
\begin{align}
&  \left\vert \left\{  \text{CS pairs}\right\}  \right\vert \nonumber\\
&  =\sum_{w\in\left\{  b\text{-element subsets of }N\right\}  }\left(
\text{\# of }s\in\left\{  \text{CS pairs}\right\}  \text{ satisfying }f\left(
s\right)  =w\right) \nonumber\\
&  =\sum_{D\in\left\{  b\text{-element subsets of }N\right\}  }%
\underbrace{\left(  \text{\# of }s\in\left\{  \text{CS pairs}\right\}  \text{
satisfying }f\left(  s\right)  =D\right)  }_{\substack{=\left(  \text{\# of CS
pairs }s\text{ satisfying }f\left(  s\right)  =D\right)  \\=\left(  \text{\#
of CS pairs whose second entry is }D\right)  \\\text{(because if }s\text{ is a
CS pair, then }f\left(  s\right)  \text{ is the second entry of }s\\\text{(by
the definition of }f\text{))}}}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have renamed the index }w\text{
as }D\right) \nonumber\\
&  =\sum_{D\in\left\{  b\text{-element subsets of }N\right\}  }\left(
\text{\# of CS pairs whose second entry is }D\right)  .
\label{pf.prop.binom.trin-rev.2nd.fml.6}%
\end{align}


Now, fix $D\in\left\{  b\text{-element subsets of }N\right\}  $. Thus, $D$ is
a $b$-element subset of $N$. Hence, $\left\vert D\right\vert =b$, so that
$b=\left\vert D\right\vert \in\mathbb{N}$. Now, what are the CS pairs whose
second entry is $D$ ? They are precisely the CS pairs of the form $\left(
A,D\right)  $ for some $a$-element subset $A$ of $N$ satisfying $D\subseteq
A$. Thus, the map%
\begin{align*}
\left\{  \text{CS pairs whose second entry is }D\right\}   &  \rightarrow
\left\{  a\text{-element subsets }A\text{ of }N\text{ satisfying }D\subseteq
A\right\}  ,\\
\left(  A,D\right)   &  \mapsto A
\end{align*}
is well-defined. In the other direction, there is a map%
\begin{align*}
\left\{  a\text{-element subsets }A\text{ of }N\text{ satisfying }D\subseteq
A\right\}   &  \rightarrow\left\{  \text{CS pairs whose second entry is
}D\right\}  ,\\
A  &  \mapsto\left(  A,D\right)  .
\end{align*}
Clearly, these two maps are mutually inverse. Thus, they are bijections.
Hence, the bijection principle yields%
\begin{align}
&  \left(  \text{\# of CS pairs whose second entry is }D\right) \nonumber\\
&  =\left(  \text{\# of }a\text{-element subsets }A\text{ of }N\text{
satisfying }D\subseteq A\right) \nonumber\\
&  =\dbinom{n-b}{a-b} \label{pf.prop.binom.trin-rev.2nd.fml.7}%
\end{align}
(by Proposition \ref{prop.count.subsets.Dsub}, applied to $d=b$ and $k=a$).

Now, forget that we fixed $D$. We thus have shown that
(\ref{pf.prop.binom.trin-rev.2nd.fml.7}) holds for every $D\in\left\{
b\text{-element subsets of }N\right\}  $. Thus,
(\ref{pf.prop.binom.trin-rev.2nd.fml.6}) becomes%
\begin{align}
&  \left\vert \left\{  \text{CS pairs}\right\}  \right\vert \nonumber\\
&  =\sum_{D\in\left\{  b\text{-element subsets of }N\right\}  }%
\underbrace{\left(  \text{\# of CS pairs whose second entry is }D\right)
}_{\substack{=\dbinom{n-b}{a-b}\\\text{(by
(\ref{pf.prop.binom.trin-rev.2nd.fml.7}))}}}\nonumber\\
&  =\sum_{D\in\left\{  b\text{-element subsets of }N\right\}  }\dbinom
{n-b}{a-b}=\underbrace{\left\vert \left\{  b\text{-element subsets of
}N\right\}  \right\vert }_{\substack{=\left(  \text{\# of }b\text{-element
subsets of }N\right)  \\=\dbinom{n}{b}\\\text{(by Theorem \ref{thm.binom.comb}%
, applied to }S=N\text{ and }k=b\text{)}}}\cdot\,\dbinom{n-b}{a-b}\nonumber\\
&  =\dbinom{n}{b}\dbinom{n-b}{a-b}. \label{pf.prop.binom.trin-rev.2nd.fml.8}%
\end{align}


Now, comparing (\ref{pf.prop.binom.trin-rev.2nd.fml.3}) with
(\ref{pf.prop.binom.trin-rev.2nd.fml.8}), we obtain%
\[
\dbinom{n}{a}\dbinom{a}{b}=\dbinom{n}{b}\dbinom{n-b}{a-b}.
\]
This proves Proposition \ref{prop.binom.trin-rev} in the case when
$n\in\mathbb{N}$.
\end{proof}

\begin{remark}
Something looks fishy. In the second proof of Proposition
\ref{prop.binom.trin-rev} we gave above, we have assumed that $n\in\mathbb{N}%
$, but we have not assumed that $a\in\mathbb{N}$. But then, how did we manage
to obtain a combinatorial interpretation for $\dbinom{a}{b}$ such as
(\ref{pf.prop.binom.trin-rev.2nd.fml.2}), which shows that $\dbinom{a}{b}$ is
an integer? Doesn't this contradict the fact that $\dbinom{a}{b}$ is usually
not an integer when $a\notin\mathbb{N}$ ? Where is our mistake?

It turns out that there is nothing wrong with our proof. The crux of the
matter is the little sentence \textquotedblleft Now, fix $C\in\left\{
a\text{-element subsets of }N\right\}  $\textquotedblright. This sentence
provides the context in which the equality
(\ref{pf.prop.binom.trin-rev.2nd.fml.2}) was stated. In other words, we have
only claimed that the equality (\ref{pf.prop.binom.trin-rev.2nd.fml.2}) holds
\textbf{for each }$C\in\left\{  a\text{-element subsets of }N\right\}  $.
Thus, $\dbinom{a}{b}$ will be an integer \textbf{for each }$C\in\left\{
a\text{-element subsets of }N\right\}  $. Even though $\dbinom{a}{b}$ does not
depend on $C$, we cannot just throw the \textquotedblleft for each
$C\in\left\{  a\text{-element subsets of }N\right\}  $\textquotedblright\ part
of this statement away, because there is no a-priori guarantee that there
exists a $C\in\left\{  a\text{-element subsets of }N\right\}  $. And indeed,
such a $C$ can exist only when $a\in\mathbb{N}$ (and, even stronger,
$a\in\left\{  0,1,\ldots,n\right\}  $); and $\dbinom{a}{b}$ is indeed an
integer in this case. When such a $C$ does not exist, $\dbinom{a}{b}$ will
\textbf{not} always be an integer. So the equality
(\ref{pf.prop.binom.trin-rev.2nd.fml.2}) leads to a contradiction if we take
it out of its context, but inside its context it is perfectly correct.

The sentence \textquotedblleft Now, forget that we fixed $C$\textquotedblright%
\ that appeared later on in the proof marks the end of this context. After
this sentence, $C$ is no longer a fixed $a$-element subset of $N$, and the
equality (\ref{pf.prop.binom.trin-rev.2nd.fml.3}) can be applied to any
$a$-element subset of $N$ in the role of $C$. (Thus, in particular,
(\ref{pf.prop.binom.trin-rev.2nd.fml.3}) can be applied to manipulate the
addends in the sum appearing in (\ref{pf.prop.binom.trin-rev.2nd.fml.3o}),
because this sum ranges over all $a$-element subsets of $N$. Of course, when
$a\notin\mathbb{N}$, then this sum is an empty sum.)
\end{remark}

\begin{exercise}
\label{exe.simple-counts}Let $k$ be a positive integer.

\textbf{(a)} How many $k$-digit numbers are there? (A \textquotedblleft%
$k$-digit number\textquotedblright\ means a nonnegative integer that has $k$
digits without leading zeroes. For example, $3902$ is a $4$-digit number, not
a $5$-digit number. Note that $0$ counts as a $0$-digit number, not as a
$1$-digit number.)

\textbf{(b)} How many $k$-digit numbers are there that have no two equal digits?

\textbf{(c)} How many $k$-digit numbers have an even sum of digits?

\textbf{(d)} How many $k$-digit numbers are palindromes? (A \textquotedblleft%
\emph{palindrome}\textquotedblright\ is a number such that reading its digits
from right to left yields the same number. For example, $5$ and $1331$ and
$49094$ are palindromes. Your answer may well depend on the parity of $k$.)
\end{exercise}

\subsubsection{A variant}

For later convenience, let us state an easy variant of the trinomial revision
formula that is better suited for certain applications:

\begin{proposition}
[Alternative trinomial revision formula]\label{prop.binom.trin-rev2}Let
$n,a,b\in\mathbb{R}$. Then,%
\[
\dbinom{n}{a}\dbinom{a}{b}=\dbinom{n}{a-b}\dbinom{n-a+b}{b}.
\]

\end{proposition}

\begin{exercise}
\label{exe.binom.trin-rev2}Prove Proposition \ref{prop.binom.trin-rev2}.
\end{exercise}

\subsection{\label{sect.binom.hockey}The hockey-stick identity revisited}

Next, we return to the hockey-stick identity (Theorem \ref{thm.binom.hock}),
which we have already proven in two ways (once in Subsection
\ref{subsect.intro.binom.other}, and once in Subsection
\ref{subsect.binom.-1.telescope}). Let us give two more proofs for it:

\begin{proof}
[Third proof of Theorem \ref{thm.binom.hock} (sketched).]Let us try to rewrite
$\dbinom{n+1}{k+1}$ as a sum of binomial coefficients with a $k$ at the bottom
(that is, of binomial coefficients of the form $\dbinom{?}{k}$ for some values
of $?$). The first step towards this goal is to rewrite $\dbinom{n+1}{k+1}$ as
follows:%
\[
\dbinom{n+1}{k+1}=\dbinom{n}{k}+\dbinom{n}{k+1}\ \ \ \ \ \ \ \ \ \ \left(
\text{by Theorem \ref{thm.binom.rec}}\right)  .
\]
This is a good start, since it gives us a $\dbinom{n}{k}$ addend, which is of
the desired form. But the other addend, $\dbinom{n}{k+1}$, is not. So let us
rewrite it in the same way, viz., as follows:%
\[
\dbinom{n+1}{k+1}=\dbinom{n}{k}+\underbrace{\dbinom{n}{k+1}}%
_{\substack{=\dbinom{n-1}{k}+\dbinom{n-1}{k+1}\\\text{(by Theorem
\ref{thm.binom.rec})}}}=\dbinom{n-1}{k}+\dbinom{n-1}{k}+\dbinom{n-1}{k+1}.
\]
This looks even better, since we now have two addends of the desired form; but
we still have an addend, $\dbinom{n-1}{k+1}$, which is not of this form. So
let us rewrite it in the same way, and keep doing this over and over:%
\begin{align*}
\dbinom{n+1}{k+1}  &  =\dbinom{n}{k}+\underbrace{\dbinom{n}{k+1}%
}_{\substack{=\dbinom{n-1}{k}+\dbinom{n-1}{k+1}\\\text{(by Theorem
\ref{thm.binom.rec})}}}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem
\ref{thm.binom.rec}}\right) \\
&  =\dbinom{n}{k}+\dbinom{n-1}{k}+\underbrace{\dbinom{n-1}{k+1}}%
_{\substack{=\dbinom{n-2}{k}+\dbinom{n-2}{k+1}\\\text{(by Theorem
\ref{thm.binom.rec})}}}\\
&  =\dbinom{n}{k}+\dbinom{n-1}{k}+\dbinom{n-2}{k}+\underbrace{\dbinom
{n-2}{k+1}}_{\substack{=\dbinom{n-3}{k}+\dbinom{n-3}{k+1}\\\text{(by Theorem
\ref{thm.binom.rec})}}}\\
&  =\dbinom{n}{k}+\dbinom{n-1}{k}+\dbinom{n-2}{k}+\dbinom{n-3}{k}+\dbinom
{n-3}{k+1}\\
&  =\cdots\cdots\cdots\ \ \ \ \ \ \ \ \ \ \left(  \text{keep doing the same
transformation}\right)  .
\end{align*}
We could go on like this forever, but let us stop at the point when the single
\textquotedblleft bad\textquotedblright\ addend (i.e., the binomial
coefficient that has a $k+1$ at the bottom) is $\dbinom{0}{k+1}$. We thus have
found%
\begin{align}
&  \dbinom{n+1}{k+1}\nonumber\\
&  =\dbinom{n}{k}+\dbinom{n-1}{k}+\dbinom{n-2}{k}+\cdots+\dbinom{0}%
{k}+\underbrace{\dbinom{0}{k+1}}_{\substack{=0\\\text{(by Lemma
\ref{lem.binom.0Ck},}\\\text{since }k+1>0\text{)}}%
}\label{pf.thm.binom.hock.3rd.2}\\
&  =\dbinom{n}{k}+\dbinom{n-1}{k}+\dbinom{n-2}{k}+\cdots+\dbinom{0}%
{k}\nonumber\\
&  =\dbinom{0}{k}+\dbinom{1}{k}+\cdots+\dbinom{n}{k}.\nonumber
\end{align}
Thus, Theorem \ref{thm.binom.hock} holds.

This is not yet a formal proof, because \textquotedblleft keep doing the same
transformation\textquotedblright\ is not a well-defined term in rigorous
mathematics. (A computation cannot have an indefinite length!) But it is easy
to formalize this argument: We are really proving the equality%
\[
\dbinom{n+1}{k+1}=\underbrace{\dbinom{n}{k}+\dbinom{n-1}{k}+\cdots
+\dbinom{n-i+1}{k}}_{\substack{\text{a sum of }i\text{ binomial coefficients}%
\\\text{with }n,n-1,\ldots,n-i+1\text{ at the top and (always) }k\text{ at the
bottom}}}+\dbinom{n-i+1}{k+1}%
\]
for each $i\in\mathbb{N}$. (This equality is our expression for $\dbinom
{n+1}{k+1}$ after $i$ transformations of the form described above.) Of course,
this equality is proved by induction on $i$. Once it is proved, we can apply
it to $i=n+1$, and obtain (\ref{pf.thm.binom.hock.3rd.2}), after which we
proceed as before. The details are LTTR.
\end{proof}

\begin{proof}
[Fourth proof of Theorem \ref{thm.binom.hock} (sketched).]Let us count the
$\left(  k+1\right)  $-element subsets of $\left[  n+1\right]  $ according to
their largest element.

First of all, why are their largest elements well-defined? Each $\left(
k+1\right)  $-element subset of $\left[  n+1\right]  $ is nonempty (since its
size is $k+1>k\geq0$), and thus has a unique largest element. This largest
element obviously belongs to $\left[  n+1\right]  $. (Even better, this
largest element belongs to $\left\{  k+1,k+2,\ldots,n+1\right\}  $, but we
don't need this.)

Theorem \ref{thm.binom.comb} (applied to $n+1$, $k+1$ and $\left[  n+1\right]
$ instead of $n$, $k$ and $S$) yields%
\begin{align}
\dbinom{n+1}{k+1}  &  =\left(  \text{\# of }\left(  k+1\right)  \text{-element
subsets of }\left[  n+1\right]  \right) \nonumber\\
&  =\sum_{j\in\left[  n+1\right]  }\left(  \text{\# of }\left(  k+1\right)
\text{-element subsets of }\left[  n+1\right]  \text{ whose largest element is
}j\right)  \label{pf.thm.binom.hock.4th.1}%
\end{align}
as a consequence of the sum rule\footnote{To be more precise: of Theorem
\ref{thm.sumrule2}, applied to $S=\left\{  \left(  k+1\right)  \text{-element
subsets of }\left[  n+1\right]  \right\}  $, $W=\left[  n+1\right]  $ and $f$
being the map that sends each $\left(  k+1\right)  $-element subset of
$\left[  n+1\right]  $ to its largest element} (since each $\left(
k+1\right)  $-element subset of $\left[  n+1\right]  $ has a unique largest
element, which belongs to $\left[  n+1\right]  $).

Now, fix $j\in\left[  n+1\right]  $. How many $\left(  k+1\right)  $-element
subsets of $\left[  n+1\right]  $ are there whose largest element is $j$ ?

The answer is:%
\begin{align}
&  \left(  \text{\# of }\left(  k+1\right)  \text{-element subsets of }\left[
n+1\right]  \text{ whose largest element is }j\right) \nonumber\\
&  =\dbinom{j-1}{k}. \label{pf.thm.binom.hock.4th.2}%
\end{align}


[\textit{Proof of (\ref{pf.thm.binom.hock.4th.2}):} Informally, this can be
justified as follows: If we want to choose a $\left(  k+1\right)  $-element
subset of $\left[  n+1\right]  $ whose largest element is $j$, then we already
know that $j$ has to be an element of this subset, and we only need to choose
its remaining $k$ elements. These remaining $k$ elements have to belong to
$\left\{  1,2,\ldots,j-1\right\}  $ (in order to ensure that $j$ is the
largest element of the resulting subset). Thus, we are really just choosing a
$k$-element subset of $\left\{  1,2,\ldots,j-1\right\}  $. Since $\left\{
1,2,\ldots,j-1\right\}  $ is a $\left(  j-1\right)  $-element set, we thus
have $\dbinom{j-1}{k}$ many choices (by Theorem \ref{thm.binom.comb}). This
proves (\ref{pf.thm.binom.hock.4th.2}).

Here is a rigorous version of this argument: If $S$ is a $\left(  k+1\right)
$-element subset of $\left[  n+1\right]  $ whose largest element is $j$, then
$S\setminus\left\{  j\right\}  $ is a $k$-element subset of $\left\{
1,2,\ldots,j-1\right\}  $. Hence, there is a map%
\begin{align*}
&  \left\{  \left(  k+1\right)  \text{-element subsets of }\left[  n+1\right]
\text{ whose largest element is }j\right\} \\
&  \rightarrow\left\{  k\text{-element subsets of }\left\{  1,2,\ldots
,j-1\right\}  \right\}
\end{align*}
which sends each $S$ to $S\setminus\left\{  j\right\}  $. This map is
furthermore a bijection\footnote{Its inverse map sends each $T$ to
$T\cup\left\{  j\right\}  $. (We leave all the necessary verifications to the
reader, who by now should find them completely routine.)}. Thus, the bijection
principle yields%
\begin{align*}
&  \left(  \text{\# of }\left(  k+1\right)  \text{-element subsets of }\left[
n+1\right]  \text{ whose largest element is }j\right) \\
&  =\left(  \text{\# of }k\text{-element subsets of }\left\{  1,2,\ldots
,j-1\right\}  \right) \\
&  =\dbinom{j-1}{k}%
\end{align*}
(by Theorem \ref{thm.binom.comb}, applied to $j-1$ and $\left\{
1,2,\ldots,j-1\right\}  $ instead of $n$ and $S$). This proves
(\ref{pf.thm.binom.hock.4th.2}) formally.]

Either way, we have thus shown that (\ref{pf.thm.binom.hock.4th.2}) holds.
Hence, (\ref{pf.thm.binom.hock.4th.1}) becomes%
\begin{align*}
&  \dbinom{n+1}{k+1}\\
&  =\underbrace{\sum_{j\in\left[  n+1\right]  }}_{=\sum_{j=1}^{n+1}%
}\underbrace{\left(  \text{\# of }\left(  k+1\right)  \text{-element subsets
of }\left[  n+1\right]  \text{ whose largest element is }j\right)
}_{\substack{=\dbinom{j-1}{k}\\\text{(by (\ref{pf.thm.binom.hock.4th.2}))}}}\\
&  =\sum_{j=1}^{n+1}\dbinom{j-1}{k}=\sum_{i=0}^{n}\dbinom{i}{k}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have substituted }i\text{ for
}j-1\text{ in the sum}\right) \\
&  =\dbinom{0}{k}+\dbinom{1}{k}+\cdots+\dbinom{n}{k}.
\end{align*}
This proves Theorem \ref{thm.binom.hock} again.
\end{proof}

\begin{remark}
In the above fourth proof of Theorem \ref{thm.binom.hock}, we have observed
that the largest element of a $\left(  k+1\right)  $-element subset of
$\left[  n+1\right]  $ not only belongs to $\left[  n+1\right]  $, but
actually belongs to the smaller set $\left\{  k+1,k+2,\ldots,n+1\right\}  $ as
well. But we have not used this observation. What if we had used it, thus
obtaining a sum over all $j\in\left\{  k+1,k+2,\ldots,n+1\right\}  $ instead
of a sum over all $j\in\left[  n+1\right]  $ ?

We would have obtained Corollary \ref{cor.binom.hock2} instead of Theorem
\ref{thm.binom.hock}.
\end{remark}

\subsection{\label{sect.binom.maps}Counting maps}

\subsubsection{\label{subsect.binom.maps.all}All maps}

How many maps are there from an $m$-element set to an $n$-element set? We
already know the answer (Theorem \ref{thm.maps.power}); let us just restate it
a bit:

\begin{theorem}
\label{thm.binom.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}

\begin{proof}
[Proof of Theorem \ref{thm.binom.maps-all}.]We have $B^{A}=\left\{  \text{maps
}A\rightarrow B\right\}  $ (by the definition of $B^{A}$). Also, $\left\vert
A\right\vert =m$ (since $A$ is an $m$-element set) and $\left\vert
B\right\vert =n$ (likewise). Now,%
\begin{align*}
\left(  \text{\# of maps from }A\text{ to }B\right)   &  =\left\vert \left\{
\text{maps }A\rightarrow B\right\}  \right\vert \\
&  =\left\vert B^{A}\right\vert \ \ \ \ \ \ \ \ \ \ \left(  \text{since
}\left\{  \text{maps }A\rightarrow B\right\}  =B^{A}\right) \\
&  =\left\vert B\right\vert ^{\left\vert A\right\vert }%
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.maps.power}}\right) \\
&  =n^{m}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left\vert B\right\vert
=n\text{ and }\left\vert A\right\vert =m\right)  .
\end{align*}
This proves Theorem \ref{thm.binom.maps-all}.
\end{proof}

Now, what if we want to count not all maps, but only some maps?

Recall that if $f:A\rightarrow B$ is a map between any two sets, then
$f\left(  A\right)  $ denotes the image of this map (i.e., the subset
$\left\{  f\left(  a\right)  \ \mid\ a\in A\right\}  $ of $B$). More
generally, if $f:A\rightarrow B$ is a map and $S$ is any subset of $A$, then
$f\left(  S\right)  $ denotes the subset $\left\{  f\left(  a\right)
\ \mid\ a\in S\right\}  $ of $B$.

\begin{exercise}
\label{exe.binom.maps-img}Let $A$ and $B$ be two sets. Let $C$ be a finite
subset of $B$. Assume that $A$ is finite, too.

\textbf{(a)} Prove that%
\[
\left(  \text{\# of maps }f:A\rightarrow B\text{ satisfying }f\left(
A\right)  \subseteq C\right)  =\left\vert C\right\vert ^{\left\vert
A\right\vert }.
\]


\textbf{(b)} Prove that%
\[
\left(  \text{\# of maps }f:A\rightarrow B\text{ satisfying }f\left(
A\right)  =C\right)  =\left(  \text{\# of surjective maps from }A\text{ to
}C\right)  .
\]

\end{exercise}

\subsubsection{\label{subsect.binom.maps.inj}Injective maps}

In Remark \ref{rmk.binom.ff} (and in \cite[Exercise 2]{19f-hw0s}), we have
introduced the notation $n^{\underline{k}}$ (called a \textquotedblleft
falling factorial\textquotedblright). Since we are now going to use this
notation more substantially, let us state its definition in detail:

\begin{definition}
\label{def.binom.ff}Let $n\in\mathbb{R}$ and $k\in\mathbb{N}$. Then, the
\emph{falling factorial} $n^{\underline{k}}$ is the number defined by%
\begin{align}
n^{\underline{k}}  &  =n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(
n-k+1\right) \label{eq.def.binom.ff.1}\\
&  =\prod_{i=0}^{k-1}\left(  n-i\right)  . \label{eq.def.binom.ff.2}%
\end{align}

\end{definition}

Falling factorials are also called \emph{lower factorials} or \emph{descending
factorials}. Let us state a few of their basic properties:

\begin{proposition}
\label{prop.binom.ff.basics}Let $n\in\mathbb{R}$.

\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 each
$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 each $k\in\mathbb{N}$.
\end{proposition}

By now, the proof of this is a near-trivial exercise:

\begin{fineprint}
\begin{proof}
[Proof of Proposition \ref{prop.binom.ff.basics}.]\textbf{(a)} Applying
(\ref{eq.def.binom.ff.1}) to $k=0$, we obtain%
\[
n^{\underline{0}}=\underbrace{n\left(  n-1\right)  \left(  n-2\right)
\cdots\left(  n-0+1\right)  }_{\text{a product with }0\text{ factors}}=\left(
\text{empty product}\right)  =1.
\]
This proves Proposition \ref{prop.binom.ff.basics} \textbf{(a)}.

\textbf{(b)} Applying (\ref{eq.def.binom.ff.1}) to $k=1$, we obtain%
\begin{equation}
n^{\underline{1}}=\underbrace{n\left(  n-1\right)  \left(  n-2\right)
\cdots\left(  n-1+1\right)  }_{\text{a product with }1\text{ factor}}=n.
\label{eq.def.binom.ff.n1}%
\end{equation}
This proves Proposition \ref{prop.binom.ff.basics} \textbf{(b)}.

\textbf{(c)} Let $k\in\mathbb{N}$. Then, multiplying both sides of the
equality (\ref{eq.def.binom.def.a}) by $k!$, we obtain%
\[
k!\cdot\dbinom{n}{k}=k!\cdot\dfrac{n\left(  n-1\right)  \left(  n-2\right)
\cdots\left(  n-k+1\right)  }{k!}=n\left(  n-1\right)  \left(  n-2\right)
\cdots\left(  n-k+1\right)  .
\]
Comparing this with (\ref{eq.def.binom.ff.1}), we obtain $n^{\underline{k}%
}=k!\cdot\dbinom{n}{k}$. This proves Proposition \ref{prop.binom.ff.basics}
\textbf{(c)}.

\textbf{(d)} Let $n\in\mathbb{N}$. Then, (\ref{eq.def.binom.ff.1}) (applied to
$k=n$) yields%
\[
n^{\underline{n}}=n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(
n-n+1\right)  =n\left(  n-1\right)  \left(  n-2\right)  \cdots1=1\cdot
2\cdot\cdots\cdot n=n!
\]
(since $n!$ is defined to be $1\cdot2\cdot\cdots\cdot n$). This proves
Proposition \ref{prop.binom.ff.basics} \textbf{(d)}.

\textbf{(e)} Let $n\in\mathbb{N}$, and let $k\in\mathbb{N}$ satisfy $k>n$.
Then, Proposition \ref{prop.binom.ff.basics} \textbf{(c)} yields
\[
n^{\underline{k}}=k!\cdot\underbrace{\dbinom{n}{k}}_{\substack{=0\\\text{(by
Proposition \ref{prop.binom.0})}}}=0.
\]
This proves Proposition \ref{prop.binom.ff.basics} \textbf{(e)}.

\textbf{(f)} Let $k\in\mathbb{N}$. Multiplying both sides of the equality
(\ref{eq.def.binom.ff.1}) by $n-k$, we obtain
\[
n^{\underline{k}}\cdot\left(  n-k\right)  =\left(  n\left(  n-1\right)
\left(  n-2\right)  \cdots\left(  n-k+1\right)  \right)  \cdot\left(
n-k\right)  =n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(
n-k\right)  .
\]
On the other hand, (\ref{eq.def.binom.ff.1}) (applied to $k+1$ instead of $k$)
yields%
\[
n^{\underline{k+1}}=n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(
n-\left(  k+1\right)  +1\right)  =n\left(  n-1\right)  \left(  n-2\right)
\cdots\left(  n-k\right)  .
\]
Comparing these two equalities, we obtain $n^{\underline{k}}\cdot\left(
n-k\right)  =n^{\underline{k+1}}$. This proves Proposition
\ref{prop.binom.ff.basics} \textbf{(f)}.
\end{proof}
\end{fineprint}

We are now ready to count the injective maps between two finite sets:

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

\end{theorem}

\begin{remark}
\label{rmk.binom.maps-inj.bordercases}\textbf{(a)} If $m=0$, then the
right-hand side of (\ref{eq.thm.binom.maps-inj.eq}) is $n^{\underline{0}}=1$
(by Proposition \ref{prop.binom.ff.basics} \textbf{(a)}). And indeed, there is
exactly one injective map from $A=\varnothing$ to $B$ (namely, the
\textquotedblleft empty map\textquotedblright, which sends nothing anywhere).

\textbf{(b)} If $m>n$, then the right-hand side of
(\ref{eq.thm.binom.maps-inj.eq}) is $n^{\underline{m}}=0$ (by Proposition
\ref{prop.binom.ff.basics} \textbf{(e)}). Thus, Theorem
\ref{thm.binom.maps-inj} yields that there are no injective maps from $A$ to
$B$ in this case. This is intuitively clear (as $B$ has \textquotedblleft not
enough elements\textquotedblright\ to find a distinct image for each $a\in
A$); we are later going to state this as a theorem, which we shall call the
\textquotedblleft Pigeonhole Principle for Injections\textquotedblright.
\end{remark}

Let us first prove Theorem \ref{thm.binom.maps-inj} in an informal way, using
the \textquotedblleft dependent product rule\textquotedblright\ for $n$ sets
that we have stated in Subsection \ref{subsect.binom.trinom.dcproof}:

\begin{proof}
[Proof of Theorem \ref{thm.binom.maps-inj} (informal version).]Let
$a_{1},a_{2},\ldots,a_{m}$ be the $m$ elements of $A$ (listed without
repetitions). Then, in order to construct a map $f$ from $A$ to $B$, we only
have to choose the $m$ values $f\left(  a_{1}\right)  ,f\left(  a_{2}\right)
,\ldots,f\left(  a_{m}\right)  $. Moreover, to ensure that this map $f$ is
injective, we need to choose these $m$ values to be distinct. In other words,
we need to choose these $m$ values to satisfy%
\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\}  ;\\
&  \vdots\\
f\left(  a_{m}\right)   &  \in B\setminus\left\{  f\left(  a_{1}\right)
,f\left(  a_{2}\right)  ,\ldots,f\left(  a_{m-1}\right)  \right\}  .
\end{align*}
We can construct such an injective map $f$ by the following $m$-step procedure:

\begin{itemize}
\item first choose the value $f\left(  a_{1}\right)  $ to be any element of
$B$ (there are $n$ options for it, since $B$ is an $n$-element set);

\item then choose the value $f\left(  a_{2}\right)  $ to be any element of
$B\setminus\left\{  f\left(  a_{1}\right)  \right\}  $ (there are $n-1$
options for it\footnote{since $\underbrace{B}_{\text{an }n\text{-element set}%
}\setminus\underbrace{\left\{  f\left(  a_{1}\right)  \right\}  }_{\text{a
}1\text{-element subset of }B}$ is an $\left(  n-1\right)  $-element set});

\item then choose the value $f\left(  a_{3}\right)  $ to be any element of
$B\setminus\left\{  f\left(  a_{1}\right)  ,f\left(  a_{2}\right)  \right\}  $
(there are $n-2$ options for it\footnote{since $\underbrace{B}_{\text{an
}n\text{-element set}}\setminus\underbrace{\left\{  f\left(  a_{1}\right)
,f\left(  a_{2}\right)  \right\}  }_{\substack{\text{a }2\text{-element subset
of }B\\\text{(since }f\left(  a_{1}\right)  \text{ and }f\left(  a_{2}\right)
\text{ are distinct}\\\text{(because we chose }f\left(  a_{2}\right)  \text{
out of }B\setminus\left\{  f\left(  a_{1}\right)  \right\}  \text{))}}}$ is an
$\left(  n-2\right)  $-element set});

\item then choose the value $f\left(  a_{4}\right)  $ to be any element of
$B\setminus\left\{  f\left(  a_{1}\right)  ,f\left(  a_{2}\right)  ,f\left(
a_{3}\right)  \right\}  $ (there are $n-3$ options for it\footnote{since
$\underbrace{B}_{\text{an }n\text{-element set}}\setminus\underbrace{\left\{
f\left(  a_{1}\right)  ,f\left(  a_{2}\right)  ,f\left(  a_{3}\right)
\right\}  }_{\substack{\text{a }3\text{-element subset of }B\\\text{(since
}f\left(  a_{1}\right)  \text{, }f\left(  a_{2}\right)  \text{ and }f\left(
a_{3}\right)  \text{ are distinct}\\\text{(since we chose }f\left(
a_{2}\right)  \text{ out of }B\setminus\left\{  f\left(  a_{1}\right)
\right\}  \text{,}\\\text{and since we chose }f\left(  a_{3}\right)  \text{
out of }B\setminus\left\{  f\left(  a_{1}\right)  ,f\left(  a_{2}\right)
\right\}  \text{))}}}$ is an $\left(  n-3\right)  $-element set});

\item and so on;

\item at last, choose the value $f\left(  a_{m}\right)  $ to be any element of
$B\setminus\left\{  f\left(  a_{1}\right)  ,f\left(  a_{2}\right)
,\ldots,f\left(  a_{m-1}\right)  \right\}  $ (there are $n-\left(  m-1\right)
$ options for it).
\end{itemize}

Thus, by the dependent product rule, the total \# of ways to make all $m$
choices is%
\[
n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(  n-\left(  m-1\right)
\right)  =n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(  n-m+1\right)
=n^{\underline{m}}%
\]
(since $n^{\underline{m}}$ is defined to be $n\left(  n-1\right)  \left(
n-2\right)  \cdots\left(  n-m+1\right)  $). Thus, the \# of injective maps
from $A$ to $B$ is $n^{\underline{m}}$. This proves Theorem
\ref{thm.binom.maps-inj}.
\end{proof}

How can we formalize this argument? The words \textquotedblleft and so
on\textquotedblright\ suggest that we should frame it as an induction over
$m$, and the use of the dependent product rule hints at using Theorem
\ref{thm.sumrule2} (which, as we recall from our Second proof of Proposition
\ref{prop.binom.trin-rev}, can be used as a stand-in replacement for the
dependent product rule, at least for its two-set version; but as we will see,
it works for the general case just as well). This leads us to the following proof:

\begin{proof}
[Proof of Theorem \ref{thm.binom.maps-inj} (formal version).]Forget that we
fixed $n$, $m$, $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$.

Now, we shall prove Theorem \ref{thm.binom.maps-inj} by induction on $m$:

\textit{Induction base:} Theorem \ref{thm.binom.maps-inj} holds when
$m=0$\ \ \ \ \footnote{\textit{Proof.} Let $m,n,A,B$ be as in Theorem
\ref{thm.binom.maps-inj}, and assume that $m=0$. We must prove the equality
(\ref{eq.thm.binom.maps-inj.eq}).
\par
The set $A$ is an $m$-element set; thus, $\left\vert A\right\vert =m=0$.
Hence, $A=\varnothing$. Thus, there is exactly one map from $A$ to $B$
(namely, the \textquotedblleft empty map\textquotedblright); this map is
clearly injective. Hence, there is exactly one injective map from $A$ to $B$.
In other words, $\left(  \text{\# of injective maps from }A\text{ to
}B\right)  =1$. Comparing this with
\begin{align*}
n^{\underline{m}}  &  =n^{\underline{0}}\ \ \ \ \ \ \ \ \ \ \left(
\text{since }m=0\right) \\
&  =1\ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.binom.ff.basics} \textbf{(a)}}\right)  ,
\end{align*}
we obtain $\left(  \text{\# of injective maps from }A\text{ to }B\right)
=n^{\underline{m}}$. This proves the equality (\ref{eq.thm.binom.maps-inj.eq})
under the assumption that $m=0$. Hence, Theorem \ref{thm.binom.maps-inj} holds
when $m=0$.}. This completes the induction base.

\textit{Induction step:} Let $k\in\mathbb{N}$. Assume (as the induction
hypothesis) that Theorem \ref{thm.binom.maps-inj} holds for $m=k$. We must now
prove that Theorem \ref{thm.binom.maps-inj} holds for $m=k+1$.

Let $n\in\mathbb{N}$. Let $A$ be a $\left(  k+1\right)  $-element set, and let
$B$ be an $n$-element set. We must show that
\begin{equation}
\left(  \text{\# of injective maps from }A\text{ to }B\right)
=n^{\underline{k+1}}. \label{pf.thm.binom.maps-inj.IG}%
\end{equation}


The set $A$ is a $\left(  k+1\right)  $-element set; thus, $\left\vert
A\right\vert =k+1>k\geq0$. Hence, $A$ is nonempty. Choose any $a\in A$. (Such
an $a$ exists, since $A$ is nonempty.)

The set $A\setminus\left\{  a\right\}  $ has size
\begin{align*}
\left\vert A\setminus\left\{  a\right\}  \right\vert  &
=\underbrace{\left\vert A\right\vert }_{=k+1}-1\ \ \ \ \ \ \ \ \ \ \left(
\text{since }a\in A\right) \\
&  =\left(  k+1\right)  -1=k.
\end{align*}
Hence, $A\setminus\left\{  a\right\}  $ is a $k$-element set. Thus, we can
apply Theorem \ref{thm.binom.maps-inj} to $A\setminus\left\{  a\right\}  $ and
$k$ instead of $A$ and $m$ (since our induction hypothesis says that Theorem
\ref{thm.binom.maps-inj} holds for $m=k$). As a result, we obtain%
\[
\left(  \text{\# of injective maps from }A\setminus\left\{  a\right\}  \text{
to }B\right)  =n^{\underline{k}}.
\]
But $\operatorname*{Inj}\left(  A\setminus\left\{  a\right\}  ,B\right)  $ is
the set of all injective maps from $A\setminus\left\{  a\right\}  $ to $B$
(since this is how $\operatorname*{Inj}\left(  A\setminus\left\{  a\right\}
,B\right)  $ is defined). Thus,%
\begin{align}
\left\vert \operatorname*{Inj}\left(  A\setminus\left\{  a\right\}  ,B\right)
\right\vert  &  =\left(  \text{\# of injective maps from }A\setminus\left\{
a\right\}  \text{ to }B\right) \nonumber\\
&  =n^{\underline{k}}. \label{pf.thm.binom.maps-inj.IH2}%
\end{align}


Now, if $h\in\operatorname*{Inj}\left(  A,B\right)  $, then $h$ is an
injective map from $A$ to $B$, and therefore the restriction $h\mid
_{A\setminus\left\{  a\right\}  }$ of $h$ to $A\setminus\left\{  a\right\}  $
is an injective map from $A\setminus\left\{  a\right\}  $ to $B$ (since a
restriction of an injective map to a subset is still injective). Thus, the map%
\begin{align*}
R:\operatorname*{Inj}\left(  A,B\right)   &  \rightarrow\operatorname*{Inj}%
\left(  A\setminus\left\{  a\right\}  ,B\right)  ,\\
h  &  \mapsto h\mid_{A\setminus\left\{  a\right\}  }%
\end{align*}
is well-defined. (All this map does is to restrict an injective map
$h\in\operatorname*{Inj}\left(  A,B\right)  $ to the subset $A\setminus
\left\{  a\right\}  $. In other words, it \textquotedblleft throws
away\textquotedblright\ the value of the map at $a$.)

[\textit{Example:} If $A=\left\{  1,2,3\right\}  $ and $B$ is any set and
$h=\left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
x & y & z
\end{array}
\right)  $ (a map from $A$ to $B$ in two-line notation) and $a=2$, then
$R\left(  h\right)  =\left.  h\mid_{\left\{  1,3\right\}  }\right.  =\left(
\begin{array}
[c]{cc}%
1 & 3\\
x & z
\end{array}
\right)  $.]

We now ask ourselves: For a given injective map $g\in\operatorname*{Inj}%
\left(  A\setminus\left\{  a\right\}  ,B\right)  $, how many injective maps
$h\in\operatorname*{Inj}\left(  A,B\right)  $ are there that satisfy $R\left(
h\right)  =g$ ? In other words, how many ways are there to extend a given
injective map $g\in\operatorname*{Inj}\left(  A\setminus\left\{  a\right\}
,B\right)  $ to an injective map $h\in\operatorname*{Inj}\left(  A,B\right)  $
? (The word \textquotedblleft extends\textquotedblright\ here means that
$h\mid_{A\setminus\left\{  a\right\}  }$ should be $g$, that is, $R\left(
h\right)  =g$.)

The answer to this question turns out to be nice -- in particular, it does not
depend on $g$:

\begin{statement}
\textit{Observation 1:} Let $g\in\operatorname*{Inj}\left(  A\setminus\left\{
a\right\}  ,B\right)  $. Then,
\[
\left(  \text{\# of maps }h\in\operatorname*{Inj}\left(  A,B\right)  \text{
satisfying }R\left(  h\right)  =g\right)  =n-k.
\]

\end{statement}

[\textit{Proof of Observation 1:} Let us first argue informally: The map
$g:A\setminus\left\{  a\right\}  \rightarrow B$ is injective (since
$g\in\operatorname*{Inj}\left(  A\setminus\left\{  a\right\}  ,B\right)  $);
thus, it has $k$ different values (since $\left\vert A\setminus\left\{
a\right\}  \right\vert =k$). In other words, $\left\vert g\left(
A\setminus\left\{  a\right\}  \right)  \right\vert =k$. Hence, $\left\vert
B\setminus g\left(  A\setminus\left\{  a\right\}  \right)  \right\vert =n-k$
(since $g\left(  A\setminus\left\{  a\right\}  \right)  $ is a subset of the
$n$-element set $B$).

To construct an $h\in\operatorname*{Inj}\left(  A,B\right)  $ satisfying
$R\left(  h\right)  =g$, we only need to choose a value $h\left(  a\right)  $
(since the condition $R\left(  h\right)  =g$ already forces all the other
values of $h$ to equal the corresponding values of $g$). This value $h\left(
a\right)  $ must be distinct from all values of $g$ (in order for $h$ to be
injective); in other words, it has to belong to $B\setminus g\left(
A\setminus\left\{  a\right\}  \right)  $. Thus, there are $n-k$ many options
for $h\left(  a\right)  $ (since $\left\vert B\setminus g\left(
A\setminus\left\{  a\right\}  \right)  \right\vert =n-k$). Hence, there are
$n-k$ many maps $h\in\operatorname*{Inj}\left(  A,B\right)  $ satisfying
$R\left(  h\right)  =g$. This proves Observation 1.

\begin{fineprint}
Here is a formal version of this argument:

The map $g:A\setminus\left\{  a\right\}  \rightarrow B$ is injective (since
$g\in\operatorname*{Inj}\left(  A\setminus\left\{  a\right\}  ,B\right)  $).
However, if $X$ and $Y$ are two finite sets, and if $z:X\rightarrow Y$ is an
injective map, then $\left\vert z\left(  X\right)  \right\vert =\left\vert
X\right\vert $\ \ \ \ \footnote{\textit{Proof.} This is a classical fact, with
a simple proof: Let $X$ and $Y$ be two finite sets, and let $z:X\rightarrow Y$
be an injective map. Let $x_{1},x_{2},\ldots,x_{p}$ be all elements of $X$
(listed without repetitions); then, the elements $x_{1},x_{2},\ldots,x_{p}$
are distinct, and $\left\vert X\right\vert =p$. But the map $z$ is injective,
and thus sends distinct elements to distinct elements. Hence, $z\left(
x_{1}\right)  ,z\left(  x_{2}\right)  ,\ldots,z\left(  x_{p}\right)  $ are
distinct (since $x_{1},x_{2},\ldots,x_{p}$ are distinct). Therefore, the set
$\left\{  z\left(  x_{1}\right)  ,z\left(  x_{2}\right)  ,\ldots,z\left(
x_{p}\right)  \right\}  $ has $p$ distinct elements; in other words,
$\left\vert \left\{  z\left(  x_{1}\right)  ,z\left(  x_{2}\right)
,\ldots,z\left(  x_{p}\right)  \right\}  \right\vert =p$. But $X=\left\{
x_{1},x_{2},\ldots,x_{p}\right\}  $ (since $x_{1},x_{2},\ldots,x_{p}$ are all
elements of $X$) and thus%
\[
z\left(  X\right)  =z\left(  \left\{  x_{1},x_{2},\ldots,x_{p}\right\}
\right)  =\left\{  z\left(  x_{1}\right)  ,z\left(  x_{2}\right)
,\ldots,z\left(  x_{p}\right)  \right\}  ,
\]
so that $\left\vert z\left(  X\right)  \right\vert =\left\vert \left\{
z\left(  x_{1}\right)  ,z\left(  x_{2}\right)  ,\ldots,z\left(  x_{p}\right)
\right\}  \right\vert =p=\left\vert X\right\vert $, qed.}. Applying this to
$X=A\setminus\left\{  a\right\}  $, $Y=B$ and $z=g$, we obtain $\left\vert
g\left(  A\setminus\left\{  a\right\}  \right)  \right\vert =\left\vert
A\setminus\left\{  a\right\}  \right\vert =k$. But recall that $\left\vert
B\right\vert =n$ (since $B$ is an $n$-element set). Also, $g\left(
A\setminus\left\{  a\right\}  \right)  $ is clearly a subset of $B$. Hence,
Theorem \ref{thm.subset-leq} \textbf{(a)} (applied to $B$ and $g\left(
A\setminus\left\{  a\right\}  \right)  $ instead of $A$ and $B$) yields
\[
\left\vert B\setminus g\left(  A\setminus\left\{  a\right\}  \right)
\right\vert =\underbrace{\left\vert B\right\vert }_{=n}-\underbrace{\left\vert
g\left(  A\setminus\left\{  a\right\}  \right)  \right\vert }_{=k}=n-k.
\]


If $h\in\operatorname*{Inj}\left(  A,B\right)  $ satisfies $R\left(  h\right)
=g$, then $h\left(  a\right)  \in B\setminus g\left(  A\setminus\left\{
a\right\}  \right)  $\ \ \ \ \footnote{\textit{Proof.} Let $h\in
\operatorname*{Inj}\left(  A,B\right)  $ satisfy $R\left(  h\right)  =g$.
Thus, $g=R\left(  h\right)  =h\mid_{A\setminus\left\{  a\right\}  }$ (by the
definition of $R$), and furthermore, the map $h:A\rightarrow B$ is injective
(since $h\in\operatorname*{Inj}\left(  A,B\right)  $). Now, if we had
$h\left(  a\right)  \in g\left(  A\setminus\left\{  a\right\}  \right)  $,
then there would exist some $u\in A\setminus\left\{  a\right\}  $ such that
$h\left(  a\right)  =g\left(  u\right)  $. This $u$ would then satisfy
$h\left(  a\right)  =\underbrace{g}_{=h\mid_{A\setminus\left\{  a\right\}  }%
}\left(  u\right)  =\left(  h\mid_{A\setminus\left\{  a\right\}  }\right)
\left(  u\right)  =h\left(  u\right)  $ and thus $h\left(  u\right)  =h\left(
a\right)  $, which would lead to $u=a$ (since $h$ is injective); but this
would contradict $u\in A\setminus\left\{  a\right\}  $. Thus, we cannot have
$h\left(  a\right)  \in g\left(  A\setminus\left\{  a\right\}  \right)  $.
Hence, $h\left(  a\right)  \notin g\left(  A\setminus\left\{  a\right\}
\right)  $. Combining this with $h\left(  a\right)  \in B$, we obtain
$h\left(  a\right)  \in B\setminus g\left(  A\setminus\left\{  a\right\}
\right)  $, qed.}. Hence, the map%
\begin{align}
\left\{  h\in\operatorname*{Inj}\left(  A,B\right)  \ \mid\ R\left(  h\right)
=g\right\}   &  \rightarrow B\setminus g\left(  A\setminus\left\{  a\right\}
\right)  ,\nonumber\\
h  &  \mapsto h\left(  a\right)  \label{pf.thm.binom.maps-inj.o1.pf.fml.map}%
\end{align}
is well-defined. It is easy to see that this map is a
bijection\footnote{Indeed, we can construct an inverse to it: For each $b\in
B\setminus g\left(  A\setminus\left\{  a\right\}  \right)  $, we let $h_{b}$
be the map from $A$ to $B$ that sends each $c\in A$ to $%
\begin{cases}
b, & \text{if }c=a;\\
g\left(  c\right)  , & \text{if }c\neq a
\end{cases}
$. It is easy to see that this map $h_{b}$ is injective. (In fact, its values
at the elements of $A\setminus\left\{  a\right\}  $ are precisely the values
of $g$, and thus are distinct because $g$ is injective; but its value at $a$
is $b$, which is distinct from its values at the elements of $A\setminus
\left\{  a\right\}  $ because $b\notin g\left(  A\setminus\left\{  a\right\}
\right)  $.) Hence, for each $b\in B\setminus g\left(  A\setminus\left\{
a\right\}  \right)  $, we have defined an injective map $h_{b}$ from $A$ to
$B$ which furthermore satisfies $R\left(  h_{b}\right)  =g$ (since
$h_{b}\left(  c\right)  =g\left(  c\right)  $ for all $c\in A\setminus\left\{
a\right\}  $). Thus, we obtain a map%
\begin{align*}
B\setminus g\left(  A\setminus\left\{  a\right\}  \right)   &  \rightarrow
\left\{  h\in\operatorname*{Inj}\left(  A,B\right)  \ \mid\ R\left(  h\right)
=g\right\}  ,\\
b  &  \mapsto h_{b}.
\end{align*}
It is now completely straightforward to check that this map is inverse to the
map (\ref{pf.thm.binom.maps-inj.o1.pf.fml.map}).}. Thus, the bijection
principle yields%
\[
\left\vert \left\{  h\in\operatorname*{Inj}\left(  A,B\right)  \ \mid
\ R\left(  h\right)  =g\right\}  \right\vert =\left\vert B\setminus g\left(
A\setminus\left\{  a\right\}  \right)  \right\vert =n-k.
\]
Thus,%
\begin{align*}
&  \left(  \text{\# of maps }h\in\operatorname*{Inj}\left(  A,B\right)  \text{
satisfying }R\left(  h\right)  =g\right) \\
&  =\left\vert \left\{  h\in\operatorname*{Inj}\left(  A,B\right)
\ \mid\ R\left(  h\right)  =g\right\}  \right\vert =n-k.
\end{align*}
Thus, Observation 1 is rigorously proven.]
\end{fineprint}

Now, Theorem \ref{thm.sumrule2} (applied to $S=\operatorname*{Inj}\left(
A,B\right)  $, $W=\operatorname*{Inj}\left(  A\setminus\left\{  a\right\}
,B\right)  $ and $f=R$) yields
\begin{align*}
\left\vert \operatorname*{Inj}\left(  A,B\right)  \right\vert  &  =\sum
_{w\in\operatorname*{Inj}\left(  A\setminus\left\{  a\right\}  ,B\right)
}\left(  \text{\# of }s\in\operatorname*{Inj}\left(  A,B\right)  \text{
satisfying }R\left(  s\right)  =w\right) \\
&  =\sum_{g\in\operatorname*{Inj}\left(  A\setminus\left\{  a\right\}
,B\right)  }\underbrace{\left(  \text{\# of }h\in\operatorname*{Inj}\left(
A,B\right)  \text{ satisfying }R\left(  h\right)  =g\right)  }%
_{\substack{=\left(  \text{\# of maps }h\in\operatorname*{Inj}\left(
A,B\right)  \text{ satisfying }R\left(  h\right)  =g\right)  \\=n-k\\\text{(by
Observation 1)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have renamed the indices
}w\text{ and }s\text{ as }g\text{ and }h\right) \\
&  =\sum_{g\in\operatorname*{Inj}\left(  A\setminus\left\{  a\right\}
,B\right)  }\left(  n-k\right)  =\underbrace{\left\vert \operatorname*{Inj}%
\left(  A\setminus\left\{  a\right\}  ,B\right)  \right\vert }%
_{\substack{=n^{\underline{k}}\\\text{(by (\ref{pf.thm.binom.maps-inj.IH2}))}%
}}\cdot\left(  n-k\right) \\
&  =n^{\underline{k}}\cdot\left(  n-k\right)  =n^{\underline{k+1}%
}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition \ref{prop.binom.ff.basics}
\textbf{(f)}}\right)  .
\end{align*}
But recall that $\operatorname*{Inj}\left(  A,B\right)  $ is the set of all
injective maps from $A$ to $B$ (since this is how $\operatorname*{Inj}\left(
A,B\right)  $ is defined). Thus,%
\[
\left\vert \operatorname*{Inj}\left(  A,B\right)  \right\vert =\left(
\text{\# of injective maps from }A\text{ to }B\right)  ,
\]
so that
\[
\left(  \text{\# of injective maps from }A\text{ to }B\right)  =\left\vert
\operatorname*{Inj}\left(  A,B\right)  \right\vert =n^{\underline{k+1}}.
\]


Now, forget that we fixed $n$, $A$ and $B$. We thus have shown that if
$n\in\mathbb{N}$, if $A$ is a $\left(  k+1\right)  $-element set, and if $B$
is an $n$-element set, then
\[
\left(  \text{\# of injective maps from }A\text{ to }B\right)
=n^{\underline{k+1}}.
\]
In other words, Theorem \ref{thm.binom.maps-inj} holds for $m=k+1$. This
completes the induction step. Thus, Theorem \ref{thm.binom.maps-inj} is proven
by induction.
\end{proof}

\subsubsection{\label{subsect.binom.maps.php}The pigeonhole principles}

We shall now state two fundamental facts about maps between finite sets -- the
so-called \emph{Pigeonhole Principles}. These facts are intuitively fairly
self-evident, but we will nevertheless give rigorous proofs due to their importance.

The first of these facts is the \emph{Pigeonhole Principle for Injections}:

\begin{theorem}
[Pigeonhole Principle for Injections]\label{thm.php-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}

\begin{proof}
[Proof of Theorem \ref{thm.php-inj}.]Let $a_{1},a_{2},\ldots,a_{k}$ be the
elements of $A$ (listed without repetitions). Thus, the elements $a_{1}%
,a_{2},\ldots,a_{k}$ are distinct and we have $\left\vert A\right\vert =k$.
But the map $f$ is injective, and thus sends distinct elements to distinct
elements. Hence, $f\left(  a_{1}\right)  ,f\left(  a_{2}\right)
,\ldots,f\left(  a_{k}\right)  $ are distinct (since $a_{1},a_{2},\ldots
,a_{k}$ are distinct). Hence, the set $\left\{  f\left(  a_{1}\right)
,f\left(  a_{2}\right)  ,\ldots,f\left(  a_{k}\right)  \right\}  $ has $k$
distinct elements. In other words,%
\begin{equation}
\left\vert \left\{  f\left(  a_{1}\right)  ,f\left(  a_{2}\right)
,\ldots,f\left(  a_{k}\right)  \right\}  \right\vert =k=\left\vert
A\right\vert . \label{pf.thm.php-inj.1}%
\end{equation}
But $\left\{  f\left(  a_{1}\right)  ,f\left(  a_{2}\right)  ,\ldots,f\left(
a_{k}\right)  \right\}  $ is clearly a subset of $B$. Therefore, Theorem
\ref{thm.subset-leq} \textbf{(b)} (applied to $B$ and $\left\{  f\left(
a_{1}\right)  ,f\left(  a_{2}\right)  ,\ldots,f\left(  a_{k}\right)  \right\}
$ instead of $A$ and $B$) yields%
\[
\left\vert \left\{  f\left(  a_{1}\right)  ,f\left(  a_{2}\right)
,\ldots,f\left(  a_{k}\right)  \right\}  \right\vert \leq\left\vert
B\right\vert .
\]
Now, (\ref{pf.thm.php-inj.1}) shows that $\left\vert A\right\vert =\left\vert
\left\{  f\left(  a_{1}\right)  ,f\left(  a_{2}\right)  ,\ldots,f\left(
a_{k}\right)  \right\}  \right\vert \leq\left\vert B\right\vert $. This proves
Theorem \ref{thm.php-inj} \textbf{(a)}.

\textbf{(b)} Assume that $\left\vert A\right\vert =\left\vert B\right\vert $.
Then, (\ref{pf.thm.php-inj.1}) becomes $\left\vert \left\{  f\left(
a_{1}\right)  ,f\left(  a_{2}\right)  ,\ldots,f\left(  a_{k}\right)  \right\}
\right\vert =\left\vert A\right\vert =\left\vert B\right\vert $. Hence,
Theorem \ref{thm.subset-leq} \textbf{(c)} (applied to $B$ and $\left\{
f\left(  a_{1}\right)  ,f\left(  a_{2}\right)  ,\ldots,f\left(  a_{k}\right)
\right\}  $ instead of $A$ and $B$) yields $\left\{  f\left(  a_{1}\right)
,f\left(  a_{2}\right)  ,\ldots,f\left(  a_{k}\right)  \right\}  =B$. But this
means that $f$ is surjective\footnote{\textit{Proof.} Let $b\in B$. Then,
$b\in B=\left\{  f\left(  a_{1}\right)  ,f\left(  a_{2}\right)  ,\ldots
,f\left(  a_{k}\right)  \right\}  $. In other words, $b=f\left(  a_{i}\right)
$ for some $i\in\left[  k\right]  $. Consider this $i$. Thus, $b$ is a value
of $f$ (namely, the value at $a_{i}$).
\par
Forget that we fixed $b$. We thus have showed that each $b\in B$ is a value of
$f$. In other words, $f$ is surjective.}. Thus, $f$ is bijective (since $f$ is
both injective and surjective). This proves Theorem \ref{thm.php-inj}
\textbf{(b)}.
\end{proof}

The following similar-looking theorem is known as the \emph{Pigeonhole
Principle for Surjections}:

\begin{theorem}
[Pigeonhole Principle for Surjections]\label{thm.php-sur}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}

\begin{proof}
[Proof of Theorem \ref{thm.php-sur}.]Let $a_{1},a_{2},\ldots,a_{k}$ be the
elements of $A$ (listed without repetitions). Thus, $\left\vert A\right\vert
=k$ and $A=\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  $. The $k$ elements
$f\left(  a_{1}\right)  ,f\left(  a_{2}\right)  ,\ldots,f\left(  a_{k}\right)
$ may or may not be distinct; thus, the set $\left\{  f\left(  a_{1}\right)
,f\left(  a_{2}\right)  ,\ldots,f\left(  a_{k}\right)  \right\}  $ has at most
$k$ elements\footnote{Here, we are tacitly using the following fact: If
$u_{1},u_{2},\ldots,u_{k}$ are any $k$ objects (distinct or not), then the set
$\left\{  u_{1},u_{2},\ldots,u_{k}\right\}  $ has at most $k$ elements.
Shouldn't this, too, be proved?
\par
(Yes, but I am leaving this to the texts on foundations. That said, you can
easily construct a proof by induction on $k$, using the even more fundamental
fact that every finite set $A$ and every object $s$ satisfy $\left\vert
A\cup\left\{  s\right\}  \right\vert =%
\begin{cases}
\left\vert A\right\vert , & \text{if }s\in A;\\
\left\vert A\right\vert +1, & \text{if }s\notin A
\end{cases}
$.)}. In other words,%
\begin{equation}
\left\vert \left\{  f\left(  a_{1}\right)  ,f\left(  a_{2}\right)
,\ldots,f\left(  a_{k}\right)  \right\}  \right\vert \leq k=\left\vert
A\right\vert . \label{pf.thm.php-sur.1}%
\end{equation}
But $f$ is surjective; hence, $\left\{  f\left(  a_{1}\right)  ,f\left(
a_{2}\right)  ,\ldots,f\left(  a_{k}\right)  \right\}  =B$%
\ \ \ \ \footnote{\textit{Proof.} Let $b\in B$. Then, there exists some $a\in
A$ such that $b=f\left(  a\right)  $ (since $f$ is surjective). Consider this
$a$. We have $a\in A=\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  $. In other
words, $a=a_{i}$ for some $i\in\left[  k\right]  $. Consider this $i$. Now,
$b=f\left(  \underbrace{a}_{=a_{i}}\right)  =f\left(  a_{i}\right)
\in\left\{  f\left(  a_{1}\right)  ,f\left(  a_{2}\right)  ,\ldots,f\left(
a_{k}\right)  \right\}  $.
\par
Forget that we fixed $b$. We thus have shown that $b\in\left\{  f\left(
a_{1}\right)  ,f\left(  a_{2}\right)  ,\ldots,f\left(  a_{k}\right)  \right\}
$ for each $b\in B$. In other words, $B\subseteq\left\{  f\left(
a_{1}\right)  ,f\left(  a_{2}\right)  ,\ldots,f\left(  a_{k}\right)  \right\}
$. Combining this with $\left\{  f\left(  a_{1}\right)  ,f\left(
a_{2}\right)  ,\ldots,f\left(  a_{k}\right)  \right\}  \subseteq B$ (which is
obvious), we obtain $\left\{  f\left(  a_{1}\right)  ,f\left(  a_{2}\right)
,\ldots,f\left(  a_{k}\right)  \right\}  =B$.}. Thus, (\ref{pf.thm.php-sur.1})
rewrites as $\left\vert B\right\vert \leq\left\vert A\right\vert $. In other
words, $\left\vert A\right\vert \geq\left\vert B\right\vert $. This proves
Theorem \ref{thm.php-sur} \textbf{(a)}.

\textbf{(b)} Assume that $\left\vert A\right\vert =\left\vert B\right\vert $.
We must prove that $f$ is bijective. First, we shall show that $f$ is injective.

Indeed, let $x$ and $y$ be two distinct elements of $A$. We shall show that
$f\left(  x\right)  \neq f\left(  y\right)  $.

Indeed, assume the contrary. Thus, $f\left(  x\right)  =f\left(  y\right)  $.
But $x\in A=\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  $; thus, $x$ can be
written in the form $x=a_{i}$ for some $i\in\left[  k\right]  $. Likewise, $y$
can be written in the form $y=a_{j}$ for some $j\in\left[  k\right]  $.
Consider these $i$ and $j$. If we had $i=j$, then we would have $a_{i}=a_{j}$
and thus $x=a_{i}=a_{j}=y$, which would contradict the fact that $x$ and $y$
are distinct. Hence, we must have $i\neq j$.

But recall that $f\left(  x\right)  =f\left(  y\right)  $. This rewrites as
$f\left(  a_{i}\right)  =f\left(  a_{j}\right)  $ (since $x=a_{i}$ and
$y=a_{j}$). Since $i\neq j$, this equality reveals that at least two of the
$k$ elements $f\left(  a_{1}\right)  ,f\left(  a_{2}\right)  ,\ldots,f\left(
a_{k}\right)  $ are equal (namely, $f\left(  a_{i}\right)  $ and $f\left(
a_{j}\right)  $). Therefore, there are at most $k-1$ distinct elements among
these $k$ elements $f\left(  a_{1}\right)  ,f\left(  a_{2}\right)
,\ldots,f\left(  a_{k}\right)  $. In other words,%
\[
\left\vert \left\{  f\left(  a_{1}\right)  ,f\left(  a_{2}\right)
,\ldots,f\left(  a_{k}\right)  \right\}  \right\vert \leq k-1.
\]
\footnote{If you insist on proving this more formally than this, here is the
argument that we tacitly used here: Let $G$ be the set%
\[
\left\{  f\left(  a_{1}\right)  ,f\left(  a_{2}\right)  ,\ldots,f\left(
a_{j-1}\right)  ,f\left(  a_{j+1}\right)  ,f\left(  a_{j+2}\right)
,\ldots,f\left(  a_{k}\right)  \right\}  =\left\{  f\left(  a_{p}\right)
\ \mid\ p\in\left[  k\right]  \setminus\left\{  j\right\}  \right\}  ,
\]
which collects all of the $k$ elements $f\left(  a_{1}\right)  ,f\left(
a_{2}\right)  ,\ldots,f\left(  a_{k}\right)  $ except for the $j$-th one. This
set $G$ clearly has size $\left\vert G\right\vert \leq k-1$ (because $f\left(
a_{1}\right)  ,f\left(  a_{2}\right)  ,\ldots,f\left(  a_{j-1}\right)
,f\left(  a_{j+1}\right)  ,f\left(  a_{j+2}\right)  ,\ldots,f\left(
a_{k}\right)  $ are $k-1$ elements). Since $i\neq j$, the element $f\left(
a_{i}\right)  $ is one of the $k-1$ elements $f\left(  a_{1}\right)  ,f\left(
a_{2}\right)  ,\ldots,f\left(  a_{j-1}\right)  ,f\left(  a_{j+1}\right)
,f\left(  a_{j+2}\right)  ,\ldots,f\left(  a_{k}\right)  $ that constitute the
set $G$ (because $i\neq j$ entails $i\in\left[  k\right]  \setminus\left\{
j\right\}  $), and thus belongs to $G$. Therefore, $\left\{  f\left(
a_{i}\right)  \right\}  \subseteq G$, so that $G\cup\left\{  f\left(
a_{i}\right)  \right\}  =G$. Hence,%
\begin{align*}
G  &  =G\cup\left\{  f\left(  a_{i}\right)  \right\}  =G\cup\left\{  f\left(
a_{j}\right)  \right\}  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }f\left(
a_{i}\right)  =f\left(  a_{j}\right)  \right) \\
&  =\left\{  f\left(  a_{1}\right)  ,f\left(  a_{2}\right)  ,\ldots,f\left(
a_{j-1}\right)  ,f\left(  a_{j+1}\right)  ,f\left(  a_{j+2}\right)
,\ldots,f\left(  a_{k}\right)  \right\}  \cup\left\{  f\left(  a_{j}\right)
\right\} \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }G=\left\{  f\left(  a_{1}\right)
,f\left(  a_{2}\right)  ,\ldots,f\left(  a_{j-1}\right)  ,f\left(
a_{j+1}\right)  ,f\left(  a_{j+2}\right)  ,\ldots,f\left(  a_{k}\right)
\right\}  \right) \\
&  =\left\{  f\left(  a_{1}\right)  ,f\left(  a_{2}\right)  ,\ldots,f\left(
a_{j-1}\right)  ,f\left(  a_{j+1}\right)  ,f\left(  a_{j+2}\right)
,\ldots,f\left(  a_{k}\right)  ,f\left(  a_{j}\right)  \right\} \\
&  =\left\{  f\left(  a_{1}\right)  ,f\left(  a_{2}\right)  ,\ldots,f\left(
a_{k}\right)  \right\}
\end{align*}
(because the $k$ elements $f\left(  a_{1}\right)  ,f\left(  a_{2}\right)
,\ldots,f\left(  a_{j-1}\right)  ,f\left(  a_{j+1}\right)  ,f\left(
a_{j+2}\right)  ,\ldots,f\left(  a_{k}\right)  ,f\left(  a_{j}\right)  $ are
exactly the $k$ elements $f\left(  a_{1}\right)  ,f\left(  a_{2}\right)
,\ldots,f\left(  a_{k}\right)  $, up to order). Thus, the inequality
$\left\vert G\right\vert \leq k-1$, which we have previously proved, rewrites
as $\left\vert \left\{  f\left(  a_{1}\right)  ,f\left(  a_{2}\right)
,\ldots,f\left(  a_{k}\right)  \right\}  \right\vert \leq k-1$.} In view of
$\left\{  f\left(  a_{1}\right)  ,f\left(  a_{2}\right)  ,\ldots,f\left(
a_{k}\right)  \right\}  =B$, this rewrites as $\left\vert B\right\vert \leq
k-1$. Hence, $\left\vert B\right\vert \leq k-1<k=\left\vert A\right\vert
=\left\vert B\right\vert $. This is, of course, absurd. This contradiction
shows that our assumption was false.

Hence, we have shown that $f\left(  x\right)  \neq f\left(  y\right)  $.

Now, forget that we fixed $x$ and $y$. We thus have proved that if $x$ and $y$
are two distinct elements of $A$, then $f\left(  x\right)  \neq f\left(
y\right)  $. In other words, the map $f$ sends distinct elements to distinct
elements. In other words, $f$ is injective.

\begin{verlong}
Here is a different proof of the fact that $f$ is injective:

Indeed, let $x$ and $y$ be two distinct elements of $A$. We shall show that
$f\left(  x\right)  \neq f\left(  y\right)  $.

Indeed, assume the contrary. Thus, $f\left(  x\right)  =f\left(  y\right)  $.
Note that $x\neq y$ (since $x$ and $y$ are distinct), so that $x\in
A\setminus\left\{  y\right\}  $. Moreover, the set $A\setminus\left\{
y\right\}  $ has size
\begin{align}
\left\vert A\setminus\left\{  y\right\}  \right\vert  &  =\left\vert
A\right\vert -1\ \ \ \ \ \ \ \ \ \ \left(  \text{since }y\in A\right)
\nonumber\\
&  <\left\vert A\right\vert =\left\vert B\right\vert .
\label{pf.thm.php-sur.2}%
\end{align}


Now, let $f^{\prime}$ be the restriction $f\mid_{A\setminus\left\{  y\right\}
}$ of the map $f:A\rightarrow B$ to the subset $A\setminus\left\{  y\right\}
$. Then, $f^{\prime}$ is a map from $A\setminus\left\{  y\right\}  $ to $B$.
If this map $f^{\prime}$ was surjective, then Theorem \ref{thm.php-sur}
\textbf{(a)} (applied to $A\setminus\left\{  y\right\}  $ and $f^{\prime}$
instead of $A$ and $f$) would yield $\left\vert A\setminus\left\{  y\right\}
\right\vert \geq\left\vert B\right\vert $, which would contradict
(\ref{pf.thm.php-sur.2}). Hence, this map $f^{\prime}$ is not surjective. In
other words, there exists some $b\in B$ which is \textbf{not} a value of
$f^{\prime}$. Consider this $b$. Note that%
\begin{equation}
f^{\prime}\left(  a\right)  =f\left(  a\right)  \ \ \ \ \ \ \ \ \ \ \text{for
each }a\in A\setminus\left\{  y\right\}  \label{pf.thm.php-sur.3}%
\end{equation}
(since $f^{\prime}$ is the restriction of $f$ to $A\setminus\left\{
y\right\}  $). Applying this to $a=x$, we obtain $f^{\prime}\left(  x\right)
=f\left(  x\right)  $ (since $x\in A\setminus\left\{  y\right\}  $). Thus,
$f^{\prime}\left(  x\right)  =f\left(  x\right)  =f\left(  y\right)  $. Hence,
$f\left(  y\right)  $ is a value of $f^{\prime}$. If we had $b=f\left(
y\right)  $, then this would entail that $b$ is a value of $f^{\prime}$; but
this would contradict the fact that $b$ is not a value of $f^{\prime}$. Hence,
we don't have $b=f\left(  y\right)  $. In other words, we have $b\neq f\left(
y\right)  $.

Recall that $f$ is surjective. Hence, each element of $B$ is a value of $f$.
Thus, in particular, $b$ is a value of $f$. In other words, there exists some
$a\in A$ such that $f\left(  a\right)  =b$. Consider this $a$. From $f\left(
a\right)  =b\neq f\left(  y\right)  $, we obtain $a\neq y$. Combining $a\in A$
with $a\neq y$, we obtain $a\in A\setminus\left\{  y\right\}  $. Hence,
(\ref{pf.thm.php-sur.3}) yields $f^{\prime}\left(  a\right)  =f\left(
a\right)  =b$, so that $b$ is a value of $f^{\prime}$; but this contradicts
the fact that $b$ is not a value of $f^{\prime}$. This contradiction shows
that our assumption was false.

Hence, we have shown that $f\left(  x\right)  \neq f\left(  y\right)  $.

Now, forget that we fixed $x$ and $y$. We thus have proved that if $x$ and $y$
are two distinct elements of $A$, then $f\left(  x\right)  \neq f\left(
y\right)  $. In other words, the map $f$ sends distinct elements to distinct
elements. In other words, $f$ is injective.
\end{verlong}

Hence, $f$ is bijective (since $f$ is both injective and surjective). This
proves Theorem \ref{thm.php-sur} \textbf{(b)}.
\end{proof}

\begin{remark}
The parts \textbf{(b)} of both Pigeonhole Principles become false if the sets
$A$ and $B$ are not finite. For example:

\begin{itemize}
\item The map $\mathbb{N}\rightarrow\mathbb{N},\ i\mapsto i+1$ is injective,
but not bijective. Thus, Theorem \ref{thm.php-inj} \textbf{(b)} fails if $A$
and $B$ are infinite.

\item The map $\mathbb{N}\rightarrow\mathbb{N},\ i\mapsto%
\begin{cases}
0, & \text{if }i=0;\\
i-1, & \text{if }i>0
\end{cases}
$ is surjective, but not bijective. Thus, Theorem \ref{thm.php-sur}
\textbf{(b)} fails if $A$ and $B$ are infinite.
\end{itemize}
\end{remark}

\subsubsection{\label{subsect.binom.maps.per}Permutations}

We can now prove Theorem \ref{thm.count.perms}:

\begin{proof}
[Proof of Theorem \ref{thm.count.perms}.]The set $X$ is finite (since it is an
$n$-element set) and satisfies $\left\vert X\right\vert =\left\vert
X\right\vert $. Hence, Theorem \ref{thm.php-inj} \textbf{(b)} shows that if
$f:X\rightarrow X$ is an injective map, then $f$ is bijective. In other words,
every injective map from $X$ to $X$ is bijective. The converse also holds (by
definition). Thus, the injective maps from $X$ to $X$ are precisely the
bijective maps from $X$ to $X$. Hence,%
\begin{align*}
\left\{  \text{injective maps from }X\text{ to }X\right\}   &  =\left\{
\text{bijective maps from }X\text{ to }X\right\} \\
&  =\left\{  \text{bijections from }X\text{ to }X\right\}  =\left\{
\text{permutations of }X\right\}
\end{align*}
(because the permutations of $X$ are defined to be the bijections from $X$ to
$X$). Hence,%
\[
\left(  \text{\# of injective maps from }X\text{ to }X\right)  =\left(
\text{\# of permutations of }X\right)  .
\]
But Theorem \ref{thm.binom.maps-inj} (applied to $m=n$, $A=X$ and $B=X$) shows
that
\[
\left(  \text{\# of injective maps from }X\text{ to }X\right)
=n^{\underline{n}}=n!
\]
(by Proposition \ref{prop.binom.ff.basics} \textbf{(d)}). Comparing these two
equalities, we obtain%
\[
\left(  \text{\# of permutations of }X\right)  =n!.
\]
This proves Theorem \ref{thm.count.perms}.
\end{proof}

\subsubsection{\label{subsect.binom.maps.sur}Surjective maps}

After having counted injective maps, let us count surjective maps. The answer
will not be as simple as the one we obtained for injective maps in Theorem
\ref{thm.binom.maps-inj}. First, we introduce a notation (which we already
have used in Theorem \ref{thm.1.13}):

\begin{definition}
\label{def.surmn}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}

\begin{example}
We have $\operatorname*{sur}\left(  3,2\right)  =6$, because there are exactly
$6$ surjective maps from $\left[  3\right]  $ to $\left[  2\right]  $; namely,
these maps are
\begin{align*}
&  \left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
1 & 1 & 2
\end{array}
\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
1 & 2 & 1
\end{array}
\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
1 & 2 & 2
\end{array}
\right)  ,\\
&  \left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
2 & 1 & 1
\end{array}
\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
2 & 1 & 2
\end{array}
\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
2 & 2 & 1
\end{array}
\right)
\end{align*}
(written in two-line notation).
\end{example}

A priori, these numbers $\operatorname*{sur}\left(  m,n\right)  $ only count
surjective maps between the specific finite sets $\left[  m\right]  $ and
$\left[  n\right]  $; but it is easy to see that they also count surjective
maps between any two finite sets:

\begin{proposition}
\label{prop.binom.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}
[Proof of Proposition \ref{prop.binom.maps-surj} (sketched).]This is a
relabeling argument, similar to our proof of Lemma \ref{lem.count.dera.X=n}:
Relabel the $m$ elements of $A$ as $1,2,\ldots,m$, and relabel the $n$
elements of $B$ as $1,2,\ldots,n$. The details are LTTR.\footnote{For the
formal proof, you have to construct a bijection from the set $\left\{
\text{surjective maps from }A\text{ to }B\right\}  $ to the set $\left\{
\text{surjective maps from }\left[  m\right]  \text{ to }\left[  n\right]
\right\}  $. Here is how to do this:
\par
We have $\left\vert A\right\vert =m$ (since $A$ is an $m$-element set) and
$\left\vert \left[  m\right]  \right\vert =m$, so that $\left\vert
A\right\vert =m=\left\vert \left[  m\right]  \right\vert $. Thus, the sets $A$
and $\left[  m\right]  $ have the same size. Hence, Theorem
\ref{thm.bij-rule-conv} (applied to $X=A$ and $Y=\left[  m\right]  $) shows
that there is a bijection $\alpha:A\rightarrow\left[  m\right]  $. Likewise,
there is a bijection $\beta:B\rightarrow\left[  n\right]  $. Consider these
$\alpha$ and $\beta$. Now, it is easy to see that the maps%
\begin{align*}
\left\{  \text{surjective maps from }A\text{ to }B\right\}   &  \rightarrow
\left\{  \text{surjective maps from }\left[  m\right]  \text{ to }\left[
n\right]  \right\}  ,\\
f  &  \mapsto\beta\circ f\circ\alpha^{-1}%
\end{align*}
and%
\begin{align*}
\left\{  \text{surjective maps from }\left[  m\right]  \text{ to }\left[
n\right]  \right\}   &  \rightarrow\left\{  \text{surjective maps from
}A\text{ to }B\right\}  ,\\
f  &  \mapsto\beta^{-1}\circ f\circ\alpha
\end{align*}
are well-defined and mutually inverse; thus, they are bijections. Hence, the
bijection principle yields%
\begin{align*}
&  \left(  \text{\# of surjective maps from }A\text{ to }B\right) \\
&  =\left(  \text{\# of surjective maps from }\left[  m\right]  \text{ to
}\left[  n\right]  \right)  =\operatorname*{sur}\left(  m,n\right)
\end{align*}
(since $\operatorname*{sur}\left(  m,n\right)  $ was defined to be the \# of
surjective maps from $\left[  m\right]  $ to $\left[  n\right]  $).}
\end{proof}

Recall that \textquotedblleft surjection\textquotedblright\ is a shorthand for
\textquotedblleft surjective map\textquotedblright. Thus, for any
$m,n\in\mathbb{N}$, we have%
\begin{align}
&  \left(  \text{\# of surjections from }\left[  m\right]  \text{ to }\left[
n\right]  \right) \nonumber\\
&  =\left(  \text{\# of surjective maps from }\left[  m\right]  \text{ to
}\left[  n\right]  \right)  =\operatorname*{sur}\left(  m,n\right)
\label{eq.binom.maps-sur.1}%
\end{align}
(since $\operatorname*{sur}\left(  m,n\right)  $ is defined as the \# of
surjective maps from $\left[  m\right]  $ to $\left[  n\right]  $).

Let us next determine some values of $\operatorname*{sur}\left(  m,n\right)  $
(with heavy use of Iverson brackets):

\begin{proposition}
\label{prop.binom.surm0-etc}\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,k\right)  =\left[
k=0\right]  $ for all $k\in\mathbb{N}$.

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

\textbf{(f)} We have $\operatorname*{sur}\left(  m,n\right)  =0$ for all
$m,n\in\mathbb{N}$ satisfying $m<n$.
\end{proposition}

Proving this proposition is an easy exercise in understanding what
surjectivity of maps means (as well as applying Theorem
\ref{thm.binom.maps-all} and Theorem \ref{thm.php-sur} \textbf{(a)}):

\begin{teachingnote}
Parts of the following proof should be exercises:
\end{teachingnote}

\begin{fineprint}
\begin{proof}
[Proof of Proposition \ref{prop.binom.surm0-etc}.]The set $\left[  0\right]  $
is empty. Thus, there is exactly one map from $\left[  0\right]  $ to $\left[
0\right]  $ (namely, the \textquotedblleft empty map\textquotedblright, which
sends nothing anywhere). This map is surjective\footnote{Indeed, a map
$f:A\rightarrow B$ (where $A$ and $B$ are two sets) is surjective if and only
if each element of $B$ lies in its image. If the set $B$ is empty, then this
is vacuously true.}. Hence, there is exactly one surjective map from $\left[
0\right]  $ to $\left[  0\right]  $. In other words, $\operatorname*{sur}%
\left(  0,0\right)  =1$ (since $\operatorname*{sur}\left(  0,0\right)  $ is
defined as the \# of surjective maps from $\left[  0\right]  $ to $\left[
0\right]  $). Comparing $\operatorname*{sur}\left(  0,0\right)  =1$ with
$\left[  0=0\right]  =1$, we obtain $\operatorname*{sur}\left(  0,0\right)
=\left[  0=0\right]  $.

\textbf{(a)} Let $m\in\mathbb{N}$. Recall that $\operatorname*{sur}\left(
0,0\right)  =\left[  0=0\right]  $. In other words, Proposition
\ref{prop.binom.surm0-etc} \textbf{(a)} holds for $m=0$. Thus, for the rest of
this proof, we WLOG assume that $m\neq0$. Hence, $m>0$ (since $m\in\mathbb{N}%
$). Thus, $1\in\left[  m\right]  $. Hence, there exists no map from $\left[
m\right]  $ to $\left[  0\right]  $ (because such a map would have to send $1$
to some element of $\left[  0\right]  $, but there is no element of $\left[
0\right]  $ to send it to). Thus, a fortiori, there exists no surjective map
from $\left[  m\right]  $ to $\left[  0\right]  $. In other words,
$\operatorname*{sur}\left(  m,0\right)  =0$ (since $\operatorname*{sur}\left(
m,0\right)  $ is defined as the \# of surjective maps from $\left[  m\right]
$ to $\left[  0\right]  $). Comparing this with $\left[  m=0\right]  =0$
(which follows from $m\neq0$), we obtain $\operatorname*{sur}\left(
m,0\right)  =\left[  m=0\right]  $. Thus, Proposition
\ref{prop.binom.surm0-etc} \textbf{(a)} is proved.

\textbf{(f)} Let $m,n\in\mathbb{N}$ be such that $m<n$. Theorem
\ref{thm.php-sur} \textbf{(a)} (applied to $A=\left[  m\right]  $ and
$B=\left[  n\right]  $) shows that if $f:\left[  m\right]  \rightarrow\left[
n\right]  $ is a surjective map, then $\left\vert \left[  m\right]
\right\vert \geq\left\vert \left[  n\right]  \right\vert $; but this
contradicts $\left\vert \left[  m\right]  \right\vert =m<n=\left\vert \left[
n\right]  \right\vert $. Thus, we obtain a contradiction for each surjective
map $f:\left[  m\right]  \rightarrow\left[  n\right]  $. Hence, there exists
no such map. In other words, there is no surjective map from $\left[
m\right]  $ to $\left[  n\right]  $. In other words, $\operatorname*{sur}%
\left(  m,n\right)  =0$ (since $\operatorname*{sur}\left(  m,n\right)  $ is
defined as the \# of surjective maps from $\left[  m\right]  $ to $\left[
n\right]  $). This proves Proposition \ref{prop.binom.surm0-etc} \textbf{(f)}.

\textbf{(d)} Let $k\in\mathbb{N}$. Recall that $\operatorname*{sur}\left(
0,0\right)  =\left[  0=0\right]  $. In other words, Proposition
\ref{prop.binom.surm0-etc} \textbf{(d)} holds for $k=0$. Hence, for the rest
of this proof, we WLOG assume that $k\neq0$. Hence, $k>0$ (since
$k\in\mathbb{N}$), so that $0<k$. Thus, Proposition \ref{prop.binom.surm0-etc}
\textbf{(f)} (applied to $m=0$ and $n=k$) yields $\operatorname*{sur}\left(
0,k\right)  =0$. Comparing this with $\left[  k=0\right]  =0$ (which follows
from $k\neq0$), we obtain $\operatorname*{sur}\left(  0,k\right)  =\left[
k=0\right]  $. This proves Proposition \ref{prop.binom.surm0-etc} \textbf{(d)}.

\textbf{(b)} Let $m\in\mathbb{N}$. We need to prove the chain of equalities
$\operatorname*{sur}\left(  m,1\right)  =\left[  m\neq0\right]  =1-\left[
m=0\right]  $. The second of these equalities is easily
checked\footnote{Indeed, it is a particular case of the equality $\left[
\text{not }\mathcal{A}\right]  =1-\left[  \mathcal{A}\right]  $, which holds
for any logical statement $\mathcal{A}$. Applying the latter equality to
$\mathcal{A}=\left(  \text{\textquotedblleft}m=0\text{\textquotedblright%
}\right)  $, we obtain $\left[  \text{not }\left(  m=0\right)  \right]
=1-\left[  m=0\right]  $. In other words, $\left[  m\neq0\right]  =1-\left[
m=0\right]  $.}. Thus, it remains to prove the first equality, i.e., the
equality $\operatorname*{sur}\left(  m,1\right)  =\left[  m\neq0\right]  $.

Proposition \ref{prop.binom.surm0-etc} \textbf{(d)} (applied to $k=1$) yields
$\operatorname*{sur}\left(  0,1\right)  =\left[  1=0\right]  =0$ (since
$1\neq0$). Comparing this with $\left[  0\neq0\right]  =0$ (since $0=0$), we
obtain $\operatorname*{sur}\left(  0,1\right)  =\left[  0\neq0\right]  $. In
other words, the equality $\operatorname*{sur}\left(  m,1\right)  =\left[
m\neq0\right]  $ (which we intend to prove) holds for $m=0$. Thus, for the
rest of this proof, we WLOG assume that $m\neq0$. Hence, $m>0$ (since
$m\in\mathbb{N}$), so that $1\in\left[  m\right]  $. Now, the set $\left[
1\right]  $ has only one element, namely $1$. Thus, there is exactly one map
from $\left[  m\right]  $ to $\left[  1\right]  $: namely, the map $f$ that
sends each element of $\left[  m\right]  $ to $1$ (because the only possible
value for this map is $1$). This map is surjective, because the only element
of $\left[  1\right]  $ (namely, $1$) is a value of this map (indeed, it is
the value of this map at $1\in\left[  m\right]  $). Thus, there is exactly one
surjective map from $\left[  m\right]  $ to $\left[  1\right]  $. In other
words, $\operatorname*{sur}\left(  m,1\right)  =1$ (since $\operatorname*{sur}%
\left(  m,1\right)  $ is defined as the \# of surjective maps from $\left[
m\right]  $ to $\left[  1\right]  $). Comparing this with $\left[
m\neq0\right]  =1$ (which follows from $m\neq0$), we obtain
$\operatorname*{sur}\left(  m,1\right)  =\left[  m\neq0\right]  $. This
completes our proof of Proposition \ref{prop.binom.surm0-etc} \textbf{(b)}.

\textbf{(e)} Let $k\in\mathbb{N}$. Proposition \ref{prop.binom.surm0-etc}
\textbf{(b)} (applied to $m=1$) yields $\operatorname*{sur}\left(  1,1\right)
=\left[  1\neq0\right]  =1-\left[  1=0\right]  $. Hence, $\operatorname*{sur}%
\left(  1,1\right)  =\left[  1\neq0\right]  =1$ (since $1\neq0$). Compared
with $\left[  1=1\right]  =1$, this yields $\operatorname*{sur}\left(
1,1\right)  =\left[  1=1\right]  $. In other words, Proposition
\ref{prop.binom.surm0-etc} \textbf{(e)} holds for $k=1$. Hence, for the rest
of this proof, we WLOG assume that $k\neq1$.

Proposition \ref{prop.binom.surm0-etc} \textbf{(a)} (applied to $m=1$) yields
$\operatorname*{sur}\left(  1,0\right)  =\left[  1=0\right]  =0$ (since
$1\neq0$). Compared with $\left[  0=1\right]  =0$, this yields
$\operatorname*{sur}\left(  1,0\right)  =\left[  0=1\right]  $. In other
words, Proposition \ref{prop.binom.surm0-etc} \textbf{(e)} holds for $k=0$.
Hence, for the rest of this proof, we WLOG assume that $k\neq0$.

We now have $k\neq0$ and $k\neq1$. Hence, $k\geq2$ (since $k\in\mathbb{N}$).
Thus, $k\geq2>1$, so that $1<k$. Hence, Proposition \ref{prop.binom.surm0-etc}
\textbf{(f)} (applied to $m=1$ and $n=k$) yields $\operatorname*{sur}\left(
1,k\right)  =0$. Comparing this with $\left[  k=1\right]  =0$ (which is
because $k\neq1$), we obtain $\operatorname*{sur}\left(  1,k\right)  =\left[
k=1\right]  $. This proves Proposition \ref{prop.binom.surm0-etc} \textbf{(e)}.

\textbf{(c)} Let $m\in\mathbb{N}$. Proposition \ref{prop.binom.surm0-etc}
\textbf{(d)} (applied to $k=2$) yields $\operatorname*{sur}\left(  0,2\right)
=\left[  2=0\right]  =0$. Comparing this with $\underbrace{2^{0}}%
_{=1}-2+\underbrace{\left[  0=0\right]  }_{=1}=1-2+1=0$, we obtain
$\operatorname*{sur}\left(  0,2\right)  =2^{0}-2+\left[  0=0\right]  $. Thus,
Proposition \ref{prop.binom.surm0-etc} \textbf{(c)} holds for $m=0$. Hence,
for the rest of this proof, we WLOG assume that $m\neq0$. Hence, $1\in\left[
m\right]  $. Now, Theorem \ref{thm.binom.maps-all} (applied to $n=2$,
$A=\left[  m\right]  $ and $B=\left[  2\right]  $) yields%
\[
\left(  \text{\# of maps from }\left[  m\right]  \text{ to }\left[  2\right]
\right)  =2^{m}.
\]
In other words, there are exactly $2^{m}$ maps from $\left[  m\right]  $ to
$\left[  2\right]  $. Which of these $2^{m}$ maps are surjective? Obviously,
in order for a map $f:\left[  m\right]  \rightarrow\left[  2\right]  $ to be
surjective, it suffices that both $1$ and $2$ appear as its values; in other
words, it must avoid sending all elements of $\left[  m\right]  $ to $1$, and
it must avoid sending all elements of $\left[  m\right]  $ to $2$. Thus, among
the $2^{m}$ maps from $\left[  m\right]  $ to $\left[  2\right]  $, only two
fail to be surjective: namely, the map $\alpha$ that sends all elements of
$\left[  m\right]  $ to $1$, and the map $\beta$ that sends all elements of
$\left[  m\right]  $ to $2$. Moreover, these two maps $\alpha$ and $\beta$ are
distinct (because $\alpha\left(  1\right)  =1\neq2=\beta\left(  1\right)  $).
Hence, exactly $2$ out of the $2^{m}$ maps from $\left[  m\right]  $ to
$\left[  2\right]  $ fail to be surjective. Thus,%
\[
\left(  \text{\# of surjective maps from }\left[  m\right]  \text{ to }\left[
2\right]  \right)  =2^{m}-2.
\]
This rewrites as $\operatorname*{sur}\left(  m,2\right)  =2^{m}-2$ (since
$\operatorname*{sur}\left(  m,2\right)  $ is defined as the \# of surjective
maps from $\left[  m\right]  $ to $\left[  2\right]  $). Compared with
$2^{m}-2+\underbrace{\left[  m=0\right]  }_{\substack{=0\\\text{(since }%
m\neq0\text{)}}}=2^{m}-2$, this yields $\operatorname*{sur}\left(  m,2\right)
=2^{m}-2+\left[  m=0\right]  $. Thus, Proposition \ref{prop.binom.surm0-etc}
\textbf{(c)} is proved.
\end{proof}
\end{fineprint}

Proposition \ref{prop.binom.surm0-etc} gives us many values of
$\operatorname*{sur}\left(  m,n\right)  $, but far from all of them -- and
certainly not the most interesting ones. For example, what is
$\operatorname*{sur}\left(  30,20\right)  $ ?

It thus is reasonable to look for a recursive formula for $\operatorname*{sur}%
\left(  m,n\right)  $. We shall show two different approaches to this
question, giving two different recursive formulas.

\bigskip

\textit{1st approach:} Fix $m\in\mathbb{N}$ and a positive integer $n>0$.
Thus, $n\in\left[  n\right]  $.

Given a surjective map $f:\left[  m\right]  \rightarrow\left[  n\right]  $, we
let $J_{f}$ be the set of all $i\in\left[  m\right]  $ such that $f\left(
i\right)  =n$.\ \ \ \ \footnote{For example, if $m=4$ and $n=3$, and if
$f:\left[  m\right]  \rightarrow\left[  n\right]  $ is the surjective map
written in two-line notation as $\left(
\begin{array}
[c]{cccc}%
1 & 2 & 3 & 4\\
3 & 1 & 3 & 2
\end{array}
\right)  $, then $J_{f}=\left\{  1,3\right\}  $, because $1$ and $3$ are
precisely the $i\in\left[  4\right]  $ such that $f\left(  i\right)  =3$.}
Clearly, this set $J_{f}$ is a subset of $\left[  m\right]  $ and satisfies
$J_{f}\neq\varnothing$ (since $f$ is surjective, so there exists at least one
$i\in\left[  m\right]  $ such that $f\left(  i\right)  =n$). Thus, the sum
rule yields%
\begin{align}
&  \left(  \text{\# of all surjective maps }f:\left[  m\right]  \rightarrow
\left[  n\right]  \right) \nonumber\\
&  =\sum_{\substack{J\subseteq\left[  m\right]  ;\\J\neq\varnothing}}\left(
\text{\# of all surjective maps }f:\left[  m\right]  \rightarrow\left[
n\right]  \text{ satisfying }J_{f}=J\right)  .
\label{pf.prop.binom.surmn-rec1.0}%
\end{align}


Now, fix a subset $J$ of $\left[  m\right]  $ that satisfies $J\neq
\varnothing$. What is the \# of all surjective maps $f:\left[  m\right]
\rightarrow\left[  n\right]  $ satisfying $J_{f}=J$ ? Such a map $f$ must
satisfy%
\[
J=J_{f}=\left\{  i\in\left[  m\right]  \ \mid\ f\left(  i\right)  =n\right\}
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }J_{f}\right)  .
\]
In other words, such a map $f$ must send all elements of $J$, but no other
elements, to $n$. In other words, it must send all elements of $J$ to $n$, and
send all other elements of $\left[  m\right]  $ to numbers different from $n$.
The latter numbers are, of course, the elements of $\left[  n\right]
\setminus\left\{  n\right\}  =\left[  n-1\right]  $. Thus, a surjective map
$f:\left[  m\right]  \rightarrow\left[  n\right]  $ satisfying $J_{f}=J$ must
send all elements of $J$ to $n$, and send all elements of $\left[  m\right]
\setminus J$ to elements of $\left[  n-1\right]  $. Hence, if $f$ is such a
map, then $f$ is uniquely determined by its values at the elements of $\left[
m\right]  \setminus J$, and said values must belong to $\left[  n-1\right]  $.
In other words, if $f$ is such a map, then $f$ is uniquely determined by its
restriction $f\mid_{\left[  m\right]  \setminus J}$, and furthermore this
restriction must \textquotedblleft actually\textquotedblright\ be a map from
$\left[  m\right]  \setminus J$ to $\left[  n-1\right]  $, in the sense that
all its values belong to $\left[  n-1\right]  $. Moreover, in order for the
map $f$ to be surjective, all of the numbers $1,2,\ldots,n$ must be values of
$f$. Since $J\neq\varnothing$, we know that $n$ will always be a value of $f$
(indeed, $f$ sends any element of $J$ to $n$, and there is at least one
element of $J$, since $J\neq\varnothing$); we thus only need to ensure that
$1,2,\ldots,n-1$ are values of $f$ as well. Obviously, these values must be
taken at elements of $\left[  m\right]  \setminus J$ (because $f$ sends all
elements of $J$ to $n$). In other words, if we restrict $f$ to the set
$\left[  m\right]  \setminus J$, then the resulting map $f\mid_{\left[
m\right]  \setminus J}:\left[  m\right]  \setminus J\rightarrow\left[
n\right]  $ needs to take all the numbers $1,2,\ldots,n-1$ as values; i.e., if
we consider $f\mid_{\left[  m\right]  \setminus J}$ as a map from $\left[
m\right]  \setminus J$ to $\left[  n-1\right]  $, then $f\mid_{\left[
m\right]  \setminus J}$ should be surjective. Thus, in order to construct a
surjective map $f:\left[  m\right]  \rightarrow\left[  n\right]  $ satisfying
$J_{f}=J$, we need to construct a surjective map from $\left[  m\right]
\setminus J$ to $\left[  n-1\right]  $. Hence,%
\begin{align}
&  \left(  \text{\# of all surjective maps }f:\left[  m\right]  \rightarrow
\left[  n\right]  \text{ satisfying }J_{f}=J\right) \nonumber\\
&  =\left(  \text{\# of all surjective maps from }\left[  m\right]  \setminus
J\text{ to }\left[  n-1\right]  \right)  . \label{pf.prop.binom.surmn-rec1.1a}%
\end{align}
(Formally speaking, this can be proved using the bijection
principle\footnote{More precisely, we need to apply the bijection principle to
the bijection%
\[
\left\{  \text{surjective maps }f:\left[  m\right]  \rightarrow\left[
n\right]  \text{ satisfying }J_{f}=J\right\}  \rightarrow\left\{
\text{surjective maps from }\left[  m\right]  \setminus J\text{ to }\left[
n-1\right]  \right\}
\]
that sends each $f$ to its restriction $f\mid_{\left[  m\right]  \setminus J}$
(considered as a map from $\left[  m\right]  \setminus J$ to $\left[
n-1\right]  $).
\par
Here, of course, we are using the fact that if $f:\left[  m\right]
\rightarrow\left[  n\right]  $ satisfies $J_{f}=J$, then the restriction
$f\mid_{\left[  m\right]  \setminus J}$ can be considered as a map from
$\left[  m\right]  \setminus J$ to $\left[  n-1\right]  $, since it does not
take the value $n$.}.)

On the other hand, $J\subseteq\left[  m\right]  $, and thus an application of
Theorem \ref{thm.subset-leq} \textbf{(a)} yields $\left\vert \left[  m\right]
\setminus J\right\vert =\underbrace{\left\vert \left[  m\right]  \right\vert
}_{=m}-\left\vert J\right\vert =m-\left\vert J\right\vert $. Thus, $\left[
m\right]  \setminus J$ is an $\left(  m-\left\vert J\right\vert \right)
$-element set. Also, $\left[  n-1\right]  $ is an $\left(  n-1\right)
$-element set (since $n$ is a positive integer, so that $n-1\in\mathbb{N}$).
Hence, Proposition \ref{prop.binom.maps-surj} (applied to $\left[  m\right]
\setminus J$, $\left[  n-1\right]  $, $\left\vert \left[  m\right]  \setminus
J\right\vert $, and $\left\vert \left[  n-1\right]  \right\vert $ instead of
$A$, $B$, $m$ and $n$) yields%
\[
\left(  \text{\# of all surjective maps }\left[  m\right]  \setminus
J\rightarrow\left[  n-1\right]  \right)  =\operatorname*{sur}\left(
m-\left\vert J\right\vert ,n-1\right)  .
\]
Thus, (\ref{pf.prop.binom.surmn-rec1.1a}) becomes%
\begin{align}
&  \left(  \text{\# of all surjective maps }f:\left[  m\right]  \rightarrow
\left[  n\right]  \text{ satisfying }J_{f}=J\right) \nonumber\\
&  =\left(  \text{\# of all surjective maps from }\left[  m\right]  \setminus
J\text{ to }\left[  n-1\right]  \right) \nonumber\\
&  =\operatorname*{sur}\left(  m-\left\vert J\right\vert ,n-1\right)  .
\label{pf.prop.binom.surmn-rec1.1b}%
\end{align}


Now, forget that we fixed $J$. We thus have proved
(\ref{pf.prop.binom.surmn-rec1.1b}) for each subset $J$ of $\left[  m\right]
$ satisfying $J\neq\varnothing$. Hence, (\ref{pf.prop.binom.surmn-rec1.0})
becomes%
\begin{align}
&  \left(  \text{\# of all surjective maps }f:\left[  m\right]  \rightarrow
\left[  n\right]  \right) \nonumber\\
&  =\sum_{\substack{J\subseteq\left[  m\right]  ;\\J\neq\varnothing
}}\underbrace{\left(  \text{\# of all surjective maps }f:\left[  m\right]
\rightarrow\left[  n\right]  \text{ satisfying }J_{f}=J\right)  }%
_{\substack{=\operatorname*{sur}\left(  m-\left\vert J\right\vert ,n-1\right)
\\\text{(by (\ref{pf.prop.binom.surmn-rec1.1b}))}}}\nonumber\\
&  =\sum_{\substack{J\subseteq\left[  m\right]  ;\\J\neq\varnothing
}}\operatorname*{sur}\left(  m-\left\vert J\right\vert ,n-1\right)
=\underbrace{\sum_{j\in\left\{  1,2,\ldots,m\right\}  }}_{=\sum_{j=1}^{m}%
}\ \ \sum_{\substack{J\subseteq\left[  m\right]  ;\\J\neq\varnothing
;\\\left\vert J\right\vert =j}}\operatorname*{sur}\left(
m-\underbrace{\left\vert J\right\vert }_{=j},n-1\right) \nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have split the sum according to the value of }\left\vert
J\right\vert \text{,}\\
\text{because each subset }J\text{ of }\left[  m\right]  \text{ satisfying
}J\neq\varnothing\text{ (that is,}\\
\text{each nonempty subset }J\text{ of }\left[  m\right]  \text{) satisfies
}\left\vert J\right\vert \in\left\{  1,2,\ldots,m\right\} \\
\text{(since }J\subseteq\left[  m\right]  \text{ entails }\left\vert
J\right\vert \leq m\text{, whereas }J\neq\varnothing\text{ entails }\left\vert
J\right\vert \geq1\text{)}%
\end{array}
\right) \nonumber\\
&  =\sum_{j=1}^{m}\underbrace{\sum_{\substack{J\subseteq\left[  m\right]
;\\J\neq\varnothing;\\\left\vert J\right\vert =j}}\operatorname*{sur}\left(
m-j,n-1\right)  }_{=\left(  \text{\# of }J\subseteq\left[  m\right]  \text{
such that }J\neq\varnothing\text{ and }\left\vert J\right\vert =j\right)
\cdot\operatorname*{sur}\left(  m-j,n-1\right)  }\nonumber\\
&  =\sum_{j=1}^{m}\left(  \text{\# of }J\subseteq\left[  m\right]  \text{ such
that }J\neq\varnothing\text{ and }\left\vert J\right\vert =j\right)
\cdot\operatorname*{sur}\left(  m-j,n-1\right)  .
\label{pf.prop.binom.surmn-rec1.2}%
\end{align}
We shall next simplify the \# on the right hand side of this equation. Indeed,
let $j\in\left[  m\right]  $. Thus, $j\geq1>0$. Hence, each subset $J$ of
$\left[  m\right]  $ satisfying $\left\vert J\right\vert =j$ must
automatically be nonempty (since $\left\vert J\right\vert =j>0$); in other
words, it must satisfy $J\neq\varnothing$. Thus, the requirement
$J\neq\varnothing$ in \textquotedblleft\# of $J\subseteq\left[  m\right]  $
such that $J\neq\varnothing$ and $\left\vert J\right\vert =j$%
\textquotedblright\ is redundant. Hence,%
\begin{align}
&  \left(  \text{\# of }J\subseteq\left[  m\right]  \text{ such that }%
J\neq\varnothing\text{ and }\left\vert J\right\vert =j\right) \nonumber\\
&  =\left(  \text{\# of }J\subseteq\left[  m\right]  \text{ such that
}\left\vert J\right\vert =j\right) \nonumber\\
&  =\left(  \text{\# of }j\text{-element subsets of }\left[  m\right]
\right)  =\dbinom{m}{j} \label{pf.prop.binom.surmn-rec1.3}%
\end{align}
(by Theorem \ref{thm.binom.comb}, applied to $m$, $j$ and $\left[  m\right]  $
instead of $n$, $k$ and $S$).

Forget that we fixed $j$. We thus have proved
(\ref{pf.prop.binom.surmn-rec1.3}) for each $j\in\left[  m\right]  $. Hence,
(\ref{pf.prop.binom.surmn-rec1.2}) becomes%
\begin{align*}
&  \left(  \text{\# of all surjective maps }f:\left[  m\right]  \rightarrow
\left[  n\right]  \right) \\
&  =\sum_{j=1}^{m}\underbrace{\left(  \text{\# of }J\subseteq\left[  m\right]
\text{ such that }J\neq\varnothing\text{ and }\left\vert J\right\vert
=j\right)  }_{\substack{=\dbinom{m}{j}\\\text{(by
(\ref{pf.prop.binom.surmn-rec1.3}))}}}\cdot\operatorname*{sur}\left(
m-j,n-1\right) \\
&  =\sum_{j=1}^{m}\underbrace{\dbinom{m}{j}}_{\substack{=\dbinom{m}%
{m-j}\\\text{(by Theorem \ref{thm.binom.sym},}\\\text{applied to }m\text{ and
}j\\\text{instead of }n\text{ and }k\text{)}}}\cdot\operatorname*{sur}\left(
m-j,n-1\right)  =\sum_{j=1}^{m}\dbinom{m}{m-j}\cdot\operatorname*{sur}\left(
m-j,n-1\right) \\
&  =\sum_{j=0}^{m-1}\dbinom{m}{j}\cdot\operatorname*{sur}\left(  j,n-1\right)
\end{align*}
(here, we have substituted $m-j$ for $j$ in the sum). Hence,%
\begin{align*}
\operatorname*{sur}\left(  m,n\right)   &  =\left(  \text{\# of all surjective
maps }f:\left[  m\right]  \rightarrow\left[  n\right]  \right) \\
&  =\sum_{j=1}^{m}\dbinom{m}{j}\cdot\operatorname*{sur}\left(  m-j,n-1\right)
=\sum_{j=0}^{m-1}\dbinom{m}{j}\cdot\operatorname*{sur}\left(  j,n-1\right)  .
\end{align*}


Forget that we fixed $m$ and $n$. Thus, we have proved the following recursive
formula for the numbers $\operatorname*{sur}\left(  m,n\right)  $:

\begin{proposition}
\label{prop.binom.surmn-rec1}Let $m\in\mathbb{N}$, and let $n$ be a positive
integer. Then,%
\[
\operatorname*{sur}\left(  m,n\right)  =\sum_{j=1}^{m}\dbinom{m}{j}%
\cdot\operatorname*{sur}\left(  m-j,n-1\right)  =\sum_{j=0}^{m-1}\dbinom{m}%
{j}\cdot\operatorname*{sur}\left(  j,n-1\right)  .
\]

\end{proposition}

Using this proposition and Proposition \ref{prop.binom.surm0-etc}
\textbf{(a)}, it is easy to compute $\operatorname*{sur}\left(  m,n\right)  $ recursively.

\begin{center}
\fbox{\textbf{Class of 2019-10-23}}
\end{center}

\bigskip

\textit{2nd approach:} Here is another way to get a recursive formula for
$\operatorname*{sur}\left(  m,n\right)  $.

Fix two positive integers $m$ and $n$. Let us classify the surjections
$\left[  m\right]  \rightarrow\left[  n\right]  $ according to the image of
$m$.

A surjection $f:\left[  m\right]  \rightarrow\left[  n\right]  $ will be called

\begin{itemize}
\item \textbf{red} if $f\left(  m\right)  =f\left(  i\right)  $ for some
$i\in\left[  m-1\right]  $;

\item \textbf{green} if it is not red (i.e., if $f\left(  m\right)  \neq
f\left(  i\right)  $ for all $i\in\left[  m-1\right]  $).
\end{itemize}

[\textit{Examples:} If $m=4$ and $n=3$, then the surjection $f_{1}:\left[
m\right]  \rightarrow\left[  n\right]  $ written in two-line notation as
$\left(
\begin{array}
[c]{cccc}%
1 & 2 & 3 & 4\\
2 & 1 & 3 & 2
\end{array}
\right)  $ is red (since $f_{1}\left(  m\right)  =f_{1}\left(  1\right)  $
with $1\in\left[  m-1\right]  $), while the surjection $f_{2}:\left[
m\right]  \rightarrow\left[  n\right]  $ written in two-line notation as
$\left(
\begin{array}
[c]{cccc}%
1 & 2 & 3 & 4\\
2 & 1 & 2 & 3
\end{array}
\right)  $ is green (since $f_{2}\left(  m\right)  =3\neq f_{2}\left(
i\right)  $ for all $i\in\left[  m-1\right]  $).]

If $f:\left[  m\right]  \rightarrow\left[  n\right]  $ is a red surjection,
then its restriction $f\mid_{\left[  m-1\right]  }:\left[  m-1\right]
\rightarrow\left[  n\right]  $ is \textquotedblleft still\textquotedblright\ a
surjection\footnote{\textit{Formal proof.} Let $f:\left[  m\right]
\rightarrow\left[  n\right]  $ be a red surjection. Then, $f$ is surjective;
thus, $f\left(  \left[  m\right]  \right)  =\left[  n\right]  $. Also,
$f\left(  m\right)  =f\left(  i\right)  $ for some $i\in\left[  m-1\right]  $
(since $f$ is red). Consider this $i$. From $i\in\left[  m-1\right]  =\left\{
1,2,\ldots,m-1\right\}  $, we obtain $f\left(  i\right)  \in\left\{  f\left(
1\right)  ,f\left(  2\right)  ,\ldots,f\left(  m-1\right)  \right\}  $. Hence,
$f\left(  m\right)  =f\left(  i\right)  \in\left\{  f\left(  1\right)
,f\left(  2\right)  ,\ldots,f\left(  m-1\right)  \right\}  $, so that
$\left\{  f\left(  m\right)  \right\}  \subseteq\left\{  f\left(  1\right)
,f\left(  2\right)  ,\ldots,f\left(  m-1\right)  \right\}  $.
\par
Now, the image of the restriction $f\mid_{\left[  m-1\right]  }$ is the set%
\begin{align*}
\left(  f\mid_{\left[  m-1\right]  }\right)  \left(  \left[  m-1\right]
\right)   &  =\left\{  \underbrace{\left(  f\mid_{\left[  m-1\right]
}\right)  \left(  j\right)  }_{\substack{=f\left(  j\right)  \\\text{(since
}f\mid_{\left[  m-1\right]  }\text{ is a restriction of }f\text{)}}%
}\ \mid\ j\in\left[  m-1\right]  \right\}  =\left\{  f\left(  j\right)
\ \mid\ j\in\left[  m-1\right]  \right\} \\
&  =\left\{  f\left(  1\right)  ,f\left(  2\right)  ,\ldots,f\left(
m-1\right)  \right\}  =\left\{  f\left(  1\right)  ,f\left(  2\right)
,\ldots,f\left(  m-1\right)  \right\}  \cup\left\{  f\left(  m\right)
\right\} \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left\{  f\left(  m\right)
\right\}  \subseteq\left\{  f\left(  1\right)  ,f\left(  2\right)
,\ldots,f\left(  m-1\right)  \right\}  \right) \\
&  =\left\{  f\left(  1\right)  ,f\left(  2\right)  ,\ldots,f\left(
m-1\right)  ,f\left(  m\right)  \right\}  =\left\{  f\left(  1\right)
,f\left(  2\right)  ,\ldots,f\left(  m\right)  \right\}  =f\left(  \left[
m\right]  \right)  =\left[  n\right]
\end{align*}
(since $f$ is surjective). Thus, the map $f\mid_{\left[  m-1\right]  }:\left[
m-1\right]  \rightarrow\left[  n\right]  $ is surjective. In other words,
$f\mid_{\left[  m-1\right]  }:\left[  m-1\right]  \rightarrow\left[  n\right]
$ is a surjection.}. Conversely, if $f:\left[  m\right]  \rightarrow\left[
n\right]  $ is any map whose restriction $f\mid_{\left[  m-1\right]  }:\left[
m-1\right]  \rightarrow\left[  n\right]  $ is a surjection, then $f$ must be a
red surjection\footnote{Check this! (The idea is: Since $f\mid_{\left[
m-1\right]  }:\left[  m-1\right]  \rightarrow\left[  n\right]  $ is
surjective, we know that each element of $\left[  n\right]  $ is a value of
$f$ at one of the numbers $1,2,\ldots,m-1$. Hence, $f$ is surjective.
Moreover, $f\left(  m\right)  \in\left[  n\right]  $ must also be a value of
$f\mid_{\left[  m-1\right]  }$ (since $f\mid_{\left[  m-1\right]  }$ is
surjective); but this is saying that $f\left(  m\right)  =f\left(  i\right)  $
for some $i\in\left[  m-1\right]  $. This shows that the surjection $f$ is
red.)}.

Thus, we get the following algorithm for constructing a red surjection
$f:\left[  m\right]  \rightarrow\left[  n\right]  $:

\begin{itemize}
\item first, we choose $f\left(  m\right)  $ (there are $n$ choices for this,
since we want $f\left(  m\right)  \in\left[  n\right]  $);

\item then, we choose $f\left(  1\right)  ,f\left(  2\right)  ,\ldots,f\left(
m-1\right)  $; in other words, we choose the restriction $f\mid_{\left[
m-1\right]  }$ (there are $\operatorname*{sur}\left(  m-1,n\right)  $ choices
for this, since $f\mid_{\left[  m-1\right]  }$ has to be a surjection from
$\left[  m-1\right]  $ to $\left[  n\right]  $).
\end{itemize}

Hence, the dependent product rule yields%
\begin{equation}
\left(  \text{\# of red surjections }f:\left[  m\right]  \rightarrow\left[
n\right]  \right)  =n\cdot\operatorname*{sur}\left(  m-1,n\right)  .
\label{pf.prop.binom.surmn-rec2.red}%
\end{equation}


(You might want to see how this argument can be formalized without speaking of
\textquotedblleft choices\textquotedblright. See Exercise
\ref{exe.binom.surmn-rec2} further below for the answer.)

On the other hand, if $f:\left[  m\right]  \rightarrow\left[  n\right]  $ is a
green surjection, then the restriction $f\mid_{\left[  m-1\right]  }$ has
image $\left[  n\right]  \setminus\left\{  f\left(  m\right)  \right\}
$\ \ \ \ \footnote{The proof proceeds roughly as follows: Let $f:\left[
m\right]  \rightarrow\left[  n\right]  $ be a green surjection. Then, the
image of $f$ contains all elements of $\left[  n\right]  $ (since $f$ is a
surjective), but the value $n$ is taken by $f$ only once, namely at $m$
(because $f$ is green). Thus, if we remove $m$ from the domain of $f$, then
$f$ will no longer take the value $n$. In other words, the restriction
$f\mid_{\left[  m-1\right]  }$ no longer takes the value $n$. Other than that,
of course, this restriction takes all the values that $f$ takes; thus, it
takes all the elements of $\left[  n\right]  $ as values except for $f\left(
m\right)  $. In other words, it has image $\left[  n\right]  \setminus\left\{
f\left(  m\right)  \right\}  $.}, and thus can be viewed as a surjection
$\left[  m-1\right]  \rightarrow\left[  n\right]  \setminus\left\{  f\left(
m\right)  \right\}  $. Conversely, if $f:\left[  m\right]  \rightarrow\left[
n\right]  $ is any map whose restriction $f\mid_{\left[  m-1\right]  }$ is a
surjection from $\left[  m-1\right]  $ to $\left[  n\right]  \setminus\left\{
f\left(  m\right)  \right\}  $, then $f$ must be a green
surjection\footnote{Check this!}. Hence, we get the following algorithm for
constructing a green surjection $f:\left[  m\right]  \rightarrow\left[
n\right]  $:

\begin{itemize}
\item first, we choose $f\left(  m\right)  $ (there are $n$ choices);

\item then, we choose $f\left(  1\right)  ,f\left(  2\right)  ,\ldots,f\left(
m-1\right)  $; in other words, we choose the restriction $f\mid_{\left[
m-1\right]  }$ (there are $\operatorname*{sur}\left(  m-1,n-1\right)  $
choices for this, because $f\mid_{\left[  m-1\right]  }$ needs to be a
surjection $\left[  m-1\right]  \rightarrow\left[  n\right]  \setminus\left\{
f\left(  m\right)  \right\}  $, and Proposition \ref{prop.binom.maps-surj}
shows that the \# of such surjections is $\operatorname*{sur}\left(
\underbrace{\left\vert \left[  m-1\right]  \right\vert }_{=m-1}%
,\underbrace{\left\vert \left[  n\right]  \setminus\left\{  f\left(  m\right)
\right\}  \right\vert }_{=n-1}\right)  =\operatorname*{sur}\left(
m-1,n-1\right)  $).
\end{itemize}

Hence,%
\begin{equation}
\left(  \text{\# of green surjections }f:\left[  m\right]  \rightarrow\left[
n\right]  \right)  =n\cdot\operatorname*{sur}\left(  m-1,n-1\right)  .
\label{pf.prop.binom.surmn-rec2.green}%
\end{equation}


(Again, see Exercise \ref{exe.binom.surmn-rec2} further below for a rigorous
proof of this equality.)

Hence, (\ref{eq.binom.maps-sur.1}) becomes%
\begin{align*}
&  \operatorname*{sur}\left(  m,n\right) \\
&  =\left(  \text{\# of surjections }f:\left[  m\right]  \rightarrow\left[
n\right]  \right) \\
&  =\underbrace{\left(  \text{\# of red surjections }f:\left[  m\right]
\rightarrow\left[  n\right]  \right)  }_{\substack{=n\cdot\operatorname*{sur}%
\left(  m-1,n\right)  \\\text{(by (\ref{pf.prop.binom.surmn-rec2.red}))}%
}}+\underbrace{\left(  \text{\# of green surjections }f:\left[  m\right]
\rightarrow\left[  n\right]  \right)  }_{\substack{=n\cdot\operatorname*{sur}%
\left(  m-1,n-1\right)  \\\text{(by (\ref{pf.prop.binom.surmn-rec2.green}))}%
}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since each surjection }f:\left[  m\right]  \rightarrow\left[  n\right]
\text{ is either red or green}\\
\text{(but not both at the same time)}%
\end{array}
\right) \\
&  =n\cdot\operatorname*{sur}\left(  m-1,n\right)  +n\cdot\operatorname*{sur}%
\left(  m-1,n-1\right) \\
&  =n\cdot\left(  \operatorname*{sur}\left(  m-1,n\right)
+\operatorname*{sur}\left(  m-1,n-1\right)  \right)  .
\end{align*}


Forget that we fixed $m$ and $n$. Thus, we have proved the following fact:

\begin{proposition}
\label{prop.binom.surmn-rec2}Let $m$ and $n$ be positive integers. Then,%
\[
\operatorname*{sur}\left(  m,n\right)  =n\cdot\left(  \operatorname*{sur}%
\left(  m-1,n\right)  +\operatorname*{sur}\left(  m-1,n-1\right)  \right)  .
\]

\end{proposition}

\begin{exercise}
\label{exe.binom.surmn-rec2}Give rigorous proofs of the equalities
(\ref{pf.prop.binom.surmn-rec2.red}) and (\ref{pf.prop.binom.surmn-rec2.green}%
) above.
\end{exercise}

Proposition \ref{prop.binom.surmn-rec2} is an even better recursion than
Proposition \ref{prop.binom.surmn-rec1}; it is almost as simple as Theorem
\ref{thm.binom.rec}. Let us draw a conclusion from it:

\begin{corollary}
\label{cor.binom.surmn-n!}\textbf{(a)} We have $\operatorname*{sur}\left(
n,n\right)  =n!$ for all $n\in\mathbb{N}$.

\textbf{(b)} The integer $\operatorname*{sur}\left(  m,n\right)  $ is a
multiple of $n!$ for all $n\in\mathbb{N}$ and $m\in\mathbb{N}$.
\end{corollary}

\begin{proof}
[First proof of Corollary \ref{cor.binom.surmn-n!} (rough idea).]Both parts
can easily be shown by induction using Proposition \ref{prop.binom.surmn-rec2}%
. (Use induction on $n$ for part \textbf{(a)}, and induction on $m$ for part
\textbf{(b)}.)
\end{proof}

\begin{exercise}
\label{exe.binom.surmn-n!} Complete this proof of Corollary
\ref{cor.binom.surmn-n!}.
\end{exercise}

\begin{proof}
[Second proof of Corollary \ref{cor.binom.surmn-n!} (rough idea).]\textbf{(a)}
Let $n\in\mathbb{N}$. The surjections $\left[  n\right]  \rightarrow\left[
n\right]  $ are bijections (by Theorem \ref{thm.php-sur} \textbf{(b)}). Thus,
they are precisely the bijections $\left[  n\right]  \rightarrow\left[
n\right]  $. In other words, they are precisely the permutations of $\left[
n\right]  $. Hence, their number is $n!$ (according to Theorem
\ref{thm.count.perms}). Thus, $\operatorname*{sur}\left(  n,n\right)  =n!$.
This proves Corollary \ref{cor.binom.surmn-n!} \textbf{(a)}.

\textbf{(b)} Here is just the idea behind the proof (as we are, so far,
missing the language for formalizing it): Each surjection $f:\left[  m\right]
\rightarrow\left[  n\right]  $ provides a way of \textquotedblleft
grouping\textquotedblright\ the elements of $\left[  m\right]  $ into $n$
nonempty (disjoint) subsets -- namely, the subsets%
\[
\underbrace{\left\{  i\in\left[  m\right]  \ \mid\ f\left(  i\right)
=1\right\}  }_{\substack{\text{the elements}\\\text{sent to }1\text{ by }%
f}},\qquad\underbrace{\left\{  i\in\left[  m\right]  \ \mid\ f\left(
i\right)  =2\right\}  }_{\substack{\text{the elements}\\\text{sent to }2\text{
by }f}},\qquad\ldots,\qquad\underbrace{\left\{  i\in\left[  m\right]
\ \mid\ f\left(  i\right)  =n\right\}  }_{\substack{\text{the elements}%
\\\text{sent to }n\text{ by }f}}.
\]
(These $n$ subsets are nonempty, since $f$ is surjective.) For example, the
surjection $f:\left[  6\right]  \rightarrow\left[  3\right]  $ that is given
in two-line notation as%
\[
\left(
\begin{array}
[c]{cccccc}%
1 & 2 & 3 & 4 & 5 & 6\\
2 & 1 & 2 & 3 & 3 & 2
\end{array}
\right)
\]
groups the elements of $\left[  6\right]  $ into the $3$ subsets%
\[
\underbrace{\left\{  2\right\}  }_{\substack{\text{the elements}\\\text{sent
to }1\text{ by }f}},\ \ \ \ \ \ \ \ \ \ \underbrace{\left\{  1,3,6\right\}
}_{\substack{\text{the elements}\\\text{sent to }2\text{ by }f}%
},\ \ \ \ \ \ \ \ \ \ \underbrace{\left\{  4,5\right\}  }_{\substack{\text{the
elements}\\\text{sent to }3\text{ by }f}}.
\]
Conversely, each such \textquotedblleft grouping\textquotedblright\ comes from
a unique surjection $f:\left[  m\right]  \rightarrow\left[  n\right]  $
(namely, the surjection which sends the elements of the $1$-st subset to $1$,
the elements of the $2$-nd subset to $2$, and so on). Hence, the \# of such
\textquotedblleft groupings\textquotedblright\ is $\operatorname*{sur}\left(
m,n\right)  $. However, if we forget the order of the subsets in each grouping
(i.e., we forget which subset is the $1$-st subset, which subset is the $2$-nd
subset, and so on, and only remember the \textbf{set} of these subsets), then
the \# of all such \textquotedblleft groupings\textquotedblright\ becomes
$\operatorname*{sur}\left(  m,n\right)  /n!$, because each unordered
\textquotedblleft grouping\textquotedblright\ can be ordered in precisely $n!$
many different ways. Thus, $\operatorname*{sur}\left(  m,n\right)
/n!\in\mathbb{N}$. This proves Corollary \ref{cor.binom.surmn-n!} \textbf{(b)}.

For the details of this argument, see \cite[\S 0.3 (on \textquotedblleft set
partitions\textquotedblright)]{18s-hw3s} (specifically, \cite[Definition
0.13]{18s-hw3s}).
\end{proof}

\begin{remark}
\label{rmk.binom.stirl2def}Let $m\in\mathbb{N}$ and $n\in\mathbb{N}$. The
number $\operatorname*{sur}\left(  m,n\right)  /n!$ is often denoted $%
%TCIMACRO{\QDATOPD{\{}{\}}{m}{n}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{m}{n}%
%EndExpansion
$, and is called a \emph{Stirling number of the second kind}. This number is
an integer, because of Corollary \ref{cor.binom.surmn-n!} \textbf{(b)}.
\end{remark}

\noindent(Of course, the expression \textquotedblleft$\operatorname*{sur}%
\left(  m,n\right)  /n!$\textquotedblright\ is to be interpreted as $\left(
\operatorname*{sur}\left(  m,n\right)  \right)  /n!$.)

Here is the most explicit formula known for $\operatorname*{sur}\left(
m,n\right)  $:

\begin{theorem}
\label{thm.binom.surmn-as-altsum}Let $m\in\mathbb{N}$ and $n\in\mathbb{N}$.
Then,%
\[
\operatorname*{sur}\left(  m,n\right)  =\sum_{i=0}^{n}\left(  -1\right)
^{n-i}\dbinom{n}{i}i^{m}.
\]

\end{theorem}

The most conceptual proof of Theorem \ref{thm.binom.surmn-as-altsum} uses the
Principle of Inclusion and Exclusion, which we have not learned yet; this
proof will appear in Subsection \ref{subsect.binom.pie.app-surj}\footnote{This
proof also appears in \cite[Exercise 2 \textbf{(b)}]{18s-hw3s}.}. But there is
also an alternative proof, which requires nothing that we have not already seen:

\begin{exercise}
\label{exe.thm.binom.surmn-as-altsum.elpf}Prove Theorem
\ref{thm.binom.surmn-as-altsum} by strong induction on $m$, using Proposition
\ref{prop.binom.surmn-rec1}.
\end{exercise}

Applying Theorem \ref{thm.binom.surmn-as-altsum} to $n=3$, we find that each
$m\in\mathbb{N}$ satisfies%
\begin{align*}
\operatorname*{sur}\left(  m,3\right)   &  =\sum_{i=0}^{3}\left(  -1\right)
^{3-i}\dbinom{3}{i}i^{m}=-\underbrace{0^{m}}_{=\left[  m=0\right]  }%
+3\cdot\underbrace{1^{m}}_{=1}-3\cdot2^{m}+3^{m}\\
&  =3^{m}-3\cdot2^{m}+3-\left[  m=0\right]  .
\end{align*}
Likewise, we can recover parts \textbf{(a)}, \textbf{(b)} and \textbf{(c)} of
Proposition \ref{prop.binom.surm0-etc} by applying Theorem
\ref{thm.binom.surmn-as-altsum} to $n=0$, $n=1$ and $n=2$, respectively.

The following exercise gives some variations on the formula in Theorem
\ref{thm.binom.surmn-as-altsum}:

\begin{exercise}
\label{exe.surmn-as-altsum.vars}Let $m$ be a positive integer. Let
$n\in\mathbb{N}$.

\textbf{(a)} Prove that%
\[
\operatorname*{sur}\left(  m,n\right)  =n\sum_{i=0}^{n}\left(  -1\right)
^{n-i}\dbinom{n-1}{i-1}i^{m-1}.
\]


\textbf{(b)} Prove that%
\[%
%TCIMACRO{\QDATOPD{\{}{\}}{m}{n}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{m}{n}%
%EndExpansion
=\sum_{i=0}^{n}\left(  -1\right)  ^{n-i}\dfrac{i^{m}}{i!\left(  n-i\right)
!}.
\]

\end{exercise}

\subsection{\label{sect.binom.powersum}$1^{m}+2^{m}+...+n^{m}$}

We have still not proved Theorem \ref{thm.1.13}. But we are getting close. The
crucial tool will be the following fact:

\begin{theorem}
\label{thm.binom.surmn-km=}Let $k\in\mathbb{N}$ and $m\in\mathbb{N}$. Then,%
\[
k^{m}=\sum_{i=0}^{m}\operatorname*{sur}\left(  m,i\right)  \cdot\dbinom{k}%
{i}.
\]

\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.binom.surmn-km=}.]We shall prove the theorem by
double counting. Let us compute the \# of all maps $f:\left[  m\right]
\rightarrow\left[  k\right]  $. We shall compute this \# in two ways:

\textit{1st way:} We have%
\begin{align}
\left(  \text{\# of maps }f:\left[  m\right]  \rightarrow\left[  k\right]
\right)   &  =\left(  \text{\# of maps from }\left[  m\right]  \text{ to
}\left[  k\right]  \right) \nonumber\\
&  =k^{m} \label{pf.thm.binom.surmn-km=.1way}%
\end{align}
(by Theorem \ref{thm.binom.maps-all}, applied to $k$, $\left[  m\right]  $ and
$\left[  k\right]  $ instead of $n$, $A$ and $B$).

\textit{2nd way:} We can construct a map $f:\left[  m\right]  \rightarrow
\left[  k\right]  $ by the following method:

\begin{itemize}
\item First, we choose the number $\left\vert f\left(  \left[  m\right]
\right)  \right\vert $ (this is the size of the image of $f$, i.e., the \# of
distinct values of $f$). This is an integer in $\left\{  0,1,\ldots,m\right\}
$\ \ \ \ \footnote{since the set $f\left(  \left[  m\right]  \right)
=f\left(  \left\{  1,2,\ldots,m\right\}  \right)  =\left\{  f\left(  1\right)
,f\left(  2\right)  ,\ldots,f\left(  m\right)  \right\}  $ clearly has at most
$m$ elements}. Let us call this integer $i$.

\item Then, we choose the set $f\left(  \left[  m\right]  \right)  $ (this is
the set of all values of $f$). There are $\dbinom{k}{i}$ many choices for this
(since $f\left(  \left[  m\right]  \right)  $ must be an $i$-element subset of
$\left[  k\right]  $).

\item Finally, we choose the map $f$ itself. The image of this map $f$ must be
the already chosen $i$-element set $f\left(  \left[  m\right]  \right)  $.
Thus, what we are choosing is essentially a surjection from the $m$-element
set $\left[  m\right]  $ to the already chosen $i$-element set $f\left(
\left[  m\right]  \right)  $. Hence, there are $\operatorname*{sur}\left(
m,i\right)  $ many choices here (by Proposition \ref{prop.binom.maps-surj}).
\end{itemize}

Thus, by the dependent product rule, we obtain%
\begin{equation}
\left(  \text{\# of maps }f:\left[  m\right]  \rightarrow\left[  k\right]
\right)  =\sum\limits_{i=0}^{m}\dbinom{k}{i}\cdot\operatorname*{sur}\left(
m,i\right)  . \label{pf.thm.binom.surmn-km=.2way}%
\end{equation}


(See Exercise \ref{exe.binom.surmn-km=} below for a rigorous presentation of
this proof.)

Comparing (\ref{pf.thm.binom.surmn-km=.1way}) with
(\ref{pf.thm.binom.surmn-km=.2way}), we obtain%
\[
k^{m}=\sum\limits_{i=0}^{m}\dbinom{k}{i}\cdot\operatorname*{sur}\left(
m,i\right)  =\sum\limits_{i=0}^{m}\operatorname*{sur}\left(  m,i\right)
\cdot\dbinom{k}{i}.
\]
This proves Theorem \ref{thm.binom.surmn-km=}.
\end{proof}

\begin{exercise}
\label{exe.binom.surmn-km=}Prove (\ref{pf.thm.binom.surmn-km=.2way}) rigorously.
\end{exercise}

\begin{theorem}
\label{thm.binom.surmn-sumkm=}Let $n\in\mathbb{N}$ and $m\in\mathbb{N}$. Then,%
\[
\sum_{k=0}^{n}k^{m}=\sum_{i=0}^{m}\operatorname*{sur}\left(  m,i\right)
\cdot\dbinom{n+1}{i+1}.
\]

\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.binom.surmn-sumkm=}.]We have%
\begin{align*}
\sum_{k=0}^{n}\underbrace{k^{m}}_{\substack{=\sum\limits_{i=0}^{m}%
\operatorname*{sur}\left(  m,i\right)  \cdot\dbinom{k}{i}\\\text{(by Theorem
\ref{thm.binom.surmn-km=})}}}  &  =\underbrace{\sum_{k=0}^{n}\ \ \sum
\limits_{i=0}^{m}}_{\substack{=\sum\limits_{i=0}^{m}\ \ \sum\limits_{k=0}%
^{n}\\\text{(here, we interchanged}\\\text{the summation signs,}\\\text{by the
Fubini principle)}}}\operatorname*{sur}\left(  m,i\right)  \cdot\dbinom{k}%
{i}=\sum\limits_{i=0}^{m}\underbrace{\sum\limits_{k=0}^{n}\operatorname*{sur}%
\left(  m,i\right)  \cdot\dbinom{k}{i}}_{=\operatorname*{sur}\left(
m,i\right)  \cdot\sum\limits_{k=0}^{n}\dbinom{k}{i}}\\
&  =\sum\limits_{i=0}^{m}\operatorname*{sur}\left(  m,i\right)  \cdot
\underbrace{\sum\limits_{k=0}^{n}\dbinom{k}{i}}_{\substack{=\dbinom{0}%
{i}+\dbinom{1}{i}+\cdots+\dbinom{n}{i}\\=\dbinom{n+1}{i+1}\\\text{(by Theorem
\ref{thm.binom.hock},}\\\text{applied to }k=i\text{)}}}=\sum\limits_{i=0}%
^{m}\operatorname*{sur}\left(  m,i\right)  \cdot\dbinom{n+1}{i+1}.
\end{align*}
This proves Theorem \ref{thm.binom.surmn-sumkm=}.
\end{proof}

\begin{proof}
[Proof of Theorem \ref{thm.1.13}.]Forget that we fixed $k$. Instead, let $m$
be a positive integer. Theorem \ref{thm.binom.surmn-sumkm=} yields%
\[
\sum_{k=0}^{n}k^{m}=\sum_{i=0}^{m}\operatorname*{sur}\left(  m,i\right)
\cdot\dbinom{n+1}{i+1}.
\]
Comparing this with%
\[
\sum_{k=0}^{n}k^{m}=\underbrace{0^{m}}_{\substack{=0\\\text{(since
}m>0\text{)}}}+1^{m}+2^{m}+\cdots+n^{m}=1^{m}+2^{m}+\cdots+n^{m}=\sum
_{i=1}^{n}i^{m},
\]
we obtain%
\[
\sum_{i=1}^{n}i^{m}=\sum_{i=0}^{m}\operatorname*{sur}\left(  m,i\right)
\cdot\dbinom{n+1}{i+1}.
\]


Now, forget that we fixed $m$. We thus have proved that
\[
\sum_{i=1}^{n}i^{m}=\sum_{i=0}^{m}\operatorname*{sur}\left(  m,i\right)
\cdot\dbinom{n+1}{i+1}\ \ \ \ \ \ \ \ \ \ \text{for each positive integer }m.
\]
Renaming $m$ as $k$ in this statement, we conclude that%
\[
\sum_{i=1}^{n}i^{k}=\sum_{i=0}^{k}\operatorname*{sur}\left(  k,i\right)
\cdot\dbinom{n+1}{i+1}\ \ \ \ \ \ \ \ \ \ \text{for each positive integer }k.
\]
This proves Theorem \ref{thm.1.13}.
\end{proof}

An alternative, combinatorial proof of Theorem \ref{thm.1.13} (by double
counting) can be found in \cite[Proposition 23.2]{Galvin} (but, in a sense, is
merely a translation of our above proof into the language of counting).

\begin{center}
\fbox{\textbf{Class of 2019-10-25}}
\end{center}

\subsection{\label{sect.binom.vander}The Vandermonde convolution}

\subsubsection{The Vandermonde convolution theorem}

The next theorem is one of the most fundamental identities for binomial coefficients:

\begin{theorem}
[The Vandermonde convolution, or the Chu--Vandermonde identity]%
\label{thm.binom.vanderRR}Let $n\in\mathbb{N}$ and $x,y\in\mathbb{R}$. Then,%
\begin{align}
\dbinom{x+y}{n}  &  =\sum_{k=0}^{n}\dbinom{x}{k}\dbinom{y}{n-k}%
\label{eq.thm.binom.vanderRR.k=0-n}\\
&  =\sum_{k}\dbinom{x}{k}\dbinom{y}{n-k}. \label{eq.thm.binom.vanderRR.all-k}%
\end{align}
Here, the summation sign \textquotedblleft$\sum\limits_{k}$\textquotedblright%
\ on the right hand side of (\ref{eq.thm.binom.vanderRR.all-k}) means a sum
over all $k\in\mathbb{Z}$. (We are thus implicitly claiming that this sum over
all $k\in\mathbb{Z}$ is well-defined, i.e., that it has only finitely many
nonzero addends.)
\end{theorem}

Note that (\ref{eq.thm.binom.vanderRR.k=0-n}) is precisely Theorem
\ref{thm.vandermonde.RR}.

\begin{remark}
\label{rmk.vanderRR.sums-equal}Before proving Theorem \ref{thm.binom.vanderRR}%
, let us explain why the right hand sides of
(\ref{eq.thm.binom.vanderRR.k=0-n}) and (\ref{eq.thm.binom.vanderRR.all-k})
are equal. Indeed, fix $n\in\mathbb{N}$ and $x,y\in\mathbb{R}$. Now, consider
any $k\in\mathbb{Z}$. If $k<0$, then we have $k\notin\mathbb{N}$ and thus
$\dbinom{x}{k}=0$ (by (\ref{eq.def.binom.def.b})), and thus the product
$\dbinom{x}{k}\dbinom{y}{n-k}$ is $0$. But if $k>n$, then we have
$n-k\notin\mathbb{N}$ and thus $\dbinom{y}{n-k}=0$ (again by
(\ref{eq.def.binom.def.b})), and thus the product $\dbinom{x}{k}\dbinom
{y}{n-k}$ is again $0$. Thus, the product $\dbinom{x}{k}\dbinom{y}{n-k}$ is
$0$ whenever the integer $k$ satisfies either $k<0$ or $k>n$. In other words,
$\dbinom{x}{k}\dbinom{y}{n-k}=0$ whenever $k\notin\left\{  0,1,\ldots
,n\right\}  $ (because an integer $k$ satisfies either $k<0$ or $k>n$ if and
only if it satisfies $k\notin\left\{  0,1,\ldots,n\right\}  $). Therefore,
even though the sums on the right hand sides of
(\ref{eq.thm.binom.vanderRR.k=0-n}) and (\ref{eq.thm.binom.vanderRR.all-k})
differ in some addends, these addends in which they differ are all $0$. Thus,
these sums are equal.

We shall use the symbol \textquotedblleft$\overset{0}{=}$\textquotedblright%
\ (an equality sign with a $0$ on top of it) to describe situations like this.
More specifically: If $A$ and $B$ are two sums that only differ in addends
that are $0$, then we will write $A\overset{0}{=}B$. (Of course,
$A\overset{0}{=}B$ implies $A=B$, which is why we are using the equality
sign.) Thus, the argument we have just made shows that%
\[
\sum_{k=0}^{n}\dbinom{x}{k}\dbinom{y}{n-k}\overset{0}{=}\sum_{k}\dbinom{x}%
{k}\dbinom{y}{n-k}.
\]


Likewise,%
\[
\sum_{k=0}^{n}k\overset{0}{=}\sum_{k=1}^{n}k\ \ \ \ \ \ \ \ \ \ \text{for each
}n\in\mathbb{N}.
\]


Likewise, each $n\in\mathbb{N}$ satisfies%
\[
\sum\limits_{k=0}^{n}\dbinom{n}{k}\overset{0}{=}\sum\limits_{k=0}^{n+1}%
\dbinom{n}{k}\overset{0}{=}\sum\limits_{k\in\mathbb{N}}\dbinom{n}%
{k}\overset{0}{=}\sum\limits_{k\in\mathbb{Z}}\dbinom{n}{k}%
\]
(since $\dbinom{n}{k}=0$ whenever $k\notin\left\{  0,1,\ldots,n\right\}  $).
Likewise, the equality that we spent the main part of our proof of Corollary
\ref{cor.binom.hock2} arguing can be written as%
\[
\dbinom{0}{k}+\dbinom{1}{k}+\dbinom{2}{k}+\cdots+\dbinom{n}{k}\overset{0}{=}%
\dbinom{k}{k}+\dbinom{k+1}{k}+\dbinom{k+2}{k}+\cdots+\dbinom{n}{k}.
\]

\end{remark}

We will give two proofs of Theorem \ref{thm.binom.vanderRR} and a reference to
a third one; but none of our two proofs will be complete right away. Instead,
our first proof will only prove Theorem \ref{thm.binom.vanderRR} in the
particular case when $x\in\mathbb{N}$, and our second proof will only prove
Theorem \ref{thm.binom.vanderRR} in the (even more particular) case when both
$x$ and $y$ belong to $\mathbb{N}$. Later -- in Subsection
\ref{subsect.binom.vander.salvage} -- we will see how to regain the generality
of Theorem \ref{thm.binom.vanderRR} and transform these proofs into complete
proofs of Theorem \ref{thm.binom.vanderRR}.

\begin{proof}
[First proof of Theorem \ref{thm.vandermonde.RR} for $x\in\mathbb{N}$
(informal version).]Let $u\in\mathbb{R}$ and $v\in\mathbb{N}$. Then, Theorem
\ref{thm.binom.rec} yields%
\[
\dbinom{u}{n}=\dbinom{u-1}{n-1}+\dbinom{u-1}{n}.
\]
Let us now apply Theorem \ref{thm.binom.rec} again to each addend on the right
hand side of this equation:%
\begin{align*}
\dbinom{u}{n}  &  =\underbrace{\dbinom{u-1}{n-1}}_{\substack{=\dbinom
{u-2}{n-2}+\dbinom{u-2}{n-1}\\\text{(by Theorem \ref{thm.binom.rec})}%
}}+\underbrace{\dbinom{u-1}{n}}_{\substack{=\dbinom{u-2}{n-1}+\dbinom{u-2}%
{n}\\\text{(by Theorem \ref{thm.binom.rec})}}}\\
&  =\underbrace{\dbinom{u-2}{n-2}}_{\substack{=\dbinom{u-3}{n-3}+\dbinom
{u-3}{n-2}\\\text{(by Theorem \ref{thm.binom.rec})}}}+2\underbrace{\dbinom
{u-2}{n-1}}_{\substack{=\dbinom{u-3}{n-2}+\dbinom{u-3}{n-1}\\\text{(by Theorem
\ref{thm.binom.rec})}}}+\underbrace{\dbinom{u-2}{n}}_{\substack{=\dbinom
{u-3}{n-1}+\dbinom{u-3}{n}\\\text{(by Theorem \ref{thm.binom.rec})}}}\\
&  =\dbinom{u-3}{n-3}+3\dbinom{u-3}{n-2}+3\dbinom{u-3}{n-1}+\dbinom{u-3}{n}\\
&  =\dbinom{u-4}{n-4}+4\dbinom{u-4}{n-3}+6\dbinom{u-4}{n-2}+4\dbinom{u-4}%
{n-1}+\dbinom{u-4}{n}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by applying Theorem \ref{thm.binom.rec}
to each addend again}\right)  .
\end{align*}


We can keep applying Theorem \ref{thm.binom.rec} like this indefinitely. After
$v$ steps, we obtain an equality of the form%
\begin{align}
\dbinom{u}{n}  &  =\alpha_{v,v}\dbinom{u-v}{n-v}+\alpha_{v,v-1}\dbinom
{u-v}{n-\left(  v-1\right)  }+\cdots+\alpha_{v,1}\dbinom{u-v}{n-1}%
+\alpha_{v,0}\dbinom{u-v}{n}\nonumber\\
&  =\sum_{k=0}^{v}\alpha_{v,k}\dbinom{u-v}{n-k},
\label{pf.thm.binom.vanderRR.1st.2}%
\end{align}
where $\alpha_{v,0},\alpha_{v,1},\ldots,\alpha_{v,v}$ are certain numbers. Due
to how we are combining terms, we see that these numbers satisfy%
\[
\alpha_{v,0}=1,\ \ \ \ \ \ \ \ \ \ \alpha_{v,v}%
=1\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \alpha_{v,i}%
=\alpha_{v-1,i}+\alpha_{v-1,i-1}\text{ for each }i\in\left[  v-1\right]
\]
(because both $\dbinom{u-\left(  v-1\right)  }{n-i}$ and $\dbinom{u-\left(
v-1\right)  }{n-\left(  i-1\right)  }$ spawn a $\dbinom{u-v}{n-i}$ term when
rewritten using Theorem \ref{thm.binom.rec}). This is a recurrence that allows
us to compute the $\alpha_{v,i}$ for all $v$ and $i$; but more importantly,
this is the same recurrence that the binomial coefficients $\dbinom{v}{i}$
satisfy:%
\[
\dbinom{v}{0}=1,\ \ \ \ \ \ \ \ \ \ \dbinom{v}{v}%
=1,\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \dbinom{v}{i}%
=\dbinom{v-1}{i}+\dbinom{v-1}{i-1}\text{ for each }i\in\left[  v-1\right]
\]
(by Theorem \ref{thm.binom.rec}). Hence, a straightforward induction on $v$
shows that%
\[
\alpha_{v,k}=\dbinom{v}{k}\ \ \ \ \ \ \ \ \ \ \text{for each }k\in\left\{
0,1,\ldots,v\right\}  .
\]
Thus, (\ref{pf.thm.binom.vanderRR.1st.2}) rewrites as
\[
\dbinom{u}{n}=\sum_{k=0}^{v}\dbinom{v}{k}\dbinom{u-v}{n-k}.
\]
\qquad

Now, forget that we fixed $u$ and $v$. We thus have proved the identity%
\begin{equation}
\dbinom{u}{n}=\sum_{k=0}^{v}\dbinom{v}{k}\dbinom{u-v}{n-k}
\label{pf.thm.binom.vanderRR.1st.uCn}%
\end{equation}
for any $u\in\mathbb{R}$ and $v\in\mathbb{N}$.

Now, let $x\in\mathbb{N}$ and $y\in\mathbb{R}$. Applying
(\ref{pf.thm.binom.vanderRR.1st.uCn}) to $u=x+y$ and $v=x$, we
get\footnote{Here, we are using the \textquotedblleft$\overset{0}{=}%
$\textquotedblright\ notation that we introduced in Remark
\ref{rmk.vanderRR.sums-equal}.}%
\begin{align*}
\dbinom{x+y}{n}  &  =\sum_{k=0}^{x}\dbinom{x}{k}\dbinom{\left(  x+y\right)
-x}{n-k}=\sum_{k=0}^{x}\dbinom{x}{k}\dbinom{y}{n-k}\\
&  \overset{0}{=}\sum_{k\in\mathbb{N}}\dbinom{x}{k}\dbinom{y}{n-k}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\dbinom{x}{k}=0\text{ whenever
}k>x\right) \\
&  \overset{0}{=}\sum_{k=0}^{n}\dbinom{x}{k}\dbinom{y}{n-k}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\dbinom{y}{n-k}=0\text{ whenever
}k>n\right)  .
\end{align*}
Thus, (\ref{eq.thm.binom.vanderRR.k=0-n}) is proved. Hence,
(\ref{eq.thm.binom.vanderRR.all-k}) follows as well\footnote{because we have
seen in Remark \ref{rmk.vanderRR.sums-equal} that the right hand sides of
(\ref{eq.thm.binom.vanderRR.k=0-n}) and of (\ref{eq.thm.binom.vanderRR.all-k})
are equal}. This proves Theorem \ref{thm.binom.vanderRR} for $x\in\mathbb{N}$.
\end{proof}

The above proof was informal, but it is easy to formalize:

\begin{exercise}
\label{exe.binom.vanderRR.1st-proof}Transform the above informal proof of
Theorem \ref{thm.binom.vanderRR} into a rigorous proof. (Of course, this proof
will still require $x\in\mathbb{N}$.)
\end{exercise}

Now, let us come to our second proof of Theorem \ref{thm.binom.vanderRR}. As I
said, it is even less complete than the first one: it only covers the case
when $x,y\in\mathbb{N}$. However, it is neater:

\begin{proof}
[Second proof of Theorem \ref{thm.binom.vanderRR} for $x,y\in\mathbb{N}$
(sketched).]Let $x,y\in\mathbb{N}$. We shall prove
(\ref{eq.thm.binom.vanderRR.k=0-n}) by double counting. How many ways are
there to choose an $n$-element subset of the set $\left\{  1,2,\ldots
,x\right\}  \cup\left\{  -1,-2,\ldots,-y\right\}  $ ? Let us answer this
question in two ways:

\textit{1st way:} The answer is $\dbinom{x+y}{n}$ (by Theorem
\ref{thm.binom.comb}, since $\left\{  1,2,\ldots,x\right\}  \cup\left\{
-1,-2,\ldots,-y\right\}  $ is an $\left(  x+y\right)  $-element set).

\textit{2nd way:} We choose an $n$-element subset of the set $\left\{
1,2,\ldots,x\right\}  \cup\left\{  -1,-2,\ldots,-y\right\}  $ as follows:

\begin{itemize}
\item First, we decide how many positive elements our subset will have. Let's
say it will have $k$ positive elements (with $k\in\left\{  0,1,\ldots
,n\right\}  $).

\item Then, we choose these $k$ positive elements. (There are $\dbinom{x}{k}$
choices for them, since they must belong to the $x$-element set $\left\{
1,2,\ldots,x\right\}  $.)

\item Then, we choose the remaining $n-k$ negative elements of our subset.
(There are $\dbinom{y}{n-k}$ choices for them, since they must belong to the
$y$-element set $\left\{  -1,-2,\ldots,-y\right\}  $).
\end{itemize}

\noindent Thus, the answer is $\sum\limits_{k=0}^{n}\dbinom{x}{k}\dbinom
{y}{n-k}$. (Formally speaking, this follows by applying the sum rule and the
product rule.)

Now, we can compare the two answers we have found. We obtain $\dbinom{x+y}%
{n}=\sum\limits_{k=0}^{n}\dbinom{x}{k}\dbinom{y}{n-k}$. This proves
(\ref{eq.thm.binom.vanderRR.k=0-n}) when $x,y\in\mathbb{N}$. Hence,
(\ref{eq.thm.binom.vanderRR.all-k}) follows as well\footnote{because we have
seen in Remark \ref{rmk.vanderRR.sums-equal} that the right hand sides of
(\ref{eq.thm.binom.vanderRR.k=0-n}) and of (\ref{eq.thm.binom.vanderRR.all-k})
are equal} (for $x,y\in\mathbb{N}$). Therefore, Theorem
\ref{thm.binom.vanderRR} is proved for $x,y\in\mathbb{N}$.
\end{proof}

(See \cite[proof of Lemma 2.17.15]{19s} for a more detailed version of this proof.)

A third proof of Theorem \ref{thm.binom.vanderRR} can be obtained by induction
on $n$, using the absorption identity $\dbinom{y}{n}=\dfrac{y}{n}\dbinom
{y-1}{n-1}$. See \cite[first proof of Theorem 3.29]{detnotes} for this proof.
Unlike our first two proofs above, it proves Theorem \ref{thm.binom.vanderRR}
in full generality (without any extra assumptions on $x$ and $y$); but on the
flipside, it is somewhat laborious and unmemorable.

Before I explain how the above two proofs above can be extended to the general
case ($x,y\in\mathbb{R}$), let me draw a couple conclusions from the theorem:

\begin{corollary}
\label{cor.binom.vander-xkyk}Let $x\in\mathbb{R}$ and $y\in\mathbb{N}$. Then,%
\[
\sum_{k=0}^{y}\dbinom{x}{k}\dbinom{y}{k}=\dbinom{x+y}{y}.
\]

\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.binom.vander-xkyk}.]We have%
\[
\sum_{k=0}^{y}\dbinom{x}{k}\underbrace{\dbinom{y}{k}}_{\substack{=\dbinom
{y}{y-k}\\\text{(by Theorem \ref{thm.binom.sym},}\\\text{applied to
}n=y\text{)}}}=\sum_{k=0}^{y}\dbinom{x}{k}\dbinom{y}{y-k}=\dbinom{x+y}{y}%
\]
(by (\ref{eq.thm.binom.vanderRR.k=0-n}), applied to $n=y$). This proves
Corollary \ref{cor.binom.vander-xkyk}.
\end{proof}

\begin{exercise}
\label{exe.binom.vander-xkyk}We have so far not proved Theorem
\ref{thm.binom.vanderRR} in full generality. However, our first proof of
Theorem \ref{thm.binom.vanderRR} above proves the particular case of Theorem
\ref{thm.binom.vanderRR} for $x\in\mathbb{N}$.

Give an alternative proof of Corollary \ref{cor.binom.vander-xkyk} which
relies only on this particular case.
\end{exercise}

\begin{corollary}
\label{cor.binom.vander-nksq}Let $n\in\mathbb{N}$. Then,
\[
\sum_{k=0}^{n}\dbinom{n}{k}^{2}=\dbinom{2n}{n}.
\]

\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.binom.vander-nksq}.]We have%
\begin{align*}
\sum_{k=0}^{n}\dbinom{n}{k}^{2}  &  =\sum_{k=0}^{n}\dbinom{n}{k}\dbinom{n}%
{k}=\dbinom{n+n}{n}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Corollary \ref{cor.binom.vander-xkyk}
(applied to }x=n\text{ and }y=n\text{)}\right) \\
&  =\dbinom{2n}{n}.
\end{align*}
This proves Corollary \ref{cor.binom.vander-nksq}.
\end{proof}

\begin{remark}
Corollary \ref{cor.binom.vander-nksq} gives an explicit formula for
$\sum_{k=0}^{n}\dbinom{n}{k}^{2}$, while Corollary \ref{cor.binom.2pown} gives
an explicit formula for $\sum_{k=0}^{n}\dbinom{n}{k}^{1}$. Is there a formula
for $\sum\limits_{k=0}^{n}\dbinom{n}{k}^{3}$ as well? No explicit formula is
known, but some recursions can be found. For example, if we set $a_{n}%
=\sum\limits_{k=0}^{n}\dbinom{n}{k}^{3}$ for each $n\in\mathbb{N}$, then%
\[
\left(  n+1\right)  ^{2}a_{n+1}=\left(  7n^{2}+7n+2\right)  a_{n}%
+8n^{2}a_{n-1}\ \ \ \ \ \ \ \ \ \ \text{for each }n\geq1.
\]
(See \cite[Exercise 6.54 b]{Stanley-EC2} for this formula, which was found by
Franel in 1894. Recursions like this, although increasingly more complicated,
exist for all $\sum\limits_{k=0}^{n}\dbinom{n}{k}^{r}$. Note that the sequence
$\left(  a_{0},a_{1},a_{2},\ldots\right)  $ is
\href{https://oeis.org/A000172}{OEIS sequence A000172}.)

The situation is somewhat nicer for alternating sums -- i.e., sums of the
forms $\sum\limits_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n}{k}^{r}$. Indeed,
there are simple formulas for these sums for all $r\in\left\{  1,2,3\right\}
$. We have already seen the formula for $r=1$ (this is Proposition
\ref{prop.binom.sum-alt-row}), and will soon see a formula for $r=2$ (in
Exercise \ref{exe.binom.genfun.minus-vd} \textbf{(c)}). The formula for $r=3$
is a special case of Dixon's identity (\cite[($\ast$)]{Ward91}), which we may
see later too.
\end{remark}

\begin{exercise}
\label{exe.binom.vander.-1}Explain why Exercise \ref{exe.binom.altsum-partial}
\textbf{(a)} is also a particular case of Theorem \ref{thm.vandermonde.RR}.

[\textbf{Hint:} Apply Theorem \ref{thm.vandermonde.RR} to $y=-1$.]
\end{exercise}

\subsubsection{\label{subsect.binom.vander.polidt}The polynomial identity
trick}

We shall next discuss a \textquotedblleft simple\textquotedblright\ trick that
will help us complete the first two proofs of Theorem \ref{thm.binom.vanderRR}
(i.e., to prove the theorem in full generality, not just for $x,y\in
\mathbb{N}$). Essentially, this trick allows us to argue that if a certain
kind of identity involving a variable $x$ holds for all $x\in\mathbb{N}$, then
it must also hold for all $x\in\mathbb{R}$. This is the \textquotedblleft%
\emph{polynomial identity trick}\textquotedblright.

Let me begin with \textbf{a reminder on polynomials}. I will not formally
define polynomials here (I might get to it later, in the chapter on generating
functions), but merely recall the main features of this concept. Polynomials
are not functions, but you can nevertheless substitute numbers into them.
Informally, a \emph{polynomial} (with real coefficients, in $1$ variable $X$)
is a \textquotedblleft formal expression\textquotedblright\ of the form%
\[
\alpha X^{a}+\beta X^{b}+\gamma X^{c}+\cdots+\omega X^{z}%
\ \ \ \ \ \ \ \ \ \ \text{with }\alpha,\beta,\gamma,\ldots,\omega\in
\mathbb{R}\text{ and }a,b,c,\ldots,z\in\mathbb{N}%
\]
-- that is, a finite sum\footnote{possibly an empty sum} of terms of the form
\[
\left(  \text{a real number}\right)  \cdot X^{\left(  \text{a nonnegative
integer}\right)  }.
\]
For example,%
\[
2X^{3}+7X^{5},\ \ \ \ \ \ \ \ \ \ \dfrac{3}{2}X^{1}+6X^{0}%
,\ \ \ \ \ \ \ \ \ \ 7X^{5},\ \ \ \ \ \ \ \ \ \ \left(  -2\right)
X^{0},\ \ \ \ \ \ \ \ \ \ 0
\]
are polynomials (where $0$ is understood to be an empty sum). Two such
expressions are understood to be equal to each other if they can be
transformed into one another by the following rules:

\begin{itemize}
\item The terms can be swapped at will (i.e., we can replace $\varphi
X^{n}+\psi X^{m}$ by $\psi X^{m}+\varphi X^{n}$).

\item Terms involving the same power of $X$ can be combined (i.e., we can
replace $\varphi X^{n}+\psi X^{n}$ by $\left(  \varphi+\psi\right)  X^{n}$).
This is called \textquotedblleft combining like terms\textquotedblright. The
opposite operation (i.e., splitting a term) can also be done.

\item Terms of the form $0X^{m}$ can be removed or introduced at will.
\end{itemize}

We write $X^{0}$ as $1$ (so the term $\alpha X^{0}$ is written as $\alpha$),
and we write $X^{1}$ as $X$.

If $P$ is a polynomial, then we can write $P$ as a finite sum $a_{0}%
X^{0}+a_{1}X^{1}+\cdots+a_{n}X^{n}$ for some $n\in\mathbb{N}$ and some real
numbers $a_{0},a_{1},\ldots,a_{n}$. (Indeed, we can transform $P$ into this
form by swapping the terms until they are in the order of increasing
exponents\footnote{The \textquotedblleft exponent\textquotedblright\ of a term
$\beta X^{b}$ is understood to be the integer $b$.}, then combining like terms
until no two terms with the same exponent remain, and finally introducing
$0X^{m}$ terms wherever necessary.) Moreover, the representation of $P$ as
such a sum is unique up to \textquotedblleft trailing zeroes\textquotedblright%
: We can always make $n$ larger by introducing $0X^{m}$ terms (for example,
$2X^{0}+7X^{1}$ can be rewritten as $2X^{0}+7X^{1}+0X^{2}$ or as
$2X^{0}+7X^{1}+0X^{2}+0X^{3}$), but other than that the representation of $P$
is unique.

We can also write a polynomial $P$ as an infinite sum $a_{0}X^{0}+a_{1}%
X^{1}+a_{2}X^{2}+\cdots$, where $a_{0},a_{1},a_{2},\ldots$ are real numbers
such that only finitely many of them are nonzero. (Indeed, we obtain this
representation by writing $P$ as a finite sum $a_{0}X^{0}+a_{1}X^{1}%
+\cdots+a_{n}X^{n}$ and then setting $a_{n+1}=a_{n+2}=a_{n+3}=\cdots=0$.)

If $P$ is written in such a form $a_{0}X^{0}+a_{1}X^{1}+a_{2}X^{2}+\cdots$,
then $a_{i}$ is called the $i$\emph{-th coefficient} of $P$ (or the
\emph{coefficient} of $X^{i}$ in $P$) whenever $i\in\mathbb{N}$.

The \emph{zero polynomial} is the polynomial $0$ (that is, the polynomial
whose all coefficients are $0$). A polynomial is said to be \emph{nonzero} if
it is not the zero polynomial.

Addition of polynomials is defined by just throwing their terms together:
e.g.,%
\[
\left(  \alpha X^{a}+\beta X^{b}\right)  +\left(  \gamma X^{c}+\delta
X^{d}\right)  =\alpha X^{a}+\beta X^{b}+\gamma X^{c}+\delta X^{d}.
\]
Subtraction is defined like addition, except that the terms of the subtrahend
get their signs flipped:%
\[
\left(  \alpha X^{a}+\beta X^{b}\right)  -\left(  \gamma X^{c}+\delta
X^{d}\right)  =\alpha X^{a}+\beta X^{b}+\left(  -\gamma\right)  X^{c}+\left(
-\delta\right)  X^{d}.
\]
Multiplication is defined by the distributivity law and the rule $\left(
\alpha X^{a}\right)  \left(  \beta X^{b}\right)  =\left(  \alpha\beta\right)
X^{a+b}$. For example,%
\begin{align*}
&  \left(  \alpha X^{a}+\beta X^{b}\right)  \left(  \gamma X^{c}+\delta
X^{d}\right) \\
&  =\underbrace{\left(  \alpha X^{a}\right)  \left(  \gamma X^{c}\right)
}_{=\alpha\gamma X^{a+c}}+\underbrace{\left(  \alpha X^{a}\right)  \left(
\delta X^{d}\right)  }_{=\alpha\delta X^{a+d}}+\underbrace{\left(  \beta
X^{b}\right)  \left(  \gamma X^{c}\right)  }_{=\beta\gamma X^{b+c}%
}+\underbrace{\left(  \beta X^{b}\right)  \left(  \delta X^{d}\right)
}_{=\beta\delta X^{b+d}}\\
&  =\alpha\gamma X^{a+c}+\alpha\delta X^{a+d}+\beta\gamma X^{b+c}+\beta\delta
X^{b+d}.
\end{align*}
We cannot always divide a polynomial by another polynomial; but we can divide
a polynomial by a nonzero real number. Namely, $\dfrac{P}{r}$ is defined to be
$r^{-1}\cdot P$ whenever $r$ is a nonzero real number and $P$ is a polynomial.
Furthermore, if $n\in\mathbb{N}$ and if $P$ is a polynomial, then $P^{n}$
(that is, the $n$-th power of $P$) is defined to be the product
$\underbrace{PP\cdots P}_{n\text{ times}}$.

The \emph{degree} of a nonzero polynomial $P$ is the largest $i\in\mathbb{N}$
such that the $i$-th coefficient of $P$ is nonzero. For example, the degree of
$2X^{2}+7X^{5}-X$ is $5$. (We say that the degree of the zero polynomial $0$
is $-\infty$.)

\emph{Substituting} a number (or square matrix, or another polynomial) $x$
into a polynomial $P=\alpha X^{a}+\beta X^{b}+\gamma X^{c}+\cdots$ yields
$\alpha x^{a}+\beta x^{b}+\gamma x^{c}+\cdots$. This result is called
$P\left(  x\right)  $.

The discussion of polynomials we just had is not fully rigorous and
self-contained. We could make it rigorous by formally defining the notion of
\textquotedblleft formal expression\textquotedblright, but we would have to
verify that it behaves as nicely as we would hope for, meaning that the
following facts are true (among others):

\begin{itemize}
\item The representation of a given polynomial $P$ as a finite sum $a_{0}%
X^{0}+a_{1}X^{1}+\cdots+a_{n}X^{n}$ is unique up to \textquotedblleft trailing
zeroes\textquotedblright.

\item The representation of a given polynomial $P$ as an infinite sum
$a_{0}X^{0}+a_{1}X^{1}+a_{2}X^{2}+\cdots$ is unique. (This is necessary to
ensure that the $i$-th coefficient of $P$ is well-defined.)

\item Our definitions of addition, subtraction and multiplication of
polynomials are well-defined. (This means, for example, that the product $PQ$
does not depend on how $P$ and $Q$ are expressed. For example, if we
\textquotedblleft combine like terms\textquotedblright\ or remove a $0X^{m}$
term from $P$, then the product $PQ$ also stays the same.)

\item The result of substituting a number $x$ into a polynomial $P$ does not
depend on how the polynomial is expressed.
\end{itemize}

\noindent All of these facts are true and can be proven, but it requires some
work. Thus, it is more common to define polynomials in a different way, namely
as infinite sequences $\left(  a_{0},a_{1},a_{2},\ldots\right)  $ of real
numbers having only finitely many nonzero entries. (Such a sequence $\left(
a_{0},a_{1},a_{2},\ldots\right)  $ corresponds to the polynomial $a_{0}%
X^{0}+a_{1}X^{1}+a_{2}X^{2}+\cdots$.) This definition of polynomials can be
found in \cite[\S 1.5]{detnotes} or \cite[Sections 7.1--7.3]{Loehr-BC} or
\cite[\S 7.4]{19s} or most good algebra textbooks; we will also outline it in
the generating functions chapter of this course.

We shall silently identify each number $u$ with the polynomial $uX^{0}$ (which
is called a \emph{constant polynomial}, and has degree $0$ when $u\neq0$ and
degree $-\infty$ when $u=0$).

Let us now discuss roots of polynomials:

\begin{definition}
A number $x$ (say, a rational or real or complex number) is a \emph{root} of a
polynomial $P$ if and only if $P\left(  x\right)  =0$.
\end{definition}

A crucial property of polynomials is that they cannot have too many roots
(unless they are the zero polynomial):

\begin{theorem}
\label{thm.polidtrick-a}Let $n\in\mathbb{N}$. Then, a nonzero polynomial of
degree $\leq n$ has $\leq n$ roots.
\end{theorem}

\noindent Here, \textquotedblleft polynomial\textquotedblright\ means
\textquotedblleft polynomial with real coefficients in $1$ variable
$X$\textquotedblright, and \textquotedblleft root\textquotedblright\ means
\textquotedblleft real root\textquotedblright. However, the same theorem can
be stated using rational or complex numbers instead (and the same proofs apply).

\begin{example}
\textbf{(a)} The polynomial $X^{2}-2X-3$ has degree $2$; thus, Theorem
\ref{thm.polidtrick-a} (applied to $n=2$) shows that it has $\leq2$ roots. And
indeed, it has $2$ roots: $3$ and $-1$.

\textbf{(b)} The polynomial $X^{2}-2X+1$ has degree $2$; thus, Theorem
\ref{thm.polidtrick-a} (applied to $n=2$) shows that it has $\leq2$ roots. And
indeed, it has $1$ root: $1$. (We could say that $1$ is a \textquotedblleft
double root\textquotedblright\ of this polynomial, since $X^{2}-2X+1=\left(
X-1\right)  ^{2}$; but this requires the somewhat subtle concept of
\textquotedblleft double roots\textquotedblright\ and, more generally,
\textquotedblleft multiple roots\textquotedblright, which I don't want to
introduce here.)
\end{example}

Theorem \ref{thm.polidtrick-a} is often called the \textquotedblleft easy half
of the Fundamental Theorem of Algebra\textquotedblright. We will not prove it
here, but proofs of this theorem are not hard to find. I believe any good
textbook on abstract algebra contains a proof of Theorem
\ref{thm.polidtrick-a} somewhere. (In particular, proofs appear in
\cite[Corollary 1.8.24]{Goodman}, \cite[Theorem 1.58]{Joyce17},
\cite[Corollary 4.5.10]{Walker87}, \cite[Chapter 1, \S 5, Corollary
3]{CoLiOs15}, \cite[Theorem 7.6.11]{19s}, \cite[Corollary 33.8]{Elman18} and
\cite[Corollary 1.14]{Knapp1}.)

The following corollary of Theorem \ref{thm.polidtrick-a} is almost trivial:

\begin{corollary}
\label{cor.polidtrick-b}If a polynomial $P$ has infinitely many roots, then
$P$ is the zero polynomial.
\end{corollary}

\noindent(Again, \textquotedblleft polynomial\textquotedblright\ means
\textquotedblleft polynomial with real coefficients in $1$ variable
$X$\textquotedblright, and \textquotedblleft root\textquotedblright\ means
\textquotedblleft real root\textquotedblright\ here.)

\begin{proof}
[Proof of Corollary \ref{cor.polidtrick-b}.]Let $P$ be a polynomial that has
infinitely many roots. We must prove that $P$ is the zero polynomial. Indeed,
assume the contrary. Thus, $P$ is nonzero. Let $n$ be the degree of $P$. Thus,
$P$ is a nonzero polynomial of degree $\leq n$. Hence, Theorem
\ref{thm.polidtrick-a} shows that $P$ has $\leq n$ roots. But $P$ has $>n$
roots (since $P$ has infinitely many roots). The previous two sentences
contradict each other. This contradiction shows that our assumption was false.
Hence, Corollary \ref{cor.polidtrick-b} is proven.
\end{proof}

A corollary of this corollary will prove the most useful to us:

\begin{corollary}
\label{cor.polidtrick-c}Let $P$ and $Q$ be polynomials (with real coefficients
in $1$ variable $X$). Assume that%
\begin{equation}
P\left(  x\right)  =Q\left(  x\right)  \ \ \ \ \ \ \ \ \ \ \text{for all }%
x\in\mathbb{N}. \label{eq.cor.polidtrick-c.ass}%
\end{equation}
Then, $P=Q$.
\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.polidtrick-c}.]Consider the polynomial $P-Q$. For
each $x\in\mathbb{N}$, we have%
\[
\left(  P-Q\right)  \left(  x\right)  =P\left(  x\right)  -Q\left(  x\right)
=0\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{eq.cor.polidtrick-c.ass}%
)}\right)  .
\]
In other words, each $x\in\mathbb{N}$ is a root of $P-Q$. Hence, $P-Q$ has
infinitely many roots (since there are infinitely many $x\in\mathbb{N}$).
Thus, Corollary \ref{cor.polidtrick-b} (applied to $P-Q$ instead of $P$) shows
that $P-Q$ is the zero polynomial. In other words, $P-Q=0$. Hence, $P=Q$. This
proves Corollary \ref{cor.polidtrick-c}.
\end{proof}

\subsubsection{\label{subsect.binom.vander.salvage}Salvaging the proofs of
Theorem \ref{thm.binom.vanderRR}}

How does Corollary \ref{cor.polidtrick-c} help us prove Theorem
\ref{thm.binom.vanderRR}? What do the binomial coefficients appearing in
Theorem \ref{thm.binom.vanderRR} have to do with polynomials?

To understand this, let us extend our definition of binomial coefficients somewhat:

\begin{definition}
In Definition \ref{def.binom.def}, we defined the binomial coefficient
$\dbinom{n}{k}$ whenever $n$ and $k$ are numbers. Let us now extend this
definition to the case when $n$ is a polynomial (although $k$ should still be
a number).
\end{definition}

Since polynomials are not usually denoted by $n$, let me restate this
definition: If $P$ is any polynomial and $k$ is any number, then $\dbinom
{P}{k}$ is a polynomial defined by%
\[
\dbinom{P}{k}=\dfrac{P\left(  P-1\right)  \left(  P-2\right)  \cdots\left(
P-k+1\right)  }{k!}\ \ \ \ \ \ \ \ \ \ \text{if }k\in\mathbb{N}%
\]
and%
\[
\dbinom{P}{k}=0\ \ \ \ \ \ \ \ \ \ \text{if }k\notin\mathbb{N}.
\]


Note the following fact:

\begin{proposition}
\label{prop.polidtrick.subst-into-bin}Let $P$ be a polynomial, and let $n$ and
$k$ be two numbers. Then, substituting $n$ into the polynomial $\dbinom{P}{k}$
yields the number $\dbinom{P\left(  n\right)  }{k}$.
\end{proposition}

This proposition is intuitively clear (it is just saying that it does not
matter whether we substitute $n$ for $X$ before computing the binomial
coefficient $\dbinom{P}{k}$ or after it). For a formal proof, see
\cite[Corollary 7.6.16 \textbf{(c)}]{19s}.

Let us now come back to our first proof of Theorem \ref{thm.binom.vanderRR}.
In that proof, we only showed that Theorem \ref{thm.binom.vanderRR} holds for
all $x\in\mathbb{N}$. We shall now extend it to all real values of $x$:

\begin{proof}
[Completion of the first proof of Theorem \ref{thm.binom.vanderRR}.]Fix
$y\in\mathbb{R}$ and $n\in\mathbb{N}$. We have already proved that Theorem
\ref{thm.binom.vanderRR} holds for $x\in\mathbb{N}$. Thus, the equality%
\begin{equation}
\dbinom{x+y}{n}=\sum_{k=0}^{n}\dbinom{x}{k}\dbinom{y}{n-k}
\label{pf.thm.binom.vanderRR.1st-compl.goal}%
\end{equation}
holds for all $x\in\mathbb{N}$. We now want to prove this equality for all
$x\in\mathbb{R}$.

Define two polynomials $P$ and $Q$ (in $1$ variable $X$, with real
coefficients) by%
\[
P=\dbinom{X+y}{n}\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ Q=\sum
_{k=0}^{n}\dbinom{X}{k}\dbinom{y}{n-k}.
\]
These are well-defined polynomials, and can be written explicitly as follows:%
\[
P=\dbinom{X+y}{n}=\dfrac{\left(  X+y\right)  \left(  X+y-1\right)  \left(
X+y-2\right)  \cdots\left(  X+y-n+1\right)  }{n!}%
\]
and%
\[
Q=\sum_{k=0}^{n}\dbinom{X}{k}\dbinom{y}{n-k}=\sum_{k=0}^{n}\dfrac{X\left(
X-1\right)  \left(  X-2\right)  \cdots\left(  X-k+1\right)  }{k!}\dbinom
{y}{n-k}.
\]


Now, for each $x\in\mathbb{R}$, we have%
\[
P\left(  x\right)  =\dbinom{x+y}{n}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
Proposition \ref{prop.polidtrick.subst-into-bin}, since }P=\dbinom{X+y}%
{n}\right)
\]
and%
\[
Q\left(  x\right)  =\sum_{k=0}^{n}\dbinom{x}{k}\dbinom{y}{n-k}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{likewise}\right)  .
\]
In view of these two equalities, we can rewrite
(\ref{pf.thm.binom.vanderRR.1st-compl.goal}) as%
\[
P\left(  x\right)  =Q\left(  x\right)  .
\]
Hence, we know that $P\left(  x\right)  =Q\left(  x\right)  $ holds for all
$x\in\mathbb{N}$ (because we know that
(\ref{pf.thm.binom.vanderRR.1st-compl.goal}) holds for all $x\in\mathbb{N}$).
Therefore, Corollary \ref{cor.polidtrick-c} yields $P=Q$. Thus, $P\left(
x\right)  =Q\left(  x\right)  $ for all $x\in\mathbb{R}$. In other words,
\[
\dbinom{x+y}{n}=\sum_{k=0}^{n}\dbinom{x}{k}\dbinom{y}{n-k}%
\]
for all $x\in\mathbb{R}$ (since $P\left(  x\right)  =\dbinom{x+y}{n}$ and
$Q\left(  x\right)  =\sum_{k=0}^{n}\dbinom{x}{k}\dbinom{y}{n-k}$ for each
$x\in\mathbb{R}$). Thus, we have proved the equality
(\ref{eq.thm.binom.vanderRR.k=0-n}) for all $x\in\mathbb{R}$. Hence,
(\ref{eq.thm.binom.vanderRR.all-k}) holds for all $x\in\mathbb{R}$ as
well\footnote{because we have seen in Remark \ref{rmk.vanderRR.sums-equal}
that the right hand sides of (\ref{eq.thm.binom.vanderRR.k=0-n}) and of
(\ref{eq.thm.binom.vanderRR.all-k}) are equal}. Therefore, Theorem
\ref{thm.binom.vanderRR} is proved (this time for all values of $x$ and $y$).
\end{proof}

Our use of Corollary \ref{cor.polidtrick-c} in the proof we just gave is an
instance of what I call the \textquotedblleft\emph{polynomial identity
trick}\textquotedblright: We wanted to prove the equality $P\left(  x\right)
=Q\left(  x\right)  $ for all $x\in\mathbb{R}$, where $P$ and $Q$ were two
given polynomials. We did this as follows: We first proved it for all
$x\in\mathbb{N}$; then, we used this to conclude that $P=Q$ (by Corollary
\ref{cor.polidtrick-c}); finally we substituted $x$ in $P=Q$ to obtain
$P\left(  x\right)  =Q\left(  x\right)  $ for all $x\in\mathbb{R}$. What made
this argument possible is that the equality that we were aiming to show (in
our case, (\ref{pf.thm.binom.vanderRR.1st-compl.goal})) was an equality
between two polynomials in $x$ (that is, we could rewrite it as $P\left(
x\right)  =Q\left(  x\right)  $ for two polynomials $P$ and $Q$). Corollary
\ref{cor.polidtrick-c} allows us to use this kind of argument in proving any
such equality. This is called the \textquotedblleft polynomial identity
trick\textquotedblright\ or (in \cite[\S 5.1]{GKP}) the \textquotedblleft
polynomial argument\textquotedblright.

We can also salvage our second proof of Theorem \ref{thm.binom.vanderRR} in a
similar way. Here we need to apply the polynomial identity trick twice:

\begin{itemize}
\item \textit{Step 1:} Fix $y\in\mathbb{N}$ and $n\in\mathbb{N}$. Use the same
argument as before to prove that (\ref{pf.thm.binom.vanderRR.1st-compl.goal})
holds for all $x\in\mathbb{R}$. Thus,
(\ref{pf.thm.binom.vanderRR.1st-compl.goal}) is proved for all $x\in
\mathbb{R}$ and $y\in\mathbb{N}$.

\item \textit{Step 2:} Fix $x\in\mathbb{R}$ and $n\in\mathbb{N}$. Use an
analogous argument (using $y$ instead of $x$) to prove that
(\ref{pf.thm.binom.vanderRR.1st-compl.goal}) holds for all $y\in\mathbb{R}$.
\end{itemize}

\noindent See \cite[\S 2.17.3]{19s} for the details of this
argument\footnote{I use $\mathbb{Q}$ instead of $\mathbb{R}$ in
\cite[\S 2.17.3]{19s}, but otherwise the argument proceeds exactly in the same
way.}, and \cite[Second proof of Theorem 3.30]{detnotes} for a different
variant of this argument (using polynomials in $2$ variables).

\subsubsection{\label{subsect.binom.vander.salvage-more}More consequences of
the polynomial identity trick}

The polynomial identity trick can be applied to several other identities. For example:

\begin{itemize}
\item Proposition \ref{prop.binom.trin-rev} (the trinomial revision formula)
says that%
\begin{equation}
\dbinom{n}{a}\dbinom{a}{b}=\dbinom{n}{b}\dbinom{n-b}{a-b}
\label{eq.polidtrick.exa.trin.1}%
\end{equation}
for all $n,a,b\in\mathbb{R}$. Our second proof of this proposition (in
Subsection \ref{subsect.binom.trinom.dcproof}) only showed that it holds for
all $n\in\mathbb{N}$. But using the polynomial identity trick, we can now
complete it to obtain a proof of Proposition \ref{prop.binom.trin-rev} for all
$n\in\mathbb{R}$: Namely, we fix $a,b\in\mathbb{R}$, and we rewrite the
equality (\ref{eq.polidtrick.exa.trin.1}) as%
\[
P\left(  n\right)  =Q\left(  n\right)  ,
\]
where the polynomials $P$ and $Q$ are defined by%
\[
P=\dbinom{X}{a}\dbinom{a}{b}\ \ \ \ \ \ \ \ \ \ \text{and}%
\ \ \ \ \ \ \ \ \ \ Q=\dbinom{X}{b}\dbinom{X-b}{a-b}.
\]
Our second proof of Proposition \ref{prop.binom.trin-rev} thus shows that
$P\left(  n\right)  =Q\left(  n\right)  $ for all $n\in\mathbb{N}$. Hence,
using the polynomial identity trick, we conclude that $P\left(  n\right)
=Q\left(  n\right)  $ for all $n\in\mathbb{R}$. This completes the second
proof of Proposition \ref{prop.binom.trin-rev}.

\item Proposition \ref{prop.binom.sum-alt-row} says that
\begin{equation}
\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n}{k}=\left[  n=0\right]
\label{eq.polidtrick.exa.alt-row.1}%
\end{equation}
holds for all $n\in\mathbb{N}$. Can we use the polynomial identity trick to
generalize this to all $n\in\mathbb{R}$ ? No, because $n$ appears as a
summation bound on the left hand side, and it would make no sense to replace
it by a non-integer number (because what would \textquotedblleft$\sum
_{k=0}^{\sqrt{2}}$\textquotedblright\ even mean?).

We could try to sneak past this issue by rewriting the left hand side
somewhat. For any $n\in\mathbb{N}$, we can rewrite the identity
(\ref{eq.polidtrick.exa.alt-row.1}) as%
\begin{equation}
\sum_{k\in\mathbb{N}}\left(  -1\right)  ^{k}\dbinom{n}{k}=\left[  n=0\right]
\label{eq.polidtrick.exa.alt-row.2}%
\end{equation}
(because $\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n}{k}\overset{0}{=}%
\sum_{k\in\mathbb{N}}\left(  -1\right)  ^{k}\dbinom{n}{k}$). But even in this
form, we cannot generalize it to $n\in\mathbb{R}$ using the polynomial
identity trick, because the right hand side of
(\ref{eq.polidtrick.exa.alt-row.2}) cannot be written as a polynomial in $n$.
In other words, there exists no polynomial $Q$ such that%
\[
Q\left(  n\right)  =\left[  n=0\right]  \ \ \ \ \ \ \ \ \ \ \text{for all
}n\in\mathbb{N}%
\]
(in fact, such a polynomial $Q$ would have infinitely many roots,
contradicting Corollary \ref{cor.polidtrick-b}).

Note that we cannot generalize (\ref{eq.polidtrick.exa.alt-row.2}) to all
$n\in\mathbb{R}$ in any way (by the polynomial identity trick or otherwise),
because if we try to substitute $n=-1$ into (\ref{eq.polidtrick.exa.alt-row.2}%
), then the left hand side will become%
\[
\sum_{k\in\mathbb{N}}\left(  -1\right)  ^{k}\underbrace{\dbinom{-1}{k}%
}_{\substack{=\left(  -1\right)  ^{k}\\\text{(by
(\ref{eq.exa.binom.small.-1Ck}))}}}=\sum_{k\in\mathbb{N}}\underbrace{\left(
-1\right)  ^{k}\left(  -1\right)  ^{k}}_{\substack{=\left(  -1\right)
^{k+k}=1\\\text{(since }k+k=2k\text{ is even)}}}=\sum_{k\in\mathbb{N}}1,
\]
which is an ill-defined infinite sum (with infinitely many nonzero addends).
More generally, for \textbf{any} $n\in\mathbb{R}\setminus\mathbb{N}$, the
infinite sum $\sum\limits_{k\in\mathbb{N}}\left(  -1\right)  ^{k}\dbinom{n}%
{k}$ will have infinitely many nonzero addends (unlike for $n\in\mathbb{N}$).

\item Theorem \ref{thm.binom.surmn-km=} claims that%
\begin{equation}
k^{m}=\sum_{i=0}^{m}\operatorname*{sur}\left(  m,i\right)  \cdot\dbinom{k}{i}
\label{eq.polidtrick.exa.km-sur.1}%
\end{equation}
for all $k\in\mathbb{N}$ and $m\in\mathbb{N}$. Can we use the polynomial
identity trick to generalize this to all $k\in\mathbb{R}$ ? What about
generalizing it to all $m\in\mathbb{R}$ ?

The answer to the second question is negative, because $k^{m}$ is clearly not
a polynomial in $m$ (that is, there exists no polynomial $P$ such that
$P\left(  m\right)  =k^{m}$ for all $m\in\mathbb{N}$, where $k$ is fixed).
Thus, $m$ has to remain a nonnegative integer. But the answer to the first
question is positive. Indeed, if we fix $m\in\mathbb{N}$, then both sides of
(\ref{eq.polidtrick.exa.km-sur.1}) are polynomials in $k$; that is, we can
rewrite the equality (\ref{eq.polidtrick.exa.km-sur.1}) as%
\[
P\left(  k\right)  =Q\left(  k\right)  ,\ \ \ \ \ \ \ \ \ \ \text{where
}P=X^{m}\text{ and }Q=\sum_{i=0}^{m}\operatorname*{sur}\left(  m,i\right)
\cdot\dbinom{X}{i}.
\]
From Theorem \ref{thm.binom.surmn-km=}, we know that this equality holds for
all $k\in\mathbb{N}$. Thus, the polynomial identity trick shows that it holds
for all $k\in\mathbb{R}$. Thus, we have proved that
\begin{equation}
k^{m}=\sum_{i=0}^{m}\operatorname*{sur}\left(  m,i\right)  \cdot\dbinom{k}{i}
\label{eq.polidtrick.exa.km-sur.gen}%
\end{equation}
for all $k\in\mathbb{R}$ and $m\in\mathbb{N}$. This is a significant
generalization of Theorem \ref{thm.binom.surmn-km=}.

\item Exercise \ref{exe.binom.altsum-partial} \textbf{(a)} claims the equality%
\[
\sum_{k=0}^{m}\left(  -1\right)  ^{k}\dbinom{n}{k}=\left(  -1\right)
^{m}\dbinom{n-1}{m}%
\]
for all $n\in\mathbb{R}$ and $m\in\mathbb{N}$. We cannot generalize this
equality to $m\in\mathbb{R}$ (because, for example, $\left(  -1\right)
^{m}\dbinom{n-1}{m}$ is not a polynomial in $m$). But the polynomial identity
trick shows that if we had only proved it for $n\in\mathbb{N}$, we could
automatically conclude that it holds for all $n\in\mathbb{R}$ (since both
sides are polynomials in $n$). (But we have no need for this, since we have
proved it for all $n\in\mathbb{R}$ already.)

\item We cannot generalize Theorem \ref{thm.binom.hock} to all $n\in
\mathbb{R}$, because $n$ appears as a summation bound on the left hand side.
The polynomial identity trick does not help here, since the left hand side is
not a polynomial in $n$. (The right hand side is, but this alone is not
sufficient.) We also cannot generalize Theorem \ref{thm.binom.hock} to all
$k\in\mathbb{R}$, because it would be false for $k=-1$ and $n=0$ (and, of
course, because $\dbinom{n+1}{k+1}$ is not a polynomial in $k$). (It would be
true for all $k\neq-1$, but only because it would boil down to $0=0$ in the
stupidest possible way when $k+1\notin\mathbb{N}$.) For similar reasons, we
cannot generalize Corollary \ref{cor.binom.hock2}.
\end{itemize}

\begin{teachingnote}
Add the following: One still missing exercise (18f-hw2s Exercise 2) says that%
\[
\sum_{i=0}^{n}\dbinom{n}{i}\dbinom{n-i}{k-2i}2^{k-2i}=\dbinom{2n}{k}%
\]
for all $n\in\mathbb{N}$ and $k\in\mathbb{N}$. In this form, this cannot be
generalized to $n\in\mathbb{R}$ (since $n$ appears as a summation bound on the
left hand side). But we can replace $\sum_{i=0}^{n}$ by $\sum_{i=0}%
^{\left\lfloor k/2\right\rfloor }$, and then we can use the polynomial
identity trick to generalize this to all $n\in\mathbb{R}$. (And we can also
allow $k\in\mathbb{R}$, but that does not follow from the polynomial identity
trick; it's just because we get $0=0$ when $k\notin\mathbb{N}$.)
\end{teachingnote}

\begin{center}
\fbox{\textbf{Class of 2019-10-28}}
\end{center}

\subsubsection{Mutating the Chu--Vandermonde identity}

We shall next see some \textquotedblleft mutated\textquotedblright\ versions
of the Chu--Vandermonde identity (Theorem \ref{thm.binom.vanderRR}). Here,
\textquotedblleft mutated\textquotedblright\ means that these versions are
obtained from the Chu--Vandermonde identity by transforming the binomial
coefficients via the upper negation and symmetry identities\footnote{i.e.,
Proposition \ref{prop.binom.upneg} and Theorem \ref{thm.binom.sym}}. One
example of such a \textquotedblleft mutated\textquotedblright\ version is
Corollary \ref{cor.binom.vander-xkyk}, since that corollary was proved by
applying the Chu--Vandermonde identity and rewriting one of the binomial
coefficients using symmetry. Here is another (which we shall prove soon):

\begin{proposition}
\label{prop.binom.vander-up}Let $n,x,y\in\mathbb{N}$. Then,%
\[
\dbinom{n+1}{x+y+1}=\sum_{k=0}^{n}\dbinom{k}{x}\dbinom{n-k}{y}.
\]

\end{proposition}

This proposition is often called the \textquotedblleft upside-down Vandermonde
convolution\textquotedblright, since its right hand side is the right hand
side of (\ref{eq.thm.binom.vanderRR.k=0-n}) with all binomial coefficients
turned \textquotedblleft upside down\textquotedblright. It behaves rather
differently in some aspects, however. In particular,
(\ref{eq.thm.binom.vanderRR.k=0-n}) holds for all $x,y\in\mathbb{R}$, whereas
Proposition \ref{prop.binom.vander-up} requires $x,y\in\mathbb{N}$ (and
indeed, would be false for $n=3$, $x=-1$ and $y=2$). The polynomial identity
trick cannot be used to generalize Proposition \ref{prop.binom.vander-up},
since its right hand side is neither a polynomial in $n$ nor a polynomial in
$x$ nor a polynomial in $y$.

We shall give two proofs of Proposition \ref{prop.binom.vander-up}: one
algebraic and one by double counting. The algebraic proof will explain why we
call it a \textquotedblleft mutated\textquotedblright\ Chu--Vandermonde
identity; the double-counting proof will shine some light on its combinatorial
meaning. Which is the \textquotedblleft right\textquotedblright\ proof? You decide.

\begin{proof}
[First proof of Proposition \ref{prop.binom.vander-up}.]This proof is a close
relative of the proof given in \cite[proof of Proposition 3.32 \textbf{(f)}%
]{detnotes} (but is more direct).

We shall first show an auxiliary claim:

\begin{statement}
\textit{Claim 1:} Let $k\in\left\{  0,1,\ldots,n\right\}  $ be such that $k<x$
or $n-k<y$. Then,%
\[
\dbinom{k}{x}\dbinom{n-k}{y}=0.
\]

\end{statement}

\begin{fineprint}
[\textit{Proof of Claim 1:} Assume the contrary. Thus, $\dbinom{k}{x}%
\dbinom{n-k}{y}\neq0$. Hence, $\dbinom{k}{x}\neq0$ and $\dbinom{n-k}{y}\neq0$.
Note that $k\in\left\{  0,1,\ldots,n\right\}  $, so that both $k$ and $n-k$
are nonnegative integers. Thus, $k\in\mathbb{N}$ and $n-k\in\mathbb{N}$.

From $k\in\mathbb{N}$ and $\dbinom{k}{x}\neq0$, we obtain $k\geq x$, because
otherwise, Proposition \ref{prop.binom.0} (applied to $k$ and $x$ instead of
$n$ and $k$) would yield $\dbinom{k}{x}=0$.

From $n-k\in\mathbb{N}$ and $\dbinom{n-k}{y}\neq0$, we obtain $n-k\geq y$,
because otherwise, Proposition \ref{prop.binom.0} (applied to $n-k$ and $y$
instead of $n$ and $k$) would yield $\dbinom{n-k}{y}=0$.

We have thus found $k\geq x$ and $n-k\geq y$. This contradicts the assumption
that $k<x$ or $n-k<y$. This contradiction shows that our assumption was wrong.
Hence, Claim 1 is proven.]
\end{fineprint}

We are in one of the following two cases:

\textit{Case 1:} We have $n<x+y$.

\textit{Case 2:} We have $n\geq x+y$.

Let us first consider Case 1. In this case, we have $n<x+y$. Therefore, each
$k\in\left\{  0,1,\ldots,n\right\}  $ satisfies either $k<x$ or $n-k<y$%
\ \ \ \ \footnote{\textit{Proof.} Assume the contrary. Thus, neither $k<x$ nor
$n-k<y$ holds. Hence, we have $k\geq x$ and $n-k\geq y$. Adding these two
inequalities together, we obtain $k+\left(  n-k\right)  \geq x+y$. This
contradicts $k+\left(  n-k\right)  =n<x+y$. This contradiction shows that our
assumption was wrong. Qed.}. Hence, each $k\in\left\{  0,1,\ldots,n\right\}  $
satisfies
\begin{equation}
\dbinom{k}{x}\dbinom{n-k}{y}=0 \label{pf.prop.binom.vander-up.1st.c1.0}%
\end{equation}
(by Claim 1).

Now, $n<x+y$, thus $n+1<x+y+1$. Thus, Proposition \ref{prop.binom.0} (applied
to $n+1$ and $x+y+1$ instead of $n$ and $k$) yields $\dbinom{n+1}{x+y+1}=0$.
Comparing this with%
\[
\sum_{k=0}^{n}\underbrace{\dbinom{k}{x}\dbinom{n-k}{y}}%
_{\substack{=0\\\text{(by (\ref{pf.prop.binom.vander-up.1st.c1.0}))}}%
}=\sum_{k=0}^{n}0=0,
\]
we obtain
\[
\dbinom{n+1}{x+y+1}=\sum_{k=0}^{n}\dbinom{k}{x}\dbinom{n-k}{y}.
\]
Thus, Proposition \ref{prop.binom.vander-up} is proven in Case 1.

Let us now consider Case 2. In this case, we have $n\geq x+y$. Thus, $n-y\geq
x$. Thus, $x\leq n-y$, so that $0\leq x\leq n-y\leq n$ (since $y\in\mathbb{N}%
$). Therefore, the integer interval $\left[  x,n-y\right]  =\left\{
x,x+1,\ldots,n-y\right\}  $ is a subset of $\left[  0,n\right]  =\left\{
0,1,\ldots,n\right\}  $. Thus, the elements $k\in\left\{  0,1,\ldots
,n\right\}  $ that satisfy $k\geq x$ and $k\leq n-y$ are precisely the
elements of $\left\{  x,x+1,\ldots,n-y\right\}  $.

Now, each $k\in\left\{  0,1,\ldots,n\right\}  $ satisfies
\[
\text{either }\left(  k\geq x\text{ and }n-k\geq y\right)  \text{ or }\left(
k<x\text{ or }n-k<y\right)
\]
(but not both of these statements simultaneously). Thus, we can split the sum
$\sum_{k=0}^{n}\dbinom{k}{x}\dbinom{n-k}{y}$ as follows:\footnote{Here we are
using the splitting rule (\ref{eq.sum.split.As}), along with the fact that the
\textquotedblleft$\sum_{k=0}^{n}$\textquotedblright\ sign is a shorthand for
\textquotedblleft$\sum_{k\in\left\{  0,1,\ldots,n\right\}  }$%
\textquotedblright.}%
\begin{align}
&  \sum_{k=0}^{n}\dbinom{k}{x}\dbinom{n-k}{y}\nonumber\\
&  =\underbrace{\sum_{\substack{k\in\left\{  0,1,\ldots,n\right\}  ;\\k\geq
x\text{ and }n-k\geq y}}}_{\substack{=\sum_{\substack{k\in\left\{
0,1,\ldots,n\right\}  ;\\k\geq x\text{ and }k\leq n-y}}\\\text{(since the
inequality }n-k\geq y\\\text{is equivalent to }k\leq n-y\text{)}}}\dbinom
{k}{x}\dbinom{n-k}{y}+\sum_{\substack{k\in\left\{  0,1,\ldots,n\right\}
;\\k<x\text{ or }n-k<y}}\underbrace{\dbinom{k}{x}\dbinom{n-k}{y}%
}_{\substack{=0\\\text{(by Claim 1)}}}\nonumber\\
&  =\sum_{\substack{k\in\left\{  0,1,\ldots,n\right\}  ;\\k\geq x\text{ and
}k\leq n-y}}\dbinom{k}{x}\dbinom{n-k}{y}+\sum_{\substack{k\in\left\{
0,1,\ldots,n\right\}  ;\\k<x\text{ or }n-k<y}}0\nonumber\\
&  =\sum_{\substack{k\in\left\{  0,1,\ldots,n\right\}  ;\\k\geq x\text{ and
}k\leq n-y}}\dbinom{k}{x}\dbinom{n-k}{y}\nonumber\\
&  =\sum_{k=x}^{n-y}\dbinom{k}{x}\dbinom{n-k}{y}
\label{pf.prop.binom.vander-up.1st.c2.1}%
\end{align}
(because the elements $k\in\left\{  0,1,\ldots,n\right\}  $ that satisfy
$k\geq x$ and $k\leq n-y$ are precisely the elements of $\left\{
x,x+1,\ldots,n-y\right\}  $).

Now, fix $k\in\left\{  x,x+1,\ldots,n-y\right\}  $. Thus, $x\leq k\leq n-y$,
so that $0\leq x\leq k\leq n-y\leq n$. Thus, $k\in\mathbb{N}$ (since $0\leq
k$) and $n-k\in\mathbb{N}$ (since $k\leq n$). Theorem \ref{thm.binom.sym}
(applied to $k$ and $x$ instead of $n$ and $k$) yields%
\begin{align}
\dbinom{k}{x}  &  =\dbinom{k}{k-x}=\dbinom{-\left(  -k\right)  }%
{k-x}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }k=-\left(  -k\right)  \right)
\nonumber\\
&  =\left(  -1\right)  ^{k-x}\dbinom{-k+k-x-1}{k-x}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Proposition \ref{prop.binom.upneg}, applied to }-k\text{ and }k-x\\
\text{instead of }n\text{ and }k
\end{array}
\right) \nonumber\\
&  =\left(  -1\right)  ^{k-x}\dbinom{-x-1}{k-x}
\label{pf.prop.binom.vander-up.1st.c2.2a}%
\end{align}
(since $-k+k-x-1=-x-1$). Furthermore, recall that $n-k\in\mathbb{N}$; hence,
Theorem \ref{thm.binom.sym} (applied to $n-k$ and $y$ instead of $n$ and $k$)
yields%
\begin{align}
\dbinom{n-k}{y}  &  =\dbinom{n-k}{n-k-y}=\dbinom{-\left(  k-n\right)  }%
{n-k-y}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }n-k=-\left(  k-n\right)
\right) \nonumber\\
&  =\left(  -1\right)  ^{n-k-y}\dbinom{k-n+n-k-y-1}{n-k-y}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Proposition \ref{prop.binom.upneg}, applied to }k-n\text{ and
}n-k-y\\
\text{instead of }n\text{ and }k
\end{array}
\right) \nonumber\\
&  =\left(  -1\right)  ^{n-k-y}\dbinom{-y-1}{n-y-k}
\label{pf.prop.binom.vander-up.1st.c2.2b}%
\end{align}
(since $k-n+n-k-y-1=-y-1$ and $n-k-y=n-y-k$). Multiplying the equalities
(\ref{pf.prop.binom.vander-up.1st.c2.2a}) and
(\ref{pf.prop.binom.vander-up.1st.c2.2b}), we obtain%
\begin{align}
\dbinom{k}{x}\dbinom{n-k}{y}  &  =\left(  -1\right)  ^{k-x}\dbinom{-x-1}%
{k-x}\left(  -1\right)  ^{n-k-y}\dbinom{-y-1}{n-y-k}\nonumber\\
&  =\underbrace{\left(  -1\right)  ^{k-x}\left(  -1\right)  ^{n-k-y}%
}_{\substack{=\left(  -1\right)  ^{\left(  k-x\right)  +\left(  n-k-y\right)
}=\left(  -1\right)  ^{n-x-y}\\\text{(since }\left(  k-x\right)  +\left(
n-k-y\right)  =n-x-y\text{)}}}\dbinom{-x-1}{k-x}\dbinom{-y-1}{n-y-k}%
\nonumber\\
&  =\left(  -1\right)  ^{n-x-y}\dbinom{-x-1}{k-x}\dbinom{-y-1}{n-y-k}.
\label{pf.prop.binom.vander-up.1st.c2.3}%
\end{align}


Now, forget that we fixed $k$. We thus have proved the equality
(\ref{pf.prop.binom.vander-up.1st.c2.3}) for each $k\in\left\{  x,x+1,\ldots
,n-y\right\}  $. Now, (\ref{pf.prop.binom.vander-up.1st.c2.1}) becomes%
\begin{align}
&  \sum_{k=0}^{n}\dbinom{k}{x}\dbinom{n-k}{y}\nonumber\\
&  =\sum_{k=x}^{n-y}\underbrace{\dbinom{k}{x}\dbinom{n-k}{y}}%
_{\substack{=\left(  -1\right)  ^{n-x-y}\dbinom{-x-1}{k-x}\dbinom{-y-1}%
{n-y-k}\\\text{(by (\ref{pf.prop.binom.vander-up.1st.c2.3}))}}}=\sum
_{k=x}^{n-y}\left(  -1\right)  ^{n-x-y}\dbinom{-x-1}{k-x}\dbinom{-y-1}%
{n-y-k}\nonumber\\
&  =\underbrace{\sum_{k=0}^{n-y-x}}_{\substack{=\sum_{k=0}^{n-x-y}%
\\\text{(since }n-y-x=n-x-y\text{)}}}\left(  -1\right)  ^{n-x-y}%
\underbrace{\dbinom{-x-1}{\left(  k+x\right)  -x}}_{\substack{=\dbinom
{-x-1}{k}\\\text{(since }\left(  k+x\right)  -x=k\text{)}}}\underbrace{\dbinom
{-y-1}{n-y-\left(  k+x\right)  }}_{\substack{=\dbinom{-y-1}{n-x-y-k}%
\\\text{(since }n-y-\left(  k+x\right)  =n-x-y-k\text{)}}}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have substituted }k+x\text{ for
}k\text{ in the sum}\right) \nonumber\\
&  =\sum_{k=0}^{n-x-y}\left(  -1\right)  ^{n-x-y}\dbinom{-x-1}{k}\dbinom
{-y-1}{n-x-y-k}\nonumber\\
&  =\left(  -1\right)  ^{n-x-y}\sum_{k=0}^{n-x-y}\dbinom{-x-1}{k}\dbinom
{-y-1}{n-x-y-k}. \label{pf.prop.binom.vander-up.1st.c2.5}%
\end{align}


Let us now look at the sum on the right hand side of this equality more
carefully. It is a sum of products of binomial coefficients, and this time the
running index $k$ of the sum appears only in the bottom arguments of these
coefficients. This looks similar to the right hand side of
(\ref{eq.thm.binom.vanderRR.k=0-n}), and indeed we can easily recognize the
right hand side of (\ref{eq.thm.binom.vanderRR.k=0-n}) in our sum, with
$n-x-y$, $-x-1$ and $-y-1$ substituted for $n$, $x$ and $y$.

Let us see how this works in detail: We have $n-x-y\geq0$ (since $n\geq x+y$)
and thus $n-x-y\in\mathbb{N}$. Thus, (\ref{eq.thm.binom.vanderRR.k=0-n})
(applied to $n-x-y$, $-x-1$ and $-y-1$ instead of $n$, $x$ and $y$) yields%
\[
\dbinom{\left(  -x-1\right)  +\left(  -y-1\right)  }{n-x-y}=\sum_{k=0}%
^{n-x-y}\dbinom{-x-1}{k}\dbinom{-y-1}{n-x-y-k}.
\]
In view of $\left(  -x-1\right)  +\left(  -y-1\right)  =-\left(  x+y+2\right)
$, this rewrites as%
\begin{equation}
\dbinom{-\left(  x+y+2\right)  }{n-x-y}=\sum_{k=0}^{n-x-y}\dbinom{-x-1}%
{k}\dbinom{-y-1}{n-x-y-k}. \label{pf.prop.binom.vander-up.1st.c2.6}%
\end{equation}
Thus, (\ref{pf.prop.binom.vander-up.1st.c2.5}) becomes%
\begin{align*}
&  \sum_{k=0}^{n}\dbinom{k}{x}\dbinom{n-k}{y}\\
&  =\left(  -1\right)  ^{n-x-y}\underbrace{\sum_{k=0}^{n-x-y}\dbinom{-x-1}%
{k}\dbinom{-y-1}{n-x-y-k}}_{\substack{=\dbinom{-\left(  x+y+2\right)  }%
{n-x-y}\\\text{(by (\ref{pf.prop.binom.vander-up.1st.c2.6}))}}}\\
&  =\left(  -1\right)  ^{n-x-y}\underbrace{\dbinom{-\left(  x+y+2\right)
}{n-x-y}}_{\substack{=\left(  -1\right)  ^{n-x-y}\dbinom{x+y+2+n-x-y-1}%
{n-x-y}\\\text{(by Proposition \ref{prop.binom.upneg},}\\\text{applied to
}x+y+2\text{ and }n-x-y\text{ instead of }n\text{ and }k\text{)}}}\\
&  =\underbrace{\left(  -1\right)  ^{n-x-y}\left(  -1\right)  ^{n-x-y}%
}_{\substack{=\left(  -1\right)  ^{\left(  n-x-y\right)  +\left(
n-x-y\right)  }=1\\\text{(since }\left(  n-x-y\right)  +\left(  n-x-y\right)
=2\left(  n-x-y\right)  \\\text{is even)}}}\underbrace{\dbinom{x+y+2+n-x-y-1}%
{n-x-y}}_{\substack{=\dbinom{n+1}{n-x-y}\\\text{(since }%
x+y+2+n-x-y-1=n+1\text{)}}}\\
&  =\dbinom{n+1}{n-x-y}=\dbinom{n+1}{\left(  n+1\right)  -\left(
n-x-y\right)  }\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.binom.sym}, applied
to }n+1\text{ and }n-x-y\text{ instead of }n\text{ and }k\right) \\
&  =\dbinom{n+1}{x+y+1}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left(
n+1\right)  -\left(  n-x-y\right)  =x+y+1\right)  .
\end{align*}
Thus, Proposition \ref{prop.binom.vander-up} is proven in Case 2.

We have now proved Proposition \ref{prop.binom.vander-up} in both Cases 1 and
2. Hence, Proposition \ref{prop.binom.vander-up} always holds.
\end{proof}

\begin{proof}
[Second proof of Proposition \ref{prop.binom.vander-up} (sketched).]We shall
prove Proposition \ref{prop.binom.vander-up} by double counting. How many
$\left(  x+y+1\right)  $-element subsets does the set $\left[  n+1\right]  $
have? Let us answer this question in two ways:

\textit{1st way:} Theorem \ref{thm.binom.comb} (applied to $n+1$, $x+y+1$ and
$\left[  n+1\right]  $ instead of $n$, $k$ and $S$) shows that
\begin{align}
&  \left(  \text{\# of }\left(  x+y+1\right)  \text{-element subsets of
}\left[  n+1\right]  \right) \nonumber\\
&  =\dbinom{n+1}{x+y+1}. \label{pf.prop.binom.vander-up.2nd.1}%
\end{align}


\textit{2nd way:} Here is a weird procedure to construct an $\left(
x+y+1\right)  $-element subset $U$ of $\left[  n+1\right]  $:

\begin{itemize}
\item First, we choose the $\left(  x+1\right)  $-st smallest element of the
subset $U$. Let us call it $m$. Thus, $m\in\left[  n+1\right]  $.

\item Then, we choose the $x$ smallest elements of $U$. These $x$ smallest
elements must belong to the $\left(  m-1\right)  $-element set $\left\{
1,2,\ldots,m-1\right\}  $ (since they must be smaller than the $\left(
x+1\right)  $-st smallest element of $U$, which is $m$); thus, there are
$\dbinom{m-1}{x}$ choices for them (by Theorem \ref{thm.binom.comb}, applied
to $m-1$, $x$ and $\left\{  1,2,\ldots,m-1\right\}  $ instead of $n$, $k$ and
$S$).

\item Finally, we choose the remaining $y$ elements of $U$. These $y$ elements
must belong to the $\left(  n-m+1\right)  $-element set $\left\{
m+1,m+2,\ldots,n+1\right\}  $ (since they must be larger than the $\left(
x+1\right)  $-st smallest element of $U$, which is $m$); thus, there are
$\dbinom{n-m+1}{y}$ choices for them (by Theorem \ref{thm.binom.comb}, applied
to $n-m+1$, $y$ and $\left\{  m+1,m+2,\ldots,n+1\right\}  $ instead of $n$,
$k$ and $S$).
\end{itemize}

\noindent The total \# of ways to make these decisions is clearly $\sum
_{m\in\left[  n+1\right]  }\dbinom{m-1}{x}\dbinom{n-m+1}{y}$. Thus,%
\begin{align}
&  \left(  \text{\# of }\left(  x+y+1\right)  \text{-element subsets of
}\left[  n+1\right]  \right) \nonumber\\
&  =\sum_{m\in\left[  n+1\right]  }\dbinom{m-1}{x}\dbinom{n-m+1}{y}.
\label{pf.prop.binom.vander-up.2nd.2}%
\end{align}


Now, comparing (\ref{pf.prop.binom.vander-up.2nd.1}) with
(\ref{pf.prop.binom.vander-up.2nd.2}), we obtain%
\begin{align*}
\dbinom{n+1}{x+y+1}  &  =\underbrace{\sum_{m\in\left[  n+1\right]  }}%
_{=\sum_{m=1}^{n+1}}\dbinom{m-1}{x}\underbrace{\dbinom{n-m+1}{y}%
}_{\substack{=\dbinom{n-\left(  m-1\right)  }{y}\\\text{(since }%
n-m+1=n-\left(  m-1\right)  \text{)}}}\\
&  =\sum_{m=1}^{n+1}\dbinom{m-1}{x}\dbinom{n-\left(  m-1\right)  }{y}%
=\sum_{k=0}^{n}\dbinom{k}{x}\dbinom{n-k}{y}%
\end{align*}
(here, we have substituted $k$ for $m-1$ in the sum). Thus, Proposition
\ref{prop.binom.vander-up} is proved again.
\end{proof}

\begin{exercise}
\label{exe.binom.vander-up.hock}Explain why Theorem \ref{thm.binom.hock} is a
particular case of Proposition \ref{prop.binom.vander-up}.
\end{exercise}

There are several other \textquotedblleft mutated versions\textquotedblright%
\ of the Chu--Vandermonde identity. Two of them are given in the following exercises:

\begin{exercise}
\label{exe.binom.vander-muts.d}Let $x,y\in\mathbb{R}$ and $n\in\mathbb{N}$.
Show that%
\[
\dbinom{x-y}{n}=\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{x}{n-k}%
\dbinom{k+y-1}{k}.
\]

\end{exercise}

\begin{exercise}
\label{exe.binom.vander-muts.e}Let $x\in\mathbb{N}$, $y\in\mathbb{R}$ and
$n\in\mathbb{N}$. Prove that%
\[
\dbinom{y-x-1}{n-x}=\sum_{k=0}^{n}\left(  -1\right)  ^{k-x}\dbinom{k}%
{x}\dbinom{y}{n-k}.
\]

\end{exercise}

The following two exercises can be solved entirely algebraically, using the
Chu--Vandermonde identity and the trinomial revision formula alone:

\begin{exercise}
\label{exe.binom.xaxb}Let $a,b\in\mathbb{N}$ and $x\in\mathbb{R}$. Prove that%
\[
\dbinom{x}{a}\dbinom{x}{b}=\sum_{i=a}^{a+b}\dbinom{i}{a}\dbinom{a}%
{a+b-i}\dbinom{x}{i}.
\]

\end{exercise}

\begin{exercise}
\label{exe.binom.pfaffsaal}Let $a,b\in\mathbb{N}$ and $x,y\in\mathbb{R}$.
Prove that%
\[
\sum_{i=0}^{\min\left\{  a,b\right\}  }\dbinom{x+y+i}{i}\dbinom{x}{a-i}%
\dbinom{y}{b-i}=\dbinom{x+b}{a}\dbinom{y+a}{b}.
\]


[\textbf{Hint:} Apply the Chu--Vandermonde identity thrice and each of
Propositions \ref{prop.binom.trin-rev} and \ref{prop.binom.trin-rev2} once.]
\end{exercise}

\begin{exercise}
\label{exe.binom.AMM12016}Fix a real $x\in\mathbb{R}$ and a nonnegative
integer $n\in\mathbb{N}$. For any $u,v\in\mathbb{R}$, we define%
\[
F_{x,n}\left(  u,v\right)  =\sum_{i=0}^{n}\dbinom{x+u}{n-i}\dbinom{u+i}%
{i}\dbinom{v}{i}.
\]
Prove that
\[
F_{x,n}\left(  u,v\right)  =F_{x,n}\left(  v,u\right)
\ \ \ \ \ \ \ \ \ \ \text{for any }u,v\in\mathbb{R}.
\]


[\textbf{Hint:} Apply both the Chu--Vandermonde identity and Corollary
\ref{cor.binom.vander-xkyk}.]
\end{exercise}

\subsection{\label{sect.binom.subsets-sheep}Counting subsets again}

One of the most important facts we have seen so far was Theorem
\ref{thm.binom.comb}, which said that if $S$ is an $n$-element set and
$k\in\mathbb{R}$, then
\[
\dbinom{n}{k}=\left(  \text{\# of }k\text{-element subsets of }S\right)  .
\]
We have proved this fact by induction on $n$. We shall now re-prove it using
the sum rule applied \textquotedblleft backwards\textquotedblright. The
underlying idea of the argument can be summarized by the saying
\textquotedblleft to count sheep, first count the legs and then divide by
$4$\textquotedblright. In our case, the sheep will be the $k$-element subsets
of $S$, and their legs will be \emph{injective }$k$\emph{-tuples} of elements
of $S$ (i.e., $k$-tuples $\left(  s_{1},s_{2},\ldots,s_{k}\right)  \in S^{k}$
such that $s_{1},s_{2},\ldots,s_{k}$ are distinct). More precisely, an
injective $k$-tuple $\left(  s_{1},s_{2},\ldots,s_{k}\right)  \in S^{k}$ will
be considered a \textquotedblleft leg\textquotedblright\ of a sheep $W$ if and
only if $W=\left\{  s_{1},s_{2},\ldots,s_{k}\right\}  $. What is so useful
about this definition of \textquotedblleft legs\textquotedblright\ is that

\begin{itemize}
\item the legs are easier to count than the sheep, and

\item each sheep has the same number of legs (although not $4$).
\end{itemize}

\noindent This trick for counting is sometimes called the \textquotedblleft
multijection principle\textquotedblright\footnote{or \textquotedblleft
strategic overcounting\textquotedblright\ (but there is yet another trick that
shares this name)}, but it requires no new theorems; the sum rule is all we need.

\begin{teachingnote}
Should there be a tikz picture with a bunch of sheep and legs here? Wouldn't
hurt, I guess.
\end{teachingnote}

Here are the details. First, let us define the injective $k$-tuples -- the
\textquotedblleft legs\textquotedblright\ of our \textquotedblleft
sheep\textquotedblright:

\begin{definition}
\label{def.binom.inj-k-tup}Let $S$ be a set. Let $k\in\mathbb{N}$.

\textbf{(a)} A $k$-tuple $\left(  s_{1},s_{2},\ldots,s_{k}\right)  \in S^{k}$
is said to be \emph{injective} if $s_{1},s_{2},\ldots,s_{k}$ are distinct.

\textbf{(b)} Let $S_{\operatorname*{inj}}^{k}$ be the set of all injective
$k$-tuples $\left(  s_{1},s_{2},\ldots,s_{k}\right)  \in S^{k}$. This is a
subset of $S^{k}$.
\end{definition}

For example, the $3$-tuple $\left(  3,2,5\right)  $ is injective (since
$3,2,5$ are distinct), whereas the $3$-tuple $\left(  4,2,4\right)  $ is not
(since $4=4$).

In probability theory, injective $k$-tuples are called \textquotedblleft
ordered $k$-samples without replacement\textquotedblright\ (while arbitrary
$k$-tuples are called \textquotedblleft ordered $k$-samples with
replacement\textquotedblright).

\textbf{Warning:} Some authors also refer to injective $k$-tuples $\left(
s_{1},s_{2},\ldots,s_{k}\right)  \in S^{k}$ as $k$\emph{-permutations} of $S$.
But this is not the meaning that the word \textquotedblleft
permutation\textquotedblright\ has in this text!

We promised that the injective $k$-tuples (the \textquotedblleft
legs\textquotedblright) would be easy to count; let us do this:

\begin{proposition}
\label{prop.binom.inj-k-tup.count}Let $S$ be a finite set. Let $k\in
\mathbb{N}$. Then, $\left\vert S_{\operatorname*{inj}}^{k}\right\vert
=\left\vert S\right\vert ^{\underline{k}}$.
\end{proposition}

Here, we are using the falling factorial notation $n^{\underline{k}}$ (as
defined in Definition \ref{def.binom.ff}).

It is easy to prove Proposition \ref{prop.binom.inj-k-tup.count} using the
\textquotedblleft dependent product rule\textquotedblright\footnote{Just argue
that an injective $k$-tuple $\left(  s_{1},s_{2},\ldots,s_{k}\right)  \in
S_{\operatorname*{inj}}^{k}$ can be constructed by first choosing its first
entry $s_{1}$ (there are $\left\vert S\right\vert $ many choices), then
choosing its second entry $s_{2}$ (there are $\left\vert S\right\vert -1$ many
choices, since $s_{2}$ has to be distinct from $s_{1}$), then choosing its
third entry $s_{3}$ (there are $\left\vert S\right\vert -2$ many choices,
since $s_{3}$ has to be distinct from the two distinct elements $s_{1}$ and
$s_{2}$), and so on, and therefore the total \# of injective $k$-tuples
$\left(  s_{1},s_{2},\ldots,s_{k}\right)  \in S_{\operatorname*{inj}}^{k}$
must be $\left\vert S\right\vert \cdot\left(  \left\vert S\right\vert
-1\right)  \cdot\left(  \left\vert S\right\vert -2\right)  \cdot\cdots
\cdot\left(  \left\vert S\right\vert -k+1\right)  =\left\vert S\right\vert
^{\underline{k}}$.}. However, we have already made more or less the same
argument when we proved Theorem \ref{thm.binom.maps-inj}, so instead of doing
it again, I find it easier to piggyback on Theorem \ref{thm.binom.maps-inj}:

\begin{proof}
[Proof of Proposition \ref{prop.binom.inj-k-tup.count}.]Note that $S$ is a
$\left\vert S\right\vert $-element set, whereas $\left[  k\right]  $ is a
$k$-element set.

The injective $k$-tuples $\left(  s_{1},s_{2},\ldots,s_{k}\right)  \in S^{k}$
are in one-to-one correspondence with the injective maps from $\left[
k\right]  $ to $S$. More precisely: If $f$ is an injective map from $\left[
k\right]  $ to $S$, then the $k$-tuple $\left(  f\left(  1\right)  ,f\left(
2\right)  ,\ldots,f\left(  k\right)  \right)  \in S^{k}$ is injective (since
the injectivity of $f$ forces the values $f\left(  1\right)  ,f\left(
2\right)  ,\ldots,f\left(  k\right)  $ to be distinct) and thus belongs to
$S_{\operatorname*{inj}}^{k}$. Thus, we can define a map%
\begin{align*}
\alpha:\left\{  \text{injective maps from }\left[  k\right]  \text{ to
}S\right\}   &  \rightarrow S_{\operatorname*{inj}}^{k},\\
f  &  \mapsto\left(  f\left(  1\right)  ,f\left(  2\right)  ,\ldots,f\left(
k\right)  \right)  .
\end{align*}
This map $\alpha$ simply sends every injective map $f:\left[  k\right]
\rightarrow S$ to its list of values. It is easy to see that this map $\alpha$
is a bijection\footnote{Indeed, $\alpha$ has an inverse, which can be
constructed as follows: For each injective $k$-tuple $\mathbf{s}=\left(
s_{1},s_{2},\ldots,s_{k}\right)  \in S_{\operatorname*{inj}}^{k}$, we let
$f_{\mathbf{s}}:\left[  k\right]  \rightarrow S$ be the map that sends
$1,2,\ldots,k$ to $s_{1},s_{2},\ldots,s_{k}$, respectively. This map
$f_{\mathbf{s}}$ is injective (since its values $s_{1},s_{2},\ldots,s_{k}$ are
distinct (because $\left(  s_{1},s_{2},\ldots,s_{k}\right)  $ is an injective
$k$-tuple)), and thus belongs to $\left\{  \text{injective maps from }\left[
k\right]  \text{ to }S\right\}  $. Hence, we can define a map%
\begin{align*}
\beta:S_{\operatorname*{inj}}^{k}  &  \rightarrow\left\{  \text{injective maps
from }\left[  k\right]  \text{ to }S\right\}  ,\\
\mathbf{s}  &  \mapsto f_{\mathbf{s}}.
\end{align*}
It is straightforward to see that the maps $\alpha$ and $\beta$ are mutually
inverse. Hence, the map $\alpha$ is invertible, i.e., bijective, i.e., a
bijection.}. Thus, the bijection principle yields%
\[
\left\vert \left\{  \text{injective maps from }\left[  k\right]  \text{ to
}S\right\}  \right\vert =\left\vert S_{\operatorname*{inj}}^{k}\right\vert .
\]
Hence,%
\begin{align*}
\left\vert S_{\operatorname*{inj}}^{k}\right\vert  &  =\left\vert \left\{
\text{injective maps from }\left[  k\right]  \text{ to }S\right\}  \right\vert
\\
&  =\left(  \text{\# of injective maps from }\left[  k\right]  \text{ to
}S\right)  =\left\vert S\right\vert ^{\underline{k}}%
\end{align*}
(by Theorem \ref{thm.binom.maps-inj}, applied to $m=k$, $n=\left\vert
S\right\vert $, $A=\left[  k\right]  $ and $B=S$). This proves Proposition
\ref{prop.binom.inj-k-tup.count}.
\end{proof}

We shall now apply this to obtain a second proof of Theorem
\ref{thm.binom.comb}, as promised:

\begin{proof}
[Second proof of Theorem \ref{thm.binom.comb} (sketched).]We must prove the
equality%
\[
\dbinom{n}{k}=\left(  \text{\# of }k\text{-element subsets of }S\right)  .
\]
If $k\notin\mathbb{N}$, then both sides of this equality are $0$ (because $S$
has no $k$-element subsets when $k\notin\mathbb{N}$), and thus the equality is
clearly true. Hence, for the rest of this proof, we WLOG assume that
$k\in\mathbb{N}$.

We have $\left\vert S\right\vert =n$ (since $S$ is an $n$-element set).

For each injective $k$-tuple $\mathbf{s}=\left(  s_{1},s_{2},\ldots
,s_{k}\right)  \in S_{\operatorname*{inj}}^{k}$, we let $\operatorname*{set}%
\mathbf{s}$ denote the set $\left\{  s_{1},s_{2},\ldots,s_{k}\right\}  $ of
all entries of $\mathbf{s}$. This set $\operatorname*{set}\mathbf{s}$ is a
$k$-element set (because $s_{1},s_{2},\ldots,s_{k}$ are
distinct\footnote{since $\left(  s_{1},s_{2},\ldots,s_{k}\right)  $ is an
injective $k$-tuple}) and a subset of $S$ (because $s_{1},s_{2},\ldots,s_{k}$
are elements of $S$\ \ \ \ \footnote{since $\left(  s_{1},s_{2},\ldots
,s_{k}\right)  \in S_{\operatorname*{inj}}^{k}\subseteq S^{k}$}), and thus is
a $k$-element subset of $S$.

In our informal discussion above, $\operatorname*{set}\mathbf{s}$ was playing
the role of the \textquotedblleft sheep\textquotedblright\ whose
\textquotedblleft leg\textquotedblright\ is the $k$-tuple $\mathbf{s}$. Now,
how many \textquotedblleft legs\textquotedblright\ does a \textquotedblleft
sheep\textquotedblright\ have? Let us find out.

Let us fix a $k$-element subset $W$ of $S$. Thus, $\left\vert W\right\vert =k$
(since $W$ is a $k$-element set). The following observation is easy:

\begin{statement}
\textit{Observation 1:} The injective $k$-tuples $\mathbf{s}\in
S_{\operatorname*{inj}}^{k}$ satisfying $\operatorname*{set}\mathbf{s}=W$ are
precisely the injective $k$-tuples in $W_{\operatorname*{inj}}^{k}$.
\end{statement}

\begin{fineprint}
[\textit{Proof of Observation 1:} We must prove the following two claims:

\begin{statement}
\textit{Claim 1.1:} Every injective $k$-tuple $\mathbf{s}\in
S_{\operatorname*{inj}}^{k}$ satisfying $\operatorname*{set}\mathbf{s}=W$ is
an injective $k$-tuple in $W_{\operatorname*{inj}}^{k}$.
\end{statement}

\begin{statement}
\textit{Claim 1.2:} Every injective $k$-tuple in $W_{\operatorname*{inj}}^{k}$
is an injective $k$-tuple $\mathbf{s}\in S_{\operatorname*{inj}}^{k}$
satisfying $\operatorname*{set}\mathbf{s}=W$.
\end{statement}

[\textit{Proof of Claim 1.1:} Let $\mathbf{s}\in S_{\operatorname*{inj}}^{k}$
be an injective $k$-tuple satisfying $\operatorname*{set}\mathbf{s}=W$. We
must prove that $\mathbf{s}$ is an injective $k$-tuple in
$W_{\operatorname*{inj}}^{k}$.

Write the $k$-tuple $\mathbf{s}$ as $\mathbf{s}=\left(  s_{1},s_{2}%
,\ldots,s_{k}\right)  $. Then, $\operatorname*{set}\mathbf{s}=\left\{
s_{1},s_{2},\ldots,s_{k}\right\}  $ (by the definition of $\operatorname*{set}%
\mathbf{s}$), so that $\left\{  s_{1},s_{2},\ldots,s_{k}\right\}
=\operatorname*{set}\mathbf{s}=W$. Hence, the elements $s_{1},s_{2}%
,\ldots,s_{k}$ belong to $W$ (because they clearly belong to $\left\{
s_{1},s_{2},\ldots,s_{k}\right\}  $). Therefore, $\left(  s_{1},s_{2}%
,\ldots,s_{k}\right)  \in W^{k}$. In other words, $\mathbf{s}\in W^{k}$ (since
$\mathbf{s}=\left(  s_{1},s_{2},\ldots,s_{k}\right)  $). Since the $k$-tuple
$\mathbf{s}$ is injective, this shows that $\mathbf{s}\in
W_{\operatorname*{inj}}^{k}$. Hence, $\mathbf{s}$ is an injective $k$-tuple in
$W_{\operatorname*{inj}}^{k}$. This completes the proof of Claim 1.1.]

[\textit{Proof of Claim 1.2:} Let $\mathbf{w}$ be an injective $k$-tuple in
$W_{\operatorname*{inj}}^{k}$. We must prove that $\mathbf{w}$ is an injective
$k$-tuple $\mathbf{s}\in S_{\operatorname*{inj}}^{k}$ satisfying
$\operatorname*{set}\mathbf{s}=W$. In other words, we must prove that
$\mathbf{w}$ is an injective $k$-tuple that belongs to $S_{\operatorname*{inj}%
}^{k}$ and satisfies $\operatorname*{set}\mathbf{w}=W$.

We have $\mathbf{w}\in W_{\operatorname*{inj}}^{k}\subseteq W^{k}\subseteq
S^{k}$ (since $W\subseteq S$). Thus, $\mathbf{w}$ is an injective $k$-tuple in
$S^{k}$; in other words, $\mathbf{w}\in S_{\operatorname*{inj}}^{k}$. Now,
write the $k$-tuple $\mathbf{w}$ in the form $\mathbf{w}=\left(  w_{1}%
,w_{2},\ldots,w_{k}\right)  $. Then, $w_{1},w_{2},\ldots,w_{k}\in W$ (since
$\left(  w_{1},w_{2},\ldots,w_{k}\right)  =\mathbf{w}\in
W_{\operatorname*{inj}}^{k}\subseteq W^{k}$), so that $\left\{  w_{1}%
,w_{2},\ldots,w_{k}\right\}  $ is a subset of $W$. Moreover, the $k$-tuple
$\left(  w_{1},w_{2},\ldots,w_{k}\right)  =\mathbf{w}$ is injective; in other
words, $w_{1},w_{2},\ldots,w_{k}$ are distinct. Thus, $\left\{  w_{1}%
,w_{2},\ldots,w_{k}\right\}  $ is a $k$-element set. In other words,
$\left\vert \left\{  w_{1},w_{2},\ldots,w_{k}\right\}  \right\vert =k$. Hence,
$\left\vert \left\{  w_{1},w_{2},\ldots,w_{k}\right\}  \right\vert
=k=\left\vert W\right\vert $ (since $\left\vert W\right\vert =k$). Hence,
Theorem \ref{thm.subset-leq} \textbf{(c)} (applied to $A=W$ and $B=\left\{
w_{1},w_{2},\ldots,w_{k}\right\}  $) yields $\left\{  w_{1},w_{2},\ldots
,w_{k}\right\}  =W$. Now, from $\mathbf{w}=\left(  w_{1},w_{2},\ldots
,w_{k}\right)  $, we obtain $\operatorname*{set}\mathbf{w}=\left\{
w_{1},w_{2},\ldots,w_{k}\right\}  $ (by the definition of $\operatorname*{set}%
\mathbf{w}$), so that $\operatorname*{set}\mathbf{w}=\left\{  w_{1}%
,w_{2},\ldots,w_{k}\right\}  =W$. Thus, altogether, we have shown that
$\mathbf{w}$ is an injective $k$-tuple that belongs to $S_{\operatorname*{inj}%
}^{k}$ and satisfies $\operatorname*{set}\mathbf{w}=W$. This proves Claim 1.2.]

Combining Claim 1.1 with Claim 1.2, we obtain precisely the claim of
Observation 1. Hence, Observation 1 is proven.]
\end{fineprint}

\vspace{0.5pc}

Now, Observation 1 shows that%
\begin{align}
&  \left(  \text{\# of injective }k\text{-tuples }\mathbf{s}\in
S_{\operatorname*{inj}}^{k}\text{ satisfying }\operatorname*{set}%
\mathbf{s}=W\right) \nonumber\\
&  =\left(  \text{\# of injective }k\text{-tuples in }W_{\operatorname*{inj}%
}^{k}\right) \nonumber\\
&  =\left\vert W_{\operatorname*{inj}}^{k}\right\vert
\ \ \ \ \ \ \ \ \ \ \left(  \text{since all elements of }%
W_{\operatorname*{inj}}^{k}\text{ are injective }k\text{-tuples}\right)
\nonumber\\
&  =\left\vert W\right\vert ^{\underline{k}}\ \ \ \ \ \ \ \ \ \ \left(
\text{by Proposition \ref{prop.binom.inj-k-tup.count}, applied to }W\text{
instead of }S\right) \nonumber\\
&  =k^{\underline{k}}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left\vert
W\right\vert =k\right) \nonumber\\
&  =k! \label{pf.thm.binom.comb.2nd.4}%
\end{align}
(by Proposition \ref{prop.binom.ff.basics} \textbf{(d)}, applied to $k$
instead of $n$).

Now, forget that we fixed $W$. We thus have proved
(\ref{pf.thm.binom.comb.2nd.4}) for each $k$-element subset $W$ of $S$.

Now, recall that for each injective $k$-tuple $\mathbf{s}\in
S_{\operatorname*{inj}}^{k}$, we have defined a $k$-element subset
$\operatorname*{set}\mathbf{s}$ of $S$. In other words, there is a map%
\begin{align*}
\left\{  \text{injective }k\text{-tuples }\mathbf{s}\in S_{\operatorname*{inj}%
}^{k}\right\}   &  \rightarrow\left\{  k\text{-element subsets of }S\right\}
,\\
\mathbf{s}  &  \mapsto\operatorname*{set}\mathbf{s}.
\end{align*}
Hence, the sum rule (Theorem \ref{thm.sumrule2}) shows that%
\begin{align*}
&  \left(  \text{\# of injective }k\text{-tuples }\mathbf{s}\in
S_{\operatorname*{inj}}^{k}\right) \\
&  =\sum_{\substack{W\text{ is a }k\text{-element}\\\text{subset of }%
S}}\underbrace{\left(  \text{\# of injective }k\text{-tuples }\mathbf{s}\in
S_{\operatorname*{inj}}^{k}\text{ satisfying }\operatorname*{set}%
\mathbf{s}=W\right)  }_{\substack{=k!\\\text{(by
(\ref{pf.thm.binom.comb.2nd.4}))}}}\\
&  =\sum_{\substack{W\text{ is a }k\text{-element}\\\text{subset of }%
S}}k!=\left(  \text{\# of }k\text{-element subsets of }S\right)  \cdot k!.
\end{align*}
Comparing this equality with%
\begin{align*}
&  \left(  \text{\# of injective }k\text{-tuples }\mathbf{s}\in
S_{\operatorname*{inj}}^{k}\right) \\
&  =\left\vert S_{\operatorname*{inj}}^{k}\right\vert
\ \ \ \ \ \ \ \ \ \ \left(  \text{since all elements of }%
S_{\operatorname*{inj}}^{k}\text{ are injective }k\text{-tuples}\right) \\
&  =\left\vert S\right\vert ^{\underline{k}}\ \ \ \ \ \ \ \ \ \ \left(
\text{by Proposition \ref{prop.binom.inj-k-tup.count}}\right) \\
&  =n^{\underline{k}}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left\vert
S\right\vert =n\right) \\
&  =k!\cdot\dbinom{n}{k}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.binom.ff.basics} \textbf{(c)}}\right)  ,
\end{align*}
we obtain%
\[
k!\cdot\dbinom{n}{k}=\left(  \text{\# of }k\text{-element subsets of
}S\right)  \cdot k!.
\]
We can divide both sides of this equality by $k!$ (since $k!=1\cdot
2\cdot\cdots\cdot k$ is clearly a nonzero integer), and thus obtain%
\[
\dbinom{n}{k}=\left(  \text{\# of }k\text{-element subsets of }S\right)  .
\]
Hence, Theorem \ref{thm.binom.comb} is proved again.
\end{proof}

\begin{center}
\fbox{\textbf{Class of 2019-10-30}}
\end{center}

\subsection{\label{sect.binom.genfun1}Another use of polynomials}

We have already seen how binomial identities (i.e., identities that involve
binomial coefficients) can be proved using the \textquotedblleft polynomial
identity trick\textquotedblright. This is not the only application of
polynomials to proving binomial identities. We shall now see another
application (which is actually a foretaste of a comprehensive method -- the
method of \textit{generating functions}), in which polynomials are not merely
evaluated at numbers, but also compared coefficientwise. This application will
be (yet) another proof of the Chu--Vandermonde identity (specifically,
(\ref{eq.thm.binom.vanderRR.k=0-n})). As in our second proof of Theorem
\ref{thm.binom.vanderRR}, we will only prove it in the case when
$x,y\in\mathbb{N}$, but as we already know, the polynomial identity trick
allows us to extend such a proof to the general case more or less
automatically, so we don't lose any generality by restricting ourselves to
such a case.

Before we come to this new proof of the Chu--Vandermonde identity, let us
state a simple lemma:

\begin{lemma}
\label{lem.binom.(1+X)powk}Let $p\in\mathbb{N}$. Then,%
\[
\left(  1+X\right)  ^{p}=\sum_{m\in\mathbb{N}}\dbinom{p}{m}X^{m}%
\]
(an equality between polynomials in $1$ variable $X$ with real coefficients).
Here, the sum on the right hand side is infinite, but it is well-defined
because only finitely many of its addends are nonzero.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.binom.(1+X)powk} (sketched).]We have stated Theorem
\ref{thm.binom.binom} only for the case when $x$ and $y$ are real numbers;
however, it also holds when $x$ and $y$ are polynomials (and the same proof
that we gave applies in this case). Thus, we can apply Theorem
\ref{thm.binom.binom} to $n=p$, $x=X$ and $y=1$. We thus obtain\footnote{See
Remark \ref{rmk.vanderRR.sums-equal} for the meaning of the \textquotedblleft%
$\overset{0}{=}$\textquotedblright\ sign.}
\[
\left(  X+1\right)  ^{p}=\sum_{k=0}^{p}\dbinom{p}{k}X^{k}\underbrace{1^{p-k}%
}_{=1}=\sum_{k=0}^{p}\dbinom{p}{k}X^{k}\overset{0}{=}\sum_{k\in\mathbb{N}%
}\dbinom{p}{k}X^{k}.
\]
Here, the \textquotedblleft$\overset{0}{=}$\textquotedblright\ sign is owed to
the fact that all integers $k$ satisfying $k>p$ satisfy $\dbinom{p}{k}=0$ (by
Proposition \ref{prop.binom.0}, applied to $n=p$) and thus $\dbinom{p}{k}%
X^{k}=0$. This also shows that the infinite sum $\sum_{k\in\mathbb{N}}%
\dbinom{p}{k}X^{k}$ has only finitely many nonzero addends, and thus is
well-defined. Now,%
\[
\left(  X+1\right)  ^{p}=\sum_{k\in\mathbb{N}}\dbinom{p}{k}X^{k}=\sum
_{m\in\mathbb{N}}\dbinom{p}{m}X^{m}%
\]
(here, we have renamed the summation index $k$ as $m$). In view of $X+1=1+X$,
we can rewrite this as%
\[
\left(  1+X\right)  ^{p}=\sum_{m\in\mathbb{N}}\dbinom{p}{m}X^{m}.
\]
This proves Lemma \ref{lem.binom.(1+X)powk}.
\end{proof}

\begin{proof}
[Fourth proof of Theorem \ref{thm.binom.vanderRR} for $x,y\in\mathbb{N}$
(sketched).]Assume that $x,y\in\mathbb{N}$. We shall only prove the equality
(\ref{eq.thm.binom.vanderRR.k=0-n}) (since we have already seen how to derive
(\ref{eq.thm.binom.vanderRR.all-k}) from it).

Rename $x$ and $y$ as $a$ and $b$. Thus, $a,b\in\mathbb{N}$, and we must prove
the equality%
\begin{equation}
\dbinom{a+b}{n}=\sum_{k=0}^{n}\dbinom{a}{k}\dbinom{b}{n-k}.
\label{pf.thm.binom.vanderRR.4th.goal}%
\end{equation}


Let us work with polynomials in one variable $X$, with real coefficients.
Lemma \ref{lem.binom.(1+X)powk} (applied to $p=a$) yields%
\[
\left(  1+X\right)  ^{a}=\sum_{m\in\mathbb{N}}\dbinom{a}{m}X^{m}=\sum
_{i\in\mathbb{N}}\dbinom{a}{i}X^{i}%
\]
(here, we have renamed the summation index $m$ as $i$). Similarly,%
\[
\left(  1+X\right)  ^{b}=\sum_{j\in\mathbb{N}}\dbinom{b}{j}X^{j}.
\]
Multiplying these two equalities, we obtain%
\begin{align*}
&  \left(  1+X\right)  ^{a}\cdot\left(  1+X\right)  ^{b}\\
&  =\left(  \sum_{i\in\mathbb{N}}\dbinom{a}{i}X^{i}\right)  \cdot\left(
\sum_{j\in\mathbb{N}}\dbinom{b}{j}X^{j}\right) \\
&  =\sum_{i\in\mathbb{N}}\underbrace{\dbinom{a}{i}X^{i}\sum_{j\in\mathbb{N}%
}\dbinom{b}{j}X^{j}}_{=\sum_{j\in\mathbb{N}}\dbinom{a}{i}X^{i}\dbinom{b}%
{j}X^{j}}=\sum_{i\in\mathbb{N}}\ \ \sum_{j\in\mathbb{N}}\underbrace{\dbinom
{a}{i}X^{i}\dbinom{b}{j}X^{j}}_{=\dbinom{a}{i}\dbinom{b}{j}X^{i+j}}\\
&  =\sum_{i\in\mathbb{N}}\ \ \sum_{j\in\mathbb{N}}\dbinom{a}{i}\dbinom{b}%
{j}X^{i+j}=\sum_{\left(  i,j\right)  \in\mathbb{N}^{2}}\dbinom{a}{i}\dbinom
{b}{j}X^{i+j}\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by the first equality sign in Theorem \ref{thm.fubini-inf},}\\
\text{since only finitely many }\left(  i,j\right)  \in\mathbb{N}^{2}\text{
satisfy }\dbinom{a}{i}\dbinom{b}{j}X^{i+j}\neq0
\end{array}
\right) \\
&  =\sum_{m\in\mathbb{N}}\ \ \sum_{\substack{\left(  i,j\right)  \in
\mathbb{N}^{2};\\i+j=m}}\dbinom{a}{i}\dbinom{b}{j}\underbrace{X^{i+j}%
}_{\substack{=X^{m}\\\text{(since }i+j=m\text{)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have used
the analogue of (\ref{eq.sum.sheph}) for infinite sums}\right) \\
&  =\sum_{m\in\mathbb{N}}\underbrace{\sum_{\substack{\left(  i,j\right)
\in\mathbb{N}^{2};\\i+j=m}}\dbinom{a}{i}\dbinom{b}{j}X^{m}}_{=\left(
\sum_{\substack{\left(  i,j\right)  \in\mathbb{N}^{2};\\i+j=m}}\dbinom{a}%
{i}\dbinom{b}{j}\right)  X^{m}}\\
&  =\sum_{m\in\mathbb{N}}\left(  \sum_{\substack{\left(  i,j\right)
\in\mathbb{N}^{2};\\i+j=m}}\dbinom{a}{i}\dbinom{b}{j}\right)  X^{m}.
\end{align*}


Comparing this with%
\begin{align*}
&  \left(  1+X\right)  ^{a}\cdot\left(  1+X\right)  ^{b}\\
&  =\left(  1+X\right)  ^{a+b}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since the product rule for exponents, }u^{a}\cdot u^{b}=u^{a+b}%
\text{,}\\
\text{holds for polynomials just as it holds for numbers}%
\end{array}
\right) \\
&  =\sum_{m\in\mathbb{N}}\dbinom{a+b}{m}X^{m}\ \ \ \ \ \ \ \ \ \ \left(
\text{by Lemma \ref{lem.binom.(1+X)powk}, applied to }p=a+b\right)  ,
\end{align*}
we obtain%
\begin{equation}
\sum_{m\in\mathbb{N}}\left(  \sum_{\substack{\left(  i,j\right)  \in
\mathbb{N}^{2};\\i+j=m}}\dbinom{a}{i}\dbinom{b}{j}\right)  X^{m}=\sum
_{m\in\mathbb{N}}\dbinom{a+b}{m}X^{m}. \label{pf.thm.binom.vanderRR.4th.poleq}%
\end{equation}
We can thus define a polynomial $P$ by%
\[
P=\sum_{m\in\mathbb{N}}\left(  \sum_{\substack{\left(  i,j\right)
\in\mathbb{N}^{2};\\i+j=m}}\dbinom{a}{i}\dbinom{b}{j}\right)  X^{m}=\sum
_{m\in\mathbb{N}}\dbinom{a+b}{m}X^{m}.
\]
Now, from $P=\sum_{m\in\mathbb{N}}\left(  \sum_{\substack{\left(  i,j\right)
\in\mathbb{N}^{2};\\i+j=m}}\dbinom{a}{i}\dbinom{b}{j}\right)  X^{m}$, we
obtain
\begin{equation}
\left(  \text{the }n\text{-th coefficient of }P\right)  =\sum
_{\substack{\left(  i,j\right)  \in\mathbb{N}^{2};\\i+j=n}}\dbinom{a}%
{i}\dbinom{b}{j}. \label{pf.thm.binom.vanderRR.4th.coeff1}%
\end{equation}
Meanwhile, from $P=\sum_{m\in\mathbb{N}}\dbinom{a+b}{m}X^{m}$, we obtain%
\[
\left(  \text{the }n\text{-th coefficient of }P\right)  =\dbinom{a+b}{n}.
\]
Comparing this with (\ref{pf.thm.binom.vanderRR.4th.coeff1}), we obtain%
\[
\dbinom{a+b}{n}=\sum_{\substack{\left(  i,j\right)  \in\mathbb{N}^{2}%
;\\i+j=n}}\dbinom{a}{i}\dbinom{b}{j}=\sum_{k\in\left\{  0,1,\ldots,n\right\}
}\dbinom{a}{k}\dbinom{b}{n-k}%
\]
(here, we have substituted $\left(  k,n-k\right)  $ for $\left(  i,j\right)  $
in the sum, since the map%
\begin{align*}
\left\{  0,1,\ldots,n\right\}   &  \rightarrow\left\{  \left(  i,j\right)
\in\mathbb{N}^{2}\ \mid\ i+j=n\right\}  ,\\
k  &  \mapsto\left(  k,n-k\right)
\end{align*}
is a bijection\footnote{In informal terms, this is just saying that each pair
$\left(  i,j\right)  \in\mathbb{N}^{2}$ of nonnegative integers satisfying
$i+j=n$ has the form $\left(  k,n-k\right)  $ for a unique $k\in\left\{
0,1,\ldots,n\right\}  $ (namely, for $k=i$), and conversely, any pair of the
latter form is a pair $\left(  i,j\right)  \in\mathbb{N}^{2}$ of nonnegative
integers satisfying $i+j=n$.}). This is precisely the equality
(\ref{pf.thm.binom.vanderRR.4th.goal}) (since the summation sign $\sum
_{k=0}^{n}$ is a synonym for $\sum_{k\in\left\{  0,1,\ldots,n\right\}  }$).
Thus, (\ref{pf.thm.binom.vanderRR.4th.goal}) holds. As we have said, this
proves Theorem \ref{thm.binom.vanderRR} in the case when $x,y\in\mathbb{N}$.
\end{proof}

The proof we just gave used polynomials, but not via the polynomial identity
trick. Instead, we obtained an equality between two polynomials (viz.,
(\ref{pf.thm.binom.vanderRR.4th.poleq})), and then compared coefficients
(i.e., argued that two equal polynomials have equal $n$-th coefficients). This
relies on the fact that any polynomial has a well-defined $n$-th coefficient
for each $n\in\mathbb{N}$, which does not depend on how the polynomial is
expressed. This is a versatile tactic, and we will later apply it to more
general objects than polynomials. But even when restricted to polynomials, it
is rather useful. Instead of proving Theorem \ref{thm.binom.vanderRR} again
and again, we can apply it to obtain a new equality:

\begin{exercise}
\label{exe.binom.genfun.minus-vd}\textbf{(a)} Prove that%
\[
\sum_{k=0}^{m}\left(  -1\right)  ^{k}\dbinom{n}{k}\dbinom{n}{m-k}=%
\begin{cases}
\left(  -1\right)  ^{m/2}\dbinom{n}{m/2}, & \text{if }m\text{ is even;}\\
0, & \text{if }m\text{ is odd}%
\end{cases}
\]
for any $n\in\mathbb{N}$ and any $m\in\mathbb{N}$.

\textbf{(b)} Prove that the claim of Exercise \ref{exe.binom.genfun.minus-vd}
\textbf{(a)} holds, more generally, for all $n\in\mathbb{R}$ (rather than only
for $n\in\mathbb{N}$).

\textbf{(c)} Conclude that every $n\in\mathbb{N}$ satisfies%
\[
\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n}{k}^{2}=%
\begin{cases}
\left(  -1\right)  ^{n/2}\dbinom{n}{n/2}, & \text{if }n\text{ is even;}\\
0, & \text{if }n\text{ is odd}%
\end{cases}
.
\]


[\textbf{Hint:} For part \textbf{(a)}, compare coefficients in the equality
$\left(  1-X\right)  ^{n}\cdot\left(  1+X\right)  ^{n}=\left(  1-X^{2}\right)
^{n}$ (expanded, once again, using the binomial formula). For part
\textbf{(b)}, apply the polynomial identity trick.]
\end{exercise}

Exercise \ref{exe.binom.genfun.minus-vd} \textbf{(c)}, in turn, can be used to
derive another binomial identity:

\begin{exercise}
\label{exe.binom.GM400}Let $n\in\mathbb{N}$. Prove that
\[
\sum_{k=0}^{n}\left(  -2\right)  ^{k}\dbinom{n}{k}\dbinom{2n-k}{n-k}=%
\begin{cases}
\left(  -1\right)  ^{n/2}\dbinom{n}{n/2}, & \text{if }n\text{ is even;}\\
0, & \text{if }n\text{ is odd}%
\end{cases}
.
\]

\end{exercise}

\subsection{\label{sect.binom.pie}The Principle of Inclusion and Exclusion}

We shall now come to an important tool for counting: the \emph{Principle of
Inclusion and Exclusion}. We shall first present this principle in four forms
(Theorem \ref{thm.pie.a-ik}, Theorem \ref{thm.pie.a}, Theorem \ref{thm.pie.b}
and Theorem \ref{thm.pie.bU}); then we will prove it in Subsection
\ref{subsect.binom.pie.pfs} (after proving a simple but important identity in
Subsection \ref{subsect.binom.pie.destr}, which will help in our proofs), and
show some applications in the remaining subsections.

\subsubsection{\label{subsect.binom.pie.thms}The principles}

We begin with some simple facts about unions and intersections of finite sets.

If $A_{1}$ and $A_{2}$ are two disjoint finite sets, then $\left\vert
A_{1}\cup A_{2}\right\vert =\left\vert A_{1}\right\vert +\left\vert
A_{2}\right\vert $. (This is just the equality (\ref{eq.thm.1.2.variant1-k=2}%
), with $X$ and $Y$ renamed as $A_{1}$ and $A_{2}$.) Is there a similar
formula for $\left\vert A_{1}\cup A_{2}\right\vert $ when $A_{1}$ and $A_{2}$
are not disjoint? Yes, if $\left\vert A_{1}\cap A_{2}\right\vert $ is known.
Namely,%
\begin{equation}
\left\vert A_{1}\cup A_{2}\right\vert =\left\vert A_{1}\right\vert +\left\vert
A_{2}\right\vert -\left\vert A_{1}\cap A_{2}\right\vert \label{eq.pie.n=2}%
\end{equation}
for any two finite sets $A_{1}$ and $A_{2}$. This is fairly easy to check. A
similar but more complicated formula holds for $3$ sets: namely,%
\begin{align}
\left\vert A_{1}\cup A_{2}\cup A_{3}\right\vert  &  =\left\vert A_{1}%
\right\vert +\left\vert A_{2}\right\vert +\left\vert A_{3}\right\vert
-\left\vert A_{1}\cap A_{2}\right\vert -\left\vert A_{1}\cap A_{3}\right\vert
-\left\vert A_{2}\cap A_{3}\right\vert \nonumber\\
&  \ \ \ \ \ \ \ \ \ \ +\left\vert A_{1}\cap A_{2}\cap A_{3}\right\vert
\label{eq.pie.n=3}%
\end{align}
for any three finite sets $A_{1}$, $A_{2}$ and $A_{3}$. A further formula of
the same kind holds for $4$ sets: namely,%
\begin{align}
&  \left\vert A_{1}\cup A_{2}\cup A_{3}\cup A_{4}\right\vert \nonumber\\
&  =\left\vert A_{1}\right\vert +\left\vert A_{2}\right\vert +\left\vert
A_{3}\right\vert +\left\vert A_{4}\right\vert \nonumber\\
&  \ \ \ \ \ \ \ \ \ \ -\left\vert A_{1}\cap A_{2}\right\vert -\left\vert
A_{1}\cap A_{3}\right\vert -\left\vert A_{1}\cap A_{4}\right\vert -\left\vert
A_{2}\cap A_{3}\right\vert -\left\vert A_{2}\cap A_{4}\right\vert -\left\vert
A_{3}\cap A_{4}\right\vert \nonumber\\
&  \ \ \ \ \ \ \ \ \ \ +\left\vert A_{1}\cap A_{2}\cap A_{3}\right\vert
+\left\vert A_{1}\cap A_{2}\cap A_{4}\right\vert +\left\vert A_{1}\cap
A_{3}\cap A_{4}\right\vert +\left\vert A_{2}\cap A_{3}\cap A_{4}\right\vert
\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ -\left\vert A_{1}\cap A_{2}\cap A_{3}\cap
A_{4}\right\vert \label{eq.pie.n=4}%
\end{align}
for any four finite sets $A_{1}$, $A_{2}$, $A_{3}$ and $A_{4}$. These three
formulas (along with the trivial formula $\left\vert A_{1}\right\vert
=\left\vert A_{1}\right\vert $ for a single set $A_{1}$) all are particular
cases of one general fact, which expresses the size of the union of $n$ finite
sets through the sizes of their intersections (more precisely, of the
intersection of each $k$ of these sets):

\begin{theorem}
[Principle of Inclusion and Exclusion (union form)]\label{thm.pie.a-ik}Let
$n\in\mathbb{N}$. Let $A_{1},A_{2},\ldots,A_{n}$ be $n$ finite sets. Then,%
\begin{align}
&  \left\vert A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right\vert \nonumber\\
&  =\sum_{m=1}^{n}\left(  -1\right)  ^{m-1}\sum_{\substack{\left(  i_{1}%
,i_{2},\ldots,i_{m}\right)  \in\left[  n\right]  ^{m};\\i_{1}<i_{2}%
<\cdots<i_{m}}}\left\vert A_{i_{1}}\cap A_{i_{2}}\cap\cdots\cap A_{i_{m}%
}\right\vert . \label{eq.thm.pie.a-ik.claim}%
\end{align}

\end{theorem}

The nested sum on the right hand side of (\ref{eq.thm.pie.a-ik.claim}) is
somewhat daunting, so let us write it out: It is%
\begin{align*}
&  \underbrace{\left\vert A_{1}\right\vert +\left\vert A_{2}\right\vert
+\cdots+\left\vert A_{n}\right\vert }_{\substack{\text{the sizes of all }%
A_{i}\\\text{(summed with }+\text{ signs)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \underbrace{-\left\vert A_{1}\cap A_{2}\right\vert
-\left\vert A_{1}\cap A_{3}\right\vert -\cdots-\left\vert A_{n-1}\cap
A_{n}\right\vert }_{\substack{\text{the sizes of all intersections }A_{i}\cap
A_{j}\text{ (with }i<j\text{)}\\\text{(summed with }-\text{ signs)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \underbrace{+\left\vert A_{1}\cap A_{2}\cap
A_{3}\right\vert +\left\vert A_{1}\cap A_{2}\cap A_{4}\right\vert
+\cdots+\left\vert A_{n-2}\cap A_{n-1}\cap A_{n}\right\vert }%
_{\substack{\text{the sizes of all intersections }A_{i}\cap A_{j}\cap
A_{k}\text{ (with }i<j<k\text{)}\\\text{(summed with }+\text{ signs)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \pm\cdots\\
&  \ \ \ \ \ \ \ \ \ \ +\underbrace{\left(  -1\right)  ^{n-1}\left\vert
A_{1}\cap A_{2}\cap\cdots\cap A_{n}\right\vert }_{\substack{\text{the size of
the intersection }A_{1}\cap A_{2}\cap\cdots\cap A_{n}\\\text{(summed with a
}+\text{ or }-\text{ sign depending on the parity of }n\text{)}}}.
\end{align*}
Thus, it is a sum that contains the sizes of all possible intersections of
some of the sets $A_{1},A_{2},\ldots,A_{n}$, each with a $+$ or $-$ sign
depending on how many sets are being intersected. Clearly, the right hand
sides of (\ref{eq.pie.n=2}), (\ref{eq.pie.n=3}) and (\ref{eq.pie.n=4}) are the
particular cases of this sum obtained for $n=2$, $n=3$ and $n=4$, respectively.

Theorem \ref{thm.pie.a-ik} is known as the \emph{Principle of Inclusion and
Exclusion} (often abbreviated \emph{PIE}) or the \emph{Sylvester sieve
formula}. We will not prove it right away, since this will become easier once
we have restated it in a more abstract form. This abstract form (which also
makes it more convenient to apply) relies on the following notation from set theory:

\begin{definition}
\label{def.bigcap}Let $I$ be a nonempty set. For each $i\in I$, let $A_{i}$ be
a set. Then, $\bigcap_{i\in I}A_{i}$ denotes the set%
\[
\left\{  x\ \mid\ x\in A_{i}\text{ for each }i\in I\right\}  .
\]
This set $\bigcap_{i\in I}A_{i}$ is called the intersection of all $A_{i}$
with $i\in I$.
\end{definition}

It is easy to see that if $I=\left\{  i_{1},i_{2},\ldots,i_{m}\right\}  $ is a
finite set, and if $A_{i}$ is a set for each $i\in I$, then%
\begin{equation}
\bigcap_{i\in I}A_{i}=A_{i_{1}}\cap A_{i_{2}}\cap\cdots\cap A_{i_{m}}.
\label{eq.bigcap.simple}%
\end{equation}


\begin{example}
Let $I=\left[  5\right]  $. For each $i\in I$, let $A_{i}=\left[
i-8,i\right]  =\left\{  i-8,i-7,\ldots,i-1,i\right\}  $ (where we are using
the notation from Definition \ref{def.int-interval}). Then,%
\begin{align*}
\bigcap_{i\in I}A_{i}  &  =\underbrace{A_{1}}_{\substack{=\left[
1-8,1\right]  \\=\left[  -7,1\right]  }}\cap\underbrace{A_{2}}%
_{\substack{=\left[  2-8,2\right]  \\=\left[  -6,2\right]  }}\cap
\underbrace{A_{3}}_{\substack{=\left[  3-8,3\right]  \\=\left[  -5,3\right]
}}\cap\underbrace{A_{4}}_{\substack{=\left[  4-8,4\right]  \\=\left[
-4,4\right]  }}\cap\underbrace{A_{5}}_{\substack{=\left[  5-8,5\right]
\\=\left[  -3,5\right]  }}\\
&  =\left[  -7,1\right]  \cap\left[  -6,2\right]  \cap\left[  -5,3\right]
\cap\left[  -4,4\right]  \cap\left[  -3,5\right] \\
&  =\left[  -3,1\right]  =\left\{  -3,-2,-1,0,1\right\}  .
\end{align*}

\end{example}

Note the similarity between the notation $\bigcap_{i\in I}A_{i}$ (for the
intersection of a family of sets) and the notation $\sum_{i\in I}a_{i}$ (for
the sum of a finite family of numbers). However, in the notation
$\bigcap_{i\in I}A_{i}$, the set $I$ must be nonempty (unlike in $\sum_{i\in
I}a_{i}$) but can be infinite (unlike in $\sum_{i\in I}a_{i}$, which is
usually undefined when $I$ is infinite).

We can now rewrite the right hand side of (\ref{eq.thm.pie.a-ik.claim}) as follows:

\begin{proposition}
\label{prop.pie.bigcap-rewritten}Let $n\in\mathbb{N}$. Let $A_{1},A_{2}%
,\ldots,A_{n}$ be $n$ finite sets. Then,%
\[
\sum_{m=1}^{n}\left(  -1\right)  ^{m-1}\sum_{\substack{\left(  i_{1}%
,i_{2},\ldots,i_{m}\right)  \in\left[  n\right]  ^{m};\\i_{1}<i_{2}%
<\cdots<i_{m}}}\left\vert A_{i_{1}}\cap A_{i_{2}}\cap\cdots\cap A_{i_{m}%
}\right\vert =\sum_{\substack{I\subseteq\left[  n\right]  ;\\I\neq\varnothing
}}\left(  -1\right)  ^{\left\vert I\right\vert -1}\left\vert \bigcap_{i\in
I}A_{i}\right\vert .
\]

\end{proposition}

\begin{example}
Set $n=3$ in Proposition \ref{prop.pie.bigcap-rewritten}. Then, the claim of
Proposition \ref{prop.pie.bigcap-rewritten} becomes%
\begin{align*}
&  \left(  -1\right)  ^{1-1}\left(  \left\vert A_{1}\right\vert +\left\vert
A_{2}\right\vert +\left\vert A_{3}\right\vert \right) \\
&  \ \ \ \ \ \ \ \ \ \ +\left(  -1\right)  ^{2-1}\left(  \left\vert A_{1}\cap
A_{2}\right\vert +\left\vert A_{1}\cap A_{3}\right\vert +\left\vert A_{2}\cap
A_{3}\right\vert \right) \\
&  \ \ \ \ \ \ \ \ \ \ +\left(  -1\right)  ^{3-1}\left\vert A_{1}\cap
A_{2}\cap A_{3}\right\vert \\
&  =\left(  -1\right)  ^{\left\vert \left\{  1\right\}  \right\vert
-1}\left\vert \bigcap_{i\in\left\{  1\right\}  }A_{i}\right\vert +\left(
-1\right)  ^{\left\vert \left\{  2\right\}  \right\vert -1}\left\vert
\bigcap_{i\in\left\{  2\right\}  }A_{i}\right\vert +\left(  -1\right)
^{\left\vert \left\{  3\right\}  \right\vert -1}\left\vert \bigcap
_{i\in\left\{  3\right\}  }A_{i}\right\vert \\
&  \ \ \ \ \ \ \ \ \ \ +\left(  -1\right)  ^{\left\vert \left\{  1,2\right\}
\right\vert -1}\left\vert \bigcap_{i\in\left\{  1,2\right\}  }A_{i}\right\vert
+\left(  -1\right)  ^{\left\vert \left\{  1,3\right\}  \right\vert
-1}\left\vert \bigcap_{i\in\left\{  1,3\right\}  }A_{i}\right\vert \\
&  \ \ \ \ \ \ \ \ \ \ +\left(  -1\right)  ^{\left\vert \left\{  2,3\right\}
\right\vert -1}\left\vert \bigcap_{i\in\left\{  2,3\right\}  }A_{i}\right\vert
+\left(  -1\right)  ^{\left\vert \left\{  1,2,3\right\}  \right\vert
-1}\left\vert \bigcap_{i\in\left\{  1,2,3\right\}  }A_{i}\right\vert
\end{align*}
(since the subsets $I$ of $\left[  n\right]  $ that satisfy $I\neq\varnothing$
are $\left\{  1\right\}  ,\left\{  2\right\}  ,\left\{  3\right\}  ,\left\{
1,2\right\}  ,\left\{  1,3\right\}  ,\left\{  2,3\right\}  ,\left\{
1,2,3\right\}  $). You can easily confirm this by checking that the addends on
the left hand side (after the parentheses are expanded) are precisely the
addends on the right hand side.
\end{example}

\begin{proof}
[Proof of Proposition \ref{prop.pie.bigcap-rewritten}.]We first claim the following:

\begin{statement}
\textit{Claim 1:} Let $m\in\left\{  1,2,\ldots,n\right\}  $. Then,%
\[
\sum_{\substack{\left(  i_{1},i_{2},\ldots,i_{m}\right)  \in\left[  n\right]
^{m};\\i_{1}<i_{2}<\cdots<i_{m}}}\left\vert A_{i_{1}}\cap A_{i_{2}}\cap
\cdots\cap A_{i_{m}}\right\vert =\sum_{\substack{I\subseteq\left[  n\right]
;\\I\neq\varnothing;\\\left\vert I\right\vert =m}}\left\vert \bigcap_{i\in
I}A_{i}\right\vert .
\]

\end{statement}

[\textit{Proof of Claim 1:} We have $m>0$ (since $m\in\left\{  1,2,\ldots
,n\right\}  $). Now, if $I$ is a subset of $\left[  n\right]  $ that satisfies
$\left\vert I\right\vert =m$, then it satisfies $I\neq\varnothing$ (since
$\left\vert I\right\vert =m>0$). Hence, the condition \textquotedblleft%
$I\neq\varnothing$\textquotedblright\ under the summation sign $\sum
_{\substack{I\subseteq\left[  n\right]  ;\\I\neq\varnothing;\\\left\vert
I\right\vert =m}}$ is redundant (i.e., the sum does not change if we remove
it). Thus,%
\begin{align}
\sum_{\substack{I\subseteq\left[  n\right]  ;\\I\neq\varnothing;\\\left\vert
I\right\vert =m}}\left\vert \bigcap_{i\in I}A_{i}\right\vert  &
=\sum_{\substack{I\subseteq\left[  n\right]  ;\\\left\vert I\right\vert
=m}}\left\vert \bigcap_{i\in I}A_{i}\right\vert \nonumber\\
&  =\sum_{I\in\left\{  m\text{-element subsets of }\left[  n\right]  \right\}
}\left\vert \bigcap_{i\in I}A_{i}\right\vert .
\label{pf.prop.pie.bigcap-rewritten.c1.pf.1}%
\end{align}


For any $m$-tuple $\left(  i_{1},i_{2},\ldots,i_{m}\right)  \in\left[
n\right]  ^{m}$ satisfying $i_{1}<i_{2}<\cdots<i_{m}$, the set $\left\{
i_{1},i_{2},\ldots,i_{m}\right\}  $ is an $m$-element subset of $\left[
n\right]  $\ \ \ \ \footnote{\textit{Proof.} Let $\left(  i_{1},i_{2}%
,\ldots,i_{m}\right)  \in\left[  n\right]  ^{m}$ be an $m$-tuple satisfying
$i_{1}<i_{2}<\cdots<i_{m}$. Thus, $i_{1},i_{2},\ldots,i_{m}\in\left[
n\right]  $; hence, $\left\{  i_{1},i_{2},\ldots,i_{m}\right\}  $ is a subset
of $\left[  n\right]  $. Moreover, the numbers $i_{1},i_{2},\ldots,i_{m}$ are
distinct (since $i_{1}<i_{2}<\cdots<i_{m}$), and thus the set $\left\{
i_{1},i_{2},\ldots,i_{m}\right\}  $ has $m$ elements. Hence, $\left\{
i_{1},i_{2},\ldots,i_{m}\right\}  $ is an $m$-element set. Therefore,
$\left\{  i_{1},i_{2},\ldots,i_{m}\right\}  $ is an $m$-element subset of
$\left[  n\right]  $.}. Thus, the map%
\begin{align*}
\left\{  \left(  i_{1},i_{2},\ldots,i_{m}\right)  \in\left[  n\right]
^{m}\ \mid\ i_{1}<i_{2}<\cdots<i_{m}\right\}   &  \rightarrow\left\{
m\text{-element subsets of }\left[  n\right]  \right\}  ,\\
\left(  i_{1},i_{2},\ldots,i_{m}\right)   &  \mapsto\left\{  i_{1}%
,i_{2},\ldots,i_{m}\right\}
\end{align*}
is well-defined. Moreover, this map is bijective\footnote{Indeed, this can
easily be derived from Proposition \ref{prop.intset.inclist-k}.}. Hence, we
can substitute $\left\{  i_{1},i_{2},\ldots,i_{m}\right\}  $ for $I$ in the
sum $\sum_{I\in\left\{  m\text{-element subsets of }\left[  n\right]
\right\}  }\left\vert \bigcap_{i\in I}A_{i}\right\vert $. We thus obtain%
\begin{align*}
\sum_{I\in\left\{  m\text{-element subsets of }\left[  n\right]  \right\}
}\left\vert \bigcap_{i\in I}A_{i}\right\vert  &  =\sum_{\substack{\left(
i_{1},i_{2},\ldots,i_{m}\right)  \in\left[  n\right]  ^{m};\\i_{1}%
<i_{2}<\cdots<i_{m}}}\left\vert \underbrace{\bigcap_{i\in\left\{  i_{1}%
,i_{2},\ldots,i_{m}\right\}  }A_{i}}_{\substack{=A_{i_{1}}\cap A_{i_{2}}%
\cap\cdots\cap A_{i_{m}}\\\text{(by (\ref{eq.bigcap.simple}))}}}\right\vert \\
&  =\sum_{\substack{\left(  i_{1},i_{2},\ldots,i_{m}\right)  \in\left[
n\right]  ^{m};\\i_{1}<i_{2}<\cdots<i_{m}}}\left\vert A_{i_{1}}\cap A_{i_{2}%
}\cap\cdots\cap A_{i_{m}}\right\vert .
\end{align*}
Hence, (\ref{pf.prop.pie.bigcap-rewritten.c1.pf.1}) becomes%
\[
\sum_{\substack{I\subseteq\left[  n\right]  ;\\I\neq\varnothing;\\\left\vert
I\right\vert =m}}\left\vert \bigcap_{i\in I}A_{i}\right\vert =\sum
_{I\in\left\{  m\text{-element subsets of }\left[  n\right]  \right\}
}\left\vert \bigcap_{i\in I}A_{i}\right\vert =\sum_{\substack{\left(
i_{1},i_{2},\ldots,i_{m}\right)  \in\left[  n\right]  ^{m};\\i_{1}%
<i_{2}<\cdots<i_{m}}}\left\vert A_{i_{1}}\cap A_{i_{2}}\cap\cdots\cap
A_{i_{m}}\right\vert .
\]
This proves Claim 1.]

Now, for any subset $I$ of $\left[  n\right]  $ satisfying $I\neq\varnothing$,
we have $\left\vert I\right\vert \in\left\{  1,2,\ldots,n\right\}
$\ \ \ \ \footnote{\textit{Proof.} Let $I$ be a subset of $\left[  n\right]  $
satisfying $I\neq\varnothing$. Then, Theorem \ref{thm.subset-leq} \textbf{(b)}
(applied to $A=\left[  n\right]  $ and $B=I$) yields $\left\vert I\right\vert
\leq\left\vert \left[  n\right]  \right\vert =n$. Also, $\left\vert
I\right\vert >0$ (since $I\neq\varnothing$) and thus $\left\vert I\right\vert
\geq1$. Combining this with $\left\vert I\right\vert \leq n$, we obtain
$\left\vert I\right\vert \in\left\{  1,2,\ldots,n\right\}  $, qed.}. Hence, an
application of (\ref{eq.sum.sheph}) yields%
\begin{align*}
\sum_{\substack{I\subseteq\left[  n\right]  ;\\I\neq\varnothing}}\left(
-1\right)  ^{\left\vert I\right\vert -1}\left\vert \bigcap_{i\in I}%
A_{i}\right\vert  &  =\sum_{m\in\left\{  1,2,\ldots,n\right\}  }%
\ \ \sum_{\substack{I\subseteq\left[  n\right]  ;\\I\neq\varnothing
;\\\left\vert I\right\vert =m}}\ \ \underbrace{\left(  -1\right)  ^{\left\vert
I\right\vert -1}}_{\substack{=\left(  -1\right)  ^{m-1}\\\text{(since
}\left\vert I\right\vert =m\text{)}}}\left\vert \bigcap_{i\in I}%
A_{i}\right\vert \\
&  =\sum_{m\in\left\{  1,2,\ldots,n\right\}  }\ \ \underbrace{\sum
_{\substack{I\subseteq\left[  n\right]  ;\\I\neq\varnothing;\\\left\vert
I\right\vert =m}}\left(  -1\right)  ^{m-1}\left\vert \bigcap_{i\in I}%
A_{i}\right\vert }_{=\left(  -1\right)  ^{m-1}\sum_{\substack{I\subseteq
\left[  n\right]  ;\\I\neq\varnothing;\\\left\vert I\right\vert =m}}\left\vert
\bigcap_{i\in I}A_{i}\right\vert }\\
&  =\sum_{m\in\left\{  1,2,\ldots,n\right\}  }\left(  -1\right)
^{m-1}\underbrace{\sum_{\substack{I\subseteq\left[  n\right]  ;\\I\neq
\varnothing;\\\left\vert I\right\vert =m}}\left\vert \bigcap_{i\in I}%
A_{i}\right\vert }_{\substack{=\sum_{\substack{\left(  i_{1},i_{2}%
,\ldots,i_{m}\right)  \in\left[  n\right]  ^{m};\\i_{1}<i_{2}<\cdots<i_{m}%
}}\left\vert A_{i_{1}}\cap A_{i_{2}}\cap\cdots\cap A_{i_{m}}\right\vert
\\\text{(by Claim 1)}}}\\
&  =\underbrace{\sum_{m\in\left\{  1,2,\ldots,n\right\}  }}_{=\sum_{m=1}^{n}%
}\left(  -1\right)  ^{m-1}\sum_{\substack{\left(  i_{1},i_{2},\ldots
,i_{m}\right)  \in\left[  n\right]  ^{m};\\i_{1}<i_{2}<\cdots<i_{m}%
}}\left\vert A_{i_{1}}\cap A_{i_{2}}\cap\cdots\cap A_{i_{m}}\right\vert \\
&  =\sum_{m=1}^{n}\left(  -1\right)  ^{m-1}\sum_{\substack{\left(  i_{1}%
,i_{2},\ldots,i_{m}\right)  \in\left[  n\right]  ^{m};\\i_{1}<i_{2}%
<\cdots<i_{m}}}\left\vert A_{i_{1}}\cap A_{i_{2}}\cap\cdots\cap A_{i_{m}%
}\right\vert .
\end{align*}
This proves Proposition \ref{prop.pie.bigcap-rewritten}.
\end{proof}

We can now restate Theorem \ref{thm.pie.a} as follows:

\Needspace{5pc}

\begin{theorem}
[Principle of Inclusion and Exclusion (union form)]\label{thm.pie.a}Let
$n\in\mathbb{N}$. Let $A_{1},A_{2},\ldots,A_{n}$ be $n$ finite sets. Then,%
\begin{equation}
\left\vert A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right\vert =\sum
_{\substack{I\subseteq\left[  n\right]  ;\\I\neq\varnothing}}\left(
-1\right)  ^{\left\vert I\right\vert -1}\left\vert \bigcap_{i\in I}%
A_{i}\right\vert . \label{eq.thm.pie.a.claim}%
\end{equation}

\end{theorem}

We will soon prove Theorem \ref{thm.pie.a} (and thus conclude Theorem
\ref{thm.pie.a-ik} from it). First, let us state yet another equivalent
version of this principle:

\begin{theorem}
[Principle of Inclusion and Exclusion (complement form)]\label{thm.pie.b}Let
$n\in\mathbb{N}$. Let $U$ be a finite set. Let $A_{1},A_{2},\ldots,A_{n}$ be
$n$ subsets of $U$. Then,%
\begin{equation}
\left\vert U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right)
\right\vert =\sum_{I\subseteq\left[  n\right]  }\left(  -1\right)
^{\left\vert I\right\vert }\left\vert \bigcap_{i\in I}A_{i}\right\vert .
\label{eq.thm.pie.b.claim}%
\end{equation}
Here, the \textquotedblleft empty\textquotedblright\ intersection
$\bigcap_{i\in\varnothing}A_{i}$ is understood to mean the set $U$.
\end{theorem}

\begin{example}
Let $U$ be a finite set, and let $A_{1}$ and $A_{2}$ be two subsets of $U$.
Then, Theorem \ref{thm.pie.b} (applied to $n=2$) says that%
\begin{align*}
\left\vert U\setminus\left(  A_{1}\cup A_{2}\right)  \right\vert  &
=\sum_{I\subseteq\left[  2\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\left\vert \bigcap_{i\in I}A_{i}\right\vert \\
&  =\underbrace{\left(  -1\right)  ^{\left\vert \varnothing\right\vert }}%
_{=1}\left\vert \underbrace{\bigcap_{i\in\varnothing}A_{i}}%
_{\substack{=U\\\text{(by definition)}}}\right\vert +\underbrace{\left(
-1\right)  ^{\left\vert \left\{  1\right\}  \right\vert }}_{=-1}\left\vert
\underbrace{\bigcap_{i\in\left\{  1\right\}  }A_{i}}_{=A_{1}}\right\vert \\
&  \ \ \ \ \ \ \ \ \ \ +\underbrace{\left(  -1\right)  ^{\left\vert \left\{
2\right\}  \right\vert }}_{=-1}\left\vert \underbrace{\bigcap_{i\in\left\{
2\right\}  }A_{i}}_{=A_{2}}\right\vert +\underbrace{\left(  -1\right)
^{\left\vert \left\{  1,2\right\}  \right\vert }}_{=1}\left\vert
\underbrace{\bigcap_{i\in\left\{  1,2\right\}  }A_{i}}_{=A_{1}\cap A_{2}%
}\right\vert \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since the subsets of }\left[  2\right]
\text{ are }\varnothing,\left\{  1\right\}  ,\left\{  2\right\}  ,\left\{
1,2\right\}  \right) \\
&  =\left\vert U\right\vert +\left(  -1\right)  \left\vert A_{1}\right\vert
+\left(  -1\right)  \left\vert A_{2}\right\vert +\left\vert A_{1}\cap
A_{2}\right\vert \\
&  =\left\vert U\right\vert -\left\vert A_{1}\right\vert -\left\vert
A_{2}\right\vert +\left\vert A_{1}\cap A_{2}\right\vert .
\end{align*}

\end{example}

A remark is in order here. In Definition \ref{def.bigcap}, we have defined
$\bigcap_{i\in I}A_{i}$ for any \textbf{nonempty} set $I$. This definition
cannot be extended to the case when $I=\varnothing$, because it would entail
that $\bigcap_{i\in\varnothing}A_{i}$ should be the set of \textbf{all}
objects whatsoever, but there is no such set\footnote{See \cite[\S 8.3]%
{LeLeMe16} for an explanation.}. However, in order for the right hand side of
(\ref{eq.thm.pie.b.claim}) to make sense, we need a well-defined set
$\bigcap_{i\in I}A_{i}$ for all $I\subseteq\left[  n\right]  $, including
$I=\varnothing$. Thus, we need to define $\bigcap_{i\in\varnothing}A_{i}$
somehow. It turns out that defining $\bigcap_{i\in\varnothing}A_{i}$ to be $U$
is the right thing to do (in this particular situation). It is justified here,
because all of the sets involved are subsets of $U$, so \textquotedblleft all
objects\textquotedblright\ can be interpreted as \textquotedblleft all
elements of $U$\textquotedblright\ (and then the set of all objects really
becomes $U$). This is, by the way, the reason why we chose the letter $U$ in
Theorem \ref{thm.pie.b}; it stands for \textquotedblleft
universe\textquotedblright.

Finally, let us restate Theorem \ref{thm.pie.b} in an equivalent form that is
slightly easier to actually use, because it shuns the notation $\bigcap_{i\in
I}A_{i}$ (and thus avoids having to define it separately for $I=\varnothing$):

\begin{theorem}
[Principle of Inclusion and Exclusion (complement form, simplified)]%
\label{thm.pie.bU}Let $n\in\mathbb{N}$. Let $U$ be a finite set. Let
$A_{1},A_{2},\ldots,A_{n}$ be $n$ subsets of $U$. Then,%
\[
\left\vert U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right)
\right\vert =\sum_{I\subseteq\left[  n\right]  }\left(  -1\right)
^{\left\vert I\right\vert }\left\vert \left\{  s\in U\ \mid\ s\in A_{i}\text{
for all }i\in I\right\}  \right\vert .
\]

\end{theorem}

Note that the addend corresponding to $I=\varnothing$ on the right hand side
of this equality is simply $\left\vert U\right\vert $%
\ \ \ \ \footnote{\textit{Proof.} This addend is%
\[
\underbrace{\left(  -1\right)  ^{\left\vert \varnothing\right\vert }}%
_{=1}\left\vert \underbrace{\left\{  s\in U\ \mid\ s\in A_{i}\text{ for all
}i\in\varnothing\right\}  }_{\substack{=\left\{  s\in U\right\}
\\\text{(because each }s\in U\text{ satisfies }\left(  s\in A_{i}\text{ for
all }i\in\varnothing\right)  \\\text{(indeed, this is vacuously true, since
there exists no }i\in\varnothing\text{))}}}\right\vert =\left\vert
\underbrace{\left\{  s\in U\right\}  }_{=U}\right\vert =\left\vert
U\right\vert .
\]
}.

\subsubsection{\label{subsect.binom.pie.destr}The cancellation lemma}

We have now stated the Principle of Inclusion and Exclusion in four forms
(Theorem \ref{thm.pie.a-ik}, Theorem \ref{thm.pie.a}, Theorem \ref{thm.pie.b}
and Theorem \ref{thm.pie.bU}). Soon we shall prove them. First, we state a
crucial theorem that will serve as an auxiliary tool in the proofs:

\begin{proposition}
\label{prop.DIE.destruct1}Let $S$ be a finite set. Then,%
\[
\sum_{I\subseteq S}\left(  -1\right)  ^{\left\vert I\right\vert }=\left[
S=\varnothing\right]  .
\]

\end{proposition}

Once again, we are using the Iverson bracket notation here (see Definition
\ref{def.iverson}).

\begin{example}
The subsets of $\left\{  1,2\right\}  $ are $\varnothing$, $\left\{
1\right\}  $, $\left\{  2\right\}  $ and $\left\{  1,2\right\}  $. Thus,
applying Proposition \ref{prop.DIE.destruct1} to $S=\left\{  1,2\right\}  $,
we find
\[
\underbrace{\left(  -1\right)  ^{\left\vert \varnothing\right\vert }}%
_{=1}+\underbrace{\left(  -1\right)  ^{\left\vert \left\{  1\right\}
\right\vert }}_{=-1}+\underbrace{\left(  -1\right)  ^{\left\vert \left\{
2\right\}  \right\vert }}_{=-1}+\underbrace{\left(  -1\right)  ^{\left\vert
\left\{  1,2\right\}  \right\vert }}_{=1}=\left[  \left\{  1,2\right\}
=\varnothing\right]  .
\]
Indeed, both sides of this equality are $0$ (the left hand side because the
addends cancel; the right hand side because $\left\{  1,2\right\}
\neq\varnothing$).
\end{example}

\begin{proof}
[First proof of Proposition \ref{prop.DIE.destruct1}.]This will be similar to
the proof of Theorem \ref{thm.subsets.2pown} that we gave in Subsection
\ref{subsect.intro.count.subsets}.

We have $S=\varnothing$ if and only if $\left\vert S\right\vert =0$. In other
words, \textquotedblleft$S=\varnothing$\textquotedblright\ and
\textquotedblleft$\left\vert S\right\vert =0$\textquotedblright\ are two
equivalent logical statements. Hence, Exercise \ref{exe.iverson-prop}
\textbf{(a)} (applied to $\mathcal{A}=\left(  \text{\textquotedblleft%
}S=\varnothing\text{\textquotedblright}\right)  $ and $\mathcal{B}=\left(
\text{\textquotedblleft}\left\vert S\right\vert =0\text{\textquotedblright%
}\right)  $) yields $\left[  S=\varnothing\right]  =\left[  \left\vert
S\right\vert =0\right]  $.

Let $n=\left\vert S\right\vert $. Hence, $S$ is an $n$-element set. If $I$ is
any subset of $S$, then Theorem \ref{thm.subset-leq} \textbf{(b)} (applied to
$A=S$ and $B=I$) yields $\left\vert I\right\vert \leq\left\vert S\right\vert
=n$ and therefore $\left\vert I\right\vert \in\left\{  0,1,\ldots,n\right\}
$. Hence, an application of (\ref{eq.sum.sheph}) yields%
\begin{align*}
&  \sum_{I\subseteq S}\left(  -1\right)  ^{\left\vert I\right\vert }\\
&  =\sum_{k\in\left\{  0,1,\ldots,n\right\}  }\ \ \sum_{\substack{I\subseteq
S;\\\left\vert I\right\vert =k}}\underbrace{\left(  -1\right)  ^{\left\vert
I\right\vert }}_{\substack{=\left(  -1\right)  ^{k}\\\text{(since }\left\vert
I\right\vert =k\text{)}}}=\sum_{k\in\left\{  0,1,\ldots,n\right\}
}\underbrace{\sum_{\substack{I\subseteq S;\\\left\vert I\right\vert
=k}}\left(  -1\right)  ^{k}}_{=\left(  \text{\# of subsets }I\text{ of
}S\text{ satisfying }\left\vert I\right\vert =k\right)  \cdot\left(
-1\right)  ^{k}}\\
&  =\underbrace{\sum_{k\in\left\{  0,1,\ldots,n\right\}  }}_{=\sum_{k=0}^{n}%
}\underbrace{\left(  \text{\# of subsets }I\text{ of }S\text{ satisfying
}\left\vert I\right\vert =k\right)  }_{\substack{=\left(  \text{\# of
}k\text{-element subsets of }S\right)  \\=\dbinom{n}{k}\\\text{(by Theorem
\ref{thm.binom.comb})}}}\cdot\left(  -1\right)  ^{k}\\
&  =\sum_{k=0}^{n}\dbinom{n}{k}\left(  -1\right)  ^{k}=\sum_{k=0}^{n}\left(
-1\right)  ^{k}\dbinom{n}{k}=\left[  n=0\right]  \ \ \ \ \ \ \ \ \ \ \left(
\text{by Proposition \ref{prop.binom.sum-alt-row}}\right) \\
&  =\left[  \left\vert S\right\vert =0\right]  \ \ \ \ \ \ \ \ \ \ \left(
\text{since }n=\left\vert S\right\vert \right) \\
&  =\left[  S=\varnothing\right]  \ \ \ \ \ \ \ \ \ \ \left(  \text{since
}\left[  S=\varnothing\right]  =\left[  \left\vert S\right\vert =0\right]
\right)  .
\end{align*}
This proves Proposition \ref{prop.DIE.destruct1}.
\end{proof}

\begin{proof}
[Second proof of Proposition \ref{prop.DIE.destruct1}.]If $S=\varnothing$,
then Proposition \ref{prop.DIE.destruct1} holds\footnote{\textit{Proof.}
Assume that $S=\varnothing$. Thus, there exists exactly one subset of $S$,
namely the empty set $\varnothing$. Hence, the sum $\sum_{I\subseteq S}\left(
-1\right)  ^{\left\vert I\right\vert }$ has exactly one addend, namely the
addend for $I=\varnothing$. Thus, this sum simplifies as follows:%
\[
\sum_{I\subseteq S}\left(  -1\right)  ^{\left\vert I\right\vert }=\left(
-1\right)  ^{\left\vert \varnothing\right\vert }=1\ \ \ \ \ \ \ \ \ \ \left(
\text{since }\left\vert \varnothing\right\vert =0\text{ is even}\right)  .
\]
Comparing this with%
\[
\left[  S=\varnothing\right]  =1\ \ \ \ \ \ \ \ \ \ \left(  \text{since
}S=\varnothing\right)  ,
\]
we obtain $\sum_{I\subseteq S}\left(  -1\right)  ^{\left\vert I\right\vert
}=\left[  S=\varnothing\right]  $. Hence, Proposition \ref{prop.DIE.destruct1}
is proven under the assumption that $S=\varnothing$.}. Hence, for the rest of
this proof, we WLOG assume that we don't have $S=\varnothing$. Thus,
$S\neq\varnothing$. Hence, there exists some $g\in S$. Consider this $g$. (We
can have many choices for $g$, but we just pick one.)

Each subset $I$ of $S$ must satisfy either $g\in I$ or $g\notin I$ (but not
both at the same time). Hence, we can split the sum $\sum_{I\subseteq
S}\left(  -1\right)  ^{\left\vert I\right\vert }$ as follows:%
\begin{equation}
\sum_{I\subseteq S}\left(  -1\right)  ^{\left\vert I\right\vert }%
=\sum_{\substack{I\subseteq S;\\g\in I}}\left(  -1\right)  ^{\left\vert
I\right\vert }+\sum_{\substack{I\subseteq S;\\g\notin I}}\left(  -1\right)
^{\left\vert I\right\vert }. \label{pf.prop.DIE.destruct1.2nd.1}%
\end{equation}
We shall now \textquotedblleft set the two sums on the right hand side up to
fight each other\textquotedblright.

Each subset $J$ of $S$ satisfies $J\cup\left\{  g\right\}  \subseteq S$
(because $g\in S$) and $g\in J\cup\left\{  g\right\}  $ (obviously). Thus, the
map\footnote{The notation \textquotedblleft$\left\{  I\subseteq S\ \mid
\ g\notin I\right\}  $\textquotedblright\ means \textquotedblleft the set of
all subsets $I$ of $S$ satisfying $g\notin I$\textquotedblright. Similarly,
the notation \textquotedblleft$\left\{  I\subseteq S\ \mid\ g\in I\right\}
$\textquotedblright\ means \textquotedblleft the set of all subsets $I$ of $S$
satisfying $g\in I$\textquotedblright.}%
\begin{align*}
\left\{  I\subseteq S\ \mid\ g\notin I\right\}   &  \rightarrow\left\{
I\subseteq S\ \mid\ g\in I\right\}  ,\\
J  &  \mapsto J\cup\left\{  g\right\}
\end{align*}
is well-defined. The map%
\begin{align*}
\left\{  I\subseteq S\ \mid\ g\in I\right\}   &  \rightarrow\left\{
I\subseteq S\ \mid\ g\notin I\right\}  ,\\
K  &  \mapsto K\setminus\left\{  g\right\}
\end{align*}
is also well-defined. These two maps are mutually inverse\footnote{because of
the following two (easily proven) facts:
\par
\begin{itemize}
\item Every subset $J$ of $S$ satisfying $g\notin J$ must satisfy $\left(
J\cup\left\{  g\right\}  \right)  \setminus\left\{  g\right\}  =J$.
\par
\item Every subset $K$ of $S$ satisfying $g\in K$ must satisfy $\left(
K\setminus\left\{  g\right\}  \right)  \cup\left\{  g\right\}  =K$.
\end{itemize}
}, and thus are bijections. Hence, in particular, the map%
\begin{align*}
\left\{  I\subseteq S\ \mid\ g\notin I\right\}   &  \rightarrow\left\{
I\subseteq S\ \mid\ g\in I\right\}  ,\\
J  &  \mapsto J\cup\left\{  g\right\}
\end{align*}
is a bijection. Thus, we can substitute $J\cup\left\{  g\right\}  $ for $I$ in
the sum $\sum_{\substack{I\subseteq S;\\g\in I}}\left(  -1\right)
^{\left\vert I\right\vert }$. We thus obtain%
\begin{align}
\sum_{\substack{I\subseteq S;\\g\in I}}\left(  -1\right)  ^{\left\vert
I\right\vert }  &  =\sum_{\substack{J\subseteq S;\\g\notin J}%
}\underbrace{\left(  -1\right)  ^{\left\vert J\cup\left\{  g\right\}
\right\vert }}_{\substack{=\left(  -1\right)  ^{\left\vert J\right\vert
+1}\\\text{(since }\left\vert J\cup\left\{  g\right\}  \right\vert =\left\vert
J\right\vert +1\\\text{(because }g\notin J\text{))}}}=\sum
_{\substack{J\subseteq S;\\g\notin J}}\underbrace{\left(  -1\right)
^{\left\vert J\right\vert +1}}_{=-\left(  -1\right)  ^{\left\vert J\right\vert
}}=-\sum_{\substack{J\subseteq S;\\g\notin J}}\left(  -1\right)  ^{\left\vert
J\right\vert }\nonumber\\
&  =-\sum_{\substack{I\subseteq S;\\g\notin I}}\left(  -1\right)  ^{\left\vert
I\right\vert } \label{pf.prop.DIE.destruct1.1}%
\end{align}
(here, we have renamed the summation index $J$ as $I$).

Now, (\ref{pf.prop.DIE.destruct1.2nd.1}) becomes%
\[
\sum_{I\subseteq S}\left(  -1\right)  ^{\left\vert I\right\vert }%
=\underbrace{\sum_{\substack{I\subseteq S;\\g\in I}}\left(  -1\right)
^{\left\vert I\right\vert }}_{\substack{=-\sum_{\substack{I\subseteq
S;\\g\notin I}}\left(  -1\right)  ^{\left\vert I\right\vert }\\\text{(by
(\ref{pf.prop.DIE.destruct1.1}))}}}+\sum_{\substack{I\subseteq S;\\g\notin
I}}\left(  -1\right)  ^{\left\vert I\right\vert }=-\sum_{\substack{I\subseteq
S;\\g\notin I}}\left(  -1\right)  ^{\left\vert I\right\vert }+\sum
_{\substack{I\subseteq S;\\g\notin I}}\left(  -1\right)  ^{\left\vert
I\right\vert }=0.
\]
Comparing this with%
\[
\left[  S=\varnothing\right]  =0\ \ \ \ \ \ \ \ \ \ \left(  \text{since }%
S\neq\varnothing\right)  ,
\]
we obtain $\sum_{I\subseteq S}\left(  -1\right)  ^{\left\vert I\right\vert
}=\left[  S=\varnothing\right]  $. This proves Proposition
\ref{prop.DIE.destruct1}.
\end{proof}

We note that there is a generalization of Proposition \ref{prop.DIE.destruct1}%
, which we will not use anytime soon but which is nevertheless rather useful:

\begin{proposition}
\label{prop.DIE.destruct2}Let $S$ be a finite set. Let $T$ be a subset of $S$.
Then,%
\[
\sum_{\substack{I\subseteq S;\\T\subseteq I}}\left(  -1\right)  ^{\left\vert
I\right\vert }=\left(  -1\right)  ^{\left\vert T\right\vert }\left[
S=T\right]  .
\]

\end{proposition}

\begin{exercise}
\label{exe.DIE.destruct1}Prove Proposition \ref{prop.DIE.destruct2}.
\end{exercise}

Clearly, Proposition \ref{prop.DIE.destruct1} is the particular case of
Proposition \ref{prop.DIE.destruct2} when $T=\varnothing$ (since every subset
$I$ of $S$ satisfies $\varnothing\subseteq I$).

\subsubsection{\label{subsect.binom.pie.pfs}The proofs}

\begin{center}
\fbox{\textbf{Class of 2019-11-01}}
\end{center}

We are now ready to prove the Principle of Inclusion and Exclusion in all its
forms. We begin with Theorem \ref{thm.pie.bU}:

\begin{proof}
[Proof of Theorem \ref{thm.pie.bU}.]We shall use the Iverson bracket notation
(see Definition \ref{def.iverson}).

Here is the plan: We will approach the sum
\begin{equation}
\sum_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\left\vert \left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in
I\right\}  \right\vert \label{pf.thm.pie.bU.plan-sum}%
\end{equation}
by looking at each particular $s\in U$ and computing how often $s$ is
\textquotedblleft counted\textquotedblright\ in this sum. In other words,
instead of computing (\ref{pf.thm.pie.bU.plan-sum}) directly, we shall compute
the sum $\sum_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\left[  s\in A_{i}\text{ for all }i\in I\right]  $ for a single
$s\in U$ first. Then, we will sum it over all $s\in U$, and obtain
(\ref{pf.thm.pie.bU.plan-sum}), because of Proposition
\ref{prop.count.rollcall} \textbf{(b)}.

Here are the details: Fix $s\in U$. Define a subset $S$ of $\left[  n\right]
$ by
\[
S=\left\{  i\in\left[  n\right]  \ \mid\ s\in A_{i}\right\}  .
\]
Thus, $S$ is the set of all $i\in\left[  n\right]  $ such that $s\in A_{i}$.
Hence, $S=\varnothing$ holds if and only if there exists no $i\in\left[
n\right]  $ such that $s\in A_{i}$. Thus, we have the following chain of
logical equivalences:%
\begin{align*}
\left(  S=\varnothing\right)  \  &  \Longleftrightarrow\ \left(  \text{there
exists no }i\in\left[  n\right]  \text{ such that }s\in A_{i}\right) \\
&  \Longleftrightarrow\ \left(  \text{we have }s\notin A_{i}\text{ for all
}i\in\left[  n\right]  \right) \\
&  \Longleftrightarrow\ \left(  s\notin A_{1}\cup A_{2}\cup\cdots\cup
A_{n}\right) \\
&  \Longleftrightarrow\ \left(  s\in U\setminus\left(  A_{1}\cup A_{2}%
\cup\cdots\cup A_{n}\right)  \right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{since
}s\in U\right)  .
\end{align*}
Thus, \textquotedblleft$S=\varnothing$\textquotedblright\ and
\textquotedblleft$s\in U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup
A_{n}\right)  $\textquotedblright\ are two equivalent logical statements.
Hence, Exercise \ref{exe.iverson-prop} \textbf{(a)} (applied to $\mathcal{A}%
=\left(  \text{\textquotedblleft}S=\varnothing\text{\textquotedblright%
}\right)  $ and \newline$\mathcal{B}=\left(  \text{\textquotedblleft}s\in
U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right)
\text{\textquotedblright}\right)  $) yields
\begin{equation}
\left[  S=\varnothing\right]  =\left[  s\in U\setminus\left(  A_{1}\cup
A_{2}\cup\cdots\cup A_{n}\right)  \right]  . \label{pf.thm.pie.b.S=nothing=}%
\end{equation}


On the other hand, let $I$ be any subset of $\left[  n\right]  $. Then, we
have the following chain of logical equivalences:%
\begin{align*}
&  \left(  s\in A_{i}\text{ for each }i\in I\right) \\
\Longleftrightarrow\  &  \left(  i\in S\text{ for each }i\in I\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{because for any given }i\in I\text{, the statement \textquotedblleft%
}s\in A_{i}\text{\textquotedblright}\\
\text{is equivalent to \textquotedblleft}i\in S\text{\textquotedblright\ (by
the definition of }S\text{)}%
\end{array}
\right) \\
\Longleftrightarrow\  &  \left(  I\subseteq S\right)  .
\end{align*}
Thus, \textquotedblleft$s\in A_{i}$ for each $i\in I$\textquotedblright\ and
\textquotedblleft$I\subseteq S$\textquotedblright\ are two equivalent logical
statements. Consequently, Exercise \ref{exe.iverson-prop} \textbf{(a)}
(applied to $\mathcal{A}=\left(  \text{\textquotedblleft}s\in A_{i}\text{ for
each }i\in I\text{\textquotedblright}\right)  $ and $\mathcal{B}=\left(
\text{\textquotedblleft}I\subseteq S\text{\textquotedblright}\right)  $)
yields%
\begin{equation}
\left[  s\in A_{i}\text{ for each }i\in I\right]  =\left[  I\subseteq
S\right]  . \label{pf.thm.pie.b.xincap}%
\end{equation}


Forget that we fixed $I$. We thus have proved (\ref{pf.thm.pie.b.xincap}) for
each subset $I$ of $\left[  n\right]  $.

Now,
\begin{align}
&  \sum_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\underbrace{\left[  s\in A_{i}\text{ for each }i\in I\right]
}_{\substack{=\left[  I\subseteq S\right]  \\\text{(by
(\ref{pf.thm.pie.b.xincap}))}}}\nonumber\\
&  =\sum_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\left[  I\subseteq S\right] \nonumber\\
&  =\underbrace{\sum_{\substack{I\subseteq\left[  n\right]  ;\\I\subseteq S}%
}}_{\substack{=\sum_{I\subseteq S}\\\text{(since }S\subseteq\left[  n\right]
\text{,}\\\text{and thus any subset }I\text{ of }S\\\text{is a subset of
}\left[  n\right]  \text{)}}}\left(  -1\right)  ^{\left\vert I\right\vert
}\underbrace{\left[  I\subseteq S\right]  }_{\substack{=1\\\text{(since
}I\subseteq S\text{)}}}+\sum_{\substack{I\subseteq\left[  n\right]
;\\\text{not }I\subseteq S}}\left(  -1\right)  ^{\left\vert I\right\vert
}\underbrace{\left[  I\subseteq S\right]  }_{\substack{=0\\\text{(since we
don't have }I\subseteq S\text{)}}}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{since each subset
}I\text{ of }\left[  n\right]  \text{ satisfies either }I\subseteq S\text{ or
not }I\subseteq S\right) \nonumber\\
&  =\sum_{I\subseteq S}\left(  -1\right)  ^{\left\vert I\right\vert
}+\underbrace{\sum_{\substack{I\subseteq\left[  n\right]  ;\\\text{not
}I\subseteq S}}\left(  -1\right)  ^{\left\vert I\right\vert }0}_{=0}%
=\sum_{I\subseteq S}\left(  -1\right)  ^{\left\vert I\right\vert }=\left[
S=\varnothing\right]  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.DIE.destruct1}}\right) \nonumber\\
&  =\left[  s\in U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right)
\right]  \label{pf.thm.pie.b.xsum}%
\end{align}
(by (\ref{pf.thm.pie.b.S=nothing=})).

Forget that we fixed $s$. We thus have proved (\ref{pf.thm.pie.b.xsum}) for
each $s\in U$. Now, if $I$ is any subset of $\left[  n\right]  $, then
\begin{align}
&  \left\vert \left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\}
\right\vert \nonumber\\
&  =\left(  \text{\# of }s\in U\text{ that satisfy }\left(  s\in A_{i}\text{
for all }i\in I\right)  \right) \nonumber\\
&  =\sum_{s\in U}\left[  s\in A_{i}\text{ for all }i\in I\right]
\label{pf.thm.pie.b.sizecapAi}%
\end{align}
(by Proposition \ref{prop.count.rollcall} \textbf{(b)}, applied to $S=U$ and
$\mathcal{A}\left(  s\right)  =\left(  \text{\textquotedblleft}s\in
A_{i}\text{ for all }i\in I\text{\textquotedblright}\right)  $). Hence,
\begin{align*}
&  \sum_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\underbrace{\left\vert \left\{  s\in U\ \mid\ s\in A_{i}\text{
for all }i\in I\right\}  \right\vert }_{\substack{=\sum_{s\in U}\left[  s\in
A_{i}\text{ for all }i\in I\right]  \\\text{(by (\ref{pf.thm.pie.b.sizecapAi}%
))}}}\\
&  =\sum_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\sum_{s\in U}\left[  s\in A_{i}\text{ for all }i\in I\right]
=\underbrace{\sum_{I\subseteq\left[  n\right]  }\ \ \sum_{s\in U}}%
_{=\sum_{s\in U}\ \ \sum_{I\subseteq\left[  n\right]  }}\left(  -1\right)
^{\left\vert I\right\vert }\left[  s\in A_{i}\text{ for all }i\in I\right] \\
&  =\sum_{s\in U}\ \ \underbrace{\sum_{I\subseteq\left[  n\right]  }\left(
-1\right)  ^{\left\vert I\right\vert }\left[  s\in A_{i}\text{ for all }i\in
I\right]  }_{\substack{=\left[  s\in U\setminus\left(  A_{1}\cup A_{2}%
\cup\cdots\cup A_{n}\right)  \right]  \\\text{(by (\ref{pf.thm.pie.b.xsum}))}%
}}=\sum_{s\in U}\left[  s\in U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup
A_{n}\right)  \right]  .
\end{align*}
On the other hand, Proposition \ref{prop.count.rollcall} \textbf{(a)} (applied
to $U$ and $U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right)  $
instead of $S$ and $T$) yields%
\[
\left\vert U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right)
\right\vert =\sum_{s\in U}\left[  s\in U\setminus\left(  A_{1}\cup A_{2}%
\cup\cdots\cup A_{n}\right)  \right]  .
\]
Comparing these two equalities, we obtain%
\[
\left\vert U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right)
\right\vert =\sum_{I\subseteq\left[  n\right]  }\left(  -1\right)
^{\left\vert I\right\vert }\left\vert \left\{  s\in U\ \mid\ s\in A_{i}\text{
for all }i\in I\right\}  \right\vert .
\]
This proves Theorem \ref{thm.pie.bU}.
\end{proof}

Let us next derive Theorem \ref{thm.pie.b} from Theorem \ref{thm.pie.bU}:

\begin{proof}
[Proof of Theorem \ref{thm.pie.b}.]In order to derive this from Theorem
\ref{thm.pie.bU}, we need to show the following fact:

\begin{statement}
\textit{Statement 1:} Let $I$ be a subset of $\left[  n\right]  $. Then,%
\[
\bigcap_{i\in I}A_{i}=\left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in
I\right\}  .
\]

\end{statement}

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

\textit{Case 1:} We have $I=\varnothing$.

\textit{Case 2:} We have $I\neq\varnothing$.

Let us first consider Case 1. In this case, we have $I=\varnothing$. Hence,
$\bigcap_{i\in I}A_{i}=\bigcap_{i\in\varnothing}A_{i}=U$ (since we defined
$\bigcap_{i\in\varnothing}A_{i}$ to be $U$ in Theorem \ref{thm.pie.b}).
Comparing this with%
\begin{align*}
&  \left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\} \\
&  =\left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in\varnothing\right\}
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }I=\varnothing\right) \\
&  =\left\{  s\in U\right\}  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since each }s\in U\text{ satisfies }\left(  s\in A_{i}\text{ for all
}i\in\varnothing\right) \\
\text{(indeed, this is vacuously true, since there exists no }i\in
\varnothing\text{)}%
\end{array}
\right) \\
&  =U,
\end{align*}
we obtain $\bigcap_{i\in I}A_{i}=\left\{  s\in U\ \mid\ s\in A_{i}\text{ for
all }i\in I\right\}  $. Thus, Statement 1 is proved in Case 1.

Let us next consider Case 2. In this case, we have $I\neq\varnothing$. Thus,
the set $I$ is nonempty. Hence, the definition of $\bigcap_{i\in I}A_{i}$
yields%
\[
\bigcap_{i\in I}A_{i}=\left\{  x\ \mid\ x\in A_{i}\text{ for each }i\in
I\right\}  .
\]
But $I$ is nonempty; thus, there exists some $j\in I$. Consider this $j$. From
$j\in I$, we obtain $\bigcap_{i\in I}A_{i}\subseteq A_{j}$ (since the
intersection of a family of sets is clearly contained in each of these sets).
But $A_{j}$ is a subset of $U$ (since $A_{1},A_{2},\ldots,A_{n}$ are subsets
of $U$). Hence, $A_{j}\subseteq U$, so that $\bigcap_{i\in I}A_{i}\subseteq
A_{j}\subseteq U$ and thus $U\cap\left(  \bigcap_{i\in I}A_{i}\right)
=\bigcap_{i\in I}A_{i}$. Hence,%
\begin{align*}
\bigcap_{i\in I}A_{i}  &  =U\cap\underbrace{\left(  \bigcap_{i\in I}%
A_{i}\right)  }_{=\left\{  x\ \mid\ x\in A_{i}\text{ for each }i\in I\right\}
}\\
&  =U\cap\left\{  x\ \mid\ x\in A_{i}\text{ for each }i\in I\right\}
=\left\{  x\in U\ \mid\ x\in A_{i}\text{ for each }i\in I\right\} \\
&  =\left\{  x\in U\ \mid\ x\in A_{i}\text{ for all }i\in I\right\}  =\left\{
s\in U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\}
\end{align*}
(here, we have renamed the index $x$ as $s$). Thus, Statement 1 is proved in
Case 2.

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

Now, Theorem \ref{thm.pie.bU} yields%
\[
\left\vert U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right)
\right\vert =\sum_{I\subseteq\left[  n\right]  }\left(  -1\right)
^{\left\vert I\right\vert }\left\vert \left\{  s\in U\ \mid\ s\in A_{i}\text{
for all }i\in I\right\}  \right\vert .
\]
Comparing this with%
\[
\sum_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\left\vert \underbrace{\bigcap_{i\in I}A_{i}}%
_{\substack{=\left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\}
\\\text{(by Statement 1)}}}\right\vert =\sum_{I\subseteq\left[  n\right]
}\left(  -1\right)  ^{\left\vert I\right\vert }\left\vert \left\{  s\in
U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\}  \right\vert ,
\]
we obtain%
\[
\left\vert U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right)
\right\vert =\sum_{I\subseteq\left[  n\right]  }\left(  -1\right)
^{\left\vert I\right\vert }\left\vert \bigcap_{i\in I}A_{i}\right\vert .
\]
This proves Theorem \ref{thm.pie.b}.
\end{proof}

We can now derive Theorem \ref{thm.pie.a} from this:

\begin{proof}
[Proof of Theorem \ref{thm.pie.a}.]Let $U$ be the set $A_{1}\cup A_{2}%
\cup\cdots\cup A_{n}$. Then, $A_{1},A_{2},\ldots,A_{n}$ are subsets of $U$.
The set $U=A_{1}\cup A_{2}\cup\cdots\cup A_{n}$ is finite (since $A_{1}%
,A_{2},\ldots,A_{n}$ are finite). From $U=A_{1}\cup A_{2}\cup\cdots\cup A_{n}%
$, we obtain $U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right)
=\varnothing$ and thus $\left\vert U\setminus\left(  A_{1}\cup A_{2}\cup
\cdots\cup A_{n}\right)  \right\vert =\left\vert \varnothing\right\vert =0$.

Let us agree to understand the \textquotedblleft empty\textquotedblright%
\ intersection $\bigcap_{i\in\varnothing}A_{i}$ to mean the set $U$. Then,
Theorem \ref{thm.pie.b} yields%
\begin{align*}
&  \left\vert U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right)
\right\vert \\
&  =\sum_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\left\vert \bigcap_{i\in I}A_{i}\right\vert \\
&  =\underbrace{\left(  -1\right)  ^{\left\vert \varnothing\right\vert }%
}_{\substack{=1\\\text{(since }\left\vert \varnothing\right\vert =0\\\text{is
even)}}}\left\vert \underbrace{\bigcap_{i\in\varnothing}A_{i}}_{=U}\right\vert
+\sum_{\substack{I\subseteq\left[  n\right]  ;\\I\neq\varnothing
}}\underbrace{\left(  -1\right)  ^{\left\vert I\right\vert }}_{=-\left(
-1\right)  ^{\left\vert I\right\vert -1}}\left\vert \bigcap_{i\in I}%
A_{i}\right\vert \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have split off the addend for
}I=\varnothing\text{ from the sum}\right) \\
&  =\left\vert \underbrace{U}_{=A_{1}\cup A_{2}\cup\cdots\cup A_{n}%
}\right\vert +\underbrace{\sum_{\substack{I\subseteq\left[  n\right]
;\\I\neq\varnothing}}\left(  -\left(  -1\right)  ^{\left\vert I\right\vert
-1}\right)  \left\vert \bigcap_{i\in I}A_{i}\right\vert }_{=-\sum
_{\substack{I\subseteq\left[  n\right]  ;\\I\neq\varnothing}}\left(
-1\right)  ^{\left\vert I\right\vert -1}\left\vert \bigcap_{i\in I}%
A_{i}\right\vert }\\
&  =\left\vert A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right\vert -\sum
_{\substack{I\subseteq\left[  n\right]  ;\\I\neq\varnothing}}\left(
-1\right)  ^{\left\vert I\right\vert -1}\left\vert \bigcap_{i\in I}%
A_{i}\right\vert .
\end{align*}
Comparing this with $\left\vert U\setminus\left(  A_{1}\cup A_{2}\cup
\cdots\cup A_{n}\right)  \right\vert =0$, we obtain%
\[
\left\vert A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right\vert -\sum
_{\substack{I\subseteq\left[  n\right]  ;\\I\neq\varnothing}}\left(
-1\right)  ^{\left\vert I\right\vert -1}\left\vert \bigcap_{i\in I}%
A_{i}\right\vert =0.
\]
In other words,%
\[
\left\vert A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right\vert =\sum
_{\substack{I\subseteq\left[  n\right]  ;\\I\neq\varnothing}}\left(
-1\right)  ^{\left\vert I\right\vert -1}\left\vert \bigcap_{i\in I}%
A_{i}\right\vert .
\]
This proves Theorem \ref{thm.pie.a}.
\end{proof}

\begin{proof}
[Proof of Theorem \ref{thm.pie.a-ik}.]Theorem \ref{thm.pie.a} yields%
\begin{align*}
\left\vert A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right\vert  &  =\sum
_{\substack{I\subseteq\left[  n\right]  ;\\I\neq\varnothing}}\left(
-1\right)  ^{\left\vert I\right\vert -1}\left\vert \bigcap_{i\in I}%
A_{i}\right\vert \\
&  =\sum_{m=1}^{n}\left(  -1\right)  ^{m-1}\sum_{\substack{\left(  i_{1}%
,i_{2},\ldots,i_{m}\right)  \in\left[  n\right]  ^{m};\\i_{1}<i_{2}%
<\cdots<i_{m}}}\left\vert A_{i_{1}}\cap A_{i_{2}}\cap\cdots\cap A_{i_{m}%
}\right\vert
\end{align*}
(by Proposition \ref{prop.pie.bigcap-rewritten}). This proves Theorem
\ref{thm.pie.a-ik}.
\end{proof}

We thus have proved all three forms of the Principle of Inclusion and
Exclusion. We notice that Theorem \ref{thm.pie.a} also appears in
\cite{Smid09} (with a proof by induction), in \cite[Theorem 16.1]{Galvin}
(with two proofs) and in \cite[Theorem 3.42]{detnotes} (in a slightly more
general form). Likewise, Theorem \ref{thm.pie.b} also appears in
\cite{White10}, in \cite[(12)]{Galvin} and in \cite[Theorem 3.43]{detnotes}
(again, in a slightly more general form). Several generalizations of the
Principle can be found in \cite[Theorems 3.44, 3.45 and 3.46]{detnotes}.

The following exercise provides an analogue of Theorem \ref{thm.pie.a-ik} with
the roles of $\cup$ and $\cap$ swapped:

\begin{exercise}
\label{exe.pie.owr-a} Let $n$ be a positive integer. Let $A_{1}, A_{2},
\ldots, A_{n}$ be $n$ finite sets. Prove that
\[
\left|  A_{1} \cap A_{2} \cap\cdots\cap A_{n} \right|  = \sum_{m=1}^{n}
\left(  -1 \right)  ^{m-1} \sum_{\substack{\left(  i_{1}, i_{2}, \ldots, i_{m}
\right)  \in\left[  n \right]  ^{m}; \\i_{1} < i_{2} < \cdots< i_{m}}} \left|
A_{i_{1}} \cup A_{i_{2}} \cup\cdots\cup A_{i_{m}} \right|  .
\]

\end{exercise}

We shall now explore some applications of the Principle of Inclusion and Exclusion.

\subsubsection{\label{subsect.binom.pie.app-surj}Application: Surjections}

Let us recall the numbers $\operatorname*{sur}\left(  m,n\right)  $ we
introduced in Definition \ref{def.surmn}. We have proved two recursive
formulas for them in Subsection \ref{subsect.binom.maps.sur}; but we left a
more explicit formula (Theorem \ref{thm.binom.surmn-as-altsum}) without an
appropriately elucidating proof\footnote{unless you count the inductive proof
in Exercise \ref{exe.thm.binom.surmn-as-altsum.elpf} as a such}. It is now
time to give such a proof using Theorem \ref{thm.pie.bU}:

\begin{proof}
[Proof of Theorem \ref{thm.binom.surmn-as-altsum}.]Recall that
$\operatorname*{sur}\left(  m,n\right)  $ is the \# of surjective maps from
$\left[  m\right]  $ to $\left[  n\right]  $ (by Definition \ref{def.surmn}).
In order to compute this using Theorem \ref{thm.pie.bU}, we want to find a
finite set (\textquotedblleft universe\textquotedblright) $U$ and $n$ subsets
$A_{1},A_{2},\ldots,A_{n}$ of $U$ such that%
\begin{equation}
U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right)  =\left\{
\text{surjective maps from }\left[  m\right]  \text{ to }\left[  n\right]
\right\}  . \label{pf.thm.binom.surmn-as-altsum.Uwo}%
\end{equation}


We find them as follows: We define
\begin{equation}
U=\left[  n\right]  ^{\left[  m\right]  }=\left\{  \text{maps from }\left[
m\right]  \text{ to }\left[  n\right]  \right\}  .
\label{pf.thm.binom.surmn-as-altsum.U=}%
\end{equation}
This is a finite set. Thus, the elements $f\in U$ are the maps $f:\left[
m\right]  \rightarrow\left[  n\right]  $. For each $i\in\left\{
1,2,\ldots,n\right\}  $, we define a subset $A_{i}$ of $U$ by%
\begin{equation}
A_{i}=\left\{  \text{maps }f:\left[  m\right]  \rightarrow\left[  n\right]
\ \mid\ i\notin f\left(  \left[  m\right]  \right)  \right\}  .
\label{pf.thm.binom.surmn-as-altsum.Ai=}%
\end{equation}
(This is the set of all maps $f:\left[  m\right]  \rightarrow\left[  n\right]
$ which never take $i$ as a value.) Then, $A_{1},A_{2},\ldots,A_{n}$ are $n$
subsets of $U$. Let us check that they satisfy
(\ref{pf.thm.binom.surmn-as-altsum.Uwo}).

Indeed, we have%
\begin{align}
&  \left\{  \text{surjective maps from }\left[  m\right]  \text{ to }\left[
n\right]  \right\} \nonumber\\
&  =\left\{  \text{maps }f:\left[  m\right]  \rightarrow\left[  n\right]
\ \mid\ f\text{ is surjective}\right\} \nonumber\\
&  =\left\{  \text{maps }f:\left[  m\right]  \rightarrow\left[  n\right]
\ \mid\ \text{every }i\in\left[  n\right]  \text{ is taken as a value by
}f\right\}  \label{pf.thm.binom.surmn-as-altsum.surj=}%
\end{align}
(because a map $f:\left[  m\right]  \rightarrow\left[  n\right]  $ is
surjective if and only if every $i\in\left[  n\right]  $ is taken as a value
by $f$). But from (\ref{pf.thm.binom.surmn-as-altsum.Ai=}), we obtain%
\[
A_{1}\cup A_{2}\cup\cdots\cup A_{n}=\left\{  \text{maps }f:\left[  m\right]
\rightarrow\left[  n\right]  \ \mid\ \text{at least one }i\in\left[  n\right]
\text{ satisfies }i\notin f\left(  \left[  m\right]  \right)  \right\}
\]
and thus%
\begin{align}
&  U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right) \nonumber\\
&  =\underbrace{U}_{\substack{=\left\{  \text{maps from }\left[  m\right]
\text{ to }\left[  n\right]  \right\}  \\=\left\{  \text{maps }f:\left[
m\right]  \rightarrow\left[  n\right]  \right\}  }}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \setminus\left\{  \text{maps }f:\left[  m\right]
\rightarrow\left[  n\right]  \ \mid\ \text{at least one }i\in\left[  n\right]
\text{ satisfies }i\notin f\left(  \left[  m\right]  \right)  \right\}
\nonumber\\
&  =\left\{  \text{maps }f:\left[  m\right]  \rightarrow\left[  n\right]
\right\} \nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \setminus\left\{  \text{maps }f:\left[  m\right]
\rightarrow\left[  n\right]  \ \mid\ \text{at least one }i\in\left[  n\right]
\text{ satisfies }i\notin f\left(  \left[  m\right]  \right)  \right\}
\nonumber\\
&  =\left\{  \text{maps }f:\left[  m\right]  \rightarrow\left[  n\right]
\ \mid\ \text{every }i\in\left[  n\right]  \text{ satisfies }i\in f\left(
\left[  m\right]  \right)  \right\} \nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since the negation of the statement}\\
\text{\textquotedblleft at least one }i\in\left[  n\right]  \text{ satisfies
}i\notin f\left(  \left[  m\right]  \right)  \text{\textquotedblright}\\
\text{is \textquotedblleft every }i\in\left[  n\right]  \text{ satisfies }i\in
f\left(  \left[  m\right]  \right)  \text{\textquotedblright}%
\end{array}
\right) \nonumber\\
&  =\left\{  \text{maps }f:\left[  m\right]  \rightarrow\left[  n\right]
\ \mid\ \text{every }i\in\left[  n\right]  \text{ is taken as a value by
}f\right\} \nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since the statement \textquotedblleft every }i\in\left[  n\right]
\text{ satisfies }i\in f\left(  \left[  m\right]  \right)
\text{\textquotedblright}\\
\text{means the same as \textquotedblleft every }i\in\left[  n\right]  \text{
is taken as a value by }f\text{\textquotedblright}%
\end{array}
\right) \nonumber\\
&  =\left\{  \text{surjective maps from }\left[  m\right]  \text{ to }\left[
n\right]  \right\}  \label{pf.thm.binom.surmn-as-altsum.Uwo-proved}%
\end{align}
(by (\ref{pf.thm.binom.surmn-as-altsum.surj=})). Thus,
(\ref{pf.thm.binom.surmn-as-altsum.Uwo}) is indeed satisfied.

Now, (\ref{pf.thm.binom.surmn-as-altsum.Uwo-proved}) yields%
\begin{align}
&  \left\vert U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right)
\right\vert \nonumber\\
&  =\left\vert \left\{  \text{surjective maps from }\left[  m\right]  \text{
to }\left[  n\right]  \right\}  \right\vert \nonumber\\
&  =\left(  \text{\# of surjective maps from }\left[  m\right]  \text{ to
}\left[  n\right]  \right)  =\operatorname*{sur}\left(  m,n\right)
\label{pf.thm.binom.surmn-as-altsum.=sur}%
\end{align}
(since $\operatorname*{sur}\left(  m,n\right)  $ was defined as the \# of
surjective maps from $\left[  m\right]  $ to $\left[  n\right]  $).

In order to apply Theorem \ref{thm.pie.bU} successfully, we want to understand
the sets $\left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\}  $
(or at least their sizes). But this is easy: If $I$ is a subset of $\left[
n\right]  $, then%
\begin{align}
&  \left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\} \nonumber\\
&  =\left\{  \text{maps }f:\left[  m\right]  \rightarrow\left[  n\right]
\ \mid\ f\left(  \left[  m\right]  \right)  \subseteq\left[  n\right]
\setminus I\right\}  . \label{pf.thm.binom.surmn-as-altsum.capAi=}%
\end{align}


\begin{fineprint}
[\textit{Proof of (\ref{pf.thm.binom.surmn-as-altsum.capAi=}):} Let $I$ be a
subset of $\left[  n\right]  $. We have%
\begin{align}
&  \left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\} \nonumber\\
&  =\left\{  s\in U\ \mid\ s\in A_{i}\text{ for each }i\in I\right\}
\nonumber\\
&  =\left\{  f\in U\ \mid\ f\in A_{i}\text{ for each }i\in I\right\}
\ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have renamed the index }s\text{ as
}f\right) \nonumber\\
&  =\left\{  \text{maps }f:\left[  m\right]  \rightarrow\left[  n\right]
\ \mid\ f\in A_{i}\text{ for each }i\in I\right\}
\label{pf.pf.thm.binom.surmn-as-altsum.capAi=.2}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since the elements }f\in U\text{ are the
maps }f:\left[  m\right]  \rightarrow\left[  n\right]  \right)  .\nonumber
\end{align}
But if $f:\left[  m\right]  \rightarrow\left[  n\right]  $ is any map, then we
have the following chain of logical equivalences:%
\begin{align*}
&  \ \left(  f\in A_{i}\text{ for each }i\in I\right) \\
&  \Longleftrightarrow\ \left(  i\notin f\left(  \left[  m\right]  \right)
\text{ for each }i\in I\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{because an }i\in I\text{ satisfies }f\in
A_{i}\text{ if and only if }i\notin f\left(  \left[  m\right]  \right)  \text{
(by (\ref{pf.thm.binom.surmn-as-altsum.Ai=}))}\right) \\
&  \Longleftrightarrow\ \left(  \text{none of the elements of }I\text{ is
contained in }f\left(  \left[  m\right]  \right)  \right) \\
&  \Longleftrightarrow\ \left(  \text{the sets }f\left(  \left[  m\right]
\right)  \text{ and }I\text{ are disjoint}\right) \\
&  \Longleftrightarrow\ \left(  f\left(  \left[  m\right]  \right)  \text{ is
disjoint from }I\right) \\
&  \Longleftrightarrow\ \left(  f\left(  \left[  m\right]  \right)
\subseteq\left[  n\right]  \setminus I\right)
\end{align*}
(because $f\left(  \left[  m\right]  \right)  $ is a subset of $\left[
n\right]  $, and thus is disjoint from $I$ if and only if $f\left(  \left[
m\right]  \right)  \subseteq\left[  n\right]  \setminus I$). In light of this
equivalence, we can rewrite (\ref{pf.pf.thm.binom.surmn-as-altsum.capAi=.2})
as%
\[
\left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\}  =\left\{
\text{maps }f:\left[  m\right]  \rightarrow\left[  n\right]  \ \mid\ f\left(
\left[  m\right]  \right)  \subseteq\left[  n\right]  \setminus I\right\}  .
\]
This proves (\ref{pf.thm.binom.surmn-as-altsum.capAi=}).]
\end{fineprint}

Now, if $I$ is a subset of $\left[  n\right]  $, then%
\begin{align}
&  \left\vert \left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\}
\right\vert \nonumber\\
&  =\left\vert \left\{  \text{maps }f:\left[  m\right]  \rightarrow\left[
n\right]  \ \mid\ f\left(  \left[  m\right]  \right)  \subseteq\left[
n\right]  \setminus I\right\}  \right\vert \ \ \ \ \ \ \ \ \ \ \left(
\text{by (\ref{pf.thm.binom.surmn-as-altsum.capAi=})}\right) \nonumber\\
&  =\left(  \text{\# of maps }f:\left[  m\right]  \rightarrow\left[  n\right]
\text{ satisfying }f\left(  \left[  m\right]  \right)  \subseteq\left[
n\right]  \setminus I\right) \nonumber\\
&  =\left\vert \left[  n\right]  \setminus I\right\vert ^{\left\vert \left[
m\right]  \right\vert }\ \ \ \ \ \ \ \ \ \ \left(  \text{by Exercise
\ref{exe.binom.maps-img} \textbf{(a)}, applied to }A=\left[  m\right]  \text{,
}B=\left[  n\right]  \text{ and }C=I\right) \nonumber\\
&  =\left(  \left\vert \left[  n\right]  \right\vert -\left\vert I\right\vert
\right)  ^{\left\vert \left[  m\right]  \right\vert }%
\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since }\left\vert \left[  n\right]  \setminus I\right\vert =\left\vert
\left[  n\right]  \right\vert -\left\vert I\right\vert \\
\text{(by Theorem \ref{thm.subset-leq} \textbf{(a)}, since }I\text{ is a
subset of }\left[  n\right]  \text{)}%
\end{array}
\right) \nonumber\\
&  =\left(  n-\left\vert I\right\vert \right)  ^{m}\ \ \ \ \ \ \ \ \ \ \left(
\text{since }\left\vert \left[  n\right]  \right\vert =n\text{ and }\left\vert
\left[  m\right]  \right\vert =m\right)  .
\label{pf.thm.binom.surmn-as-altsum.abscapAi=}%
\end{align}


Now, let us note that each subset $I$ of $\left[  n\right]  $ satisfies
$\left\vert I\right\vert \in\left\{  0,1,\ldots,n\right\}  $ (since Theorem
\ref{thm.subset-leq} \textbf{(b)} yields $\left\vert I\right\vert
\leq\left\vert \left[  n\right]  \right\vert =n$). Theorem \ref{thm.pie.bU}
yields%
\begin{align*}
&  \left\vert U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right)
\right\vert \\
&  =\sum_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\underbrace{\left\vert \left\{  s\in U\ \mid\ s\in A_{i}\text{
for all }i\in I\right\}  \right\vert }_{\substack{=\left(  n-\left\vert
I\right\vert \right)  ^{m}\\\text{(by
(\ref{pf.thm.binom.surmn-as-altsum.abscapAi=}))}}}\\
&  =\sum_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\left(  n-\left\vert I\right\vert \right)  ^{m}=\sum_{k=0}%
^{n}\ \ \sum_{\substack{I\subseteq\left[  n\right]  ;\\\left\vert I\right\vert
=k}}\underbrace{\left(  -1\right)  ^{\left\vert I\right\vert }\left(
n-\left\vert I\right\vert \right)  ^{m}}_{\substack{=\left(  -1\right)
^{k}\left(  n-k\right)  ^{m}\\\text{(since }\left\vert I\right\vert
=k\text{)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by an application of (\ref{eq.sum.sheph}), since}\\
\text{each subset }I\text{ of }\left[  n\right]  \text{ satisfies }\left\vert
I\right\vert \in\left\{  0,1,\ldots,n\right\}
\end{array}
\right) \\
&  =\sum_{k=0}^{n}\underbrace{\sum_{\substack{I\subseteq\left[  n\right]
;\\\left\vert I\right\vert =k}}\left(  -1\right)  ^{k}\left(  n-k\right)
^{m}}_{=\left(  \text{\# of subsets }I\text{ of }\left[  n\right]  \text{
satisfying }\left\vert I\right\vert =k\right)  \cdot\left(  -1\right)
^{k}\left(  n-k\right)  ^{m}}\\
&  =\sum_{k=0}^{n}\underbrace{\left(  \text{\# of subsets }I\text{ of }\left[
n\right]  \text{ satisfying }\left\vert I\right\vert =k\right)  }%
_{\substack{=\left(  \text{\# of }k\text{-element subsets of }\left[
n\right]  \right)  =\dbinom{n}{k}\\\text{(by Theorem \ref{thm.binom.comb},
applied to }S=\left[  n\right]  \text{)}}}\cdot\left(  -1\right)  ^{k}\left(
n-k\right)  ^{m}\\
&  =\sum_{k=0}^{n}\dbinom{n}{k}\cdot\left(  -1\right)  ^{k}\left(  n-k\right)
^{m}=\sum_{k=0}^{n}\underbrace{\left(  -1\right)  ^{k}}_{\substack{=\left(
-1\right)  ^{n-\left(  n-k\right)  }\\\text{(since }k=n-\left(  n-k\right)
\text{)}}}\underbrace{\dbinom{n}{k}}_{\substack{=\dbinom{n}{n-k}\\\text{(by
Theorem \ref{thm.binom.sym})}}}\left(  n-k\right)  ^{m}\\
&  =\sum_{k=0}^{n}\left(  -1\right)  ^{n-\left(  n-k\right)  }\dbinom{n}%
{n-k}\left(  n-k\right)  ^{m}=\sum_{i=0}^{n}\left(  -1\right)  ^{n-i}%
\dbinom{n}{i}i^{m}%
\end{align*}
(here, we have substituted $i$ for $n-k$ in the sum). Comparing this with
(\ref{pf.thm.binom.surmn-as-altsum.=sur}), we obtain%
\[
\operatorname*{sur}\left(  m,n\right)  =\sum_{i=0}^{n}\left(  -1\right)
^{n-i}\dbinom{n}{i}i^{m}.
\]
This proves Theorem \ref{thm.binom.surmn-as-altsum}.
\end{proof}

\subsubsection{\label{subsect.binom.pie.app-der}Application: Derangements}

In Definition \ref{def.count.dera}, we defined the notion of a derangement; in
Definition \ref{def.count.dera.Dn}, we introduced the notation $D_{n}$ for the
\# of derangements of $\left[  n\right]  $. We now intend to use the Principle
of Inclusion and Exclusion to obtain a formula for $D_{n}$ -- namely, the
formula from Theorem \ref{thm.count.dera.teasers} \textbf{(d)}.

We shall use the following notation (which is fairly widespread in abstract algebra):

\begin{definition}
Let $X$ be any set. Then, the set of all permutations of $X$ is denoted by
$S_{X}$.
\end{definition}

Thus, if $X$ is a finite set, then%
\[
S_{X}=\left\{  \text{permutations of }X\right\}
\]
and therefore%
\begin{equation}
\left\vert S_{X}\right\vert =\left(  \text{\# of permutations of }X\right)
=\left\vert X\right\vert ! \label{eq.count.perms.absSX=}%
\end{equation}
(by Theorem \ref{thm.count.perms}, applied to $n=\left\vert X\right\vert $),
since $X$ is an $\left\vert X\right\vert $-element set.

In order to count the derangements of $\left[  n\right]  $ for some
$n\in\mathbb{N}$, we can try to apply Theorem \ref{thm.pie.bU} to%
\[
U=S_{\left[  n\right]  }\ \ \ \ \ \ \ \ \ \ \text{and}%
\ \ \ \ \ \ \ \ \ \ A_{i}=\left\{  \sigma\in S_{\left[  n\right]  }%
\ \mid\ \sigma\left(  i\right)  =i\right\}  .
\]
This would shift our problem to the computation of $\left\vert \left\{  s\in
U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\}  \right\vert $ for subsets
$I$ of $\left[  n\right]  $. The following proposition will help us do so:

\begin{proposition}
\label{prop.count.dera.subfix}Let $X$ be a set. Let $I$ be a subset of $X$.
Then, there is a bijection%
\[
\text{from }\left\{  \sigma\in S_{X}\ \mid\ \sigma\left(  i\right)  =i\text{
for each }i\in I\right\}  \text{ to }S_{X\setminus I}.
\]

\end{proposition}

\begin{example}
For this example, set $X=\left[  4\right]  $ and $I=\left\{  1,3\right\}  $.
Then, Proposition \ref{prop.count.dera.subfix} claims that there is a
bijection%
\[
\text{from }\left\{  \sigma\in S_{\left[  4\right]  }\ \mid\ \sigma\left(
i\right)  =i\text{ for each }i\in\left\{  1,3\right\}  \right\}  \text{ to
}S_{\left\{  2,4\right\}  }%
\]
(since $X\setminus I=\left[  4\right]  \setminus\left\{  1,3\right\}
=\left\{  2,4\right\}  $). Let us check this: The permutations $\sigma\in
S_{\left[  4\right]  }$ satisfying $\left(  \sigma\left(  i\right)  =i\text{
for each }i\in\left\{  1,3\right\}  \right)  $ are%
\[
\left(
\begin{array}
[c]{cccc}%
1 & 2 & 3 & 4\\
1 & 2 & 3 & 4
\end{array}
\right)  \ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{cccc}%
1 & 2 & 3 & 4\\
1 & 4 & 3 & 2
\end{array}
\right)
\]
(in two-line notation). Meanwhile, the permutations of $\left\{  2,4\right\}
$ are
\[
\left(
\begin{array}
[c]{cc}%
2 & 4\\
2 & 4
\end{array}
\right)  \ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{cc}%
2 & 4\\
4 & 2
\end{array}
\right)
\]
(in two-line notation). Thus, there is a bijection from the former two
permutations (i.e., from the set $\left\{  \sigma\in S_{\left[  4\right]
}\ \mid\ \sigma\left(  i\right)  =i\text{ for each }i\in\left\{  1,3\right\}
\right\}  $) to the latter two permutations (i.e., to the set $S_{\left\{
2,4\right\}  }$): Namely, the bijection is \textquotedblleft throw away the
values at $1$ and at $3$\textquotedblright\ or, more formally,
\textquotedblleft restrict the permutation to the subset $\left\{
2,4\right\}  $\textquotedblright.
\end{example}

The following proof of Proposition \ref{prop.count.dera.subfix} generalizes
the bijection we have found in this example:

\begin{proof}
[Proof of Proposition \ref{prop.count.dera.subfix} (sketched).]Here is the
rough idea of the proof: If a permutation $\sigma\in S_{X}$ satisfies $\left(
\sigma\left(  i\right)  =i\text{ for each }i\in I\right)  $, then it has to
map each element of $I$ to itself, and therefore must permute the remaining
elements of $X$ among themselves (i.e., it must send any element of
$X\setminus I$ to an element of $X\setminus I$), since it would otherwise fail
to be injective. Thus, a permutation $\sigma\in S_{X}$ satisfying $\left(
\sigma\left(  i\right)  =i\text{ for each }i\in I\right)  $ is
\textquotedblleft nothing but\textquotedblright\ a permutation of the set
$X\setminus I$ (since the requirement $\left(  \sigma\left(  i\right)
=i\text{ for each }i\in I\right)  $ uniquely determines its values on the set
$I$). This is not rigorous, because strictly speaking a permutation of $X$
cannot be a permutation of $X\setminus I$ (after all, the former has domain
$X$ while the latter only has domain $X\setminus I$). Here is a rigorous
version of the argument we just made:

To each permutation $\sigma\in S_{X}$ satisfying $\left(  \sigma\left(
i\right)  =i\text{ for each }i\in I\right)  $, we can assign a permutation
$\widetilde{\sigma}$ of $X\setminus I$ by letting%
\[
\widetilde{\sigma}\left(  p\right)  =\sigma\left(  p\right)
\ \ \ \ \ \ \ \ \ \ \text{for each }p\in X\setminus I.
\]
\footnote{Why is this map $\widetilde{\sigma}$ well-defined, and why is it
really a permutation of $X\setminus I$ ? Try to answer these questions (and
similar questions that we leave unanswered in this proof) on your own, or look
up the answers in the solution to Exercise \ref{exe.count.dera.subfix.details}
below.} This defines a map%
\begin{align*}
A:\left\{  \sigma\in S_{X}\ \mid\ \sigma\left(  i\right)  =i\text{ for each
}i\in I\right\}   &  \rightarrow S_{X\setminus I},\\
\sigma &  \mapsto\widetilde{\sigma}.
\end{align*}
Conversely, to each permutation $\tau$ of $X\setminus I$, we can assign a
permutation $\widehat{\tau}\in S_{X}$ satisfying $\left(  \widehat{\tau
}\left(  i\right)  =i\text{ for each }i\in I\right)  $ by setting%
\[
\widehat{\tau}\left(  p\right)  =%
\begin{cases}
\tau\left(  p\right)  , & \text{if }p\notin I;\\
p, & \text{if }p\in I
\end{cases}
\ \ \ \ \ \ \ \ \ \ \text{for each }p\in X.
\]
\footnote{Once again: This should be proved! (Proving this is part of Exercise
\ref{exe.count.dera.subfix.details} below.)} This defines a map%
\begin{align*}
B:S_{X\setminus I}  &  \rightarrow\left\{  \sigma\in S_{X}\ \mid
\ \sigma\left(  i\right)  =i\text{ for each }i\in I\right\}  ,\\
\tau &  \mapsto\widehat{\tau}.
\end{align*}
The maps $A$ and $B$ are well-defined and mutually inverse\footnote{Once
again: This should be proved! (Proving this is part of Exercise
\ref{exe.count.dera.subfix.details} below.)}. Hence, they are bijections.
Thus, there is a bijection from the set $\left\{  \sigma\in S_{X}%
\ \mid\ \sigma\left(  i\right)  =i\text{ for each }i\in I\right\}  $ to the
set $S_{X\setminus I}$ (namely, $A$). This proves Proposition
\ref{prop.count.dera.subfix}.
\end{proof}

\begin{exercise}
\label{exe.count.dera.subfix.details}Fill in the missing details in the above
(sketched) proof of Proposition \ref{prop.count.dera.subfix}.
\end{exercise}

\begin{corollary}
\label{cor.count.dera.subfix-size}Let $n\in\mathbb{N}$. Let $X$ be an
$n$-element set. Let $I$ be a subset of $X$. Then,
\[
\left\vert \left\{  \sigma\in S_{X}\ \mid\ \sigma\left(  i\right)  =i\text{
for each }i\in I\right\}  \right\vert =\left(  n-\left\vert I\right\vert
\right)  !.
\]

\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.count.dera.subfix-size}.]The set $X$ is finite
(since it is an $n$-element set). Hence, its subset $X\setminus I$ is finite
as well. Moreover, $I$ is a subset of $X$; thus, Theorem \ref{thm.subset-leq}
\textbf{(a)} (applied to $A=X$ and $B=I$) yields
\[
\left\vert X\setminus I\right\vert =\underbrace{\left\vert X\right\vert
}_{\substack{=n\\\text{(since }X\text{ is}\\\text{an }n\text{-element set)}%
}}-\left\vert I\right\vert =n-\left\vert I\right\vert .
\]


Proposition \ref{prop.count.dera.subfix} shows that there is a bijection%
\[
\text{from }\left\{  \sigma\in S_{X}\ \mid\ \sigma\left(  i\right)  =i\text{
for each }i\in I\right\}  \text{ to }S_{X\setminus I}.
\]
Hence, the bijection principle yields%
\[
\left\vert \left\{  \sigma\in S_{X}\ \mid\ \sigma\left(  i\right)  =i\text{
for each }i\in I\right\}  \right\vert =\left\vert S_{X\setminus I}\right\vert
=\left\vert X\setminus I\right\vert !
\]
(by (\ref{eq.count.perms.absSX=}), applied to $X\setminus I$ instead of $X$).
In view of $\left\vert X\setminus I\right\vert =n-\left\vert I\right\vert $,
this rewrites as%
\[
\left\vert \left\{  \sigma\in S_{X}\ \mid\ \sigma\left(  i\right)  =i\text{
for each }i\in I\right\}  \right\vert =\left(  n-\left\vert I\right\vert
\right)  !
\]
This proves Corollary \ref{cor.count.dera.subfix-size}.
\end{proof}

We can now prove Theorem \ref{thm.count.dera.teasers} \textbf{(d)}:

\begin{proof}
[Proof of Theorem \ref{thm.count.dera.teasers} \textbf{(d)}.]Let
$n\in\mathbb{N}$. Set $U=S_{\left[  n\right]  }$. For each $i\in\left[
n\right]  $, we define a set%
\begin{equation}
A_{i}=\left\{  \sigma\in S_{\left[  n\right]  }\ \mid\ \sigma\left(  i\right)
=i\right\}  . \label{pf.thm.count.dera.teasers.d.Ai=}%
\end{equation}
This set $A_{i}$ is a subset of $S_{\left[  n\right]  }=U$. Thus, we have
found $n$ subsets $A_{1},A_{2},\ldots,A_{n}$ of $U$. We claim that%
\begin{equation}
U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right)  =\left\{
\text{derangements of }\left[  n\right]  \right\}  .
\label{pf.thm.count.dera.teasers.d.der=}%
\end{equation}


[\textit{Proof of (\ref{pf.thm.count.dera.teasers.d.der=}):} Let $\sigma$ be a
permutation of $\left[  n\right]  $. Hence, $\sigma\in S_{\left[  n\right]  }$
(by the definition of $S_{\left[  n\right]  }$). Hence, for any $i\in\left[
n\right]  $, we have the equivalence $\left(  \sigma\in A_{i}\right)
\ \Longleftrightarrow\ \left(  \sigma\left(  i\right)  =i\right)  $ (by
(\ref{pf.thm.count.dera.teasers.d.Ai=})). Thus, we have the following
equivalence:%
\begin{align}
&  \ \left(  \text{there exists no }i\in\left[  n\right]  \text{ such that
}\sigma\in A_{i}\right) \nonumber\\
&  \Longleftrightarrow\ \left(  \text{there exists no }i\in\left[  n\right]
\text{ such that }\sigma\left(  i\right)  =i\right)  .
\label{pf.thm.count.dera.teasers.d.der=.pf.0}%
\end{align}


But a fixed point of $\sigma$ is defined to be an element $i\in\left[
n\right]  $ such that $\sigma\left(  i\right)  =i$. Hence, we have the
following chain of equivalences:%
\begin{align}
&  \ \left(  \sigma\text{ has no fixed points}\right) \nonumber\\
&  \Longleftrightarrow\ \left(  \text{there exists no }i\in\left[  n\right]
\text{ such that }\sigma\left(  i\right)  =i\right) \nonumber\\
&  \Longleftrightarrow\ \left(  \text{there exists no }i\in\left[  n\right]
\text{ such that }\sigma\in A_{i}\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.thm.count.dera.teasers.d.der=.pf.0})}\right) \nonumber\\
&  \Longleftrightarrow\ \left(  \sigma\notin A_{i}\text{ for all }i\in\left[
n\right]  \right) \nonumber\\
&  \Longleftrightarrow\ \left(  \sigma\notin A_{1}\cup A_{2}\cup\cdots\cup
A_{n}\right)  . \label{pf.thm.count.dera.teasers.d.der=.pf.3}%
\end{align}


Forget that we fixed $\sigma$. We thus have proved the equivalence
(\ref{pf.thm.count.dera.teasers.d.der=.pf.3}) for each permutation $\sigma$ of
$\left[  n\right]  $.

Recall that a derangement of $\left[  n\right]  $ is defined as a permutation
of $\left[  n\right]  $ that has no fixed points. Hence,%
\begin{align*}
&  \left\{  \text{derangements of }\left[  n\right]  \right\} \\
&  =\left\{  \text{permutations of }\left[  n\right]  \text{ that have no
fixed points}\right\} \\
&  =\left\{  \sigma\text{ is a permutation of }\left[  n\right]
\ \mid\ \sigma\text{ has no fixed points}\right\} \\
&  =\left\{  \sigma\text{ is a permutation of }\left[  n\right]
\ \mid\ \sigma\notin A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right\} \\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{by the equivalence
(\ref{pf.thm.count.dera.teasers.d.der=.pf.3})}\right) \\
&  =\left\{  \sigma\in S_{\left[  n\right]  }\ \mid\ \sigma\notin A_{1}\cup
A_{2}\cup\cdots\cup A_{n}\right\} \\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{since the
permutations of }\left[  n\right]  \text{ are the elements of }S_{\left[
n\right]  }\right) \\
&  =\underbrace{S_{\left[  n\right]  }}_{=U}\setminus\left(  A_{1}\cup
A_{2}\cup\cdots\cup A_{n}\right)  =U\setminus\left(  A_{1}\cup A_{2}\cup
\cdots\cup A_{n}\right)  .
\end{align*}
This proves (\ref{pf.thm.count.dera.teasers.d.der=}).]

Now, (\ref{pf.thm.count.dera.teasers.d.der=}) yields%
\begin{align}
&  \left\vert U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right)
\right\vert \nonumber\\
&  =\left\vert \left\{  \text{derangements of }\left[  n\right]  \right\}
\right\vert \nonumber\\
&  =\left(  \text{\# of derangements of }\left[  n\right]  \right)  =D_{n}
\label{pf.thm.count.dera.teasers.d.=D}%
\end{align}
(since $D_{n}$ was defined as the \# of derangements of $\left[  n\right]  $).

In order to apply Theorem \ref{thm.pie.bU} successfully, we want to understand
the sets $\left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\}  $
(or at least their sizes). But this is easy: If $I$ is a subset of $\left[
n\right]  $, then%
\begin{align}
&  \left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\} \nonumber\\
&  =\left\{  \sigma\in S_{\left[  n\right]  }\ \mid\ \sigma\left(  i\right)
=i\text{ for each }i\in I\right\}  .
\label{pf.thm.count.dera.teasers.d.capAi=}%
\end{align}


\begin{fineprint}
[\textit{Proof of (\ref{pf.thm.count.dera.teasers.d.capAi=}):} Let $I$ be a
subset of $\left[  n\right]  $. We have%
\begin{align*}
&  \left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\} \\
&  =\left\{  s\in U\ \mid\ s\in A_{i}\text{ for each }i\in I\right\} \\
&  =\left\{  \sigma\in U\ \mid\ \sigma\in A_{i}\text{ for each }i\in I\right\}
\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have renamed
the index }s\text{ as }\sigma\right) \\
&  =\left\{  \sigma\in S_{\left[  n\right]  }\ \mid\ \sigma\in A_{i}\text{ for
each }i\in I\right\}  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }U=S_{\left[
n\right]  }\right) \\
&  =\left\{  \sigma\in S_{\left[  n\right]  }\ \mid\ \sigma\left(  i\right)
=i\text{ for each }i\in I\right\}
\end{align*}
(because for each $\sigma\in S_{\left[  n\right]  }$ and each $i\in I$, we
have the equivalence $\left(  \sigma\in A_{i}\right)  \ \Longleftrightarrow
\ \left(  \sigma\left(  i\right)  =i\right)  $\ \ \ \ \footnote{by
(\ref{pf.thm.count.dera.teasers.d.Ai=})}). This proves
(\ref{pf.thm.count.dera.teasers.d.capAi=}).]
\end{fineprint}

Now, if $I$ is a subset of $\left[  n\right]  $, then%
\begin{align}
&  \left\vert \left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\}
\right\vert \nonumber\\
&  =\left\vert \left\{  \sigma\in S_{\left[  n\right]  }\ \mid\ \sigma\left(
i\right)  =i\text{ for each }i\in I\right\}  \right\vert
\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{pf.thm.count.dera.teasers.d.capAi=}%
)}\right) \nonumber\\
&  =\left(  n-\left\vert I\right\vert \right)  !
\label{pf.thm.count.dera.teasers.d.abscapAi=}%
\end{align}
(by Corollary \ref{cor.count.dera.subfix-size}, applied to $X=\left[
n\right]  $).

Now, let us note that each subset $I$ of $\left[  n\right]  $ satisfies
$\left\vert I\right\vert \in\left\{  0,1,\ldots,n\right\}  $ (since Theorem
\ref{thm.subset-leq} \textbf{(b)} yields $\left\vert I\right\vert
\leq\left\vert \left[  n\right]  \right\vert =n$). Theorem \ref{thm.pie.bU}
yields%
\begin{align*}
&  \left\vert U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right)
\right\vert \\
&  =\sum_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\underbrace{\left\vert \left\{  s\in U\ \mid\ s\in A_{i}\text{
for all }i\in I\right\}  \right\vert }_{\substack{=\left(  n-\left\vert
I\right\vert \right)  !\\\text{(by
(\ref{pf.thm.count.dera.teasers.d.abscapAi=}))}}}\\
&  =\sum_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\left(  n-\left\vert I\right\vert \right)  !=\sum_{k=0}%
^{n}\ \ \sum_{\substack{I\subseteq\left[  n\right]  ;\\\left\vert I\right\vert
=k}}\underbrace{\left(  -1\right)  ^{\left\vert I\right\vert }\left(
n-\left\vert I\right\vert \right)  !}_{\substack{=\left(  -1\right)
^{k}\left(  n-k\right)  !\\\text{(since }\left\vert I\right\vert =k\text{)}%
}}\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by an application of (\ref{eq.sum.sheph}), since}\\
\text{each subset }I\text{ of }\left[  n\right]  \text{ satisfies }\left\vert
I\right\vert \in\left\{  0,1,\ldots,n\right\}
\end{array}
\right) \\
&  =\sum_{k=0}^{n}\underbrace{\sum_{\substack{I\subseteq\left[  n\right]
;\\\left\vert I\right\vert =k}}\left(  -1\right)  ^{k}\left(  n-k\right)
!}_{=\left(  \text{\# of subsets }I\text{ of }\left[  n\right]  \text{
satisfying }\left\vert I\right\vert =k\right)  \cdot\left(  -1\right)
^{k}\left(  n-k\right)  !}\\
&  =\sum_{k=0}^{n}\underbrace{\left(  \text{\# of subsets }I\text{ of }\left[
n\right]  \text{ satisfying }\left\vert I\right\vert =k\right)  }%
_{\substack{=\left(  \text{\# of }k\text{-element subsets of }\left[
n\right]  \right)  =\dbinom{n}{k}\\\text{(by Theorem \ref{thm.binom.comb},
applied to }S=\left[  n\right]  \text{)}}}\cdot\left(  -1\right)  ^{k}\left(
n-k\right)  !\\
&  =\sum_{k=0}^{n}\underbrace{\dbinom{n}{k}}_{\substack{=\dfrac{n!}%
{k!\cdot\left(  n-k\right)  !}\\\text{(by Theorem \ref{thm.binom.fac})}}%
}\cdot\left(  -1\right)  ^{k}\left(  n-k\right)  !=\sum_{k=0}^{n}%
\underbrace{\dfrac{n!}{k!\cdot\left(  n-k\right)  !}\cdot\left(  -1\right)
^{k}\left(  n-k\right)  !}_{=\left(  -1\right)  ^{k}\dfrac{n!}{k!}}\\
&  =\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dfrac{n!}{k!}.
\end{align*}
Comparing this with (\ref{pf.thm.count.dera.teasers.d.=D}), we obtain%
\[
D_{n}=\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dfrac{n!}{k!}.
\]
This proves Theorem \ref{thm.count.dera.teasers} \textbf{(d)}.
\end{proof}

\begin{exercise}
\label{exe.count.dera.teasers.abc}Prove parts \textbf{(a)}, \textbf{(b)} and
\textbf{(c)} of Theorem \ref{thm.count.dera.teasers}.
\end{exercise}

\subsubsection{\label{subsect.binom.pie.app-phi}Application: Euler's totient
function}

We recall two standard notions from elementary number theory (see, e.g.,
\cite[\S 2.9 and \S 2.10]{19s}):

\begin{itemize}
\item The \emph{greatest common divisor} of two positive integers $a$ and $b$
is defined to be the greatest positive integer that divides both $a$ and $b$.
It is denoted by $\gcd\left(  a,b\right)  $. For example, $\gcd\left(
4,6\right)  =2$ and $\gcd\left(  3,7\right)  =1$ and $\gcd\left(
10,25\right)  =5$.

\item Two positive integers $a$ and $b$ are said to be \emph{coprime} (or
\emph{relatively prime}) if $\gcd\left(  a,b\right)  =1$.

\item A positive integer $a$ is said to be \emph{coprime to} a positive
integer $b$ if $\gcd\left(  a,b\right)  =1$ (that is, if $a$ and $b$ are coprime).
\end{itemize}

\noindent(These definitions can be extended to arbitrary integers, if we set
$\gcd\left(  0,0\right)  =0$ (despite $0$ not literally being the greatest
common divisor of $0$ and $0$). But we will only need them for positive integers.)

We now define a function that has many uses in number theory (see, e.g.,
\cite[\S 2.14]{19s}):

\begin{definition}
\label{def.eulerphi.phi}The function $\phi:\left\{  1,2,3,\ldots\right\}
\rightarrow\mathbb{N}$ (called \emph{Euler's totient function} or
\emph{Euler's }$\phi$\emph{-function}) is defined by%
\[
\phi\left(  u\right)  =\left(  \text{\# of all }m\in\left[  u\right]  \text{
that are coprime to }u\right)  .
\]

\end{definition}

See \cite{Tou17} for a history of this function (and an attempt at explaining
its name).

\begin{example}
\label{exam.eulerphi.phi24612}\textbf{(a)} The definition of $\phi$ yields
\begin{equation}
\phi\left(  2\right)  =\left(  \text{\# of all }m\in\left[  2\right]  \text{
that are coprime to }2\right)  . \label{eq.exam.eulerphi.phi24612.2}%
\end{equation}
Among the elements $1,2$ of $\left[  2\right]  $, only $1$ is coprime to $2$
(since $\gcd\left(  1,2\right)  =1$ and $\gcd\left(  2,2\right)  =2$). Thus,
the \# of all $m\in\left[  2\right]  $ that are coprime to $2$ is $1$. Hence,
(\ref{eq.exam.eulerphi.phi24612.2}) becomes%
\[
\phi\left(  2\right)  =1.
\]


\textbf{(b)} The definition of $\phi$ yields
\begin{equation}
\phi\left(  4\right)  =\left(  \text{\# of all }m\in\left[  4\right]  \text{
that are coprime to }4\right)  . \label{eq.exam.eulerphi.phi24612.4}%
\end{equation}
Among the elements $1,2,3,4$ of $\left[  4\right]  $, only $1$ and $3$ are
coprime to $4$ (since $\gcd\left(  1,4\right)  =1$, $\gcd\left(  2,4\right)
=2$, $\gcd\left(  3,4\right)  =1$ and $\gcd\left(  4,4\right)  =4$). Thus, the
\# of all $m\in\left[  4\right]  $ that are coprime to $4$ is $2$. Hence,
(\ref{eq.exam.eulerphi.phi24612.4}) becomes%
\[
\phi\left(  4\right)  =2.
\]


\textbf{(c)} Likewise,%
\[
\phi\left(  6\right)  =2,
\]
since the only elements among $1,2,3,4,5,6$ that are coprime to $6$ are $1$
and $5$.

\textbf{(d)} Likewise,
\[
\phi\left(  7\right)  =6,
\]
since the only elements among $1,2,3,4,5,6,7$ that are coprime to $7$ are
$1,2,3,4,5,6$.

\textbf{(e)} Likewise,%
\[
\phi\left(  12\right)  =4,
\]
since the only elements among $1,2,3,4,5,6,7,8,9,10,11,12$ that are coprime to
$12$ are $1,5,7,11$.
\end{example}

Here is a table of the first $15$ values of $\phi$:%
\[%
\begin{tabular}
[c]{|c||c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c}\hline
$n$ & $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$ & $9$ & $10$ & $11$ & $12$
& $13$ & $14$ & $15$ & $\ \ \ \ \ \ \cdots\ \ \ \ \ \ $\\\hline
$\phi\left(  n\right)  $ & $1$ & $1$ & $2$ & $2$ & $4$ & $2$ & $6$ & $4$ & $6$
& $4$ & $10$ & $4$ & $12$ & $6$ & $8$ & $\ \ \ \ \ \ \cdots\ \ \ \ \ \ $%
\\\hline
\end{tabular}
\ \ \ \ .
\]


The function $\phi$ can, of course, be seen as a sequence of integers (namely,
the sequence $\left(  \phi\left(  1\right)  ,\phi\left(  2\right)
,\phi\left(  3\right)  ,\ldots\right)  $). As such, it appears in the OEIS as
\href{https://oeis.org/A000010}{OEIS\ sequence A000010}.

Here are two neat (but inconsequential, at least for us) exercises on the
function $\phi$ (which can be solved essentially combinatorially):

\begin{exercise}
\label{exe.ent.phi.even}Let $n\in\mathbb{N}$ satisfy $n>2$. Prove that
$\phi\left(  n\right)  $ is even.
\end{exercise}

\begin{exercise}
\label{exe.ent.phi.gauss}Let $n\in\mathbb{N}$ satisfy $n>1$. Prove that
\[
\sum_{\substack{i\in\left\{  1,2,\ldots,n\right\}  ;\\i\text{ is coprime to
}n}}i=n\phi\left(  n\right)  /2.
\]

\end{exercise}

We shall apply the Principle of Inclusion and Exclusion to proving the
following \textquotedblleft explicit\textquotedblright\ formula for
$\phi\left(  u\right)  $:

\begin{theorem}
\label{thm.eulerphi.prime-formula}Let $u$ be a positive integer. Let
$p_{1},p_{2},\ldots,p_{n}$ be the distinct primes that divide $u$. Then,%
\[
\phi\left(  u\right)  =u\cdot\prod_{i=1}^{n}\left(  1-\dfrac{1}{p_{i}}\right)
.
\]

\end{theorem}

\begin{example}
Let $u=18$. What does Theorem \ref{thm.eulerphi.prime-formula} say in this
case? The distinct primes that divide $u$ are $2$ and $3$ (since
$u=18=2\cdot3^{2}$). Hence, we can apply Theorem
\ref{thm.eulerphi.prime-formula} to $n=2$, $p_{1}=2$ and $p_{2}=3$. We thus
obtain%
\[
\phi\left(  u\right)  =u\cdot\prod_{i=1}^{2}\left(  1-\dfrac{1}{p_{i}}\right)
=u\cdot\left(  1-\dfrac{1}{2}\right)  \left(  1-\dfrac{1}{3}\right)  .
\]
In view of $u=18$, this rewrites as%
\[
\phi\left(  18\right)  =18\cdot\left(  1-\dfrac{1}{2}\right)  \left(
1-\dfrac{1}{3}\right)  =6.
\]
This is easy to verify by actually counting all $m\in\left[  18\right]  $ that
are coprime to $18$.
\end{example}

There are many ways to prove Theorem \ref{thm.eulerphi.prime-formula}; for
example, one can be found in \cite[\S 2.16.3]{19s}. We shall give a
combinatorial proof that uses the Principle of Inclusion and Exclusion as well
as a few elementary lemmas. The first lemma is a pair of simple identities:

\begin{lemma}
\label{lem.eulerphi.proda}Let $n\in\mathbb{N}$. Let $a_{1},a_{2},\ldots,a_{n}$
be any $n$ numbers. Then:

\textbf{(a)} We have%
\[
\sum_{I\subseteq\left[  n\right]  }\prod_{i\in I}a_{i}=\left(  1+a_{1}\right)
\left(  1+a_{2}\right)  \cdots\left(  1+a_{n}\right)  .
\]


\textbf{(b)} We have%
\[
\sum_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\prod_{i\in I}a_{i}=\left(  1-a_{1}\right)  \left(
1-a_{2}\right)  \cdots\left(  1-a_{n}\right)  .
\]

\end{lemma}

\begin{example}
If $n=3$, then Lemma \ref{lem.eulerphi.proda} \textbf{(a)} says that
\[
1+a_{1}+a_{2}+a_{3}+a_{1}a_{2}+a_{1}a_{3}+a_{2}a_{3}+a_{1}a_{2}a_{3}=\left(
1+a_{1}\right)  \left(  1+a_{2}\right)  \left(  1+a_{3}\right)  .
\]
This is no surprise: The left hand side is what you obtain if you expand the
right hand side.
\end{example}

\begin{exercise}
\label{exe.eulerphi.proda}Prove Lemma \ref{lem.eulerphi.proda}.
\end{exercise}

The remaining lemmas that we will need come from elementary number theory. The
first is a simple counting exercise:\footnote{In the following, we will
(mostly) avoid using the symbol \textquotedblleft$\mid$\textquotedblright\ for
the word \textquotedblleft divides\textquotedblright\ (in the notation
\textquotedblleft$a\mid b$\textquotedblright). Instead, we will just write out
the word \textquotedblleft divides\textquotedblright. We will do this in order
to avoid confusing expressions like \textquotedblleft$\left\{  m\in\left[
u\right]  \ \mid\ v\mid m\right\}  $\textquotedblright, because the symbol
\textquotedblleft$\mid$\textquotedblright\ is already used in set-builder
notation (e.g., in \textquotedblleft$\left\{  m\in\left[  u\right]
\ \mid\ v\text{ divides }m\right\}  $\textquotedblright).}

\begin{lemma}
\label{lem.eulerphi.1}Let $u$ and $v$ be two positive integers such that $v$
divides $u$. Then,%
\[
\left(  \text{\# of }m\in\left[  u\right]  \text{ such that }v\text{ divides
}m\right)  =u/v.
\]

\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.eulerphi.1} (sketched).]The positive integers $u$ and
$v$ have the property that $v$ divides $u$. Hence, $u/v$ is a positive
integer. Moreover, if $m\in\left[  u\right]  $, then $m\leq u$. Hence, if
$m\in\left[  u\right]  $ has the property that $v$ divides $m$, then $m/v$ is
a positive integer satisfying $m/v\leq u/v$ (since $m\leq u$), and thus
belongs to $\left[  u/v\right]  $. Hence, the map%
\begin{align*}
A:\left\{  m\in\left[  u\right]  \ \mid\ v\text{ divides }m\right\}   &
\rightarrow\left[  u/v\right]  ,\\
m  &  \mapsto m/v
\end{align*}
is well-defined. Consider this map $A$.

On the other hand, if $j\in\left[  u/v\right]  $, then $jv$ is an element of
$\left[  u\right]  $ (because $j\in\left[  u/v\right]  $ yields $0<j\leq u/v$
and thus $0<jv\leq u$) and has the property that $v$ divides $jv$. Hence, the
map%
\begin{align*}
B:\left[  u/v\right]   &  \rightarrow\left\{  m\in\left[  u\right]
\ \mid\ v\text{ divides }m\right\}  ,\\
j  &  \mapsto jv
\end{align*}
is well-defined. Consider this map $B$.

The maps $A$ and $B$ are mutually inverse (since $A$ divides the input by $v$,
whereas $B$ multiplies the input by $v$), and hence are bijections. Thus, the
bijection principle yields%
\[
\left\vert \left\{  m\in\left[  u\right]  \ \mid\ v\text{ divides }m\right\}
\right\vert =\left\vert \left[  u/v\right]  \right\vert =u/v
\]
(since $u/v$ is a positive integer). Hence,%
\[
\left(  \text{\# of }m\in\left[  u\right]  \text{ such that }v\text{ divides
}m\right)  =\left\vert \left\{  m\in\left[  u\right]  \ \mid\ v\text{ divides
}m\right\}  \right\vert =u/v.
\]
This proves Lemma \ref{lem.eulerphi.1}.
\end{proof}

The next lemma is a particular case of \cite[Exercise 2.10.3]{19s}:

\begin{lemma}
\label{lem.eulerphi.coprime-prod}Let $c\in\mathbb{Z}$. Let $b_{1},b_{2}%
,\ldots,b_{k}$ be $k$ positive integers that are mutually coprime.
(\textquotedblleft Mutually coprime\textquotedblright\ means that $b_{i}$ is
coprime to $b_{j}$ whenever $i\neq j$). Assume that $b_{i}\mid c$ for each
$i\in\left\{  1,2,\ldots,k\right\}  $. Then, $b_{1}b_{2}\cdots b_{k}\mid c$.
\end{lemma}

Using this lemma, we can easily see the following fact:

\begin{lemma}
\label{lem.eulerphi.prime-prod}Let $c\in\mathbb{Z}$. Let $b_{1},b_{2}%
,\ldots,b_{k}$ be $k$ distinct primes. Assume that $b_{i}\mid c$ for each
$i\in\left\{  1,2,\ldots,k\right\}  $. Then, $b_{1}b_{2}\cdots b_{k}\mid c$.
\end{lemma}

\begin{exercise}
\label{exe.eulerphi.prime-prod}Derive Lemma \ref{lem.eulerphi.prime-prod} from
Lemma \ref{lem.eulerphi.coprime-prod}.
\end{exercise}

From Lemma \ref{lem.eulerphi.prime-prod}, in turn, we can easily derive the
following lemma:

\begin{lemma}
\label{lem.eulerphi.2}Let $I$ be a finite set. For each $i\in I$, let $p_{i}$
be a prime. Assume that all these primes $p_{i}$ (for different $i\in I$) are
distinct. Let $m$ be an integer. Then, we have the equivalence%
\begin{equation}
\left(  p_{j}\text{ divides }m\text{ for each }j\in I\right)
\Longleftrightarrow\left(  \prod_{i\in I}p_{i}\text{ divides }m\right)  .
\label{eq.lem.eulerphi.2.equiv}%
\end{equation}

\end{lemma}

\begin{exercise}
\label{exe.eulerphi.2}Prove Lemma \ref{lem.eulerphi.2}.
\end{exercise}

The next lemma stems easily from the definition of a greatest common divisor:

\begin{lemma}
\label{lem.eulerphi.3}Let $u$ be a positive integer. Let $p_{1},p_{2}%
,\ldots,p_{n}$ be the distinct primes that divide $u$. Let $m$ be a positive
integer. Then, we have the equivalence%
\[
\left(  m\text{ is coprime to }u\right)  \Longleftrightarrow\left(  \left(
p_{i}\text{ does not divide }m\right)  \text{ for each }i\in\left[  n\right]
\right)  .
\]

\end{lemma}

\begin{exercise}
\label{exe.eulerphi.3}Prove Lemma \ref{lem.eulerphi.3}.

[\textbf{Hint:} A well-known fact says that if $n>1$ is an integer, then there
exists at least one prime $p$ such that $p\mid n$.]
\end{exercise}

We can now prove Theorem \ref{thm.eulerphi.prime-formula} using Theorem
\ref{thm.pie.bU}:

\begin{proof}
[Proof of Theorem \ref{thm.eulerphi.prime-formula}.]Define a finite set $U$ of
positive integers by
\[
U=\left[  u\right]  .
\]
For each $i\in\left[  n\right]  $, define a subset $A_{i}$ of $U$ by%
\begin{equation}
A_{i}=\left\{  m\in U\ \mid\ p_{i}\text{ divides }m\right\}  .
\label{pf.thm.eulerphi.prime-formula.Ai=}%
\end{equation}
Thus, we have found $n$ subsets $A_{1},A_{2},\ldots,A_{n}$ of $U$.

For any $m\in U$, we have the logical equivalence%
\begin{equation}
\left(  m\in A_{i}\right)  \ \Longleftrightarrow\ \left(  p_{i}\text{ divides
}m\right)  \label{pf.thm.eulerphi.prime-formula.mu1}%
\end{equation}
(by (\ref{pf.thm.eulerphi.prime-formula.Ai=})), and thus we also have the
logical equivalence%
\begin{equation}
\left(  m\notin A_{i}\right)  \ \Longleftrightarrow\ \left(  p_{i}\text{ does
not divide }m\right)  . \label{pf.thm.eulerphi.prime-formula.mu2}%
\end{equation}


We claim that%
\begin{equation}
U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right)  =\left\{
m\in\left[  u\right]  \ \mid\ m\text{ is coprime to }u\right\}  .
\label{pf.thm.eulerphi.prime-formula.whatnot}%
\end{equation}


[\textit{Proof of (\ref{pf.thm.eulerphi.prime-formula.whatnot}):} For any
$m\in U$, we have the logical equivalence%
\[
\left(  m\text{ is coprime to }u\right)  \Longleftrightarrow\left(  \left(
p_{i}\text{ does not divide }m\right)  \text{ for each }i\in\left[  n\right]
\right)
\]
(by Lemma \ref{lem.eulerphi.3}). Thus,%
\begin{align}
&  \left\{  m\in U\ \mid\ m\text{ is coprime to }u\right\} \nonumber\\
&  =\left\{  m\in U\ \mid\ \left(  p_{i}\text{ does not divide }m\right)
\text{ for each }i\in\left[  n\right]  \right\}  .
\label{pf.thm.eulerphi.prime-formula.whatnot.pf.4}%
\end{align}


But the definition of set difference yields
\begin{align*}
&  U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right) \\
&  =\left\{  m\in U\ \mid\ m\notin A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right\}
\\
&  =\left\{  m\in U\ \mid\ \underbrace{m\notin A_{i}}_{\substack{\text{This is
equivalent to}\\\text{\textquotedblleft}p_{i}\text{ does not divide
}m\text{\textquotedblright}\\\text{(by
(\ref{pf.thm.eulerphi.prime-formula.mu2}))}}}\text{ for each }i\in\left[
n\right]  \right\} \\
&  =\left\{  m\in U\ \mid\ \left(  p_{i}\text{ does not divide }m\right)
\text{ for each }i\in\left[  n\right]  \right\} \\
&  =\left\{  m\in U\ \mid\ m\text{ is coprime to }u\right\}
\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.thm.eulerphi.prime-formula.whatnot.pf.4})}\right) \\
&  =\left\{  m\in\left[  u\right]  \ \mid\ m\text{ is coprime to }u\right\}
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }U=\left[  u\right]  \right)  .
\end{align*}
This proves (\ref{pf.thm.eulerphi.prime-formula.whatnot}).]

Now, the definition of $\phi$ yields
\begin{align}
\phi\left(  u\right)   &  =\left(  \text{\# of all }m\in\left[  u\right]
\text{ that are coprime to }u\right) \nonumber\\
&  =\left\vert \left\{  m\in\left[  u\right]  \ \mid\ m\text{ is coprime to
}u\right\}  \right\vert \nonumber\\
&  =\left\vert U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right)
\right\vert \label{pf.thm.eulerphi.prime-formula.whatnot-size}%
\end{align}
(since (\ref{pf.thm.eulerphi.prime-formula.whatnot}) yields $\left\{
m\in\left[  u\right]  \ \mid\ m\text{ is coprime to }u\right\}  =U\setminus
\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right)  $).

In order to apply Theorem \ref{thm.pie.bU} successfully, we want to understand
the sets $\left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\}  $
(or at least their sizes). But this is easy: If $I$ is a subset of $\left[
n\right]  $, then%
\begin{align}
&  \left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\} \nonumber\\
&  =\left\{  m\in\left[  u\right]  \ \mid\ \prod_{i\in I}p_{i}\text{ divides
}m\right\}  . \label{pf.thm.eulerphi.prime-formula.cap-Ai=}%
\end{align}


[\textit{Proof of (\ref{pf.thm.eulerphi.prime-formula.cap-Ai=}):} Let $I$ be a
subset of $\left[  n\right]  $. We have%
\begin{align*}
&  \left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\} \\
&  =\left\{  s\in U\ \mid\ s\in A_{i}\text{ for each }i\in I\right\} \\
&  =\left\{  m\in U\ \mid\ m\in A_{i}\text{ for each }i\in I\right\} \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have renamed the index }s\text{
as }m\right) \\
&  =\left\{  m\in U\ \mid\ p_{i}\text{ divides }m\text{ for each }i\in
I\right\} \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{due to the equivalence
(\ref{pf.thm.eulerphi.prime-formula.mu1}), which holds for every }m\in
U\right) \\
&  =\left\{  m\in\left[  u\right]  \ \mid\ p_{i}\text{ divides }m\text{ for
each }i\in I\right\}  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }U=\left[
u\right]  \right) \\
&  =\left\{  m\in\left[  u\right]  \ \mid\ p_{j}\text{ divides }m\text{ for
each }j\in I\right\} \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have renamed the index }i\text{
as }j\right) \\
&  =\left\{  m\in\left[  u\right]  \ \mid\ \prod_{i\in I}p_{i}\text{ divides
}m\right\}  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the equivalence
(\ref{eq.lem.eulerphi.2.equiv})}\right)  .
\end{align*}
This proves (\ref{pf.thm.eulerphi.prime-formula.cap-Ai=}).]

As a consequence of (\ref{pf.thm.eulerphi.prime-formula.cap-Ai=}), we can now
easily see the following: If $I$ is a subset of $\left[  n\right]  $, then%
\begin{equation}
\left\vert \left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\}
\right\vert =u\cdot\prod_{i\in I}\dfrac{1}{p_{i}}.
\label{pf.thm.eulerphi.prime-formula.cap-Ai=s}%
\end{equation}


[\textit{Proof of (\ref{pf.thm.eulerphi.prime-formula.cap-Ai=s}):} Let $I$ be
a subset of $\left[  n\right]  $. All the primes $p_{i}$ (for different $i\in
I$) are distinct (since $p_{1},p_{2},\ldots,p_{n}$ are the distinct primes
that divide $u$). Furthermore, $p_{j}$ divides $u$ for each $j\in I$ (for the
same reason). But Lemma \ref{lem.eulerphi.2} (applied to $m=u$) shows that we
have the equivalence%
\[
\left(  p_{j}\text{ divides }u\text{ for each }j\in I\right)
\Longleftrightarrow\left(  \prod_{i\in I}p_{i}\text{ divides }u\right)  .
\]
Hence, $\prod_{i\in I}p_{i}$ divides $u$ (since $p_{j}$ divides $u$ for each
$j\in I$). Thus, Lemma \ref{lem.eulerphi.1} (applied to $v=\prod_{i\in I}%
p_{i}$) yields that
\[
\left(  \text{\# of }m\in\left[  u\right]  \text{ such that }\prod_{i\in
I}p_{i}\text{ divides }m\right)  =u/\left(  \prod_{i\in I}p_{i}\right)  .
\]


But (\ref{pf.thm.eulerphi.prime-formula.cap-Ai=}) yields
\begin{align*}
\left\vert \left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\}
\right\vert  &  =\left\vert \left\{  m\in\left[  u\right]  \ \mid\ \prod_{i\in
I}p_{i}\text{ divides }m\right\}  \right\vert \\
&  =\left(  \text{\# of }m\in\left[  u\right]  \text{ such that }\prod_{i\in
I}p_{i}\text{ divides }m\right) \\
&  =u/\left(  \prod_{i\in I}p_{i}\right)  =u\cdot\underbrace{\dfrac{1}%
{\prod_{i\in I}p_{i}}}_{=\prod_{i\in I}\dfrac{1}{p_{i}}}=u\cdot\prod_{i\in
I}\dfrac{1}{p_{i}}.
\end{align*}
This proves (\ref{pf.thm.eulerphi.prime-formula.cap-Ai=s}).]

Now, everything is in place. The equality
(\ref{pf.thm.eulerphi.prime-formula.whatnot-size}) becomes%
\begin{align*}
\phi\left(  u\right)   &  =\left\vert U\setminus\left(  A_{1}\cup A_{2}%
\cup\cdots\cup A_{n}\right)  \right\vert \\
&  =\sum_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\underbrace{\left\vert \left\{  s\in U\ \mid\ s\in A_{i}\text{
for all }i\in I\right\}  \right\vert }_{\substack{=u\cdot\prod_{i\in I}%
\dfrac{1}{p_{i}}\\\text{(by (\ref{pf.thm.eulerphi.prime-formula.cap-Ai=s}))}%
}}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.pie.bU}}\right) \\
&  =\sum_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }u\cdot\prod_{i\in I}\dfrac{1}{p_{i}}=u\cdot\underbrace{\sum
_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert I\right\vert
}\prod_{i\in I}\dfrac{1}{p_{i}}}_{\substack{=\left(  1-\dfrac{1}{p_{1}%
}\right)  \left(  1-\dfrac{1}{p_{2}}\right)  \cdots\left(  1-\dfrac{1}{p_{n}%
}\right)  \\\text{(by Lemma \ref{lem.eulerphi.proda} \textbf{(b)}, applied to
}a_{i}=\dfrac{1}{p_{i}}\text{)}}}\\
&  =u\cdot\underbrace{\left(  1-\dfrac{1}{p_{1}}\right)  \left(  1-\dfrac
{1}{p_{2}}\right)  \cdots\left(  1-\dfrac{1}{p_{n}}\right)  }_{=\prod
_{i=1}^{n}\left(  1-\dfrac{1}{p_{i}}\right)  }=u\cdot\prod_{i=1}^{n}\left(
1-\dfrac{1}{p_{i}}\right)  .
\end{align*}
This proves Theorem \ref{thm.eulerphi.prime-formula}.
\end{proof}

\subsubsection{Other cancellation-type lemmas}

Propositions \ref{prop.DIE.destruct1} and \ref{prop.DIE.destruct2} belong to a
genre of results saying that certain sums simplify to $0$ in most cases. The
following exercises give other specimens of this kind of result:

\begin{exercise}
\label{exe.DIE.etabasis-lem}Let $S$ be a finite set. Let $T$ be any set. Prove
that%
\[
\sum_{I\subseteq S}\left(  -1\right)  ^{\left\vert I\setminus T\right\vert }=%
\begin{cases}
2^{\left\vert S\right\vert }, & \text{if }S\subseteq T;\\
0, & \text{otherwise}%
\end{cases}
\ \ .
\]

\end{exercise}

\begin{exercise}
\label{exe.DIE.destructXY}Let $S$ be a finite set. Let $X$ and $Y$ be two
\textbf{distinct} subsets of $S$. Prove that
\[
\sum_{I\subseteq S}\left(  -1\right)  ^{\left\vert X\cap I\right\vert
+\left\vert Y\cap I\right\vert }=0.
\]

\end{exercise}

\begin{center}
\fbox{\textbf{Class of 2019-11-04}}
\end{center}

\subsection{\label{sect.binom.compos}Compositions and weak compositions}

We already know how to count $n$-tuples of elements of a set $A$: They are the
elements of $A^{n}$, so their number is $\left\vert A^{n}\right\vert
=\left\vert A\right\vert ^{n}$ (by Corollary \ref{cor.powruleAn}). We shall
now turn to some subtler tuple-counting problems. Specifically, we will count
tuples of integers with a given sum.

\subsubsection{\label{subsect.binom.compos.comp}Compositions}

How many ways are there to write $5$ as a sum of $3$ positive integers, if the
order matters? In other words, how many $3$-tuples $\left(  x_{1},x_{2}%
,x_{3}\right)  $ of positive integers satisfy $x_{1}+x_{2}+x_{3}=5$ ? The
answer is that there are $6$ such $3$-tuples (i.e., there are $6$ ways to
write $5$ as a sum of $3$ positive integers), namely
\[
\left(  1,1,3\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  1,3,1\right)
,\ \ \ \ \ \ \ \ \ \ \left(  3,1,1\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
1,2,2\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  2,1,2\right)
,\ \ \ \ \ \ \ \ \ \ \left(  2,2,1\right)  .
\]
Indeed,%
\[
5=1+1+3=1+3+1=3+1+1=1+2+2=2+1+2=2+2+1.
\]


What if we replace $5$ and $3$ by two arbitrary nonnegative integers $n$ and
$k$ ? In other words, how many $k$-tuples $\left(  x_{1},x_{2},\ldots
,x_{k}\right)  $ of positive integers satisfy $x_{1}+x_{2}+\cdots+x_{k}=n$ ?
The following theorem answers this question:

\begin{theorem}
\label{thm.binom.compos.count}Let $\mathbb{P}=\left\{  1,2,3,\ldots\right\}  $
be the set of all positive integers. Let $n\in\mathbb{N}$ and $k\in\mathbb{N}%
$. Then,%
\begin{align}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in
\mathbb{P}^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n\right) \nonumber\\
&  =\dbinom{n-1}{n-k}\label{eq.thm.binom.compos.count.r1}\\
&  =%
\begin{cases}
\dbinom{n-1}{k-1}, & \text{if }n>0;\\
\left[  k=0\right]  , & \text{if }n=0
\end{cases}
. \label{eq.thm.binom.compos.count.r2}%
\end{align}

\end{theorem}

Before we prove Theorem \ref{thm.binom.compos.count}, let us introduce some
terminology for the tuples counted in it:

\begin{definition}
\label{def.compos}\textbf{(a)} A \emph{composition} shall mean a tuple (i.e.,
a finite list) of positive integers.

\textbf{(b)} If $k\in\mathbb{N}$, then a \emph{composition into }$k$\emph{
parts} shall mean a $k$-tuple of positive integers.

\textbf{(c)} If $n\in\mathbb{N}$, then a \emph{composition of }$n$ shall mean
a tuple of positive integers whose sum is $n$.

\textbf{(d)} If $n\in\mathbb{N}$ and $k\in\mathbb{N}$, then a
\emph{composition of }$n$\emph{ into }$k$\emph{ parts} shall mean a $k$-tuple
of positive integers whose sum is $n$.
\end{definition}

Note that the compositions we have just defined have nothing to do with the
composition $f\circ g$ of two maps $f$ and $g$. The use of the same word for
the two completely unrelated concepts is a historical accident.

\begin{example}
\label{exa.compos.3-0}\textbf{(a)} The compositions of $5$ into $3$ parts are%
\[
\left(  1,1,3\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  1,3,1\right)
,\ \ \ \ \ \ \ \ \ \ \left(  3,1,1\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
1,2,2\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  2,1,2\right)
,\ \ \ \ \ \ \ \ \ \ \left(  2,2,1\right)  .
\]
This is just a restatement of what we said before Theorem
\ref{thm.binom.compos.count}.

\textbf{(b)} The compositions of $3$ are%
\[
\left(  3\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  1,2\right)
,\ \ \ \ \ \ \ \ \ \ \left(  2,1\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
1,1,1\right)  .
\]
The first of these is a composition into $1$ part; the last is a composition
into $3$ parts; the other two are compositions into $2$ parts.

\textbf{(c)} The only composition of $0$ is the $0$-tuple $\left(  {}\right)
$; it is a composition into $0$ parts.
\end{example}

If $n\in\mathbb{N}$ and $k\in\mathbb{N}$, then the compositions of $n$ into
$k$ parts are the $k$-tuples of positive integers whose sum is $n$. In other
words, they are the $k$-tuples $\left(  x_{1},x_{2},\ldots,x_{k}\right)
\in\mathbb{P}^{k}$ satisfying $x_{1}+x_{2}+\cdots+x_{k}=n$ (where we are using
the notation $\mathbb{P}=\left\{  1,2,3,\ldots\right\}  $). Hence, Theorem
\ref{thm.binom.compos.count} can be restated as follows:%
\begin{align*}
&  \left(  \text{\# of compositions of }n\text{ into }k\text{ parts}\right) \\
&  =\dbinom{n-1}{n-k}\\
&  =%
\begin{cases}
\dbinom{n-1}{k-1}, & \text{if }n>0;\\
\left[  k=0\right]  , & \text{if }n=0
\end{cases}
\end{align*}
for any $n\in\mathbb{N}$ and $k\in\mathbb{N}$.

We shall now outline a proof of Theorem \ref{thm.binom.compos.count},
referring to \cite[solution to Exercise 1 \textbf{(b)}]{19f-hw0s} (where a
similar argument is made in a slightly different proof) and to Exercise
\ref{exe.binom.compos.count0} for some missing details. A different proof will
be given in Exercise \ref{exe.binom.compos.count2} further below.

\begin{proof}
[Proof of Theorem \ref{thm.binom.compos.count} (sketched).]It is easy to see
that Theorem \ref{thm.binom.compos.count} holds when $n=0$ (see Exercise
\ref{exe.binom.compos.count0} \textbf{(b)} below for the proof). Thus, for the
rest of this proof, we WLOG assume that $n\neq0$. Hence, $n\geq1$ (since
$n\in\mathbb{N}$). Thus, $n-1\in\mathbb{N}$.

It is easy to see that Theorem \ref{thm.binom.compos.count} holds when $k=0$
(see Exercise \ref{exe.binom.compos.count0} \textbf{(c)} below for the proof).
Thus, for the rest of this proof, we WLOG assume that $k\neq0$. Hence,
$k\geq1$ (since $k\in\mathbb{N}$). Thus, $k-1\in\mathbb{N}$.

A $k$-tuple of positive integers whose sum is $n$ is the same as a composition
of $n$ into $k$ parts\footnote{since this is how a composition of $n$ into $k$
parts was defined in Definition \ref{def.compos} \textbf{(d)}}. In other
words, a $k$-tuple $\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\mathbb{P}%
^{k}$ satisfying $x_{1}+x_{2}+\cdots+x_{k}=n$ is the same as a composition of
$n$ into $k$ parts\footnote{since $\mathbb{P}$ is the set of all positive
integers}. Therefore,
\begin{align}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in
\mathbb{P}^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n\right) \nonumber\\
&  =\left(  \text{\# of compositions of }n\text{ into }k\text{ parts}\right)
. \label{pf.thm.binom.compos.count.comp=comp}%
\end{align}


Now, we define a map%
\[
C:\left\{  \text{compositions of }n\text{ into }k\text{ parts}\right\}
\rightarrow\left\{  \left(  k-1\right)  \text{-element subsets of }\left[
n-1\right]  \right\}
\]
by setting%
\begin{align*}
C\left(  \left(  a_{1},a_{2},\ldots,a_{k}\right)  \right)   &  =\left\{
a_{1}+a_{2}+\cdots+a_{i}\ \mid\ i\in\left[  k-1\right]  \right\} \\
&  =\left\{  a_{1},\ \ a_{1}+a_{2},\ \ a_{1}+a_{2}+a_{3},\ \ \ldots
,\ \ a_{1}+a_{2}+\cdots+a_{k-1}\right\} \\
&  \ \ \ \ \ \ \ \ \ \ \text{for all compositions }\left(  a_{1},a_{2}%
,\ldots,a_{k}\right)  \text{ of }n\text{ into }k\text{ parts.}%
\end{align*}
It is easy to see that this map $C$ is well-defined\footnote{\textit{Proof.}
We need to show that $\left\{  a_{1}+a_{2}+\cdots+a_{i}\ \mid\ i\in\left[
k-1\right]  \right\}  $ is actually a $\left(  k-1\right)  $-element subset of
$\left[  n-1\right]  $ whenever $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ is
a composition of $n$ into $k$ parts.
\par
So let $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ be a composition of $n$
into $k$ parts. We must show that $\left\{  a_{1}+a_{2}+\cdots+a_{i}%
\ \mid\ i\in\left[  k-1\right]  \right\}  $ is a $\left(  k-1\right)
$-element subset of $\left[  n-1\right]  $. In \cite[solution to Exercise 1
\textbf{(b)}, proof of the well-definedness of $C$]{19f-hw0s}, it is shown
that $\left\{  a_{1}+a_{2}+\cdots+a_{i}\ \mid\ i\in\left[  k-1\right]
\right\}  $ is a subset of $\left[  n-1\right]  $. It thus remains to only
show that this subset is a $\left(  k-1\right)  $-element subset.
\par
The $k$-tuple $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ is a composition;
thus, its entries $a_{1},a_{2},\ldots,a_{k}$ are positive integers. Hence, we
have the chain of inequalities
\[
a_{1}<a_{1}+a_{2}<a_{1}+a_{2}+a_{3}<\cdots<a_{1}+a_{2}+\cdots+a_{k-1}.
\]
Thus, the $k-1$ numbers $a_{1},\ \ a_{1}+a_{2},\ \ a_{1}+a_{2}+a_{3}%
,\ \ \ldots,\ \ a_{1}+a_{2}+\cdots+a_{k-1}$ are distinct. In other words, the
$k-1$ numbers $a_{1}+a_{2}+\cdots+a_{i}$ for $i\in\left[  k-1\right]  $ are
distinct. Hence, the set $\left\{  a_{1}+a_{2}+\cdots+a_{i}\ \mid\ i\in\left[
k-1\right]  \right\}  $ is a $\left(  k-1\right)  $-element set. Since this
set is a subset of $\left[  n-1\right]  $, we thus conclude that it is a
$\left(  k-1\right)  $-element subset of $\left[  n-1\right]  $. This
completes our proof.}.

(For example, if $n=10$ and $k=3$, then applying the map $C$ to the
composition $\left(  3,5,2\right)  $ yields $C\left(  \left(  3,5,2\right)
\right)  =\left\{  3,3+5\right\}  =\left\{  3,8\right\}  $.)

Next, we define a map%
\[
D:\left\{  \left(  k-1\right)  \text{-element subsets of }\left[  n-1\right]
\right\}  \rightarrow\left\{  \text{compositions of }n\text{ into }k\text{
parts}\right\}
\]
as follows: Let $S$ be a $\left(  k-1\right)  $-element subset of $\left[
n-1\right]  $. Thus, Proposition \ref{prop.intset.inclist-k} (applied to
$m=k-1$) shows that there exists a unique $\left(  k-1\right)  $-tuple
$\left(  s_{1},s_{2},\ldots,s_{k-1}\right)  $ of integers satisfying $\left\{
s_{1},s_{2},\ldots,s_{k-1}\right\}  =S$ and $s_{1}<s_{2}<\cdots<s_{k-1}$.
Consider this $\left(  k-1\right)  $-tuple, and extend it further to a
$\left(  k+1\right)  $-tuple $\left(  s_{0},s_{1},\ldots,s_{k}\right)  $ by
setting $s_{0}=0$ and $s_{k}=n$. Then, it is easy to see that $s_{0}%
<s_{1}<\cdots<s_{k}$\ \ \ \ \footnote{Indeed, this can be proved just as
$s_{0}<s_{1}<\cdots<s_{k+1}$ is proved in \cite[solution to Exercise 1
\textbf{(b)}, construction of the map $D$]{19f-hw0s} (with the caveat that
what we call $k$ here corresponds to the $k+1$ in \cite[solution to Exercise 1
\textbf{(b)}, construction of the map $D$]{19f-hw0s}).}. Now, set
\[
D\left(  S\right)  =\left(  s_{1}-s_{0},s_{2}-s_{1},\ldots,s_{k}%
-s_{k-1}\right)  .
\]
This defines $D$. It is easy to see that this map $D$ is
well-defined\footnote{This can be done as in \cite[solution to Exercise 1
\textbf{(b)}, proof of the well-definedness of $D$]{19f-hw0s}.}.

Note that the map $D$ depends on $n$. For example,

\begin{itemize}
\item if $n=6$ and $k=4$, then $D\left(  \left\{  2,3,5\right\}  \right)
=\left(  2,1,2,1\right)  $; but

\item if $n=7$ and $k=4$, then $D\left(  \left\{  2,3,5\right\}  \right)
=\left(  2,1,2,2\right)  $.
\end{itemize}

Now, it is easy to check that the maps $C$ and $D$ are mutually
inverse\footnote{This can be done as in \cite[solution to Exercise 1
\textbf{(b)}]{19f-hw0s}.}. Thus, the map%
\[
C:\left\{  \text{compositions of }n\text{ into }k\text{ parts}\right\}
\rightarrow\left\{  \left(  k-1\right)  \text{-element subsets of }\left[
n-1\right]  \right\}
\]
is invertible, i.e., is a bijection. Hence, the bijection principle yields%
\begin{align}
&  \left\vert \left\{  \text{compositions of }n\text{ into }k\text{
parts}\right\}  \right\vert \nonumber\\
&  =\left\vert \left\{  \left(  k-1\right)  \text{-element subsets of }\left[
n-1\right]  \right\}  \right\vert \nonumber\\
&  =\left(  \text{\# of }\left(  k-1\right)  \text{-element subsets of
}\left[  n-1\right]  \right) \nonumber\\
&  =\dbinom{n-1}{k-1} \label{pf.thm.binom.compos.count.1stbin}%
\end{align}
(by Theorem \ref{thm.binom.comb}, applied to $\left[  n-1\right]  $, $n-1$ and
$k-1$ instead of $S$, $n$ and $k$).

Now, (\ref{pf.thm.binom.compos.count.comp=comp}) becomes%
\begin{align*}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in
\mathbb{P}^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n\right) \\
&  =\left(  \text{\# of compositions of }n\text{ into }k\text{ parts}\right)
\\
&  =\left\vert \left\{  \text{compositions of }n\text{ into }k\text{
parts}\right\}  \right\vert \\
&  =\dbinom{n-1}{k-1}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.thm.binom.compos.count.1stbin})}\right) \\
&  =\dbinom{n-1}{\left(  n-1\right)  -\left(  k-1\right)  }%
\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Theorem \ref{thm.binom.sym} (applied to }n-1\text{ and }k-1\\
\text{instead of }n\text{ and }k\text{), since }n-1\in\mathbb{N}%
\end{array}
\right) \\
&  =\dbinom{n-1}{n-k}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left(
n-1\right)  -\left(  k-1\right)  =n-k\right)  .
\end{align*}
This proves (\ref{eq.thm.binom.compos.count.r1}). Comparing this with%
\begin{align*}%
\begin{cases}
\dbinom{n-1}{k-1}, & \text{if }n>0;\\
\left[  k=0\right]  , & \text{if }n=0
\end{cases}
&  =\dbinom{n-1}{k-1}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }n>0\right) \\
&  =\dbinom{n-1}{n-k},
\end{align*}
we obtain (\ref{eq.thm.binom.compos.count.r2}). Thus, Theorem
\ref{thm.binom.compos.count} is proved.
\end{proof}

\begin{exercise}
\label{exe.binom.compos.count0}The purpose of this exercise is to supply some
missing details for the above proof of Theorem \ref{thm.binom.compos.count}.

\textbf{(a)} Prove that any $n\in\mathbb{N}$ and $k\in\mathbb{N}$ satisfy
\[
\dbinom{n-1}{n-k}=%
\begin{cases}
\dbinom{n-1}{k-1}, & \text{if }n>0;\\
\left[  k=0\right]  , & \text{if }n=0
\end{cases}
.
\]


\textbf{(b)} Prove that Theorem \ref{thm.binom.compos.count} holds for $n=0$.

\textbf{(c)} Prove that Theorem \ref{thm.binom.compos.count} holds for $k=0$.
\end{exercise}

\begin{exercise}
\label{exe.binom.compos.count2}Prove Theorem \ref{thm.binom.compos.count} by
induction on $k$.
\end{exercise}

\subsubsection{\label{subsect.binom.compos.bicomp}Binary compositions}

Let us now count the ways to write a given $n\in\mathbb{N}$ not as a sum of
$k$ positive integers, but as a sum of $k$ elements of the set $\left\{
0,1\right\}  $:

\begin{theorem}
\label{thm.binom.bicompos.count}Let $n\in\mathbb{Z}$ and $k\in\mathbb{N}$.
Then,%
\begin{align*}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{
0,1\right\}  ^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n\right) \\
&  =\dbinom{k}{n}.
\end{align*}

\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.binom.bicompos.count} (sketched).]Here is the idea
of the proof:

If $\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{  0,1\right\}  ^{k}$ is
a $k$-tuple, then each index $i\in\left[  k\right]  $ satisfies either
$x_{i}=0$ or $x_{i}=1$; furthermore, the sum $x_{1}+x_{2}+\cdots+x_{k}$ of all
entries of this $k$-tuple is precisely the number of indices $i\in\left[
k\right]  $ satisfying $x_{i}=1$ (because each such index contributes a $1$ to
this sum, whereas all remaining indices contribute $0$'s).

Thus, in order to construct a $k$-tuple $\left(  x_{1},x_{2},\ldots
,x_{k}\right)  \in\left\{  0,1\right\}  ^{k}$ satisfying $x_{1}+x_{2}%
+\cdots+x_{k}=n$, we just need to choose which $n$ indices $i\in\left[
k\right]  $ will satisfy $x_{i}=1$ (because then, the remaining $k-n$ indices
$i\in\left[  k\right]  $ will necessarily satisfy $x_{i}=0$). There are
$\dbinom{k}{n}$ many options for this, since this boils down to choosing an
$n$-element subset of $\left[  k\right]  $ (and Theorem \ref{thm.binom.comb}
says that there are $\dbinom{k}{n}$ such subsets).\medskip

\begin{fineprint}
A formal version of this argument would proceed using the bijection principle.
Namely, it would argue that the map%
\begin{align*}
\left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{  0,1\right\}
^{k}\ \mid\ x_{1}+x_{2}+\cdots+x_{k}=n\right\}   &  \rightarrow\left\{
n\text{-element subsets of }\left[  k\right]  \right\}  ,\\
\left(  x_{1},x_{2},\ldots,x_{k}\right)   &  \mapsto\left\{  i\in\left[
k\right]  \ \mid\ x_{i}=1\right\}
\end{align*}
is a bijection; therefore, the bijection principle yields%
\begin{align*}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{
0,1\right\}  ^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n\right) \\
&  =\left(  \text{\# of }n\text{-element subsets of }\left[  k\right]  \right)
\\
&  =\dbinom{k}{n}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem
\ref{thm.binom.comb}, applied to }k\text{ and }n\text{ instead of }n\text{ and
}k\right)  .
\end{align*}

\end{fineprint}
\end{proof}

\begin{exercise}
\label{exe.binom.bicompos.count2}Prove Theorem \ref{thm.binom.bicompos.count}
by induction on $k$.
\end{exercise}

\subsubsection{\label{subsect.binom.compos.wecomp}Weak compositions}

Let us next count the ways to write a given $n\in\mathbb{N}$ as a sum of $k$
\textbf{nonnegative} integers:

\begin{theorem}
\label{thm.binom.wecompos.count}Let $n\in\mathbb{N}$ and $k\in\mathbb{N}$.
Then,%
\begin{align}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in
\mathbb{N}^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n\right) \nonumber\\
&  =\dbinom{n+k-1}{n}\label{eq.thm.binom.wecompos.count.r1}\\
&  =%
\begin{cases}
\dbinom{n+k-1}{k-1}, & \text{if }k>0;\\
\left[  n=0\right]  , & \text{if }k=0
\end{cases}
. \label{eq.thm.binom.wecompos.count.r2}%
\end{align}

\end{theorem}

\begin{remark}
Tuples of nonnegative integers are called \emph{weak compositions}. Thus,
Theorem \ref{thm.binom.wecompos.count} can be considered as a formula for
counting (certain) weak compositions.
\end{remark}

\begin{example}
For $n=2$ and $k=3$, the $k$-tuples $\left(  x_{1},x_{2},\ldots,x_{k}\right)
\in\mathbb{N}^{k}$ satisfying $x_{1}+x_{2}+\cdots+x_{k}=n$ are%
\[
\left(  0,0,2\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  0,2,0\right)
,\ \ \ \ \ \ \ \ \ \ \left(  2,0,0\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
0,1,1\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  1,0,1\right)
,\ \ \ \ \ \ \ \ \ \ \left(  1,1,0\right)  ,
\]
because%
\[
2=0+0+2=0+2+0=2+0+0=0+1+1=1+0+1=1+1+0.
\]
Thus, their \# is $6$. This is exactly what
(\ref{eq.thm.binom.wecompos.count.r1}) yields, since $\dbinom{2+3-1}%
{2}=\dbinom{4}{2}=6$.
\end{example}

\begin{proof}
[Proof of Theorem \ref{thm.binom.wecompos.count}.]Let $\mathbb{P}$ denote the
set $\left\{  1,2,3,\ldots\right\}  $ of all positive integers.

If $x$ is a nonnegative integer, then $x+1$ is a positive integer. In other
words, if $x\in\mathbb{N}$, then $x+1\in\mathbb{P}$. Hence, if a $k$-tuple
$\left(  x_{1},x_{2},\ldots,x_{k}\right)  $ belongs to $\mathbb{N}^{k}$ and
satisfies $x_{1}+x_{2}+\cdots+x_{k}=n$, then the $k$-tuple $\left(
x_{1}+1,x_{2}+1,\ldots,x_{k}+1\right)  $ belongs to $\mathbb{P}^{k}$ and
satisfies%
\[
\left(  x_{1}+1\right)  +\left(  x_{2}+1\right)  +\cdots+\left(
x_{k}+1\right)  =\underbrace{\left(  x_{1}+x_{2}+\cdots+x_{k}\right)  }%
_{=n}+\underbrace{\underbrace{1+1+\cdots+1}_{k\text{ times}}}_{=k}=n+k.
\]
Hence, the map%
\begin{align*}
&  \left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\mathbb{N}^{k}\mid
x_{1}+x_{2}+\cdots+x_{k}=n\right\} \\
&  \rightarrow\left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in
\mathbb{P}^{k}\mid x_{1}+x_{2}+\cdots+x_{k}=n+k\right\}  ,\\
\left(  x_{1},x_{2},\ldots,x_{k}\right)   &  \mapsto\left(  x_{1}%
+1,x_{2}+1,\ldots,x_{k}+1\right)
\end{align*}
is well-defined. It is easy to see that this map is a bijection. Thus, the
bijection principle yields%
\begin{align*}
&  \left\vert \left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in
\mathbb{N}^{k}\mid x_{1}+x_{2}+\cdots+x_{k}=n\right\}  \right\vert \\
&  =\left\vert \left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in
\mathbb{P}^{k}\mid x_{1}+x_{2}+\cdots+x_{k}=n+k\right\}  \right\vert .
\end{align*}
In other words,%
\begin{align*}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in
\mathbb{N}^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n\right) \\
&  =\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)
\in\mathbb{P}^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n+k\right) \\
&  =\dbinom{\left(  n+k\right)  -1}{\left(  n+k\right)  -k}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{eq.thm.binom.compos.count.r1}),
applied to }n+k\text{ instead of }n\right) \\
&  =\dbinom{n+k-1}{n}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left(
n+k\right)  -1=n+k-1\text{ and }\left(  n+k\right)  -k=n\right)  .
\end{align*}
This proves (\ref{eq.thm.binom.wecompos.count.r1}).

Continuing this computation, we obtain%
\begin{align*}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in
\mathbb{N}^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n\right) \\
&  =\dbinom{n+k-1}{n}=%
\begin{cases}
\dbinom{n+k-1}{k-1}, & \text{if }k>0;\\
\left[  n=0\right]  , & \text{if }k=0
\end{cases}
\end{align*}
(by Theorem \ref{thm.binom.sym} and an easy distinction of cases\footnote{See
Exercise \ref{exe.binom.wecompos.count0} below for a detailed justification of
the last equality sign.}). This proves (\ref{eq.thm.binom.wecompos.count.r2}).
Thus, Theorem \ref{thm.binom.wecompos.count} is proven.
\end{proof}

\begin{exercise}
\label{exe.binom.wecompos.count0}Let $n\in\mathbb{N}$ and $k\in\mathbb{N}$.
Prove that%
\[
\dbinom{n+k-1}{n}=%
\begin{cases}
\dbinom{n+k-1}{k-1}, & \text{if }k>0;\\
\left[  n=0\right]  , & \text{if }k=0
\end{cases}
.
\]

\end{exercise}

The equality (\ref{eq.thm.binom.wecompos.count.r1}) also appears in
\cite[Exercise 3.15]{detnotes} (with a proof by induction).

\subsubsection{Other composition-like counting problems}

Theorem \ref{thm.binom.compos.count}, Theorem \ref{thm.binom.wecompos.count}
and Theorem \ref{thm.binom.bicompos.count} are perhaps the three most
important results about counting tuples of integers with a given sum. But
there are many others. First of all, we can count compositions of $n$ without
specifying the number of parts:

\begin{theorem}
\label{thm.binom.compos.all}Let $n\in\mathbb{N}$. Then,%
\[
\left(  \text{\# of compositions of }n\right)  =%
\begin{cases}
2^{n-1}, & \text{if }n>0\\
1, & \text{if }n=0
\end{cases}
.
\]

\end{theorem}

For the proof of Theorem \ref{thm.binom.compos.all}, see \cite[Exercise 1
\textbf{(b)}]{19f-hw0s}.

We may also want to count compositions of $n$ whose entries belong to
$\left\{  1,2\right\}  $ -- that is, ways to write $n$ as a sum of $1$'s and
$2$'s. The answer turns out to be simple again:

\begin{exercise}
\label{exe.binom.compos.12}Let $n\in\mathbb{N}$.

A $\left\{  1,2\right\}  $\emph{-composition of }$n$ shall mean a composition
$\left(  x_{1},x_{2},\ldots,x_{k}\right)  $ of $n$ such that $x_{1}%
,x_{2},\ldots,x_{k}\in\left\{  1,2\right\}  $.

For example, the $\left\{  1,2\right\}  $-compositions of $5$ are%
\begin{align*}
&  \left(  1,1,1,1,1\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  1,1,1,2\right)
,\ \ \ \ \ \ \ \ \ \ \left(  1,1,2,1\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
1,2,1,1\right)  ,\\
&  \left(  2,1,1,1\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  2,2,1\right)
,\ \ \ \ \ \ \ \ \ \ \left(  2,1,2\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
1,2,2\right)  .
\end{align*}


\textbf{(a)} Prove that%
\[
\left(  \text{\# of }\left\{  1,2\right\}  \text{-compositions of }n\right)
=f_{n+1}%
\]
(where $\left(  f_{0},f_{1},f_{2},\ldots\right)  $ denotes the Fibonacci
sequence, as defined in Definition \ref{def.fib}).

\textbf{(b)} Let $k\in\mathbb{N}$. A $\left\{  1,2\right\}  $%
\emph{-composition of }$n$\emph{ into }$k$\emph{ parts} shall mean a
composition $\left(  x_{1},x_{2},\ldots,x_{k}\right)  $ of $n$ into $k$ parts
such that $x_{1},x_{2},\ldots,x_{k}\in\left\{  1,2\right\}  $.

Prove that
\[
\left(  \text{\# of }\left\{  1,2\right\}  \text{-compositions of }n\text{
into }k\text{ parts}\right)  =\dbinom{k}{n-k}.
\]

\end{exercise}

Also, we can try to generalize Theorem \ref{thm.binom.bicompos.count} by
replacing $\left\{  0,1\right\}  $ by $\left\{  0,1,\ldots,p-1\right\}  $ for
a given $p\in\mathbb{N}$. Thus, we look for the \# of $\left(  x_{1}%
,x_{2},\ldots,x_{k}\right)  \in\left\{  0,1,\ldots,p-1\right\}  ^{k}$
satisfying $x_{1}+x_{2}+\cdots+x_{k}=n$. The answer to this counting problem,
however, will not be as simple as $\dbinom{k}{n}$:

\begin{exercise}
\label{exe.binom.compos.p}Let $p\in\mathbb{N}$. Let $n\in\mathbb{Z}$ and
$k\in\mathbb{N}$. Prove that%
\begin{align*}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{
0,1,\ldots,p-1\right\}  ^{k}\text{ satisfying }x_{1}+x_{2}+\cdots
+x_{k}=n\right) \\
&  =\sum_{j=0}^{k}\left(  -1\right)  ^{j}\dbinom{k}{j}\dbinom{n-pj+k-1}{n-pj}.
\end{align*}


[\textbf{Hint:} Use the Principle of Inclusion and Exclusion, keeping in mind
that $\left\{  0,1,\ldots,p-1\right\}  =\mathbb{N}\setminus\left\{
i\in\mathbb{N}\ \mid\ i\geq p\right\}  $.]
\end{exercise}

The next exercise is a simple-looking identity for binomial coefficients,
which can be nicely solved using weak compositions despite not explicitly
involving them:

\begin{exercise}
\label{exe.binom.nCk-2i-qedmo}Let $n\in\mathbb{N}$ and $k\in\mathbb{N}$. Prove
that
\[
\sum_{i=0}^{k}\dbinom{n+i-1}{i}\dbinom{n}{k-2i}=\dbinom{n+k-1}{k}.
\]


[\textbf{Hint:} Any nonnegative integer $u$ can be written as $u=2q+r$ for a
unique $q\in\mathbb{N}$ and a unique $r\in\left\{  0,1\right\}  $. What does
this mean for weak compositions of $k$ into $n$ parts?]
\end{exercise}

\begin{exercise}
\label{exe.binom.nCk-2i-qedmo-gen}Generalize Exercise
\ref{exe.binom.nCk-2i-qedmo} to all $n\in\mathbb{R}$.
\end{exercise}

Rather than count the compositions of an integer, we can also count them
\textquotedblleft with weight\textquotedblright\ -- i.e., sum certain values
over them. Perhaps the simplest such value is the length. Recall that the
\emph{length} of a tuple $\left(  x_{1},x_{2},\ldots,x_{k}\right)  $ is
defined to be the integer $k$. In other words, the length of a tuple $\alpha$
is the $k\in\mathbb{N}$ such that $\alpha$ is a $k$-tuple. Thus, each
composition has a well-defined length (since it is a tuple).

\begin{exercise}
\label{exe.binom.compos.sum-len}Let $n$ be a positive integer. Prove that the
sum of the lengths of all compositions of $n$ is $\left(  n+1\right)  2^{n-2}$.
\end{exercise}

\subsection{\label{sect.binom.mulsub}Multisubsets}

\subsubsection{Definitions}

The notion of a set is sufficiently versatile that it is often used as a
foundation to build all of mathematics upon. But it has its limitations; in
particular, a set cannot contain multiple copies of the same element. (More
precisely, a set $S$ can either contain or not contain an element $x$; it
makes no sense to ask \textquotedblleft how often\textquotedblright\ it
contains $x$.) Often, one wants to use a kind of collection that can contain
elements with multiplicities\footnote{For example, the roots of a polynomial
naturally come with multiplicities.}.
\href{https://en.wikipedia.org/wiki/Multiset}{The notion of a
\textit{multiset}} addresses this need (at least if the multiplicities of the
elements are nonnegative integers\footnote{There are also variants that allow
infinite multiplicities.}). Rather than define this notion, we shall however
introduce a slight modification thereof, namely the notion of a
\emph{multisubset} of a given set $T$:

\begin{definition}
\label{def.mulsub}Let $T$ be a set.

\textbf{(a)} A \emph{multisubset of }$T$ is formally defined as a map
$f:T\rightarrow\mathbb{N}$ such that only finitely many $t\in T$ satisfy
$f\left(  t\right)  \neq0$.

Informally, we regard such a map $f:T\rightarrow\mathbb{N}$ as a way to encode
a \textquotedblleft set with multiplicities\textquotedblright\ -- namely, the
\textquotedblleft set\textquotedblright\ in which each $t\in T$ appears
$f\left(  t\right)  $ many times.

\textbf{(b)} If $f$ is a multisubset of $T$, and if $t\in T$, then the number
$f\left(  t\right)  $ is called the \emph{multiplicity} of $t$ in $f$, and we
say that the element $t$ is contained in $T$ exactly $f\left(  t\right)  $
times. If $f\left(  t\right)  =0$, then we say that $t$ is \emph{not
contained} in $T$, and we write $t\notin T$.

\textbf{(c)} Let $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ be a finite list
of elements of $T$. (We don't require $a_{1},a_{2},\ldots,a_{k}$ to be
distinct.) Then, $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}$ shall denote the multisubset of $T$ in which each
element $t\in T$ is contained as many times as it is contained in the list
$\left(  a_{1},a_{2},\ldots,a_{k}\right)  $. In other words, $\left\{
a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}$ shall denote the
multisubset $f$ of $T$ defined by%
\begin{align*}
f\left(  t\right)   &  =\left(  \text{\# of times }t\text{ appears in the list
}\left(  a_{1},a_{2},\ldots,a_{k}\right)  \right) \\
&  =\left(  \text{\# of }i\in\left[  k\right]  \text{ satisfying }%
a_{i}=t\right)  \ \ \ \ \ \ \ \ \ \ \text{for each }t\in T.
\end{align*}

\end{definition}

For example, if $T=\left[  8\right]  $, then the map from $\left[  8\right]  $
to $\mathbb{N}$ given in two-line notation as%
\[
\left(
\begin{array}
[c]{cccccccc}%
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8\\
1 & 0 & 0 & 2 & 1 & 0 & 3 & 0
\end{array}
\right)
\]
is a multisubset of $\left[  8\right]  $, namely the multisubset of $\left[
8\right]  $ in which $1$ is contained $1$ time, $4$ is contained $2$ times,
$5$ is contained $1$ time, and $7$ is contained $3$ times (while the elements
$2$, $3$, $6$ and $8$ are not contained in this multisubset). This multisubset
can also be written as $\left\{  1,4,4,5,7,7,7\right\}
_{\operatorname*{multi}}$ or as $\left\{  7,5,4,7,4,1,7\right\}
_{\operatorname*{multi}}$ or in many other equivalent ways.

Note that $\left\{  1,1\right\}  _{\operatorname*{multi}}\neq\left\{
1\right\}  _{\operatorname*{multi}}$, despite $\left\{  1,1\right\}  =\left\{
1\right\}  $.

The requirement that \textquotedblleft only finitely many $t\in T$ satisfy
$f\left(  t\right)  \neq0$\textquotedblright\ in Definition \ref{def.mulsub}
\textbf{(a)} prevents us from having infinite multisubsets. Of course, if the
set $T$ is finite, then this requirement is automatically satisfied.

We note that many authors use the notation $\left\{  \left\{  a_{1}%
,a_{2},\ldots,a_{k}\right\}  \right\}  $ instead of our notation $\left\{
a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}$ for a multisubset.
However, the former notation can be misunderstood to mean a set consisting of
the set $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  $; thus we are avoiding it.

As we said, instead of defining multisubsets of a set $T$, we could have
defined multisets in general.\footnote{The easiest way to define them is as
follows: A \emph{multiset} is a pair $\left(  S,f\right)  $, where $S$ is a
finite set and $f:S\rightarrow\left\{  1,2,3,\ldots\right\}  $ is a map. The
elements of $S$ are considered to be the elements of this multiset, and the
values $f\left(  s\right)  $ are understood to be their multiplicities (i.e.,
any element $s\in S$ is understood to appear $f\left(  s\right)  $ times in
the multiset). This time, the map $f$ must have target $\left\{
1,2,3,\ldots\right\}  $ rather than $\mathbb{N}$ (that is, it cannot have $0$
in its image), since otherwise our multiset could have \textquotedblleft
ghost\textquotedblright\ elements $s$ that are considered to be its elements
but appear with multiplicity $0$.} We are preferring multisubsets of $T$ here,
as they are better adapted to counting purposes.

\begin{definition}
\label{def.mulsub.size}Let $T$ be a set. If $f:T\rightarrow\mathbb{N}$ is a
multisubset of $T$, then the \emph{size} of this multisubset $f$ is defined to
be the nonnegative integer $\sum\limits_{t\in T}f\left(  t\right)  $.
\end{definition}

For example, the above-mentioned multisubset $\left\{  1,4,4,5,7,7,7\right\}
_{\operatorname*{multi}}$ of $\left[  8\right]  $ has size $1+2+1+3=7$. Note
that the sum $\sum\limits_{t\in T}f\left(  t\right)  $ in Definition
\ref{def.mulsub.size} is well-defined, since we required in Definition
\ref{def.mulsub} that only finitely many $t\in T$ satisfy $f\left(  t\right)
\neq0$.

If $a_{1},a_{2},\ldots,a_{k}$ are $k$ objects, then the set $\left\{
a_{1},a_{2},\ldots,a_{k}\right\}  $ doesn't always have size $k$; its size
will be smaller than $k$ if some of $a_{1},a_{2},\ldots,a_{k}$ are equal. But
the multiset $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}$ always has size $k$, as the following simple
exercise shows:

\begin{exercise}
\label{exe.mulsub.size1}Let $T$ be a set. Let $k\in\mathbb{N}$. Let
$a_{1},a_{2},\ldots,a_{k}$ be any $k$ elements of $T$ (not necessarily
distinct). Prove that the multisubset $\left\{  a_{1},a_{2},\ldots
,a_{k}\right\}  _{\operatorname*{multi}}$ of $T$ has size $k$.
\end{exercise}

\subsubsection{Counting multisubsets of given size}

A finite nonempty set $T$ has infinitely many multisubsets, since any element
can appear any number of times. Thus, counting all multisubsets of a given
finite set $T$ is not a promising combinatorial question. However, we get a
finite number if we restrict ourselves to counting multisubsets with a given size:

\begin{corollary}
\label{cor.binom.mulsub.count}Let $n\in\mathbb{N}$ and $k\in\mathbb{N}$. Let
$T$ be a $k$-element set. Then,%
\[
\left(  \text{\# of multisubsets of }T\text{ having size }n\right)
=\dbinom{n+k-1}{n}.
\]

\end{corollary}

\begin{example}
The multisubsets of $\left[  3\right]  $ having size $2$ are%
\begin{align*}
&  \left\{  1,1\right\}  _{\operatorname*{multi}},\ \ \ \ \ \ \ \ \ \ \left\{
1,2\right\}  _{\operatorname*{multi}},\ \ \ \ \ \ \ \ \ \ \left\{
1,3\right\}  _{\operatorname*{multi}},\\
&  \left\{  2,2\right\}  _{\operatorname*{multi}},\ \ \ \ \ \ \ \ \ \ \left\{
2,3\right\}  _{\operatorname*{multi}},\ \ \ \ \ \ \ \ \ \ \left\{
3,3\right\}  _{\operatorname*{multi}}.
\end{align*}
In terms of their definition, these multisubsets are the maps from $\left[
3\right]  $ to $\mathbb{N}$ with the two-line notations%
\begin{align*}
&  \left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
2 & 0 & 0
\end{array}
\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
1 & 1 & 0
\end{array}
\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
1 & 0 & 1
\end{array}
\right)  ,\\
&  \left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
0 & 2 & 0
\end{array}
\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
0 & 1 & 1
\end{array}
\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
0 & 0 & 2
\end{array}
\right)  ,
\end{align*}
respectively. Either way, we see that there are $6$ of them, and this is what
Corollary \ref{cor.binom.mulsub.count} predicts (because $\dbinom{2+3-1}{2}=6$).
\end{example}

\begin{proof}
[Proof of Corollary \ref{cor.binom.mulsub.count}.]Let $t_{1},t_{2}%
,\ldots,t_{k}$ be the $k$ elements of $T$, listed in some order (with no
repetitions). Recall that a multisubset of $T$ is the same as a map
$f:T\rightarrow\mathbb{N}$ such that only finitely many $t\in T$ satisfy
$f\left(  t\right)  \neq0$ (according to Definition \ref{def.mulsub}
\textbf{(a)}). In other words, a multisubset of $T$ is the same as a map
$f:T\rightarrow\mathbb{N}$ (because the property that \textquotedblleft only
finitely many $t\in T$ satisfy $f\left(  t\right)  \neq0$\textquotedblright%
\ is automatically satisfied\footnote{since $T$ is finite}). Moreover, if
$f:T\rightarrow\mathbb{N}$ is a multisubset of $T$, then
\begin{align*}
\left(  \text{the size of }f\right)   &  =\sum_{t\in T}f\left(  t\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Definition \ref{def.mulsub.size}}\right)
\\
&  =f\left(  t_{1}\right)  +f\left(  t_{2}\right)  +\cdots+f\left(
t_{k}\right)
\end{align*}
(since $t_{1},t_{2},\ldots,t_{k}$ are the $k$ elements of $T$). Hence, the
multisubsets of $T$ having size $n$ are precisely the maps $f:T\rightarrow
\mathbb{N}$ satisfying $f\left(  t_{1}\right)  +f\left(  t_{2}\right)
+\cdots+f\left(  t_{k}\right)  =n$. Clearly, such maps $f:T\rightarrow
\mathbb{N}$ are uniquely determined by their lists of values $\left(  f\left(
t_{1}\right)  ,f\left(  t_{2}\right)  ,\ldots,f\left(  t_{k}\right)  \right)
\in\mathbb{N}^{k}$ (since $t_{1},t_{2},\ldots,t_{k}$ are the $k$ elements of
$T$). Thus, the map%
\begin{align*}
\left\{  \text{multisubsets of }T\text{ having size }n\right\}   &
\rightarrow\left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\mathbb{N}%
^{k}\ \mid\ x_{1}+x_{2}+\cdots+x_{k}=n\right\}  ,\\
f  &  \mapsto\left(  f\left(  t_{1}\right)  ,f\left(  t_{2}\right)
,\ldots,f\left(  t_{k}\right)  \right)
\end{align*}
is a bijection. Hence, the bijection principle yields%
\begin{align*}
&  \left(  \text{\# of multisubsets of }T\text{ having size }n\right) \\
&  =\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)
\in\mathbb{N}^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n\right) \\
&  =\dbinom{n+k-1}{n}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{eq.thm.binom.wecompos.count.r1})}\right)  .
\end{align*}
This proves Corollary \ref{cor.binom.mulsub.count}.
\end{proof}

\subsubsection{An application to lacunar subsets}

We shall now outline an application of multisubsets. First, however, let us
state two propositions, which are fairly obvious intuitively (even though
proving them formally is somewhat time-consuming):\footnote{Note that a
multisubset of a set $T$ is defined as a map from $T$ to $\mathbb{N}$, so you
might expect me to use a letter like $f$ or $g$ for it. Nevertheless, I am
using the uppercase letter $S$ for it in Proposition \ref{prop.mulsub.inclist}
and Proposition \ref{prop.mulsub.inclist-k}, in order to stress the analogy to
a subset of $T$ (which is typically denoted by an uppercase letter).}

\begin{proposition}
\label{prop.mulsub.inclist} Let $T$ be a set of integers. Let $S$ be a
multisubset of $T$. Then, there exists a unique tuple $\left(  s_{1}%
,s_{2},\ldots,s_{k}\right)  $ of integers in $T$ satisfying $\left\{
s_{1},s_{2},\ldots,s_{k}\right\}  _{\operatorname*{multi}}=S$ and $s_{1}\leq
s_{2}\leq\cdots\leq s_{k}$.
\end{proposition}

\begin{proposition}
\label{prop.mulsub.inclist-k} Let $T$ be a set of integers. Let $m\in
\mathbb{N}$. Let $S$ be a multisubset of $T$ having size $m$. Then, there
exists a unique $m$-tuple $\left(  s_{1},s_{2},\ldots,s_{m}\right)  $ of
integers in $T$ satisfying $\left\{  s_{1},s_{2},\ldots,s_{m}\right\}
_{\operatorname*{multi}}=S$ and $s_{1}\leq s_{2}\leq\cdots\leq s_{m}$.
\end{proposition}

Proposition \ref{prop.mulsub.inclist} and Proposition
\ref{prop.mulsub.inclist-k} are multiset analogues of Proposition
\ref{prop.intset.inclist} and Proposition \ref{prop.intset.inclist-k},
respectively. The latter two propositions say that a finite set of integers
has a unique \textbf{strictly} increasing list of elements; the former two say
that a finite multiset of integers has a unique \textbf{weakly} increasing
list of elements.

\begin{exercise}
\label{exe.prop.mulsub.inclist}Prove Proposition \ref{prop.mulsub.inclist} and
Proposition \ref{prop.mulsub.inclist-k}.
\end{exercise}

As an application of multisubsets, we shall sketch a solution to the following
exercise (whose statement involves no multisubsets!):

\begin{exercise}
\label{exe.binom.mulsub.lac-ev-od}Let $m\in\mathbb{N}$ and $a,b\in\left\{
0,1,\ldots,m\right\}  $. Prove that%
\begin{align*}
&  \left(  \text{\# of lacunar subsets of }\left[  2m\right]  \text{ with
exactly }a\text{ even and }b\text{ odd elements}\right) \\
&  =\dbinom{m-a}{b}\cdot\dbinom{m-b}{a}.
\end{align*}

\end{exercise}

Exercise \ref{exe.binom.mulsub.lac-ev-od} originates in \cite[Theorem
3]{MusPro07} (although the authors of this paper forget to assume that
$a,b\in\left\{  0,1,\ldots,m\right\}  $). One might try to solve it using the
dependent product rule, but this does not work: If we (say) first choose the
$b$ odd elements of our lacunar subset, then the \# of ways to subsequently
choose the remaining $a$ even elements will depend on our chosen $b$ odd
elements. The exercise is too subtle for this method. I have outlined two
solutions of Exercise \ref{exe.binom.mulsub.lac-ev-od} in \cite[Exercise
3]{18s-hw2s}. A simpler solution has been found by Musiker and Propp (in
\cite{MusPro07}) using multisubsets\footnote{This solution is also sketched in
\cite[Exercise 1.10]{Stanley-EC1}.}. Before I sketch this solution, let me
define a multiset analogue of the notion of the union of two disjoint sets:

\begin{definition}
\label{def.mulsub.djun-djsets}Let $A$ and $B$ be two disjoint sets. Let $X$ be
a multisubset of $A$. Let $Y$ be a multisubset of $B$.

Then, $X\cup Y$ shall denote the multisubset of $A\cup B$ defined by%
\begin{equation}
X\cup Y=\left\{  x_{1},x_{2},\ldots,x_{k},y_{1},y_{2},\ldots,y_{\ell}\right\}
_{\operatorname*{multi}}, \label{eq.def.mulsub.djun-djsets.by-elts}%
\end{equation}
where we have written $X$ in the form $X=\left\{  x_{1},x_{2},\ldots
,x_{k}\right\}  _{\operatorname*{multi}}$ and written $Y$ in the form
$Y=\left\{  y_{1},y_{2},\ldots,y_{\ell}\right\}  _{\operatorname*{multi}}$.

Here is a different (but equivalent) way to define this multisubset $X\cup Y$:
Recall that a multisubset of $A$ is the same as a map $f:A\rightarrow
\mathbb{N}$. Thus, the multisubset $X$ of $A$ is a map $f:A\rightarrow
\mathbb{N}$. Likewise, the multisubset $Y$ of $B$ is a map $g:B\rightarrow
\mathbb{N}$. Now, define a map $h:A\cup B\rightarrow\mathbb{N}$ by setting%
\begin{equation}
h\left(  u\right)  =%
\begin{cases}
f\left(  u\right)  , & \text{if }u\in A;\\
g\left(  u\right)  , & \text{if }u\in B
\end{cases}
\ \ \ \ \ \ \ \ \ \ \text{for each }u\in A\cup B.
\label{eq.def.mulsub.djun-djsets.by-func}%
\end{equation}
(This is well-defined, since no $u\in A\cup B$ can satisfy both $u\in A$ and
$u\in B$ at the same time.) This map $h:A\cup B\rightarrow\mathbb{N}$ is a
multisubset of $A\cup B$; we define $X\cup Y$ to be this multisubset.

The multisubset $X\cup Y$ of $A\cup B$ is called the \emph{multiset union} of
$X$ and $Y$.
\end{definition}

For example, the multiset union of the multisubset $\left\{  1,2,2,4\right\}
_{\operatorname*{multi}}$ of $\left\{  1,2,3,4,5\right\}  $ with the
multisubset $\left\{  6,6,8,9,9\right\}  _{\operatorname*{multi}}$ of
$\left\{  6,7,8,9,10\right\}  $ is the multisubset%
\[
\left\{  1,2,2,4\right\}  _{\operatorname*{multi}}\cup\left\{
6,6,8,9,9\right\}  _{\operatorname*{multi}}=\left\{
1,2,2,4,6,6,8,9,9\right\}  _{\operatorname*{multi}}%
\]
of $\left\{  1,2,\ldots,10\right\}  $.

\begin{fineprint}
\begin{remark}
Definition \ref{def.mulsub.djun-djsets} can be extended to the case when $A$
and $B$ are not disjoint. However, there are two non-equivalent ways to do so.
In other words, there are two different reasonable notions of $X\cup Y$ when
$A$ and $B$ are not disjoint.

One of these two notions can be defined by the equality
(\ref{eq.def.mulsub.djun-djsets.by-elts}). Equivalently, it can be defined by
regarding $X$ and $Y$ as maps $f:A\rightarrow\mathbb{N}$ and $g:B\rightarrow
\mathbb{N}$ (as in Definition \ref{def.mulsub.djun-djsets}), and defining
$X\cup Y$ as the map $h:A\cup B\rightarrow\mathbb{N}$ given by%
\[
h\left(  u\right)  =%
\begin{cases}
f\left(  u\right)  , & \text{if }u\in A\setminus B;\\
g\left(  u\right)  , & \text{if }u\in B\setminus A;\\
f\left(  u\right)  +g\left(  u\right)  , & \text{if }u\in A\cap B
\end{cases}
\ \ \ \ \ \ \ \ \ \ \text{for each }u\in A\cup B.
\]
For example, this definition entails that the multiset union of the
multisubset $\left\{  1,2,2,3\right\}  _{\operatorname*{multi}}$ of $\left[
3\right]  $ with the multisubset $\left\{  2,3,3,4\right\}
_{\operatorname*{multi}}$ of $\left[  4\right]  $ is the multisubset
\[
\left\{  1,2,2,3\right\}  _{\operatorname*{multi}}\cup\left\{
2,3,3,4\right\}  _{\operatorname*{multi}}=\left\{  1,2,2,3,2,3,3,4\right\}
_{\operatorname*{multi}}=\left\{  1,2,2,2,3,3,3,4\right\}
_{\operatorname*{multi}}%
\]
of $\left[  4\right]  $.

The second notion of $X\cup Y$ can be defined by regarding $X$ and $Y$ as maps
$f:A\rightarrow\mathbb{N}$ and $g:B\rightarrow\mathbb{N}$ (as in Definition
\ref{def.mulsub.djun-djsets}), and defining $X\cup Y$ as the map $h^{\prime
}:A\cup B\rightarrow\mathbb{N}$ given by%
\[
h^{\prime}\left(  u\right)  =%
\begin{cases}
f\left(  u\right)  , & \text{if }u\in A\setminus B;\\
g\left(  u\right)  , & \text{if }u\in B\setminus A;\\
\max\left\{  f\left(  u\right)  ,g\left(  u\right)  \right\}  , & \text{if
}u\in A\cap B
\end{cases}
\ \ \ \ \ \ \ \ \ \ \text{for each }u\in A\cup B
\]
(where $\max S$ denotes the largest element of any given set $S\subseteq
\mathbb{N}$). For example, this definition entails that the multiset union of
the multisubset $\left\{  1,2,2,3\right\}  _{\operatorname*{multi}}$ of
$\left[  3\right]  $ with the multisubset $\left\{  2,3,3,4\right\}
_{\operatorname*{multi}}$ of $\left[  4\right]  $ is the multisubset
\[
\left\{  1,2,2,3\right\}  _{\operatorname*{multi}}\cup\left\{
2,3,3,4\right\}  _{\operatorname*{multi}}=\left\{  1,2,2,3,3,4\right\}
_{\operatorname*{multi}}%
\]
of $\left[  4\right]  $.

These two notions of $X\cup Y$ coincide when $X$ and $Y$ have no elements in
common; otherwise, the first notion of $X\cup Y$ has larger size than the
second. Note that the second notion (unlike the first) does not satisfy
(\ref{eq.def.mulsub.djun-djsets.by-elts}) in general.
\end{remark}
\end{fineprint}

It is easy to check that if $A$ and $B$ are two disjoint sets, then any
multisubset of $A\cup B$ can be uniquely split up as a multiset union of a
multisubset of $A$ with a multisubset of $B$, in the following sense:

\begin{lemma}
\label{lem.mulsub.djun-djsets.split}Let $A$ and $B$ be two disjoint sets. Let
$Z$ be a multisubset of $A\cup B$. Then, there is a unique way to write $Z$ in
the form $X\cup Y$, where $X$ is a multisubset of $A$ and where $Y$ is a
multisubset of $B$. (In other words, there exists a unique pair $\left(
X,Y\right)  $ such that $X$ is a multisubset of $A$ and $Y$ is a multisubset
of $B$ and $Z=X\cup Y$.)
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.mulsub.djun-djsets.split} (sketched).]Let us view the
multisubset $Z$ of $A\cup B$ as a map $f:A\cup B\rightarrow\mathbb{N}$. Then,
its restriction $\left.  f\mid_{A}\right.  :A\rightarrow\mathbb{N}$ is a
multisubset of $A$, and its restriction $\left.  f\mid_{B}\right.
:B\rightarrow\mathbb{N}$ is a multisubset of $B$. If we denote these two
restrictions by $X$ and $Y$, we then have $Z=X\cup Y$. It is easy to see that
this is the only way to write $Z$ in the form $X\cup Y$, where $X$ is a
multisubset of $A$ and where $Y$ is a multisubset of $B$. Thus, Lemma
\ref{lem.mulsub.djun-djsets.split} follows.
\end{proof}

The following is also rather obvious:

\begin{lemma}
\label{lem.mulsum.djun-djsets.size}Let $A$ and $B$ be two disjoint sets. Let
$X$ be a multisubset of $A$. Let $Y$ be a multisubset of $B$. Then, the size
of $X\cup Y$ is the sum of the sizes of $X$ and $Y$.
\end{lemma}

We can now solve Exercise \ref{exe.binom.mulsub.lac-ev-od}:

\begin{proof}
[Solution to Exercise \ref{exe.binom.mulsub.lac-ev-od} (sketched).]Let
$g=m-a-b+1$. It is easy to see that Exercise \ref{exe.binom.mulsub.lac-ev-od}
is true if $g<0$\ \ \ \ \footnote{\textit{Proof.} Assume that $g<0$. We must
prove that Exercise \ref{exe.binom.mulsub.lac-ev-od} is true.
\par
We have%
\[
m-\left(  a+b\right)  =m-a-b=\underbrace{\left(  m-a-b+1\right)  }%
_{=g<0}-1<0-1=-1<0.
\]
In other words, $m<a+b$. Thus, $a+b>m$.
\par
However, Proposition \ref{prop.subsets.lacunar.maxsize} (applied to $n=2m$)
shows that the largest size of a lacunar subset of $\left[  2m\right]  $ is
$\left\lceil 2m/2\right\rceil $. In other words, the largest size of a lacunar
subset of $\left[  2m\right]  $ is $m$ (since $\left\lceil \underbrace{2m/2}%
_{=m}\right\rceil =\left\lceil m\right\rceil =m$). Therefore, any lacunar
subset of $\left[  2m\right]  $ has size $\leq m$. In other words, no lacunar
subset of $\left[  2m\right]  $ has size $>m$.
\par
Hence, there exists no lacunar subset of $\left[  2m\right]  $ that contains
exactly $a$ even and $b$ odd elements (because such a subset would have size
$a+b>m$, but this would contradict the preceding sentence). In other words,%
\begin{align}
&  \left(  \text{\# of lacunar subsets of }\left[  2m\right]  \text{ with
exactly }a\text{ even and }b\text{ odd elements}\right) \nonumber\\
&  =0. \label{sol.binom.mulsub.lac-ev-od.fn1.1}%
\end{align}
\par
On the other hand, $a\leq m$ (since $a\in\left\{  0,1,\ldots,m\right\}  $), so
that $m-a\geq0$ and therefore $m-a\in\mathbb{N}$. Furthermore, $b>m-a$ (since
$a+b>m$). Thus, Proposition \ref{prop.binom.0} (applied to $m-a$ and $b$
instead of $n$ and $k$) yields $\dbinom{m-a}{b}=0$. Therefore,%
\[
\underbrace{\dbinom{m-a}{b}}_{=0}\cdot\dbinom{m-b}{a}=0.
\]
Comparing this with (\ref{sol.binom.mulsub.lac-ev-od.fn1.1}), we obtain%
\begin{align*}
&  \left(  \text{\# of lacunar subsets of }\left[  2m\right]  \text{ with
exactly }a\text{ even and }b\text{ odd elements}\right) \\
&  =\dbinom{m-a}{b}\cdot\dbinom{m-b}{a}.
\end{align*}
Hence, we have shown that Exercise \ref{exe.binom.mulsub.lac-ev-od} is true if
$g<0$.}. Thus, for the rest of this solution, we WLOG assume that $g\geq0$.
Hence, $g\in\mathbb{N}$.

The set $\left[  2g\right]  $ is the union of its two disjoint $g$-element
subsets%
\begin{align*}
E  &  :=\left\{  \text{even elements of }\left[  2g\right]  \right\}
=\left\{  2,4,6,\ldots,2g\right\}  \ \ \ \ \ \ \ \ \ \ \text{and}\\
O  &  :=\left\{  \text{odd elements of }\left[  2g\right]  \right\}  =\left\{
1,3,5,\ldots,2g-1\right\}  .
\end{align*}


Let $S$ be a lacunar subset of $\left[  2m\right]  $ with exactly $a$ even and
$b$ odd elements. Thus, $\left\vert S\right\vert =a+b$, so that we can write
$S$ uniquely in the form $S=\left\{  s_{1}<s_{2}<\cdots<s_{a+b}\right\}  $ (by
Proposition \ref{prop.intset.inclist-k}). Let us consider these $s_{1}%
,s_{2},\ldots,s_{a+b}$. Then, since $S$ is lacunar, we have
\begin{equation}
s_{1}-0\leq s_{2}-2\leq s_{3}-4\leq\cdots\leq s_{a+b}-2\left(  a+b-1\right)
\label{sol.binom.mulsub.lac-ev-od.chain2}%
\end{equation}
\footnote{\textit{Proof.} We must show that $s_{i}-2\left(  i-1\right)  \leq
s_{i+1}-2i$ for each $i\in\left[  a+b-1\right]  $.
\par
So let $i\in\left[  a+b-1\right]  $. Then, $s_{i}<s_{i+1}$ (since $s_{1}%
<s_{2}<\cdots<s_{a+b}$), so that $s_{i}\leq s_{i+1}-1$ (since $s_{i}$ and
$s_{i+1}$ are integers). But recall that the set $S$ is lacunar, and thus
contains no two consecutive integers. If we had $s_{i}=s_{i+1}-1$, then
$s_{i}$ and $s_{i+1}$ would be two consecutive integers in $S$, which would
contradict the previous sentence. Hence, we cannot have $s_{i}=s_{i+1}-1$.
Thus, we have $s_{i}\neq s_{i+1}-1$. Combined with $s_{i}\leq s_{i+1}-1$, this
yields $s_{i}<s_{i+1}-1$. Since $s_{i}$ and $s_{i+1}-1$ are integers, this
entails $s_{i}\leq\left(  s_{i+1}-1\right)  -1=s_{i+1}-2$. Subtracting
$2\left(  i-1\right)  $ from both sides of this inequality, we obtain
$s_{i}-2\left(  i-1\right)  \leq s_{i+1}-2-2\left(  i-1\right)  =s_{i+1}-2i$.
\par
Now, forget that we fixed $i$. We thus have showed that $s_{i}-2\left(
i-1\right)  \leq s_{i+1}-2i$ for each $i\in\left[  a+b-1\right]  $. In other
words,
\[
s_{1}-0\leq s_{2}-2\leq s_{3}-4\leq\cdots\leq s_{a+b}-2\left(  a+b-1\right)
.
\]
}. Moreover, all the $a+b$ entries $s_{i}-2\left(  i-1\right)  $ (for
$i\in\left[  a+b\right]  $) of this chain of inequalities belong to the set
$\left[  2g\right]  $\ \ \ \ \footnote{\textit{Proof.} We must show that
$s_{i}-2\left(  i-1\right)  \in\left[  2g\right]  $ for each $i\in\left[
a+b\right]  $. So let us fix $i\in\left[  a+b\right]  $. Then, $1\leq i\leq
a+b$. Hence, $s_{1}-0\leq s_{i}-2\left(  i-1\right)  \leq s_{a+b}-2\left(
a+b-1\right)  $ (by (\ref{sol.binom.mulsub.lac-ev-od.chain2})). Hence,
$s_{i}-2\left(  i-1\right)  \geq s_{1}-0=s_{1}\geq1$ (since $s_{1}\in\left\{
s_{1}<s_{2}<\cdots<s_{a+b}\right\}  =S\subseteq\left[  2m\right]  $). Also,
$s_{a+b}\leq2m$ (since $s_{a+b}\in\left\{  s_{1}<s_{2}<\cdots<s_{a+b}\right\}
=S\subseteq\left[  2m\right]  $), and $s_{i}-2\left(  i-1\right)
\leq\underbrace{s_{a+b}}_{\leq2m}-2\left(  a+b-1\right)  \leq2m-2\left(
a+b-1\right)  =2\underbrace{\left(  m-a-b+1\right)  }_{=g}=2g$. Combining
$s_{i}-2\left(  i-1\right)  \geq1$ with $s_{i}-2\left(  i-1\right)  \leq2g$,
we obtain $s_{i}-2\left(  i-1\right)  \in\left\{  1,2,\ldots,2g\right\}
=\left[  2g\right]  $, qed.}. Hence, we can define the multisubset\footnote{We
are using an analogue of the notation from Definition \ref{def.intset.inccomp}
for multisets here: If $T$ is a set of integers, and if $a_{1},a_{2}%
,\ldots,a_{k}$ are $k$ numbers from $T$, then the notation \textquotedblleft%
$\left\{  a_{1}\leq a_{2}\leq\cdots\leq a_{k}\right\}  _{\operatorname*{multi}%
}$\textquotedblright\ shall denote the multisubset $\left\{  a_{1}%
,a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}$ of $T$ and
simultaneously assert that $a_{1}\leq a_{2}\leq\cdots\leq a_{k}$.}%
\[
M_{S}:=\left\{  s_{1}-0\leq s_{2}-2\leq s_{3}-4\leq\cdots\leq s_{a+b}-2\left(
a+b-1\right)  \right\}  _{\operatorname*{multi}}%
\]
of $\left[  2g\right]  $. This multisubset $M_{S}$ has exactly $a$ even and
$b$ odd elements\footnote{counted with multiplicity} (since the integers
$s_{1}-0,s_{2}-2,s_{3}-4,\ldots,s_{a+b}-2\left(  a+b-1\right)  $ have the same
parities\footnote{The \emph{parity} of an integer $k$ is defined to be $0$ if
$k$ is even and $1$ if $k$ is odd. Thus, two integers $k$ and $\ell$ have the
same parity if and only if they are either both even or both odd.} as the
integers $s_{1},s_{2},s_{3},\ldots,s_{a+b}$, respectively\footnote{because the
former integers differ from the latter integers by a multiple of $2$ (to wit:
$s_{i}-2\left(  i-1\right)  $ differs from $s_{i}$ by $2\left(  i-1\right)
$).}). In other words, the multisubset $M_{S}$ has exactly $a$ elements from
$E$ and exactly $b$ elements from $O$.

Recall that $M_{S}$ is a multisubset of $\left[  2g\right]  =E\cup O$. Hence,
we can (using Lemma \ref{lem.mulsub.djun-djsets.split}) uniquely split $M_{S}$
up as a multiset union\ $M_{S,\operatorname*{even}}\cup
M_{S,\operatorname*{odd}}$, where%
\[
M_{S,\operatorname*{even}}\text{ is a multisubset of }E
\]
and
\[
M_{S,\operatorname*{odd}}\text{ is a multisubset of }O.
\]
Moreover, the multisubset $M_{S,\operatorname*{even}}$ here has size $a$
(since $M_{S}$ has exactly $a$ elements from $E$), and the multisubset
$M_{S,\operatorname*{odd}}$ here has size $b$ (since $M_{S}$ has exactly $b$
elements from $O$).

Forget that we fixed $S$. Thus, for each lacunar subset $S$ of $\left[
2m\right]  $ with exactly $a$ even and $b$ odd elements, we have constructed a
size-$a$ multisubset $M_{S,\operatorname*{even}}$ of $E$ and a size-$b$
multisubset $M_{S,\operatorname*{odd}}$ of $O$. Hence, we can define a map%
\begin{align*}
&  \left\{  \text{lacunar subsets of }\left[  2m\right]  \text{ with exactly
}a\text{ even and }b\text{ odd elements}\right\} \\
&  \rightarrow\left\{  \text{size-}a\text{ multisubsets of }E\right\}
\times\left\{  \text{size-}b\text{ multisubsets of }O\right\}  ,\\
S  &  \mapsto\left(  M_{S,\operatorname*{even}},M_{S,\operatorname*{odd}%
}\right)  .
\end{align*}
This map is easily seen to be a bijection\footnote{The inverse map sends any
pair $\left(  X,Y\right)  \in\left\{  \text{size-}a\text{ multisubsets of
}E\right\}  \times\left\{  \text{size-}b\text{ multisubsets of }O\right\}  $
to the lacunar subset $S$ of $\left[  2m\right]  $ constructed as follows:
Write the multiset union $X\cup Y$ in the form $X\cup Y=\left\{  t_{1}\leq
t_{2}\leq\cdots\leq t_{a+b}\right\}  _{\operatorname*{multi}}$ (Proposition
\ref{prop.mulsub.inclist-k} guarantees that this can be done in a unique way),
and define $S$ by%
\[
S=\left\{  t_{1}+0<t_{2}+2<t_{3}+4<\cdots<t_{a+b}+2\left(  a+b-1\right)
\right\}  .
\]
}. Hence, the bijection principle yields%
\begin{align*}
&  \left(  \text{\# of lacunar subsets of }\left[  2m\right]  \text{ with
exactly }a\text{ even and }b\text{ odd elements}\right) \\
&  =\left\vert \left\{  \text{size-}a\text{ multisubsets of }E\right\}
\times\left\{  \text{size-}b\text{ multisubsets of }O\right\}  \right\vert \\
&  =\underbrace{\left(  \text{\# of size-}a\text{ multisubsets of }E\right)
}_{\substack{=\left(  \text{\# of multisubsets of }E\text{ having size
}a\right)  \\=\dbinom{a+g-1}{a}\\\text{(by Corollary
\ref{cor.binom.mulsub.count},}\\\text{applied to }a\text{, }g\text{ and
}E\text{ instead of }n\text{, }k\text{ and }T\text{)}}}\cdot
\underbrace{\left(  \text{\# of size-}b\text{ multisubsets of }O\right)
}_{\substack{=\left(  \text{\# of multisubsets of }O\text{ having size
}b\right)  \\=\dbinom{b+g-1}{b}\\\text{(by Corollary
\ref{cor.binom.mulsub.count},}\\\text{applied to }b\text{, }g\text{ and
}O\text{ instead of }n\text{, }k\text{ and }T\text{)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the product rule}\right) \\
&  =\underbrace{\dbinom{a+g-1}{a}}_{\substack{=\dbinom{m-b}{a}\\\text{(since
}a+g-1=m-b\\\text{(because }g=m-a-b+1\text{))}}}\cdot\underbrace{\dbinom
{b+g-1}{b}}_{\substack{=\dbinom{m-a}{b}\\\text{(since }%
b+g-1=m-a\\\text{(because }g=m-a-b+1\text{))}}}\\
&  =\dbinom{m-b}{a}\cdot\dbinom{m-a}{b}=\dbinom{m-a}{b}\cdot\dbinom{m-b}{a}.
\end{align*}
This solves Exercise \ref{exe.binom.mulsub.lac-ev-od}.
\end{proof}

Note that, as a consequence of Exercise \ref{exe.binom.mulsub.lac-ev-od}, we
can obtain the following formula for Fibonacci numbers:%
\[
f_{2m+2}=\sum_{a=0}^{m}\ \ \sum_{b=0}^{m}\dbinom{m-a}{b}\cdot\dbinom{m-b}%
{a}\ \ \ \ \ \ \ \ \ \ \text{for all }m\in\mathbb{N}.
\]
(See \cite[solution to Exercise 3 \textbf{(f)}]{18s-mt1s} for more details on
how this is proved.)

\subsection{\label{sect.binom.multinom}Multinomial coefficients}

\subsubsection{Definition and formulas}

Let us next introduce another family of combinatorially meaningful numbers.

\begin{definition}
\label{def.multinom}Let $n\in\mathbb{N}$ and $n_{1},n_{2},\ldots,n_{k}%
\in\mathbb{N}$ be such that $n_{1}+n_{2}+\cdots+n_{k}=n$. Then, we define a
rational number $\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}$ by%
\[
\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}=\dfrac{n!}{n_{1}!n_{2}!\cdots n_{k}!}.
\]
This number $\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}$ is called a
\emph{multinomial coefficient}.
\end{definition}

\begin{remark}
\textbf{(a)} We are not defining $\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}$ for
negative or non-integer $n$. (This is in contrast to the notion of binomial
coefficients $\dbinom{n}{k}$.)

\textbf{(b)} The notation $\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}$ for
multinomial coefficients may get mistaken for a binomial coefficient in the
case when $k=1$. However, in this trivial case, both notations lead to the
same value (namely, $1$)\ \ \ \ \footnotemark, and thus the ambiguity is harmless.
\end{remark}

\footnotetext{In more details: Assume that $n\in\mathbb{N}$ and $n_{1}%
,n_{2},\ldots,n_{k}\in\mathbb{N}$ satisfy $n_{1}+n_{2}+\cdots+n_{k}=n$ and
$k=1$. Then, $n=n_{1}+n_{2}+\cdots+n_{k}=n_{1}$ (since $k=1$), so that
$n_{1}=n$. Thus, the binomial coefficient $\dbinom{n}{n_{1}}$ satisfies
$\dbinom{n}{n_{1}}=\dbinom{n}{n}=1$ (by Exercise \ref{exe.binom.nn}). But the
definition of the multinomial coefficient $\dbinom{n}{n_{1},n_{2},\ldots
,n_{k}}$ yields $\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}=\dfrac{n!}{n_{1}%
!n_{2}!\cdots n_{k}!}=\dfrac{n!}{n_{1}!}$ (since $k=1$), so that $\dbinom
{n}{n_{1},n_{2},\ldots,n_{k}}=\dfrac{n!}{n_{1}!}=1$ (since $n=n_{1}$). Hence,
both the binomial coefficient $\dbinom{n}{n_{1}}$ and the multinomial
coefficient $\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}$ equal $1$ in this case.}

\begin{example}
We have $7\in\mathbb{N}$ and $2,3,2\in\mathbb{N}$ and $2+3+2=7$. Thus,
Definition \ref{def.multinom} yields%
\[
\dbinom{7}{2,3,2}=\dfrac{7!}{2!\cdot3!\cdot2!}=\dfrac{5040}{2\cdot6\cdot
2}=210.
\]

\end{example}

Here are some algebraic properties of multinomial coefficients:

\begin{proposition}
\label{prop.multinom.formulas}Let $n\in\mathbb{N}$ and $n_{1},n_{2}%
,\ldots,n_{k}\in\mathbb{N}$ be such that $n_{1}+n_{2}+\cdots+n_{k}=n$. Then:

\textbf{(a)} We have%
\begin{align*}
\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}  &  =\prod_{i=1}^{k}\dbinom{n-n_{1}%
-n_{2}-\cdots-n_{i-1}}{n_{i}}\\
&  =\dbinom{n}{n_{1}}\dbinom{n-n_{1}}{n_{2}}\dbinom{n-n_{1}-n_{2}}{n_{3}%
}\cdots\underbrace{\dbinom{n-n_{1}-n_{2}-\cdots-n_{k-1}}{n_{k}}}_{=1}\\
&  =\prod_{i=1}^{k-1}\dbinom{n-n_{1}-n_{2}-\cdots-n_{i-1}}{n_{i}}.
\end{align*}


\textbf{(b)} We have $\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}\in\mathbb{N}$.
\end{proposition}

\begin{exercise}
\label{exe.prop.multinom.formulas}Prove Proposition
\ref{prop.multinom.formulas}.
\end{exercise}

\subsubsection{Counting maps that take values a given number of times}

Next, we shall give two combinatorial interpretations of multinomial coefficients:

\begin{proposition}
\label{prop.multinom.maps}Let $n\in\mathbb{N}$ and $n_{1},n_{2},\ldots
,n_{k}\in\mathbb{N}$ be such that $n_{1}+n_{2}+\cdots+n_{k}=n$. Then, the \#
of maps $f:\left[  n\right]  \rightarrow\left[  k\right]  $ satisfying%
\[
\left(  \text{\# of }a\in\left[  n\right]  \text{ such that }f\left(
a\right)  =i\right)  =n_{i}\ \ \ \ \ \ \ \ \ \ \text{for each }i\in\left[
k\right]
\]
is $\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}$.
\end{proposition}

\begin{example}
We have $7\in\mathbb{N}$ and $2,3,2\in\mathbb{N}$ and $2+3+2=7$. Hence,
Proposition \ref{prop.multinom.maps} (applied to $n=7$ and $k=3$ and $\left(
n_{1},n_{2},n_{3}\right)  =\left(  2,3,2\right)  $) says that the \# of maps
$f:\left[  7\right]  \rightarrow\left[  3\right]  $ satisfying
\begin{align*}
\left(  \text{\# of }a\in\left[  n\right]  \text{ such that }f\left(
a\right)  =1\right)   &  =2\ \ \ \ \ \ \ \ \ \ \text{and}\\
\left(  \text{\# of }a\in\left[  n\right]  \text{ such that }f\left(
a\right)  =2\right)   &  =3\ \ \ \ \ \ \ \ \ \ \text{and}\\
\left(  \text{\# of }a\in\left[  n\right]  \text{ such that }f\left(
a\right)  =3\right)   &  =2
\end{align*}
is $\dbinom{7}{2,3,2}=210$. In other words, it says that the \# of maps
$f:\left[  7\right]  \rightarrow\left[  3\right]  $ that take the value $1$
exactly twice, take the value $2$ exactly thrice, and take the value $3$
exactly twice is $210$. One such map is $\left(
\begin{array}
[c]{ccccccc}%
1 & 2 & 3 & 4 & 5 & 6 & 7\\
1 & 3 & 2 & 2 & 1 & 2 & 3
\end{array}
\right)  $ (in two-line notation).
\end{example}

\begin{center}
\fbox{\textbf{Class of 2019-11-06}}
\end{center}

Let us first give an informal way of proving Proposition
\ref{prop.multinom.maps}:

\begin{proof}
[Proof of Proposition \ref{prop.multinom.maps} (informal version, sketched).]A
\emph{relevant map} shall mean a map $f:\left[  n\right]  \rightarrow\left[
k\right]  $ satisfying%
\begin{equation}
\left(  \text{\# of }a\in\left[  n\right]  \text{ such that }f\left(
a\right)  =i\right)  =n_{i}\ \ \ \ \ \ \ \ \ \ \text{for each }i\in\left[
k\right]  . \label{pf.prop.multinom.maps.rlv}%
\end{equation}
Thus, we need to prove that the \# of all relevant maps is $\dbinom{n}%
{n_{1},n_{2},\ldots,n_{k}}$.

A map $f:\left[  n\right]  \rightarrow\left[  k\right]  $ (not necessarily
relevant) is uniquely determined if you know which elements of $\left[
n\right]  $ it sends to $1$, which elements of $\left[  n\right]  $ it sends
to $2$, which elements of $\left[  n\right]  $ it sends to $3$, and so on. In
other words, a map $f:\left[  n\right]  \rightarrow\left[  k\right]  $ is
uniquely determined if you know the $k$ sets%
\begin{align*}
&  \left\{  a\in\left[  n\right]  \ \mid\ f\left(  a\right)  =1\right\}  ,\\
&  \left\{  a\in\left[  n\right]  \ \mid\ f\left(  a\right)  =2\right\}  ,\\
&  \left\{  a\in\left[  n\right]  \ \mid\ f\left(  a\right)  =3\right\}  ,\\
&  \ldots,\\
&  \left\{  a\in\left[  n\right]  \ \mid\ f\left(  a\right)  =k\right\}  .
\end{align*}
These $k$ sets should be $k$ disjoint subsets of $\left[  n\right]
$\ \ \ \ \footnote{Indeed, they must be disjoint, since any element $a$ in the
intersection of two of them would have two different values of $f\left(
a\right)  $ at the same time.}, and their union must be $\left[  n\right]
$\ \ \ \ \footnote{since each $a\in\left[  n\right]  $ should have some value
$f\left(  a\right)  \in\left[  k\right]  $ assigned to it, and thus lie in one
of these $k$ sets}. If we want the map $f$ to be relevant, then these $k$ sets
should have sizes $n_{1},n_{2},n_{3},\ldots,n_{k}$,
respectively\footnote{because the equality (\ref{pf.prop.multinom.maps.rlv})
says that $\left\vert \left\{  a\in\left[  n\right]  \ \mid\ f\left(
a\right)  =i\right\}  \right\vert =n_{i}$ for each $i\in\left[  k\right]  $}.

Thus, the following algorithm can be used to construct any relevant map
$f:\left[  n\right]  \rightarrow\left[  k\right]  $:

\begin{itemize}
\item First, choose the set $\left\{  a\in\left[  n\right]  \ \mid\ f\left(
a\right)  =1\right\}  $. This must be a subset of $\left[  n\right]  $ having
size $n_{1}$. In other words, this must be an $n_{1}$-element subset of the
$n$-element set $\left[  n\right]  $. Thus, we have $\dbinom{n}{n_{1}}$
choices for it.

\item Then, choose the set $\left\{  a\in\left[  n\right]  \ \mid\ f\left(
a\right)  =2\right\}  $. This must be a subset of $\left[  n\right]  $ having
size $n_{2}$ and disjoint from the already chosen set $\left\{  a\in\left[
n\right]  \ \mid\ f\left(  a\right)  =1\right\}  $. In other words, this must
be an $n_{2}$-element subset of the $\left(  n-n_{1}\right)  $-element set
$\left[  n\right]  \setminus\left\{  a\in\left[  n\right]  \ \mid\ f\left(
a\right)  =1\right\}  $. Thus, we have $\dbinom{n-n_{1}}{n_{2}}$ choices for it.

\item Then, choose the set $\left\{  a\in\left[  n\right]  \ \mid\ f\left(
a\right)  =3\right\}  $. This must be a subset of $\left[  n\right]  $ having
size $n_{3}$ and disjoint from the two already chosen sets $\left\{
a\in\left[  n\right]  \ \mid\ f\left(  a\right)  =1\right\}  $ and $\left\{
a\in\left[  n\right]  \ \mid\ f\left(  a\right)  =2\right\}  $. In other
words, this must be an $n_{3}$-element subset of the $\left(  n-n_{1}%
-n_{2}\right)  $-element set $\left[  n\right]  \setminus\left\{  a\in\left[
n\right]  \ \mid\ f\left(  a\right)  =1\right\}  \setminus\left\{  a\in\left[
n\right]  \ \mid\ f\left(  a\right)  =2\right\}  $. Thus, we have
$\dbinom{n-n_{1}-n_{2}}{n_{3}}$ choices.

\item And so on, until the last set $\left\{  a\in\left[  n\right]
\ \mid\ f\left(  a\right)  =k\right\}  $ has been chosen (for which we have
$\dbinom{n-n_{1}-n_{2}-\cdots-n_{k-1}}{n_{k}}$ choices).
\end{itemize}

The dependent product rule thus shows that the total \# of relevant maps is%
\begin{align*}
&  \dbinom{n}{n_{1}}\dbinom{n-n_{1}}{n_{2}}\dbinom{n-n_{1}-n_{2}}{n_{3}}%
\cdots\dbinom{n-n_{1}-n_{2}-\cdots-n_{k-1}}{n_{k}}\\
&  =\prod_{i=1}^{k}\dbinom{n-n_{1}-n_{2}-\cdots-n_{i-1}}{n_{i}}\\
&  =\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
Proposition \ref{prop.multinom.formulas} \textbf{(a)}}\right)  .
\end{align*}
Thus, Proposition \ref{prop.multinom.maps} is proved.
\end{proof}

\begin{exercise}
\label{exe.prop.multinom.maps}Give a formal proof of Proposition
\ref{prop.multinom.maps} (using induction instead of the dependent product rule).
\end{exercise}

If $A$ is any set and $n\in\mathbb{N}$, then the maps from $\left[  n\right]
$ to $A$ are in bijection with the $n$-tuples of elements of $A$ (as we have
seen, e.g., in the proof of Theorem \ref{thm.maps.power}). Thus, any
properties of the former can be restated in terms of the latter (and vice
versa). For example, we can restate Proposition \ref{prop.multinom.maps} in
terms of $n$-tuples:

\begin{proposition}
\label{prop.multinom.tups}Let $n\in\mathbb{N}$ and $n_{1},n_{2},\ldots
,n_{k}\in\mathbb{N}$ be such that $n_{1}+n_{2}+\cdots+n_{k}=n$. Then, the \#
of $n$-tuples $\left(  u_{1},u_{2},\ldots,u_{n}\right)  \in\left[  k\right]
^{n}$ satisfying%
\begin{equation}
\left(  \text{\# of }a\in\left[  n\right]  \text{ such that }u_{a}=i\right)
=n_{i}\ \ \ \ \ \ \ \ \ \ \text{for each }i\in\left[  k\right]
\label{eq.prop.multinom.tups.1}%
\end{equation}
is $\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}$.
\end{proposition}

Note that the $n$-tuples $\left(  u_{1},u_{2},\ldots,u_{n}\right)  \in\left[
k\right]  ^{n}$ satisfying (\ref{eq.prop.multinom.tups.1}) in Proposition
\ref{prop.multinom.tups} are simply the $n$-tuples of elements of $\left[
k\right]  $ that contain the entry $1$ exactly $n_{1}$ many times, contain the
entry $2$ exactly $n_{2}$ many times, contain the entry $3$ exactly $n_{3}$
many times, and so on.

\begin{proof}
[Proof of Proposition \ref{prop.multinom.tups} (sketched).]We introduce some
shorthand terminology: A \emph{relevant }$n$\emph{-tuple} shall mean an
$n$-tuple $\left(  u_{1},u_{2},\ldots,u_{n}\right)  \in\left[  k\right]  ^{n}$
satisfying%
\[
\left(  \text{\# of }a\in\left[  n\right]  \text{ such that }u_{a}=i\right)
=n_{i}\ \ \ \ \ \ \ \ \ \ \text{for each }i\in\left[  k\right]  .
\]
Thus, we need to prove that the \# of all relevant $n$-tuples is $\dbinom
{n}{n_{1},n_{2},\ldots,n_{k}}$.

A \emph{relevant map} shall mean a map $f:\left[  n\right]  \rightarrow\left[
k\right]  $ satisfying%
\[
\left(  \text{\# of }a\in\left[  n\right]  \text{ such that }f\left(
a\right)  =i\right)  =n_{i}\ \ \ \ \ \ \ \ \ \ \text{for each }i\in\left[
k\right]  .
\]
Thus, Proposition \ref{prop.multinom.maps} shows that the \# of all relevant
maps is $\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}$.

Recall that $\left[  k\right]  ^{\left[  n\right]  }=\left\{  \text{maps from
}\left[  n\right]  \text{ to }\left[  k\right]  \right\}  $. Consider the map%
\begin{align*}
\Phi:\left\{  \text{relevant maps}\right\}   &  \rightarrow\left\{
\text{relevant }n\text{-tuples}\right\}  ,\\
f  &  \mapsto\left(  f\left(  1\right)  ,f\left(  2\right)  ,\ldots,f\left(
n\right)  \right)  .
\end{align*}
This map $\Phi$ sends each relevant map $f:\left[  n\right]  \rightarrow
\left[  k\right]  $ to its list of values at the points\footnote{I am just
using \textquotedblleft point\textquotedblright\ as just a suggestive way of
saying \textquotedblleft element of $\left[  n\right]  $\textquotedblright%
\ here.} $1,2,\ldots,n$. It is clear that this map $\Phi$ is a
bijection\footnote{Indeed, the definition of a \textquotedblleft relevant
map\textquotedblright\ requires the map to take the value $i$ exactly $n_{i}$
many times (for each $i\in\left[  k\right]  $), whereas the definition of a
\textquotedblleft relevant $n$-tuple\textquotedblright\ requires the $n$-tuple
to contain the entry $i$ exactly $n_{i}$ many times (for each $i\in\left[
k\right]  $). It is clear that if we encode a map by its list of values, then
the former requirement translates into the latter requirement.}. Thus, the
bijection principle yields
\[
\left\vert \left\{  \text{relevant maps}\right\}  \right\vert =\left\vert
\left\{  \text{relevant }n\text{-tuples}\right\}  \right\vert .
\]
In other words,%
\begin{equation}
\left(  \text{\# of all relevant maps}\right)  =\left(  \text{\# of all
relevant }n\text{-tuples}\right)  . \label{pf.prop.multinom.tups.5}%
\end{equation}
But we know that the \# of all relevant maps is $\dbinom{n}{n_{1},n_{2}%
,\ldots,n_{k}}$. Thus, (\ref{pf.prop.multinom.tups.5}) shows that the \# of
all relevant $n$-tuples is $\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}$. This proves
Proposition \ref{prop.multinom.tups}.
\end{proof}

\subsubsection{Counting anagrams}

For a second combinatorial interpretation of multinomial coefficients, we need
the notion of an \textquotedblleft anagram\textquotedblright:

\begin{definition}
\label{def.multinom.anagram}Let $n\in\mathbb{N}$. Let $\alpha$ be an $n$-tuple
(of any objects). An \emph{anagram} of $\alpha$ shall mean an $n$-tuple that
can be obtained from $\alpha$ by permuting its entries.

In other words (more formally): Write $\alpha$ as $\alpha=\left(  \alpha
_{1},\alpha_{2},\ldots,\alpha_{n}\right)  $. Then, an anagram of $\alpha$ is
an $n$-tuple of the form $\left(  \alpha_{\sigma\left(  1\right)  }%
,\alpha_{\sigma\left(  2\right)  },\ldots,\alpha_{\sigma\left(  n\right)
}\right)  $, where $\sigma$ is a permutation of $\left[  n\right]  $.
\end{definition}

\textquotedblleft Anagrams\textquotedblright\ are often called
\textquotedblleft permutations\textquotedblright, but the latter terminology
risks confusion with the notion of permutations defined in Definition
\ref{def.perm}.

\begin{example}
\textbf{(a)} The anagrams of the $3$-tuple $\left(  1,4,6\right)  $ are
$\left(  1,4,6\right)  $, $\left(  1,6,4\right)  $, $\left(  4,1,6\right)  $,
$\left(  4,6,1\right)  $, $\left(  6,1,4\right)  $ and $\left(  6,4,1\right)
$.

\textbf{(b)} The anagrams of the $3$-tuple $\left(  1,4,1\right)  $ are
$\left(  1,4,1\right)  $, $\left(  4,1,1\right)  $ and $\left(  1,1,4\right)
$. (There are $6$ ways to permute the $3$ entries of $\left(  1,4,1\right)  $,
but they only produce $3$ different results.)

\textbf{(c)} The only anagram of the $3$-tuple $\left(  2,2,2\right)  $ is
$\left(  2,2,2\right)  $ itself. (All $6$ ways of permuting the $3$ entries of
$\left(  2,2,2\right)  $ yield the same result.)
\end{example}

We can now interpret multinomial coefficients as counting anagrams:

\begin{proposition}
\label{prop.multinom.anagr}Let $n\in\mathbb{N}$ and $n_{1},n_{2},\ldots
,n_{k}\in\mathbb{N}$ be such that $n_{1}+n_{2}+\cdots+n_{k}=n$.

Let $\alpha$ be the $n$-tuple%
\[
\left(  \underbrace{1,1,\ldots,1}_{n_{1}\text{ times}},\underbrace{2,2,\ldots
,2}_{n_{2}\text{ times}},\ldots,\underbrace{k,k,\ldots,k}_{n_{k}\text{ times}%
}\right)  .
\]
Then, the \# of distinct anagrams of $\alpha$ (that is, $n$-tuples obtained
from $\alpha$ by permuting its entries) is $\dbinom{n}{n_{1},n_{2}%
,\ldots,n_{k}}$.
\end{proposition}

\begin{example}
\label{exa.multinom.anagr-anagram}How many anagrams does the word
\textquotedblleft anagram\textquotedblright\ have? (Here, we regard a word as
a tuple of letters; it doesn't have to make any sense in English. For example,
\textquotedblleft nagrama\textquotedblright\ is an anagram of
\textquotedblleft anagram\textquotedblright. And yes, a word counts as its own anagram.)

Equivalently, how many anagrams does the word \textquotedblleft
aaagmnr\textquotedblright\ have? (This is an equivalent question, because the
words \textquotedblleft anagram\textquotedblright\ and \textquotedblleft
aaagmnr\textquotedblright\ are anagrams of one another, and thus have the same
set of anagrams.)

Equivalently, how many anagrams does the $7$-tuple $\left(
1,1,1,2,3,4,5\right)  $\ have? (This is an equivalent question, because
$\left(  1,1,1,2,3,4,5\right)  $\ is obtained from \textquotedblleft
aaagmnr\textquotedblright\ by replacing each letter by a number\footnotemark.)

Proposition \ref{prop.multinom.anagr} (applied to $n=7$, $k=5$ and $\left(
n_{1},n_{2},\ldots,n_{k}\right)  =\left(  3,1,1,1,1\right)  $) says that the
answer to the last question is
\[
\dbinom{7}{3,1,1,1,1}=\dfrac{7!}{3!\cdot1!\cdot1!\cdot1!\cdot1!}=\dfrac
{7!}{3!}=7\cdot6\cdot5\cdot4=840.
\]
Thus, the word \textquotedblleft anagram\textquotedblright\ has $840$ anagrams.
\end{example}

\footnotetext{Namely, we replaced the letters \textquotedblleft
a\textquotedblright, \textquotedblleft g\textquotedblright, \textquotedblleft
m\textquotedblright, \textquotedblleft n\textquotedblright\ and
\textquotedblleft r\textquotedblright\ by the numbers $1$, $2$, $3$, $4$ and
$5$, respectively. (It doesn't matter which letter we choose to replace by
which number; the replacement merely has to guarantee that equal letters
become equal numbers, while distinct letters become distinct numbers.)} Let us
prove Proposition \ref{prop.multinom.anagr} informally:

\begin{proof}
[Proof of Proposition \ref{prop.multinom.anagr} (informal version).]If we
permute the entries of an $n$-tuple, then the order of its entries will change
(usually), but some things won't change: The number of times $1$ appears as an
entry won't change; the number of times $2$ appears as an entry won't change;
the number of times $3$ appears as an entry won't change; and so on. Thus, if
$\beta$ is any anagram of $\alpha$, and if $i\in\left[  k\right]  $ is
arbitrary, then
\begin{align}
\left(  \text{\# of times }i\text{ appears in }\beta\right)   &  =\left(
\text{\# of times }i\text{ appears in }\alpha\right)
\label{pf.prop.multinom.anagr.2}\\
&  =n_{i}\nonumber
\end{align}
(since $i$ appears $n_{i}$ times in the $n$-tuple $\alpha$). Hence, if $\beta$
is an anagram of $\alpha$, then
\begin{equation}
\left(  \text{\# of times }i\text{ appears in }\beta\right)  =n_{i}%
\ \ \ \ \ \ \ \ \ \ \text{for each }i\in\left[  k\right]  .
\label{pf.prop.multinom.anagr.4}%
\end{equation}


Conversely, if $\beta\in\left[  k\right]  ^{n}$ is an $n$-tuple that satisfies
(\ref{pf.prop.multinom.anagr.4}), then $\beta$ is an anagram of $\alpha$.
Indeed, we can sort the entries of $\beta$ in increasing order, thus obtaining
an $n$-tuple of the form $\left(  \underbrace{1,1,\ldots,1}_{\text{some \# of
}1\text{'s}},\underbrace{2,2,\ldots,2}_{\text{some \# of }2\text{'s}}%
,\ldots,\underbrace{k,k,\ldots,k}_{\text{some \# of }k\text{'s}}\right)  $;
but the equalities (\ref{pf.prop.multinom.anagr.4}) show that the \# of $1$'s
in this $n$-tuple will be $n_{1}$, and the \# of $2$'s will be $n_{2}$, and
the \# of $3$'s will be $n_{3}$, and so on, so that this $n$-tuple will be
precisely $\left(  \underbrace{1,1,\ldots,1}_{n_{1}\text{ times}%
},\underbrace{2,2,\ldots,2}_{n_{2}\text{ times}},\ldots,\underbrace{k,k,\ldots
,k}_{n_{k}\text{ times}}\right)  =\alpha$. This shows that $\alpha$ can be
obtained by sorting $\beta$, and thus $\beta$ is an anagram of $\alpha$.

Combining our observations, we conclude that the anagrams of $\alpha$ are
precisely the $n$-tuples $\beta\in\left[  k\right]  ^{n}$ that satisfy
(\ref{pf.prop.multinom.anagr.4}). Renaming $\beta$ as $\left(  u_{1}%
,u_{2},\ldots,u_{n}\right)  $, we can rewrite this as follows: The anagrams of
$\alpha$ are precisely the $n$-tuples $\left(  u_{1},u_{2},\ldots
,u_{n}\right)  \in\left[  k\right]  ^{n}$ that satisfy%
\[
\left(  \text{\# of times }i\text{ appears in }\left(  u_{1},u_{2}%
,\ldots,u_{n}\right)  \right)  =n_{i}\ \ \ \ \ \ \ \ \ \ \text{for each }%
i\in\left[  k\right]  .
\]
In other words, the anagrams of $\alpha$ are precisely the $n$-tuples $\left(
u_{1},u_{2},\ldots,u_{n}\right)  \in\left[  k\right]  ^{n}$ satisfying%
\[
\left(  \text{\# of }a\in\left[  n\right]  \text{ such that }u_{a}=i\right)
=n_{i}\ \ \ \ \ \ \ \ \ \ \text{for each }i\in\left[  k\right]  .
\]
But we know (from Proposition \ref{prop.multinom.tups}) that the \# of such
$n$-tuples is $\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}$. Hence, we conclude that
the \# of distinct anagrams of $\alpha$ is $\dbinom{n}{n_{1},n_{2}%
,\ldots,n_{k}}$. This proves Proposition \ref{prop.multinom.anagr}.
\end{proof}

To formalize the above proof of Proposition \ref{prop.multinom.anagr}, we need
to fill two gaps. The first is a rigorous justification of the equality
(\ref{pf.prop.multinom.anagr.2}) (assuming that $\beta$ is an anagram of
$\alpha$). This can easily be done on a more general level:

\begin{exercise}
\label{exe.multinom.anagr.formal1}Let $X$ be any set. Let $n\in\mathbb{N}$.
Let $\alpha\in X^{n}$ be an $n$-tuple. Let $\beta$ be an anagram of $\alpha$.
Let $i\in X$. Prove that%
\[
\left(  \text{\# of times }i\text{ appears in }\beta\right)  =\left(  \text{\#
of times }i\text{ appears in }\alpha\right)  .
\]

\end{exercise}

Applying Exercise \ref{exe.multinom.anagr.formal1} to $X=\left[  k\right]  $,
we immediately obtain (\ref{pf.prop.multinom.anagr.2}).

But there is a second gap in the above informal proof of Proposition
\ref{prop.multinom.anagr} (at least from a formal point of view); indeed, we
used the notion of \textquotedblleft sorting\textquotedblright\ an $n$-tuple
(when we said that \textquotedblleft we can sort the entries of $\beta$ in
increasing order\textquotedblright). Behind this notion stands the fundamental
but nontrivial fact that any $n$-tuple of integers (or, more generally, of
real numbers) can be sorted into weakly increasing order by permuting its
entries. This fact is not hard to prove (see, e.g., \cite[Proposition 6.40
\textbf{(a)}]{detnotes} and its proof in \cite[solution to Exercise
6.13]{detnotes}).

There is also a second way of closing this second gap. Indeed, we can avoid
the notion of \textquotedblleft sorting\textquotedblright\ altogether, and
instead show the following fact (a converse to Exercise
\ref{exe.multinom.anagr.formal1}):

\begin{exercise}
\label{exe.multinom.anagr.formal2}Let $X$ be any set. Let $n\in\mathbb{N}$.
Let $\alpha\in X^{n}$ and $\beta\in X^{n}$ be two $n$-tuples. Assume that%
\begin{equation}
\left(  \text{\# of times }i\text{ appears in }\beta\right)  =\left(  \text{\#
of times }i\text{ appears in }\alpha\right)
\label{eq.exe.multinom.anagr.formal2.ass}%
\end{equation}
for each $i\in X$. Prove that $\beta$ is an anagram of $\alpha$.
\end{exercise}

\begin{example}
Let $X=\mathbb{Z}$ and $n=5$ and $\alpha=\left(  1,4,1,2,0\right)  $ and
$\beta=\left(  2,0,1,1,4\right)  $. Then, each integer appears as often in the
$5$-tuple $\alpha$ as it appears in the $5$-tuple $\beta$. In other words,
(\ref{eq.exe.multinom.anagr.formal2.ass}) holds for each $i\in X$. Hence,
Exercise \ref{exe.multinom.anagr.formal2} shows that $\beta$ is an anagram of
$\alpha$. And indeed, if we write $\alpha$ as $\left(  \alpha_{1},\alpha
_{2},\alpha_{3},\alpha_{4},\alpha_{5}\right)  $, then we can easily find a
permutation $\sigma$ of $\left[  5\right]  $ such that $\beta=\left(
\alpha_{\sigma\left(  1\right)  },\alpha_{\sigma\left(  2\right)  }%
,\alpha_{\sigma\left(  3\right)  },\alpha_{\sigma\left(  4\right)  }%
,\alpha_{\sigma\left(  5\right)  }\right)  $. (For example, the permutation
given in two-line notation as $\left(
\begin{array}
[c]{ccccc}%
1 & 2 & 3 & 4 & 5\\
4 & 5 & 1 & 3 & 2
\end{array}
\right)  $ will do.)
\end{example}

Once Exercise \ref{exe.multinom.anagr.formal2} is solved, we no longer have
need for sorting. Instead, we can apply Exercise
\ref{exe.multinom.anagr.formal2} to $X=\left[  k\right]  $, and thus conclude
that if $\beta\in\left[  k\right]  ^{n}$ is an $n$-tuple that satisfies
(\ref{pf.prop.multinom.anagr.4}), then $\beta$ is an anagram of $\alpha$. So
the second gap in the above proof of Proposition \ref{prop.multinom.anagr} is
filled again.

Note that Exercise \ref{exe.multinom.anagr.formal2} is a weaker version of
\cite[Lemma 2.13.20]{19s}.

Proposition \ref{prop.multinom.anagr} is somewhat restrictive in that it
requires the entries of $\alpha$ to appear in weakly increasing order (which
is why, in Exercise \ref{exa.multinom.anagr-anagram}, we had to replace
\textquotedblleft anagram\textquotedblright\ by \textquotedblleft
aaagmnr\textquotedblright\ before we could apply the proposition). This
requirement is insubstantial and can easily be lifted:

\begin{proposition}
\label{prop.multinom.anagr-gen}Let $n\in\mathbb{N}$ and $n_{1},n_{2}%
,\ldots,n_{k}\in\mathbb{N}$ be such that $n_{1}+n_{2}+\cdots+n_{k}=n$.

Let $\alpha\in\left[  k\right]  ^{n}$ be an $n$-tuple that satisfies%
\begin{equation}
\left(  \text{\# of times }i\text{ appears in }\alpha\right)  =n_{i}%
\ \ \ \ \ \ \ \ \ \ \text{for each }i\in\left[  k\right]  .
\label{eq.prop.multinom.anagr-gen.ass}%
\end{equation}
Then, the \# of distinct anagrams of $\alpha$ (that is, $n$-tuples obtained
from $\alpha$ by permuting its entries) is $\dbinom{n}{n_{1},n_{2}%
,\ldots,n_{k}}$.
\end{proposition}

\begin{exercise}
\label{exe.multinom.anagr-gen}Prove Proposition \ref{prop.multinom.anagr-gen}.
\end{exercise}

\subsubsection{More formulas}

We shall now state a few more basic properties of multinomial coefficients.

First, we observe that the multinomial coefficients generalize the binomial
coefficients that you see in Pascal's triangle:

\begin{proposition}
\label{prop.multinom.binom}Let $n\in\mathbb{N}$ and $k\in\left\{
0,1,\ldots,n\right\}  $. Then,%
\[
\underbrace{\dbinom{n}{k}}_{\text{binomial coefficient}}=\underbrace{\dbinom
{n}{k,n-k}}_{\text{multinomial coefficient}}.
\]

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.multinom.binom}.]From $k\in\left\{
0,1,\ldots,n\right\}  $, we obtain $k\leq n$ and thus $n-k\in\mathbb{N}$.
Also, $k\in\left\{  0,1,\ldots,n\right\}  \subseteq\mathbb{N}$. So we have
$k,n-k\in\mathbb{N}$ and $k+\left(  n-k\right)  =n$. Thus, the multinomial
coefficient $\dbinom{n}{k,n-k}$ is well-defined. Moreover, its definition
yields%
\[
\dbinom{n}{k,n-k}=\dfrac{n!}{k!\left(  n-k\right)  !}=\dfrac{n!}%
{k!\cdot\left(  n-k\right)  !}.
\]
Comparing this with%
\[
\dbinom{n}{k}=\dfrac{n!}{k!\cdot\left(  n-k\right)  !}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.binom.fac}}\right)  ,
\]
we obtain $\dbinom{n}{k}=\dbinom{n}{k,n-k}$. This proves Proposition
\ref{prop.multinom.binom}.
\end{proof}

Let us prove some further properties of multinomial coefficients.

\begin{proposition}
\label{prop.multinom.perm}Let $n\in\mathbb{N}$ and $n_{1},n_{2},\ldots
,n_{k}\in\mathbb{N}$ be such that $n_{1}+n_{2}+\cdots+n_{k}=n$. Let $\sigma$
be a permutation of $\left[  k\right]  $. Then,%
\[
\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}=\dbinom{n}{n_{\sigma\left(  1\right)
},n_{\sigma\left(  2\right)  },\ldots,n_{\sigma\left(  k\right)  }}.
\]

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.multinom.perm}.]The map $\sigma$ is a
permutation of $\left[  k\right]  $, that is, a bijection from $\left[
k\right]  $ to $\left[  k\right]  $. Hence, the product $n_{\sigma\left(
1\right)  }!n_{\sigma\left(  2\right)  }!\cdots n_{\sigma\left(  k\right)  }!$
has the same factors as the product $n_{1}!n_{2}!\cdots n_{k}!$ (just in a
different order). Thus, $n_{\sigma\left(  1\right)  }!n_{\sigma\left(
2\right)  }!\cdots n_{\sigma\left(  k\right)  }!=n_{1}!n_{2}!\cdots n_{k}!$.
For similar reasons, we have $n_{\sigma\left(  1\right)  }+n_{\sigma\left(
2\right)  }+\cdots+n_{\sigma\left(  k\right)  }=n_{1}+n_{2}+\cdots+n_{k}$.
Thus, $n_{\sigma\left(  1\right)  }+n_{\sigma\left(  2\right)  }%
+\cdots+n_{\sigma\left(  k\right)  }=n_{1}+n_{2}+\cdots+n_{k}=n$, so that the
multinomial coefficient $\dbinom{n}{n_{\sigma\left(  1\right)  }%
,n_{\sigma\left(  2\right)  },\ldots,n_{\sigma\left(  k\right)  }}$ is well-defined.

But the definition of the multinomial coefficient $\dbinom{n}{n_{\sigma\left(
1\right)  },n_{\sigma\left(  2\right)  },\ldots,n_{\sigma\left(  k\right)  }}$
yields%
\begin{align*}
\dbinom{n}{n_{\sigma\left(  1\right)  },n_{\sigma\left(  2\right)  }%
,\ldots,n_{\sigma\left(  k\right)  }}  &  =\dfrac{n!}{n_{\sigma\left(
1\right)  }!n_{\sigma\left(  2\right)  }!\cdots n_{\sigma\left(  k\right)  }%
!}=\dfrac{n!}{n_{1}!n_{2}!\cdots n_{k}!}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }n_{\sigma\left(  1\right)
}!n_{\sigma\left(  2\right)  }!\cdots n_{\sigma\left(  k\right)  }%
!=n_{1}!n_{2}!\cdots n_{k}!\right) \\
&  =\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}%
\end{align*}
(since the multinomial coefficient $\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}$ is
defined to be $\dfrac{n!}{n_{1}!n_{2}!\cdots n_{k}!}$).

This proves Proposition \ref{prop.multinom.perm}.
\end{proof}

\begin{theorem}
[Recurrence of the multinomial coefficients]\label{thm.multinom.rec}Let
$n\in\mathbb{N}$ and $n_{1},n_{2},\ldots,n_{k}\in\mathbb{N}$ be such that
$n_{1}+n_{2}+\cdots+n_{k}=n>0$. Then,%
\[
\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}=\sum_{i=1}^{k}\underbrace{\dbinom
{n-1}{n_{1},\ldots,n_{i-1},n_{i}-1,n_{i+1},\ldots,n_{k}}}_{\text{This should
be interpreted as }0\text{ if }n_{i}=0}.
\]

\end{theorem}

\begin{exercise}
\label{exe.multinom.rec}Prove Theorem \ref{thm.multinom.rec}.
\end{exercise}

Just as we tabulated the binomial coefficients in Pascal's triangle, we can
tabulate the multinomial coefficients $\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}$
for a given value of $k$ in a $k$-dimensional pyramid-like table, called
\textquotedblleft Pascal's pyramid\textquotedblright\ (see \cite[p. 20, Figure
10]{Ueckerdt} for a picture). Theorem \ref{thm.multinom.rec} shows that each
entry in this table (except for the $\dbinom{0}{0,0,\ldots,0}=1$ at its apex)
is the sum of its $k$ upper neighbors (generalizing the analogous property of
Pascal's triangle).

The following theorem generalizes the binomial formula (because of Proposition
\ref{prop.multinom.binom}):

\begin{theorem}
[the multinomial formula]\label{thm.multinom.mulfor}Let $x_{1},x_{2}%
,\ldots,x_{k}$ be $k$ numbers. Let $n\in\mathbb{N}$. Then,%
\[
\left(  x_{1}+x_{2}+\cdots+x_{k}\right)  ^{n}=\sum_{\substack{\left(
n_{1},n_{2},\ldots,n_{k}\right)  \in\mathbb{N}^{k};\\n_{1}+n_{2}+\cdots
+n_{k}=n}}\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}x_{1}^{n_{1}}x_{2}^{n_{2}}\cdots
x_{k}^{n_{k}}.
\]

\end{theorem}

\begin{proof}
LTTR. There are many ways to prove this: Either do it combinatorially using
Proposition \ref{prop.multinom.maps} (see \cite[Theorem 11.7]{Galvin} for this
proof); or use induction on $n$; or use induction on $k$ (see \cite[Exercise
6.2]{detnotes} for this proof\footnote{Keep in mind that what we call
$\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}$ is denoted by $\mathbf{m}\left(
n_{1},n_{2},\ldots,n_{k}\right)  $ in \cite[Exercise 6.2]{detnotes}.}).
\end{proof}

\section{\label{chp.12fold}The twelvefold way}

Let us look back at the counting problems we have so far been solving. We have
counted subsets, tuples, maps, integers, tilings and more complicated
combinations of these (such as tuples of subsets). While these problems were
often interconnected (in particular, many of them were solved using the same
methods, and bijections let us translate between differently looking objects),
the problems themselves followed no system other than \textquotedblleft what
else can we count using the methods seen so far?\textquotedblright.
Historically, this has led to combinatorics being regarded more as a
hodgepodge of problems and tricks rather than as a systematic theory.

To some extent, this is still the case, and it is not just an artifact of
viewpoint; combinatorics really is a broad field with much less of a clear
direction than many other mathematical subjects.\footnote{This is not entirely
a bad thing: It means that an average result in combinatorics relies less on
prior knowledge and mastery of complex theory than in most other
pure-mathematical disciplines. Already early on in your journey, you have more
directions to \textquotedblleft branch out\textquotedblright\ into, and more
results you can achieve without years of training but merely with a good dose
of creativity and perseverance. But on the flip side, it means that said
results will be less likely to be foundational to others' work after you. (And
this does not spell significance for texts like this...)} Nevertheless, there
is more structure in combinatorics than meets the eye, and there have been
several successful attempts to classify and organize the most common
enumerative problems in a coherent theory. One of the most successful attempts
of this kind is the \emph{twelvefold way}, introduced in the 1960s by
Gian-Carlo Rota under the name of \textquotedblleft theory of distribution and
occupancy\textquotedblright\ (or, less grandiloquently, \textquotedblleft
placing balls in boxes\textquotedblright) and since popularized as the
\textquotedblleft twelvefold way\textquotedblright.

\subsection{\label{sect.12fold.what}What is the twelvefold way?}

The \href{https://en.wikipedia.org/wiki/Twelvefold_way}{\emph{twelvefold way}}
is a collection of $12$ standard counting problems (usually arranged as a
table with $4$ rows and $3$ columns) that frequently appear in combinatorics
(in the sense that many other counting problems can be reduced to them). Let
us first introduce it informally, and then define it formally and study it in detail.

\begin{convention}
For the rest of Chapter \ref{chp.12fold}, we fix two finite sets $A$ and $X$.
We shall refer to the elements of $A$ as \emph{balls}, and we shall refer to
the elements of $X$ as \emph{boxes}. (The letters $A$ and $X$ have been chosen
because \textquotedblleft a\textquotedblright\ appears in \textquotedblleft
ball\textquotedblright\ while \textquotedblleft x\textquotedblright\ appears
in \textquotedblleft box\textquotedblright. I cannot use \textquotedblleft%
$B$\textquotedblright\ for both sets...)

A \emph{placement} shall mean a way to distribute all the balls $a\in A$ into
the boxes $x\in X$. Rigorously, we can think of a placement as a map from $A$
to $X$. More precisely, this is what we will call an \textquotedblleft%
$L\rightarrow L$\emph{ placement}\textquotedblright; other kinds of placements
will be defined below.
\end{convention}

How many $L\rightarrow L$ placements are there? Of course, there are
$\left\vert X\right\vert ^{\left\vert A\right\vert }$ many (by Theorem
\ref{thm.binom.maps-all}). But let us look at them more closely.

\begin{example}
\label{exa.12fold.what.1}Let $X=\left[  2\right]  $ and $A=\left[  3\right]
$, so that $\left\vert X\right\vert =2$ and $\left\vert A\right\vert =3$.
Thus, we are trying to place $3$ balls (called $1,2,3$) into $2$ boxes (called
$1,2$).

We will draw such placements as follows: We will always draw the boxes in
increasing order:%
\[
\fbox{$%
\ \ \numboxed{\phantom{(1)(2)(3)}}{1}\ \ \ \numboxed{\phantom{(1)(2)(3)}}{2}\ \ $}%
\]
We draw each ball as a pair of parentheses with a number inside -- so, for
example, the ball $3$ will be drawn as \textquotedblleft$\left(  3\right)
$\textquotedblright.

So the $L\rightarrow L$ placements of the balls $1,2,3\in A$ in the boxes
$1,2\in X$ are%
\begin{align*}
&  \fbox{$%
\ \ \numboxed{(1)(2)(3)}{1}\ \ \ \numboxed{\phantom{(1)(2)(3)}}{2}\ \ $}%
\ \ ,\ \ \ \ \ \ \ \ \ \ \fbox{$%
\ \ \numboxed{\phantom{(3}(1)(2)\phantom{)}}{1}\ \ \ \numboxed{\phantom{(1)}(3)\phantom{(2)}}{2}\ \ $}%
\ \ ,\\
& \\
&  \fbox{$%
\ \ \numboxed{\phantom{(2}(1)(3)\phantom{)}}{1}\ \ \ \numboxed{\phantom{(1)}(2)\phantom{(3)}}{2}\ \ $}%
\ \ ,\ \ \ \ \ \ \ \ \ \ \fbox{$%
\ \ \numboxed{\phantom{(1}(2)(3)\phantom{)}}{1}\ \ \ \numboxed{\phantom{(2)}(1)\phantom{(3)}}{2}\ \ $}%
\ \ ,\\
& \\
&  \fbox{$%
\ \ \numboxed{\phantom{(1)}(3)\phantom{(2)}}{1}\ \ \ \numboxed{\phantom{(3}(1)(2)\phantom{)}}{2}\ \ $}%
\ \ ,\ \ \ \ \ \ \ \ \ \ \fbox{$%
\ \ \numboxed{\phantom{(1)}(2)\phantom{(3)}}{1}\ \ \ \numboxed{\phantom{(2}(1)(3)\phantom{)}}{2}\ \ $}%
\ \ ,\\
& \\
&  \fbox{$%
\ \ \numboxed{\phantom{(2)}(1)\phantom{(3)}}{1}\ \ \ \numboxed{\phantom{(1}(2)(3)\phantom{)}}{2}\ \ $}%
\ \ ,\ \ \ \ \ \ \ \ \ \ \fbox{$%
\ \ \numboxed{\phantom{(1)(2)(3)}}{1}\ \ \ \numboxed{(1)(2)(3)}{2}\ \ $}\ \ .
\end{align*}
The order of balls \textbf{within} a single box does not matter:%
\[
\fbox{$%
\ \ \numboxed{\phantom{(1)}(3)\phantom{(2)}}{1}\ \ \ \numboxed{\phantom{(3}(1)(2)\phantom{)}}{2}\ \ $}%
\ \ =\ \ \fbox{$%
\ \ \numboxed{\phantom{(1)}(3)\phantom{(2)}}{1}\ \ \ \numboxed{\phantom{(3}(2)(1)\phantom{)}}{2}\ \ $}%
\ \ \ .
\]

\end{example}

As we said, counting these $L\rightarrow L$ placements was easy. But we can
consider the following variations of the problem:

\begin{itemize}
\item What if we require our maps $f:A\rightarrow X$ to be injective (i.e.,
each box contains $\leq1$ ball) or surjective (i.e., each box contains $\geq1$ ball)?

\item What if the balls are unlabelled (i.e., indistinguishable)?

For example, the two $L\rightarrow L$ placements%
\[
\fbox{$%
\ \ \numboxed{\phantom{(3}(1)(2)\phantom{)}}{1}\ \ \ \numboxed{\phantom{(1)}(3)\phantom{(2)}}{2}\ \ $}%
\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \fbox{$%
\ \ \numboxed{\phantom{(1}(2)(3)\phantom{)}}{1}\ \ \ \numboxed{\phantom{(2)}(1)\phantom{(3)}}{2}\ \ $}%
\]
were counted as different, because the former has ball $1$ in box $1$ whereas
the latter has ball $1$ in box $2$. But if the balls are indistinguishable,
then this difference disappears, and these placements become identical, thus
reducing the count.

Intuitively, it may be clear what \textquotedblleft
indistinguishable\textquotedblright\ means, but it is a bit tricky to make
this mathematically rigorous. After all, if we define placements as maps, then
we cannot just pretend that two different maps are equal because we
\textquotedblleft chose to think of the balls as
indistinguishable\textquotedblright. (There is no notion of a
\textquotedblleft set with indistinguishable elements\textquotedblright\ in
mathematics.\footnote{Actually, there is: the notion of a multiset, as defined
in Section \ref{sect.binom.mulsub}. However, it would only help us if we
defined maps between multisets (as well as maps between multisets and sets),
which we are not going to do (as it comes with its own difficulties).})

We will make this rigorous using the notion of \textit{equivalence classes}
(which we will introduce in Section \ref{sect.12fold.eqrel}). These are sets
of mutually equivalent objects (in our case, maps $f:A\rightarrow X$), where
the word \textquotedblleft equivalent\textquotedblright\ is understood with
respect to a specific relation. Equivalent objects will contribute to the same
equivalence class; thus, if we want to \textquotedblleft count objects up to
equivalence\textquotedblright, all we will have to do is counting their
equivalence classes. This is a valid and (once you have gotten used to it)
fairly convenient rigorous alternative to \textquotedblleft
pretending\textquotedblright\ that equivalent objects are \textquotedblleft
the same\textquotedblright.

Here is how this general idea will be applied to our question about
indistinguishable balls: We will say that two maps $f,g:A\rightarrow X$ are
\textquotedblleft\textit{ball-equivalent}\textquotedblright\ if there is a
permutation $\tau$ of the balls (i.e., formally: a permutation $\tau$ of the
set $A$) that transforms one into the other (i.e., that satisfies
$f=g\circ\tau$). Then, \textquotedblleft$U\rightarrow L$\textit{
placements}\textquotedblright\ (i.e., placements of unlabelled balls in
labelled boxes) will be defined as the equivalence classes of ball-equivalence.

For example, the two $L\rightarrow L$ placements%
\[
\fbox{$%
\ \ \numboxed{\phantom{(3}(1)(2)\phantom{)}}{1}\ \ \ \numboxed{\phantom{(1)}(3)\phantom{(2)}}{2}\ \ $}%
\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \fbox{$%
\ \ \numboxed{\phantom{(1}(2)(3)\phantom{)}}{1}\ \ \ \numboxed{\phantom{(2)}(1)\phantom{(3)}}{2}\ \ $}%
\]
are ball-equivalent, and therefore contribute to only $1$ ball-equivalence
class -- i.e., they count as one and the same $U\rightarrow L$ placement.

We shall draw $U\rightarrow L$ placements in the same way as we draw
$L\rightarrow L$ placements, but representing balls by \textquotedblleft%
$\bullet$\textquotedblright\ symbols (rather than by numbers in parentheses).
Thus, the $U\rightarrow L$ placement that we have just discussed becomes%
\[
\fbox{$%
\ \ \numboxed{\phantom{(\bullet}\bullet\bullet\phantom{\bullet)}}{1}\ \ \ \numboxed{\phantom{(1)}\bullet\phantom{(2)}}{2}\ \ $}%
\ \ .
\]
This shall visualize the fact that balls are indistinguishable.

\item What if the boxes are unlabelled (i.e., indistinguishable)?

This can be made rigorous in a similar way, but using permutations of boxes
instead of permutations of balls. This gives \textquotedblleft$L\rightarrow
U$\textit{ placements}\textquotedblright\ (i.e., placements of labelled balls
into unlabelled boxes). For example, the two $L\rightarrow L$ placements%
\[
\fbox{$%
\ \ \numboxed{\phantom{(2}(1)(3)\phantom{)}}{1}\ \ \ \numboxed{\phantom{(1)}(2)\phantom{(3)}}{2}\ \ $}%
\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \fbox{$%
\ \ \numboxed{\phantom{(1)}(2)\phantom{(3)}}{1}\ \ \ \numboxed{\phantom{(2}(1)(3)\phantom{)}}{2}\ \ $}%
\]
are \textquotedblleft\textit{box-equivalent}\textquotedblright\ (i.e., can be
transformed into one another by permuting the boxes) and thus contribute to
only $1$ box-equivalence class -- i.e., they count as one and the same
$L\rightarrow U$ placement.

We shall draw $L\rightarrow U$ placements in the same way as we draw
$L\rightarrow L$ placements, but without marking the boxes as
\textquotedblleft box $1$\textquotedblright, \textquotedblleft box
$2$\textquotedblright\ etc.. Thus, the $L\rightarrow U$ placement that we have
just discussed becomes%
\[
\fbox{$%
\ \ \boxed{\phantom{(2}(1)(3)\phantom{)}}\ \ \ \boxed{\phantom{(1)}(2)\phantom{(3)}}\ \ $}%
\ \ .
\]


\item What if both the boxes and the balls are indistinguishable? This kind of
placements will be called \textquotedblleft$U\rightarrow U$\textit{
placements}\textquotedblright. We shall draw them in the same way as we draw
$L\rightarrow L$ placements, but representing balls by \textquotedblleft%
$\bullet$\textquotedblright\ symbols and without marking the boxes.
\end{itemize}

We can combine these variations, by

\begin{itemize}
\item requiring $f$ either to be arbitrary (i.e., not requiring anything about
$f$), or to be injective, or to be surjective;

\item counting $L\rightarrow L$ placements or $U\rightarrow L$ placements or
$L\rightarrow U$ placements or $L\rightarrow L$ placements.
\end{itemize}

\noindent In total, we thus get $3\cdot4=12$ many different counting problems.
We list them in a table:%
\[%
\begin{tabular}
[c]{|c||c|c|c|}\hline
& arbitrary & injective & surjective\\\hline
$L\rightarrow L$ & $\left\vert X\right\vert ^{\left\vert A\right\vert }$ &  &
\\\hline
$U\rightarrow L$ &  &  & \\\hline
$L\rightarrow U$ &  &  & \\\hline
$U\rightarrow U$ &  &  & \\\hline
\end{tabular}
\ \
\]
Here:

\begin{itemize}
\item The columns specify whether we are requiring $f$ to be arbitrary or
injective or surjective.

\item The rows specify what kind of placements we are counting:

\begin{itemize}
\item \textquotedblleft$L\rightarrow L$\textquotedblright\ means
\textquotedblleft balls are labelled, boxes are labelled\textquotedblright, so
we are just counting maps $f:A\rightarrow X$.

\item \textquotedblleft$U\rightarrow L$\textquotedblright\ means
\textquotedblleft balls are unlabelled, boxes are labelled\textquotedblright.

\item \textquotedblleft$L\rightarrow U$\textquotedblright\ means
\textquotedblleft balls are labelled, boxes are unlabelled\textquotedblright.

\item \textquotedblleft$U\rightarrow U$\textquotedblright\ means
\textquotedblleft balls are unlabelled, boxes are unlabelled\textquotedblright.
\end{itemize}
\end{itemize}

\begin{example}
Let $X=\left[  2\right]  $ and $A=\left[  3\right]  $. Then, let us count how
many placements of each kind we have:%
\[%
\begin{tabular}
[c]{|c||c|c|c|}\hline
& arbitrary & injective & surjective\\\hline
$L\rightarrow L$ & $8$ & $0$ & $6$\\\hline
$U\rightarrow L$ & $4$ & $0$ & $2$\\\hline
$L\rightarrow U$ & $4$ & $0$ & $3$\\\hline
$U\rightarrow U$ & $2$ & $0$ & $1$\\\hline
\end{tabular}
\
\]


In fact:

\begin{itemize}
\item The $U\rightarrow L$ placements are%
\begin{align*}
&  \fbox{$%
\ \ \numboxed{\phantom{((}\bullet\bullet\bullet\phantom{))}}{1}\ \ \ \numboxed{\phantom{(1) \bullet (2)}}{2}\ \ $}%
\ \ ,\ \ \ \ \ \ \ \ \ \ \fbox{$%
\ \ \numboxed{\phantom{(\bullet}\bullet\bullet\phantom{\bullet)}}{1}\ \ \ \numboxed{\phantom{(1)}\bullet\phantom{(2)}}{2}\ \ $}%
\ \ ,\\
& \\
&  \fbox{$%
\ \ \numboxed{\phantom{(1)}\bullet\phantom{(2)}}{1}\ \ \ \numboxed{\phantom{(\bullet}\bullet\bullet\phantom{\bullet)}}{2}\ \ $}%
\ \ ,\ \ \ \ \ \ \ \ \ \ \fbox{$%
\ \ \numboxed{\phantom{(1) \bullet (2)}}{1}\ \ \ \numboxed{\phantom{((}\bullet\bullet\bullet\phantom{))}}{2}\ \ $}%
\ \ .
\end{align*}


\item The $L\rightarrow U$ placements are%
\begin{align*}
&  \fbox{$\ \ \boxed{(1)(2)(3)}\ \ \ \boxed{\phantom{(1)(2)(3)}}\ \ $}%
\ \ ,\ \ \ \ \ \ \ \ \ \ \fbox{$%
\ \ \boxed{\phantom{(3}(1)(2)\phantom{)}}\ \ \ \boxed{\phantom{(1)}(3)\phantom{(2)}}\ \ $}%
\ \ ,\\
& \\
&  \fbox{$%
\ \ \boxed{\phantom{(2}(1)(3)\phantom{)}}\ \ \ \boxed{\phantom{(1)}(2)\phantom{(3)}}\ \ $}%
\ \ ,\ \ \ \ \ \ \ \ \ \ \fbox{$%
\ \ \boxed{\phantom{(1}(2)(3)\phantom{)}}\ \ \ \boxed{\phantom{(2)}(1)\phantom{(3)}}\ \ $}%
\ \ .
\end{align*}


\item The $U\rightarrow U$ placements are%
\[
\fbox{$%
\ \ \boxed{\phantom{((}\bullet\bullet\bullet\phantom{))}}\ \ \ \boxed{\phantom{(1) \bullet (2)}}\ \ $}%
\ \ ,\ \ \ \ \ \ \ \ \ \ \fbox{$%
\ \ \boxed{\phantom{(\bullet}\bullet\bullet\phantom{\bullet)}}\ \ \ \boxed{\phantom{(1)}\bullet\phantom{(2)}}\ \ $}%
\ \ .
\]

\end{itemize}
\end{example}

In general, not every of the $12$ questions in the table above has a
closed-form answer. But each has, at least, a good recursive answer, and there
is much to be learned from attempting to answer all the questions. We shall
thus strive to fill in the whole \textquotedblleft twelvefold
way\textquotedblright\ table, row by row.

\subsection{$L\rightarrow L$}

We begin with the first row of the twelvefold way: the counting of
$L\rightarrow L$ placements. Let us repeat how we defined them above:

\begin{definition}
\label{def.12fold.LtoL}An $L\rightarrow L$\emph{ placement} from $A$ to $X$ is
just a map from $A$ to $X$. The value of this map at some $a\in A$ is called
the \emph{box in which ball }$a$\emph{ is placed}.
\end{definition}

We can now count the $L\rightarrow L$ placements:

\begin{proposition}
\label{prop.12fold.LtoL.all}We have%
\begin{align*}
&  \left(  \text{\# of }L\rightarrow L\text{ placements }A\rightarrow X\right)
\\
&  =\left(  \text{\# of maps from }A\text{ to }X\right)  =\left\vert
X\right\vert ^{\left\vert A\right\vert }.
\end{align*}

\end{proposition}

\begin{proof}
The first equality sign follows from Definition \ref{def.12fold.LtoL}. The
second equality sign follows from Theorem \ref{thm.binom.maps-all} (applied to
$m=\left\vert A\right\vert $, $n=\left\vert X\right\vert $ and $B=X$).
\end{proof}

\begin{proposition}
\label{prop.12fold.LtoL.inj}We have%
\begin{align*}
&  \left(  \text{\# of injective }L\rightarrow L\text{ placements
}A\rightarrow X\right) \\
&  =\left(  \text{\# of injective maps from }A\text{ to }X\right)  =\left\vert
X\right\vert ^{\underline{\left\vert A\right\vert }}.
\end{align*}

\end{proposition}

\begin{proof}
The first equality sign follows from Definition \ref{def.12fold.LtoL}. The
second equality sign follows from Theorem \ref{thm.binom.maps-inj} (applied to
$m=\left\vert A\right\vert $, $n=\left\vert X\right\vert $ and $B=X$).
\end{proof}

\begin{proposition}
\label{prop.12fold.LtoL.sur}We have%
\begin{align*}
&  \left(  \text{\# of surjective }L\rightarrow L\text{ placements
}A\rightarrow X\right) \\
&  =\left(  \text{\# of surjective maps from }A\text{ to }X\right)
=\operatorname*{sur}\left(  \left\vert A\right\vert ,\left\vert X\right\vert
\right)  .
\end{align*}

\end{proposition}

\begin{proof}
The first equality sign follows from Definition \ref{def.12fold.LtoL}. The
second equality sign follows from Theorem \ref{prop.binom.maps-surj} (applied
to $m=\left\vert A\right\vert $, $n=\left\vert X\right\vert $ and $B=X$).
\end{proof}

\begin{example}
Here are some typical counting problems that boil down to counting
$L\rightarrow L$ placements:

\begin{itemize}
\item How many ways are there to assign grades (from a finite set $X$) to
students (from a finite set $A$) ? These assignments are arbitrary
$L\rightarrow L$ placements.

\item How many ways are there to assign IP addresses to a given set of
computers? These assignments are injective $L\rightarrow L$ placements, since
IP addresses should be distinct and come from a well-specified set (say,
$\left\{  \text{32-bit numbers}\right\}  $ for IPv4 addresses).

\item How many $8$-digit telephone numbers are there with no $2$ equal digits?

Of course, these telephone numbers are precisely the injective $8$-tuples
$\left(  i_{1},i_{2},\ldots,i_{8}\right)  \in\left\{  0,1,\ldots,9\right\}
_{\operatorname*{inj}}^{8}$ (see Definition \ref{def.binom.inj-k-tup} for the
meaning of these words), and thus Proposition \ref{prop.binom.inj-k-tup.count}
shows that there are $10^{\underline{8}}$ many of them.

Alternatively, let us restate this counting problem in terms of $L\rightarrow
L$ placements: The $8$-digit telephone numbers with no $2$ equal digits
correspond to injective $L\rightarrow L$ placements with $A=\left[  8\right]
$ and $X=\left\{  0,1,\ldots,9\right\}  $; for example, the telephone number
$20354986$ corresponds to the $L\rightarrow L$ placement%
\[
\fbox{$%
\ \ \numboxed{(2)}{0}\ \ \ \numboxed{\phantom{(2)}}{1}\ \ \ \numboxed{(1)}{2}\ \ \ \numboxed{(3)}{3}\ \ \ \numboxed{(5)}{4}\ \ \ \numboxed{(4)}{5}\ \ \ \numboxed{(8)}{6}\ \ \ \numboxed{\phantom{(2)}}{7}\ \ \ \numboxed{(7)}{8}\ \ \ \numboxed{(6)}{9}\ \ $}%
\ \ .
\]
Thus, the total \# of such telephone numbers is $10^{\underline{8}}%
=10\cdot9\cdot\cdots\cdot3=10!/2!$.
\end{itemize}
\end{example}

\subsection{\label{sect.12fold.eqrel}Equivalence relations}

Now, we take a break from counting questions to build some theory that will
help us rigorously formulate the other three rows of the twelvefold way (i.e.,
the notions of $U\rightarrow L$ placements, $L\rightarrow U$ placements, and
$U\rightarrow U$ placements). These notions depend on having \textquotedblleft
unlabelled balls\textquotedblright\ and/or \textquotedblleft unlabelled
boxes\textquotedblright. What does it mean for balls, or boxes, to be unlabelled?

Rigorously, it means that we are counting \textbf{not} the maps
$f:A\rightarrow X$ themselves, but rather their \textbf{equivalence classes}
with respect to some relation.

We are going to explain what these are. First, let us introduce (or recall,
depending on your background) the notions of \textit{relations} and, in
particular, \textit{equivalence relations}.

\begin{center}
\fbox{\textbf{Class of 2019-11-08}}
\end{center}

\subsubsection{Relations}

I will follow \cite[Chapter 3]{19s} in this subsection.

We will first define the notion of a \emph{binary relation}. Roughly speaking,
if $S$ is a set, then a binary relation on $S$ is a rule that associates some
elements of $S$ with some elements of $S$. For instance, equality is a binary
relation on an arbitrary set $S$ (associating each element of $S$ with
itself); divisibility is a binary relation on the set $\mathbb{Z}$
(associating each integer $x$ with each integer $y$ such that $x$ is divisible
by $y$); orthogonality is a binary relation on the set of all (straight) lines
in the plane (associating each line with each line that is orthogonal to it).
See Example \ref{exa.12fold.eqrel.exas1} for some more examples.

In order to rigorously define the general notion of a binary relation, we
encode it as a set of pairs of elements of $S$: namely, as the set of all
pairs $\left(  x,y\right)  $ such that our relation associates $x$ with $y$.
Since a set of pairs of elements of $S$ is the same as a subset of $S\times
S$, we thus arrive at the following definition:

\begin{definition}
\label{def.12fold.eqrel.rel}Let $S$ be a set. A \emph{binary relation} on $S$
is formally defined as a subset of $S\times S$. If $R$ is a binary relation on
$S$, and if $\left(  x,y\right)  $ is a pair of two elements of $S$, then the
statement \textquotedblleft$\left(  x,y\right)  \in R$\textquotedblright\ will
be written as \textquotedblleft$x\ R\ y$\textquotedblright. (This notation is
called \textquotedblleft writing $R$ \emph{infix}\textquotedblright.)

Informally, a binary relation on $S$ is understood to mean a statement
\textquotedblleft$x\ R\ y$\textquotedblright\ defined for every pair of
elements $\left(  x,y\right)  \in S\times S$. For each pair $\left(
x,y\right)  \in S\times S$, this statement $x\ R\ y$ is either true or false.
\end{definition}

The informal and the formal definitions of a binary relation are equivalent, because:

\begin{itemize}
\item Given a statement \textquotedblleft$x\ R\ y$\textquotedblright\ defined
for every pair $\left(  x,y\right)  \in S\times S$, we can encode it as a
subset of $S\times S$, namely as the subset%
\[
\left\{  \left(  x,y\right)  \in S\times S\ \mid\ x\ R\ y\right\}  .
\]


\item Conversely, every subset $T$ of $S\times S$ can be decoded into a
statement defined for every pair $\left(  x,y\right)  \in S\times S$ (namely,
the statement \textquotedblleft$\left(  x,y\right)  \in T$\textquotedblright).
\end{itemize}

\begin{convention}
In the following, we will abbreviate the words \textquotedblleft\emph{binary
relation}\textquotedblright\ simply as \textquotedblleft\emph{relation}%
\textquotedblright.
\end{convention}

Relations can be found in droves all over mathematics; here are some basic examples:

\begin{example}
\label{exa.12fold.eqrel.exas1}Let $S=\mathbb{Z}$.

\textbf{(a)} The relation $=$ is a binary relation on $S$. As a subset of
$S\times S$, this relation is%
\begin{align*}
\left\{  \left(  a,b\right)  \in S\times S\ \mid\ a=b\right\}   &  =\left\{
\left(  c,c\right)  \ \mid\ c\in S\right\} \\
&  =\left\{  \ldots,\left(  -2,-2\right)  ,\left(  -1,-1\right)  ,\left(
0,0\right)  ,\left(  1,1\right)  ,\left(  2,2\right)  ,\ldots\right\}  .
\end{align*}


\textbf{(b)} The relation $<$ is a binary relation on $S$. As a subset of
$S\times S$, this relation is%
\[
\left\{  \left(  a,b\right)  \in S\times S\ \mid\ a<b\right\}  .
\]
For example, the pair $\left(  2,3\right)  $ belongs to this subset $<$ of
$S\times S$, whereas the pairs $\left(  2,2\right)  $ and $\left(  3,2\right)
$ do not.

\textbf{(c)} The relation $\leq$ is a binary relation on $S$. For instance, it
contains the pairs $\left(  2,2\right)  $ and $\left(  2,3\right)  $ but not
$\left(  3,2\right)  $.

\textbf{(d)} The relation $\neq$ is a binary relation on $S$. As a subset of
$S\times S$, this relation is $\left(  S\times S\right)  \setminus\left(
=\right)  $, where $\left(  =\right)  $ is the relation $=$ from Example
\ref{exa.12fold.eqrel.exas1} \textbf{(a)}.

\textbf{(e)} Fix $n\in\mathbb{Z}$. Define a binary relation
$\underset{n}{\equiv}$ on $S=\mathbb{Z}$ by%
\begin{align*}
\left(  a\underset{n}{\equiv}b\right)  \  &  \Longleftrightarrow\ \left(
a\equiv b\operatorname{mod}n\right)  \ \Longleftrightarrow\ \left(  n\mid
a-b\right) \\
\  &  \Longleftrightarrow\ \left(  a=b+kn\text{ for some }k\in\mathbb{Z}%
\right)  .
\end{align*}
This relation $\underset{n}{\equiv}$ is called \emph{congruence modulo }$n$.
Note that the relation $\underset{0}{\equiv}$ is $=$.

When $n$ is positive, we have $a\equiv b\operatorname{mod}n$ if and only if
$a\%n=b\%n$, where we are using the notation $c\%n$ for the remainder of an
integer $c$ upon division by $n$.

For $n=1$, we have the chain of equivalences%
\[
\left(  a\underset{1}{\equiv}b\right)  \Longleftrightarrow\left(  1\mid
a-b\right)  \Longleftrightarrow\left(  \dfrac{a-b}{1}\in\mathbb{Z}\right)
\Longleftrightarrow\left(  a-b\in\mathbb{Z}\right)  \Longleftrightarrow\left(
\text{true}\right)
\]
for any two integers $a$ and $b$. Thus, the relation $\underset{1}{\equiv}$
contains every pair of two integers (i.e., we have $a\underset{1}{\equiv}b$
for all $\left(  a,b\right)  \in S\times S$). Hence, it equals the whole set
$S\times S$ (when considered as a subset of $S\times S$).

The relation $\underset{2}{\equiv}$ associates every even integer with every
even integer, and associates every odd integer with every odd integer. Besides
these, it associates no integers. Thus, it associates two integers if and only
if these two integers have the same parity.

\textbf{(f)} Define a binary relation $N$ on $S$ by%
\[
\left(  a\ N\ b\right)  \Longleftrightarrow\left(  \text{false}\right)  .
\]
That is, there is no pair $\left(  a,b\right)  \in S\times S$ such that
$a\ N\ b$. As a subset of $S\times S$, this relation $N$ is $\varnothing$.

\textbf{(g)} Define a binary relation $A$ on $S$ by%
\[
\left(  a\ A\ b\right)  \Longleftrightarrow\left(  \text{true}\right)  .
\]
That is, every pair $\left(  a,b\right)  \in S\times S$ satisfies $a\ A\ b$.
As a subset of $S\times S$, this relation is $S\times S$ itself.

This relation $A$ is identical with the relation $\underset{1}{\equiv}$ from
Example \ref{exa.12fold.eqrel.exas1} \textbf{(e)}; however, the way we have
just defined it, we can just as well define an analogous relation $A$ for
every set $S$ (not just for $S=\mathbb{Z}$), whereas the definition of
$\underset{1}{\equiv}$ requires $S$ to be $\mathbb{Z}$.

\textbf{(h)} The relation $\mid$ (also known as \textquotedblleft
divides\textquotedblright) is a binary relation on $S$. For instance, the pair
$\left(  3,12\right)  $ belongs to this relation $\mid$, because $3\mid12$.

\textbf{(i)} The relation \textquotedblleft is coprime to\textquotedblright%
\ is a binary relation on $S$. For example, it contains the pair $\left(
3,4\right)  $, but not the pair $\left(  2,4\right)  $.
\end{example}

There are other examples of relations on $\mathbb{Z}$, as well as relations on
other sets. For example, if $S$ is the set of all straight lines on the plane
(in plane geometry), then \textquotedblleft parallel\textquotedblright\ is a
relation on $S$; so is \textquotedblleft orthogonal\textquotedblright.

\subsubsection{Equivalence relations}

We shall be particularly interested in a special class of relations: the
\emph{equivalence relations}. To define them, we first introduce three
properties that some relations have:

\begin{definition}
\label{def.12fold.eqrel.rst}Let $R$ be a binary relation on a set $S$.

\textbf{(a)} We say that $R$ is \emph{reflexive} if every $a\in S$ satisfies
$a\ R\ a$.

\textbf{(b)} We say that $R$ is \emph{symmetric} if every $a,b\in S$
satisfying $a\ R\ b$ satisfy $b\ R\ a$.

\textbf{(c)} We say that $R$ is \emph{transitive} if every $a,b,c\in S$
satisfying $a\ R\ b$ and $b\ R\ c$ satisfy $a\ R\ c$.
\end{definition}

\begin{example}
\label{exa.12fold.eqrel.rst.exa1}Let $S$ be the set $\mathbb{Z}$. Recall the
relations on $S$ introduced in Example \ref{exa.12fold.eqrel.exas1}.

\textbf{(a)} The relation $=$ is reflexive, symmetric and transitive. (For
instance, the transitivity of $=$ means that every $a,b,c\in S$ satisfying
$a=b$ and $b=c$ satisfy $a=c$. This is a very fundamental property of equality.)

\textbf{(b)} The relation $<$ is not reflexive, not symmetric but transitive.

\textbf{(c)} The relation $\leq$ is reflexive, not symmetric but transitive.
(It is reflexive because every $a\in S$ satisfies $a\leq a$.)

\textbf{(d)} The relation $\neq$ is not reflexive, but symmetric. It is not
transitive (e.g., we have $2\neq3$ and $3\neq2$, but $2=2$).

\textbf{(e)} For every $n\in\mathbb{Z}$, the congruence relation
$\underset{n}{\equiv}$ is reflexive (since $n\mid a-a$), symmetric (since
$n\mid a-b$ implies $n\mid b-a$) and transitive (since $n\mid a-b$ and $n\mid
b-c$ imply $n\mid a-c$).

\textbf{(f)} The relation $N$ is symmetric (vacuously) and transitive
(vacuously), but not reflexive. (\textquotedblleft Vacuously\textquotedblright%
\ means that the respective statements are vacuously true. For instance, in
order to show that the relation $N$ is symmetric, we must show that every
$a,b\in S$ satisfying $a\ N\ b$ satisfy $b\ N\ a$. But this is vacuously true,
since the antecedent $a\ N\ b$ never holds in the first place.)

\textbf{(g)} The relation $A$ is reflexive, symmetric and transitive.

\textbf{(h)} The divisibility relation $\mid$ is reflexive but not symmetric.
It is transitive (if $a\mid b$ and $b\mid c$, then $a\mid c$).

\textbf{(i)} The coprimality relation is symmetric but neither reflexive nor transitive.
\end{example}

We are now ready to define equivalence relations:

\begin{definition}
\label{def.12fold.eqrel.eqrel}An \emph{equivalence relation} on a set $S$
means a relation on $S$ that is reflexive, symmetric and transitive.
\end{definition}

Among the relations discussed in Example \ref{exa.12fold.eqrel.exas1}, three
are equivalence relations:

\begin{example}
Let $S$ be any set. The relation $=$ on $S$ is an equivalence relation.
\end{example}

\begin{example}
Let $n\in\mathbb{Z}$. Then, the congruence relation $\underset{n}{\equiv}$ on
$\mathbb{Z}$ is an equivalence relation.
\end{example}

\begin{example}
Let $S$ be any set. Let $A$ be the binary relation on $S$ defined by $\left(
a\ A\ b\right)  \Longleftrightarrow\left(  \text{true}\right)  $. (That is, we
define $A$ as in Example \ref{exa.12fold.eqrel.exas1} \textbf{(g)}, but
without requiring $S=\mathbb{Z}$.) Then, $A$ is an equivalence relation.
\end{example}

Here are some further examples from plane geometry:

\begin{example}
The relation \textquotedblleft parallel\textquotedblright\ on the set
$\left\{  \text{lines in the plane}\right\}  $ is an equivalence relation. But
the relation \textquotedblleft orthogonal\textquotedblright\ on the same set
is not (since it is neither reflexive nor transitive).
\end{example}

\begin{example}
The relation \textquotedblleft similar\textquotedblright\ on the set $\left\{
\text{triangles in the plane}\right\}  $ is an equivalence relation.
\end{example}

\begin{example}
The relation \textquotedblleft directly similar\textquotedblright\ (= similar
with the same orientation) on $\left\{  \text{triangles in the plane}\right\}
$ is an equivalence relation.

However, the relation \textquotedblleft indirectly similar\textquotedblright%
\ (= similar with opposite orientation) on $\left\{  \text{triangles in the
plane}\right\}  $ is not an equivalence relation, because it is not reflexive.
\end{example}

The following example is very general:

\begin{example}
\label{exa.12fold.eqrel.f-eq}Let $S$ and $T$ be two sets. Let $f:S\rightarrow
T$ be a map. Define a relation $\underset{f}{\equiv}$ on $S$ by%
\[
\left(  a\underset{f}{\equiv}b\right)  \Longleftrightarrow\left(  f\left(
a\right)  =f\left(  b\right)  \right)  .
\]
(As a subset of $S\times S$, this relation is the set of all pairs $\left(
a,b\right)  \in S\times S$ that satisfy $f\left(  a\right)  =f\left(
b\right)  $.) This relation $\underset{f}{\equiv}$ is an equivalence relation.
(For instance, its transitivity easily follows from the transitivity of
equality: If $f\left(  a\right)  =f\left(  b\right)  $ and $f\left(  b\right)
=f\left(  c\right)  $, then $f\left(  a\right)  =f\left(  c\right)  $.)
\end{example}

Here is an informal example:

\begin{example}
\label{exa.12fold.eqrel.land}Let $S$ be $\left\{  \text{all points on the
landmass of the Earth}\right\}  $. Define a relation $\sim$ on $S$ by%
\[
\left(  a\sim b\right)  \Longleftrightarrow\left(  \text{there is a land route
from }a\text{ to }b\right)  .
\]
Then, $\sim$ is an equivalence relation. (Its transitivity follows from the
fact that two routes with a common endpoint can be combined to form a
composite route.)
\end{example}

The following example is crucial in the construction of the rational number system:

\begin{example}
\label{exa.12fold.eqrel.QQ}Let
\[
S=\mathbb{Z}\times\left(  \mathbb{Z}\setminus\left\{  0\right\}  \right)
=\left\{  \left(  a_{1},a_{2}\right)  \in\mathbb{Z}^{2}\ \mid\ a_{1}%
\in\mathbb{Z}\text{ and }a_{2}\in\mathbb{Z}\setminus\left\{  0\right\}
\right\}  .
\]
This is the set of all pairs of integers such that the second entry of the
pair is nonzero.

Define a relation $\underset{\ast}{\sim}$ on $S$ by%
\[
\left(  \left(  a_{1},a_{2}\right)  \underset{\ast}{\sim}\left(  b_{1}%
,b_{2}\right)  \right)  \ \Longleftrightarrow\ \left(  a_{1}b_{2}=a_{2}%
b_{1}\right)  .
\]
This relation $\underset{\ast}{\sim}$ is an equivalence relation. (Let us
check its transitivity: If $\alpha,\beta,\gamma$ are three elements of $S$
satisfying $\alpha\underset{\ast}{\sim}\beta$ and $\beta\underset{\ast}{\sim
}\gamma$, then we can write $\alpha,\beta,\gamma$ in the form $\alpha=\left(
a_{1},a_{2}\right)  $ and $\beta=\left(  b_{1},b_{2}\right)  $ and
$\gamma=\left(  c_{1},c_{2}\right)  $. Thus, $\alpha\underset{\ast}{\sim}%
\beta$ rewrites as $\left(  a_{1},a_{2}\right)  \underset{\ast}{\sim}\left(
b_{1},b_{2}\right)  $, which means that $a_{1}b_{2}=a_{2}b_{1}$. Similarly,
from $\beta\underset{\ast}{\sim}\gamma$, we obtain $b_{1}c_{2}=c_{1}b_{2}$.
Using these two equalities, we obtain%
\[
\underbrace{a_{1}b_{2}}_{=a_{2}b_{1}}c_{2}=a_{2}\underbrace{b_{1}c_{2}%
}_{=c_{1}b_{2}}=a_{2}c_{1}b_{2}.
\]
We can cancel $b_{2}$ from this equality (since $\left(  b_{1},b_{2}\right)
\in S$ entails $b_{2}\neq0$) and thus obtain $a_{1}c_{2}=a_{2}c_{1}$. This
means that $\left(  a_{1},a_{2}\right)  \underset{\ast}{\sim}\left(
c_{1},c_{2}\right)  $. That is, $\alpha\underset{\ast}{\sim}\gamma$ (since
$\alpha=\left(  a_{1},a_{2}\right)  $ and $\gamma=\left(  c_{1},c_{2}\right)
$). This proves that the relation $\underset{\ast}{\sim}$ is transitive. The
proofs of its reflexivity and its symmetry are easier.)
\end{example}

\subsubsection{Equivalence classes}

Given an equivalence relation on a set $S$, we can define certain special
subsets of $S$ that are known as its \emph{equivalence classes}:

\begin{definition}
\label{def.12fold.eqcl.eqcl}Let $\sim$ be an equivalence relation on a set $S$.

\textbf{(a)} For each $a\in S$, we define a subset $\left[  a\right]  _{\sim}$
of $S$ by%
\[
\left[  a\right]  _{\sim}=\left\{  b\in S\ \mid\ b\sim a\right\}  .
\]
This subset $\left[  a\right]  _{\sim}$ is called the \emph{equivalence class
of }$a$ (for the relation $\sim$), or the $\sim$\emph{-equivalence class of
}$a$.

\textbf{(b)} The \emph{equivalence classes of }$\sim$ are defined to be the
sets $\left[  a\right]  _{\sim}$ for $a\in S$. They are also known as the
$\sim$\emph{-equivalence classes}.
\end{definition}

\begin{example}
Consider the relation $\underset{3}{\equiv}$ on $\mathbb{Z}$ (as defined in
Example \ref{exa.12fold.eqrel.exas1} \textbf{(e)}). We have%
\begin{align*}
\left[  5\right]  _{\underset{3}{\equiv}}  &  =\left\{  b\in\mathbb{Z}%
\ \mid\ b\underset{3}{\equiv}5\right\}  =\left\{  b\in\mathbb{Z}%
\ \mid\ b\equiv5\operatorname{mod}3\right\} \\
&  =\left\{  5+3k\ \mid\ k\in\mathbb{Z}\right\}  =\left\{  \ldots
,-4,-1,2,5,8,11,14,\ldots\right\}
\end{align*}
and%
\begin{align*}
\left[  3\right]  _{\underset{3}{\equiv}}  &  =\left\{  b\in\mathbb{Z}%
\ \mid\ b\underset{3}{\equiv}3\right\}  =\left\{  b\in\mathbb{Z}%
\ \mid\ b\equiv3\operatorname{mod}3\right\} \\
&  =\left\{  3+3k\ \mid\ k\in\mathbb{Z}\right\}  =\left\{  \ldots
,-6,-3,0,3,6,9,\ldots\right\}
\end{align*}
and%
\begin{align*}
\left[  2\right]  _{\underset{3}{\equiv}}  &  =\left\{  b\in\mathbb{Z}%
\ \mid\ b\underset{3}{\equiv}2\right\}  =\left\{  b\in\mathbb{Z}%
\ \mid\ b\equiv2\operatorname{mod}3\right\} \\
&  =\left\{  2+3k\ \mid\ k\in\mathbb{Z}\right\}  =\left\{  \ldots
,-4,-1,2,5,8,11,14,\ldots\right\}  .
\end{align*}
Note that $\left[  2\right]  _{\underset{3}{\equiv}}=\left[  5\right]
_{\underset{3}{\equiv}}$. This illustrates the general principle that
different elements of $S$ will often have the same $\sim$-equivalence class.
(See Proposition \ref{prop.12fold.eqcl.eqcl.3} for general criteria for this
to happen.)
\end{example}

\begin{example}
Let $n\in\mathbb{Z}$. Recall the relation $\underset{n}{\equiv}$ from Example
\ref{exa.12fold.eqrel.exas1} \textbf{(e)}. It is easy to see that its
equivalence classes are (the sets of entries of) arithmetic progressions with
difference $n$ (and integer entries).
\end{example}

Let us now state some basic general properties of equivalence classes. For
their proofs, see \cite[\S 3.3.2]{19s} or any sufficiently thorough
introduction to proofs.

\begin{proposition}
\label{prop.12fold.eqcl.eqcl.1}Let $\sim$ be an equivalence relation on a set
$S$. Let $a\in S$. Then,%
\[
\left[  a\right]  _{\sim}=\left\{  b\in S\ \mid\ a\sim b\right\}  .
\]

\end{proposition}

\begin{proposition}
\label{prop.12fold.eqcl.eqcl.2}Let $\sim$ be an equivalence relation on a set
$S$. Let $a\in S$. Then, $a\in\left[  a\right]  _{\sim}$.
\end{proposition}

\begin{proposition}
\label{prop.12fold.eqcl.eqcl.3}Let $\sim$ be an equivalence relation on a set
$S$. Let $x,y\in S$.

\textbf{(a)} If $x\sim y$, then $\left[  x\right]  _{\sim}=\left[  y\right]
_{\sim}$.

\textbf{(b)} If not $x\sim y$, then $\left[  x\right]  _{\sim}$ and $\left[
y\right]  _{\sim}$ are disjoint.

\textbf{(c)} We have $x\sim y$ if and only if $x\in\left[  y\right]  _{\sim}$.

\textbf{(d)} We have $x\sim y$ if and only if $y\in\left[  x\right]  _{\sim}$.

\textbf{(e)} We have $x\sim y$ if and only if $\left[  x\right]  _{\sim
}=\left[  y\right]  _{\sim}$.
\end{proposition}

As a consequence of Proposition \ref{prop.12fold.eqcl.eqcl.3} (specifically,
of its parts \textbf{(a)} and \textbf{(b)}), any two $\sim$-equivalence
classes are either identical or disjoint.

\begin{example}
Let%
\[
S=\mathbb{Z}\times\left(  \mathbb{Z}\setminus\left\{  0\right\}  \right)
=\left\{  \left(  a_{1},a_{2}\right)  \in\mathbb{Z}^{2}\ \mid\ a_{1}%
\in\mathbb{Z}\text{ and }a_{2}\in\mathbb{Z}\setminus\left\{  0\right\}
\right\}  .
\]
Consider the relation $\underset{\ast}{\sim}$ on the set $S$ defined by%
\[
\left(  \left(  a_{1},a_{2}\right)  \underset{\ast}{\sim}\left(  b_{1}%
,b_{2}\right)  \right)  \ \Longleftrightarrow\ \left(  a_{1}b_{2}=a_{2}%
b_{1}\right)  .
\]
As we know from Example \ref{exa.12fold.eqrel.QQ}, this relation
$\underset{\ast}{\sim}$ is an equivalence relation. Its equivalence classes
are the rational numbers! Indeed, this is how the rational numbers are
rigorously defined; the standard notation $\dfrac{a_{1}}{a_{2}}$ for a
rational number (obtained as a quotient of two integers $a_{1}$ and $a_{2}$)
is merely a shorthand for the equivalence class $\left[  \left(  a_{1}%
,a_{2}\right)  \right]  _{\underset{\ast}{\sim}}$ of the pair $\left(
a_{1},a_{2}\right)  $. (See, e.g., \cite[\S 17]{Warner71} or \cite[\S 6.6]%
{Loehr20} or \cite[\S B.2]{Newste19} or \cite[\S 6]{Yashin15} for the details
of this definition.)

So the relation $\underset{\ast}{\sim}$ in Example \ref{exa.12fold.eqrel.QQ}
is not a nameless relation among many, but a rather important one: It tells us
which pairs of integers give the same rational number (upon dividing the first
entry by the second).
\end{example}

\begin{example}
Let $S$ be the set $\left\{  \text{all points on the landmass of the
Earth}\right\}  $, and consider the relation $\sim$ on $S$ defined by%
\[
\left(  a\sim b\right)  \Longleftrightarrow\left(  \text{there is a land route
from }a\text{ to }b\right)  .
\]
As we have seen above, this relation $\sim$ is an equivalence relation. The
$\sim$-equivalence classes are the continents and islands (as long as we
consider Europe and Asia to be one single continent).
\end{example}

\begin{example}
\label{exa.12fold.eqrel.un-k-tup}Let $A$ be a set, and let $k\in\mathbb{N}$.
Consider the set $A^{k}$, which consists of all $k$-tuples of elements of $A$.
The relation $\underset{\operatorname{perm}}{\sim}$ on $A^{k}$ is defined as
follows:%
\begin{align*}
\left(  \mathbf{p}\underset{\operatorname{perm}}{\sim}\mathbf{q}\right)   &
\Longleftrightarrow\left(  \mathbf{p}\text{ is an anagram of }\mathbf{q}%
\right) \\
&  \Longleftrightarrow\left(  \mathbf{p}\text{ can be obtained from
}\mathbf{q}\text{ by permuting the entries}\right)  .
\end{align*}
For example, $\left(  3,8,8,2\right)  \underset{\operatorname{perm}}{\sim
}\left(  8,3,2,8\right)  $.

It is easy to see that the relation $\underset{\operatorname{perm}}{\sim}$ is
an equivalence relation. (See Exercise \ref{exe.12fold.eqrel.un-k-tup-eq}
below for the proof.)

The equivalence classes of $\underset{\operatorname{perm}}{\sim}$ are called
\emph{unordered }$k$\emph{-tuples} of elements of $A$. They are in bijection
with size-$k$ multisubsets of $A$: Namely, the equivalence class $\left[
\left(  a_{1},a_{2},\ldots,a_{k}\right)  \right]
_{\underset{\operatorname{perm}}{\sim}}$ of a $k$-tuple $\left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  \in A^{k}$ corresponds to the multisubset
$\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}$. This
fact is intuitively obvious (isn't a multisubset just a bunch of elements
without a specific ordering?); a formal proof will be given in the solution to
Exercise \ref{exe.12fold.eqrel.un-k-tup}.
\end{example}

\begin{example}
Let $n\in\mathbb{Z}$. The equivalence classes of the relation
$\underset{n}{\equiv}$ (which was defined in Example
\ref{exa.12fold.eqrel.exas1} \textbf{(e)}) are called \textquotedblleft%
\emph{integers modulo }$n$\textquotedblright\ (or, more precisely,
\textquotedblleft\emph{residue classes of integers modulo }$n$%
\textquotedblright). The set of these equivalence classes is denoted by
$\mathbb{Z}/n\mathbb{Z}$ or $\mathbb{Z}_{n}$ or $\mathbb{Z}/n$ or $Z_{n}$ or
$C_{n}$ (depending on author and context). In particular, the sets
$\mathbb{Z}/12\mathbb{Z}$ and $\mathbb{Z}/24\mathbb{Z}$ have well-known
meanings: they stand for the hours on a clock (a $12$-hour clock or a
$24$-hour clock, respectively). For example, when you say \textquotedblleft$3$
hours after $11$ is $2$\textquotedblright, you are really saying that
$11+3\equiv2\operatorname{mod}12$ or, equivalently, $\left[  11\right]
_{\underset{12}{\equiv}}+\left[  3\right]  _{\underset{12}{\equiv}}=\left[
2\right]  _{\underset{12}{\equiv}}$ for an appropriate definition of addition
of equivalence classes.
\end{example}

\begin{exercise}
\label{exe.12fold.eqrel.un-k-tup-eq}Let $A$ be a set, and let $k\in\mathbb{N}%
$. Prove that the relation $\underset{\operatorname{perm}}{\sim}$ (defined in
Example \ref{exa.12fold.eqrel.un-k-tup}) is an equivalence relation on the set
$A^{k}$.
\end{exercise}

\begin{exercise}
\label{exe.12fold.eqrel.un-k-tup}Let $A$ be a set, and let $k\in\mathbb{N}$.
Show that the unordered $k$-tuples of elements of $A$ (defined as in Example
\ref{exa.12fold.eqrel.un-k-tup}) are in bijection with the size-$k$
multisubsets of $A$. More precisely, show that the map%
\begin{align*}
\left\{  \text{unordered }k\text{-tuples of elements of }A\right\}   &
\rightarrow\left\{  \text{size-}k\text{ multisubsets of }A\right\}  ,\\
\left[  \left(  a_{1},a_{2},\ldots,a_{k}\right)  \right]
_{\underset{\operatorname{perm}}{\sim}}  &  \mapsto\left\{  a_{1},a_{2}%
,\ldots,a_{k}\right\}  _{\operatorname*{multi}}%
\end{align*}
is well-defined and bijective.
\end{exercise}

Next, we will define box-equivalence and ball-equivalence on placements of
balls into boxes. Then, by taking equivalence classes, we will be able to make
sense of \textquotedblleft unlabelled balls\textquotedblright\ and
\textquotedblleft unlabelled boxes\textquotedblright.

\begin{center}
\fbox{\textbf{Class of 2019-11-11}}
\end{center}

\subsubsection{Defining unlabelled boxes and balls}

What does it mean for balls, or boxes, to be unlabelled (in the twelvefold way)?

As we already mentioned, it means that we are counting \textbf{not} the maps
$f:A\rightarrow X$, \textbf{but rather} their equivalence classes with respect
to certain equivalence relations. Let us define these relations:

\begin{definition}
\label{def.12fold.boxeq}Let $f,g:A\rightarrow X$ be two maps (i.e., two
$L\rightarrow L$ placements). Then:

\begin{itemize}
\item We say that $f$ is \emph{box-equivalent} to $g$ (this is written
$f\overset{\operatorname*{box}}{\sim}g$) if and only if there exists a
permutation $\sigma$ of $X$ such that $f=\sigma\circ g$ (in other words, $f$
can be obtained from $g$ by permuting boxes).

\item We say that $f$ is \emph{ball-equivalent} to $g$ (this is written
$f\overset{\operatorname*{ball}}{\sim}g$) if and only if there exists a
permutation $\tau$ of $A$ such that $f=g\circ\tau$ (in other words, $f$ can be
obtained from $g$ by permuting balls).

\item We say that $f$ is \emph{box-ball-equivalent} to $g$ (this is written
$f\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}g$) if
and only if there exist a permutation $\sigma$ of $X$ and a permutation $\tau$
of $A$ such that $f=\sigma\circ g\circ\tau$.
\end{itemize}
\end{definition}

Thus, we have defined three relations $\overset{\operatorname*{box}}{\sim}$,
$\overset{\operatorname*{ball}}{\sim}$ and $\underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}$ on the set of all maps from $A$ to $X$.

\begin{example}
\label{exa.12fold.boxeq.1}Let $A=\left[  3\right]  $ and $X=\left[  2\right]
$.

\textbf{(a)} The two $L\rightarrow L$ placements%
\[
\fbox{$%
\ \ \numboxed{\phantom{(2)}(1)\phantom{(3)}}{1}\ \ \ \numboxed{\phantom{(1}(2)(3)\phantom{)}}{2}\ \ $}%
\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \fbox{$%
\ \ \numboxed{\phantom{(1}(2)(3)\phantom{)}}{1}\ \ \ \numboxed{\phantom{(2)}(1)\phantom{(3)}}{2}\ \ $}%
\]
are box-equivalent to one another (since they can be obtained from one another
by swapping the two boxes), but they are not ball-equivalent to one another
(since a permutation of balls cannot change the fact that the first placement
has $1$ ball in the first box, whereas the second placement has $2$).

\textbf{(b)} The two $L\rightarrow L$ placements%
\[
\fbox{$%
\ \ \numboxed{\phantom{(2)}(1)\phantom{(3)}}{1}\ \ \ \numboxed{\phantom{(1}(2)(3)\phantom{)}}{2}\ \ $}%
\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \fbox{$%
\ \ \numboxed{\phantom{(1)}(2)\phantom{(3)}}{1}\ \ \ \numboxed{\phantom{(2}(1)(3)\phantom{)}}{2}\ \ $}%
\]
are ball-equivalent to one another (since they can be obtained from one
another by swapping the balls $1$ and $2$), but they are not box-equivalent to
one another (since a permutation of boxes cannot change the fact that balls
$2$ and $3$ are together in a single box in the first placement, but not in
the second).

\textbf{(c)} The two $L\rightarrow L$ placements%
\[
\fbox{$%
\ \ \numboxed{\phantom{(1}(2)(3)\phantom{)}}{1}\ \ \ \numboxed{\phantom{(2)}(1)\phantom{(3)}}{2}\ \ $}%
\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \fbox{$%
\ \ \numboxed{\phantom{(1)}(2)\phantom{(3)}}{1}\ \ \ \numboxed{\phantom{(2}(1)(3)\phantom{)}}{2}\ \ $}%
\]
are box-ball-equivalent to one another (since they can be obtained from one
another by swapping the two boxes and swapping balls $1$ and $2$). But they
are neither box-equivalent nor ball-equivalent.

\textbf{(d)} The two $L\rightarrow L$ placements
\[
\fbox{$%
\ \ \numboxed{(1)(2)(3)}{1}\ \ \ \numboxed{\phantom{(1)(2)(3)}}{2}\ \ $}%
\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \fbox{$%
\ \ \numboxed{\phantom{(1}(2)(3)\phantom{)}}{1}\ \ \ \numboxed{\phantom{(2)}(1)\phantom{(3)}}{2}\ \ $}%
\]
are not box-ball-equivalent to one another (since no permutation of boxes or
of balls can change the fact that the first placement has an empty box, but
the second does not).
\end{example}

\begin{example}
\label{exa.12fold.boxeq.2}Here is a less trivial example of ball-equivalence:
Let $X=\left[  3\right]  $ and $A=\left[  9\right]  $, and consider the two
$L\rightarrow L$ placements%
\begin{align*}
f:=\fbox{$%
\ \ \numboxed{(2)(4)(5)(7)}{1}\ \ \ \numboxed{\phantom{((1}(3)(9)\phantom{2))}}{2}\ \ \ \numboxed{\phantom{((}(1)(6)(8)\phantom{))}}{3}\ \ $}
& \\
\text{and}\ \ \ \ \ \ \ \ \ \ g:=\fbox{$%
\ \ \numboxed{(1)(2)(3)(4)}{1}\ \ \ \numboxed{\phantom{((1}(5)(6)\phantom{2))}}{2}\ \ \ \numboxed{\phantom{((}(7)(8)(9)\phantom{))}}{3}\ \ $}
&  .
\end{align*}
(Thus, for instance, $f$ is the map from $A$ to $X$ that sends
$1,2,3,4,5,6,7,8,9$ to $3,1,2,1,1,3,1,3,2$, respectively.)

These two placements $f$ and $g$ are ball-equivalent. Indeed, $f$ can be
obtained from $g$ by permuting the balls so that the balls $1,2,3,4,5,6,7,8,9$
become $2,4,5,7,3,9,1,6,8$. (In more formal terms: We have $f=g\circ\tau$,
where $\tau$ is the permutation of $A$ that sends $1,2,3,4,5,6,7,8,9$ to
$2,4,5,7,3,9,1,6,8$, respectively.) Note that this permutation is far from
unique, since the order of the balls inside a box is not fixed.

The ball-equivalence of $f$ and $g$ can also be seen without explicitly
constructing the permutation. Indeed, it suffices to notice that each box has
equally many balls in $f$ as it has in $g$ (for instance, box $1$ has $4$
balls in each of $f$ and $g$); thus, any permutation $\tau$ of $A$ that

\begin{itemize}
\item sends the balls in box $1$ of $g$ to the balls in box $1$ of $f$;

\item sends the balls in box $2$ of $g$ to the balls in box $2$ of $f$;

\item sends the balls in box $3$ of $g$ to the balls in box $3$ of $f$
\end{itemize}

\noindent will have the property that $f=g\circ\tau$ and therefore will show
that $f$ and $g$ are ball-equivalent. The specific permutation $\tau$ that we
picked above is merely one of $4!\cdot2!\cdot3!=288$ many possible choices.
\end{example}

\begin{proposition}
\label{prop.12fold.boxeq.equiv}All three relations
$\overset{\operatorname*{box}}{\sim}$, $\overset{\operatorname*{ball}}{\sim}$
and $\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}$ are
equivalence relations on the set $\left\{  \text{maps }A\rightarrow X\right\}
$.
\end{proposition}

This proposition should be fairly intuitive at this point, and its proof is a
straightforward exercise in basic mathematical reasoning (specifically, the
concepts of bijectivity and relations):

\begin{exercise}
\label{exe.12fold.boxeq.equiv}Prove Proposition \ref{prop.12fold.boxeq.equiv}.
\end{exercise}

We can now rigorously define $U\rightarrow L$ placements, $L\rightarrow U$
placements and $U\rightarrow U$ placements:

\begin{definition}
\label{def.12fold.boxeq-classes}\ \ 

\begin{itemize}
\item We define the $U\rightarrow L$ \emph{placements} to be the
$\overset{\operatorname*{ball}}{\sim}$-equivalence classes.

\item We define the $L\rightarrow U$ \emph{placements} to be the
$\overset{\operatorname*{box}}{\sim}$-equivalence classes.

\item We define the $U\rightarrow U$ \emph{placements} to be the
$\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}%
$-equivalence classes.
\end{itemize}
\end{definition}

\begin{example}
As in Example \ref{exa.12fold.boxeq.1}, let $X=\left[  2\right]  $ and
$A=\left[  3\right]  $. Let $g$ be the $L\rightarrow L$ placement%
\[
\fbox{$%
\ \ \numboxed{\phantom{(2)}(1)\phantom{(3)}}{1}\ \ \ \numboxed{\phantom{(1}(2)(3)\phantom{)}}{2}\ \ $}%
.
\]


\textbf{(a)} The $\overset{\operatorname*{box}}{\sim}$-equivalence class of
$g$ is
\[
\left\{  \ \ \fbox{$%
\ \ \numboxed{\phantom{(2)}(1)\phantom{(3)}}{1}\ \ \ \numboxed{\phantom{(1}(2)(3)\phantom{)}}{2}\ \ $}%
\ \ ,\ \ \ \fbox{$%
\ \ \numboxed{\phantom{(1}(2)(3)\phantom{)}}{1}\ \ \ \numboxed{\phantom{(2)}(1)\phantom{(3)}}{2}\ \ $}%
\ \ \right\}  .
\]


\textbf{(b)} The $\overset{\operatorname*{ball}}{\sim}$-equivalence class of
$g$ is
\begin{align*}
&  \left\{  \ \ \fbox{$%
\ \ \numboxed{\phantom{(2)}(1)\phantom{(3)}}{1}\ \ \ \numboxed{\phantom{(1}(2)(3)\phantom{)}}{2}\ \ $}%
\ \ ,\ \ \ \fbox{$%
\ \ \numboxed{\phantom{(1)}(2)\phantom{(3)}}{1}\ \ \ \numboxed{\phantom{(2}(1)(3)\phantom{)}}{2}\ \ $}%
\ \ ,\right. \\
&  \ \ \ \ \ \ \ \ \ \ \left.  \ \ \fbox{$%
\ \ \numboxed{\phantom{(1)}(3)\phantom{(2)}}{1}\ \ \ \numboxed{\phantom{(3}(1)(2)\phantom{)}}{2}\ \ $}%
\ \ \right\}  .
\end{align*}


\textbf{(c)} The $\underset{\operatorname*{ball}}{\overset{\operatorname*{box}%
}{\sim}}$-equivalence class of $g$ is%
\begin{align*}
&  \left\{  \ \ \fbox{$%
\ \ \numboxed{\phantom{(3}(1)(2)\phantom{)}}{1}\ \ \ \numboxed{\phantom{(1)}(3)\phantom{(2)}}{2}\ \ $}%
\ \ ,\ \ \ \fbox{$%
\ \ \numboxed{\phantom{(2}(1)(3)\phantom{)}}{1}\ \ \ \numboxed{\phantom{(1)}(2)\phantom{(3)}}{2}\ \ $}%
\ \ ,\right. \\
& \\
&  \ \ \ \ \ \ \ \ \ \ \left.  \ \ \fbox{$%
\ \ \numboxed{\phantom{(1}(2)(3)\phantom{)}}{1}\ \ \ \numboxed{\phantom{(2)}(1)\phantom{(3)}}{2}\ \ $}%
\ \ ,\ \ \ \fbox{$%
\ \ \numboxed{\phantom{(1)}(3)\phantom{(2)}}{1}\ \ \ \numboxed{\phantom{(3}(1)(2)\phantom{)}}{2}\ \ $}%
\ \ ,\right. \\
&  \ \ \ \ \ \ \ \ \ \ \left.  \ \ \fbox{$%
\ \ \numboxed{\phantom{(1)}(2)\phantom{(3)}}{1}\ \ \ \numboxed{\phantom{(2}(1)(3)\phantom{)}}{2}\ \ $}%
\ \ ,\ \ \ \fbox{$%
\ \ \numboxed{\phantom{(2)}(1)\phantom{(3)}}{1}\ \ \ \numboxed{\phantom{(1}(2)(3)\phantom{)}}{2}\ \ $}%
\ \ \right\}  .
\end{align*}

\end{example}

Let us briefly explain why Definition \ref{def.12fold.boxeq-classes} matches
our intuitive understanding of $U\rightarrow L$ placements, $L\rightarrow U$
placements and $U\rightarrow U$ placements. Indeed:

\begin{itemize}
\item According to Definition \ref{def.12fold.boxeq-classes}, a $U\rightarrow
L$ placement is a $\overset{\operatorname*{ball}}{\sim}$-equivalence class --
i.e., a set that consists of all $L\rightarrow L$ placements that can be
obtained from a given $L\rightarrow L$ placement $f:A\rightarrow X$ by
permuting balls. Thus, roughly speaking, a $U\rightarrow L$ placement is an
$L\rightarrow L$ placement \textquotedblleft up to permutation of
balls\textquotedblright. In other words, it is a placement of unlabelled balls
in labelled boxes, in our intuitive sense.

\item Similarly, an $L\rightarrow U$ placement is a placement of labelled
balls in unlabelled boxes.

\item Similarly, a $U\rightarrow U$ placement is a placement of unlabelled
balls in unlabelled boxes.
\end{itemize}

Thus, we have put our notions of $U\rightarrow L$, $L\rightarrow U$ and
$U\rightarrow U$ placements on a rigorous footing. Let us now define what it
means for such a placement to be injective or surjective. This definition will
rely on the following two facts:

\begin{proposition}
\label{prop.12fold.boxeq.jectivities}Let $f,g:A\rightarrow X$ be two maps that
satisfy $f\overset{\operatorname*{box}}{\sim}g$ or
$f\overset{\operatorname*{ball}}{\sim}g$ or $f\underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}g$. Then:

\textbf{(a)} If $f$ is injective, then $g$ is injective.

\textbf{(b)} If $f$ is surjective, then $g$ is surjective.
\end{proposition}

\begin{corollary}
\label{cor.12fold.boxeq.jectivities}Let $C$ be a $U\rightarrow L$ placement or
an $L\rightarrow U$ placement or a $U\rightarrow U$ placement. (In other
words, let $C$ be a $\overset{\operatorname*{ball}}{\sim}$-equivalence class
or a $\overset{\operatorname*{box}}{\sim}$-equivalence class or a
$\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}%
$-equivalence class.) Then:

\textbf{(a)} If $C$ contains an injective map, then every map in $C$ is injective.

\textbf{(b)} If $C$ contains a surjective map, then every map in $C$ is surjective.
\end{corollary}

\begin{exercise}
\label{exe.12fold.boxeq.jectivities}Prove Proposition
\ref{prop.12fold.boxeq.jectivities} and Corollary
\ref{cor.12fold.boxeq.jectivities}.
\end{exercise}

\begin{definition}
\label{def.12fold.inj-surj}Let $C$ be a $U\rightarrow L$ placement or an
$L\rightarrow U$ placement or a $U\rightarrow U$ placement. (In other words,
let $C$ be a $\overset{\operatorname*{ball}}{\sim}$-equivalence class or a
$\overset{\operatorname*{box}}{\sim}$-equivalence class or a
$\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}%
$-equivalence class.) Then:

\textbf{(a)} We say that $C$ is \emph{injective} if $C$ contains an injective
map. (By Corollary \ref{cor.12fold.boxeq.jectivities} \textbf{(a)}, this
condition entails that every map in $C$ is injective.)

\textbf{(b)} We say that $C$ is \emph{surjective} if $C$ contains a surjective
map. (By Corollary \ref{cor.12fold.boxeq.jectivities} \textbf{(b)}, this
condition entails that every map in $C$ is surjective.)
\end{definition}

Visually speaking, a placement of (labelled or unlabelled) balls in (labelled
or unlabelled) boxes is

\begin{itemize}
\item \textbf{injective} if and only if each box contains \textbf{at most} one
ball (i.e., no two balls lie in the same box);

\item \textbf{surjective} if and only if each box contains \textbf{at least}
one ball.
\end{itemize}

\begin{example}
\label{exa.12fold.boxeq.jectivities1}\textbf{(a)} Let $A=\left[  4\right]  $
and $X=\left[  3\right]  $. Let $f$ be the $L\rightarrow L$ placement%
\[
\fbox{$%
\ \ \numboxed{\phantom{(1)}(2)(4)\phantom{(1)}}{1}\ \ \ \numboxed{\phantom{(1(2}(1)\phantom{2)2)}}{2}\ \ \numboxed{\phantom{(1(2}(3)\phantom{2)2)}}{3}\ \ $}%
\ \ .
\]
This $L\rightarrow L$ placement $f$ is surjective (i.e., each box contains at
least one ball). Thus, so are the $U\rightarrow L$ placement, the
$L\rightarrow U$ placement and the $U\rightarrow U$ placement obtained from it
(i.e., the equivalence classes $\left[  f\right]
_{\overset{\operatorname*{ball}}{\sim}}$, $\left[  f\right]
_{\overset{\operatorname*{box}}{\sim}}$ and $\left[  f\right]
_{\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}}$).
However, the $L\rightarrow L$ placement $f$ is not injective (since box $1$
contains two balls). Thus, neither are the $U\rightarrow L$ placement, the
$L\rightarrow U$ placement and the $U\rightarrow U$ placement obtained from it
(i.e., the equivalence classes $\left[  f\right]
_{\overset{\operatorname*{ball}}{\sim}}$, $\left[  f\right]
_{\overset{\operatorname*{box}}{\sim}}$ and $\left[  f\right]
_{\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}}$).

\textbf{(b)} Now, let $A=\left[  3\right]  $ and $X=\left[  4\right]  $
instead. Let $g$ be the $L\rightarrow L$ placement%
\[
\fbox{$%
\ \ \numboxed{\phantom{(1(2}(2)\phantom{2)2)}}{1}\ \ \ \numboxed{\phantom{(1(2}(3)\phantom{2)2)}}{2}\ \ \numboxed{\phantom{(1(2(3)2)2)}}{3}\ \ \numboxed{\phantom{(1(2}(1)\phantom{2)2)}}{4}\ \ $}%
\ \ .
\]
This $L\rightarrow L$ placement $g$ is injective (i.e., each box contains at
most one ball). Thus, so are the $U\rightarrow L$ placement, the $L\rightarrow
U$ placement and the $U\rightarrow U$ placement obtained from it (i.e., the
equivalence classes $\left[  g\right]  _{\overset{\operatorname*{ball}}{\sim}%
}$, $\left[  g\right]  _{\overset{\operatorname*{box}}{\sim}}$ and $\left[
g\right]  _{\underset{\operatorname*{ball}}{\overset{\operatorname*{box}%
}{\sim}}}$). However, the $L\rightarrow L$ placement $g$ is not surjective
(since box $3$ contains no balls). Thus, neither are the $U\rightarrow L$
placement, the $L\rightarrow U$ placement and the $U\rightarrow U$ placement
obtained from it (i.e., the equivalence classes $\left[  g\right]
_{\overset{\operatorname*{ball}}{\sim}}$, $\left[  g\right]
_{\overset{\operatorname*{box}}{\sim}}$ and $\left[  g\right]
_{\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}}$).

\textbf{(c)} Now, let $A=\left[  3\right]  $ and $X=\left[  3\right]  $. Let
$h$ be the $L\rightarrow L$ placement%
\[
\fbox{$%
\ \ \numboxed{\phantom{(1(2}(2)\phantom{2)2)}}{1}\ \ \ \numboxed{\phantom{(1(2}(3)\phantom{2)2)}}{2}\ \ \numboxed{\phantom{(1(2}(1)\phantom{2)2)}}{3}\ \ $}%
\ \ .
\]
This $L\rightarrow L$ placement $h$ is both injective and surjective (since
each box contains exactly one ball). Thus, so are the $U\rightarrow L$
placement, the $L\rightarrow U$ placement and the $U\rightarrow U$ placement
obtained from it (i.e., the equivalence classes $\left[  h\right]
_{\overset{\operatorname*{ball}}{\sim}}$, $\left[  h\right]
_{\overset{\operatorname*{box}}{\sim}}$ and $\left[  h\right]
_{\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}}$).

\textbf{(d)} Finally, let $A=\left[  3\right]  $ and $X=\left[  3\right]  $.
Let $d$ be the $L\rightarrow L$ placement%
\[
\fbox{$%
\ \ \numboxed{\phantom{(1)}(2)(3)\phantom{(1)}}{1}\ \ \ \numboxed{\phantom{(1(2}(1)\phantom{2)2)}}{2}\ \ \numboxed{\phantom{(1(2(3)2)2)}}{3}\ \ $}%
\ \ .
\]
This $L\rightarrow L$ placement $d$ is neither injective nor surjective. Thus,
the same holds for the $U\rightarrow L$ placement, the $L\rightarrow U$
placement and the $U\rightarrow U$ placement obtained from it (i.e., the
equivalence classes $\left[  d\right]  _{\overset{\operatorname*{ball}}{\sim}%
}$, $\left[  d\right]  _{\overset{\operatorname*{box}}{\sim}}$ and $\left[
d\right]  _{\underset{\operatorname*{ball}}{\overset{\operatorname*{box}%
}{\sim}}}$).
\end{example}

\begin{example}
In Example \ref{exa.12fold.boxeq.1} \textbf{(d)}, the second $L\rightarrow L$
placement is surjective (and so are the $U\rightarrow L$ placement, the
$L\rightarrow U$ placement and the $U\rightarrow U$ placement obtained from
it), but the first is not.
\end{example}

Finally, some words about counting. Recall the following crucial general fact
about equivalence classes (Proposition \ref{prop.12fold.eqcl.eqcl.3}
\textbf{(e)}):

\begin{proposition}
\label{prop.12fold.eqcl.eqcl.4}Let $\sim$ be an equivalence relation on a set
$S$. Let $x\in S$ and $y\in S$. Then, $x\sim y$ if and only if the $\sim
$-equivalence classes of $x$ and $y$ are identical (that is, $\left[
x\right]  _{\sim}=\left[  y\right]  _{\sim}$).
\end{proposition}

Thus, \textquotedblleft counting elements of $S$ up to
equivalence\textquotedblright\ means counting $\sim$-equivalence classes. For
instance, \textquotedblleft counting maps from $A$ to $X$ up to
$\overset{\operatorname*{ball}}{\sim}$-equivalence\textquotedblright\ means
counting $\overset{\operatorname*{ball}}{\sim}$-equivalence classes (aka
$U\rightarrow L$ placements).

\subsection{$U\rightarrow L$}

Recall that the $U\rightarrow L$ placements are the
$\overset{\operatorname*{ball}}{\sim}$-equivalence classes. We shall now count them.

\begin{example}
\label{exa.12fold.UL.exa1}For $X=\left[  2\right]  $ and $A=\left[  3\right]
$, there are $4$ different $U\rightarrow L$ placements:%
\begin{align*}
&  \left\{  \ \ \fbox{$%
\ \ \numboxed{(1)(2)(3)}{1}\ \ \ \numboxed{\phantom{(1)(2)(3)}}{2}\ \ $}%
\ \ \right\}  ,\\
& \\
&  \left\{  \ \ \fbox{$%
\ \ \numboxed{\phantom{(3}(1)(2)\phantom{)}}{1}\ \ \ \numboxed{\phantom{(1)}(3)\phantom{(2)}}{2}\ \ $}%
\ \ ,\ \ \ \fbox{$%
\ \ \numboxed{\phantom{(2}(1)(3)\phantom{)}}{1}\ \ \ \numboxed{\phantom{(1)}(2)\phantom{(3)}}{2}\ \ $}%
\ \ ,\right. \\
&  \ \ \ \ \ \ \ \ \ \ \left.  \ \ \fbox{$%
\ \ \numboxed{\phantom{(1}(2)(3)\phantom{)}}{1}\ \ \ \numboxed{\phantom{(2)}(1)\phantom{(3)}}{2}\ \ $}%
\ \ \right\}  ,\\
& \\
&  \left\{  \ \ \fbox{$%
\ \ \numboxed{\phantom{(2)}(1)\phantom{(3)}}{1}\ \ \ \numboxed{\phantom{(1}(2)(3)\phantom{)}}{2}\ \ $}%
\ \ ,\ \ \ \fbox{$%
\ \ \numboxed{\phantom{(1)}(2)\phantom{(3)}}{1}\ \ \ \numboxed{\phantom{(2}(1)(3)\phantom{)}}{2}\ \ $}%
\ \ ,\right. \\
&  \ \ \ \ \ \ \ \ \ \ \left.  \ \ \fbox{$%
\ \ \numboxed{\phantom{(1)}(3)\phantom{(2)}}{1}\ \ \ \numboxed{\phantom{(3}(1)(2)\phantom{)}}{2}\ \ $}%
\ \ \right\}  ,\\
& \\
&  \left\{  \ \ \fbox{$%
\ \ \numboxed{\phantom{(1)(2)(3)}}{1}\ \ \ \numboxed{(1)(2)(3)}{2}\ \ $}%
\ \ \right\}  .
\end{align*}

\end{example}

\begin{convention}
\label{conv.12fold.UL.balls=circles}When visualizing a $U\rightarrow L$
placement, we will just draw the balls as circles, without putting any numbers
in them (since the balls are meant to be unlabelled, i.e., their precise
identities do not matter). So the four $U\rightarrow L$ placements for
$X=\left[  2\right]  $ and $A=\left[  3\right]  $ are (shown here in the same
order as in Example \ref{exa.12fold.UL.exa1})%
\begin{align*}
&  \fbox{$%
\ \ \numboxed{\phantom{((}\bullet\bullet\bullet\phantom{))}}{1}\ \ \ \numboxed{\phantom{(1) \bullet (2)}}{2}\ \ $}%
\ \ ,\ \ \ \ \ \ \ \ \ \ \fbox{$%
\ \ \numboxed{\phantom{(\bullet}\bullet\bullet\phantom{\bullet)}}{1}\ \ \ \numboxed{\phantom{(1)}\bullet\phantom{(2)}}{2}\ \ $}%
\ \ ,\\
& \\
&  \fbox{$%
\ \ \numboxed{\phantom{(1)}\bullet\phantom{(2)}}{1}\ \ \ \numboxed{\phantom{(\bullet}\bullet\bullet\phantom{\bullet)}}{2}\ \ $}%
\ \ ,\ \ \ \ \ \ \ \ \ \ \fbox{$%
\ \ \numboxed{\phantom{(1) \bullet (2)}}{1}\ \ \ \numboxed{\phantom{((}\bullet\bullet\bullet\phantom{))}}{2}\ \ $}%
\ \ .
\end{align*}

\end{convention}

Now, we are ready to count the $U\rightarrow L$ placements in the general case:

\begin{center}
\fbox{\textbf{Unpolished stuff starts here}}
\end{center}

\begin{proposition}
\label{prop.12fold.UtoL.all}We have%
\begin{align*}
&  \left(  \text{\# of }U\rightarrow L\text{ placements }A\rightarrow X\right)
\\
&  =\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{\left\vert X\right\vert
}\right)  \in\mathbb{N}^{\left\vert X\right\vert }\text{ satisfying }%
x_{1}+x_{2}+\cdots+x_{\left\vert X\right\vert }=\left\vert A\right\vert
\right) \\
&  =\dbinom{\left\vert A\right\vert +\left\vert X\right\vert -1}{\left\vert
A\right\vert }.
\end{align*}

\end{proposition}

\begin{proof}
The second equality sign follows from (\ref{eq.thm.binom.wecompos.count.r1}).

It remains to prove the first equality sign. First, we WLOG assume that
$X=\left[  \left\vert X\right\vert \right]  $ (so the boxes are labelled
$1,2,\ldots,\left\vert X\right\vert $). Then, consider the bijection%
\[
\left\{  U\rightarrow L\text{ placements }A\rightarrow X\right\}
\rightarrow\left\{  \left(  x_{1},x_{2},\ldots,x_{\left\vert X\right\vert
}\right)  \in\mathbb{N}^{\left\vert X\right\vert }\text{ }\mid\text{ }%
x_{1}+x_{2}+\cdots+x_{\left\vert X\right\vert }=\left\vert A\right\vert
\right\}
\]
that sends each $U\rightarrow L$ placement
$\fbox{\ \ \boxed{a_1 \text{ balls}}\ \ \ \boxed{a_2 \text{ balls}}\ \ \ $%
\cdots$\ \ \ \boxed{a_{\left|X\right|} \text{ balls}}\ \ }$ to the $\left\vert
X\right\vert $-tuple $\left(  a_{1},a_{2},\ldots,a_{\left\vert X\right\vert
}\right)  $. (More rigorously: The $\overset{\operatorname*{ball}}{\sim}%
$-equivalence class of a map $f:A\rightarrow X$ is sent to the $\left\vert
X\right\vert $-tuple%
\[
\left(  \left\vert f^{-1}\left(  1\right)  \right\vert ,\left\vert
f^{-1}\left(  2\right)  \right\vert ,\ldots,\left\vert f^{-1}\left(
\left\vert X\right\vert \right)  \right\vert \right)  ,
\]
where%
\[
f^{-1}\left(  x\right)  :=\left\{  a\in A\ \mid\ f\left(  a\right)
=x\right\}  .
\]
To see that this is a bijection, we need to show that if $f,g:A\rightarrow X$
are two maps such that%
\[
\left\vert f^{-1}\left(  x\right)  \right\vert =\left\vert g^{-1}\left(
x\right)  \right\vert \ \ \ \ \ \ \ \ \ \ \text{for all }x\in X,
\]
then $f\overset{\operatorname*{ball}}{\sim}g$.)

Thus, the bijection principle yields%
\begin{align*}
&  \left(  \text{\# of }U\rightarrow L\text{ placements }A\rightarrow X\right)
\\
&  =\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{\left\vert X\right\vert
}\right)  \in\mathbb{N}^{\left\vert X\right\vert }\text{ satisfying }%
x_{1}+x_{2}+\cdots+x_{\left\vert X\right\vert }=\left\vert A\right\vert
\right)  .
\end{align*}
This is exactly the first equality sign of Proposition
\ref{prop.12fold.UtoL.all}.
\end{proof}

Recall: An $L\rightarrow L$ placement is surjective if and only if each box
has at least one ball in it.

We define surjectivity of $U\rightarrow L$ placements in the same way. Thus, a
$\overset{\operatorname*{ball}}{\sim}$-equivalence class is a surjective
$U\rightarrow L$ placement if and only if all its elements are surjective maps.

\begin{proposition}
\label{prop.12fold.UtoL.sur}We have%
\begin{align*}
&  \left(  \text{\# of surjective }U\rightarrow L\text{ placements
}A\rightarrow X\right) \\
&  =\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{\left\vert X\right\vert
}\right)  \in\mathbb{P}^{\left\vert X\right\vert }\text{ satisfying }%
x_{1}+x_{2}+\cdots+x_{\left\vert X\right\vert }=\left\vert A\right\vert
\right) \\
&  =\dbinom{\left\vert A\right\vert -1}{\left\vert A\right\vert -\left\vert
X\right\vert }.
\end{align*}

\end{proposition}

\begin{proof}
The first equality sign is proved similarly to the first equality sign in
Proposition \ref{prop.12fold.UtoL.all}.

The second equality sign follows from (\ref{eq.thm.binom.compos.count.r1}).
\end{proof}

Recall: An $L\rightarrow L$ placement is injective if and only if each box has
at most one ball in it.

We define injectivity of $U\rightarrow L$ placements in the same way. Thus, a
$\overset{\operatorname*{ball}}{\sim}$-equivalence class is an injective
$U\rightarrow L$ placement if and only if all its elements are injective maps.

\begin{proposition}
\label{prop.12fold.UtoL.inj}We have%
\begin{align*}
&  \left(  \text{\# of injective }U\rightarrow L\text{ placements
}A\rightarrow X\right) \\
&  =\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{\left\vert X\right\vert
}\right)  \in\left\{  0,1\right\}  ^{\left\vert X\right\vert }\text{
satisfying }x_{1}+x_{2}+\cdots+x_{\left\vert X\right\vert }=\left\vert
A\right\vert \right) \\
&  =\dbinom{\left\vert X\right\vert }{\left\vert A\right\vert }.
\end{align*}

\end{proposition}

\begin{proof}
The first equality sign is proved similarly to the first equality sign in
Proposition \ref{prop.12fold.UtoL.all}.

The second equality sign follows from Theorem \ref{thm.binom.bicompos.count}.
\end{proof}

Thus, our \textquotedblleft twelvefold way\textquotedblright\ table now looks
as follows:%
\[%
\begin{tabular}
[c]{|c||c|c|c|}\hline
& arbitrary & injective & surjective\\\hline
$L\rightarrow L$ & $\left\vert X\right\vert ^{\left\vert A\right\vert }$ &
$\left\vert X\right\vert ^{\underline{\left\vert A\right\vert }}$ &
$\operatorname*{sur}\left(  \left\vert X\right\vert ,\left\vert A\right\vert
\right)  $\\\hline
$U\rightarrow L$ & $\dbinom{\left\vert A\right\vert +\left\vert X\right\vert
-1}{\left\vert A\right\vert }$ & $\dbinom{\left\vert X\right\vert }{\left\vert
A\right\vert }$ & $\dbinom{\left\vert A\right\vert -1}{\left\vert A\right\vert
-\left\vert X\right\vert }$\\\hline
$L\rightarrow U$ &  &  & \\\hline
$U\rightarrow U$ &  &  & \\\hline
\end{tabular}
\ \ \ \ .
\]


\subsection{$L\rightarrow U$}

Recall: The $L\rightarrow U$ placements are the $\overset{\operatorname*{box}%
}{\sim}$-equivalence classes. They are placements of labelled balls in
unlabelled boxes.

\begin{example}
For $X=\left[  2\right]  $ and $A=\left[  3\right]  $, there are $4$ different
$L\rightarrow U$ placements:%
\begin{align*}
&  \left\{  \ \ \fbox{$%
\ \ \numboxed{(1)(2)(3)}{1}\ \ \ \numboxed{\phantom{(1)(2)(3)}}{2}\ \ $}%
\ \ ,\ \ \ \fbox{$%
\ \ \numboxed{\phantom{(1)(2)(3)}}{1}\ \ \ \numboxed{(1)(2)(3)}{2}\ \ $}%
\ \ \right\}  ,\\
& \\
&  \left\{  \ \ \fbox{$%
\ \ \numboxed{\phantom{(3}(1)(2)\phantom{)}}{1}\ \ \ \numboxed{\phantom{(1)}(3)\phantom{(2)}}{2}\ \ $}%
\ \ ,\ \ \ \fbox{$%
\ \ \numboxed{\phantom{(1)}(3)\phantom{(2)}}{1}\ \ \ \numboxed{\phantom{(3}(1)(2)\phantom{)}}{2}\ \ $}%
\ \ \right\}  ,\\
& \\
&  \left\{  \ \ \fbox{$%
\ \ \numboxed{\phantom{(2}(1)(3)\phantom{)}}{1}\ \ \ \numboxed{\phantom{(1)}(2)\phantom{(3)}}{2}\ \ $}%
\ \ ,\ \ \ \fbox{$%
\ \ \numboxed{\phantom{(1)}(2)\phantom{(3)}}{1}\ \ \ \numboxed{\phantom{(2}(1)(3)\phantom{)}}{2}\ \ $}%
\ \ \right\}  ,\\
& \\
&  \left\{  \ \ \fbox{$%
\ \ \numboxed{\phantom{(1}(2)(3)\phantom{)}}{1}\ \ \ \numboxed{\phantom{(2)}(1)\phantom{(3)}}{2}\ \ $}%
\ \ ,\ \ \ \fbox{$%
\ \ \numboxed{\phantom{(2)}(1)\phantom{(3)}}{1}\ \ \ \numboxed{\phantom{(1}(2)(3)\phantom{)}}{2}\ \ $}%
\ \ \right\}  .
\end{align*}

\end{example}

\begin{proposition}
\label{prop.12fold.LtoU.inj}We have%
\[
\left(  \text{\# of injective }L\rightarrow U\text{ placements }A\rightarrow
X\right)  =\left[  \left\vert A\right\vert \leq\left\vert X\right\vert
\right]  .
\]

\end{proposition}

\begin{proof}
If $\left\vert A\right\vert >\left\vert X\right\vert $, then the Pigeonhole
Principle shows that no such placements exist, and thus $\left(  \text{\# of
injective }L\rightarrow U\text{ placements}\right)  =0$.

Now assume that $\left\vert A\right\vert \leq\left\vert X\right\vert $. WLOG
assume that $X=\left[  \left\vert X\right\vert \right]  $, so that the boxes
are labelled $1,2,\ldots,\left\vert X\right\vert $. Thus, injective
$L\rightarrow U$ placements do exist: for example, we can place each ball $i$
into box $i$ (thus leaving the last $\left\vert X\right\vert -\left\vert
A\right\vert $ many boxes empty). Furthermore, any two injective $L\rightarrow
U$ placements are identical. (Indeed, any such placement consists of one box
with ball $1$, one box with ball $2$, one box with ball $3$, and so on,
totalling to $\left\vert A\right\vert $ many boxes filled with $1$ ball each,
and furthermore $\left\vert X\right\vert -\left\vert A\right\vert $ many empty
boxes. It is clear that this uniquely describes it as an $L\rightarrow U$
placement, because any two $L\rightarrow L$ placements of this form can be
turned into one another by a permutation of the boxes. For example,%
\begin{align*}
&  \fbox{$%
\ \ \numboxed{\phantom{(1)(2)(3)}}{1}\ \ \ \numboxed{\phantom{(1)}(2)\phantom{(3)}}{2}\ \ \ \numboxed{\phantom{(1)}(1)\phantom{(3)}}{3}\ \ \ \numboxed{\phantom{(1)(2)(3)}}{4}\ \ \ \numboxed{\phantom{(1)}(3)\phantom{(3)}}{5}\ \ $}%
\\
\overset{\operatorname*{box}}{\sim}\ \ \  &  \fbox{$%
\ \ \numboxed{\phantom{(1)}(1)\phantom{(3)}}{1}\ \ \ \numboxed{\phantom{(1)}(2)\phantom{(3)}}{2}\ \ \ \numboxed{\phantom{(1)}(3)\phantom{(3)}}{3}\ \ \ \numboxed{\phantom{(1)(2)(3)}}{4}\ \ \ \numboxed{\phantom{(1)(2)(3)}}{5}\ \ $}%
\ \ \ .
\end{align*}
Thus, any two injective $L\rightarrow U$ placements are identical.) Hence, the
total \# of injective $L\rightarrow U$ placements is $1$. But this is
precisely $\left[  \left\vert A\right\vert \leq\left\vert X\right\vert
\right]  $, since $\left\vert A\right\vert \leq\left\vert X\right\vert $.
\end{proof}

\textbf{Recall:} If $n\in\mathbb{N}$ and $k\in\mathbb{N}$, then $%
%TCIMACRO{\QDATOPD{\{}{\}}{n}{k}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{n}{k}%
%EndExpansion
:=\operatorname*{sur}\left(  n,k\right)  /k!$ is called a \textbf{Stirling
number of the second kind}.

\begin{proposition}
\label{prop.12fold.LtoU.sur}We have%
\[
\left(  \text{\# of surjective }L\rightarrow U\text{ placements }A\rightarrow
X\right)  =%
%TCIMACRO{\QDATOPD{\{}{\}}{\left\vert A\right\vert }{\left\vert X\right\vert
%}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{\left\vert A\right\vert }{\left\vert X\right\vert }%
%EndExpansion
=\dfrac{\operatorname*{sur}\left(  \left\vert A\right\vert ,\left\vert
X\right\vert \right)  }{\left\vert X\right\vert !}.
\]

\end{proposition}

\begin{proof}
The crux of the proof is the following claim:

\begin{statement}
\textit{Claim 1:} Each $\overset{\operatorname*{box}}{\sim}$-equivalence class
of surjective maps (i.e., each surjective $L\rightarrow U$ placement) contains
exactly $\left\vert X\right\vert !$ many maps $A\rightarrow X$.
\end{statement}

[\textit{Proof of Claim 1:} Consider the $\overset{\operatorname*{box}}{\sim}%
$-equivalence class of some surjective map $g:A\rightarrow X$. The elements of
this class are all the maps of the form $\sigma\circ g$ with $\sigma$ a
permutation of $X$. There are $\left\vert X\right\vert !$ many permutations of
$X$, and they all lead to \textbf{distinct} maps $\sigma\circ g$ (because if
you know $\sigma\circ g$ and you have an $x\in X$, then you can tell what
$\sigma\left(  x\right)  $ is by looking at a ball placed in box $x$ by $g$,
and checking which box contains this ball in $\sigma\circ g$). Thus, there are
exactly $\left\vert X\right\vert !$ many distinct maps $\sigma\circ g$ in the
class of $g$. This proves Claim 1.]

Now, Proposition \ref{prop.binom.maps-surj} yields%
\begin{align*}
&  \operatorname*{sur}\left(  \left\vert A\right\vert ,\left\vert X\right\vert
\right) \\
&  =\left(  \text{\# of surjections }A\rightarrow X\right) \\
&  =\sum_{\substack{C\text{ is a }\overset{\operatorname*{box}}{\sim
}\text{-equivalence}\\\text{class of surjections}}}\underbrace{\left\vert
C\right\vert }_{\substack{=\left\vert X\right\vert !\\\text{(by Claim 1)}%
}}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have split the sum}\\
\text{according to the }\overset{\operatorname*{box}}{\sim}\text{-equivalence
class}%
\end{array}
\right) \\
&  =\sum_{\substack{C\text{ is a }\overset{\operatorname*{box}}{\sim
}\text{-equivalence}\\\text{class of surjections}}}\left\vert X\right\vert
!=\left(  \text{\# of }\overset{\operatorname*{box}}{\sim}\text{-equivalence
classes of surjections}\right)  \cdot\left\vert X\right\vert !.
\end{align*}
Thus, dividing by $\left\vert X\right\vert !$, we obtain%
\begin{align*}
&  \left(  \text{\# of }\overset{\operatorname*{box}}{\sim}\text{-equivalence
classes of surjections}\right) \\
&  =\operatorname*{sur}\left(  \left\vert A\right\vert ,\left\vert
X\right\vert \right)  /\left\vert X\right\vert !=%
%TCIMACRO{\QDATOPD{\{}{\}}{\left\vert A\right\vert }{\left\vert X\right\vert
%}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{\left\vert A\right\vert }{\left\vert X\right\vert }%
%EndExpansion
\end{align*}
(since $%
%TCIMACRO{\QDATOPD{\{}{\}}{\left\vert A\right\vert }{\left\vert X\right\vert
%}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{\left\vert A\right\vert }{\left\vert X\right\vert }%
%EndExpansion
$ was defined to be $\operatorname*{sur}\left(  \left\vert A\right\vert
,\left\vert X\right\vert \right)  /\left\vert X\right\vert !$). This proves
Proposition \ref{prop.12fold.LtoU.sur} (since the
$\overset{\operatorname*{box}}{\sim}$-equivalence classes of surjections are
precisely the surjective $L\rightarrow U$ placements $A\rightarrow X$).
\end{proof}

\begin{center}
\fbox{\textbf{Class of 2019-11-13}}
\end{center}

\begin{proposition}
\label{prop.12fold.LtoU.all}We have%
\[
\left(  \text{\# of }L\rightarrow U\text{ placements }A\rightarrow X\right)  =%
%TCIMACRO{\QDATOPD{\{}{\}}{\left\vert A\right\vert }{0}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{\left\vert A\right\vert }{0}%
%EndExpansion
+%
%TCIMACRO{\QDATOPD{\{}{\}}{\left\vert A\right\vert }{1}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{\left\vert A\right\vert }{1}%
%EndExpansion
+\cdots+%
%TCIMACRO{\QDATOPD{\{}{\}}{\left\vert A\right\vert }{\left\vert X\right\vert
%}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{\left\vert A\right\vert }{\left\vert X\right\vert }%
%EndExpansion
.
\]

\end{proposition}

\begin{proof}
We can prove a better claim: For each $k\in\left\{  0,1,\ldots,\left\vert
X\right\vert \right\}  $, we have%
\[
\left(  \text{\# of }L\rightarrow U\text{ placements with exactly }k\text{
nonempty boxes}\right)  =%
%TCIMACRO{\QDATOPD{\{}{\}}{\left\vert A\right\vert }{k}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{\left\vert A\right\vert }{k}%
%EndExpansion
.
\]
(This is not hard to see, because in an $L\rightarrow U$ placement, we can
WLOG assume that all empty boxes are at the end, and thus we can simply ignore
the empty boxes.)

Adding these equalities up for all $k\in\left\{  0,1,\ldots,\left\vert
X\right\vert \right\}  $, we obtain precisely the claim of Proposition
\ref{prop.12fold.LtoU.all}. (Details LTTR.)
\end{proof}

Thus, our table now looks as follows:%
\[%
\begin{tabular}
[c]{|c||c|c|c|}\hline
& arbitrary & injective & surjective\\\hline
$L\rightarrow L$ & $\left\vert X\right\vert ^{\left\vert A\right\vert }$ &
$\left\vert X\right\vert ^{\underline{\left\vert A\right\vert }}$ &
$\operatorname*{sur}\left(  \left\vert X\right\vert ,\left\vert A\right\vert
\right)  $\\\hline
$U\rightarrow L$ & $\dbinom{\left\vert A\right\vert +\left\vert X\right\vert
-1}{\left\vert A\right\vert }$ & $\dbinom{\left\vert X\right\vert }{\left\vert
A\right\vert }$ & $\dbinom{\left\vert A\right\vert -1}{\left\vert A\right\vert
-\left\vert X\right\vert }$\\\hline
$L\rightarrow U$ & $%
%TCIMACRO{\QDATOPD{\{}{\}}{\left\vert A\right\vert }{0}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{\left\vert A\right\vert }{0}%
%EndExpansion
+%
%TCIMACRO{\QDATOPD{\{}{\}}{\left\vert A\right\vert }{1}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{\left\vert A\right\vert }{1}%
%EndExpansion
+\cdots+%
%TCIMACRO{\QDATOPD{\{}{\}}{\left\vert A\right\vert }{\left\vert X\right\vert
%}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{\left\vert A\right\vert }{\left\vert X\right\vert }%
%EndExpansion
$ & $\left[  \left\vert A\right\vert \leq\left\vert X\right\vert \right]  $ &
$%
%TCIMACRO{\QDATOPD{\{}{\}}{\left\vert A\right\vert }{\left\vert X\right\vert
%}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{\left\vert A\right\vert }{\left\vert X\right\vert }%
%EndExpansion
$\\\hline
$U\rightarrow U$ &  &  & \\\hline
\end{tabular}
\ \ \ .
\]


Let us say a few words about an equivalent version of surjective $L\rightarrow
U$ placements: the set partitions.

\begin{definition}
Let $S$ be a set.

\textbf{(a)} A \textbf{set partition} of $S$ is a set $\mathcal{F}$ of
disjoint nonempty subsets of $S$ such that the union of these subsets is $S$.

In other words, a set partition of $S$ is a set $\left\{  S_{1},S_{2}%
,\ldots,S_{k}\right\}  $ of nonempty subsets of $S$ such that each element of
$S$ lies in exactly one $S_{i}$. (Here, we are assuming that $S$ is finite.)

\textbf{(b)} If $\mathcal{F}$ is a set partition of $S$, then the elements of
$\mathcal{F}$ are called the \textbf{parts} (or \textbf{blocks}) of
$\mathcal{F}$. Keep in mind that they are subsets of $S$.

\textbf{(c)} If a set partition $\mathcal{F}$ of $S$ has $k$ parts, then we
say that $\mathcal{F}$ is a \textbf{set partition of }$S$ \textbf{into }%
$k$\textbf{ parts}.
\end{definition}

\begin{example}
Here are all set partitions of the set $\left[  3\right]  =\left\{
1,2,3\right\}  $:
\begin{align*}
&  \left\{  \left\{  1,2,3\right\}  \right\}  ,\ \ \ \ \ \ \ \ \ \ \left\{
\left\{  1,2\right\}  ,\left\{  3\right\}  \right\}
,\ \ \ \ \ \ \ \ \ \ \left\{  \left\{  1,3\right\}  ,\left\{  2\right\}
\right\}  ,\ \ \ \ \ \ \ \ \ \ \left\{  \left\{  2,3\right\}  ,\left\{
1\right\}  \right\}  ,\\
&  \left\{  \left\{  1\right\}  ,\left\{  2\right\}  ,\left\{  3\right\}
\right\}  .
\end{align*}
And here are the same set partitions, drawn as pictures (each part of the set
partition corresponds to a blob):%
\[%
\begin{array}
[c]{c|c|c|c|c}%
\begin{tikzpicture} \draw (0.7, 0.5) ellipse (1.3 and 1.3); \tikzstyle{every node} = [circle] \node (a) at (0, 0) {1}; \node (b) at +(0: 1.5) {2}; \node (c) at +(60: 1.5) {3}; \end{tikzpicture} &
\begin{tikzpicture} \draw (0.75, 0) ellipse (1.4 and .5); \draw (0.8, 1.3) ellipse (0.5 and 0.5); \tikzstyle{every node} = [circle] \node (a) at (0, 0) {1}; \node (b) at +(0: 1.5) {2}; \node (c) at +(60: 1.5) {3}; \end{tikzpicture} &
\begin{tikzpicture} \draw[rotate=-30] (0, 0.6) ellipse (.5 and 1.4); \draw (1.5, 0) ellipse (0.5 and 0.5); \tikzstyle{every node} = [circle] \node (a) at (0, 0) {1}; \node (b) at +(0: 1.5) {2}; \node (c) at +(60: 1.5) {3}; \end{tikzpicture} &
\begin{tikzpicture} \draw[rotate=30] (1.3, -0.1) ellipse (.5 and 1.4); \draw (0, 0) ellipse (0.5 and 0.5); \tikzstyle{every node} = [circle] \node (a) at (0, 0) {1}; \node (b) at +(0: 1.5) {2}; \node (c) at +(60: 1.5) {3}; \end{tikzpicture} &
\begin{tikzpicture} \draw (0, 0) ellipse (0.5 and 0.5); \draw (1.5, 0) ellipse (0.5 and 0.5); \draw (0.75, 1.3) ellipse (0.5 and 0.5); \tikzstyle{every node} = [circle] \node (a) at (0, 0) {1}; \node (b) at +(0: 1.5) {2}; \node (c) at +(60: 1.5) {3}; \end{tikzpicture}
\end{array}
\]

\end{example}

\begin{proposition}
Let $A$ be an $n$-element set. Let $k\in\mathbb{N}$. Then,
\[
\left(  \text{\# of set partitions of }A\text{ into }k\text{ parts}\right)  =%
%TCIMACRO{\QDATOPD{\{}{\}}{n}{k}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{n}{k}%
%EndExpansion
.
\]

\end{proposition}

\begin{proof}
Let $X=\left[  k\right]  $. Then, there is a bijection%
\begin{align*}
\left\{  \text{set partitions of }A\text{ into }k\text{ parts}\right\}   &
\rightarrow\left\{  \text{surjective }L\rightarrow U\text{ placements
}A\rightarrow X\right\}  ,\\
\left\{  S_{1},S_{2},\ldots,S_{k}\right\}   &  \mapsto\left(  \text{all
elements in }S_{i}\text{ go into box }i\right)  .
\end{align*}
(This is well-defined, because the resulting $L\rightarrow U$ placement does
not depend on the order in which we have listed the blocks of our set
partition; any two orders lead to $\overset{\operatorname*{box}}{\sim}%
$-equivalent maps.) Now, it remains to recall the bijection principle and
apply Proposition \ref{prop.12fold.LtoU.sur}.
\end{proof}

Recall that we have shown a bunch of properties of $\operatorname*{sur}\left(
m,n\right)  $. Since $%
%TCIMACRO{\QDATOPD{\{}{\}}{m}{n}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{m}{n}%
%EndExpansion
=\operatorname*{sur}\left(  m,n\right)  /n!$, we can translate them into
properties of $%
%TCIMACRO{\QDATOPD{\{}{\}}{m}{n}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{m}{n}%
%EndExpansion
$:

\begin{proposition}
Let $n\in\mathbb{N}$ and $k\in\mathbb{N}$.

\textbf{(a)} We have $%
%TCIMACRO{\QDATOPD{\{}{\}}{n}{0}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{n}{0}%
%EndExpansion
=\left[  n=0\right]  $.

\textbf{(b)} We have $%
%TCIMACRO{\QDATOPD{\{}{\}}{0}{k}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{0}{k}%
%EndExpansion
=\left[  k=0\right]  $.

\textbf{(c)} We have $%
%TCIMACRO{\QDATOPD{\{}{\}}{n}{k}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{n}{k}%
%EndExpansion
=0$ if $k>n$.

\textbf{(d)} We have $%
%TCIMACRO{\QDATOPD{\{}{\}}{n}{k}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{n}{k}%
%EndExpansion
=%
%TCIMACRO{\QDATOPD{\{}{\}}{n-1}{k-1}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{n-1}{k-1}%
%EndExpansion
+k%
%TCIMACRO{\QDATOPD{\{}{\}}{n-1}{k}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{n-1}{k}%
%EndExpansion
$ if $n>0$ and $k>0$.

\textbf{(e)} We have $%
%TCIMACRO{\QDATOPD{\{}{\}}{n}{k}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{n}{k}%
%EndExpansion
=\sum\limits_{j=0}^{n-1}\dbinom{n}{j}%
%TCIMACRO{\QDATOPD{\{}{\}}{j}{k-1}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{j}{k-1}%
%EndExpansion
/k$ if $k>0$.

\textbf{(f)} We have $%
%TCIMACRO{\QDATOPD{\{}{\}}{n}{k}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{n}{k}%
%EndExpansion
=\dfrac{1}{k!}\sum\limits_{i=0}^{k}\left(  -1\right)  ^{k-i}\dbinom{k}{i}%
i^{n}$.
\end{proposition}

\begin{proof}
\textbf{(a)} Follows from Proposition \ref{prop.binom.surm0-etc} \textbf{(a)}.

\textbf{(b)} Follows from Proposition \ref{prop.binom.surm0-etc} \textbf{(d)}.

\textbf{(c)} Follows from Proposition \ref{prop.binom.surm0-etc} \textbf{(f)}.

\textbf{(d)} Follows from Proposition \ref{prop.binom.surmn-rec2}.

\textbf{(e)} Follows from Proposition \ref{prop.binom.surmn-rec1}.

\textbf{(f)} Follows from Theorem \ref{thm.binom.surmn-as-altsum}.
\end{proof}

\begin{remark}
Let $n\in\mathbb{N}$. The $n$\textbf{-th Bell number} $B\left(  n\right)  $ is
defined as the \# of all set partitions of $\left[  n\right]  $. Thus,
Proposition \ref{prop.12fold.LtoU.sur} yields
\[
B\left(  n\right)  =%
%TCIMACRO{\QDATOPD{\{}{\}}{n}{0}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{n}{0}%
%EndExpansion
+%
%TCIMACRO{\QDATOPD{\{}{\}}{n}{1}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{n}{1}%
%EndExpansion
+\cdots+%
%TCIMACRO{\QDATOPD{\{}{\}}{n}{n}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{n}{n}%
%EndExpansion
.
\]
For example, $B\left(  3\right)  =5$.

There is no explicit formula for $B\left(  n\right)  $, but there is a
recurrence relation:%
\[
B\left(  n+1\right)  =\sum_{i=0}^{n}\dbinom{n}{i}B\left(  i\right)  .
\]


See \cite[Theorem 1.4.3]{Guicha20} for a proof of this recurrence relation,
and \cite[\S 0.3.2]{18s-hw3s} for more about the Bell numbers.
\end{remark}

\subsection{$U\rightarrow U$ and integer partitions}

It remains to count $U\rightarrow U$ placements.

A $U\rightarrow U$ placement looks like this:%
\[
\fbox{$%
\ \ \boxed{\phantom{(}\bullet\bullet\bullet\phantom{)}}\ \ \ \boxed{\phantom{(\bullet\bullet\bullet)}}\ \ \ \boxed{\phantom{(\bullet}\bullet\phantom{\bullet)}}\ \ \ \boxed{\phantom{((}\bullet\bullet\phantom{))}}\ \ \ \boxed{\phantom{(\bullet\bullet\bullet)}}\ \ \ \boxed{\phantom{((}\bullet\bullet\phantom{))}}\ \ \ \boxed{\phantom{(\bullet\bullet\bullet)}}\ \ $}%
\ \ \ ,
\]
with the understanding that the boxes, too, are interchangeable. Thus, we can
order the boxes by decreasing number of balls:%
\[
\fbox{$%
\ \ \boxed{\phantom{(}\bullet\bullet\bullet\phantom{)}}\ \ \ \boxed{\phantom{((}\bullet\bullet\phantom{))}}\ \ \ \boxed{\phantom{((}\bullet\bullet\phantom{))}}\ \ \ \boxed{\phantom{(\bullet}\bullet\phantom{\bullet)}}\ \ \ \boxed{\phantom{(\bullet\bullet\bullet)}}\ \ \ \boxed{\phantom{(\bullet\bullet\bullet)}}\ \ \ \boxed{\phantom{(\bullet\bullet\bullet)}}\ \ $}%
\ \ \ .
\]
You can encode this $U\rightarrow U$ placement by a sequence of numbers, which
say how many balls lie in each box:%
\[
\left(  3,2,2,1,0,0,0\right)  .
\]
The decreasing order makes this sequence unique.

Let us introduce a name for such sequences, more precisely, for such sequences
that don't contain zeroes:

\begin{definition}
A \textbf{partition} of an integer $n$ is a weakly decreasing list $\left(
a_{1},a_{2},\ldots,a_{k}\right)  $ of positive integers whose sum is $n$ (that
is, $a_{1}\geq a_{2}\geq\cdots\geq a_{k}>0$ and $a_{1}+a_{2}+\cdots+a_{k}=n$).

Instead of \textquotedblleft partition\textquotedblright, we can also say
\textquotedblleft integer partition\textquotedblright.

The positive integers $a_{1},a_{2},\ldots,a_{k}$ are called the \textbf{parts}
of the partition $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $.

If a partition of $n$ has $k$ parts, then we say that it is a
\textbf{partition of }$n$ \textbf{into }$k$ \textbf{parts}.
\end{definition}

\begin{example}
The partitions of $5$ are%
\begin{align*}
&  \left(  5\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  4,1\right)
,\ \ \ \ \ \ \ \ \ \ \left(  3,2\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
3,1,1\right)  ,\\
&  \left(  2,2,1\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  2,1,1,1\right)
,\ \ \ \ \ \ \ \ \ \ \left(  1,1,1,1,1\right)  .
\end{align*}


The partition $\left(  2,2,1\right)  $ is a partition of $5$ into $3$ parts.
\end{example}

\begin{remark}
A partition of $n$ is the same as a weakly decreasing composition of $n$.
\end{remark}

\begin{definition}
Let $n\in\mathbb{Z}$ and $k\in\mathbb{N}$. Then, we set%
\[
p_{k}\left(  n\right)  =\left(  \text{\# of partitions of }n\text{ into
}k\text{ parts}\right)  .
\]

\end{definition}

\begin{example}
We have%
\begin{align*}
p_{0}\left(  5\right)   &  =0,\ \ \ \ \ \ \ \ \ \ p_{1}\left(  5\right)
=1,\ \ \ \ \ \ \ \ \ \ p_{2}\left(  5\right)  =2,\ \ \ \ \ \ \ \ \ \ p_{3}%
\left(  5\right)  =2,\\
p_{4}\left(  5\right)   &  =1,\ \ \ \ \ \ \ \ \ \ p_{5}\left(  5\right)
=1,\ \ \ \ \ \ \ \ \ \ p_{k}\left(  5\right)  =0\text{ for }k>5.
\end{align*}

\end{example}

\begin{proposition}
\label{prop.partitions.basics}Let $n\in\mathbb{Z}$ and $k\in\mathbb{N}$.

\textbf{(a)} We have $p_{k}\left(  n\right)  =0$ when $n<0$.

\textbf{(b)} We have $p_{k}\left(  n\right)  =0$ when $k>n$.

\textbf{(c)} We have $p_{0}\left(  n\right)  =\left[  n=0\right]  $.

\textbf{(d)} We have $p_{1}\left(  n\right)  =\left[  n>0\right]  $.

\textbf{(e)} We have $p_{k}\left(  n\right)  =p_{k}\left(  n-k\right)
+p_{k-1}\left(  n-1\right)  $ when $k\geq1$.

\textbf{(f)} We have $p_{2}\left(  n\right)  =\left\lfloor n/2\right\rfloor $
if $n\in\mathbb{N}$.
\end{proposition}

\begin{proof}
\textbf{(a)} A sum of positive integers is never negative. Thus, there exist
no partitions of $n$ when $n<0$.

\textbf{(b)} If $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ is a partition of
$n$ into $k$ parts, then%
\[
n=\underbrace{a_{1}}_{\geq1}+\underbrace{a_{2}}_{\geq1}+\cdots
+\underbrace{a_{k}}_{\geq1}\geq\underbrace{1+1+\cdots+1}_{k\text{ times}}=k.
\]
Thus, no such partition exists if $k>n$.

\textbf{(c)} A partition of $n$ into $0$ parts is a $0$-tuple of positive
integers whose sum is $n$. But the sum of a $0$-tuple is always $0$. Hence,
such a partition exists only for $n=0$, and is unique. Thus, $p_{0}\left(
n\right)  =1$ if $n=0$ and is $0$ otherwise.

\textbf{(d)} If $n>0$, then there is only one partition of $n$ into $1$ part,
namely the $1$-tuple $\left(  n\right)  $. If $n=0$, then there is no
partition of $n$ into $1$ part.

\textbf{(e)} Assume that $k\geq1$. Let us call a partition of $n$

\begin{itemize}
\item \textbf{red} if $1$ is a part of it;

\item \textbf{green} if $1$ is not a part of it.
\end{itemize}

Any red partition of $n$ must end with a $1$ (since it contains a $1$ but is
weakly decreasing). Thus, the map
\begin{align*}
\left\{  \text{red partitions of }n\text{ into }k\text{ parts}\right\}   &
\rightarrow\left\{  \text{partitions of }n-1\text{ into }k-1\text{
parts}\right\}  ,\\
\left(  a_{1},a_{2},\ldots,a_{k-1},1\right)   &  \mapsto\left(  a_{1}%
,a_{2},\ldots,a_{k-1}\right)
\end{align*}
is well-defined. It is easy to see that this map is a bijection. Hence, the
bijection principle yields%
\begin{align*}
&  \left(  \text{\# of red partitions of }n\text{ into }k\text{ parts}\right)
\\
&  =\left(  \text{\# of partitions of }n-1\text{ into }k-1\text{
parts}\right)  =p_{k-1}\left(  n-1\right)  .
\end{align*}


All parts of a green partition of $n$ are $>1$ (since they are positive
integers and $\neq1$). Thus, the map%
\begin{align*}
\left\{  \text{green partitions of }n\text{ into }k\text{ parts}\right\}   &
\rightarrow\left\{  \text{partitions of }n-k\text{ into }k\text{
parts}\right\} \\
\left(  a_{1},a_{2},\ldots,a_{k}\right)   &  \mapsto\left(  a_{1}%
-1,a_{2}-1,\ldots,a_{k}-1\right)
\end{align*}
is well-defined. It is easy to see that this map is a bijection. Hence, the
bijection principle yields%
\begin{align*}
&  \left(  \text{\# of green partitions of }n\text{ into }k\text{
parts}\right) \\
&  =\left(  \text{\# of partitions of }n-k\text{ into }k\text{ parts}\right)
=p_{k}\left(  n-k\right)  .
\end{align*}


Adding these two equalities together, we get the claim of \textbf{(e)}.

\textbf{(f)} Let $n\in\mathbb{N}$. Then, the partitions of $n$ into $2$ parts
are%
\[
\left(  n-1,1\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  n-2,2\right)
,\ \ \ \ \ \ \ \ \ \ \left(  n-3,3\right)  ,\ \ \ \ \ \ \ \ \ \ \ldots
,\ \ \ \ \ \ \ \ \ \ \left(  \left\lceil n/2\right\rceil ,\left\lfloor
n/2\right\rfloor \right)
\]
(where $\left\lceil x\right\rceil $ denotes the ceiling of the real number
$x$). So there are $\left\lfloor n/2\right\rfloor $ many of them.
\end{proof}

Here is a table of the numbers $p_{k}\left(  n\right)  $ for small values of
$k$ and $n$:%
\[%
\begin{tabular}
[c]{|c||c|c|c|c|c|c|c|c|c|c|}\hline
$p_{k}\left(  n\right)  $ & $n=0$ & $n=1$ & $n=2$ & $n=3$ & $n=4$ & $n=5$ &
$n=6$ & $n=7$ & $n=8$ & $n=9$\\\hline\hline
$k=0$ & $1$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$\\\hline
$k=1$ & $0$ & $1$ & $1$ & $1$ & $1$ & $1$ & $1$ & $1$ & $1$ & $1$\\\hline
$k=2$ & $0$ & $0$ & $1$ & $1$ & $2$ & $2$ & $3$ & $3$ & $4$ & $4$\\\hline
$k=3$ & $0$ & $0$ & $0$ & $1$ & $1$ & $2$ & $3$ & $4$ & $5$ & $7$\\\hline
$k=4$ & $0$ & $0$ & $0$ & $0$ & $1$ & $1$ & $2$ & $3$ & $5$ & $6$\\\hline
$k=5$ & $0$ & $0$ & $0$ & $0$ & $0$ & $1$ & $1$ & $2$ & $3$ & $5$\\\hline
$k=6$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$ & $1$ & $1$ & $2$ & $3$\\\hline
$k=7$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$ & $1$ & $1$ & $2$\\\hline
$k=8$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$ & $1$ & $1$\\\hline
$k=9$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$ & $1$\\\hline
\end{tabular}
\
\]


\begin{proposition}
\label{prop.12fold.UtoU.sur}We have%
\[
\left(  \text{\# of surjective }U\rightarrow U\text{ placements }A\rightarrow
X\right)  =p_{\left\vert X\right\vert }\left(  \left\vert A\right\vert
\right)  .
\]

\end{proposition}

\begin{proof}
Proof idea: Encode a surjective $U\rightarrow U$ placement $A\rightarrow X$ as
a partition of $\left\vert A\right\vert $ into $\left\vert X\right\vert $
parts: namely the partition $\left(  a_{1},a_{2},\ldots,a_{\left\vert
X\right\vert }\right)  $, where%
\[
a_{i}=\left(  \text{\# of balls in the box with the }i\text{-th largest \# of
balls}\right)  .
\]
This is a bijection.
\end{proof}

\begin{proposition}
\label{prop.12fold.UtoU.inj}We have%
\[
\left(  \text{\# of injective }U\rightarrow U\text{ placements }A\rightarrow
X\right)  =\left[  \left\vert A\right\vert \leq\left\vert X\right\vert
\right]  .
\]

\end{proposition}

\begin{proof}
This follows from Proposition \ref{prop.12fold.LtoU.inj}.
\end{proof}

\begin{proposition}
\label{prop.12fold.UtoU.all}We have%
\[
\left(  \text{\# of }U\rightarrow U\text{ placements }A\rightarrow X\right)
=p_{0}\left(  \left\vert A\right\vert \right)  +p_{1}\left(  \left\vert
A\right\vert \right)  +\cdots+p_{\left\vert X\right\vert }\left(  \left\vert
A\right\vert \right)  .
\]

\end{proposition}

\begin{proof}
Similar to the proof of Proposition \ref{prop.12fold.LtoU.all}.
\end{proof}

Thus, we have obtained a full table of answers to the \textquotedblleft
twelvefold way\textquotedblright\ counting problems:%
\[%
\begin{tabular}
[c]{|c||c|c|c|}\hline
& arbitrary & injective & surjective\\\hline
$L\rightarrow L$ & $\left\vert X\right\vert ^{\left\vert A\right\vert }$ &
$\left\vert X\right\vert ^{\underline{\left\vert A\right\vert }}$ &
$\operatorname*{sur}\left(  \left\vert X\right\vert ,\left\vert A\right\vert
\right)  $\\\hline
$U\rightarrow L$ & $\dbinom{\left\vert A\right\vert +\left\vert X\right\vert
-1}{\left\vert A\right\vert }$ & $\dbinom{\left\vert X\right\vert }{\left\vert
A\right\vert }$ & $\dbinom{\left\vert A\right\vert -1}{\left\vert A\right\vert
-\left\vert X\right\vert }$\\\hline
$L\rightarrow U$ & $%
%TCIMACRO{\QDATOPD{\{}{\}}{\left\vert A\right\vert }{0}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{\left\vert A\right\vert }{0}%
%EndExpansion
+%
%TCIMACRO{\QDATOPD{\{}{\}}{\left\vert A\right\vert }{1}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{\left\vert A\right\vert }{1}%
%EndExpansion
+\cdots+%
%TCIMACRO{\QDATOPD{\{}{\}}{\left\vert A\right\vert }{\left\vert X\right\vert
%}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{\left\vert A\right\vert }{\left\vert X\right\vert }%
%EndExpansion
$ & $\left[  \left\vert A\right\vert \leq\left\vert X\right\vert \right]  $ &
$%
%TCIMACRO{\QDATOPD{\{}{\}}{\left\vert A\right\vert }{\left\vert X\right\vert
%}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{\left\vert A\right\vert }{\left\vert X\right\vert }%
%EndExpansion
$\\\hline
$U\rightarrow U$ & $p_{0}\left(  \left\vert A\right\vert \right)
+p_{1}\left(  \left\vert A\right\vert \right)  +\cdots+p_{\left\vert
X\right\vert }\left(  \left\vert A\right\vert \right)  $ & $\left[  \left\vert
A\right\vert \leq\left\vert X\right\vert \right]  $ & $p_{\left\vert
X\right\vert }\left(  \left\vert A\right\vert \right)  $\\\hline
\end{tabular}
\ \ \ \ .
\]


By the way, what happens if we add an extra column for \textquotedblleft
bijective\textquotedblright? Here is this column:%
\[%
\begin{tabular}
[c]{|c||c|}\hline
& bijective\\\hline
$L\rightarrow L$ & $\left[  \left\vert A\right\vert =\left\vert X\right\vert
\right]  \cdot\left\vert X\right\vert !$\\\hline
$U\rightarrow L$ & $\left[  \left\vert A\right\vert =\left\vert X\right\vert
\right]  $\\\hline
$L\rightarrow U$ & $\left[  \left\vert A\right\vert =\left\vert X\right\vert
\right]  $\\\hline
$U\rightarrow U$ & $\left[  \left\vert A\right\vert =\left\vert X\right\vert
\right]  $\\\hline
\end{tabular}
\ \ \ \ \ \ \ .
\]
(See \cite[Exercise 7]{17f-hw1s} for the proofs.) So that's not a very
interesting column.

\begin{center}
\fbox{\textbf{Class of 2019-11-15}}
\end{center}

\subsection{Integer partitions (an introduction)}

Recall that we have set%
\[
p_{k}\left(  n\right)  :=\left(  \text{\# of partitions of }n\text{ into
}k\text{ parts}\right)
\]
for all $n\in\mathbb{Z}$ and $k\in\mathbb{N}$.

Proposition \ref{prop.partitions.basics} \textbf{(e)} says that%
\[
p_{k}\left(  n\right)  =p_{k}\left(  n-k\right)  +p_{k-1}\left(  n-k\right)
\ \ \ \ \ \ \ \ \ \ \text{for all }n\in\mathbb{Z}\text{ and }k\geq1.
\]


Let us also set%
\[
p\left(  n\right)  :=\left(  \text{\# of partitions of }n\right)
\]
for all $n\in\mathbb{Z}$. Then,%
\[
p\left(  n\right)  =p_{0}\left(  n\right)  +p_{1}\left(  n\right)
+\cdots+p_{n}\left(  n\right)  \ \ \ \ \ \ \ \ \ \ \text{for each }%
n\in\mathbb{Z}%
\]
(by Proposition \ref{prop.partitions.basics} \textbf{(b)}).

Let us now count partitions with some more special properties.

\begin{definition}
\label{def.partitions.podd-pdist}Let $n\in\mathbb{Z}$.

\textbf{(a)} Let
\begin{align*}
p_{\operatorname*{odd}}\left(  n\right)   &  =\left(  \text{\# of partitions
of }n\text{ into odd parts}\right) \\
&  =\left(  \text{\# of partitions }\left(  a_{1},a_{2},\ldots,a_{k}\right)
\text{ of }n\text{ such that all }a_{i}\text{ are odd}\right)  .
\end{align*}


\textbf{(b)} Let%
\begin{align*}
p_{\operatorname*{dist}}\left(  n\right)   &  =\left(  \text{\# of partitions
of }n\text{ into distinct parts}\right) \\
&  =\left(  \text{\# of partitions }\left(  a_{1},a_{2},\ldots,a_{k}\right)
\text{ of }n\text{ such that }a_{1}>a_{2}>\cdots>a_{k}\right)  .
\end{align*}

\end{definition}

\begin{example}
\textbf{(a)} We have%
\[
p_{\operatorname*{odd}}\left(  7\right)  =\left\vert \left\{  \left(
7\right)  ,\left(  5,1,1\right)  ,\left(  3,3,1\right)  ,\left(
3,1,1,1,1\right)  ,\left(  1,1,1,1,1,1,1\right)  \right\}  \right\vert =5.
\]


\textbf{(b)} We have%
\[
p_{\operatorname*{dist}}\left(  7\right)  =\left\vert \left\{  \left(
7\right)  ,\left(  6,1\right)  ,\left(  5,2\right)  ,\left(  4,3\right)
,\left(  4,2,1\right)  \right\}  \right\vert =5.
\]

\end{example}

The following theorem is due to Euler:

\begin{theorem}
\label{thm.partitions.podd=pdist}Let $n\in\mathbb{Z}$. Then,
$p_{\operatorname*{odd}}\left(  n\right)  =p_{\operatorname*{dist}}\left(
n\right)  $.
\end{theorem}

\begin{proof}
Here is a rough outline. See \cite{Andrews317} or \cite[Proposition
18.1]{Galvin} for a more detailed version (albeit with a slightly different
version of the bijection).

We construct a map%
\[
A:\left\{  \text{partitions of }n\text{ into odd parts}\right\}
\rightarrow\left\{  \text{partitions of }n\text{ into distinct parts}\right\}
\]
which transforms a partition as follows: Repeatedly merge two equal parts
until no more equal parts can be found. \textquotedblleft Merging two equal
parts\textquotedblright\ means replacing two equal parts $a,a$ by the single
part $2a$, and (if necessarily) rearranging the resulting tuple back into
weakly decreasing order.

(\textit{Examples:} Let us compute $A\left(  5,5,3,1,1,1\right)  $:%
\[
\left(  \underline{5,5},3,1,1,1\right)  \rightarrow\left(
10,3,\underline{1,1},1\right)  \rightarrow\left(  10,3,2,1\right)
\]
(where we underline equal entries that are about to get merged). Thus,
$A\left(  5,5,3,1,1,1\right)  =\left(  10,3,2,1\right)  $.

Let us compute $A\left(  5,3,1,1,1,1\right)  $:%
\[
\left(  5,3,\underline{1,1},1,1\right)  \rightarrow\left(
5,3,2,\underline{1,1}\right)  \rightarrow\left(  5,3,\underline{2,2}\right)
\rightarrow\left(  5,4,3\right)  .
\]
Thus, $A\left(  5,3,1,1,1,1\right)  =\left(  5,4,3\right)  $.)

Why is this map $A$ well-defined? This is not obvious.

Our definition of $A$ was non-deterministic: It tells us to merge equal parts;
but it does not tell us which equal parts to choose first (and there can be
several choices). Thus, we have to prove that the result of our many merges
does not depend on the order in which we do the merges.

One way to prove this is using something called the \textbf{diamond lemma}.
Another way is by writing the parts of the partitions in binary (this is what
Andrews does in \cite{Andrews317}; he doesn't even talk about merging).

The inverse of $A$ transforms a partition by repeatedly splitting even parts
into two equal pieces.

(The map $A$ is called the Glaisher bijection; there are several other
bijections that work.)
\end{proof}

\begin{proposition}
\label{prop.partitions.pkn=max}Let $n\in\mathbb{Z}$ and $k>0$. Then,%
\[
p_{k}\left(  n\right)  =\left(  \text{\# of partitions of }n\text{ whose
largest part is }k\right)  .
\]

\end{proposition}

\begin{example}
We have $p_{3}\left(  5\right)  =\left(  \text{\# of partitions of }5\text{
whose largest part is }3\right)  $ (indeed, both numbers are $2$). Indeed, the
partitions of $5$ into $3$ parts are $\left(  3,1,1\right)  $ and $\left(
2,2,1\right)  $.
\end{example}

\begin{proof}
Picture proof: e.g., let $n=14$ and $k=4$. Start with the partition
$\lambda=\left(  5,4,4,1\right)  $ of $n$ into $k$ parts. Draw a table of $k$
left-aligned rows, where the length of each row equals the corresponding part
of $\lambda$:%
\[%
\begin{tabular}
[c]{l|l|llll}\cline{2-6}%
$5\rightarrow$ & \phantom{w} & \phantom{w} & \multicolumn{1}{|l}{\phantom{w}}
& \multicolumn{1}{|l}{\phantom{w}} & \multicolumn{1}{|l|}{\phantom{w}}%
\\\cline{2-5}\cline{2-6}%
$4\rightarrow$ &  &  & \multicolumn{1}{|l}{} & \multicolumn{1}{|l}{} &
\multicolumn{1}{|l}{}\\\cline{2-5}%
$4\rightarrow$ &  &  & \multicolumn{1}{|l}{} & \multicolumn{1}{|l}{} &
\multicolumn{1}{|l}{}\\\cline{2-2}\cline{2-5}%
$1\rightarrow$ &  &  &  &  & \\\cline{2-2}%
\end{tabular}
\ \ .
\]


Now, flip the table across the main diagonal (i.e., the diagonal going from
the top-left to the bottom-right), so that the rows become columns and vice
versa:%
\[%
\begin{tabular}
[c]{lllll}
& $5$ & $4$ & $4$ & $1$\\
& $\downarrow$ & $\downarrow$ & $\downarrow$ & $\downarrow$\\\cline{2-5}
& \multicolumn{1}{|l}{\phantom{w}} & \multicolumn{1}{|l}{\phantom{w}} &
\multicolumn{1}{|l}{\phantom{w}} & \multicolumn{1}{|l|}{\phantom{w}}%
\\\cline{2-5}
& \multicolumn{1}{|l}{} & \multicolumn{1}{|l}{} & \multicolumn{1}{|l}{} &
\multicolumn{1}{|l}{}\\\cline{2-4}
& \multicolumn{1}{|l}{} & \multicolumn{1}{|l}{} & \multicolumn{1}{|l}{} &
\multicolumn{1}{|l}{}\\\cline{2-4}
& \multicolumn{1}{|l}{} & \multicolumn{1}{|l}{} & \multicolumn{1}{|l}{} &
\multicolumn{1}{|l}{}\\\cline{2-2}\cline{2-4}
& \multicolumn{1}{|l}{} & \multicolumn{1}{|l}{} &  & \\\cline{2-2}%
\end{tabular}
\ \ .
\]


The lengths of the rows of the resulting table again form a partition of $n$.
The largest part of this new partition is $k$ (because our original table had
$k$ rows, so the flipped table has $k$ columns). In our example, this new
partition is $\left(  4,3,3,3,1\right)  $.

Thus, we obtain a map%
\[
\left\{  \text{partitions of }n\text{ into }k\text{ parts}\right\}
\rightarrow\left\{  \text{partitions of }n\text{ whose largest part is
}k\right\}  ,
\]
which transforms a partition by flipping its table.

This map is a bijection; indeed, its inverse map is defined in the same way.
This bijection is called \textbf{conjugation of partitions}. The bijection
principle now yields the proposition.

(Note: The table that we constructed above is called the \textbf{Young
diagram} of $\lambda$, or the \textbf{Ferrers diagram} of $\lambda$.)
\end{proof}

\begin{definition}
For any $k\in\mathbb{Z}$, define $w_{k}\in\mathbb{N}$ by
\[
w_{k}=\dfrac{\left(  3k-1\right)  k}{2}.
\]
This is called a \textbf{pentagonal number}.
\end{definition}

\begin{theorem}
[Euler's recursion for the partition numbers]\label{thm.partitions.euler-rec}%
For each $n>0$, we have%
\begin{align*}
&  p\left(  n\right) \\
&  =p\left(  n-1\right)  +p\left(  n-2\right)  -p\left(  n-5\right)  -p\left(
n-7\right)  +p\left(  n-12\right)  +p\left(  n-15\right)  \pm\cdots\\
&  =\sum_{\substack{k\in\mathbb{Z};\\k\neq0}}\left(  -1\right)  ^{k-1}p\left(
n-w_{k}\right)  .
\end{align*}

\end{theorem}

We might get to prove this later on, using the technique of \textbf{generating
functions}.

There is, of course, much more to say about partitions. See \cite{Wilf09} or
\cite{AndEri04} for two introductions.

\subsection{Odds and ends}

Here are some random counting exercises.

\begin{exercise}
Given $n$ persons ($n>0$) and $k$ tasks ($k>0$).

\textbf{(a)} What is the \# of ways to assign a task to each person such that
each task has at least $1$ person working on it?

\textbf{(b)} What if we additionally want to choose a leader for each task
(among the people assigned to this task)?

\textbf{(c)} What if, instead, we want to choose a vertical hierarchy (between
all people working on the task) for each task? (A \textquotedblleft vertical
hierarchy\textquotedblright\ means a ranking of all people working on the
task, with no ties.)

\textbf{Example:} Assume $n=8$ and $k=3$. Let our $8$ people be
$1,2,3,4,5,6,7,8$, and let our $3$ tasks be $A,B,C$.

\textbf{(a)} One option is%
\[%
\begin{tabular}
[c]{|l|l|}\hline
task & people working on it\\\hline\hline
$A$ & $1,2,5$\\\hline
$B$ & $3$\\\hline
$C$ & $4,6,7,8$\\\hline
\end{tabular}
\
\]


\textbf{(b)} One option is%
\[%
\begin{tabular}
[c]{|l|l|}\hline
task & people working on it\\\hline\hline
$A$ & $1,2,5$ with leader $2$\\\hline
$B$ & $3$ with leader $3$\\\hline
$C$ & $4,6,7,8$ with leader $7$\\\hline
\end{tabular}
\]


\textbf{(c)} One option is%
\[%
\begin{tabular}
[c]{|l|l|}\hline
task & people working on it\\\hline\hline
$A$ & $1>5>2$\\\hline
$B$ & $3$\\\hline
$C$ & $7>8>4>6$\\\hline
\end{tabular}
\
\]
(where the \textquotedblleft$>$\textquotedblright\ signs stand for
\textquotedblleft is ranked above\textquotedblright).
\end{exercise}

\begin{proof}
(Solution sketch.)

\textbf{(a)} $\operatorname*{sur}\left(  n,k\right)  $.

\textit{Proof.} Choosing such an arrangement is tantamount to choosing a
surjection $\left\{  \text{people}\right\}  \rightarrow\left\{  \text{tasks}%
\right\}  $.

\textbf{(b)} $n^{\underline{k}}\cdot k^{n-k}$.

\textit{Proof.} First, choose a leader for each task. There are
$n^{\underline{k}}$ options for this (since the leaders have to be distinct).
Then, every of the remaining $n-k$ people joins one of the $k$ leaders. There
are $k^{n-k}$ options for this.

\textbf{(c)} $n!\cdot\dbinom{n-1}{k-1}$.

\textit{Proof.} First, order all the $n$ people in some way. There are $n!$
options for this. Then, split this ordering into $k$ nonempty chunks
(corresponding to the $k$ tasks). There are $\dbinom{n-1}{k-1}$ options for
this, since we need to put $k-1$ separators into the $n-1$ positions between
two consecutive people in our ordering.
\end{proof}

\begin{center}
\fbox{\textbf{Class of 2019-11-18}}
\end{center}

\section{Permutations}

\subsection{Introduction}

We will now talk about permutations in more detail. For deeper treatments, see
\cite{Bona22}, \cite{Sagan01} and \cite[Chapter 1]{Stanley-EC1}. See also
\cite[Chapter 5]{detnotes} for a detailed exposition of the basics.

Recall: A \textbf{permutation} of a set $X$ is a bijection from $X$ to $X$.

\subsection{Definitions}

\begin{definition}
Let $n\in\mathbb{N}$. Let $S_{n}$ be the set of all permutations of $\left[
n\right]  $. This set $S_{n}$ is called the $n$\textbf{-th symmetric group}.
It is closed under composition (i.e., for any $\alpha\in S_{n}$ and $\beta\in
S_{n}$, we have $\alpha\circ\beta\in S_{n}$) and under inverses (i.e., for any
$\sigma\in S_{n}$, we have $\sigma^{-1}\in S_{n}$), and contains the identity
map $\operatorname*{id}\nolimits_{\left[  n\right]  }$.
\end{definition}

\begin{definition}
Let $n\in\mathbb{N}$ and $\sigma\in S_{n}$. We introduce two notations for
$\sigma$:

\textbf{(a)} The \textbf{one-line notation} of $\sigma$ is the $n$-tuple
$\left(  \sigma\left(  1\right)  ,\sigma\left(  2\right)  ,\ldots
,\sigma\left(  n\right)  \right)  $. (Conventionally, authors use square
brackets for it, but we use parentheses.)

\textbf{(b)} The \textbf{cycle digraph} of $\sigma$ is defined (informally) as follows:

For each $i\in\left[  n\right]  $, draw a point (\textquotedblleft
node\textquotedblright) labelled $i$.

For each $i\in\left[  n\right]  $, draw an arrow (\textquotedblleft
arc\textquotedblright) from the node labelled $i$ to the node labelled
$\sigma\left(  i\right)  $.

The result is called the \textbf{cycle digraph} of $\sigma$.
\end{definition}

\begin{example}
Let $\sigma:\left[  10\right]  \rightarrow\left[  10\right]  $ be the map that
sends the elements $1,2,3,4,5,6,7,8,9,10$ to $5,4,3,2,6,10,1,9,8,7$,
respectively. Then, $\sigma$ is a bijection, hence a permutation of $\left[
10\right]  $. The one-line notation of $\sigma$ is $\left(
5,4,3,2,6,10,1,9,8,7\right)  $. The cycle digraph of $\sigma$ is%
\[%
%TCIMACRO{\TeXButton{tikz cycle digraph}{\begin{tikzpicture}%
%[->,shorten >=1pt,auto,node distance=3cm, thick,main node/.style={circle,fill=blue!20,draw}%
%]
%\node[main node] (0) {10};
%\node[main node] (6) [above of=0] {6};
%\node[main node] (5) [above left of=6] {5};
%\node[main node] (1) [below left of=5] {1};
%\node[main node] (7) [below of=1] {7};
%\node[main node] (9) [above right of=6] {9};
%\node[main node] (8) [right of=9] {8};
%\node[main node] (2) [right of=0] {2};
%\node[main node] (4) [right of=2] {4};
%\node[main node] (3) [below of=8] {3};
%\path[-{Stealth[length=4mm]}]
%(1) edge [bend left] (5)
%(5) edge [bend left] (6)
%(6) edge [bend left] (0)
%(0) edge [bend left] (7)
%(7) edge [bend left] (1)
%(9) edge [bend right] (8)
%(8) edge [bend right] (9)
%(2) edge [bend right] (4)
%(4) edge [bend right] (2)
%(3) edge [loop right] (3);
%\end{tikzpicture}}}%
%BeginExpansion
\begin{tikzpicture}%
[->,shorten >=1pt,auto,node distance=3cm, thick,main node/.style={circle,fill=blue!20,draw}%
]
\node[main node] (0) {10};
\node[main node] (6) [above of=0] {6};
\node[main node] (5) [above left of=6] {5};
\node[main node] (1) [below left of=5] {1};
\node[main node] (7) [below of=1] {7};
\node[main node] (9) [above right of=6] {9};
\node[main node] (8) [right of=9] {8};
\node[main node] (2) [right of=0] {2};
\node[main node] (4) [right of=2] {4};
\node[main node] (3) [below of=8] {3};
\path[-{Stealth[length=4mm]}]
(1) edge [bend left] (5)
(5) edge [bend left] (6)
(6) edge [bend left] (0)
(0) edge [bend left] (7)
(7) edge [bend left] (1)
(9) edge [bend right] (8)
(8) edge [bend right] (9)
(2) edge [bend right] (4)
(4) edge [bend right] (2)
(3) edge [loop right] (3);
\end{tikzpicture}%
%EndExpansion
\ \ .
\]

\end{example}

\subsection{Transpositions and cycles}

\begin{definition}
\textbf{(a)} Let $i$ and $j$ be two distinct elements of a set $X$.

Then, the \textbf{transposition} $t_{i,j}$ is the permutation of $X$ that
sends $i$ to $j$, sends $j$ to $i$, and leaves all other elements in their places.

If $X=\left[  n\right]  $ for some $n\in\mathbb{N}$, and if $i<j$, then the
one-line notation of $t_{i,j}$ is%
\[
\left(  \underbrace{1,2,\ldots,i-1}_{\text{integers from }1\text{ to }%
i-1},j,\underbrace{i+1,i+2,\ldots,j-1}_{\text{integers from }i+1\text{ to
}j-1},i,\underbrace{j+1,j+2,\ldots,n}_{\text{integers from }j+1\text{ to }%
n}\right)  .
\]


\textbf{(b)} Let $n\in\mathbb{N}$ and $i\in\left[  n-1\right]  $. Then, the
\textbf{simple transposition }$s_{i}$ is defined by $s_{i}=t_{i,i+1}\in S_{n}%
$. So a simple transposition is a transposition that swaps two consecutive integers.
\end{definition}

\begin{convention}
If $\alpha$ and $\beta$ are two permutations of a set $X$, then we write
$\alpha\beta$ for $\alpha\circ\beta$.

Also, if $\alpha$ is any permutation of $X$, then we set $\alpha
^{i}:=\underbrace{\alpha\circ\alpha\circ\cdots\circ\alpha}_{i\text{ times}}$
for each $i\in\mathbb{N}$. If $i=0$, this is understood to be
$\operatorname*{id}\nolimits_{X}$.
\end{convention}

\begin{proposition}
Let $n\in\mathbb{N}$.

\textbf{(a)} We have $s_{i}^{2}=\operatorname*{id}$ for all $i\in\left[
n-1\right]  $. (Recall: $s_{i}^{2}=s_{i}\circ s_{i}$.)

\textbf{(b)} We have $s_{i}s_{j}=s_{j}s_{i}$ for all $i,j\in\left[
n-1\right]  $ with $\left\vert i-j\right\vert >1$.

\textbf{(c)} We have $s_{i}s_{i+1}s_{i}=s_{i+1}s_{i}s_{i+1}=t_{i,i+2}$ for all
$i\in\left[  n-2\right]  $. (This is known as \textquotedblleft the braid
relation for permutations\textquotedblright.)
\end{proposition}

\begin{proof}
Straightforward verification that both sides send each $k\in\left[  n\right]
$ to the same value. (The \textquotedblleft hardest\textquotedblright\ part is
part \textbf{(c)}, which is proved in \cite[solution to Exercise 5.1
\textbf{(a)}]{detnotes}.)
\end{proof}

\begin{definition}
Let $n\in\mathbb{N}$. Let $w_{0}$ be the permutation in $S_{n}$ that sends
each $i\in\left[  n\right]  $ to $n+1-i$.

In other words, it \textquotedblleft reflects\textquotedblright\ all numbers
from $1$ to $n$ across the middle of $\left[  n\right]  $. It is the unique
strictly decreasing permutation of $\left[  n\right]  $.
\end{definition}

\begin{example}
If $n=5$, then $w_{0}=\left(
\begin{array}
[c]{ccccc}%
1 & 2 & 3 & 4 & 5\\
5 & 4 & 3 & 2 & 1
\end{array}
\right)  $ in two-line notation, and $w_{0}=\left(  5,4,3,2,1\right)  $ in
one-line notation.
\end{example}

\begin{definition}
Let $X$ be a set. Let $i_{1},i_{2},\ldots,i_{k}$ be $k$ distinct elements of
$X$. Then,%
\[
\operatorname*{cyc}\nolimits_{i_{1},i_{2},\ldots,i_{k}}%
\]
means the permutation of $X$ that sends $i_{1}\mapsto i_{2}$, $i_{2}\mapsto
i_{3}$, $i_{3}\mapsto i_{4}$, $\ldots$, $i_{k-1}\mapsto i_{k}$, $i_{k}\mapsto
i_{1}$ and leaves all other elements of $X$ unchanged. This is called a
$k$\textbf{-cycle}.
\end{definition}

\begin{remark}
People often write $\left(  i_{1},i_{2},\ldots,i_{k}\right)  $ for
$\operatorname*{cyc}\nolimits_{i_{1},i_{2},\ldots,i_{k}}$. (But we won't.)
\end{remark}

\begin{example}
Let $X=\left[  8\right]  $. Then, the permutation $\operatorname*{cyc}%
\nolimits_{2,6,5}$ of $\left[  8\right]  $ has two-line notation $\left(
\begin{array}
[c]{cccccccc}%
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8\\
1 & 6 & 3 & 4 & 2 & 5 & 7 & 8
\end{array}
\right)  $.
\end{example}

\begin{remark}
A permutation $\alpha$ is called an \textbf{involution} if $\alpha
^{2}=\operatorname*{id}$. For example, all transpositions $t_{i,j}$ are
involutions. Also, both $\operatorname*{id}$ and $w_{0}$ are involutions. But
$k$-cycles with $k>2$ are not involutions.
\end{remark}

\begin{proposition}
Let $n\in\mathbb{N}$.

\textbf{(a)} For any $k$ distinct elements $i_{1},i_{2},\ldots,i_{k}$ of
$\left[  n\right]  $, we have%
\[
\operatorname*{cyc}\nolimits_{i_{1},i_{2},\ldots,i_{k}}=\underbrace{t_{i_{1}%
,i_{2}}t_{i_{2},i_{3}}\cdots t_{i_{k-1},i_{k}}}_{k-1\text{ transpositions}}.
\]


\textbf{(b)} For any $i\in\left[  n\right]  $ and $k\in\mathbb{N}$ such that
$i+k-1\leq n$, we have%
\[
\operatorname*{cyc}\nolimits_{i,i+1,\ldots,i+k-1}=s_{i}s_{i+1}\cdots
s_{i+k-2}.
\]


\textbf{(c)} For any $i\in\left[  n\right]  $, we have $\operatorname*{cyc}%
\nolimits_{i}=\operatorname*{id}$.

\textbf{(d)} For any distinct $i,j\in\left[  n\right]  $, we have
$\operatorname*{cyc}\nolimits_{i,j}=t_{i,j}$.

\textbf{(e)} For any $k$ distinct elements $i_{1},i_{2},\ldots,i_{k}$ of
$\left[  n\right]  $, we have%
\[
\operatorname*{cyc}\nolimits_{i_{1},i_{2},\ldots,i_{k}}=\operatorname*{cyc}%
\nolimits_{i_{k},i_{1},i_{2},\ldots,i_{k-1}}.
\]


\textbf{(f)} For any $k$ distinct elements $i_{1},i_{2},\ldots,i_{k}$ of
$\left[  n\right]  $ and any $\sigma\in S_{n}$, then%
\[
\sigma\operatorname*{cyc}\nolimits_{i_{1},i_{2},\ldots,i_{k}}\sigma
^{-1}=\operatorname*{cyc}\nolimits_{\sigma\left(  i_{1}\right)  ,\sigma\left(
i_{2}\right)  ,\ldots,\sigma\left(  i_{k}\right)  }.
\]


\textbf{(g)} If $i$ and $j$ are two integers satisfying $1\leq i<j\leq n$,
then%
\begin{align*}
t_{i,j}  &  =s_{i}s_{i+1}\cdots s_{j-1}\cdots s_{i+1}s_{i}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{this is a product starting at }s_{i}\text{, then walking up to }%
s_{j-1}\\
\text{and back down to }s_{i}%
\end{array}
\right) \\
&  =s_{j-1}s_{j-2}\cdots s_{i}\cdots s_{j-2}s_{j-1}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{this is a product starting at }s_{j-1}\text{, then walking down to
}s_{i}\\
\text{and back up to }s_{j-1}%
\end{array}
\right)  .
\end{align*}


\textbf{(h)} We have
\begin{align*}
w_{0}  &  =\operatorname*{cyc}\nolimits_{1,2,\ldots,n}\operatorname*{cyc}%
\nolimits_{1,2,\ldots,n-1}\cdots\operatorname*{cyc}\nolimits_{1}\\
&  =\left(  s_{1}s_{2}\cdots s_{n-1}\right)  \left(  s_{1}s_{2}\cdots
s_{n-2}\right)  \cdots\left(  s_{1}s_{2}\right)  s_{1}\\
&  =\operatorname*{cyc}\nolimits_{1}\operatorname*{cyc}\nolimits_{2,1}%
\operatorname*{cyc}\nolimits_{3,2,1}\cdots\operatorname*{cyc}%
\nolimits_{n,n-1,\ldots,1}\\
&  =s_{1}\left(  s_{2}s_{1}\right)  \left(  s_{3}s_{2}s_{1}\right)
\cdots\left(  s_{n-1}s_{n-2}\cdots s_{1}\right)  .
\end{align*}

\end{proposition}

\begin{proof}
All of these are doable with some bookkeeping and induction.

\textbf{(a)} This is \cite[Exercise 5.16]{detnotes}.

\textbf{(b)} This follows from part \textbf{(a)}.

\textbf{(c)}, \textbf{(d)} and \textbf{(e)} are obvious consequences of the definitions.

\textbf{(f)} This is \cite[Exercise 5.17 \textbf{(a)}]{detnotes}.

\textbf{(g)} This can be proved by induction on $j-i$ or otherwise. Perhaps
the quickest way, however, is using part \textbf{(a)}: To show that
$t_{i,j}=s_{i}s_{i+1}\cdots s_{j-1}\cdots s_{i+1}s_{i}$, we notice that part
\textbf{(a)} yields%
\[
s_{i}s_{i+1}\cdots s_{j-1}=t_{i,i+1}t_{i+1,i+2}\cdots t_{j-1,j}%
=\operatorname*{cyc}\nolimits_{i,i+1,\ldots,j}\ \ \ \ \ \ \ \ \ \ \left(
\text{by part \textbf{(a)}}\right)
\]
and
\[
s_{j-2}s_{j-3}\cdots s_{i+1}s_{i}=t_{j-1,j-2}t_{j-2,j-3}\cdots t_{i+2,i+1}%
t_{i+1,i}=\operatorname*{cyc}\nolimits_{j-1,j-2,\ldots,i+1,i}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{by part \textbf{(a)}}\right)  .
\]
Now,%
\begin{align*}
&  s_{i}s_{i+1}\cdots s_{j-1}\cdots s_{i+1}s_{i}\\
&  =\underbrace{\left(  s_{i}s_{i+1}\cdots s_{j-1}\right)  }%
_{=\operatorname*{cyc}\nolimits_{i,i+1,\ldots,j}}\underbrace{\left(
s_{j-2}s_{j-3}\cdots s_{i+1}s_{i}\right)  }_{=\operatorname*{cyc}%
\nolimits_{j-1,j-2,\ldots,i+1,i}}\\
&  =\operatorname*{cyc}\nolimits_{i,i+1,\ldots,j}\operatorname*{cyc}%
\nolimits_{j-1,j-2,\ldots,i+1,i}=t_{i,j}\ \ \ \ \ \ \ \ \ \ \left(  \text{this
is easy to check}\right)  .
\end{align*}
This proves the first equality sign of part \textbf{(g)}; the second is proved similarly.

\textbf{(h)} TODO. For now, see \cite{18s}.
\end{proof}

\subsection{Inversions and lengths}

\begin{definition}
Let $n\in\mathbb{N}$ and $\sigma\in S_{n}$.

\textbf{(a)} An \textbf{inversion} of $\sigma$ is a pair $\left(  i,j\right)
$ of elements of $\left[  n\right]  $ such that $i<j$ and $\sigma\left(
i\right)  >\sigma\left(  j\right)  $.

\textbf{(b)} The \textbf{length} (or \textbf{Coxeter length}) of $\sigma$ is
the \# of inversions of $\sigma$. It is called $\ell\left(  \sigma\right)  $.
\end{definition}

(In LaTeX, you can obtain the symbol \textquotedblleft$\ell$\textquotedblright%
\ by typing \textquotedblleft\texttt{%
%TCIMACRO{\TEXTsymbol{\backslash}}%
%BeginExpansion
$\backslash$%
%EndExpansion
ell}\textquotedblright. If you just type \textquotedblleft\texttt{l}%
\textquotedblright, then you get the less remarkable letter \textquotedblleft%
$l$\textquotedblright.)

\begin{example}
Let $\pi=\left(  3,1,4,2\right)  \in S_{4}$ (in one-line notation).

The inversions of $\pi$ are
\begin{align*}
&  \left(  1,4\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }1<4\text{ and
}\underbrace{\pi\left(  1\right)  }_{=3}>\underbrace{\pi\left(  4\right)
}_{=2}\right)  \ \ \ \ \ \ \ \ \ \ \text{and}\\
&  \left(  3,4\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }3<4\text{ and
}\underbrace{\pi\left(  3\right)  }_{=4}>\underbrace{\pi\left(  4\right)
}_{=2}\right)  \ \ \ \ \ \ \ \ \ \ \text{and}\\
&  \left(  1,2\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }1<2\text{ and
}\underbrace{\pi\left(  1\right)  }_{=3}>\underbrace{\pi\left(  2\right)
}_{=1}\right)  .
\end{align*}
So the length of $\pi$ is $3$.
\end{example}

\begin{remark}
If $\sigma\in S_{n}$, then $0\leq\ell\left(  \sigma\right)  \leq\dbinom{n}{2}$.

The only $\sigma\in S_{n}$ with $\ell\left(  \sigma\right)  =0$ is
$\operatorname*{id}$.

The only $\sigma\in S_{n}$ with $\ell\left(  \sigma\right)  =\dbinom{n}{2}$ is
$w_{0}$.

Inbetween, there are many permutations with a given $\ell\left(
\sigma\right)  $.
\end{remark}

\begin{center}
\fbox{\textbf{Class of 2019-11-20}}
\end{center}

\begin{remark}
If $n\in\mathbb{N}$, then the permutations of $\left[  n\right]  $ can be
represented as the vertices of an $\left(  n-1\right)  $-dimensional
polyhedron in $n$-dimensional space. Namely, each permutation $\sigma$ of
$\left[  n\right]  $ gives rise to the point $\left(  \sigma\left(  1\right)
,\sigma\left(  2\right)  ,\ldots,\sigma\left(  n\right)  \right)
\in\mathbb{R}^{n}$, and the convex hull of all these points is the polyhedron.
This is called the
\textbf{\href{https://en.wikipedia.org/wiki/Permutohedron}{\textbf{permutahedron}%
}}.
\end{remark}

\begin{proposition}
For every $\sigma\in S_{n}$, we have $\ell\left(  \sigma^{-1}\right)
=\ell\left(  \sigma\right)  $.
\end{proposition}

\begin{proof}
Recall: An inversion of $\sigma$ is a pair $\left(  i,j\right)  \in\left[
n\right]  \times\left[  n\right]  $ such that $i<j$ and $\sigma\left(
i\right)  >\sigma\left(  j\right)  $. An inversion of $\sigma^{-1}$ is a pair
$\left(  u,v\right)  \in\left[  n\right]  \times\left[  n\right]  $ such that
$u<v$ and $\sigma^{-1}\left(  u\right)  >\sigma^{-1}\left(  v\right)  $.

The map%
\begin{align*}
\left\{  \text{inversions of }\sigma\right\}   &  \rightarrow\left\{
\text{inversions of }\sigma^{-1}\right\}  ,\\
\left(  i,j\right)   &  \mapsto\left(  \sigma\left(  j\right)  ,\sigma\left(
i\right)  \right)
\end{align*}
is well-defined and bijective (its inverse map sends each $\left(  u,v\right)
\in\left\{  \text{inversions of }\sigma^{-1}\right\}  $ to $\left(
\sigma^{-1}\left(  v\right)  ,\sigma^{-1}\left(  u\right)  \right)  $). So the
bijection principle yields $\ell\left(  \sigma\right)  =\ell\left(
\sigma^{-1}\right)  $.

(For details, see \cite[Exercise 5.2 \textbf{(f)}]{detnotes}.)
\end{proof}

Recall from last time

\begin{itemize}
\item the transpositions $t_{i,j}$ (swapping $i$ with $j$ while leaving all
other numbers unchanged), and

\item the simple transpositions $s_{i}=t_{i,i+1}$.
\end{itemize}

\begin{proposition}
Let $n\in\mathbb{N}$, $\sigma\in S_{n}$ and $k\in\left[  n-1\right]  $.

\textbf{(a)} We have%
\[
\ell\left(  \sigma\circ s_{k}\right)  =%
\begin{cases}
\ell\left(  \sigma\right)  +1, & \text{if }\sigma\left(  k\right)
<\sigma\left(  k+1\right)  ;\\
\ell\left(  \sigma\right)  -1, & \text{if }\sigma\left(  k\right)
>\sigma\left(  k+1\right)  .
\end{cases}
\]


\textbf{(b)} We have%
\[
\ell\left(  s_{k}\circ\sigma\right)  =%
\begin{cases}
\ell\left(  \sigma\right)  +1, & \text{if }\sigma^{-1}\left(  k\right)
<\sigma^{-1}\left(  k+1\right)  ;\\
\ell\left(  \sigma\right)  -1, & \text{if }\sigma^{-1}\left(  k\right)
>\sigma^{-1}\left(  k+1\right)  .
\end{cases}
\]


[\textbf{Note:} $\sigma^{-1}\left(  i\right)  $ is the \textbf{position} in
which $i$ appears in the one-line notation of $\sigma$. For example, if
$\sigma=\left(  5,1,2,3,6,4\right)  $ in one-line notation, then $\sigma
^{-1}\left(  6\right)  =5$.]
\end{proposition}

\begin{proof}
\textbf{(b)} How do the inversions of $s_{k}\circ\sigma$ differ from the
inversions of $\sigma$ ?

I claim that they are the same, except that (when we go from $\sigma$ to
$s_{k}\circ\sigma$)

\begin{itemize}
\item if $\sigma^{-1}\left(  k\right)  <\sigma^{-1}\left(  k+1\right)  $, then
we gain a new inversion $\left(  \sigma^{-1}\left(  k\right)  ,\sigma
^{-1}\left(  k+1\right)  \right)  $;

\item if $\sigma^{-1}\left(  k\right)  >\sigma^{-1}\left(  k+1\right)  $, then
we lose an existing inversion $\left(  \sigma^{-1}\left(  k+1\right)
,\sigma^{-1}\left(  k\right)  \right)  $.
\end{itemize}

For example, let
\[
n=7\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \sigma=\left(
6,2,4,1,7,3,5\right)  \ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ k=4.
\]
Thus, $\sigma^{-1}\left(  k\right)  <\sigma^{-1}\left(  k+1\right)  $ and
$s_{k}\circ\sigma=\left(  6,2,5,1,7,3,4\right)  $. So we gain a new inversion
$\left(  3,7\right)  $ since $5>4$, but all other inversions remain the same.

For another example, let
\[
n=7\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \sigma=\left(
3,1,4,2,7,6,5\right)  \ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ k=2.
\]
Thus, $\sigma^{-1}\left(  k\right)  >\sigma^{-1}\left(  k+1\right)  $ and
$s_{k}\circ\sigma=\left(  2,1,4,3,7,6,5\right)  $. So we lose the inversion
$\left(  1,4\right)  $ since $3>2$, but all other inversions remain the same.

Thus, when going from $\sigma$ to $s_{k}\circ\sigma$, the \# of inversions
increases by $1$ if $\sigma^{-1}\left(  k\right)  <\sigma^{-1}\left(
k+1\right)  $ and decreases by $1$ if $\sigma^{-1}\left(  k\right)
>\sigma^{-1}\left(  k+1\right)  $. This is precisely the claim of \textbf{(b)}.

\textbf{(a)} Apply part \textbf{(b)} to $\sigma^{-1}$ instead of $\sigma$. We
get%
\begin{align*}
\ell\left(  s_{k}\circ\sigma^{-1}\right)   &  =%
\begin{cases}
\ell\left(  \sigma^{-1}\right)  +1, & \text{if }\left(  \sigma^{-1}\right)
^{-1}\left(  k\right)  <\left(  \sigma^{-1}\right)  ^{-1}\left(  k+1\right)
;\\
\ell\left(  \sigma^{-1}\right)  -1, & \text{if }\left(  \sigma^{-1}\right)
^{-1}\left(  k\right)  >\left(  \sigma^{-1}\right)  ^{-1}\left(  k+1\right)
\end{cases}
\\
&  =%
\begin{cases}
\ell\left(  \sigma\right)  +1, & \text{if }\sigma\left(  k\right)
<\sigma\left(  k+1\right)  ;\\
\ell\left(  \sigma\right)  -1, & \text{if }\sigma\left(  k\right)
>\sigma\left(  k+1\right)
\end{cases}
\end{align*}
(since $\ell\left(  \sigma^{-1}\right)  =\ell\left(  \sigma\right)  $ (by
previous Proposition) and $\left(  \sigma^{-1}\right)  ^{-1}=\sigma$). On the
other hand, the previous Proposition yields%
\begin{align*}
\ell\left(  s_{k}\circ\sigma^{-1}\right)   &  =\ell\left(  \underbrace{\left(
s_{k}\circ\sigma^{-1}\right)  ^{-1}}_{\substack{=\left(  \sigma^{-1}\right)
^{-1}\circ\left(  s_{k}\right)  ^{-1}\\\text{(since }\left(  \alpha\circ
\beta\right)  ^{-1}=\beta^{-1}\circ\alpha^{-1}\text{)}}}\right)  =\ell\left(
\underbrace{\left(  \sigma^{-1}\right)  ^{-1}}_{=\sigma}\circ
\underbrace{\left(  s_{k}\right)  ^{-1}}_{\substack{=s_{k}\\\text{(since
}s_{k}\circ s_{k}=\operatorname*{id}\text{)}}}\right) \\
&  =\ell\left(  \sigma\circ s_{k}\right)  .
\end{align*}
Comparing these equalities, we get%
\[
\ell\left(  \sigma\circ s_{k}\right)  =%
\begin{cases}
\ell\left(  \sigma\right)  +1, & \text{if }\sigma\left(  k\right)
<\sigma\left(  k+1\right)  ;\\
\ell\left(  \sigma\right)  -1, & \text{if }\sigma\left(  k\right)
>\sigma\left(  k+1\right)  .
\end{cases}
\]


(See \cite[Exercise 5.2 \textbf{(a)}]{detnotes} for a similar proof in more detail.)
\end{proof}

\begin{remark}
Let $n\in\mathbb{N}$ and $\sigma\in S_{n}$. Let $i,j\in\left[  n\right]  $ be
such that $i<j$ and $\sigma\left(  i\right)  >\sigma\left(  j\right)  $. Is%
\[
\ell\left(  \sigma\circ t_{i,j}\right)  <\ell\left(  \sigma\right)  \ \text{?}%
\]


It's not obvious, but the answer is \textquotedblleft yes\textquotedblright.
See \cite[Exercise 5.20]{detnotes}.
\end{remark}

Recall: A \textbf{simple transposition} in $S_{n}$ means one of the
transpositions $s_{1},s_{2},\ldots,s_{n-1}$. We shall occasionally abbreviate
\textquotedblleft simple transposition\textquotedblright\ as \textquotedblleft%
\textbf{simple}\textquotedblright.

\begin{theorem}
Let $n\in\mathbb{N}$ and $\sigma\in S_{n}$.

\textbf{(a)} We can write $\sigma$ as a composition of $\ell\left(
\sigma\right)  $ simples.

\textbf{(b)} The number $\ell\left(  \sigma\right)  $ is the smallest
$p\in\mathbb{N}$ such that we can write $\sigma$ as a composition of $p$ simples.

[\textbf{Keep in mind:} The composition of $0$ simples is $\operatorname*{id}$.]
\end{theorem}

\begin{example}
Let $\sigma\in S_{4}$ be the permutation $\left(  4,1,3,2\right)  $ (in
one-line notation). How can we represent $\sigma$ as a composition of simples?
There are several ways to do so, for example%
\begin{align*}
\sigma &  =\underbrace{s_{2}\circ s_{3}\circ s_{2}}_{=s_{3}\circ s_{2}\circ
s_{3}}\circ s_{1}=s_{3}\circ s_{2}\circ\underbrace{s_{3}\circ s_{1}}%
_{=s_{1}\circ s_{3}}=s_{3}\circ s_{2}\circ s_{1}\circ s_{3}\\
&  =s_{2}\circ s_{1}\circ s_{1}\circ s_{3}\circ s_{2}\circ s_{1}=\cdots.
\end{align*}
The shortest of these representations involve $4$ simples, as the Theorem
above predicts (since $\ell\left(  \sigma\right)  =4$).
\end{example}

\begin{proof}
(Proof of Theorem.)

\textbf{(a)} Induction on $\ell\left(  \sigma\right)  $.

\textit{Induction base:} If $\ell\left(  \sigma\right)  =0$, then
$\sigma=\operatorname*{id}$, so we can write $\sigma$ as a composition of $0$ simples.

\textit{Induction step:} Fix $h\in\mathbb{N}$. Assume (as the IH) that Theorem
\textbf{(a)} holds for $\ell\left(  \sigma\right)  =h$.

Now, let $\sigma\in S_{n}$ be such that $\ell\left(  \sigma\right)  =h+1$.

Hence, $\ell\left(  \sigma\right)  =h+1>0$, so $\sigma\neq\operatorname*{id}$.

Therefore, there exists some $k\in\left[  n-1\right]  $ such that
$\sigma\left(  k\right)  >\sigma\left(  k+1\right)  $ (because otherwise, we
would have $\sigma\left(  1\right)  \leq\sigma\left(  2\right)  \leq\cdots
\leq\sigma\left(  n\right)  $, and this would imply $\ell\left(
\sigma\right)  =0$, whence $\sigma=\operatorname*{id}$). Fix such a $k$.

Part \textbf{(a)} of the previous proposition yields%
\begin{align*}
\ell\left(  \sigma\circ s_{k}\right)   &  =%
\begin{cases}
\ell\left(  \sigma\right)  +1, & \text{if }\sigma\left(  k\right)
<\sigma\left(  k+1\right)  ;\\
\ell\left(  \sigma\right)  -1, & \text{if }\sigma\left(  k\right)
>\sigma\left(  k+1\right)
\end{cases}
=\underbrace{\ell\left(  \sigma\right)  }_{=h+1}-1\\
&  =\left(  h+1\right)  -1=h.
\end{align*}
Thus, the IH (applied to $\sigma\circ s_{k}$ instead of $\sigma$) shows that
we can write $\sigma\circ s_{k}$ as a composition of $\ell\left(  \sigma\circ
s_{k}\right)  =h$ simples:%
\[
\sigma\circ s_{k}=s_{i_{1}}\circ s_{i_{2}}\circ\cdots\circ s_{i_{h}%
}\ \ \ \ \ \ \ \ \ \ \text{for some }i_{1},i_{2},\ldots,i_{h}\in\left[
n-1\right]  .
\]
Composing both sides of this equality with $\left(  s_{k}\right)  ^{-1}$, we
obtain%
\begin{align*}
\sigma &  =\left(  s_{i_{1}}\circ s_{i_{2}}\circ\cdots\circ s_{i_{h}}\right)
\circ\underbrace{\left(  s_{k}\right)  ^{-1}}_{=s_{k}}\\
&  =\left(  s_{i_{1}}\circ s_{i_{2}}\circ\cdots\circ s_{i_{h}}\right)  \circ
s_{k}=s_{i_{1}}\circ s_{i_{2}}\circ\cdots\circ s_{i_{h}}\circ s_{k}.
\end{align*}
This shows that we can write $\sigma$ as a composition of $h+1=\ell\left(
\sigma\right)  $ simples. Thus, Theorem \textbf{(a)} holds for $\ell\left(
\sigma\right)  =h+1$. This completes the induction step, and so Theorem
\textbf{(a)} is proved by induction.

[The idea behind this proof is known as \textquotedblleft
bubblesort\textquotedblright.]

\textbf{(b)} Omitted.

(For details, see \cite[Exercise 5.2 \textbf{(g)}]{detnotes}.)
\end{proof}

\begin{corollary}
Let $n\in\mathbb{N}$.

\textbf{(a)} We have $\ell\left(  \sigma\circ\tau\right)  \equiv\ell\left(
\sigma\right)  +\ell\left(  \tau\right)  \operatorname{mod}2$ for all
$\sigma\in S_{n}$ and $\tau\in S_{n}$. (In other words, if $\ell\left(
\sigma\circ\tau\right)  $ is even, then $\ell\left(  \sigma\right)
+\ell\left(  \tau\right)  $ is even, and the same for \textquotedblleft
odd\textquotedblright.)

\textbf{(b)} We have $\ell\left(  \sigma\circ\tau\right)  \leq\ell\left(
\sigma\right)  +\ell\left(  \tau\right)  $.

\textbf{(c)} If $\sigma=s_{k_{1}}\circ s_{k_{2}}\circ\cdots\circ s_{k_{q}}$,
then $q\geq\ell\left(  \sigma\right)  $ and $q\equiv\ell\left(  \sigma\right)
\operatorname{mod}2$.
\end{corollary}

\begin{example}
Let $n=4$ and $\sigma=\left(  3,2,1,4\right)  $ and $\tau=\left(
3,1,4,2\right)  $ in one-line notation. Then, $\ell\left(  \sigma\right)  =3$
and $\ell\left(  \tau\right)  =3$. Now, $\sigma\circ\tau=\left(
1,3,4,2\right)  $ has $\ell\left(  \sigma\circ\tau\right)  =2$.

Corollary \textbf{(a)} says $\ell\left(  \sigma\circ\tau\right)  \equiv
\ell\left(  \sigma\right)  +\ell\left(  \tau\right)  \operatorname{mod}2$. In
other words, $2\equiv3+3\operatorname{mod}2$.

Corollary \textbf{(b)} says $\ell\left(  \sigma\circ\tau\right)  \leq
\ell\left(  \sigma\right)  +\ell\left(  \tau\right)  $. In other words,
$2\leq3+3$.
\end{example}

\begin{proof}
(Proof of Corollary) See \cite[Exercises 5.2 and 5.3]{detnotes}. (Or do it
yourself, e.g., by induction on $\ell\left(  \sigma\right)  $.)
\end{proof}

\begin{proposition}
Let $n\in\mathbb{N}$.

\textbf{(a)} We have $\ell\left(  s_{k}\right)  =1$ for any $k\in\left[
n-1\right]  $.

\textbf{(b)} We have $\ell\left(  t_{i,j}\right)  =2\left\vert i-j\right\vert
-1$ for any distinct $i,j\in\left[  n\right]  $.

\textbf{(c)} We have $\ell\left(  \operatorname*{cyc}\nolimits_{i,i+1,\ldots
,i+k-1}\right)  =k-1$ for all $i,k$.

\textbf{(d)} We have $\ell\left(  \operatorname*{cyc}\nolimits_{i_{1}%
,i_{2},\ldots,i_{k}}\right)  \geq k-1$ for all distinct $i_{1},i_{2}%
,\ldots,i_{k}\in\left[  n\right]  $.

\textbf{(e)} We have $\ell\left(  \operatorname*{id}\right)  =0$ and
$\ell\left(  w_{0}\right)  =\dbinom{n}{2}$. (Recall: $w_{0}$ is the
\textquotedblleft reflection across the middle of $\left[  n\right]
$\textquotedblright.)
\end{proposition}

\begin{proof}
\textbf{(a)} follows from \textbf{(b)}.

\textbf{(b)} is \cite[Exercise 5.10 \textbf{(a)}]{detnotes}, but also easy to check.

\textbf{(c)} and \textbf{(d)} are parts of \cite[Exercise 5.17]{detnotes}.

\textbf{(e)} is trivial.
\end{proof}

\begin{center}
\fbox{\textbf{Class of 2019-11-25}}
\end{center}

\begin{remark}
For a given $k$ and $n$, how many $\sigma\in S_{n}$ have length $k$ ?

\begin{itemize}
\item The \# of $\sigma\in S_{n}$ having $\ell\left(  \sigma\right)  =0$ is
$1$ (namely, just $\sigma=\operatorname*{id}$).

\item The \# of $\sigma\in S_{n}$ having $\ell\left(  \sigma\right)  =1$ is
$n-1$ (namely, just $\sigma=s_{k}$ with $k\in\left[  n-1\right]  $).

\item The \# of $\sigma\in S_{n}$ having $\ell\left(  \sigma\right)  =2$ is
$\left(  n-1\right)  \left(  n+1\right)  /2$. (Exercise.)
\end{itemize}

What about the general case?

There is no explicit formula, but there is a generating function:
\end{remark}

\begin{proposition}
Let $n\in\mathbb{N}$. Then,%
\begin{align*}
&  \sum_{w\in S_{n}}x^{\ell\left(  w\right)  }\\
&  =\prod_{i=1}^{n-1}\left(  1+x+x^{2}+\cdots+x^{i}\right) \\
&  =\left(  1+x\right)  \cdot\left(  1+x+x^{2}\right)  \cdot\left(
1+x+x^{2}+x^{3}\right)  \cdot\cdots\cdot\left(  1+x+x^{2}+\cdots
+x^{n-1}\right)  .
\end{align*}

\end{proposition}

\begin{example}
Applying this to $n=3$, we obtain%
\[
\sum_{w\in S_{3}}x^{\ell\left(  w\right)  }=\left(  1+x\right)  \cdot\left(
1+x+x^{2}\right)  .
\]
Let us check this:%
\begin{align*}
\sum_{w\in S_{3}}x^{\ell\left(  w\right)  }  &  =x^{\ell\left(  1,2,3\right)
}+x^{\ell\left(  1,3,2\right)  }+x^{\ell\left(  2,1,3\right)  }+x^{\ell\left(
2,3,1\right)  }+x^{\ell\left(  3,1,2\right)  }+x^{\ell\left(  3,2,1\right)
}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{where we are writing each permutation in
one-line notation}\right) \\
&  =x^{0}+x^{1}+x^{1}+x^{2}+x^{2}+x^{3}=x^{0}+2x^{1}+2x^{2}+x^{3}\\
&  =\left(  1+x\right)  \cdot\left(  1+x+x^{2}\right)  .
\end{align*}

\end{example}

\begin{proof}
The proposition is \cite[Corollary 5.53]{detnotes}, and a proof appears in
\cite[solution to Exercise 5.18]{detnotes}.
\end{proof}

\subsection{Descents}

\begin{definition}
Let $n\in\mathbb{N}$ and $\sigma\in S_{n}$.

A \textbf{descent} of $\sigma$ means a $k\in\left[  n-1\right]  $ such that
$\sigma\left(  k\right)  >\sigma\left(  k+1\right)  $.

The \textbf{descent set} of $\sigma$, denoted $\operatorname*{Des}\sigma$, is
the set of all descents of $\sigma$.
\end{definition}

\begin{example}
Let $\pi\in S_{4}$ be the permutation with one-line notation $\left(
3,1,4,2\right)  $. Then, $1$ is a descent of $\pi$ (since $\pi\left(
1\right)  =3>1=\pi\left(  2\right)  $), and so is $3$, but not $2$. Thus,
$\operatorname*{Des}\pi=\left\{  1,3\right\}  $.
\end{example}

\begin{exercise}
Fix $n\geq4$.

\textbf{(a)} How many $\sigma\in S_{n}$ have $0$ descents?

\textbf{(b)} How many $\sigma\in S_{n}$ have $1$ descent?

\textbf{(c)} How many $\sigma\in S_{n}$ have $n-1$ descents?

\textbf{(d)} How many $\sigma\in S_{n}$ satisfy $1\in\operatorname*{Des}%
\sigma$ (that is, $\sigma\left(  1\right)  >\sigma\left(  2\right)  $) ?

\textbf{(e)} How many $\sigma\in S_{n}$ satisfy $1,2\in\operatorname*{Des}%
\sigma$ (that is, $\sigma\left(  1\right)  >\sigma\left(  2\right)
>\sigma\left(  3\right)  $) ?

\textbf{(f)} How many $\sigma\in S_{n}$ satisfy $1,3\in\operatorname*{Des}%
\sigma$ (that is, $\sigma\left(  1\right)  >\sigma\left(  2\right)  $ and
$\sigma\left(  3\right)  >\sigma\left(  4\right)  $) ?
\end{exercise}

\begin{proof}
(Solution sketch.) \textbf{(a)} The answer is $1$ (namely, $\sigma
=\operatorname*{id}$).

\textbf{(d)} The answer is $\dfrac{n!}{2}$.

\textit{First proof:} The map%
\begin{align*}
\left\{  \sigma\in S_{n}\ \mid\ \sigma\left(  1\right)  >\sigma\left(
2\right)  \right\}   &  \rightarrow\left\{  \sigma\in S_{n}\ \mid
\ \sigma\left(  1\right)  <\sigma\left(  2\right)  \right\}  ,\\
\sigma &  \mapsto\sigma\circ s_{1}%
\end{align*}
is bijective. So each of the $2$ sets is half as large as $S_{n}$ (because
each $\sigma\in S_{n}$ satisfies either $\sigma\left(  1\right)
>\sigma\left(  2\right)  $ or $\sigma\left(  1\right)  <\sigma\left(
2\right)  $). But $\left\vert S_{n}\right\vert =n!$.

\textit{Second proof:} To construct a $\sigma\in S_{n}$ satisfying
$\sigma\left(  1\right)  >\sigma\left(  2\right)  $, we can proceed as follows:

\begin{itemize}
\item Choose the \textbf{set} $\left\{  \sigma\left(  1\right)  ,\sigma\left(
2\right)  \right\}  $. There are $\dbinom{n}{2}$ options.

\item Thus, $\sigma\left(  1\right)  $ and $\sigma\left(  2\right)  $ are
already uniquely determined, because they have to satisfy $\sigma\left(
1\right)  >\sigma\left(  2\right)  $.

\item Choose $\sigma\left(  3\right)  ,\sigma\left(  4\right)  ,\ldots
,\sigma\left(  n\right)  $. There are $\left(  n-2\right)  !$ options.
\end{itemize}

$\Longrightarrow$ The total \# is $\dbinom{n}{2}\cdot\left(  n-2\right)
!=\dfrac{n!}{2!}=\dfrac{n!}{2}$.

\textbf{(e)} The answer is $\dfrac{n!}{3!}$.

For the detailed proof, see \cite[solution to Exercise 2 \textbf{(b)}%
]{18s-mt1s}.

\textbf{(f)} The answer is $\dfrac{n!}{2!\cdot2!}=\dfrac{n!}{4}$.

For the detailed proof, see \cite[solution to Exercise 2 \textbf{(a)}%
]{18s-mt1s}.

More generally, you can ask how many permutations $\sigma\in S_{n}$ have a
given bunch of numbers in their descent set. A similar question is answered in
\cite[Exercise 4 \textbf{(a)}]{18f-hw4s}.

\textbf{(b)} First of all, fix $i\in\left[  n-1\right]  $. How many $\sigma\in
S_{n}$ have $\operatorname*{Des}\sigma=\left\{  i\right\}  $ ?

In other words, how many $\sigma\in S_{n}$ satisfy%
\[
\sigma\left(  1\right)  <\sigma\left(  2\right)  <\cdots<\sigma\left(
i\right)  >\sigma\left(  i+1\right)  <\sigma\left(  i+2\right)  <\cdots
<\sigma\left(  n\right)  .
\]


We have%
\begin{align*}
&  \left(  \text{\# of }\sigma\in S_{n}\text{ such that }\sigma\left(
1\right)  <\sigma\left(  2\right)  <\cdots<\sigma\left(  i\right)  \text{ and
}\sigma\left(  i+1\right)  <\sigma\left(  i+2\right)  <\cdots<\sigma\left(
n\right)  \right) \\
&  =\dbinom{n}{i}%
\end{align*}
(because in order to construct such a $\sigma$, it suffices to choose the
$i$-element subset $\left\{  \sigma\left(  1\right)  ,\sigma\left(  2\right)
,\ldots,\sigma\left(  i\right)  \right\}  $ of $\left[  n\right]  $). Thus,%
\begin{align*}
&  \left(  \text{\# of }\sigma\in S_{n}\text{ such that }\sigma\left(
1\right)  <\sigma\left(  2\right)  <\cdots<\sigma\left(  i\right)
>\sigma\left(  i+1\right)  <\sigma\left(  i+2\right)  <\cdots<\sigma\left(
n\right)  \right) \\
&  =\underbrace{\left(  \text{\# of }\sigma\in S_{n}\text{ such that }%
\sigma\left(  1\right)  <\sigma\left(  2\right)  <\cdots<\sigma\left(
i\right)  \text{ and }\sigma\left(  i+1\right)  <\sigma\left(  i+2\right)
<\cdots<\sigma\left(  n\right)  \right)  }_{=\dbinom{n}{i}}\\
&  -\underbrace{\left(  \text{\# of }\sigma\in S_{n}\text{ such that }%
\sigma\left(  1\right)  <\sigma\left(  2\right)  <\cdots<\sigma\left(
i\right)  <\sigma\left(  i+1\right)  <\sigma\left(  i+2\right)  <\cdots
<\sigma\left(  n\right)  \right)  }_{=1}\\
&  =\dbinom{n}{i}-1.
\end{align*}


Now, forget that we fixed $i$. Summing this over all $i\in\left[  n-1\right]
$, we get%
\begin{align*}
&  \left(  \text{\# of }\sigma\in S_{n}\text{ that have exactly }1\text{
descent}\right) \\
&  =\sum_{i=1}^{n-1}\left(  \dbinom{n}{i}-1\right)  =\underbrace{\sum
_{i=1}^{n-1}\dbinom{n}{i}}_{=2^{n}-2}-\left(  n-1\right)  =2^{n}-2-\left(
n-1\right)  =2^{n}-\left(  n+1\right)  .
\end{align*}


\textbf{(c)} Only $1$ permutation $\sigma\in S_{n}$ has $n-1$ descents, namely
$w_{0}$.
\end{proof}

\subsection{Signs}

\begin{definition}
Let $n\in\mathbb{N}$. The \textbf{sign} of a permutation $\sigma\in S_{n}$ is
$\left(  -1\right)  ^{\ell\left(  \sigma\right)  }$.

It is called $\left(  -1\right)  ^{\sigma}$ or $\operatorname*{sgn}\left(
\sigma\right)  $ or $\operatorname*{sign}\left(  \sigma\right)  $ or
$\varepsilon\left(  \sigma\right)  $.
\end{definition}

\begin{proposition}
Let $n\in\mathbb{N}$.

\textbf{(a)} We have $\left(  -1\right)  ^{\operatorname*{id}}=1$.

\textbf{(b)} We have $\left(  -1\right)  ^{t_{i,j}}=-1$.

\textbf{(c)} We have $\left(  -1\right)  ^{\operatorname*{cyc}\nolimits_{i_{1}%
,i_{2},\ldots,i_{k}}}=\left(  -1\right)  ^{k-1}$ for any $k\geq1$ and any
distinct $i_{1},i_{2},\ldots,i_{k}\in\left[  n\right]  $.

\textbf{(d)} We have $\left(  -1\right)  ^{\sigma\circ\tau}=\left(  -1\right)
^{\sigma}\cdot\left(  -1\right)  ^{\tau}$ for any $\sigma,\tau\in S_{n}$. (In
the lingo of abstract algebra, this is saying \textquotedblleft The sign is a
group homomorphism from $S_{n}$ to $\left\{  1,-1\right\}  $\textquotedblright.)

\textbf{(e)} We have $\left(  -1\right)  ^{\sigma_{1}\circ\sigma_{2}%
\circ\cdots\circ\sigma_{p}}=\left(  -1\right)  ^{\sigma_{1}}\left(  -1\right)
^{\sigma_{2}}\cdots\left(  -1\right)  ^{\sigma_{p}}$ for any $\sigma
_{1},\sigma_{2},\ldots,\sigma_{p}\in S_{n}$.

\textbf{(f)} We have $\left(  -1\right)  ^{\sigma^{-1}}=\left(  -1\right)
^{\sigma}$ for any $\sigma\in S_{n}$. (The LHS has to be read as $\left(
-1\right)  ^{\left(  \sigma^{-1}\right)  }$.)

\textbf{(g)} We have%
\[
\left(  -1\right)  ^{\sigma}=\prod_{1\leq i<j\leq n}\dfrac{\sigma\left(
i\right)  -\sigma\left(  j\right)  }{i-j}\ \ \ \ \ \ \ \ \ \ \text{for each
}\sigma\in S_{n}.
\]


\textbf{(h)} If $x_{1},x_{2},\ldots,x_{n}$ are any numbers, and $\sigma\in
S_{n}$, then%
\[
\prod_{1\leq i<j\leq n}\left(  x_{\sigma\left(  i\right)  }-x_{\sigma\left(
j\right)  }\right)  =\left(  -1\right)  ^{\sigma}\prod_{1\leq i<j\leq
n}\left(  x_{i}-x_{j}\right)  .
\]

\end{proposition}

\begin{proof}
Most of this follows easily from what we have proved above, but here are
references to complete proofs:

\textbf{(a)} This is \cite[Proposition 5.15 \textbf{(a)}]{detnotes}.

\textbf{(b)} This is \cite[Exercise 5.10 \textbf{(b)}]{detnotes}.

\textbf{(c)} This is \cite[Exercise 5.17 \textbf{(d)}]{detnotes}.

\textbf{(d)} This is \cite[Proposition 5.15 \textbf{(c)}]{detnotes}.

\textbf{(e)} This is \cite[Proposition 5.28]{detnotes}.

\textbf{(f)} This is \cite[Proposition 5.15 \textbf{(d)}]{detnotes}.

\textbf{(g)} This is \cite[Exercise 5.13 \textbf{(c)}]{detnotes}.

\textbf{(h)} This is \cite[Exercise 5.13 \textbf{(a)}]{detnotes}.
\end{proof}

\begin{definition}
Let $n\in\mathbb{N}$. A permutation $\sigma\in S_{n}$ is said to be

\begin{itemize}
\item \textbf{even} if $\left(  -1\right)  ^{\sigma}=1$ (that is, if
$\ell\left(  \sigma\right)  $ is even);

\item \textbf{odd} if $\left(  -1\right)  ^{\sigma}=-1$ (that is, if
$\ell\left(  \sigma\right)  $ is odd).
\end{itemize}
\end{definition}

\begin{corollary}
Let $n\geq2$. Then,%
\[
\left(  \text{\# of even }\sigma\in S_{n}\right)  =\left(  \text{\# of odd
}\sigma\in S_{n}\right)  =n!/2.
\]

\end{corollary}

\begin{proof}
The map%
\begin{align*}
\left\{  \text{even }\sigma\in S_{n}\right\}   &  \rightarrow\left\{
\text{odd }\sigma\in S_{n}\right\}  ,\\
\sigma &  \mapsto\sigma\circ s_{1}%
\end{align*}
is a bijection. (See \cite[Exercise 5.4]{detnotes} for details.)
\end{proof}

\begin{example}
The $15$-game%
\[%
\begin{array}
[c]{cccc}%
1 & 2 & 3 & 4\\
5 & 6 & 7 & 8\\
9 & 10 & 11 & 12\\
13 & 15 & 14 &
\end{array}
\longrightarrow%
\begin{array}
[c]{cccc}%
1 & 2 & 3 & 4\\
5 & 6 & 7 & 8\\
9 & 10 & 11 & 12\\
13 & 14 & 15 &
\end{array}
\]
(via swaps of the empty cell with the neighboring square (\textquotedblleft
slides\textquotedblright)) is unsolvable.

Why?

\textbf{Proof sketch.}

\textbf{(a)} Let us first consider the $3\times3$-analogue:%
\[%
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
4 & 5 & 6\\
8 & 7 &
\end{array}
\longrightarrow%
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
4 & 5 & 6\\
7 & 8 &
\end{array}
.
\]
This is also impossible.

\textbf{Proof:} For each position $P$, let $\sigma_{P}$ be the permutation of
$\left[  8\right]  $ whose one-line notation is what you get if you read $P$
row by row from left to right.%
\[
P=%
\begin{array}
[c]{ccc}%
a & b & c\\
d & e & \\
f & g & h
\end{array}
\mapsto\sigma_{P}=\left(  a,b,c,d,e,f,g,h\right)  \text{ (in one-line
notation).}%
\]
Now, a slide changes $\sigma_{P}$ \textbf{either} not at all \textbf{or} by
multiplying it with a $\underbrace{3\text{-cycle}}%
_{\substack{\operatorname*{cyc}\nolimits_{p,q,r}\\\text{for some }p,q,r}}$
(that is, $\sigma_{P}$ becomes $\sigma_{P}\circ\operatorname*{cyc}%
\nolimits_{p,q,r}$). Thus, the sign of $\sigma_{P}$ never changes (since
$3$-cycles have sign $1$). Thus, the $3\times3$-game is unsolvable (since the
initial position and the target position have different signs of $\sigma_{P}$).

\textbf{(b)} Now to the $4\times4$-version.

The sign of $\sigma_{P}$ is no longer invariant. Instead, every vertical slide
flips the sign of $\sigma_{P}$. Therefore,%
\[
\left(  -1\right)  ^{\sigma_{P}}\cdot\left(  -1\right)  ^{\text{which row has
an empty square}}%
\]
is invariant. This again proves that the game is unsolvable, because the
initial and target positions have different values of this invariant.
\end{example}

\begin{remark}
For any $n\in\mathbb{N}$, the set of all even permutations $\sigma\in S_{n}$
is called the \textbf{alternating group} $A_{n}$.
\end{remark}

\begin{center}
\fbox{\textbf{2019-12-04 notes}}
\end{center}

\section{Lattice paths (brief introduction)}

We shall say a few words about lattice paths. See \cite[Chapter 6]{18f} for
more, and see \cite{Kratte17} for much more.

\begin{definition}
The \textbf{integer lattice} (or, for short, \textbf{lattice}) is the set
$\mathbb{Z}^{2}=\mathbb{Z}\times\mathbb{Z}$.

Its elements are called \textbf{points}; indeed, any element $\left(
a,b\right)  \in\mathbb{Z}^{2}$ can be identified with the point with
coordinates $a$ and $b$ on the plane.

Points can be added and subtracted entrywise: e.g.,%
\[
\left(  a,b\right)  -\left(  c,d\right)  =\left(  a-c,b-d\right)  .
\]


If $\left(  a,b\right)  \in\mathbb{Z}^{2}$ and $\left(  c,d\right)
\in\mathbb{Z}^{2}$ are two points, then a \textbf{lattice path} (for short,
\textbf{LP}) from $\left(  a,b\right)  $ to $\left(  c,d\right)  $ means

\begin{itemize}
\item (informally) a path from $\left(  a,b\right)  $ to $\left(  c,d\right)
$ that uses only $2$ kinds of steps:

\begin{itemize}
\item \textquotedblleft up-steps\textquotedblright\ ($U$) going $\left(
p,q\right)  \mapsto\left(  p,q+1\right)  $;

\item \textquotedblleft right-steps\textquotedblright\ ($R$) going $\left(
p,q\right)  \mapsto\left(  p+1,q\right)  $.
\end{itemize}

\item (rigorously) a tuple $\left(  v_{0},v_{1},\ldots,v_{n}\right)  $ of
points $v_{i}\in\mathbb{Z}^{2}$ such that%
\begin{align*}
v_{0}  &  =\left(  a,b\right)  \ \ \ \ \ \ \ \ \ \ \text{and}%
\ \ \ \ \ \ \ \ \ \ v_{n}=\left(  c,d\right)  \ \ \ \ \ \ \ \ \ \ \\
\text{and}\ \ \ \ \ \ \ \ \ \ v_{i}-v_{i-1}  &  \in\left\{
\underbrace{\left(  0,1\right)  }_{\text{up-step}},\ \ \underbrace{\left(
1,0\right)  }_{\text{right-step}}\right\}  \ \ \ \ \ \ \ \ \ \ \text{for each
}i\in\left[  n\right]  .
\end{align*}

\end{itemize}
\end{definition}

\begin{example}
The following picture shows an LP from $\left(  0,0\right)  $ to $\left(
5,3\right)  $:%
\[%
%TCIMACRO{\TeXButton{tikz RURRRUUR lattice path}{\begin{tikzpicture}
%\draw[help lines] (-0.2, -0.2) grid (5.2, 3.2);
%\draw
%[line width=2pt,-stealth] (0, 0) edge (1, 0) (1, 0) edge (1, 1) (1, 1) edge (2, 1) (2, 1) edge (3, 1) (3, 1) edge (4, 1) (4, 1) edge (4, 2) (4, 2) edge (4, 3) (4, 3) edge (5, 3);
%\end{tikzpicture}}}%
%BeginExpansion
\begin{tikzpicture}
\draw[help lines] (-0.2, -0.2) grid (5.2, 3.2);
\draw
[line width=2pt,-stealth] (0, 0) edge (1, 0) (1, 0) edge (1, 1) (1, 1) edge (2, 1) (2, 1) edge (3, 1) (3, 1) edge (4, 1) (4, 1) edge (4, 2) (4, 2) edge (4, 3) (4, 3) edge (5, 3);
\end{tikzpicture}%
%EndExpansion
\]
Formally speaking, this LP is the $9$-tuple%
\[
\left(  \left(  0,0\right)  ,\left(  1,0\right)  ,\left(  1,1\right)  ,\left(
2,1\right)  ,\left(  3,1\right)  ,\left(  4,1\right)  ,\left(  4,2\right)
,\left(  4,3\right)  ,\left(  5,3\right)  \right)  .
\]
Its \textquotedblleft step sequence\textquotedblright\ (i.e., the sequence of
the directions of its steps) is $RURRRUUR$ (meaning that its first step is a
right-step, its second step is an up-step, its third step is a right-step, and
so on).
\end{example}

Note that any LP is uniquely determined by its starting point and its
\textquotedblleft step sequence\textquotedblright.

\begin{proposition}
Let $\left(  a,b\right)  \in\mathbb{Z}^{2}$ and $\left(  c,d\right)
\in\mathbb{Z}^{2}$ be two points. Then,%
\[
\left(  \text{\# of LPs from }\left(  a,b\right)  \text{ to }\left(
c,d\right)  \right)  =%
\begin{cases}
\dbinom{c+d-a-b}{c-a}, & \text{if }c+d\geq a+b;\\
0, & \text{if }c+d<a+b
\end{cases}
.
\]

\end{proposition}

\begin{proof}
In each LP, the x-coordinates of the points weakly increase at each step, and
so do the y-coordinates. Thus, LPs from $\left(  a,b\right)  $ to $\left(
c,d\right)  $ can only exist when $c\geq a$ and $d\geq b$.

Furthermore, each step of a LP increases%
\[
\left(  \text{x-coordinate}\right)  +\left(  \text{y-coordinate}\right)
\]
by exactly $1$ (in the sense that if $\left(  x_{i},y_{i}\right)  $ and
$\left(  x_{i+1},y_{i+1}\right)  $ are two consecutive points on an LP, then
$x_{i+1}+y_{i+1}=\left(  x_{i}+y_{i}\right)  +1$). Hence, each LP $\left(
v_{0},v_{1},\ldots,v_{n}\right)  $ from $\left(  a,b\right)  $ to $\left(
c,d\right)  $ must have $n=c+d-a-b$. Thus, if $c+d<a+b$, then the \# of LPs
from $\left(  a,b\right)  $ to $\left(  c,d\right)  $ is $0$. Otherwise, the
bijection%
\begin{align*}
\left\{  \text{LPs from }\left(  a,b\right)  \text{ to }\left(  c,d\right)
\right\}   &  \rightarrow\left\{  \left(  c-a\right)  \text{-element subsets
of }\left[  c+d-a-b\right]  \right\}  ,\\
\left(  v_{0},v_{1},\ldots,v_{n}\right)   &  \mapsto\left\{  i\in\left[
n\right]  \ \mid\ v_{i}-v_{i-1}=\left(  1,0\right)  \right\}
\end{align*}
shows that the \# of LPs is $\dbinom{c+d-a-b}{c-a}$.
\end{proof}

\begin{definition}
Let $\mathbf{v}=\left(  v_{0},v_{1},\ldots,v_{n}\right)  $ be a LP from
$\left(  a,b\right)  $ to $\left(  c,d\right)  $. Let $p\in\mathbb{Z}^{2}$. We
say that $p\in\mathbf{v}$ (in words: $p$ \textbf{lies on }$\mathbf{v}$) if
$p\in\left\{  v_{0},v_{1},\ldots,v_{n}\right\}  $.
\end{definition}

\begin{exercise}
Find the \# of LPs $\mathbf{v}$ from $\left(  0,0\right)  $ to $\left(
6,6\right)  $ such that $\left(  2,2\right)  \in\mathbf{v}$.
\end{exercise}

\begin{proof}
(Solution sketch.) Each such $\mathbf{v}$ consists of a LP from $\left(
0,0\right)  $ to $\left(  2,2\right)  $ and a LP from $\left(  2,2\right)  $
to $\left(  6,6\right)  $. Thus, the product rule yields%
\begin{align*}
&  \left(  \text{\# of LPs }\mathbf{v}\text{ from }\left(  0,0\right)  \text{
to }\left(  6,6\right)  \text{ such that }\left(  2,2\right)  \in
\mathbf{v}\right) \\
&  =\underbrace{\left(  \text{\# of LPs from }\left(  0,0\right)  \text{ to
}\left(  2,2\right)  \right)  }_{=\dbinom{2+2-0-0}{2-0}}\cdot
\underbrace{\left(  \text{\# of LPs from }\left(  2,2\right)  \text{ to
}\left(  6,6\right)  \right)  }_{=\dbinom{6+6-2-2}{6-2}}.
\end{align*}

\end{proof}

We shall now introduce a special class of LPs:

\begin{definition}
A LP $\mathbf{v}$ is said to be \textbf{Catalan} if $x\geq y$ for each
$\left(  x,y\right)  \in\mathbf{v}$.

(Visually, this means that $\mathbf{v}$ never strays above the diagonal $x=y$.)
\end{definition}

(In \cite{18f}, I say \textquotedblleft legal\textquotedblright\ instead of
\textquotedblleft Catalan\textquotedblright.)

\begin{example}
The following picture shows a Catalan LP from $\left(  0,0\right)  $ to
$\left(  4,4\right)  $:%
\[%
%TCIMACRO{\TeXButton{tikz RURRUURU catalan path}{\begin{tikzpicture}
%\fill[cyan!25] (-0.2, -0.2) -- (4.2, 4.2) -- (4.2, -0.2) -- cycle;
%\draw[help lines] (-0.2, -0.2) grid (4.2, 4.2);
%\draw
%[line width=2pt,-stealth] (0, 0) edge (1, 0) (1, 0) edge (1, 1) (1, 1) edge (2, 1) (2, 1) edge (3, 1) (3, 1) edge (3, 2) (3, 2) edge (3, 3) (3, 3) edge (4, 3) (4, 3) edge (4, 4);
%\end{tikzpicture}}}%
%BeginExpansion
\begin{tikzpicture}
\fill[cyan!25] (-0.2, -0.2) -- (4.2, 4.2) -- (4.2, -0.2) -- cycle;
\draw[help lines] (-0.2, -0.2) grid (4.2, 4.2);
\draw
[line width=2pt,-stealth] (0, 0) edge (1, 0) (1, 0) edge (1, 1) (1, 1) edge (2, 1) (2, 1) edge (3, 1) (3, 1) edge (3, 2) (3, 2) edge (3, 3) (3, 3) edge (4, 3) (4, 3) edge (4, 4);
\end{tikzpicture}%
%EndExpansion
\ \ .
\]
(Here, the region shaded cyan is the set of all $\left(  x,y\right)
\in\mathbb{R}^{2}$ satisfying $x\geq y$; this is the region in which a Catalan
LP must stay.)

The following LP from $\left(  0,0\right)  $ to $\left(  4,4\right)  $ is
\textbf{not} Catalan:%
\[%
%TCIMACRO{\TeXButton{tikz RUURRRUU non-catalan path}{\begin{tikzpicture}
%\fill[cyan!25] (-0.2, -0.2) -- (4.2, 4.2) -- (4.2, -0.2) -- cycle;
%\draw[help lines] (-0.2, -0.2) grid (4.2, 4.2);
%\draw
%[line width=2pt,-stealth] (0, 0) edge (1, 0) (1, 0) edge (1, 1) (1, 1) edge (1, 2) (1, 2) edge (2, 2) (2, 2) edge (3, 2) (3, 2) edge (4, 2) (4, 2) edge (4, 3) (4, 3) edge (4, 4);
%\end{tikzpicture}}}%
%BeginExpansion
\begin{tikzpicture}
\fill[cyan!25] (-0.2, -0.2) -- (4.2, 4.2) -- (4.2, -0.2) -- cycle;
\draw[help lines] (-0.2, -0.2) grid (4.2, 4.2);
\draw
[line width=2pt,-stealth] (0, 0) edge (1, 0) (1, 0) edge (1, 1) (1, 1) edge (1, 2) (1, 2) edge (2, 2) (2, 2) edge (3, 2) (3, 2) edge (4, 2) (4, 2) edge (4, 3) (4, 3) edge (4, 4);
\end{tikzpicture}%
%EndExpansion
\ \ .
\]

\end{example}

\begin{definition}
If $n,m\in\mathbb{Z}$, then we set%
\[
L_{n,m}=\left(  \text{\# of Catalan LPs from }\left(  0,0\right)  \text{ to
}\left(  n,m\right)  \right)  .
\]

\end{definition}

\begin{proposition}
\textbf{(a)} We have $L_{n,m}=L_{n-1,m}+L_{n,m-1}$ for any $n\in\mathbb{Z}$
and $m\in\mathbb{Z}$ satisfying $n\geq m$ and $\left(  n,m\right)  \neq\left(
0,0\right)  $.

\textbf{(b)} If $n\in\mathbb{N}$ and $m\in\mathbb{N}$ satisfy $n<m$, then
$L_{n,m}=0$.

\textbf{(c)} If $n\in\mathbb{N}$ and $m\in\mathbb{N}$ satisfy $n\geq m-1$,
then%
\[
L_{n,m}=\dbinom{n+m}{m}-\dbinom{n+m}{m-1}.
\]


\textbf{(d)} If $n\in\mathbb{N}$ and $m\in\mathbb{N}$ satisfy $n\geq m-1$,
then%
\[
L_{n,m}=\dfrac{n+1-m}{n+1}\dbinom{n+m}{m}.
\]


\textbf{(e)} For any $n\in\mathbb{N}$, we have%
\[
L_{n,n}=\dfrac{1}{n+1}\dbinom{2n}{n}.
\]

\end{proposition}

\begin{proof}
Main idea: Recall the notion of \textquotedblleft upsided
tuples\textquotedblright\ from MT3 exercise 4. There is a bijection%
\begin{align*}
&  \left\{  \text{Catalan LPs from }\left(  0,0\right)  \text{ to }\left(
n,m\right)  \right\} \\
&  \rightarrow\left\{  \text{upsided }\left(  n+m\right)  \text{-tuples
}\left(  i_{1},i_{2},\ldots,i_{n+m}\right)  \text{ with }i_{1}+i_{2}%
+\cdots+i_{n+m}=n\right\}  ,\\
\left(  v_{0},v_{1},\ldots,v_{n+m}\right)   &  \mapsto\left(  i_{1}%
,i_{2},\ldots,i_{n+m}\right)  ,\ \ \ \ \ \ \ \ \ \ \text{where }i_{k}=\left[
v_{k}-v_{k-1}=\left(  1,0\right)  \right]  .
\end{align*}
Thus, the claims of \textbf{(b)} and \textbf{(c)} follow from MT3 exercise 4.
The claim of \textbf{(d)} follows by simple algebra from \textbf{(c)}. The
claim of \textbf{(e)} follows by applying \textbf{(d)} to $m=n$. The claim of
\textbf{(a)} follows by looking at the last step of a Catalan LP.
\end{proof}

\begin{definition}
For any $n\in\mathbb{N}$, the number $L_{n,n}=\dfrac{1}{n+1}\dbinom{2n}%
{n}=\dbinom{2n}{n}-\dbinom{2n}{n-1}$ is called the $n$\textbf{-th Catalan
number} and is denoted by $C_{n}$.
\end{definition}

A whole book (\cite{Stanle15}) has been written about Catalan numbers. A few
other places where they appear are:

\begin{itemize}
\item Let us say that a permutation $\sigma\in S_{n}$ is \textbf{123-avoiding}
if there exist no $i<j<k$ in $\left[  n\right]  $ such that $\sigma\left(
i\right)  <\sigma\left(  j\right)  <\sigma\left(  k\right)  $. Then, the \# of
123-avoiding permutations $\sigma\in S_{n}$ is $C_{n}$.

\item Consider all possible ways to fully parenthesize a given expression
$a_{1}+a_{2}+\cdots+a_{n}$. For example, for $n=4$, these are%
\begin{align*}
&  \left(  a_{1}+a_{2}\right)  +\left(  a_{3}+a_{4}\right)
,\ \ \ \ \ \ \ \ \ \ \left(  a_{1}+\left(  a_{2}+a_{3}\right)  \right)
+a_{4},\\
&  a_{1}+\left(  \left(  a_{2}+a_{3}\right)  +a_{4}\right)
,\ \ \ \ \ \ \ \ \ \ a_{1}+\left(  a_{2}+\left(  a_{3}+a_{4}\right)  \right)
,\\
&  \left(  \left(  a_{1}+a_{2}\right)  +a_{3}\right)  +a_{4}.
\end{align*}
For any $n\in\mathbb{N}$, there are $C_{n-1}$ ways to do this.

\item Fix an $n\geq3$, and a convex $n$-gon $G_{n}$. How many ways are there
to triangulate $G_{n}$ (i.e., to subdivide $G_{n}$ into triangles whose
vertices are vertices of $G_{n}$) ?

The answer is $C_{n-2}$.
\end{itemize}

There are several variations on Catalan numbers and Catalan LPs, such as
$r$\textbf{-Catalan numbers}.

\section{Generating functions (introduction)}

We have already seen a few generating functions. Here are two more examples.

\textbf{Basic idea:} Any sequence $\left(  a_{0},a_{1},a_{2},\ldots\right)  $
of numbers gives rise to a \textquotedblleft power series\textquotedblright%
\ $a_{0}+a_{1}x+a_{2}x^{2}+a_{3}x^{3}+\cdots$, called its \textquotedblleft%
\textbf{generating function}\textquotedblright. What exactly it is is a
question that would take us a while (see \cite[Chapter 7 (in the 1st
edition)]{Loehr-BC} or \cite{Niven69} or \cite[Chapter 7]{19s}), but let us
just calculate with these generating functions as if they were polynomials in
$x$. (Of course, they are not literally polynomials in $x$, since they can
have infinitely many nonzero coefficients.)

\textbf{Example 1.} Recall the Fibonacci sequence $\left(  f_{0},f_{1}%
,f_{2},\ldots\right)  $ with%
\[
f_{0}=0,\ \ \ \ \ \ \ \ \ \ f_{1}=1,\ \ \ \ \ \ \ \ \ \ f_{n}=f_{n-1}%
+f_{n-2}.
\]


Consider its gf (= generating function)%
\begin{align*}
F\left(  x\right)   &  =f_{0}+f_{1}x+f_{2}x^{2}+\cdots\\
&  =0+1x+1x^{2}+2x^{3}+3x^{4}+5x^{5}+8x^{6}+\cdots.
\end{align*}
Then,%
\begin{align*}
F\left(  x\right)   &  =f_{0}+f_{1}x+f_{2}x^{2}+f_{3}x^{3}+f_{4}x^{4}+\cdots\\
&  =\underbrace{0+1x}_{=x}+\underbrace{\left(  f_{1}+f_{0}\right)
x^{2}+\left(  f_{2}+f_{1}\right)  x^{3}+\left(  f_{3}+f_{2}\right)
x^{4}+\cdots}_{\substack{=\left(  f_{1}x^{2}+f_{2}x^{3}+f_{3}x^{4}%
+\cdots\right)  \\+\left(  f_{0}x^{2}+f_{1}x^{3}+f_{2}x^{4}+\cdots\right)
}}\\
&  =x+\underbrace{\left(  f_{1}x^{2}+f_{2}x^{3}+f_{3}x^{4}+\cdots\right)
}_{\substack{=f_{0}x+f_{1}x^{2}+f_{2}x^{3}+f_{3}x^{4}+\cdots\\\text{(since
}f_{0}=0\text{)}}}+\left(  f_{0}x^{2}+f_{1}x^{3}+f_{2}x^{4}+\cdots\right) \\
&  =x+\underbrace{\left(  f_{0}x+f_{1}x^{2}+f_{2}x^{3}+f_{3}x^{4}%
+\cdots\right)  }_{=xF\left(  x\right)  }+\underbrace{\left(  f_{0}x^{2}%
+f_{1}x^{3}+f_{2}x^{4}+\cdots\right)  }_{=x^{2}F\left(  x\right)  }\\
&  =x+xF\left(  x\right)  +x^{2}F\left(  x\right)  .
\end{align*}
Solving this equation for $F\left(  x\right)  $, we get%
\[
F\left(  x\right)  =\dfrac{x}{1-x-x^{2}}=\dfrac{x}{\left(  1-\phi x\right)
\left(  1-\psi x\right)  }%
\]
where $\phi=\dfrac{1+\sqrt{5}}{2}$ and $\psi=\dfrac{1-\sqrt{5}}{2}$ are the
\textquotedblleft golden ratios\textquotedblright. Applying partial fraction
decomposition to the RHS, we obtain%
\[
F\left(  x\right)  =\dfrac{x}{\left(  1-\phi x\right)  \left(  1-\psi
x\right)  }=\dfrac{1}{\sqrt{5}}\cdot\dfrac{1}{1-\phi x}-\dfrac{1}{\sqrt{5}%
}\cdot\dfrac{1}{1-\psi x}.
\]


Now, what are the coefficients of $\dfrac{1}{1-\alpha x}$ for $\alpha
\in\mathbb{C}$ ?

Well:%
\[
\dfrac{1}{1-x}=1+x+x^{2}+x^{3}+\cdots,
\]
because
\begin{align*}
&  \left(  1-x\right)  \left(  1+x+x^{2}+x^{3}+\cdots\right) \\
&  =\left(  1+x+x^{2}+x^{3}+\cdots\right)  -x\left(  1+x+x^{2}+x^{3}%
+\cdots\right) \\
&  =\left(  1+x+x^{2}+x^{3}+\cdots\right)  -\left(  x+x^{2}+x^{3}%
+\cdots\right)  =1.
\end{align*}
If we substitute $\alpha x$ for $x$ here, we obtain%
\begin{align*}
\dfrac{1}{1-\alpha x}  &  =1+\alpha x+\left(  \alpha x\right)  ^{2}+\left(
\alpha x\right)  ^{3}+\cdots\\
&  =1+\alpha x+\alpha^{2}x^{2}+\alpha^{3}x^{3}+\cdots.
\end{align*}
Thus, our formula for $F\left(  x\right)  $ becomes
\begin{align*}
F\left(  x\right)   &  =\dfrac{1}{\sqrt{5}}\cdot\dfrac{1}{1-\phi x}-\dfrac
{1}{\sqrt{5}}\cdot\dfrac{1}{1-\psi x}\\
&  =\dfrac{1}{\sqrt{5}}\cdot\left(  1+\phi x+\phi^{2}x^{2}+\phi^{3}%
x^{3}+\cdots\right)  -\dfrac{1}{\sqrt{5}}\cdot\left(  1+\psi x+\psi^{2}%
x^{2}+\psi^{3}x^{3}+\cdots\right) \\
&  =\dfrac{1-1}{\sqrt{5}}+\dfrac{\phi-\psi}{\sqrt{5}}x+\dfrac{\phi^{2}%
-\psi^{2}}{\sqrt{5}}x^{2}+\dfrac{\phi^{3}-\psi^{3}}{\sqrt{5}}x^{3}+\cdots.
\end{align*}
Now, comparing coefficients before $x^{n}$, we get
\[
f_{n}=\dfrac{\phi^{n}-\psi^{n}}{\sqrt{5}}\ \ \ \ \ \ \ \ \ \ \text{for each
}n\in\mathbb{N}.
\]
This is exactly Binet's formula. Unlike the first time we saw it, we now have
a motivated \textquotedblleft proof\textquotedblright\ of it.

However, of course, this is only a proof if we can explain

\begin{itemize}
\item what a power series is;

\item what $x$ is;

\item why we can divide by power series like $1-x-x^{2}$;

\item why we can substitute $\alpha x$ for $x$ into a power series;

\item why we can expand infinite sums;

\item $\ldots$
\end{itemize}

This is done nicely in \cite[Chapter 7 (in the 1st edition)]{Loehr-BC} and
\cite[Chapter 7]{19s} and \cite{21s} and in most detailed textbooks on
abstract algebra.

\cite[Chapter 8]{18f} gives a quick overview. So does \cite{Niven69}. Many
applications are found in \cite{Wilf09}.

\section{\label{chp.sols}Solutions and references to the exercises}

This chapter contains solutions to the exercises not solved in the text, or
references to places where these solutions can be found.

\subsection{Solution to Exercise \ref{exe.odd-factorial}}

Exercise \ref{exe.odd-factorial} appears in \cite[Exercise 1 \textbf{(a)}%
]{17f-hw2s} and in \cite[Exercise 3.2 \textbf{(a)}]{detnotes}. The following
solution is taken from \cite{17f-hw2s}:

\begin{proof}
[Solution to Exercise \ref{exe.odd-factorial}.]We have%
\begin{align*}
\left(  2n\right)  !  &  =1\cdot2\cdot\cdots\cdot\left(  2n\right)
=\prod_{k\in\left\{  1,2,\ldots,2n\right\}  }k=\underbrace{\left(
\prod_{\substack{k\in\left\{  1,2,\ldots,2n\right\}  ;\\k\text{ is even}%
}}k\right)  }_{\substack{=2\cdot4\cdot6\cdot\cdots\cdot\left(  2n\right)
\\=\prod_{i=1}^{n}\left(  2i\right)  \\=2^{n}\prod_{i=1}^{n}i}%
}\underbrace{\left(  \prod_{\substack{k\in\left\{  1,2,\ldots,2n\right\}
;\\k\text{ is odd}}}k\right)  }_{=1\cdot3\cdot5\cdot\cdots\cdot\left(
2n-1\right)  }\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have split the product }\prod_{k\in\left\{  1,2,\ldots
,2n\right\}  }k\text{ into one product}\\
\text{containing all even }k\text{ and one product containing all odd }k
\end{array}
\right) \\
&  =2^{n}\underbrace{\left(  \prod_{i=1}^{n}i\right)  }_{=1\cdot2\cdot
\cdots\cdot n=n!}\cdot\left(  1\cdot3\cdot5\cdot\cdots\cdot\left(
2n-1\right)  \right) \\
&  =2^{n}n!\cdot\left(  1\cdot3\cdot5\cdot\cdots\cdot\left(  2n-1\right)
\right)  .
\end{align*}
Dividing this equality by $2^{n}n!$, we obtain%
\[
\dfrac{\left(  2n\right)  !}{2^{n}n!}=1\cdot3\cdot5\cdot\cdots\cdot\left(
2n-1\right)  =\left(  2n-1\right)  \cdot\left(  2n-3\right)  \cdot\cdots
\cdot1.
\]
This solves Exercise \ref{exe.odd-factorial}.
\end{proof}

\subsection{Solution to Exercise \ref{exe.binom.nn}}

\begin{proof}
[Solution to Exercise \ref{exe.binom.nn}.]Theorem \ref{thm.binom.sym} (applied
to $k=n$) yields
\begin{align*}
\dbinom{n}{n}  &  =\dbinom{n}{n-n}=\dbinom{n}{0}\ \ \ \ \ \ \ \ \ \ \left(
\text{since }n-n=0\right) \\
&  =1\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{eq.exa.binom.small.nC0}%
)}\right)  .
\end{align*}
This solves Exercise \ref{exe.binom.nn}.
\end{proof}

\subsection{Reference to solution to Exercise \ref{exe.iverson-prop}}

Parts \textbf{(a)}, \textbf{(b)}, \textbf{(c)}, \textbf{(d)} and \textbf{(e)}
of Exercise \ref{exe.iverson-prop} appear (with solution) in \cite[Exercise
1]{17f-hw1s} and in \cite[Exercise 3.12]{detnotes}. Thus, it remains to solve
part \textbf{(f)}:

\begin{proof}
[Solution to Exercise \ref{exe.iverson-prop} \textbf{(f)}.]\textbf{(f)} We
shall show that%
\begin{equation}
\left[  \mathcal{A}_{1}\wedge\mathcal{A}_{2}\wedge\cdots\wedge\mathcal{A}%
_{n}\right]  =\left[  \mathcal{A}_{1}\right]  \cdot\left[  \mathcal{A}%
_{2}\right]  \cdot\cdots\cdot\left[  \mathcal{A}_{n}\right]
\label{sol.iverson-prop.f.1}%
\end{equation}
for each $n\in\left\{  0,1,\ldots,k\right\}  $.

[\textit{Proof of (\ref{sol.iverson-prop.f.1}):} We shall prove
(\ref{sol.iverson-prop.f.1}) by induction on $n$:

\textit{Induction base:} The conjunction $\mathcal{A}_{1}\wedge\mathcal{A}%
_{2}\wedge\cdots\wedge\mathcal{A}_{0}$ of no statements is a true statement
(by definition), and thus its truth value is $1$. In other words, $\left[
\mathcal{A}_{1}\wedge\mathcal{A}_{2}\wedge\cdots\wedge\mathcal{A}_{0}\right]
=1$. Comparing this with $\left[  \mathcal{A}_{1}\right]  \cdot\left[
\mathcal{A}_{2}\right]  \cdot\cdots\cdot\left[  \mathcal{A}_{0}\right]
=\left(  \text{empty product}\right)  =1$, we obtain $\left[  \mathcal{A}%
_{1}\wedge\mathcal{A}_{2}\wedge\cdots\wedge\mathcal{A}_{0}\right]  =\left[
\mathcal{A}_{1}\right]  \cdot\left[  \mathcal{A}_{2}\right]  \cdot\cdots
\cdot\left[  \mathcal{A}_{0}\right]  $. In other words,
(\ref{sol.iverson-prop.f.1}) holds for $n=0$. This completes the induction base.

\textit{Induction step:} Let $m\in\left\{  0,1,\ldots,k\right\}  $ be
positive. Assume that (\ref{sol.iverson-prop.f.1}) holds for $n=m-1$. We must
prove that (\ref{sol.iverson-prop.f.1}) holds for $n=m$ as well.

We have assumed that (\ref{sol.iverson-prop.f.1}) holds for $n=m-1$. In other
words, we have%
\[
\left[  \mathcal{A}_{1}\wedge\mathcal{A}_{2}\wedge\cdots\wedge\mathcal{A}%
_{m-1}\right]  =\left[  \mathcal{A}_{1}\right]  \cdot\left[  \mathcal{A}%
_{2}\right]  \cdot\cdots\cdot\left[  \mathcal{A}_{m-1}\right]  .
\]
But the statement $\mathcal{A}_{1}\wedge\mathcal{A}_{2}\wedge\cdots
\wedge\mathcal{A}_{m}$ is equivalent to $\left(  \mathcal{A}_{1}%
\wedge\mathcal{A}_{2}\wedge\cdots\wedge\mathcal{A}_{m-1}\right)
\wedge\mathcal{A}_{m}$\ \ \ \ \footnote{Make sure you understand why this is
true even for $m=1$ ! (In this case, it comes helpful that the conjunction
$\mathcal{A}_{1}\wedge\mathcal{A}_{2}\wedge\cdots\wedge\mathcal{A}_{0}$ of no
statements was defined to be a true statement, so that $\left(  \mathcal{A}%
_{1}\wedge\mathcal{A}_{2}\wedge\cdots\wedge\mathcal{A}_{0}\right)
\wedge\mathcal{A}_{1}$ is equivalent to $\mathcal{A}_{1}$.)}. Hence, Exercise
\ref{exe.iverson-prop} \textbf{(a)} (applied to $\mathcal{A}=\mathcal{A}%
_{1}\wedge\mathcal{A}_{2}\wedge\cdots\wedge\mathcal{A}_{m}$ and $\mathcal{B}%
=\left(  \mathcal{A}_{1}\wedge\mathcal{A}_{2}\wedge\cdots\wedge\mathcal{A}%
_{m-1}\right)  \wedge\mathcal{A}_{m}$) yields%
\begin{align*}
&  \left[  \mathcal{A}_{1}\wedge\mathcal{A}_{2}\wedge\cdots\wedge
\mathcal{A}_{m}\right] \\
&  =\left[  \left(  \mathcal{A}_{1}\wedge\mathcal{A}_{2}\wedge\cdots
\wedge\mathcal{A}_{m-1}\right)  \wedge\mathcal{A}_{m}\right] \\
&  =\underbrace{\left[  \mathcal{A}_{1}\wedge\mathcal{A}_{2}\wedge\cdots
\wedge\mathcal{A}_{m-1}\right]  }_{=\left[  \mathcal{A}_{1}\right]
\cdot\left[  \mathcal{A}_{2}\right]  \cdot\cdots\cdot\left[  \mathcal{A}%
_{m-1}\right]  }\left[  \mathcal{A}_{m}\right] \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Exercise \ref{exe.iverson-prop}
\textbf{(c)}, applied to }\mathcal{A}=\mathcal{A}_{1}\wedge\mathcal{A}%
_{2}\wedge\cdots\wedge\mathcal{A}_{m-1}\text{ and }\mathcal{B}=\mathcal{A}%
_{m}\right) \\
&  =\left(  \left[  \mathcal{A}_{1}\right]  \cdot\left[  \mathcal{A}%
_{2}\right]  \cdot\cdots\cdot\left[  \mathcal{A}_{m-1}\right]  \right)
\cdot\left[  \mathcal{A}_{m}\right] \\
&  =\left[  \mathcal{A}_{1}\right]  \cdot\left[  \mathcal{A}_{2}\right]
\cdot\cdots\cdot\left[  \mathcal{A}_{m}\right]  .
\end{align*}
In other words, (\ref{sol.iverson-prop.f.1}) holds for $n=m$. This completes
the induction step. Thus, the induction proof of (\ref{sol.iverson-prop.f.1})
is complete.]

Now, (\ref{sol.iverson-prop.f.1}) (applied to $n=k$) yields $\left[
\mathcal{A}_{1}\wedge\mathcal{A}_{2}\wedge\cdots\wedge\mathcal{A}_{k}\right]
=\left[  \mathcal{A}_{1}\right]  \cdot\left[  \mathcal{A}_{2}\right]
\cdot\cdots\cdot\left[  \mathcal{A}_{k}\right]  $. This solves Exercise
\ref{exe.iverson-prop} \textbf{(f)}.
\end{proof}

\subsection{Solution to Exercise \ref{exe.binom.NN}}

In order to solve Exercise \ref{exe.binom.NN}, we must prove Lemma
\ref{lem.binom.NN} without using Theorem \ref{thm.binom.comb}. Here is such a proof:

\begin{proof}
[Second proof of Lemma \ref{lem.binom.NN}.]Forget that we fixed $n$ and $k$.
We shall prove Lemma \ref{lem.binom.NN} by induction on $n$:

\textit{Induction base:} For each $k\in\mathbb{Z}$, we have
\begin{align*}
\dbinom{0}{k}  &  =\left[  k=0\right]  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
Lemma \ref{lem.binom.0Ck}}\right) \\
&  \in\left\{  0,1\right\}  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left[
\mathcal{A}\right]  \in\left\{  0,1\right\}  \text{ for any statement
}\mathcal{A}\right) \\
&  \subseteq\mathbb{N}.
\end{align*}
Thus, we have $\dbinom{0}{k}\in\mathbb{N}$ for each $k\in\mathbb{Z}$. In other
words, Lemma \ref{lem.binom.NN} holds for $n=0$. Thus, the induction base is complete.

\textit{Induction step:} Let $m$ be a positive integer. Assume that Lemma
\ref{lem.binom.NN} holds for $n=m-1$. We must prove that Lemma
\ref{lem.binom.NN} holds for $n=m$.

Let $k\in\mathbb{Z}$. Recall that Lemma \ref{lem.binom.NN} holds for $n=m-1$
(by our assumption). Thus, Lemma \ref{lem.binom.NN} (applied to $m-1$ instead
of $n$) yields $\dbinom{m-1}{k}\in\mathbb{N}$. Also, Lemma \ref{lem.binom.NN}
(applied to $m-1$ and $k-1$ instead of $n$ and $k$) yields $\dbinom{m-1}%
{k-1}\in\mathbb{N}$ (because Lemma \ref{lem.binom.NN} holds for $n=m-1$). Now,
Theorem \ref{thm.binom.rec} (applied to $n=m$) yields%
\[
\dbinom{m}{k}=\underbrace{\dbinom{m-1}{k-1}}_{\in\mathbb{N}}%
+\underbrace{\dbinom{m-1}{k}}_{\in\mathbb{N}}\in\mathbb{N}%
\]
(since the sum of two elements of $\mathbb{N}$ is always an element of
$\mathbb{N}$).

Forget that we fixed $k$. We thus have proven that $\dbinom{m}{k}\in
\mathbb{N}$ for each $k\in\mathbb{Z}$. In other words, Lemma
\ref{lem.binom.NN} holds for $n=m$. This completes the induction step. Thus,
the inductive proof of Lemma \ref{lem.binom.NN} is finished.
\end{proof}

\subsection{Reference to solution to Exercise \ref{exe.prop.binom.-1/2Cn}}

Proposition \ref{prop.binom.-1/2Cn} is proved in \cite[Exercise 1
\textbf{(b)}]{17f-hw2s}, in \cite[Exercise 3.2 \textbf{(b)}]{detnotes} and in
\cite[Exercise 3 \textbf{(a)}]{18f-hw3s}.

\subsection{Solution to Exercise \ref{exe.binom.knCk}}

\begin{proof}
[First solution to Exercise \ref{exe.binom.knCk}.]If $n=0$, then Exercise
\ref{exe.binom.knCk} holds\footnote{\textit{Proof.} Assume that $n=0$. Then,
$\sum_{k=0}^{n}k\dbinom{n}{k}=\sum_{k=0}^{0}k\dbinom{0}{k}=0\dbinom{0}{0}=0$.
Comparing this with $\underbrace{n}_{=0}\cdot\,2^{n-1}=0$, we obtain
$\sum_{k=0}^{n}k\dbinom{n}{k}=n\cdot2^{n-1}$. Thus, we have solved Exercise
\ref{exe.binom.knCk} under the assumption that $n=0$.}. Hence, for the rest of
this solution, we can WLOG assume that $n\neq0$. Assume this. Combining
$n\neq0$ with $n\in\mathbb{N}$, we obtain $n\in\left\{  1,2,3,\ldots\right\}
$, so that $n-1\in\mathbb{N}$.

We have%
\begin{align*}
\sum_{k=0}^{n}k\dbinom{n}{k}  &  =\underbrace{0\dbinom{n}{0}}_{=0}+\sum
_{k=1}^{n}k\underbrace{\dbinom{n}{k}}_{\substack{=\dfrac{n}{k}\dbinom
{n-1}{k-1}\\\text{(by Proposition \ref{prop.binom.X-1},}\\\text{applied to
}n\text{ and }k\\\text{instead of }m\text{ and }n\text{)}}%
}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have split off the}\\
\text{addend for }k=0\text{ from the sum}%
\end{array}
\right) \\
&  =\sum_{k=1}^{n}\underbrace{k\cdot\dfrac{n}{k}}_{=n}\dbinom{n-1}{k-1}%
=\sum_{k=1}^{n}n\dbinom{n-1}{k-1}\\
&  =\sum_{k=0}^{n-1}n\dbinom{n-1}{k}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have substituted }k\\
\text{for }k-1\text{ in the sum}%
\end{array}
\right) \\
&  =n\underbrace{\sum_{k=0}^{n-1}\dbinom{n-1}{k}}_{\substack{=2^{n-1}%
\\\text{(by Corollary \ref{cor.binom.2pown},}\\\text{applied to }n-1\text{
instead of }n\text{)}}}\ \ \ \ \ \ \ \ \ \ \left(  \text{by an application of
(\ref{eq.sum.linear2})}\right) \\
&  =n\cdot2^{n-1}.
\end{align*}
This solves Exercise \ref{exe.binom.knCk}.
\end{proof}

\begin{proof}
[Second solution to Exercise \ref{exe.binom.knCk}.]The following solution uses
the same \textquotedblleft Little Gauss\textquotedblright\ trick that you have
seen in the second proof of Theorem \ref{thm.1.10}, except that we are now
using the summation sign. We have%
\begin{align*}
2\cdot\sum_{k=0}^{n}k\dbinom{n}{k}  &  =\sum_{k=0}^{n}k\dbinom{n}{k}%
+\sum_{k=0}^{n}k\dbinom{n}{k}=\sum_{k=0}^{n}k\dbinom{n}{k}+\sum_{k=0}%
^{n}\left(  n-k\right)  \underbrace{\dbinom{n}{n-k}}_{\substack{=\dbinom{n}%
{k}\\\text{(by Theorem \ref{thm.binom.sym})}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have substituted }n-k\text{ for
}k\text{ in the second sum}\right) \\
&  =\sum_{k=0}^{n}k\dbinom{n}{k}+\sum_{k=0}^{n}\left(  n-k\right)  \dbinom
{n}{k}=\sum_{k=0}^{n}\underbrace{\left(  k\dbinom{n}{k}+\left(  n-k\right)
\dbinom{n}{k}\right)  }_{=\left(  k+\left(  n-k\right)  \right)  \dbinom{n}%
{k}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by an application of
(\ref{eq.sum.linear1})}\right) \\
&  =\sum_{k=0}^{n}\underbrace{\left(  k+\left(  n-k\right)  \right)  }%
_{=n}\dbinom{n}{k}=\sum_{k=0}^{n}n\dbinom{n}{k}=n\underbrace{\sum_{k=0}%
^{n}\dbinom{n}{k}}_{\substack{=2^{n}\\\text{(by Corollary
\ref{cor.binom.2pown})}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by an application of
(\ref{eq.sum.linear2})}\right) \\
&  =n\cdot2^{n}.
\end{align*}
Dividing both sides of this equality by $2$, we obtain $\sum_{k=0}^{n}%
k\dbinom{n}{k}=n\cdot\underbrace{2^{n}/2}_{=2^{n-1}}=n\cdot2^{n-1}$. This
solves Exercise \ref{exe.binom.knCk} again.
\end{proof}

Another solution to Exercise \ref{exe.binom.knCk} can be found in Section
\ref{sect.intro.fubini}: The claim of the exercise comes out (as Corollary
\ref{cor.sum.fubini-exam1.cor}) of comparing the results of two different
solutions to Exercise \ref{exe.sum.fubini-exam1}.

\subsection{Solution to Exercise \ref{exe.subsets.2pown}}

In order to solve Exercise \ref{exe.subsets.2pown}, we must prove Theorem
\ref{thm.subsets.2pown}.

\begin{proof}
[First proof of Theorem \ref{thm.subsets.2pown}.]Forget that we fixed $n$ and
$S$.

We proceed by induction on $n$:

\textit{Induction base:} If $S$ is a $0$-element set, then $S=\varnothing$ and
thus%
\begin{align*}
\left(  \#\text{ of subsets of }S\right)   &  =\left(  \#\text{ of subsets of
}\varnothing\right) \\
&  =1\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since the empty set }\varnothing\text{ has only one subset,}\\
\text{namely the empty subset }\varnothing
\end{array}
\right) \\
&  =2^{0}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }2^{0}=1\right)  .
\end{align*}
In other words, for any $0$-element set $S$, we have $\left(  \#\text{ of
subsets of }S\right)  =2^{0}$. Thus, Theorem \ref{thm.subsets.2pown} is proven
for $n=0$. This completes the induction base.

\textit{Induction step:} Let $m\in\mathbb{N}$. Assume (as the induction
hypothesis) that Theorem \ref{thm.subsets.2pown} holds for $n=m$.

Let $S$ be an $\left(  m+1\right)  $-element set. We must prove that%
\[
\left(  \#\text{ of subsets of }S\right)  =2^{m+1}.
\]


The set $S$ is an $\left(  m+1\right)  $-element set; thus, its size is
$\left\vert S\right\vert =m+1\geq1>0$. Hence, the set $S$ is nonempty, i.e.,
there exists a $t\in S$. Fix such a $t$.

Now, we shall call a subset of $S$

\begin{itemize}
\item \textbf{red} if it contains $t$, and

\item \textbf{green} if it does not contain $t$.
\end{itemize}

\noindent Thus, each subset of $S$ is either red or green (but not both at the
same time). Thus, by the sum rule, we have%
\[
\left(  \text{\# of subsets of }S\right)  =\left(  \text{\# of red subsets of
}S\right)  +\left(  \text{\# of green subsets of }S\right)  .
\]
We shall now compute the two addends on the right hand side.

The green subsets of $S$ are the subsets of $S$ that don't contain $t$. In
other words, the green subsets of $S$ are exactly the subsets of
$S\setminus\left\{  t\right\}  $. Hence,%
\begin{equation}
\left(  \text{\# of green subsets of }S\right)  =\left(  \text{\# of subsets
of }S\setminus\left\{  t\right\}  \right)  .
\label{pf.thm.subsets.2pown-1.green1}%
\end{equation}


But $S$ is an $\left(  m+1\right)  $-element set, and thus $S\setminus\left\{
t\right\}  $ is an $m$-element set (since $t\in S$). Hence, our induction
hypothesis shows that Theorem \ref{thm.subsets.2pown} can be applied to $m$
and $S\setminus\left\{  t\right\}  $ instead of $n$ and $S$. We thus obtain
\[
\left(  \text{\# of subsets of }S\setminus\left\{  t\right\}  \right)
=2^{m}.
\]
Hence, (\ref{pf.thm.subsets.2pown-1.green1}) becomes%
\begin{equation}
\left(  \text{\# of green subsets of }S\right)  =\left(  \text{\# of subsets
of }S\setminus\left\{  t\right\}  \right)  =2^{m}.
\label{pf.thm.subsets.2pown-1.green-done}%
\end{equation}


What about the red subsets?

Informally, a similar argument works: The red subsets of $S$ are not exactly
the subsets of $S\setminus\left\{  t\right\}  $, but they \textquotedblleft
correspond to\textquotedblright\ the latter in a specific way. Namely, since
the red subsets of $S$ are required to contain $t$, the only \textquotedblleft
information\textquotedblright\ that a red subset of $S$ really
\textquotedblleft carries\textquotedblright\ is what other elements (other
than $t$) it contains. In other words, each red subset $R$ of $S$
\textquotedblleft corresponds to\textquotedblright\ the subset $R\setminus
\left\{  t\right\}  $ of $S\setminus\left\{  t\right\}  $.

Formally, this can be restated as follows: The map%
\begin{align*}
f:\left\{  \text{red subsets of }S\right\}   &  \rightarrow\left\{
\text{subsets of }S\setminus\left\{  t\right\}  \right\}  ,\\
R  &  \mapsto R\setminus\left\{  t\right\}
\end{align*}
is well-defined and is a bijection.\footnote{This can be showed in the same
way as we proved the corresponding claim in our proof of Theorem
\ref{thm.binom.comb}.} Therefore, the bijection principle (applied to the
bijection $f$) yields%
\[
\left\vert \left\{  \text{red subsets of }S\right\}  \right\vert =\left\vert
\left\{  \text{subsets of }S\setminus\left\{  t\right\}  \right\}  \right\vert
.
\]
In other words,%
\begin{equation}
\left(  \text{\# of red subsets of }S\right)  =\left(  \text{\# of subsets of
}S\setminus\left\{  t\right\}  \right)  . \label{pf.thm.subsets.2pown-1.red1}%
\end{equation}


But $S\setminus\left\{  t\right\}  $ is an $m$-element set. Hence, our
induction hypothesis shows that Theorem \ref{thm.subsets.2pown} can be applied
to $m$ and $S\setminus\left\{  t\right\}  $ instead of $n$ and $S$. We thus
obtain
\[
\left(  \text{\# of subsets of }S\setminus\left\{  t\right\}  \right)
=2^{m}.
\]
Hence, (\ref{pf.thm.subsets.2pown-1.red1}) becomes%
\begin{equation}
\left(  \text{\# of red subsets of }S\right)  =\left(  \text{\# of subsets of
}S\setminus\left\{  t\right\}  \right)  =2^{m}.
\label{pf.thm.subsets.2pown-1.red-done}%
\end{equation}


Now, we can finish our computation of $\left(  \text{\# of subsets of
}S\right)  $ that we started above:%
\begin{align*}
\left(  \text{\# of subsets of }S\right)   &  =\underbrace{\left(  \text{\# of
red subsets of }S\right)  }_{\substack{=2^{m}\\\text{(by
(\ref{pf.thm.subsets.2pown-1.red-done}))}}}+\underbrace{\left(  \text{\# of
green subsets of }S\right)  }_{\substack{=2^{m}\\\text{(by
(\ref{pf.thm.subsets.2pown-1.green-done}))}}}\\
&  =2^{m}+2^{m}=2\cdot2^{m}=2^{m+1}.
\end{align*}


Now, forget that we fixed $S$. We thus have shown that every $\left(
m+1\right)  $-element set $S$ satisfies%
\[
\left(  \text{\# of subsets of }S\right)  =2^{m+1}.
\]
In other words, Theorem \ref{thm.subsets.2pown} holds for $n=m+1$. This
completes the induction step, and thus the proof of Theorem
\ref{thm.subsets.2pown}.
\end{proof}

\subsection{Solution to Exercise \ref{exe.intset.inclist-k}}

In order to solve Exercise \ref{exe.intset.inclist-k}, we need to prove
Proposition \ref{prop.intset.inclist-k}.

\begin{proof}
[Proof of Proposition \ref{prop.intset.inclist-k}.]The set $S$ has size
$\left\vert S\right\vert =m$ (since it is an $m$-element set). Thus, it is
finite. Hence, Proposition \ref{prop.intset.inclist} yields that there exists
a unique tuple $\left(  s_{1},s_{2},\ldots,s_{k}\right)  $ of integers
satisfying $\left\{  s_{1},s_{2},\ldots,s_{k}\right\}  =S$ and $s_{1}%
<s_{2}<\cdots<s_{k}$. Consider this tuple, and denote it by $\left(
t_{1},t_{2},\ldots,t_{p}\right)  $. Thus, $\left(  t_{1},t_{2},\ldots
,t_{p}\right)  $ is the unique tuple of integers satisfying $\left\{
t_{1},t_{2},\ldots,t_{p}\right\}  =S$ and $t_{1}<t_{2}<\cdots<t_{p}$. From
$t_{1}<t_{2}<\cdots<t_{p}$, we conclude that the $p$ numbers $t_{1}%
,t_{2},\ldots,t_{p}$ are distinct. Hence, the set $\left\{  t_{1},t_{2}%
,\ldots,t_{p}\right\}  $ has size $p$. In other words, $\left\vert \left\{
t_{1},t_{2},\ldots,t_{p}\right\}  \right\vert =p$. In view of $\left\{
t_{1},t_{2},\ldots,t_{p}\right\}  =S$, this rewrites as $\left\vert
S\right\vert =p$. Comparing this with $\left\vert S\right\vert =m$, we obtain
$p=m$.

Recall that the tuple $\left(  t_{1},t_{2},\ldots,t_{p}\right)  $ is a
$p$-tuple of integers satisfying $\left\{  t_{1},t_{2},\ldots,t_{p}\right\}
=S$ and $t_{1}<t_{2}<\cdots<t_{p}$. In view of $p=m$, we can rewrite this as
follows: The tuple $\left(  t_{1},t_{2},\ldots,t_{m}\right)  $ is an $m$-tuple
of integers satisfying $\left\{  t_{1},t_{2},\ldots,t_{m}\right\}  =S$ and
$t_{1}<t_{2}<\cdots<t_{m}$. Hence, there exists \textbf{at least one}
$m$-tuple $\left(  s_{1},s_{2},\ldots,s_{m}\right)  $ of integers satisfying
$\left\{  s_{1},s_{2},\ldots,s_{m}\right\}  =S$ and $s_{1}<s_{2}<\cdots<s_{m}$
(namely, the $m$-tuple $\left(  t_{1},t_{2},\ldots,t_{m}\right)  $).
Furthermore, there exists \textbf{at most one} such $m$-tuple $\left(
s_{1},s_{2},\ldots,s_{m}\right)  $\ \ \ \ \footnote{\textit{Proof.} Recall
that $\left(  t_{1},t_{2},\ldots,t_{p}\right)  $ is the \textbf{unique} tuple
$\left(  s_{1},s_{2},\ldots,s_{k}\right)  $ of integers satisfying $\left\{
s_{1},s_{2},\ldots,s_{k}\right\}  =S$ and $s_{1}<s_{2}<\cdots<s_{k}$. Hence,
if $\left(  s_{1},s_{2},\ldots,s_{k}\right)  $ is any tuple of integers
satisfying $\left\{  s_{1},s_{2},\ldots,s_{k}\right\}  =S$ and $s_{1}%
<s_{2}<\cdots<s_{k}$, then $\left(  s_{1},s_{2},\ldots,s_{k}\right)  $ must
equal $\left(  t_{1},t_{2},\ldots,t_{p}\right)  $. Applying this to $k=m$, we
conclude that if $\left(  s_{1},s_{2},\ldots,s_{m}\right)  $ is any $m$-tuple
of integers satisfying $\left\{  s_{1},s_{2},\ldots,s_{m}\right\}  =S$ and
$s_{1}<s_{2}<\cdots<s_{m}$, then $\left(  s_{1},s_{2},\ldots,s_{m}\right)  $
must equal $\left(  t_{1},t_{2},\ldots,t_{p}\right)  $. Thus, there exists
\textbf{at most one} such $m$-tuple $\left(  s_{1},s_{2},\ldots,s_{m}\right)
$.}. Combining the claims of the preceding two sentences, we conclude that
there exists a \textbf{unique} $m$-tuple $\left(  s_{1},s_{2},\ldots
,s_{m}\right)  $ of integers satisfying $\left\{  s_{1},s_{2},\ldots
,s_{m}\right\}  =S$ and $s_{1}<s_{2}<\cdots<s_{m}$. This proves Proposition
\ref{prop.intset.inclist-k}.
\end{proof}

\subsection{Reference to solution to Exercise \ref{exe.subset-OE}}

Exercise \ref{exe.subset-OE} is \cite[Exercise 5]{17f-hw1s}.

\subsection{Reference to solution to Exercise \ref{exe.subset-lacunar-OE}}

Exercise \ref{exe.subset-lacunar-OE} is \cite[Exercise 6]{17f-hw1s}.

\subsection{Reference to solution to Exercise \ref{exe.2lac}}

Exercise \ref{exe.2lac} is \cite[Exercise 3]{17f-hw3s}.

\subsection{Reference to solution to Exercise \ref{exe.ABC}}

Parts \textbf{(a)}, \textbf{(b)} and \textbf{(c)} of Exercise \ref{exe.ABC}
are \cite[Exercise 1]{17f-hw3s}.

Part \textbf{(d)} of Exercise \ref{exe.ABC} is \cite[Exercise 2]{19f-hw2s}.

Part \textbf{(e)} of Exercise \ref{exe.ABC} is \cite[Exercise 2]{19f-mt1s}.

\subsection{Reference to solution to Exercise \ref{exe.if2i}}

Exercise \ref{exe.if2i} is \cite[Exercise 4]{17f-hw3s}.

\subsection{Reference to solution to Exercise \ref{exe.binom.altsum-partial}}

Exercise \ref{exe.binom.altsum-partial} \textbf{(a)} is essentially
\cite[Exercise 4]{18f-hw2s}. (More precisely, \cite[Exercise 4]{18f-hw2s} is
the particular case of Exercise \ref{exe.binom.altsum-partial} \textbf{(a)}
where $n$ is assumed to be a positive integer. However, the first two
solutions to \cite[Exercise 4]{18f-hw2s} apply just as well to the general
case. Only the third solution to \cite[Exercise 4]{18f-hw2s} really requires
$n$ to be a positive integer.)

Let us solve Exercise \ref{exe.binom.altsum-partial} \textbf{(b)} now. In
order to do so, we need to prove Proposition \ref{prop.binom.sum-alt-row} again:

\begin{proof}
[Alternative proof of Proposition \ref{prop.binom.sum-alt-row} using Exercise
\ref{exe.binom.altsum-partial} \textbf{(a)}.]If $n=0$, then
\begin{align*}
\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n}{k}  &  =\sum_{k=0}^{0}\left(
-1\right)  ^{k}\dbinom{0}{k}=\underbrace{\left(  -1\right)  ^{0}}%
_{=1}\underbrace{\dbinom{0}{0}}_{\substack{=1\\\text{(by
(\ref{eq.exa.binom.small.nC0}))}}}=1\\
&  =\left[  n=0\right]  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left[
n=0\right]  =1\text{ (because }n=0\text{)}\right)  .
\end{align*}
Thus, Proposition \ref{prop.binom.sum-alt-row} is proved in the case when
$n=0$. Hence, for the rest of this proof, we WLOG assume that $n\neq0$. Thus,
$\left[  n=0\right]  =0$. Also, $n$ is a positive integer (since
$n\in\mathbb{N}$ and $n\neq0$), and thus $n-1\in\mathbb{N}$. Furthermore,
$n>n-1$. Hence, Proposition \ref{prop.binom.0} (applied to $n-1$ and $n$
instead of $n$ and $k$) yields $\dbinom{n-1}{n}=0$. Now, Exercise
\ref{exe.binom.altsum-partial} \textbf{(a)} (applied to $m=n$) yields%
\[
\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n}{k}=\left(  -1\right)
^{n}\underbrace{\dbinom{n-1}{n}}_{=0}=0=\left[  n=0\right]
\]
(since $\left[  n=0\right]  =0$). This proves Proposition
\ref{prop.binom.sum-alt-row}.
\end{proof}

Thus, Exercise \ref{exe.binom.altsum-partial} \textbf{(b)} is solved.

\subsection{Reference to solution to Exercise \ref{exe.rewr-prod}}

Exercise \ref{exe.rewr-prod} is \cite[Exercise 2]{17f-hw2s}.

\subsection{Solution to Exercise \ref{exe.deprodrule2}}

In order to solve Exercise \ref{exe.deprodrule2}, we need to prove Theorem
\ref{thm.deprodrule2}. Let us now do this:

\begin{proof}
[Proof of Theorem \ref{thm.deprodrule2}.]The set $X\times Y$ is finite (since
$X$ and $Y$ are finite). Thus, the set $S$ is finite (since $S$ is a subset of
$X\times Y$).

The elements of $S$ are pairs $\left(  x,y\right)  \in X\times Y$ with $x\in
X$ and $y\in Y$ (since $S$ is a subset of $X\times Y$). Let $f:S\rightarrow X$
be the map that sends each pair $\left(  x,y\right)  \in S$ to its first entry
$x\in X$. Then, Theorem \ref{thm.sumrule2} (applied to $W=X$) yields%
\begin{equation}
\left\vert S\right\vert =\sum_{w\in X}\left(  \text{\# of }s\in S\text{
satisfying }f\left(  s\right)  =w\right)  . \label{pf.thm.deprodrule2.1}%
\end{equation}


Now, fix $w\in X$. We have assumed that for each $x\in X$, there are precisely
$a_{2}$ many elements $y\in Y$ such that $\left(  x,y\right)  \in S$. Applying
this to $x=w$, we conclude that there are precisely $a_{2}$ many elements
$y\in Y$ such that $\left(  w,y\right)  \in S$. In other words,%
\begin{equation}
\left(  \text{\# of elements }y\in Y\text{ such that }\left(  w,y\right)  \in
S\right)  =a_{2}. \label{pf.thm.deprodrule2.2}%
\end{equation}


We shall next prove that%
\[
\left(  \text{\# of elements }y\in Y\text{ such that }\left(  w,y\right)  \in
S\right)  =\left(  \text{\# of }s\in S\text{ satisfying }f\left(  s\right)
=w\right)  .
\]
Indeed, this will follow from the bijection principle, once we have set up the
appropriate bijections. Let us do this now:

If $y$ is an element of $Y$ satisfying $\left(  w,y\right)  \in S$, then the
pair $\left(  w,y\right)  $ is an $s\in S$ satisfying $f\left(  s\right)  =w$
(since the definition of $f$ yields $f\left(  \left(  w,y\right)  \right)
=w$). Hence, the map%
\begin{align*}
\alpha:\left\{  y\in Y\ \mid\ \left(  w,y\right)  \in S\right\}   &
\rightarrow\left\{  s\in S\ \mid\ f\left(  s\right)  =w\right\}  ,\\
y  &  \mapsto\left(  w,y\right)
\end{align*}
is well-defined.

On the other hand, recall again that the elements of $S$ are pairs $\left(
x,y\right)  \in X\times Y$ with $x\in X$ and $y\in Y$. In other words, they
are pairs $\left(  u,v\right)  \in X\times Y$ with $u\in X$ and $v\in Y$. If
$\left(  u,v\right)  $ is an element $s$ of $S$ satisfying $f\left(  s\right)
=w$, then $v$ is an element $y\in Y$ such that $\left(  w,y\right)  \in
S$\ \ \ \ \footnote{\textit{Proof.} Let $\left(  u,v\right)  $ be an element
$s$ of $S$ satisfying $f\left(  s\right)  =w$. Thus, $\left(  u,v\right)  \in
S$ and $f\left(  \left(  u,v\right)  \right)  =w$. But the definition of $f$
yields $f\left(  \left(  u,v\right)  \right)  =u$, so that $u=f\left(  \left(
u,v\right)  \right)  =w$. Hence, $\left(  u,v\right)  =\left(  w,v\right)  $,
so that $\left(  w,v\right)  =\left(  u,v\right)  \in S$. In other words, $v$
is an element $y\in Y$ such that $\left(  w,y\right)  \in S$.}. Hence, the map%
\begin{align*}
\beta:\left\{  s\in S\ \mid\ f\left(  s\right)  =w\right\}   &  \rightarrow
\left\{  y\in Y\ \mid\ \left(  w,y\right)  \in S\right\}  ,\\
\left(  u,v\right)   &  \mapsto v
\end{align*}
is well-defined.

It is straightforward to see that our maps $\alpha$ and $\beta$ are mutually
inverse\footnote{\textit{Proof.} We need to show that $\alpha\circ
\beta=\operatorname*{id}$ and $\beta\circ\alpha=\operatorname*{id}$. The
second of these two equalities is easy to check; we thus only need to prove
the first one.
\par
Let $s$ be an element of $S$ satisfying $f\left(  s\right)  =w$. Write $s$ in
the form $s=\left(  u,v\right)  $ for some $u\in U$ and $v\in V$. (We can do
this, since every element of $S$ has this form.) Now, $f\left(  s\right)  =w$
rewrites as $f\left(  \left(  u,v\right)  \right)  =w$ (since $s=\left(
u,v\right)  $), so that $w=f\left(  \left(  u,v\right)  \right)  =u$ (by the
definition of $f$). Hence, $\left(  w,v\right)  =\left(  u,v\right)  =s$. But
the definition of $\beta$ yields $\beta\left(  \left(  u,v\right)  \right)
=v$. This rewrites as $\beta\left(  s\right)  =v$ (since $s=\left(
u,v\right)  $). Applying the map $\alpha$ to both sides of this equality, we
obtain%
\begin{align*}
\alpha\left(  \beta\left(  s\right)  \right)   &  =\alpha\left(  v\right)
=\left(  w,v\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of
}\alpha\right) \\
&  =s.
\end{align*}
Thus, $\left(  \alpha\circ\beta\right)  \left(  s\right)  =\alpha\left(
\beta\left(  s\right)  \right)  =s=\operatorname*{id}\left(  s\right)  $.
\par
Forget that we fixed $s$. We thus have showed that $\left(  \alpha\circ
\beta\right)  \left(  s\right)  =\operatorname*{id}\left(  s\right)  $ for
each $s\in S$ satisfying $f\left(  s\right)  =w$. In other words, $\alpha
\circ\beta=\operatorname*{id}$. This completes our proof that $\alpha$ and
$\beta$ are mutually inverse (since $\beta\circ\alpha=\operatorname*{id}$).}.
Thus, $\alpha$ and $\beta$ are bijections. Hence, the bijection principle
yields%
\[
\left\vert \left\{  y\in Y\ \mid\ \left(  w,y\right)  \in S\right\}
\right\vert =\left\vert \left\{  s\in S\ \mid\ f\left(  s\right)  =w\right\}
\right\vert .
\]
In other words,%
\[
\left(  \text{\# of elements }y\in Y\text{ such that }\left(  w,y\right)  \in
S\right)  =\left(  \text{\# of }s\in S\text{ satisfying }f\left(  s\right)
=w\right)  .
\]
Comparing this with (\ref{pf.thm.deprodrule2.2}), we find%
\begin{equation}
\left(  \text{\# of }s\in S\text{ satisfying }f\left(  s\right)  =w\right)
=a_{2}. \label{pf.thm.deprodrule2.5}%
\end{equation}


Now, forget that we fixed $w$. We thus have proved (\ref{pf.thm.deprodrule2.5}%
) for each $w\in X$. Thus, (\ref{pf.thm.deprodrule2.1}) becomes%
\[
\left\vert S\right\vert =\sum_{w\in X}\underbrace{\left(  \text{\# of }s\in
S\text{ satisfying }f\left(  s\right)  =w\right)  }_{\substack{=a_{2}%
\\\text{(by (\ref{pf.thm.deprodrule2.5}))}}}=\sum_{w\in X}a_{2}%
=\underbrace{\left\vert X\right\vert }_{=a_{1}}\cdot\, a_{2}=a_{1}a_{2}.
\]
This proves Theorem \ref{thm.deprodrule2}.
\end{proof}

\subsection{Reference to solution to Exercise \ref{exe.simple-counts}}

Exercise \ref{exe.simple-counts} is \cite[Exercise 3]{17f-hw1s}.

\subsection{Solution to Exercise \ref{exe.binom.trin-rev2}}

In order to solve Exercise \ref{exe.binom.trin-rev2}, we must prove
Proposition \ref{prop.binom.trin-rev2}.

\begin{proof}
[Proof of Proposition \ref{prop.binom.trin-rev2}.]We are in one of the
following three cases:

\textit{Case 1:} We have $b\notin\mathbb{N}$.

\textit{Case 2:} We have $b\in\mathbb{N}$ and $a\notin\mathbb{N}$.

\textit{Case 3:} We have $b\in\mathbb{N}$ and $a\in\mathbb{N}$.

Let us first consider Case 1. In this case, we have $b\notin\mathbb{N}$.
Hence, (\ref{eq.def.binom.def.b}) (applied to $a$ and $b$ instead of $n$ and
$k$) yields $\dbinom{a}{b}=0$. Likewise, (\ref{eq.def.binom.def.b}) (applied
to $n-a+b$ and $b$ instead of $n$ and $k$) yields $\dbinom{n-a+b}{b}=0$. Now,
comparing $\dbinom{n}{a}\underbrace{\dbinom{a}{b}}_{=0}=0$ with $\dbinom
{n}{a-b}\underbrace{\dbinom{n-a+b}{b}}_{=0}=0$, we obtain $\dbinom{n}%
{a}\dbinom{a}{b}=\dbinom{n}{a-b}\dbinom{n-a+b}{b}$. Hence, Proposition
\ref{prop.binom.trin-rev2} is proved in Case 1.

Let us now consider Case 2. In this case, we have $b\in\mathbb{N}$ and
$a\notin\mathbb{N}$. Hence, $a-b\notin\mathbb{N}$ (because if we had
$a-b\in\mathbb{N}$, then we would have $a=\underbrace{\left(  a-b\right)
}_{\in\mathbb{N}}+\underbrace{b}_{\in\mathbb{N}}\in\mathbb{N}$, which would
contradict $a\notin\mathbb{N}$). Thus, (\ref{eq.def.binom.def.b}) (applied to
$k=a-b$) yields $\dbinom{n}{a-b}=0$. Moreover, (\ref{eq.def.binom.def.b})
(applied to $k=a$) yields $\dbinom{n}{a}=0$ (since $a\notin\mathbb{N}$). Now,
comparing $\underbrace{\dbinom{n}{a}}_{=0}\dbinom{a}{b}=0$ with
$\underbrace{\dbinom{n}{a-b}}_{=0}\dbinom{n-a+b}{b}=0$, we obtain $\dbinom
{n}{a}\dbinom{a}{b}=\dbinom{n}{a-b}\dbinom{n-a+b}{b}$. Hence, Proposition
\ref{prop.binom.trin-rev2} is proved in Case 2.

Finally, let us consider Case 3. In this case, we have $b\in\mathbb{N}$ and
$a\in\mathbb{N}$. Therefore, Theorem \ref{thm.binom.sym} (applied to $a$ and
$b$ instead of $n$ and $k$) yields $\dbinom{a}{b}=\dbinom{a}{a-b}$.
Multiplying this equality by $\dbinom{n}{a}$, we find%
\begin{align*}
\dbinom{n}{a}\dbinom{a}{b}  &  =\dbinom{n}{a}\dbinom{a}{a-b}=\dbinom{n}%
{a-b}\dbinom{n-\left(  a-b\right)  }{a-\left(  a-b\right)  }\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.binom.trin-rev}, applied to }a-b\text{ instead of }b\right) \\
&  =\dbinom{n}{a-b}\dbinom{n-a+b}{b}\ \ \ \ \ \ \ \ \ \ \left(  \text{since
}n-\left(  a-b\right)  =n-a+b\text{ and }a-\left(  a-b\right)  =b\right)  .
\end{align*}
Thus, Proposition \ref{prop.binom.trin-rev2} is proved in Case 3.

We have now proved Proposition \ref{prop.binom.trin-rev2} in all three cases
1, 2 and 3. Thus, Proposition \ref{prop.binom.trin-rev2} always holds.
\end{proof}

\subsection{Solution to Exercise \ref{exe.binom.maps-img}}

\begin{proof}
[Solution to Exercise \ref{exe.binom.maps-img}.]\textbf{(a)} Informally
speaking, the claim of Exercise \ref{exe.binom.maps-img} \textbf{(a)} is
obvious: The maps $f:A\rightarrow B$ satisfying $f\left(  A\right)  \subseteq
C$ are \textquotedblleft the same as\textquotedblright\ the maps from $A$ to
$C$, since their values belong to $C$; thus, the \# of the former maps equals
the \# of the latter maps, which is $\left\vert C\right\vert ^{\left\vert
A\right\vert }$ (by Theorem \ref{thm.binom.maps-all}, applied to $C$ instead
of $B$).

But from a rigorous point of view, this argument is not precise; the maps
$f:A\rightarrow B$ satisfying $f\left(  A\right)  \subseteq C$ are not
literally maps from $A$ to $C$, even though their values belong to $C$
(unless, of course, $C=B$). In fact, a map (as defined nowadays)
\textquotedblleft knows\textquotedblright\ what its domain and its codomain
are; thus, two maps with different codomains cannot be equal, even if they
have the same domain and the same value on each element of this domain.

Thus, we need to slightly refine our argument. If $f:A\rightarrow B$ is a map
satisfying $f\left(  A\right)  \subseteq C$, then we can define a map%
\begin{align*}
\left.  f\mid^{C}\right.  :A  &  \rightarrow C,\\
a  &  \mapsto f\left(  a\right)
\end{align*}
(because each $a\in A$ satisfies $f\left(  a\right)  \in f\left(  A\right)
\subseteq C$). This map $f\mid^{C}$ may be called the \emph{corestriction} of
$f$ to $C$. (Unlike a restriction, it has the same domain as $A$ but a
different codomain. Informally, you can think of $f\mid^{C}$ as being the map
$f$ \textquotedblleft wearing a tighter cloak\textquotedblright.) Thus, the
map%
\begin{align}
\left\{  \text{maps }f:A\rightarrow B\text{ satisfying }f\left(  A\right)
\subseteq C\right\}   &  \rightarrow\left\{  \text{maps from }A\text{ to
}C\right\}  ,\nonumber\\
f  &  \mapsto\left.  f\mid^{C}\right.  \label{sol.binom.maps-img.a.1}%
\end{align}
is well-defined. Conversely, if $g$ is any map from $A$ to $C$, then we can
define a map%
\begin{align*}
\left.  g\mid^{B}\right.  :A  &  \rightarrow B,\\
a  &  \mapsto g\left(  a\right)
\end{align*}
(because each $a\in A$ satisfies $g\left(  a\right)  \in C\subseteq B$), and
this map $g\mid^{B}$ is a map $f:A\rightarrow B$ satisfying $f\left(
A\right)  \subseteq C$ (since $\left(  g\mid^{B}\right)  \left(  A\right)
=g\left(  A\right)  \subseteq C$). Thus, the map%
\begin{align}
\left\{  \text{maps from }A\text{ to }C\right\}   &  \rightarrow\left\{
\text{maps }f:A\rightarrow B\text{ satisfying }f\left(  A\right)  \subseteq
C\right\}  ,\nonumber\\
g  &  \mapsto\left.  g\mid^{B}\right.  \label{sol.binom.maps-img.a.2}%
\end{align}
is well-defined. Note that neither of the two maps
(\ref{sol.binom.maps-img.a.1}) and (\ref{sol.binom.maps-img.a.2}) changes the
values of the map they are being applied to; all they change is the codomain.
Thus, it is clear that the two maps (\ref{sol.binom.maps-img.a.1}) and
(\ref{sol.binom.maps-img.a.2}) are mutually inverse; hence, they are
bijections. Thus, the bijection principle yields%
\[
\left\vert \left\{  \text{maps }f:A\rightarrow B\text{ satisfying }f\left(
A\right)  \subseteq C\right\}  \right\vert =\left\vert \left\{  \text{maps
from }A\text{ to }C\right\}  \right\vert .
\]
In other words,%
\[
\left(  \text{\# of maps }f:A\rightarrow B\text{ satisfying }f\left(
A\right)  \subseteq C\right)  =\left(  \text{\# of maps from }A\text{ to
}C\right)  =\left\vert C\right\vert ^{\left\vert A\right\vert }%
\]
(by Theorem \ref{thm.binom.maps-all}, applied to $C$, $\left\vert A\right\vert
$ and $\left\vert C\right\vert $ instead of $B$, $m$ and $n$). This solves
Exercise \ref{exe.binom.maps-img} \textbf{(a)}.

\textbf{(b)} In the above solution to Exercise \ref{exe.binom.maps-img}
\textbf{(a)}, we have defined a map $\left.  f\mid^{C}\right.  :A\rightarrow
C$ for each map $f:A\rightarrow B$ satisfying $f\left(  A\right)  \subseteq
C$. Thus, in particular, the map $\left.  f\mid^{C}\right.  :A\rightarrow C$
is defined for each map $f:A\rightarrow B$ satisfying $f\left(  A\right)  =C$
(because $f\left(  A\right)  =C$ implies $f\left(  A\right)  \subseteq C$).
Moreover, it is easy to see that if $f:A\rightarrow B$ is a map satisfying
$f\left(  A\right)  =C$, then the map $\left.  f\mid^{C}\right.  :A\rightarrow
C$ is surjective (because its image is $\left(  \left.  f\mid^{C}\right.
\right)  \left(  A\right)  =f\left(  A\right)  =C$). Hence, the map
\begin{align}
\left\{  \text{maps }f:A\rightarrow B\text{ satisfying }f\left(  A\right)
=C\right\}   &  \rightarrow\left\{  \text{surjective maps from }A\text{ to
}C\right\}  ,\nonumber\\
f  &  \mapsto\left.  f\mid^{C}\right.  \label{sol.binom.maps-img.b.1}%
\end{align}
is well-defined. Conversely, if $g$ is any surjective map from $A$ to $C$,
then the map $g\mid^{B}$ can be defined as in our above solution to Exercise
\ref{exe.binom.maps-img} \textbf{(a)}; this latter map $g\mid^{B}$ is a map
$f:A\rightarrow B$ satisfying $f\left(  A\right)  =C$ (since $\left(
g\mid^{B}\right)  \left(  A\right)  =g\left(  A\right)  =C$ (because $g$ is
surjective)). Thus, the map%
\begin{align}
\left\{  \text{surjective maps from }A\text{ to }C\right\}   &  \rightarrow
\left\{  \text{maps }f:A\rightarrow B\text{ satisfying }f\left(  A\right)
=C\right\}  ,\nonumber\\
g  &  \mapsto\left.  g\mid^{B}\right.  \label{sol.binom.maps-img.b.2}%
\end{align}
is well-defined. It is easy to see that the two maps
(\ref{sol.binom.maps-img.b.1}) and (\ref{sol.binom.maps-img.b.2}) are mutually
inverse\footnote{Indeed, this can be proven just as in our above solution to
Exercise \ref{exe.binom.maps-img} \textbf{(a)}.}; hence, they are bijections.
Thus, the bijection principle yields%
\[
\left\vert \left\{  \text{maps }f:A\rightarrow B\text{ satisfying }f\left(
A\right)  =C\right\}  \right\vert =\left\vert \left\{  \text{surjective maps
from }A\text{ to }C\right\}  \right\vert .
\]
In other words,%
\[
\left(  \text{\# of maps }f:A\rightarrow B\text{ satisfying }f\left(
A\right)  =C\right)  =\left(  \text{\# of surjective maps from }A\text{ to
}C\right)  .
\]
This solves Exercise \ref{exe.binom.maps-img} \textbf{(b)}.
\end{proof}

\subsection{Solution to Exercise \ref{exe.binom.surmn-rec2}}

\begin{proof}
[Solution to Exercise \ref{exe.binom.surmn-rec2}.]We need to prove the
equalities (\ref{pf.prop.binom.surmn-rec2.red}) and
(\ref{pf.prop.binom.surmn-rec2.green}) rigorously. The equality
(\ref{pf.prop.binom.surmn-rec2.red}) can be proved either using the sum rule
or using the product rule; the equality (\ref{pf.prop.binom.surmn-rec2.green})
can only be proved using the sum rule\footnote{since the options available for
$f\left(  1\right)  ,f\left(  2\right)  ,\ldots,f\left(  m-1\right)  $ in our
proof of (\ref{pf.prop.binom.surmn-rec2.green}) depend on the choice of
$f\left(  m\right)  $}. Thus, in order to be maximally consistent, we shall
prove both equalities using the sum rule.

[\textit{Proof of (\ref{pf.prop.binom.surmn-rec2.red}):} If $f:\left[
m\right]  \rightarrow\left[  n\right]  $ is a red surjection, then $f\left(
m\right)  $ is some element of $\left[  n\right]  $ (since $m\in\left\{
1,2,\ldots,m\right\}  =\left[  m\right]  $). Thus, the sum rule yields%
\begin{align}
&  \left(  \text{\# of red surjections }f:\left[  m\right]  \rightarrow\left[
n\right]  \right) \nonumber\\
&  =\sum_{i\in\left[  n\right]  }\left(  \text{\# of red surjections
}f:\left[  m\right]  \rightarrow\left[  n\right]  \text{ such that }f\left(
m\right)  =i\right)  . \label{pf.prop.binom.surmn-rec2.red.pf.1}%
\end{align}
But let $i\in\left[  n\right]  $. Then, the map%
\begin{align*}
\left\{  \text{red surjections }f:\left[  m\right]  \rightarrow\left[
n\right]  \text{ such that }f\left(  m\right)  =i\right\}   &  \rightarrow
\left\{  \text{surjections from }\left[  m-1\right]  \text{ to }\left[
n\right]  \right\}  ,\\
f  &  \mapsto f\mid_{\left[  m-1\right]  }%
\end{align*}
is well-defined (because if $f:\left[  m\right]  \rightarrow\left[  n\right]
$ is a red surjection, then its restriction $f\mid_{\left[  m-1\right]
}:\left[  m-1\right]  \rightarrow\left[  n\right]  $ is \textquotedblleft
still\textquotedblright\ a surjection), and is a bijection\footnote{Indeed,
its inverse is the map%
\begin{align*}
\left\{  \text{surjections from }\left[  m-1\right]  \text{ to }\left[
n\right]  \right\}   &  \rightarrow\left\{  \text{red surjections }f:\left[
m\right]  \rightarrow\left[  n\right]  \text{ such that }f\left(  m\right)
=i\right\}  ,\\
g  &  \mapsto\left(  \text{the extension of }g\text{ to }\left[  m\right]
\text{ that sends }m\text{ to }i\right)  .
\end{align*}
It is straightforward to see that this is well-defined.}. Thus, the bijection
principle yields%
\begin{align}
&  \left(  \text{\# of red surjections }f:\left[  m\right]  \rightarrow\left[
n\right]  \text{ such that }f\left(  m\right)  =i\right) \nonumber\\
&  =\left(  \text{\# of surjections from }\left[  m-1\right]  \text{ to
}\left[  n\right]  \right) \nonumber\\
&  =\operatorname*{sur}\left(  m-1,n\right)
\label{pf.prop.binom.surmn-rec2.red.pf.2}%
\end{align}
(by (\ref{eq.binom.maps-sur.1}), applied to $m-1$ instead of $m$).

Now, forget that we fixed $i$. Hence, we have proved
(\ref{pf.prop.binom.surmn-rec2.red.pf.2}) for each $i\in\left[  n\right]  $.
Thus, (\ref{pf.prop.binom.surmn-rec2.red.pf.1}) becomes%
\begin{align*}
&  \left(  \text{\# of red surjections }f:\left[  m\right]  \rightarrow\left[
n\right]  \right) \\
&  =\sum_{i\in\left[  n\right]  }\underbrace{\left(  \text{\# of red
surjections }f:\left[  m\right]  \rightarrow\left[  n\right]  \text{ such that
}f\left(  m\right)  =i\right)  }_{\substack{=\operatorname*{sur}\left(
m-1,n\right)  \\\text{(by (\ref{pf.prop.binom.surmn-rec2.red.pf.2}))}}}\\
&  =\sum_{i\in\left[  n\right]  }\operatorname*{sur}\left(  m-1,n\right)
=\underbrace{\left\vert \left[  n\right]  \right\vert }_{=n}\cdot
\operatorname*{sur}\left(  m-1,n\right)  =n\cdot\operatorname*{sur}\left(
m-1,n\right)  .
\end{align*}
This formally proves (\ref{pf.prop.binom.surmn-rec2.red}).]

[\textit{Proof of (\ref{pf.prop.binom.surmn-rec2.green}):} If $f:\left[
m\right]  \rightarrow\left[  n\right]  $ is a green surjection, then $f\left(
m\right)  $ is some element of $\left[  n\right]  $. Thus, the sum rule yields%
\begin{align}
&  \left(  \text{\# of green surjections }f:\left[  m\right]  \rightarrow
\left[  n\right]  \right) \nonumber\\
&  =\sum_{i\in\left[  n\right]  }\left(  \text{\# of green surjections
}f:\left[  m\right]  \rightarrow\left[  n\right]  \text{ such that }f\left(
m\right)  =i\right)  . \label{pf.prop.binom.surmn-rec2.green.pf.1}%
\end{align}
But let $i\in\left[  n\right]  $. Thus, $\left[  n\right]  \setminus\left\{
i\right\}  $ is an $\left(  n-1\right)  $-element set (since $\left[
n\right]  $ is an $n$-element set). Also, $\left[  m-1\right]  $ is an
$\left(  m-1\right)  $-element set. Now, the map\footnote{Here, $f\mid
_{\left[  m-1\right]  }^{\left[  n\right]  \setminus\left\{  i\right\}  }$
means the restriction $f\mid_{\left[  m-1\right]  }$, regarded as a map from
$\left[  m-1\right]  $ to $\left[  n\right]  \setminus\left\{  i\right\}  $.
(This is well-defined, because if $f:\left[  m\right]  \rightarrow\left[
n\right]  $ is a green surjection such that $f\left(  m\right)  =i$, then the
image of $f\mid_{\left[  m-1\right]  }$ is $\left[  n\right]  \setminus
\left\{  i\right\}  $.)}%
\begin{align*}
&  \left\{  \text{green surjections }f:\left[  m\right]  \rightarrow\left[
n\right]  \text{ such that }f\left(  m\right)  =i\right\} \\
&  \rightarrow\left\{  \text{surjections from }\left[  m-1\right]  \text{ to
}\left[  n\right]  \setminus\left\{  i\right\}  \right\}  ,\\
f  &  \mapsto f\mid_{\left[  m-1\right]  }^{\left[  n\right]  \setminus
\left\{  i\right\}  }%
\end{align*}
is well-defined (because if $f:\left[  m\right]  \rightarrow\left[  n\right]
$ is a green surjection, then its restriction $f\mid_{\left[  m-1\right]  }$
has image $\left[  n\right]  \setminus\left\{  i\right\}  $, and thus can be
regarded as a surjective map from $\left[  m-1\right]  $ to $\left[  n\right]
\setminus\left\{  i\right\}  $), and is a bijection\footnote{Indeed, its
inverse is the map%
\begin{align*}
\left\{  \text{surjections from }\left[  m-1\right]  \text{ to }\left[
n\right]  \setminus\left\{  i\right\}  \right\}   &  \rightarrow\left\{
\text{green surjections }f:\left[  m\right]  \rightarrow\left[  n\right]
\text{ such that }f\left(  m\right)  =i\right\}  ,\\
g  &  \mapsto\left(  \text{the extension of }g\text{ to }\left[  m\right]
\text{ that sends }m\text{ to }i\right)  .
\end{align*}
It is straightforward to see that this is well-defined.}. Thus, the bijection
principle yields%
\begin{align}
&  \left(  \text{\# of green surjections }f:\left[  m\right]  \rightarrow
\left[  n\right]  \text{ such that }f\left(  m\right)  =i\right) \nonumber\\
&  =\left(  \text{\# of surjections from }\left[  m-1\right]  \text{ to
}\left[  n\right]  \setminus\left\{  i\right\}  \right) \nonumber\\
&  =\left(  \text{\# of surjective maps from }\left[  m-1\right]  \text{ to
}\left[  n\right]  \setminus\left\{  i\right\}  \right) \nonumber\\
&  =\operatorname*{sur}\left(  m-1,n-1\right)
\label{pf.prop.binom.surmn-rec2.green.pf.2}%
\end{align}
(by Proposition \ref{prop.binom.maps-surj}, applied to $m-1$, $n-1$, $\left[
m-1\right]  $ and $\left[  n\right]  \setminus\left\{  i\right\}  $).

Now, forget that we fixed $i$. Hence, we have proved
(\ref{pf.prop.binom.surmn-rec2.green.pf.2}) for each $i\in\left[  n\right]  $.
Thus, (\ref{pf.prop.binom.surmn-rec2.green.pf.1}) becomes%
\begin{align*}
&  \left(  \text{\# of green surjections }f:\left[  m\right]  \rightarrow
\left[  n\right]  \right) \\
&  =\sum_{i\in\left[  n\right]  }\underbrace{\left(  \text{\# of green
surjections }f:\left[  m\right]  \rightarrow\left[  n\right]  \text{ such that
}f\left(  m\right)  =i\right)  }_{\substack{=\operatorname*{sur}\left(
m-1,n-1\right)  \\\text{(by (\ref{pf.prop.binom.surmn-rec2.green.pf.2}))}}}\\
&  =\sum_{i\in\left[  n\right]  }\operatorname*{sur}\left(  m-1,n-1\right)
=\underbrace{\left\vert \left[  n\right]  \right\vert }_{=n}\cdot
\operatorname*{sur}\left(  m-1,n-1\right)  =n\cdot\operatorname*{sur}\left(
m-1,n-1\right)  .
\end{align*}
This formally proves (\ref{pf.prop.binom.surmn-rec2.green}).]

Thus, Exercise \ref{exe.binom.surmn-rec2} is solved.
\end{proof}

\subsection{Solution to Exercise \ref{exe.binom.surmn-n!}}

In order to solve Exercise \ref{exe.binom.surmn-n!}, we need to prove
Corollary \ref{cor.binom.surmn-n!}.

\begin{proof}
[Proof of Corollary \ref{cor.binom.surmn-n!}.]\textbf{(a)} We shall prove
Corollary \ref{cor.binom.surmn-n!} \textbf{(a)} by induction on $n$:

\textit{Induction base:} Proposition \ref{prop.binom.surm0-etc} \textbf{(a)}
(applied to $m=0$) yields $\operatorname*{sur}\left(  0,0\right)  =\left[
0=0\right]  =1=0!$ (since $0!=1$). In other words, Corollary
\ref{cor.binom.surmn-n!} \textbf{(a)} holds for $n=0$. This completes the
induction base.

\textit{Induction step:} Let $k$ be a positive integer. Assume that Corollary
\ref{cor.binom.surmn-n!} \textbf{(a)} holds for $n=k-1$. We must prove that
Corollary \ref{cor.binom.surmn-n!} \textbf{(a)} holds for $n=k$.

We have assumed that Corollary \ref{cor.binom.surmn-n!} \textbf{(a)} holds for
$n=k-1$. In other words, $\operatorname*{sur}\left(  k-1,k-1\right)  =\left(
k-1\right)  !$.

We have $k-1\in\mathbb{N}$ (since $k$ is a positive integer) and $k-1<k$.
Hence, Proposition \ref{prop.binom.surm0-etc} \textbf{(f)} (applied to $m=k-1$
and $n=k$) yields $\operatorname*{sur}\left(  k-1,k\right)  =0$.

Now, Proposition \ref{prop.binom.surmn-rec2} (applied to $m=k$ and $n=k$)
yields%
\[
\operatorname*{sur}\left(  k,k\right)  =k\cdot\left(
\underbrace{\operatorname*{sur}\left(  k-1,k\right)  }_{=0}%
+\underbrace{\operatorname*{sur}\left(  k-1,k-1\right)  }_{=\left(
k-1\right)  !}\right)  =k\cdot\left(  k-1\right)  !=\left(  k-1\right)  !\cdot
k.
\]
Comparing this with%
\[
k!=\left(  k-1\right)  !\cdot k\ \ \ \ \ \ \ \ \ \ \left(  \text{by
Proposition \ref{prop.factorial.rec}, applied to }n=k\right)  ,
\]
we obtain $\operatorname*{sur}\left(  k,k\right)  =k!$. In other words,
Corollary \ref{cor.binom.surmn-n!} \textbf{(a)} holds for $n=k$. This
completes the induction step. Thus, Corollary \ref{cor.binom.surmn-n!}
\textbf{(a)} is proven by induction.

\textbf{(b)} We shall prove Corollary \ref{cor.binom.surmn-n!} \textbf{(b)} by
induction on $m$:

\textit{Induction base:} It is easy to see that the integer
$\operatorname*{sur}\left(  0,n\right)  $ is a multiple of $n!$ for all
$n\in\mathbb{N}$\ \ \ \ \footnote{\textit{Proof.} Let $n\in\mathbb{N}$. We
need to prove that $\operatorname*{sur}\left(  0,n\right)  $ is a multiple of
$n!$. We have $\operatorname*{sur}\left(  0,n\right)  =\left[  n=0\right]  $
(by Proposition \ref{prop.binom.surm0-etc} \textbf{(d)}, applied to $k=n$).
Hence, if $n\neq0$, then $\operatorname*{sur}\left(  0,n\right)  =\left[
n=0\right]  =0$ (since $n\neq0$) is clearly a multiple of $n!$. Thus, our
proof is complete if $n\neq0$. Hence, for the rest of this proof, we WLOG
assume that $n=0$. Thus, $n!=0!=1$, so that every integer is a multiple of
$n!$. Hence, in particular, $\operatorname*{sur}\left(  0,n\right)  $ is a
multiple of $0!$. Qed.}. In other words, Corollary \ref{cor.binom.surmn-n!}
\textbf{(b)} holds for $m=0$. This completes the induction base.

\textit{Induction step:} Let $k$ be a positive integer. Assume that Corollary
\ref{cor.binom.surmn-n!} \textbf{(b)} holds for $m=k-1$. We must prove that
Corollary \ref{cor.binom.surmn-n!} \textbf{(b)} holds for $m=k$. In other
words, we must prove that the integer $\operatorname*{sur}\left(  k,n\right)
$ is a multiple of $n!$ for all $n\in\mathbb{N}$.

So let $n\in\mathbb{N}$. We must prove that the integer $\operatorname*{sur}%
\left(  k,n\right)  $ is a multiple of $n!$. If $n=0$, then this is
obvious\footnote{\textit{Proof.} Assume that $n=0$. Thus, $n!=0!=1$. Hence,
every integer is a multiple of $n!$. Thus, in particular, $\operatorname*{sur}%
\left(  k,n\right)  $ is a multiple of $n!$.}. Thus, for the rest of this
proof, we WLOG assume that $n\neq0$. Thus, $n$ is a positive integer.
Proposition \ref{prop.binom.surmn-rec2} (applied to $m=k$) thus yields%
\[
\operatorname*{sur}\left(  k,n\right)  =n\cdot\left(  \operatorname*{sur}%
\left(  k-1,n\right)  +\operatorname*{sur}\left(  k-1,n-1\right)  \right)  .
\]
Also, Proposition \ref{prop.factorial.rec} yields $n!=\left(  n-1\right)
!\cdot n$.

But we have assumed that Corollary \ref{cor.binom.surmn-n!} \textbf{(b)} holds
for $m=k-1$. Thus, Corollary \ref{cor.binom.surmn-n!} \textbf{(b)} (applied to
$k-1$ instead of $m$) yields that the integer $\operatorname*{sur}\left(
k-1,n\right)  $ is a multiple of $n!$. Hence, $\operatorname*{sur}\left(
k-1,n\right)  =n!\cdot a$ for some integer $a$. Consider this $a$.

Likewise, Corollary \ref{cor.binom.surmn-n!} \textbf{(b)} (applied to $k-1$
and $n-1$ instead of $m$ and $n$) yields that the integer $\operatorname*{sur}%
\left(  k-1,n-1\right)  $ is a multiple of $\left(  n-1\right)  !$. Hence, we
have $\operatorname*{sur}\left(  k-1,n-1\right)  =\left(  n-1\right)  !\cdot
b$ for some integer $b$. Consider this $b$.

Now,
\begin{align*}
\operatorname*{sur}\left(  k,n\right)   &  =n\cdot\left(
\underbrace{\operatorname*{sur}\left(  k-1,n\right)  }_{=n!\cdot
a}+\underbrace{\operatorname*{sur}\left(  k-1,n-1\right)  }_{=\left(
n-1\right)  !\cdot b}\right)  =n\cdot\left(  n!\cdot a+\left(  n-1\right)
!\cdot b\right) \\
&  =n\cdot n!\cdot a+\underbrace{n\cdot\left(  n-1\right)  !}_{=\left(
n-1\right)  !\cdot n=n!}\cdot\, b=n\cdot n!\cdot a+n!\cdot b=n!\cdot\left(
na+b\right)  .
\end{align*}
This shows that the integer $\operatorname*{sur}\left(  k,n\right)  $ is a
multiple of $n!$.

Forget that we fixed $n$. We thus have shown that the integer
$\operatorname*{sur}\left(  k,n\right)  $ is a multiple of $n!$ for all
$n\in\mathbb{N}$. In other words, Corollary \ref{cor.binom.surmn-n!}
\textbf{(b)} holds for $m=k$. This completes the induction step. Thus,
Corollary \ref{cor.binom.surmn-n!} \textbf{(b)} is proven by induction.
\end{proof}

Thus, Exercise \ref{exe.binom.surmn-n!} is solved.

\subsection{Solution to Exercise \ref{exe.thm.binom.surmn-as-altsum.elpf}}

In order to solve Exercise \ref{exe.thm.binom.surmn-as-altsum.elpf}, we need
to prove Theorem \ref{thm.binom.surmn-as-altsum}. Before we do so, let us
state a simple corollary of the binomial formula:

\begin{corollary}
\label{cor.binom.i+1ton}Let $x\in\mathbb{R}$ and $n\in\mathbb{N}$. Then,%
\[
\left(  x+1\right)  ^{n}-x^{n}=\sum_{j=0}^{n-1}\dbinom{n}{j}x^{j}.
\]

\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.binom.i+1ton}.]Theorem \ref{thm.binom.binom}
(applied to $y=1$) yields%
\begin{align*}
\left(  x+1\right)  ^{n}  &  =\sum_{k=0}^{n}\dbinom{n}{k}x^{k}%
\underbrace{1^{n-k}}_{=1}=\sum_{k=0}^{n}\dbinom{n}{k}x^{k}=\sum_{j=0}%
^{n}\dbinom{n}{j}x^{j}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have renamed the summation index
}k\text{ as }j\right) \\
&  =\sum_{j=0}^{n-1}\dbinom{n}{j}x^{j}+\underbrace{\dbinom{n}{n}%
}_{\substack{=1\\\text{(by Exercise \ref{exe.binom.nn})}}}x^{n}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have split off the addend for
}j=n\text{ from the sum}\right) \\
&  =\sum_{j=0}^{n-1}\dbinom{n}{j}x^{j}+x^{n}.
\end{align*}
Subtracting $x^{n}$ from this equality, we find $\left(  x+1\right)
^{n}-x^{n}=\sum_{j=0}^{n-1}\dbinom{n}{j}x^{j}$. This proves Corollary
\ref{cor.binom.i+1ton}.
\end{proof}

\begin{proof}
[Proof of Theorem \ref{thm.binom.surmn-as-altsum}.]We shall prove Theorem
\ref{thm.binom.surmn-as-altsum} by strong induction over $m$:

\textit{Induction step:} Let $q\in\mathbb{N}$. Assume that Theorem
\ref{thm.binom.surmn-as-altsum} holds for all $m<q$. We must now prove that
Theorem \ref{thm.binom.surmn-as-altsum} holds for $m=q$.

We have assumed that Theorem \ref{thm.binom.surmn-as-altsum} holds for all
$m<q$. In other words, we have%
\begin{equation}
\operatorname*{sur}\left(  m,n\right)  =\sum_{i=0}^{n}\left(  -1\right)
^{n-i}\dbinom{n}{i}i^{m} \label{sol.sur.step.hyp}%
\end{equation}
for every $m\in\mathbb{N}$ and $n\in\mathbb{N}$ satisfying $m<q$.

Now, let $n\in\mathbb{N}$. We are going to prove that%
\begin{equation}
\operatorname*{sur}\left(  q,n\right)  =\sum_{i=0}^{n}\left(  -1\right)
^{n-i}\dbinom{n}{i}i^{q}. \label{sol.sur.step.goal}%
\end{equation}


[\textit{Proof of (\ref{sol.sur.step.goal}):} If $q=0$, then
(\ref{sol.sur.step.goal}) is easy to check\footnote{\textit{Proof.} Assume
that $q=0$. Thus, $\operatorname*{sur}\left(  q,n\right)  =\operatorname*{sur}%
\left(  0,n\right)  =\left[  n=0\right]  $ (by Proposition
\ref{prop.binom.surm0-etc} \textbf{(d)}, applied to $k=n$). Comparing this
with%
\begin{align*}
\sum_{i=0}^{n}\left(  -1\right)  ^{n-i}\dbinom{n}{i}i^{q}  &  =\sum_{i=0}%
^{n}\left(  -1\right)  ^{n-i}\dbinom{n}{i}\underbrace{i^{0}}_{=1}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }q=0\right) \\
&  =\sum_{i=0}^{n}\left(  -1\right)  ^{n-i}\dbinom{n}{i}=\sum_{k=0}^{n}\left(
-1\right)  ^{n-k}\underbrace{\dbinom{n}{k}}_{\substack{=\dbinom{n}%
{n-k}\\\text{(by Theorem \ref{thm.binom.sym})}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have renamed the summation index
}i\text{ as }k\right) \\
&  =\sum_{k=0}^{n}\left(  -1\right)  ^{n-k}\dbinom{n}{n-k}=\sum_{k=0}%
^{n}\left(  -1\right)  ^{k}\dbinom{n}{k}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have substituted }k\\
\text{for }n-k\text{ in the sum}%
\end{array}
\right) \\
&  =\left[  n=0\right]  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.binom.sum-alt-row}}\right)  ,
\end{align*}
we obtain $\operatorname*{sur}\left(  q,n\right)  =\sum_{i=0}^{n}\left(
-1\right)  ^{n-i}\dbinom{n}{i}i^{q}$. Thus, we have proven
(\ref{sol.sur.step.goal}) under the assumption that $q=0$.}. Hence, for the
rest of this proof, we WLOG assume that $q\neq0$. Hence, $q\in\left\{
1,2,3,\ldots\right\}  $ (since $q\in\mathbb{N}$), so that $q>0$. Since
$q\neq0$, we have $\left[  q=0\right]  =0$.

If $n=0$, then (\ref{sol.sur.step.goal}) is also easy to
check\footnote{\textit{Proof.} Assume that $n=0$. Thus, $\operatorname*{sur}%
\left(  q,n\right)  =\operatorname*{sur}\left(  q,0\right)  =\left[
q=0\right]  $ (by Proposition \ref{prop.binom.surm0-etc} \textbf{(a)}, applied
to $m=q$). Thus, $\operatorname*{sur}\left(  q,n\right)  =\left[  q=0\right]
=0$. Comparing this with
\begin{align*}
\sum_{i=0}^{n}\left(  -1\right)  ^{n-i}\dbinom{n}{i}i^{q}  &  =\sum_{i=0}%
^{0}\left(  -1\right)  ^{0-i}\dbinom{0}{i}i^{q}\ \ \ \ \ \ \ \ \ \ \left(
\text{since }n=0\right) \\
&  =\underbrace{\left(  -1\right)  ^{0-0}}_{=1}\underbrace{\dbinom{0}{0}}%
_{=1}0^{q}=0^{q}=0\ \ \ \ \ \ \ \ \ \ \left(  \text{since }q>0\right)  ,
\end{align*}
we obtain $\operatorname*{sur}\left(  q,n\right)  =\sum_{i=0}^{n}\left(
-1\right)  ^{n-i}\dbinom{n}{i}i^{q}$. Thus, we have proven
(\ref{sol.sur.step.goal}) under the assumption that $n=0$.}. Hence, for the
rest of this proof, we WLOG assume that $n\neq0$. Hence, $n\in\left\{
1,2,3,\ldots\right\}  $ (since $n\in\mathbb{N}$), so that $n>0$. Hence,
$n-1\in\mathbb{N}$. Therefore, for every $m\in\mathbb{N}$ satisfying $m<q$, we
have%
\begin{equation}
\operatorname*{sur}\left(  m,n-1\right)  =\sum_{i=0}^{n-1}\left(  -1\right)
^{\left(  n-1\right)  -i}\dbinom{n-1}{i}i^{m} \label{sol.sur.step.hyp2}%
\end{equation}
(by (\ref{sol.sur.step.hyp}) (applied to $n-1$ instead of $n$)).

Applying Proposition \ref{prop.binom.surmn-rec1} to $m=q$, we find%
\[
\operatorname*{sur}\left(  q,n\right)  =\sum_{j=1}^{q}\dbinom{q}{j}%
\cdot\operatorname*{sur}\left(  q-j,n-1\right)  =\sum_{j=0}^{q-1}\dbinom{q}%
{j}\cdot\operatorname*{sur}\left(  j,n-1\right)  .
\]
Hence,%
\begin{align}
\operatorname*{sur}\left(  q,n\right)   &  =\sum_{j=0}^{q-1}\dbinom{q}{j}%
\cdot\underbrace{\operatorname*{sur}\left(  j,n-1\right)  }_{\substack{=\sum
_{i=0}^{n-1}\left(  -1\right)  ^{\left(  n-1\right)  -i}\dbinom{n-1}{i}%
i^{j}\\\text{(by (\ref{sol.sur.step.hyp2}) (applied to }m=j\text{)}%
\\\text{(since }j\leq q-1<q\text{ and }j\in\mathbb{N}\text{))}}}\nonumber\\
&  =\sum_{j=0}^{q-1}\dbinom{q}{j}\cdot\sum_{i=0}^{n-1}\left(  -1\right)
^{\left(  n-1\right)  -i}\dbinom{n-1}{i}i^{j}=\underbrace{\sum_{j=0}%
^{q-1}\ \ \sum_{i=0}^{n-1}}_{=\sum_{i=0}^{n-1}\ \ \sum_{j=0}^{q-1}}\dbinom
{q}{j}\left(  -1\right)  ^{\left(  n-1\right)  -i}\dbinom{n-1}{i}%
i^{j}\nonumber\\
&  =\sum_{i=0}^{n-1}\ \ \sum_{j=0}^{q-1}\dbinom{q}{j}\left(  -1\right)
^{\left(  n-1\right)  -i}\dbinom{n-1}{i}i^{j}\nonumber\\
&  =\sum_{i=0}^{n-1}\left(  -1\right)  ^{\left(  n-1\right)  -i}\dbinom
{n-1}{i}\sum_{j=0}^{q-1}\dbinom{q}{j}i^{j}. \label{sol.sur.step.left}%
\end{align}


Recall that $n-1\in\mathbb{N}$. Therefore, Proposition \ref{prop.binom.0}
(applied to $n-1$ and $n$ instead of $n$ and $k$) shows that $\dbinom{n-1}%
{n}=0$ (since $n>n-1$).

Now, every $g\in\mathbb{Z}$ satisfies%
\begin{align}
\sum_{i=0}^{n}\left(  -1\right)  ^{n-i}\dbinom{g}{i}i^{q}  &  =\sum_{i=1}%
^{n}\left(  -1\right)  ^{n-i}\dbinom{g}{i}i^{q}+\left(  -1\right)
^{n-0}\dbinom{g}{0}\underbrace{0^{q}}_{\substack{=0\\\text{(since }%
q>0\text{)}}}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have split off the addend for
}i=0\text{ from the sum}\right) \nonumber\\
&  =\sum_{i=1}^{n}\left(  -1\right)  ^{n-i}\dbinom{g}{i}i^{q}%
+\underbrace{\left(  -1\right)  ^{n-0}\dbinom{g}{0}0}_{=0}\nonumber\\
&  =\sum_{i=1}^{n}\left(  -1\right)  ^{n-i}\dbinom{g}{i}i^{q}.
\label{sol.sur.step.g1}%
\end{align}
Applying this to $g=n$, we obtain%
\begin{align}
\sum_{i=0}^{n}\left(  -1\right)  ^{n-i}\dbinom{n}{i}i^{q}  &  =\sum_{i=1}%
^{n}\left(  -1\right)  ^{n-i}\underbrace{\dbinom{n}{i}}_{\substack{=\dbinom
{n-1}{i-1}+\dbinom{n-1}{i}\\\text{(by Theorem \ref{thm.binom.rec}, applied to
}k=i\text{)}}}i^{q}\nonumber\\
&  =\sum_{i=1}^{n}\left(  -1\right)  ^{n-i}\left(  \dbinom{n-1}{i-1}%
+\dbinom{n-1}{i}\right)  i^{q}\nonumber\\
&  =\sum_{i=1}^{n}\left(  -1\right)  ^{n-i}\dbinom{n-1}{i-1}i^{q}+\sum
_{i=1}^{n}\left(  -1\right)  ^{n-i}\dbinom{n-1}{i}i^{q}.
\label{sol.sur.step.1}%
\end{align}
But%
\begin{align}
\sum_{i=1}^{n}\left(  -1\right)  ^{n-i}\dbinom{n-1}{i-1}i^{q}  &  =\sum
_{i=0}^{n-1}\underbrace{\left(  -1\right)  ^{n-\left(  i+1\right)  }%
}_{=\left(  -1\right)  ^{n-i-1}}\underbrace{\dbinom{n-1}{\left(  i+1\right)
-1}}_{=\dbinom{n-1}{i}}\left(  i+1\right)  ^{q}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have substituted }i+1\text{ for
}i\text{ in the sum}\right) \nonumber\\
&  =\sum_{i=0}^{n-1}\left(  -1\right)  ^{n-i-1}\dbinom{n-1}{i}\left(
i+1\right)  ^{q}. \label{sol.sur.step.2}%
\end{align}
Also, (\ref{sol.sur.step.g1}) (applied to $g=n-1$) yields%
\[
\sum_{i=0}^{n}\left(  -1\right)  ^{n-i}\dbinom{n-1}{i}i^{q}=\sum_{i=1}%
^{n}\left(  -1\right)  ^{n-i}\dbinom{n-1}{i}i^{q},
\]
and thus we have
\begin{align}
\sum_{i=1}^{n}\left(  -1\right)  ^{n-i}\dbinom{n-1}{i}i^{q}  &  =\sum
_{i=0}^{n}\left(  -1\right)  ^{n-i}\dbinom{n-1}{i}i^{q}\nonumber\\
&  =\sum_{i=0}^{n-1}\underbrace{\left(  -1\right)  ^{n-i}}_{=-\left(
-1\right)  ^{n-i-1}}\dbinom{n-1}{i}i^{q}+\left(  -1\right)  ^{n-n}%
\underbrace{\dbinom{n-1}{n}}_{=0}n^{q}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have split off the addend for
}i=n\text{ from the sum}\right) \nonumber\\
&  =\sum_{i=0}^{n-1}\left(  -\left(  -1\right)  ^{n-i-1}\right)  \dbinom
{n-1}{i}i^{q}+\underbrace{\left(  -1\right)  ^{n-n}0n^{q}}_{=0}\nonumber\\
&  =\sum_{i=0}^{n-1}\left(  -\left(  -1\right)  ^{n-i-1}\right)  \dbinom
{n-1}{i}i^{q}\nonumber\\
&  =-\sum_{i=0}^{n-1}\left(  -1\right)  ^{n-i-1}\dbinom{n-1}{i}i^{q}.
\label{sol.sur.step.3}%
\end{align}


Now, (\ref{sol.sur.step.1}) becomes%
\begin{align*}
&  \sum_{i=0}^{n}\left(  -1\right)  ^{n-i}\dbinom{n}{i}i^{q}\\
&  =\underbrace{\sum_{i=1}^{n}\left(  -1\right)  ^{n-i}\dbinom{n-1}{i-1}i^{q}%
}_{\substack{=\sum_{i=0}^{n-1}\left(  -1\right)  ^{n-i-1}\dbinom{n-1}%
{i}\left(  i+1\right)  ^{q}\\\text{(by (\ref{sol.sur.step.2}))}}%
}+\underbrace{\sum_{i=1}^{n}\left(  -1\right)  ^{n-i}\dbinom{n-1}{i}i^{q}%
}_{\substack{=-\sum_{i=0}^{n-1}\left(  -1\right)  ^{n-i-1}\dbinom{n-1}{i}%
i^{q}\\\text{(by (\ref{sol.sur.step.3}))}}}\\
&  =\sum_{i=0}^{n-1}\left(  -1\right)  ^{n-i-1}\dbinom{n-1}{i}\left(
i+1\right)  ^{q}+\left(  -\sum_{i=0}^{n-1}\left(  -1\right)  ^{n-i-1}%
\dbinom{n-1}{i}i^{q}\right) \\
&  =\sum_{i=0}^{n-1}\left(  -1\right)  ^{n-i-1}\dbinom{n-1}{i}\left(
i+1\right)  ^{q}-\sum_{i=0}^{n-1}\left(  -1\right)  ^{n-i-1}\dbinom{n-1}%
{i}i^{q}\\
&  =\sum_{i=0}^{n-1}\underbrace{\left(  -1\right)  ^{n-i-1}}_{=\left(
-1\right)  ^{\left(  n-1\right)  -i}}\dbinom{n-1}{i}\underbrace{\left(
\left(  i+1\right)  ^{q}-i^{q}\right)  }_{\substack{=\sum_{j=0}^{q-1}%
\dbinom{q}{j}i^{j}\\\text{(by Corollary \ref{cor.binom.i+1ton}, applied to
}q\\\text{and }i\text{ instead of }n\text{ and }x\text{)}}}\\
&  =\sum_{i=0}^{n-1}\left(  -1\right)  ^{\left(  n-1\right)  -i}\dbinom
{n-1}{i}\sum_{j=0}^{q-1}\dbinom{q}{j}i^{j}.
\end{align*}
Comparing this with (\ref{sol.sur.step.left}), we obtain%
\[
\operatorname*{sur}\left(  q,n\right)  =\sum_{i=0}^{n}\left(  -1\right)
^{n-i}\dbinom{n}{i}i^{q}.
\]
This proves (\ref{sol.sur.step.goal}).]

Now, forget that we fixed $n$. We thus have proven that $\operatorname*{sur}%
\left(  q,n\right)  =\sum_{i=0}^{n}\left(  -1\right)  ^{n-i}\dbinom{n}{i}%
i^{q}$ for every $n\in\mathbb{N}$. In other words, Theorem
\ref{thm.binom.surmn-as-altsum} holds for $m=q$. This completes the induction
step. Thus, Theorem \ref{thm.binom.surmn-as-altsum} is proved.
\end{proof}

Thus, Exercise \ref{exe.thm.binom.surmn-as-altsum.elpf} is
solved.\footnote{This solution has been taken from \cite[Exercise 4]%
{17f-hw2s}.}

\subsection{Solution to Exercise \ref{exe.surmn-as-altsum.vars}}

\begin{proof}
[Solution to Exercise \ref{exe.surmn-as-altsum.vars}.]\textbf{(a)} Theorem
\ref{thm.binom.surmn-as-altsum} yields%
\begin{align*}
&  \operatorname*{sur}\left(  m,n\right) \\
&  =\sum_{i=0}^{n}\left(  -1\right)  ^{n-i}\dbinom{n}{i}i^{m}=\left(
-1\right)  ^{n-0}\dbinom{n}{0}\underbrace{0^{m}}_{\substack{=0\\\text{(since
}m\text{ is positive)}}}+\sum_{i=1}^{n}\left(  -1\right)  ^{n-i}\dbinom{n}%
{i}i^{m}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have split off the addend for
}i=0\text{ from the sum}\right) \\
&  =\underbrace{\left(  -1\right)  ^{n-0}\dbinom{n}{0}0}_{=0}+\sum_{i=1}%
^{n}\left(  -1\right)  ^{n-i}\dbinom{n}{i}i^{m}=\sum_{i=1}^{n}\left(
-1\right)  ^{n-i}\underbrace{\dbinom{n}{i}}_{\substack{=\dfrac{n}{i}%
\dbinom{n-1}{i-1}\\\text{(by Proposition \ref{prop.binom.X-1},}\\\text{applied
to }n\text{ and }i\\\text{instead of }m\text{ and }n\text{)}}%
}\underbrace{i^{m}}_{\substack{=ii^{m-1}\\\text{(since }m\text{ is positive)}%
}}\\
&  =\sum_{i=1}^{n}\left(  -1\right)  ^{n-i}\underbrace{\dfrac{n}{i}%
\dbinom{n-1}{i-1}ii^{m-1}}_{=n\dbinom{n-1}{i-1}i^{m-1}}=\sum_{i=1}^{n}\left(
-1\right)  ^{n-i}n\dbinom{n-1}{i-1}i^{m-1}\\
&  =n\sum_{i=1}^{n}\left(  -1\right)  ^{n-i}\dbinom{n-1}{i-1}i^{m-1}.
\end{align*}
Comparing this with%
\begin{align*}
&  n\underbrace{\sum_{i=0}^{n}\left(  -1\right)  ^{n-i}\dbinom{n-1}%
{i-1}i^{m-1}}_{\substack{=\left(  -1\right)  ^{n-0}\dbinom{n-1}{0-1}%
0^{m-1}+\sum_{i=1}^{n}\left(  -1\right)  ^{n-i}\dbinom{n-1}{i-1}%
i^{m-1}\\\text{(here, we have split off the addend for }i=0\text{ from the
sum)}}}\\
&  =n\left(  \left(  -1\right)  ^{n-0}\underbrace{\dbinom{n-1}{0-1}%
}_{\substack{=0\\\text{(by (\ref{eq.def.binom.def.b}), since }0-1\notin%
\mathbb{N}\text{)}}}0^{m-1}+\sum_{i=1}^{n}\left(  -1\right)  ^{n-i}%
\dbinom{n-1}{i-1}i^{m-1}\right) \\
&  =n\left(  \underbrace{\left(  -1\right)  ^{n-0}0\cdot0^{m-1}}_{=0}%
+\sum_{i=1}^{n}\left(  -1\right)  ^{n-i}\dbinom{n-1}{i-1}i^{m-1}\right) \\
&  =n\sum_{i=1}^{n}\left(  -1\right)  ^{n-i}\dbinom{n-1}{i-1}i^{m-1},
\end{align*}
we obtain%
\[
\operatorname*{sur}\left(  m,n\right)  =n\sum_{i=0}^{n}\left(  -1\right)
^{n-i}\dbinom{n-1}{i-1}i^{m-1}.
\]
This solves Exercise \ref{exe.surmn-as-altsum.vars} \textbf{(a)}.

\textbf{(b)} The definition of the Stirling number $%
%TCIMACRO{\QDATOPD{\{}{\}}{m}{n}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{m}{n}%
%EndExpansion
$ (in Remark \ref{rmk.binom.stirl2def}) yields%
\begin{align*}%
%TCIMACRO{\QDATOPD{\{}{\}}{m}{n}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{m}{n}%
%EndExpansion
&  =\operatorname*{sur}\left(  m,n\right)  /n!=\dfrac{1}{n!}%
\underbrace{\operatorname*{sur}\left(  m,n\right)  }_{\substack{=\sum
_{i=0}^{n}\left(  -1\right)  ^{n-i}\dbinom{n}{i}i^{m}\\\text{(by Theorem
\ref{thm.binom.surmn-as-altsum})}}}=\dfrac{1}{n!}\cdot\sum_{i=0}^{n}\left(
-1\right)  ^{n-i}\underbrace{\dbinom{n}{i}}_{\substack{=\dfrac{n!}%
{i!\cdot\left(  n-i\right)  !}\\\text{(by Theorem \ref{thm.binom.fac}%
,}\\\text{applied to }k=i\text{)}}}i^{m}\\
&  =\dfrac{1}{n!}\cdot\sum_{i=0}^{n}\left(  -1\right)  ^{n-i}\dfrac
{n!}{i!\cdot\left(  n-i\right)  !}i^{m}=\underbrace{\dfrac{1}{n!}\cdot
n!}_{=1}\sum_{i=0}^{n}\left(  -1\right)  ^{n-i}\dfrac{1}{i!\left(  n-i\right)
!}i^{m}\\
&  =\sum_{i=0}^{n}\left(  -1\right)  ^{n-i}\dfrac{1}{i!\left(  n-i\right)
!}i^{m}=\sum_{i=0}^{n}\left(  -1\right)  ^{n-i}\dfrac{i^{m}}{i!\left(
n-i\right)  !}.
\end{align*}
This solves Exercise \ref{exe.surmn-as-altsum.vars} \textbf{(b)}.
\footnote{This solution to Exercise \ref{exe.surmn-as-altsum.vars} has been
taken from \cite[Exercise 2]{17f-hw3s}.}
\end{proof}

\subsection{Solution to Exercise \ref{exe.binom.surmn-km=}}

\begin{proof}
[Solution to Exercise \ref{exe.binom.surmn-km=}.]Fix $k\in\mathbb{N}$ and
$m\in\mathbb{N}$. We must prove the equality
(\ref{pf.thm.binom.surmn-km=.2way}) rigorously.

Our informal proof of this equality involved a sequence of three choices, each
depending on the previous one. The easiest way to formalize such an argument
is by reframing it as two applications of the sum rule (one corresponding to
the choice of $i=\left\vert f\left(  \left[  m\right]  \right)  \right\vert $,
and one corresponding to the choice of $f\left(  \left[  m\right]  \right)
$). Thus, we obtain the following proof:

[\textit{Proof of (\ref{pf.thm.binom.surmn-km=.2way}):} If $f:\left[
m\right]  \rightarrow\left[  k\right]  $ is any map, then $\left\vert f\left(
\left[  m\right]  \right)  \right\vert \in\left\{  0,1,\ldots,m\right\}
$\ \ \ \ \footnote{\textit{Proof.} Let $f:\left[  m\right]  \rightarrow\left[
k\right]  $. Then, $\left[  m\right]  =\left\{  1,2,\ldots,m\right\}  $ and
thus $f\left(  \left[  m\right]  \right)  =f\left(  \left\{  1,2,\ldots
,m\right\}  \right)  =\left\{  f\left(  1\right)  ,f\left(  2\right)
,\ldots,f\left(  m\right)  \right\}  $. But the set $\left\{  f\left(
1\right)  ,f\left(  2\right)  ,\ldots,f\left(  m\right)  \right\}  $ has at
most $m$ elements (since $f\left(  1\right)  ,f\left(  2\right)
,\ldots,f\left(  m\right)  $ are $m$ elements). In other words, $\left\vert
\left\{  f\left(  1\right)  ,f\left(  2\right)  ,\ldots,f\left(  m\right)
\right\}  \right\vert \leq m$. In view of $f\left(  \left[  m\right]  \right)
=\left\{  f\left(  1\right)  ,f\left(  2\right)  ,\ldots,f\left(  m\right)
\right\}  $, this rewrites as $\left\vert f\left(  \left[  m\right]  \right)
\right\vert \leq m$. Hence, $\left\vert f\left(  \left[  m\right]  \right)
\right\vert \in\left\{  0,1,\ldots,m\right\}  $ (since $\left\vert f\left(
\left[  m\right]  \right)  \right\vert $ is clearly a nonnegative integer).}.
Hence, the sum rule yields%
\begin{align}
&  \left(  \text{\# of maps }f:\left[  m\right]  \rightarrow\left[  k\right]
\right) \nonumber\\
&  =\sum_{i\in\left\{  0,1,\ldots,m\right\}  }\left(  \text{\# of maps
}f:\left[  m\right]  \rightarrow\left[  k\right]  \text{ satisfying
}\left\vert f\left(  \left[  m\right]  \right)  \right\vert =i\right)  .
\label{pf.pf.thm.binom.surmn-km=.2way.1}%
\end{align}


Now, fix $i\in\left\{  0,1,\ldots,m\right\}  $. If $f:\left[  m\right]
\rightarrow\left[  k\right]  $ is any map satisfying $\left\vert f\left(
\left[  m\right]  \right)  \right\vert =i$, then $f\left(  \left[  m\right]
\right)  $ is an $i$-element subset of $\left[  k\right]  $ (since $f\left(
\left[  m\right]  \right)  \subseteq\left[  k\right]  $ and $\left\vert
f\left(  \left[  m\right]  \right)  \right\vert =i$). Thus, the sum rule
yields%
\begin{align}
&  \left(  \text{\# of maps }f:\left[  m\right]  \rightarrow\left[  k\right]
\text{ satisfying }\left\vert f\left(  \left[  m\right]  \right)  \right\vert
=i\right) \nonumber\\
&  =\sum_{\substack{I\text{ is an }i\text{-element}\\\text{subset of }\left[
k\right]  }}\left(  \text{\# of maps }f:\left[  m\right]  \rightarrow\left[
k\right]  \text{ satisfying }\left\vert f\left(  \left[  m\right]  \right)
\right\vert =i\text{ and }f\left(  \left[  m\right]  \right)  =I\right)  .
\label{pf.pf.thm.binom.surmn-km=.2way.2}%
\end{align}


Now, fix an $i$-element subset $I$ of $\left[  k\right]  $. Then, $\left\vert
I\right\vert =i$. Hence, each map $f:\left[  m\right]  \rightarrow\left[
k\right]  $ satisfying $f\left(  \left[  m\right]  \right)  =I$ automatically
satisfies $\left\vert f\left(  \left[  m\right]  \right)  \right\vert =i$
(since $f\left(  \left[  m\right]  \right)  =I$ leads to $\left\vert f\left(
\left[  m\right]  \right)  \right\vert =\left\vert I\right\vert =i$). Hence,
the condition \textquotedblleft$\left\vert f\left(  \left[  m\right]  \right)
\right\vert =i$\textquotedblright\ in \newline\textquotedblleft$\left(
\text{\# of maps }f:\left[  m\right]  \rightarrow\left[  k\right]  \text{
satisfying }\left\vert f\left(  \left[  m\right]  \right)  \right\vert
=i\text{ and }f\left(  \left[  m\right]  \right)  =I\right)  $%
\textquotedblright\ is redundant. Thus,%
\begin{align}
&  \left(  \text{\# of maps }f:\left[  m\right]  \rightarrow\left[  k\right]
\text{ satisfying }\left\vert f\left(  \left[  m\right]  \right)  \right\vert
=i\text{ and }f\left(  \left[  m\right]  \right)  =I\right) \nonumber\\
&  =\left(  \text{\# of maps }f:\left[  m\right]  \rightarrow\left[  k\right]
\text{ satisfying }f\left(  \left[  m\right]  \right)  =I\right) \nonumber\\
&  =\left(  \text{\# of surjective maps from }\left[  m\right]  \text{ to
}I\right) \nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Exercise \ref{exe.binom.maps-img}
\textbf{(b)} (applied to }A=\left[  m\right]  \text{, }B=\left[  k\right]
\text{ and }C=I\text{)}\right) \nonumber\\
&  =\operatorname*{sur}\left(  m,i\right)
\label{pf.pf.thm.binom.surmn-km=.2way.4}%
\end{align}
(by Proposition \ref{prop.binom.maps-surj}, applied to $n=i$, $A=\left[
m\right]  $ and $B=I$).

Now, forget that we fixed $I$. We thus have proved
(\ref{pf.pf.thm.binom.surmn-km=.2way.4}) for each $i$-element subset $I$ of
$\left[  k\right]  $. Thus, (\ref{pf.pf.thm.binom.surmn-km=.2way.2}) becomes%
\begin{align}
&  \left(  \text{\# of maps }f:\left[  m\right]  \rightarrow\left[  k\right]
\text{ satisfying }\left\vert f\left(  \left[  m\right]  \right)  \right\vert
=i\right) \nonumber\\
&  =\sum_{\substack{I\text{ is an }i\text{-element}\\\text{subset of }\left[
k\right]  }}\underbrace{\left(  \text{\# of maps }f:\left[  m\right]
\rightarrow\left[  k\right]  \text{ satisfying }\left\vert f\left(  \left[
m\right]  \right)  \right\vert =i\text{ and }f\left(  \left[  m\right]
\right)  =I\right)  }_{\substack{=\operatorname*{sur}\left(  m,i\right)
\\\text{(by (\ref{pf.pf.thm.binom.surmn-km=.2way.4}))}}}\nonumber\\
&  =\sum_{\substack{I\text{ is an }i\text{-element}\\\text{subset of }\left[
k\right]  }}\operatorname*{sur}\left(  m,i\right)  =\underbrace{\left(
\text{\# of }i\text{-element subsets of }\left[  k\right]  \right)
}_{\substack{=\dbinom{k}{i}\\\text{(by Theorem \ref{thm.binom.comb}%
,}\\\text{applied to }k\text{, }i\text{ and }\left[  k\right]  \text{ instead
of }n\text{, }k\text{ and }S\text{)}}}\cdot\operatorname*{sur}\left(
m,i\right) \nonumber\\
&  =\dbinom{k}{i}\cdot\operatorname*{sur}\left(  m,i\right)  .
\label{pf.pf.thm.binom.surmn-km=.2way.6}%
\end{align}


Now, forget that we fixed $i$. We thus have proved
(\ref{pf.pf.thm.binom.surmn-km=.2way.6}) for each $i\in\left\{  0,1,\ldots
,m\right\}  $. Thus, (\ref{pf.pf.thm.binom.surmn-km=.2way.1}) becomes%
\begin{align*}
&  \left(  \text{\# of maps }f:\left[  m\right]  \rightarrow\left[  k\right]
\right) \\
&  =\sum_{i\in\left\{  0,1,\ldots,m\right\}  }\underbrace{\left(  \text{\# of
maps }f:\left[  m\right]  \rightarrow\left[  k\right]  \text{ satisfying
}\left\vert f\left(  \left[  m\right]  \right)  \right\vert =i\right)
}_{\substack{=\dbinom{k}{i}\cdot\operatorname*{sur}\left(  m,i\right)
\\\text{(by (\ref{pf.pf.thm.binom.surmn-km=.2way.6}))}}}\\
&  =\underbrace{\sum_{i\in\left\{  0,1,\ldots,m\right\}  }}_{=\sum_{i=0}^{m}%
}\dbinom{k}{i}\cdot\operatorname*{sur}\left(  m,i\right)  =\sum_{i=0}%
^{m}\dbinom{k}{i}\cdot\operatorname*{sur}\left(  m,i\right)  .
\end{align*}
This proves (\ref{pf.thm.binom.surmn-km=.2way}).]

Thus, Exercise \ref{exe.binom.surmn-km=} is solved.
\end{proof}

\subsection{Solution to Exercise \ref{exe.binom.vanderRR.1st-proof}}

In order to solve Exercise \ref{exe.binom.vanderRR.1st-proof}, we need to
formalize our proof of Theorem \ref{thm.vandermonde.RR}. Here is one way to do so:

\begin{proof}
[First proof of Theorem \ref{thm.vandermonde.RR} for $x\in\mathbb{N}$ (formal
version).]Let us first show the following:

\begin{statement}
\textit{Claim 1:} We have%
\[
\dbinom{u}{n}=\sum_{k=0}^{v}\dbinom{v}{k}\dbinom{u-v}{n-k}%
\]
for any $u\in\mathbb{R}$ and $v\in\mathbb{N}$.
\end{statement}

[\textit{Proof of Claim 1:} We shall prove Claim 1 by induction on $v$.

\textit{Induction base:} We have $\dbinom{u}{n}=\sum_{k=0}^{0}\dbinom{0}%
{k}\dbinom{u-0}{n-k}$ for any $u\in\mathbb{R}$%
\ \ \ \ \footnote{\textit{Proof.} Let $u\in\mathbb{R}$. Then,
\[
\sum_{k=0}^{0}\dbinom{0}{k}\dbinom{u-0}{n-k}=\underbrace{\dbinom{0}{0}}%
_{=1}\dbinom{u-0}{n-0}=\dbinom{u-0}{n-0}=\dbinom{u}{n}.
\]
In other words, $\dbinom{u}{n}=\sum_{k=0}^{0}\dbinom{0}{k}\dbinom{u-0}{n-k}$,
qed.}. In other words, Claim 1 holds for $v=0$. This completes the induction base.

\textit{Induction step:} Let $w\in\mathbb{N}$. Assume that Claim 1 holds for
$v=w$. We must prove that Claim 1 holds for $v=w+1$.

Let $u\in\mathbb{R}$. We have assumed that Claim 1 holds for $v=w$. Thus, we
have%
\begin{align}
\dbinom{u}{n}  &  =\sum_{k=0}^{w}\dbinom{w}{k}\underbrace{\dbinom{u-w}{n-k}%
}_{\substack{=\dbinom{u-w-1}{n-k-1}+\dbinom{u-w-1}{n-k}\\\text{(by Theorem
\ref{thm.binom.rec}, applied to }u-w\text{ and }n-k\text{ instead of }n\text{
and }k\text{)}}}\nonumber\\
&  =\sum_{k=0}^{w}\dbinom{w}{k}\left(  \dbinom{u-w-1}{n-k-1}+\dbinom
{u-w-1}{n-k}\right) \nonumber\\
&  =\sum_{k=0}^{w}\left(  \dbinom{w}{k}\dbinom{u-w-1}{n-k-1}+\dbinom{w}%
{k}\dbinom{u-w-1}{n-k}\right) \nonumber\\
&  =\sum_{k=0}^{w}\dbinom{w}{k}\dbinom{u-w-1}{n-k-1}+\sum_{k=0}^{w}\dbinom
{w}{k}\dbinom{u-w-1}{n-k}. \label{pf.thm.vandermonde.RR.1st-fml.1}%
\end{align}


On the other hand, (\ref{eq.def.binom.def.b}) (applied to $w$ and $-1$ instead
of $n$ and $k$) yields $\dbinom{w}{-1}=0$ (since $-1\notin\mathbb{N}$).
Furthermore, $w+1>w$ and thus $\dbinom{w}{w+1}=0$ (by Proposition
\ref{prop.binom.0}, applied to $w$ and $w+1$ instead of $n$ and $k$).

But each $k\in\mathbb{N}$ satisfies%
\begin{align}
\dbinom{w+1}{k}  &  =\dbinom{\left(  w+1\right)  -1}{k-1}+\dbinom{\left(
w+1\right)  -1}{k}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.binom.rec}, applied
to }w+1\text{ instead of }n\right) \nonumber\\
&  =\dbinom{w}{k-1}+\dbinom{w}{k} \label{pf.thm.vandermonde.RR.1st-fml.3}%
\end{align}
(since $\left(  w+1\right)  -1=w$). Hence,%
\begin{align}
&  \sum_{k=0}^{w+1}\underbrace{\dbinom{w+1}{k}}_{\substack{=\dbinom{w}%
{k-1}+\dbinom{w}{k}\\\text{(by (\ref{pf.thm.vandermonde.RR.1st-fml.3}))}%
}}\underbrace{\dbinom{u-\left(  w+1\right)  }{n-k}}_{\substack{=\dbinom
{u-w-1}{n-k}\\\text{(since }u-\left(  w+1\right)  =u-w-1\text{)}}}\nonumber\\
&  =\sum_{k=0}^{w+1}\left(  \dbinom{w}{k-1}+\dbinom{w}{k}\right)
\dbinom{u-w-1}{n-k}\nonumber\\
&  =\sum_{k=0}^{w+1}\left(  \dbinom{w}{k-1}\dbinom{u-w-1}{n-k}+\dbinom{w}%
{k}\dbinom{u-w-1}{n-k}\right) \nonumber\\
&  =\sum_{k=0}^{w+1}\dbinom{w}{k-1}\dbinom{u-w-1}{n-k}+\sum_{k=0}^{w+1}%
\dbinom{w}{k}\dbinom{u-w-1}{n-k}. \label{pf.thm.vandermonde.RR.1st-fml.4}%
\end{align}


We intend to show that the right hand sides of the equalities
(\ref{pf.thm.vandermonde.RR.1st-fml.1}) and
(\ref{pf.thm.vandermonde.RR.1st-fml.4}) are equal. To that aim, we transform
the sums on the right hand side of the latter. Let us begin with the first
sum:%
\begin{align}
&  \sum_{k=0}^{w+1}\dbinom{w}{k-1}\dbinom{u-w-1}{n-k}\nonumber\\
&  =\underbrace{\dbinom{w}{0-1}}_{=\dbinom{w}{-1}=0}\dbinom{u-w-1}{n-0}%
+\sum_{k=1}^{w+1}\dbinom{w}{k-1}\dbinom{u-w-1}{n-k}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have split off the addend for
}k=0\text{ from the sum}\right) \nonumber\\
&  =\sum_{k=1}^{w+1}\dbinom{w}{k-1}\dbinom{u-w-1}{n-k}=\sum_{k=0}%
^{w}\underbrace{\dbinom{w}{\left(  k+1\right)  -1}}_{\substack{=\dbinom{w}%
{k}\\\text{(since }\left(  k+1\right)  -1=k\text{)}}}\underbrace{\dbinom
{u-w-1}{n-\left(  k+1\right)  }}_{\substack{=\dbinom{u-w-1}{n-k-1}%
\\\text{(since }n-\left(  k+1\right)  =n-k-1\text{)}}}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have substituted }k+1\text{ for
}k\text{ in the sum}\right) \nonumber\\
&  =\sum_{k=0}^{w}\dbinom{w}{k}\dbinom{u-w-1}{n-k-1}.
\label{pf.thm.vandermonde.RR.1st-fml.sum1}%
\end{align}
Let us next transform the second sum:%
\begin{align}
&  \sum_{k=0}^{w+1}\dbinom{w}{k}\dbinom{u-w-1}{n-k}\nonumber\\
&  =\underbrace{\dbinom{w}{w+1}}_{=0}\dbinom{u-w-1}{n-\left(  w+1\right)
}+\sum_{k=0}^{w}\dbinom{w}{k}\dbinom{u-w-1}{n-k}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have split off the addend for
}k=w+1\text{ from the sum}\right) \nonumber\\
&  =\sum_{k=0}^{w}\dbinom{w}{k}\dbinom{u-w-1}{n-k}.
\label{pf.thm.vandermonde.RR.1st-fml.sum2}%
\end{align}
Thus, (\ref{pf.thm.vandermonde.RR.1st-fml.4}) becomes%
\begin{align*}
&  \sum_{k=0}^{w+1}\dbinom{w+1}{k}\dbinom{u-\left(  w+1\right)  }{n-k}\\
&  =\underbrace{\sum_{k=0}^{w+1}\dbinom{w}{k-1}\dbinom{u-w-1}{n-k}%
}_{\substack{=\sum_{k=0}^{w}\dbinom{w}{k}\dbinom{u-w-1}{n-k-1}\\\text{(by
(\ref{pf.thm.vandermonde.RR.1st-fml.sum1}))}}}+\underbrace{\sum_{k=0}%
^{w+1}\dbinom{w}{k}\dbinom{u-w-1}{n-k}}_{\substack{=\sum_{k=0}^{w}\dbinom
{w}{k}\dbinom{u-w-1}{n-k}\\\text{(by (\ref{pf.thm.vandermonde.RR.1st-fml.sum2}%
))}}}\\
&  =\sum_{k=0}^{w}\dbinom{w}{k}\dbinom{u-w-1}{n-k-1}+\sum_{k=0}^{w}\dbinom
{w}{k}\dbinom{u-w-1}{n-k}.
\end{align*}
Comparing this with (\ref{pf.thm.vandermonde.RR.1st-fml.1}), we obtain%
\[
\dbinom{u}{n}=\sum_{k=0}^{w+1}\dbinom{w+1}{k}\dbinom{u-\left(  w+1\right)
}{n-k}.
\]


Now, forget that we fixed $u$. We thus have proved that
\[
\dbinom{u}{n}=\sum_{k=0}^{w+1}\dbinom{w+1}{k}\dbinom{u-\left(  w+1\right)
}{n-k}\ \ \ \ \ \ \ \ \ \ \text{for any }u\in\mathbb{R}.
\]
In other words, Claim 1 holds for $v=w+1$. This completes the induction step.
Thus, Claim 1 is proven by induction.]

Now, let $x\in\mathbb{N}$ and $y\in\mathbb{R}$. Applying Claim 1 to $u=x+y$
and $v=x$, we get%
\begin{equation}
\dbinom{x+y}{n}=\sum_{k=0}^{x}\dbinom{x}{k}\dbinom{\left(  x+y\right)
-x}{n-k}=\sum_{k=0}^{x}\dbinom{x}{k}\dbinom{y}{n-k}
\label{pf.thm.vandermonde.RR.1st-fml.at}%
\end{equation}
(since $\left(  x+y\right)  -x=y$).

Now, recall that $x\in\mathbb{N}$. Hence, every $k\in\mathbb{N}$ satisfying
$k>x$ must satisfy
\begin{equation}
\dbinom{x}{k}=0 \label{pf.thm.vandermonde.RR.1st-fml.zero1}%
\end{equation}
(by Proposition \ref{prop.binom.0}, applied to $x$ instead of $n$) and thus
$\underbrace{\dbinom{x}{k}}_{=0}\dbinom{y}{n-k}=0$. Thus, in the infinite sum
$\sum_{k\in\mathbb{N}}\dbinom{x}{k}\dbinom{y}{n-k}$, every addend with $k>x$
is $0$. Hence, this infinite sum has only finitely many nonzero addends
(namely, the addends with $k\leq x$). Thus, it is well-defined. Moreover,%
\begin{align*}
\sum_{k\in\mathbb{N}}\dbinom{x}{k}\dbinom{y}{n-k}  &  =\underbrace{\sum
_{\substack{k\in\mathbb{N};\\k\leq x}}}_{\substack{=\sum_{k\in\left\{
0,1,\ldots,x\right\}  }\\=\sum_{k=0}^{x}}}\dbinom{x}{k}\dbinom{y}{n-k}%
+\sum_{\substack{k\in\mathbb{N};\\k>x}}\underbrace{\dbinom{x}{k}%
}_{\substack{=0\\\text{(by (\ref{pf.thm.vandermonde.RR.1st-fml.zero1}))}%
}}\dbinom{y}{n-k}\\
&  =\sum_{k=0}^{x}\dbinom{x}{k}\dbinom{y}{n-k}+\underbrace{\sum
_{\substack{k\in\mathbb{N};\\k>x}}0\dbinom{y}{n-k}}_{=0}=\sum_{k=0}^{x}%
\dbinom{x}{k}\dbinom{y}{n-k}.
\end{align*}
Comparing this with (\ref{pf.thm.vandermonde.RR.1st-fml.at}), we obtain%
\begin{equation}
\dbinom{x+y}{n}=\sum_{k\in\mathbb{N}}\dbinom{x}{k}\dbinom{y}{n-k}.
\label{pf.thm.vandermonde.RR.1st-fml.at2}%
\end{equation}


On the other hand, $n\in\mathbb{N}$. If $k$ is an integer satisfying $k>n$,
then $n-k<0$ and thus $n-k\notin\mathbb{N}$ and therefore
\begin{equation}
\dbinom{y}{n-k}=0 \label{pf.thm.vandermonde.RR.1st-fml.zero2}%
\end{equation}
(by (\ref{eq.def.binom.def.b}), applied to $y$ and $n-k$ instead of $n$ and
$k$). Thus,%
\begin{align*}
\sum_{k\in\mathbb{N}}\dbinom{x}{k}\dbinom{y}{n-k}  &  =\underbrace{\sum
_{\substack{k\in\mathbb{N};\\k\leq n}}}_{\substack{=\sum_{k\in\left\{
0,1,\ldots,n\right\}  }\\=\sum_{k=0}^{n}}}\dbinom{x}{k}\dbinom{y}{n-k}%
+\sum_{\substack{k\in\mathbb{N};\\k>n}}\dbinom{x}{k}\underbrace{\dbinom
{y}{n-k}}_{\substack{=0\\\text{(by (\ref{pf.thm.vandermonde.RR.1st-fml.zero2}%
))}}}\\
&  =\sum_{k=0}^{n}\dbinom{x}{k}\dbinom{y}{n-k}+\underbrace{\sum
_{\substack{k\in\mathbb{N};\\k>n}}\dbinom{x}{k}0}_{=0}=\sum_{k=0}^{n}%
\dbinom{x}{k}\dbinom{y}{n-k}.
\end{align*}
Hence, (\ref{pf.thm.vandermonde.RR.1st-fml.at2}) becomes%
\[
\dbinom{x+y}{n}=\sum_{k\in\mathbb{N}}\dbinom{x}{k}\dbinom{y}{n-k}=\sum
_{k=0}^{n}\dbinom{x}{k}\dbinom{y}{n-k}.
\]
Thus, (\ref{eq.thm.binom.vanderRR.k=0-n}) is proved. Hence,
(\ref{eq.thm.binom.vanderRR.all-k}) follows as well\footnote{because we have
seen in Remark \ref{rmk.vanderRR.sums-equal} that the right hand sides of
(\ref{eq.thm.binom.vanderRR.k=0-n}) and of (\ref{eq.thm.binom.vanderRR.all-k})
are equal}. This proves Theorem \ref{thm.binom.vanderRR} for $x\in\mathbb{N}$.
\end{proof}

Thus, Exercise \ref{exe.binom.vanderRR.1st-proof} is solved.

\subsection{Solution to Exercise \ref{exe.binom.vander-xkyk}}

In order to solve Exercise \ref{exe.binom.vander-xkyk}, we need to give an
alternative proof of Corollary \ref{cor.binom.vander-xkyk}:

\begin{proof}
[Alternative proof of Corollary \ref{cor.binom.vander-xkyk}.]We have
$y\in\mathbb{N}$. Hence, we can apply (\ref{eq.thm.binom.vanderRR.k=0-n}) to
$y$, $x$ and $y$ instead of $x$, $y$ and $n$ (since we have proved
(\ref{eq.thm.binom.vanderRR.k=0-n}) for $x\in\mathbb{N}$ already). We thus
obtain%
\begin{align*}
\dbinom{y+x}{y}  &  =\sum_{k=0}^{y}\dbinom{y}{k}\dbinom{x}{y-k}=\sum_{k=0}%
^{y}\dbinom{y}{y-k}\underbrace{\dbinom{x}{y-\left(  y-k\right)  }%
}_{\substack{=\dbinom{x}{k}\\\text{(since }y-\left(  y-k\right)  =k\text{)}%
}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have substituted }y-k\text{ for
}k\text{ in the sum}\right) \\
&  =\sum_{k=0}^{y}\underbrace{\dbinom{y}{y-k}\dbinom{x}{k}}_{=\dbinom{x}%
{k}\dbinom{y}{y-k}}=\sum_{k=0}^{y}\dbinom{x}{k}\dbinom{y}{y-k}.
\end{align*}
But%
\[
\sum_{k=0}^{y}\dbinom{x}{k}\underbrace{\dbinom{y}{k}}_{\substack{=\dbinom
{y}{y-k}\\\text{(by Theorem \ref{thm.binom.sym},}\\\text{applied to
}n=y\text{)}}}=\sum_{k=0}^{y}\dbinom{x}{k}\dbinom{y}{y-k}.
\]
Comparing these two equalities, we find%
\[
\sum_{k=0}^{y}\dbinom{x}{k}\dbinom{y}{k}=\dbinom{y+x}{y}=\dbinom{x+y}%
{y}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }y+x=x+y\right)  .
\]
This proves Corollary \ref{cor.binom.vander-xkyk} again.
\end{proof}

\subsection{Solution to Exercise \ref{exe.binom.vander.-1}}

In order to solve Exercise \ref{exe.binom.vander.-1}, we need to solve
Exercise \ref{exe.binom.altsum-partial} \textbf{(a)} again using Theorem
\ref{thm.vandermonde.RR}:

\begin{proof}
[Alternative solution to Exercise \ref{exe.binom.altsum-partial} \textbf{(a)}
using Theorem \ref{thm.vandermonde.RR}.]The equality
(\ref{eq.thm.binom.vanderRR.k=0-n}) (applied to $n$, $-1$ and $m$ instead of
$x$, $y$ and $n$) yields%
\begin{equation}
\dbinom{n+\left(  -1\right)  }{m}=\sum_{k=0}^{m}\dbinom{n}{k}\dbinom{-1}{m-k}.
\label{sol.binom.vander.-1.1}%
\end{equation}
But every $k\in\left\{  0,1,\ldots,m\right\}  $ satisfies $m-k\in\left\{
0,1,\ldots,m\right\}  \subseteq\mathbb{N}$ and thus%
\begin{equation}
\dbinom{-1}{m-k}=\left(  -1\right)  ^{m-k} \label{sol.binom.vander.-1.2}%
\end{equation}
(by (\ref{eq.exa.binom.small.-1Ck}), applied to $m-k$ instead of $k$). Hence,
(\ref{sol.binom.vander.-1.1}) becomes%
\begin{align*}
\dbinom{n+\left(  -1\right)  }{m}  &  =\sum_{k=0}^{m}\dbinom{n}{k}%
\underbrace{\dbinom{-1}{m-k}}_{\substack{=\left(  -1\right)  ^{m-k}\\\text{(by
(\ref{sol.binom.vander.-1.2}))}}}=\sum_{k=0}^{m}\dbinom{n}{k}%
\underbrace{\left(  -1\right)  ^{m-k}}_{\substack{=\left(  -1\right)
^{m+k}\\\text{(since }m-k\equiv m+k\operatorname{mod}2\text{)}}}\\
&  =\sum_{k=0}^{m}\dbinom{n}{k}\underbrace{\left(  -1\right)  ^{m+k}%
}_{=\left(  -1\right)  ^{m}\left(  -1\right)  ^{k}}=\sum_{k=0}^{m}%
\underbrace{\dbinom{n}{k}\left(  -1\right)  ^{m}\left(  -1\right)  ^{k}%
}_{=\left(  -1\right)  ^{m}\left(  -1\right)  ^{k}\dbinom{n}{k}}\\
&  =\sum_{k=0}^{m}\left(  -1\right)  ^{m}\left(  -1\right)  ^{k}\dbinom{n}%
{k}=\left(  -1\right)  ^{m}\sum_{k=0}^{m}\left(  -1\right)  ^{k}\dbinom{n}{k}.
\end{align*}
In view of $n+\left(  -1\right)  =n-1$, this rewrites as%
\[
\dbinom{n-1}{m}=\left(  -1\right)  ^{m}\sum_{k=0}^{m}\left(  -1\right)
^{k}\dbinom{n}{k}.
\]
Multiplying both sides of this equality by $\left(  -1\right)  ^{m}$, we find%
\[
\left(  -1\right)  ^{m}\dbinom{n-1}{m}=\underbrace{\left(  -1\right)
^{m}\left(  -1\right)  ^{m}}_{\substack{=\left(  -1\right)  ^{m+m}%
=1\\\text{(since }m+m=2m\text{ is even)}}}\sum_{k=0}^{m}\left(  -1\right)
^{k}\dbinom{n}{k}=\sum_{k=0}^{m}\left(  -1\right)  ^{k}\dbinom{n}{k}.
\]
Thus, Exercise \ref{exe.binom.altsum-partial} \textbf{(a)} is solved again.
\end{proof}

\subsection{Solution to Exercise \ref{exe.binom.vander-up.hock}}

In order to solve Exercise \ref{exe.binom.vander-up.hock}, we must give an
alternative proof of Theorem \ref{thm.binom.hock} using Proposition
\ref{prop.binom.vander-up}. Let us do this:

\begin{proof}
[Alternative proof of Theorem \ref{thm.binom.hock}.]Forget that we fixed $k$.
For each $x\in\mathbb{N}$, we have%
\begin{align*}
\dbinom{n+1}{x+1}  &  =\sum_{k=0}^{n}\dbinom{k}{x}\underbrace{\dbinom{n-k}{0}%
}_{\substack{=1\\\text{(by (\ref{eq.exa.binom.small.nC0}),}\\\text{applied to
}n-k\\\text{instead of }n\text{)}}}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
Proposition \ref{prop.binom.vander-up}, applied to }y=0\right) \\
&  =\sum_{k=0}^{n}\dbinom{k}{x}=\dbinom{0}{x}+\dbinom{1}{x}+\dbinom{2}%
{x}+\cdots+\dbinom{n}{x}%
\end{align*}
and thus%
\[
\dbinom{0}{x}+\dbinom{1}{x}+\dbinom{2}{x}+\cdots+\dbinom{n}{x}=\dbinom
{n+1}{x+1}.
\]
Renaming $x$ as $k$ in this statement, we obtain the following: For each
$k\in\mathbb{N}$, we have%
\[
\dbinom{0}{k}+\dbinom{1}{k}+\dbinom{2}{k}+\cdots+\dbinom{n}{k}=\dbinom
{n+1}{k+1}.
\]
Thus, Theorem \ref{thm.binom.hock} is proved again.
\end{proof}

\subsection{Reference to solution to Exercise \ref{exe.binom.vander-muts.d}}

Exercise \ref{exe.binom.vander-muts.d} appears (with solution) in
\cite[Proposition 3.32 \textbf{(d)}]{detnotes}. (To be more precise,
\cite[Proposition 3.32 \textbf{(d)}]{detnotes} is only the particular case of
Exercise \ref{exe.binom.vander-muts.d} when $x,y\in\mathbb{Z}$; but the
general case can be proved by the exact same argument.)

\subsection{Solution to Exercise \ref{exe.binom.vander-muts.e}}

\begin{proof}
[Solution to Exercise \ref{exe.binom.vander-muts.e}.]We are in one of the
following two cases:

\textit{Case 1:} We have $x\leq n$.

\textit{Case 2:} We have $x>n$.

Let us first consider Case 1. In this case, we have $x\leq n$. Hence,
$n-x\geq0$, so that $n-x\in\mathbb{N}$ (since $n\in\mathbb{N}$ and
$x\in\mathbb{N}$). Now, $y-x-1=\left(  -x-1\right)  +y$. Hence,%
\begin{align}
\dbinom{y-x-1}{n-x}  &  =\dbinom{\left(  -x-1\right)  +y}{n-x}\nonumber\\
&  =\sum_{k=0}^{n-x}\dbinom{-x-1}{k}\dbinom{y}{n-x-k}
\label{sol.binom.vander-muts.e.c1.1}%
\end{align}
(by (\ref{eq.thm.binom.vanderRR.k=0-n}), applied to $-x-1$ and $n-x$ instead
of $x$ and $n$). Now, we claim the following:

\begin{statement}
\textit{Claim 1:} We have $\dbinom{-x-1}{k}=\left(  -1\right)  ^{k}%
\dbinom{x+k}{x}$ for each $k\in\mathbb{N}$.
\end{statement}

[\textit{Proof of Claim 1:} Let $k\in\mathbb{N}$. Applying upper negation
(Proposition \ref{prop.binom.upneg}) to $x+1$ instead of $n$, we obtain%
\[
\dbinom{-\left(  x+1\right)  }{k}=\left(  -1\right)  ^{k}\dbinom{x+1+k-1}%
{k}=\left(  -1\right)  ^{k}\dbinom{x+k}{k}%
\]
(since $x+1+k-1=x+k$). In view of $-\left(  x+1\right)  =-x-1$, we can rewrite
this as%
\begin{equation}
\dbinom{-x-1}{k}=\left(  -1\right)  ^{k}\dbinom{x+k}{k}.
\label{sol.binom.vander-muts.e.c1.3}%
\end{equation}


However, $x+k\in\mathbb{N}$ (since $x\in\mathbb{N}$ and $k\in\mathbb{N}$).
Hence, Theorem \ref{thm.binom.sym} (applied to $x+k$ instead of $n$) yields
$\dbinom{x+k}{k}=\dbinom{x+k}{\left(  x+k\right)  -k}=\dbinom{x+k}{x}$ (since
$\left(  x+k\right)  -k=x$). This allows us to rewrite
(\ref{sol.binom.vander-muts.e.c1.3}) as%
\[
\dbinom{-x-1}{k}=\left(  -1\right)  ^{k}\dbinom{x+k}{x}.
\]
This proves Claim 1.]

Now, (\ref{sol.binom.vander-muts.e.c1.1}) becomes%
\begin{align}
\dbinom{y-x-1}{n-x}  &  =\sum_{k=0}^{n-x}\underbrace{\dbinom{-x-1}{k}%
}_{\substack{=\left(  -1\right)  ^{k}\dbinom{x+k}{x}\\\text{(by Claim 1)}%
}}\dbinom{y}{n-x-k}=\sum_{k=0}^{n-x}\left(  -1\right)  ^{k}\dbinom{x+k}%
{x}\dbinom{y}{n-x-k}\nonumber\\
&  =\sum_{k=x}^{n}\left(  -1\right)  ^{k-x}\underbrace{\dbinom{x+\left(
k-x\right)  }{x}}_{\substack{=\dbinom{k}{x}\\\text{(since }x+\left(
k-x\right)  =k\text{)}}}\ \ \underbrace{\dbinom{y}{n-x-\left(  k-x\right)  }%
}_{\substack{=\dbinom{y}{n-k}\\\text{(since }n-x-\left(  k-x\right)
=n-k\text{)}}}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have
substituted }k-x\text{ for }k\text{ in the sum}\right) \nonumber\\
&  =\sum_{k=x}^{n}\left(  -1\right)  ^{k-x}\dbinom{k}{x}\dbinom{y}{n-k}.
\label{sol.binom.vander-muts.e.c1.5}%
\end{align}


However, for each $k\in\left\{  0,1,\ldots,x-1\right\}  $, we have $x>k$
(since $k\in\left\{  0,1,\ldots,x-1\right\}  $ entails $k\leq x-1<x$) and
therefore
\begin{equation}
\dbinom{k}{x}=0 \label{sol.binom.vander-muts.e.c1.6}%
\end{equation}
(by Proposition \ref{prop.binom.0}, applied to $k$ and $x$ instead of $n$ and
$k$).

From $x\in\mathbb{N}$, we obtain $x\geq0$. Therefore, $0\leq x\leq n$. Thus,
we can split the sum $\sum_{k=0}^{n}\left(  -1\right)  ^{k-x}\dbinom{k}%
{x}\dbinom{y}{n-k}$ up as follows:%
\begin{align*}
&  \sum_{k=0}^{n}\left(  -1\right)  ^{k-x}\dbinom{k}{x}\dbinom{y}{n-k}\\
&  =\sum_{k=0}^{x-1}\left(  -1\right)  ^{k-x}\underbrace{\dbinom{k}{x}%
}_{\substack{=0\\\text{(by (\ref{sol.binom.vander-muts.e.c1.6}))}}}\dbinom
{y}{n-k}+\sum_{k=x}^{n}\left(  -1\right)  ^{k-x}\dbinom{k}{x}\dbinom{y}{n-k}\\
&  =\underbrace{\sum_{k=0}^{x-1}\left(  -1\right)  ^{k-x}0\dbinom{y}{n-k}%
}_{=0}+\sum_{k=x}^{n}\left(  -1\right)  ^{k-x}\dbinom{k}{x}\dbinom{y}{n-k}\\
&  =\sum_{k=x}^{n}\left(  -1\right)  ^{k-x}\dbinom{k}{x}\dbinom{y}{n-k}.
\end{align*}
Comparing this with (\ref{sol.binom.vander-muts.e.c1.5}), we obtain
$\dbinom{y-x-1}{n-x}=\sum_{k=0}^{n}\left(  -1\right)  ^{k-x}\dbinom{k}%
{x}\dbinom{y}{n-k}$. Thus, Exercise \ref{exe.binom.vander-muts.e} is solved in
Case 1.

Let us now consider Case 2. In this case, we have $x>n$. In other words,
$n<x$. Thus, $n-x<0$, so that $n-x\notin\mathbb{N}$. Hence,
(\ref{eq.def.binom.def.b}) (applied to $y-x-1$ and $n-x$ instead of $n$ and
$k$) yields
\begin{equation}
\dbinom{y-x-1}{n-x}=0. \label{sol.binom.vander-muts.e.c2.5}%
\end{equation}


On the other hand, for each $k\in\left\{  0,1,\ldots,n\right\}  $, we have
$x>k$ (since $k\in\left\{  0,1,\ldots,n\right\}  $ entails $k\leq n<x$) and
therefore
\begin{equation}
\dbinom{k}{x}=0 \label{sol.binom.vander-muts.e.c2.6}%
\end{equation}
(by Proposition \ref{prop.binom.0}, applied to $k$ and $x$ instead of $n$ and
$k$). Hence,%
\[
\sum_{k=0}^{n}\left(  -1\right)  ^{k-x}\underbrace{\dbinom{k}{x}%
}_{\substack{=0\\\text{(by (\ref{sol.binom.vander-muts.e.c2.6}))}}}\dbinom
{y}{n-k}=\sum_{k=0}^{n}\left(  -1\right)  ^{k-x}0\dbinom{y}{n-k}=0.
\]
Comparing this with (\ref{sol.binom.vander-muts.e.c2.5}), we obtain
$\dbinom{y-x-1}{n-x}=\sum_{k=0}^{n}\left(  -1\right)  ^{k-x}\dbinom{k}%
{x}\dbinom{y}{n-k}$. Thus, Exercise \ref{exe.binom.vander-muts.e} is solved in
Case 2.

We have now solved Exercise \ref{exe.binom.vander-muts.e} in both Cases 1 and
2. This completes the solution of this exercise.
\end{proof}

We remark that the most important particular case of Exercise
\ref{exe.binom.vander-muts.e} (namely, the case when $x\leq n$) appears (with
solution) in \cite[Proposition 3.32 \textbf{(e)}]{detnotes}. (To be more
precise, \cite[Proposition 3.32 \textbf{(e)}]{detnotes} is only the particular
case of Exercise \ref{exe.binom.vander-muts.e} when $x\leq n$ and
$y\in\mathbb{Z}$; however, the condition $y\in\mathbb{Z}$ is not used anywhere
in the solution of \cite[Proposition 3.32 \textbf{(e)}]{detnotes}.) The
remaining case (viz., the case when $x>n$) can easily be dealt with by
observing that both sides are $0$ in this case. However, this is more or less
exactly the solution we gave above.

\subsection{Reference to solution to Exercise \ref{exe.binom.xaxb}}

Exercise \ref{exe.binom.xaxb} appears (with solution) in \cite[Proposition
3.37]{detnotes} (with $x$ renamed as $m$). (To be more precise,
\cite[Proposition 3.37]{detnotes} is only the particular case of Exercise
\ref{exe.binom.xaxb} when $x\in\mathbb{Q}$; but the general case can be proved
by the exact same argument.)

\subsection{Solution to Exercise \ref{exe.binom.pfaffsaal}}

\begin{proof}
[Solution to Exercise \ref{exe.binom.pfaffsaal}.]We shall first solve the
exercise through a computation. In order to keep the computation short, we
shall omit the justifications of some of its steps; these justifications will
instead be provided after the computation.

Here is the computation:%
\begin{align*}
&  \sum_{i=0}^{\min\left\{  a,b\right\}  }\dbinom{x+y+i}{i}\dbinom{x}%
{a-i}\dbinom{y}{b-i}\\
&  =\sum_{i=0}^{b}\underbrace{\dbinom{x+y+i}{i}}_{\substack{=\sum
_{j\in\mathbb{N}}\dbinom{y+a}{j}\dbinom{x-a+i}{i-j}\\\text{(by
Chu--Vandermonde;}\\\text{see Justification 2 below for the details)}}%
}\dbinom{x}{a-i}\dbinom{y}{b-i}\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{see Justification 1
below for why this equality holds}\right) \\
&  =\sum_{i=0}^{b}\left(  \sum_{j\in\mathbb{N}}\dbinom{y+a}{j}\dbinom
{x-a+i}{i-j}\right)  \dbinom{x}{a-i}\dbinom{y}{b-i}\\
&  =\sum_{i=0}^{b}\ \ \sum_{j\in\mathbb{N}}\dbinom{y+a}{j}\underbrace{\dbinom
{x-a+i}{i-j}\dbinom{x}{a-i}}_{\substack{=\dbinom{x}{a-j}\dbinom{a-j}%
{i-j}\\\text{(by Proposition \ref{prop.binom.trin-rev2};}\\\text{see
Justification 3 below for the details)}}}\dbinom{y}{b-i}\\
&  =\sum_{i=0}^{b}\ \ \underbrace{\sum_{j\in\mathbb{N}}\dbinom{y+a}{j}%
\dbinom{x}{a-j}\dbinom{a-j}{i-j}\dbinom{y}{b-i}}_{\substack{=\sum_{j=0}%
^{a}\dbinom{y+a}{j}\dbinom{x}{a-j}\dbinom{a-j}{i-j}\dbinom{y}{b-i}\\\text{(see
Justification 4 below for why this equality holds)}}}\\
&  =\underbrace{\sum_{i=0}^{b}\ \ \sum_{j=0}^{a}}_{=\sum_{j=0}^{a}%
\ \ \sum_{i=0}^{b}}\dbinom{y+a}{j}\dbinom{x}{a-j}\dbinom{a-j}{i-j}\dbinom
{y}{b-i}\\
&  =\sum_{j=0}^{a}\ \ \sum_{i=0}^{b}\dbinom{y+a}{j}\dbinom{x}{a-j}\dbinom
{a-j}{i-j}\dbinom{y}{b-i}\\
&  =\sum_{j=0}^{a}\dbinom{y+a}{j}\dbinom{x}{a-j}\underbrace{\sum_{i=0}%
^{b}\dbinom{a-j}{i-j}\dbinom{y}{b-i}}_{\substack{_{=\dbinom{a-j+y}{b-j}%
}\\\text{(by Chu--Vandermonde;}\\\text{see Justification 5 below for the
details)}}}
\end{align*}%
\begin{align*}
&  =\sum_{j=0}^{a}\dbinom{y+a}{j}\underbrace{\dbinom{x}{a-j}\dbinom
{a-j+y}{b-j}}_{=\dbinom{a-j+y}{b-j}\dbinom{x}{a-j}}=\sum_{j=0}^{a}%
\underbrace{\dbinom{y+a}{j}\dbinom{a-j+y}{b-j}}_{\substack{=\dbinom{y+a}%
{b}\dbinom{b}{j}\\\text{(by Proposition \ref{prop.binom.trin-rev};}\\\text{see
Justification 6 below for the details)}}}\dbinom{x}{a-j}\\
&  =\sum_{j=0}^{a}\dbinom{y+a}{b}\dbinom{b}{j}\dbinom{x}{a-j}=\dbinom{y+a}%
{b}\underbrace{\sum_{j=0}^{a}\dbinom{b}{j}\dbinom{x}{a-j}}_{\substack{=\dbinom
{x+b}{a}\\\text{(by Chu--Vandermonde;}\\\text{see Justification 7 below for
the details)}}}\\
&  =\dbinom{y+a}{b}\dbinom{x+b}{a}=\dbinom{x+b}{a}\dbinom{y+a}{b}.
\end{align*}


Here are the promised \textbf{justifications}:

\begin{enumerate}
\item \textbf{Justification 1:} We need to justify the equality%
\begin{align}
&  \sum_{i=0}^{\min\left\{  a,b\right\}  }\dbinom{x+y+i}{i}\dbinom{x}%
{a-i}\dbinom{y}{b-i}\nonumber\\
&  =\sum_{i=0}^{b}\dbinom{x+y+i}{i}\dbinom{x}{a-i}\dbinom{y}{b-i}.
\label{sol.binom.pfaffsaal.J1}%
\end{align}


In order to do so, we WLOG assume that $\min\left\{  a,b\right\}  \neq b$
(because (\ref{sol.binom.pfaffsaal.J1}) is clearly true if $\min\left\{
a,b\right\}  =b$). Hence, we must have $\min\left\{  a,b\right\}  =a$ (since
the number $\min\left\{  a,b\right\}  $ necessarily equals one of $a$ and
$b$). Therefore, $a=\min\left\{  a,b\right\}  \leq b$. Thus, $0\leq a\leq b$.
Hence, the sum on the right hand side of (\ref{sol.binom.pfaffsaal.J1}) can be
split up as follows:%
\begin{align*}
&  \sum_{i=0}^{b}\dbinom{x+y+i}{i}\dbinom{x}{a-i}\dbinom{y}{b-i}\\
&  =\underbrace{\sum_{i=0}^{a}}_{\substack{=\sum_{i=0}^{\min\left\{
a,b\right\}  }\\\text{(since }a=\min\left\{  a,b\right\}  \text{)}}%
}\dbinom{x+y+i}{i}\dbinom{x}{a-i}\dbinom{y}{b-i}\\
&  \ \ \ \ \ \ \ \ \ \ +\sum_{i=a+1}^{b}\dbinom{x+y+i}{i}\underbrace{\dbinom
{x}{a-i}}_{\substack{=0\\\text{(since }i\geq a+1>a\text{,}\\\text{thus
}a-i<0\text{, hence }a-i\notin\mathbb{N}\text{,}\\\text{and therefore }%
\dbinom{x}{a-i}=0\\\text{(by (\ref{eq.def.binom.def.b}), applied to }n=x\text{
and }k=a-i\text{))}}}\dbinom{y}{b-i}\\
&  =\sum_{i=0}^{\min\left\{  a,b\right\}  }\dbinom{x+y+i}{i}\dbinom{x}%
{a-i}\dbinom{y}{b-i}+\underbrace{\sum_{i=a+1}^{b}\dbinom{x+y+i}{i}0\dbinom
{y}{b-i}}_{=0}\\
&  =\sum_{i=0}^{\min\left\{  a,b\right\}  }\dbinom{x+y+i}{i}\dbinom{x}%
{a-i}\dbinom{y}{b-i}.
\end{align*}
This proves (\ref{sol.binom.pfaffsaal.J1}).

\item \textbf{Justification 2:} We need to prove the equality%
\begin{equation}
\dbinom{x+y+i}{i}=\sum_{j\in\mathbb{N}}\dbinom{y+a}{j}\dbinom{x-a+i}{i-j}
\label{sol.binom.pfaffsaal.J2}%
\end{equation}
for each $i\in\left\{  0,1,\ldots,b\right\}  $.

To do so, we fix $i\in\left\{  0,1,\ldots,b\right\}  $. Then, $i\in\mathbb{N}%
$. Hence, (\ref{eq.thm.binom.vanderRR.all-k}) (applied to $y+a$, $x-a+i$ and
$i$ instead of $x$, $y$ and $n$) yields\footnote{The summation sign
\textquotedblleft$\sum_{k}$\textquotedblright\ here is shorthand for
\textquotedblleft$\sum_{k\in\mathbb{Z}}$\textquotedblright.}%
\begin{align*}
&  \dbinom{\left(  y+a\right)  +\left(  x-a+i\right)  }{i}\\
&  =\underbrace{\sum_{k}}_{=\sum_{k\in\mathbb{Z}}}\dbinom{y+a}{k}%
\dbinom{x-a+i}{i-k}=\sum_{k\in\mathbb{Z}}\dbinom{y+a}{k}\dbinom{x-a+i}{i-k}\\
&  =\underbrace{\sum_{\substack{k\in\mathbb{Z};\\k\in\mathbb{N}}}}%
_{=\sum_{k\in\mathbb{N}}}\dbinom{y+a}{k}\dbinom{x-a+i}{i-k}+\sum
_{\substack{k\in\mathbb{Z};\\k\notin\mathbb{N}}}\underbrace{\dbinom{y+a}{k}%
}_{\substack{=0\\\text{(by (\ref{eq.def.binom.def.b}) (applied to
}n=y+a\text{)}\\\text{(since }k\notin\mathbb{N}\text{))}}}\dbinom{x-a+i}%
{i-k}\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since each }k\in\mathbb{Z}\text{ satisfies}\\
\text{either }k\in\mathbb{N}\text{ or }k\notin\mathbb{N}\text{ (but not both)}%
\end{array}
\right) \\
&  =\sum_{k\in\mathbb{N}}\dbinom{y+a}{k}\dbinom{x-a+i}{i-k}+\underbrace{\sum
_{\substack{k\in\mathbb{Z};\\k\notin\mathbb{N}}}0\dbinom{x-a+i}{i-k}}_{=0}\\
&  =\sum_{k\in\mathbb{N}}\dbinom{y+a}{k}\dbinom{x-a+i}{i-k}=\sum
_{j\in\mathbb{N}}\dbinom{y+a}{j}\dbinom{x-a+i}{i-j}%
\end{align*}
(here, we have renamed the summation index $k$ as $j$). In view of $\left(
y+a\right)  +\left(  x-a+i\right)  =x+y+i$, we can rewrite this as%
\[
\dbinom{x+y+i}{i}=\sum_{j\in\mathbb{N}}\dbinom{y+a}{j}\dbinom{x-a+i}{i-j}.
\]
Thus, (\ref{sol.binom.pfaffsaal.J2}) is proven.

\item \textbf{Justification 3:} We need to prove the equality
\begin{equation}
\dbinom{x-a+i}{i-j}\dbinom{x}{a-i}=\dbinom{x}{a-j}\dbinom{a-j}{i-j}
\label{sol.binom.pfaffsaal.J3}%
\end{equation}
for any $i\in\left\{  0,1,\ldots,b\right\}  $ and any $j\in\mathbb{N}$.

To prove this equality, we fix some $i\in\left\{  0,1,\ldots,b\right\}  $ and
$j\in\mathbb{N}$. Then, Proposition \ref{prop.binom.trin-rev2} (applied to
$x$, $a-j$ and $i-j$ instead of $n$, $a$ and $b$) yields%
\begin{align*}
\dbinom{x}{a-j}\dbinom{a-j}{i-j}  &  =\dbinom{x}{\left(  a-j\right)  -\left(
i-j\right)  }\dbinom{x-\left(  a-j\right)  +\left(  i-j\right)  }{i-j}\\
&  =\dbinom{x}{a-i}\dbinom{x-a+i}{i-j}\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since }\left(  a-j\right)  -\left(  i-j\right)  =a-i\\
\text{and }x-\left(  a-j\right)  +\left(  i-j\right)  =x-a+i
\end{array}
\right) \\
&  =\dbinom{x-a+i}{i-j}\dbinom{x}{a-i}.
\end{align*}
This proves (\ref{sol.binom.pfaffsaal.J3}).

\item \textbf{Justification 4:} We need to explain why the equality%
\begin{align}
&  \sum_{j\in\mathbb{N}}\dbinom{y+a}{j}\dbinom{x}{a-j}\dbinom{a-j}{i-j}%
\dbinom{y}{b-i}\nonumber\\
&  =\sum_{j=0}^{a}\dbinom{y+a}{j}\dbinom{x}{a-j}\dbinom{a-j}{i-j}\dbinom
{y}{b-i} \label{sol.binom.pfaffsaal.J4}%
\end{align}
holds for each $i\in\left\{  0,1,\ldots,b\right\}  $.

For this purpose, we fix $i\in\left\{  0,1,\ldots,b\right\}  $. Then, each
$j\in\mathbb{N}$ satisfies either $j\leq a$ or $j>a$ (but not both at the same
time). Hence, we can split the sum on the left hand side of
(\ref{sol.binom.pfaffsaal.J4}) as follows:
\begin{align*}
&  \sum_{j\in\mathbb{N}}\dbinom{y+a}{j}\dbinom{x}{a-j}\dbinom{a-j}{i-j}%
\dbinom{y}{b-i}\\
&  =\underbrace{\sum_{\substack{j\in\mathbb{N};\\j\leq a}}}_{\substack{=\sum
_{j=0}^{a}\\\text{(since }a\in\mathbb{N}\text{)}}}\dbinom{y+a}{j}\dbinom
{x}{a-j}\dbinom{a-j}{i-j}\dbinom{y}{b-i}\\
&  \ \ \ \ \ \ \ \ \ \ +\sum_{\substack{j\in\mathbb{N};\\j>a}}\dbinom{y+a}%
{j}\underbrace{\dbinom{x}{a-j}}_{\substack{=0\\\text{(since }j>a\text{,}%
\\\text{thus }a-j<0\text{, hence }a-j\notin\mathbb{N}\text{,}\\\text{and
therefore }\dbinom{x}{a-j}=0\\\text{(by (\ref{eq.def.binom.def.b}), applied to
}n=x\text{ and }k=a-j\text{))}}}\dbinom{a-j}{i-j}\dbinom{y}{b-i}\\
&  =\sum_{j=0}^{a}\dbinom{y+a}{j}\dbinom{x}{a-j}\dbinom{a-j}{i-j}\dbinom
{y}{b-i}\\
&  \ \ \ \ \ \ \ \ \ \ +\underbrace{\sum_{\substack{j\in\mathbb{N}%
;\\j>a}}\dbinom{y+a}{j}0\dbinom{a-j}{i-j}\dbinom{y}{b-i}}_{=0}\\
&  =\sum_{j=0}^{a}\dbinom{y+a}{j}\dbinom{x}{a-j}\dbinom{a-j}{i-j}\dbinom
{y}{b-i}.
\end{align*}
This proves (\ref{sol.binom.pfaffsaal.J4}).

\item \textbf{Justification 5:} We need to prove the equality%
\begin{equation}
\sum_{i=0}^{b}\dbinom{a-j}{i-j}\dbinom{y}{b-i}=\dbinom{a-j+y}{b-j}
\label{sol.binom.pfaffsaal.J5}%
\end{equation}
for each $j\in\left\{  0,1,\ldots,a\right\}  $.

To do so, we fix $j\in\left\{  0,1,\ldots,a\right\}  $. We must prove the
equality (\ref{sol.binom.pfaffsaal.J5}). We are in one of the following two cases:

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

\textit{Case 2:} We have $j>b$.

Let us first consider Case 1. In this case, we have $j\leq b$. Thus,
$b-j\geq0$, so that $b-j\in\mathbb{N}$. Hence,
(\ref{eq.thm.binom.vanderRR.k=0-n}) (applied to $a-j$ and $b-j$ instead of $x$
and $n$) yields%
\begin{align}
\dbinom{a-j+y}{b-j}  &  =\sum_{k=0}^{b-j}\dbinom{a-j}{k}\dbinom{y}%
{b-j-k}\nonumber\\
&  =\sum_{i=j}^{b}\dbinom{a-j}{i-j}\underbrace{\dbinom{y}{b-j-\left(
i-j\right)  }}_{\substack{=\dbinom{y}{b-i}\\\text{(since }b-j-\left(
i-j\right)  =b-i\text{)}}}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have
substituted }i-j\text{ for }k\text{ in the sum}\right) \nonumber\\
&  =\sum_{i=j}^{b}\dbinom{a-j}{i-j}\dbinom{y}{b-i}.
\label{sol.binom.pfaffsaal.J5.pf.1}%
\end{align}
On the other hand, $0\leq j\leq b$. Thus, we can subdivide the sum on the left
hand side of (\ref{sol.binom.pfaffsaal.J5}) as follows:%
\begin{align*}
&  \sum_{i=0}^{b}\dbinom{a-j}{i-j}\dbinom{y}{b-i}\\
&  =\sum_{i=0}^{j-1}\underbrace{\dbinom{a-j}{i-j}}_{\substack{=0\\\text{(since
}i\leq j-1<j\text{,}\\\text{thus }i-j<0\text{, hence }i-j\notin\mathbb{N}%
\text{,}\\\text{and therefore }\dbinom{a-j}{i-j}=0\\\text{(by
(\ref{eq.def.binom.def.b}), applied to }n=a-j\text{ and }k=i-j\text{))}%
}}\dbinom{y}{b-i}+\sum_{i=j}^{b}\dbinom{a-j}{i-j}\dbinom{y}{b-i}\\
&  =\underbrace{\sum_{i=0}^{j-1}0\dbinom{y}{b-i}}_{=0}+\sum_{i=j}^{b}%
\dbinom{a-j}{i-j}\dbinom{y}{b-i}\\
&  =\sum_{i=j}^{b}\dbinom{a-j}{i-j}\dbinom{y}{b-i}=\dbinom{a-j+y}%
{b-j}\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{sol.binom.pfaffsaal.J5.pf.1}%
)}\right)  .
\end{align*}
Thus, (\ref{sol.binom.pfaffsaal.J5}) is proved in Case 1.

Let us now consider Case 2. In this case, we have $j>b$. In other words,
$b<j$. Therefore, $b-j<0$, so that $b-j\notin\mathbb{N}$. Therefore,
$\dbinom{a-j+y}{b-j}=0$ (by (\ref{eq.def.binom.def.b}), applied to $n=a-j+y$
and $k=b-j$). Comparing this with%
\[
\sum_{i=0}^{b}\underbrace{\dbinom{a-j}{i-j}}_{\substack{=0\\\text{(since
}i\leq b<j\text{,}\\\text{thus }i-j<0\text{, hence }i-j\notin\mathbb{N}%
\text{,}\\\text{and therefore }\dbinom{a-j}{i-j}=0\\\text{(by
(\ref{eq.def.binom.def.b}), applied to }n=a-j\text{ and }k=i-j\text{))}%
}}\dbinom{y}{b-i}=\sum_{i=0}^{b}0\dbinom{y}{b-i}=0,
\]
we obtain $\sum_{i=0}^{b}\dbinom{a-j}{i-j}\dbinom{y}{b-i}=\dbinom{a-j+y}{b-j}%
$. Thus, (\ref{sol.binom.pfaffsaal.J5}) is proved in Case 2.

We have now proved (\ref{sol.binom.pfaffsaal.J5}) in both Cases 1 and 2. Thus,
the proof of (\ref{sol.binom.pfaffsaal.J5}) is complete.

\item \textbf{Justification 6:} We need to verify the equality%
\begin{equation}
\dbinom{y+a}{j}\dbinom{a-j+y}{b-j}=\dbinom{y+a}{b}\dbinom{b}{j}
\label{sol.binom.pfaffsaal.J6}%
\end{equation}
for each $j\in\left\{  0,1,\ldots,a\right\}  $.

To do so, we fix $j\in\left\{  0,1,\ldots,a\right\}  $. Then, Proposition
\ref{prop.binom.trin-rev} (applied to $y+a$, $b$ and $j$ instead of $n$, $a$
and $b$) yields%
\[
\dbinom{y+a}{b}\dbinom{b}{j}=\dbinom{y+a}{j}\dbinom{y+a-j}{b-j}=\dbinom
{y+a}{j}\dbinom{a-j+y}{b-j}%
\]
(since $y+a-j=a-j+y$). This proves (\ref{sol.binom.pfaffsaal.J6}).

\item \textbf{Justification 7:} We need to prove that%
\begin{equation}
\sum_{j=0}^{a}\dbinom{b}{j}\dbinom{x}{a-j}=\dbinom{x+b}{a}.
\label{sol.binom.pfaffsaal.J7}%
\end{equation}


To do so, we apply (\ref{eq.thm.binom.vanderRR.k=0-n}) to $b$, $x$ and $a$
instead of $x$, $y$ and $n$. We thus obtain%
\[
\dbinom{b+x}{a}=\sum_{k=0}^{a}\dbinom{b}{k}\dbinom{x}{a-k}=\sum_{j=0}%
^{a}\dbinom{b}{j}\dbinom{x}{a-j}%
\]
(here, we have renamed the summation index $k$ as $j$). Thus,%
\[
\sum_{j=0}^{a}\dbinom{b}{j}\dbinom{x}{a-j}=\dbinom{b+x}{a}=\dbinom{x+b}%
{a}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }b+x=x+b\right)  .
\]
This proves (\ref{sol.binom.pfaffsaal.J7}).
\end{enumerate}

We have now fully justified our above computation. The computation shows that
\[
\sum_{i=0}^{\min\left\{  a,b\right\}  }\dbinom{x+y+i}{i}\dbinom{x}{a-i}%
\dbinom{y}{b-i}=\dbinom{x+b}{a}\dbinom{y+a}{b};
\]
thus, Exercise \ref{exe.binom.pfaffsaal} is solved. (The above solution comes
from \cite[\S 3]{Gould72}.)
\end{proof}

\begin{noncompile}
See also \href{https://artofproblemsolving.com/community/c48h80577}{ML
t=80577}.
\end{noncompile}

\subsection{Solution to Exercise \ref{exe.binom.AMM12016}}

\begin{proof}
[Solution to Exercise \ref{exe.binom.AMM12016}.]Let $u,v\in\mathbb{R}$. We
must prove that $F_{x,n}\left(  u,v\right)  =F_{x,n}\left(  v,u\right)  $.

We shall first prove that
\begin{equation}
F_{x,n}\left(  u,v\right)  =\sum_{k=0}^{n}\dbinom{u}{k}\dbinom{v}{k}%
\dbinom{x+u+v-k}{n-k}. \label{sol.binom.AMM12016.main}%
\end{equation}


The proof of this identity will be computational. For the sake of brevity, we
will omit the justifications of some steps of this computation; these
justifications will instead be provided after the computation.

Here is the computation:%
\begin{align*}
&  F_{x,n}\left(  u,v\right) \\
&  =\sum_{i=0}^{n}\dbinom{x+u}{n-i}\underbrace{\dbinom{u+i}{i}}%
_{\substack{=\sum_{b=0}^{i}\dbinom{u}{b}\dbinom{i}{b}\\\text{(by an
application of Corollary \ref{cor.binom.vander-xkyk};}\\\text{see
Justification 1 below for the details)}}}\dbinom{v}{i}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }F_{x,n}\left(
u,v\right)  \right) \\
&  =\sum_{i=0}^{n}\underbrace{\dbinom{x+u}{n-i}\left(  \sum_{b=0}^{i}%
\dbinom{u}{b}\dbinom{i}{b}\right)  \dbinom{v}{i}}_{=\sum_{b=0}^{i}\dbinom
{x+u}{n-i}\dbinom{u}{b}\dbinom{i}{b}\dbinom{v}{i}}\\
&  =\underbrace{\sum_{i=0}^{n}\ \ \sum_{b=0}^{i}}_{\substack{=\sum_{b=0}%
^{n}\ \ \sum_{i=b}^{n}\\\text{(see Justification 2 below for}\\\text{why this
equality holds)}}}\dbinom{x+u}{n-i}\dbinom{u}{b}\underbrace{\dbinom{i}%
{b}\dbinom{v}{i}}_{\substack{=\dbinom{v}{i}\dbinom{i}{b}\\=\dbinom{v}%
{b}\dbinom{v-b}{i-b}\\\text{(by Proposition \ref{prop.binom.trin-rev}%
,}\\\text{applied to }v\text{ and }i\text{ instead of }n\text{ and }a\text{)}%
}}\\
&  =\sum_{b=0}^{n}\ \ \underbrace{\sum_{i=b}^{n}\dbinom{x+u}{n-i}\dbinom{u}%
{b}\dbinom{v}{b}\dbinom{v-b}{i-b}}_{=\dbinom{u}{b}\dbinom{v}{b}\sum_{i=b}%
^{n}\dbinom{x+u}{n-i}\dbinom{v-b}{i-b}}\\
&  =\sum_{b=0}^{n}\dbinom{u}{b}\dbinom{v}{b}\underbrace{\sum_{i=b}^{n}%
\dbinom{x+u}{n-i}\dbinom{v-b}{i-b}}_{\substack{=\dbinom{x+u+v-b}%
{n-b}\\\text{(by Chu--Vandermonde;}\\\text{see Justification 3 below for the
details)}}}\\
&  =\sum_{b=0}^{n}\dbinom{u}{b}\dbinom{v}{b}\dbinom{x+u+v-b}{n-b}=\sum
_{k=0}^{n}\dbinom{u}{k}\dbinom{v}{k}\dbinom{x+u+v-k}{n-k}%
\end{align*}
(here, we have renamed the summation index $b$ as $k$).

Here are the promised \textbf{justifications}:

\begin{enumerate}
\item \textbf{Justification 1:} We need to justify the equality%
\begin{equation}
\dbinom{u+i}{i}=\sum_{b=0}^{i}\dbinom{u}{b}\dbinom{i}{b}
\label{sol.binom.AMM12016.J1}%
\end{equation}
for each $i\in\left\{  0,1,\ldots,n\right\}  $.

In order to do so, we fix an $i\in\left\{  0,1,\ldots,n\right\}  $. Then,
Corollary \ref{cor.binom.vander-xkyk} (applied to $u$ and $i$ instead of $x$
and $y$) yields
\[
\sum_{k=0}^{i}\dbinom{u}{k}\dbinom{i}{k}=\dbinom{u+i}{i}.
\]
Thus,
\[
\dbinom{u+i}{i}=\sum_{k=0}^{i}\dbinom{u}{k}\dbinom{i}{k}=\sum_{b=0}^{i}%
\dbinom{u}{b}\dbinom{i}{b}%
\]
(here, we have renamed the summation index $k$ as $b$). This proves
(\ref{sol.binom.AMM12016.J1}).

\item \textbf{Justification 2:} We need to prove the following equality of
summation signs:%
\begin{equation}
\sum_{i=0}^{n}\ \ \sum_{b=0}^{i}=\sum_{b=0}^{n}\ \ \sum_{i=b}^{n}.
\label{sol.binom.AMM12016.J2}%
\end{equation}


To do so, we transform the left hand side as follows:%
\begin{align*}
&  \underbrace{\sum_{i=0}^{n}}_{=\sum_{i\in\left\{  0,1,\ldots,n\right\}  }%
}\ \ \underbrace{\sum_{b=0}^{i}}_{\substack{=\sum_{b\in\left\{  0,1,\ldots
,i\right\}  }\\=\sum_{\substack{b\in\left\{  0,1,\ldots,n\right\}  ;\\b\leq
i}}\\\text{(since the numbers }b\in\left\{  0,1,\ldots,i\right\}  \\\text{are
precisely the numbers }b\in\left\{  0,1,\ldots,n\right\}  \\\text{that satisfy
}b\leq i\text{ (because }i\leq n\text{))}}}\\
&  =\sum_{i\in\left\{  0,1,\ldots,n\right\}  }\ \ \sum_{\substack{b\in\left\{
0,1,\ldots,n\right\}  ;\\b\leq i}}\\
&  =\underbrace{\sum_{b\in\left\{  0,1,\ldots,n\right\}  }}_{=\sum_{b=0}^{n}%
}\ \ \underbrace{\sum_{\substack{i\in\left\{  0,1,\ldots,n\right\}  ;\\b\leq
i}}}_{\substack{=\sum_{\substack{i\in\left\{  0,1,\ldots,n\right\}  ;\\i\geq
b}}\\\text{(since the condition \textquotedblleft}b\leq
i\text{\textquotedblright}\\\text{is equivalent to \textquotedblleft}i\geq
b\text{\textquotedblright)}}}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have interchanged the}\\
\text{two summation signs}\\
\text{using Theorem \ref{thm.fubini.pred}}%
\end{array}
\right) \\
&  =\sum_{b=0}^{n}\ \ \underbrace{\sum_{\substack{i\in\left\{  0,1,\ldots
,n\right\}  ;\\i\geq b}}}_{\substack{=\sum_{i\in\left\{  b,b+1,\ldots
,n\right\}  }\\\text{(since the numbers }i\in\left\{  0,1,\ldots,n\right\}
\text{ that satisfy }i\geq b\\\text{are precisely the numbers }i\in\left\{
b,b+1,\ldots,n\right\}  \\\text{(because }b\geq0\text{))}}}=\sum_{b=0}%
^{n}\ \ \underbrace{\sum_{i\in\left\{  b,b+1,\ldots,n\right\}  }}_{=\sum
_{i=b}^{n}}=\sum_{b=0}^{n}\ \ \sum_{i=b}^{n}.
\end{align*}
Thus, (\ref{sol.binom.AMM12016.J2}) is proved.

(We note that (\ref{sol.binom.AMM12016.J2}) is an analogue of Corollary
\ref{cor.fubini.tri2} in which the sums start at $0$ instead of $1$. This
yields another easy way to prove (\ref{sol.binom.AMM12016.J2}).)

\item \textbf{Justification 3:} We need to prove the equality
\begin{equation}
\sum_{i=b}^{n}\dbinom{x+u}{n-i}\dbinom{v-b}{i-b}=\dbinom{x+u+v-b}{n-b}
\label{sol.binom.AMM12016.J3}%
\end{equation}
for each $b\in\left\{  0,1,\ldots,n\right\}  $.

To prove this equality, we fix some $b\in\left\{  0,1,\ldots,n\right\}  $.
Then, $b\leq n$, so that $n-b\geq0$. Therefore, $n-b\in\mathbb{N}$. Hence, the
Chu--Vandermonde identity (\ref{eq.thm.binom.vanderRR.k=0-n}) (applied to
$x+u$, $v-b$ and $n-b$ instead of $x$, $y$ and $n$) yields%
\begin{align*}
\dbinom{x+u+v-b}{n-b}  &  =\sum_{k=0}^{n-b}\dbinom{x+u}{k}\dbinom{v-b}%
{n-b-k}\\
&  =\underbrace{\sum_{i=n-\left(  n-b\right)  }^{n}}_{\substack{=\sum
_{i=b}^{n}\\\text{(since }n-\left(  n-b\right)  =b\text{)}}}\dbinom{x+u}%
{n-i}\underbrace{\dbinom{v-b}{n-b-\left(  n-i\right)  }}_{\substack{=\dbinom
{v-b}{i-b}\\\text{(since }n-b-\left(  n-i\right)  =i-b\text{)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have
substituted }n-i\text{ for }k\text{ in the sum}\right) \\
&  =\sum_{i=b}^{n}\dbinom{x+u}{n-i}\dbinom{v-b}{i-b}.
\end{align*}
Thus, (\ref{sol.binom.AMM12016.J3}) is proven.
\end{enumerate}

We have now fully justified our above computation. The computation proves the
equality (\ref{sol.binom.AMM12016.main}). The same argument (with the roles of
$u$ and $v$ interchanged) shows that%
\begin{equation}
F_{x,n}\left(  v,u\right)  =\sum_{k=0}^{n}\dbinom{v}{k}\dbinom{u}{k}%
\dbinom{x+v+u-k}{n-k}. \label{sol.binom.AMM12016.mainvu}%
\end{equation}


However, the right hand sides of the equalities (\ref{sol.binom.AMM12016.main}%
) and (\ref{sol.binom.AMM12016.mainvu}) are equal, since%
\[
\sum_{k=0}^{n}\underbrace{\dbinom{u}{k}\dbinom{v}{k}}_{=\dbinom{v}{k}%
\dbinom{u}{k}}\ \ \underbrace{\dbinom{x+u+v-k}{n-k}}_{\substack{=\dbinom
{x+v+u-k}{n-k}\\\text{(since }u+v=v+u\text{)}}}=\sum_{k=0}^{n}\dbinom{v}%
{k}\dbinom{u}{k}\dbinom{x+v+u-k}{n-k}.
\]
Therefore, the left hand sides of the equalities
(\ref{sol.binom.AMM12016.main}) and (\ref{sol.binom.AMM12016.mainvu}) must
also be equal. In other words, we have $F_{x,n}\left(  u,v\right)
=F_{x,n}\left(  v,u\right)  $. This solves Exercise \ref{exe.binom.AMM12016}.
\end{proof}

Exercise \ref{exe.binom.AMM12016} is a generalized and slightly rewritten
version of American Mathematical Monthly problem \#12016 (by Hideyuki Ohtsuka
and Roberto Tauraso). (In the original problem, the sum in the definition of
$F_{x,n}\left(  u,v\right)  $ had upper limit $v$ instead of $n$; this
necessitates requiring that $u,v\in\mathbb{N}$.)

\subsection{Solution to Exercise \ref{exe.binom.genfun.minus-vd}}

Exercise \ref{exe.binom.genfun.minus-vd} appears (with solution) in
\cite[\S 7.30]{detnotes}. More precisely:

\begin{itemize}
\item Exercise \ref{exe.binom.genfun.minus-vd} \textbf{(a)} is \cite[Lemma
7.49]{detnotes} (with $n$ and $x$ renamed as $m$ and $n$).

\item Exercise \ref{exe.binom.genfun.minus-vd} \textbf{(b)} follows from
\cite[Exercise 3.22]{detnotes}. (Namely, rename $n$ as $m$ in \cite[Exercise
3.22]{detnotes}, and substitute $n$ for $X$ in the resulting equality between
polynomials; then, you obtain precisely the claim of Exercise
\ref{exe.binom.genfun.minus-vd} \textbf{(b)}.)

\item Exercise \ref{exe.binom.genfun.minus-vd} \textbf{(c)} is \cite[Corollary
7.53]{detnotes}.
\end{itemize}

To keep these notes self-contained, let us nevertheless give a solution to
Exercise \ref{exe.binom.genfun.minus-vd} here (this is essentially the first
solution given in \cite[\S 7.30]{detnotes}):

\begin{proof}
[Solution to Exercise \ref{exe.binom.genfun.minus-vd} (sketched).]\textbf{(a)}
Let $n\in\mathbb{N}$ and $m\in\mathbb{N}$.

Let us work with polynomials in one variable $X$, with real coefficients.
Lemma \ref{lem.binom.(1+X)powk} (applied to $p=n$) yields%
\begin{equation}
\left(  1+X\right)  ^{n}=\sum_{i\in\mathbb{N}}\dbinom{n}{i}X^{i}
\label{sol.binom.genfun.minus-vd.a.1}%
\end{equation}
(here, we are using the letter $i$ for the summation index that was called $m$
in Lemma \ref{lem.binom.(1+X)powk}, because the letter $m$ is already being
used for another number in our current setting).

Substituting $-X$ for $X$ in the equality (\ref{sol.binom.genfun.minus-vd.a.1}%
), we obtain%
\begin{align*}
\left(  1+\left(  -X\right)  \right)  ^{n}  &  =\sum_{i\in\mathbb{N}}%
\dbinom{n}{i}\underbrace{\left(  -X\right)  ^{i}}_{=\left(  -1\right)
^{i}X^{i}}=\sum_{i\in\mathbb{N}}\dbinom{n}{i}\left(  -1\right)  ^{i}X^{i}\\
&  =\sum_{i\in\mathbb{N}}\left(  -1\right)  ^{i}\dbinom{n}{i}X^{i}=\sum
_{j\in\mathbb{N}}\left(  -1\right)  ^{j}\dbinom{n}{j}X^{j}%
\end{align*}
(here, we have renamed the summation index $i$ as $j$). In view of $1+\left(
-X\right)  =1-X$, this can be rewritten as%
\begin{equation}
\left(  1-X\right)  ^{n}=\sum_{j\in\mathbb{N}}\left(  -1\right)  ^{j}%
\dbinom{n}{j}X^{j}. \label{sol.binom.genfun.minus-vd.a.2}%
\end{equation}
Substituting $X^{2}$ for $X$ on both sides of this equality, we find%
\[
\left(  1-X^{2}\right)  ^{n}=\sum_{j\in\mathbb{N}}\left(  -1\right)
^{j}\dbinom{n}{j}\underbrace{\left(  X^{2}\right)  ^{j}}_{=X^{2j}}=\sum
_{j\in\mathbb{N}}\left(  -1\right)  ^{j}\dbinom{n}{j}X^{2j}.
\]


Define a polynomial $P$ by $P=\left(  1-X^{2}\right)  ^{n}$. Thus,%
\[
P=\left(  1-X^{2}\right)  ^{n}=\sum_{j\in\mathbb{N}}\left(  -1\right)
^{j}\dbinom{n}{j}X^{2j}=\sum_{\substack{i\in\mathbb{N};\\i\text{ is even}%
}}\left(  -1\right)  ^{i/2}\dbinom{n}{i/2}X^{i}%
\]
(here, we have substituted $i$ for $2j$ in the sum). Hence,
\begin{align}
&  \left(  \text{the }m\text{-th coefficient of }P\right) \nonumber\\
&  =%
\begin{cases}
\left(  -1\right)  ^{m/2}\dbinom{n}{m/2}, & \text{if }m\text{ is even;}\\
0, & \text{if }m\text{ is odd}%
\end{cases}
. \label{sol.binom.genfun.minus-vd.a.R}%
\end{align}


On the other hand, we have
\begin{align*}
P  &  =\left(  \underbrace{1-X^{2}}_{=\left(  1-X\right)  \left(  1+X\right)
}\right)  ^{n}=\left(  \left(  1-X\right)  \left(  1+X\right)  \right)  ^{n}\\
&  =\underbrace{\left(  1-X\right)  ^{n}}_{\substack{=\sum_{j\in\mathbb{N}%
}\left(  -1\right)  ^{j}\dbinom{n}{j}X^{j}\\\text{(by
(\ref{sol.binom.genfun.minus-vd.a.2}))}}}\cdot\underbrace{\left(  1+X\right)
^{n}}_{\substack{=\sum_{i\in\mathbb{N}}\dbinom{n}{i}X^{i}\\\text{(by
(\ref{sol.binom.genfun.minus-vd.a.1}))}}}\\
&  =\left(  \sum_{j\in\mathbb{N}}\left(  -1\right)  ^{j}\dbinom{n}{j}%
X^{j}\right)  \cdot\left(  \sum_{i\in\mathbb{N}}\dbinom{n}{i}X^{i}\right) \\
&  =\sum_{j\in\mathbb{N}}\underbrace{\left(  -1\right)  ^{j}\dbinom{n}{j}%
X^{j}\sum_{i\in\mathbb{N}}\dbinom{n}{i}X^{i}}_{=\sum_{i\in\mathbb{N}}\left(
-1\right)  ^{j}\dbinom{n}{j}X^{j}\dbinom{n}{i}X^{i}}=\sum_{j\in\mathbb{N}%
}\ \ \sum_{i\in\mathbb{N}}\left(  -1\right)  ^{j}\underbrace{\dbinom{n}%
{j}X^{j}\dbinom{n}{i}X^{i}}_{=\dbinom{n}{j}\dbinom{n}{i}X^{j+i}}\\
&  =\sum_{j\in\mathbb{N}}\ \ \sum_{i\in\mathbb{N}}\left(  -1\right)
^{j}\dbinom{n}{j}\dbinom{n}{i}X^{j+i}=\sum_{\left(  j,i\right)  \in
\mathbb{N}^{2}}\left(  -1\right)  ^{j}\dbinom{n}{j}\dbinom{n}{i}X^{j+i}\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by the first equality sign in Theorem \ref{thm.fubini-inf},}\\
\text{since only finitely many }\left(  j,i\right)  \in\mathbb{N}^{2}\text{
satisfy }\left(  -1\right)  ^{j}\dbinom{n}{j}\dbinom{n}{i}X^{j+i}\neq0
\end{array}
\right) \\
&  =\sum_{k\in\mathbb{N}}\ \ \sum_{\substack{\left(  j,i\right)  \in
\mathbb{N}^{2};\\j+i=k}}\left(  -1\right)  ^{j}\dbinom{n}{j}\dbinom{n}%
{i}\underbrace{X^{j+i}}_{\substack{=X^{k}\\\text{(since }j+i=k\text{)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have used
the analogue of (\ref{eq.sum.sheph}) for infinite sums}\right) \\
&  =\sum_{k\in\mathbb{N}}\ \ \sum_{\substack{\left(  j,i\right)  \in
\mathbb{N}^{2};\\j+i=k}}\left(  -1\right)  ^{j}\dbinom{n}{j}\dbinom{n}{i}%
X^{k}=\sum_{k\in\mathbb{N}}\left(  \sum_{\substack{\left(  j,i\right)
\in\mathbb{N}^{2};\\j+i=k}}\left(  -1\right)  ^{j}\dbinom{n}{j}\dbinom{n}%
{i}\right)  X^{k}.
\end{align*}
Hence,
\[
\left(  \text{the }m\text{-th coefficient of }P\right)  =\sum
_{\substack{\left(  j,i\right)  \in\mathbb{N}^{2};\\j+i=m}}\left(  -1\right)
^{j}\dbinom{n}{j}\dbinom{n}{i}=\sum_{k=0}^{m}\left(  -1\right)  ^{k}\dbinom
{n}{k}\dbinom{n}{m-k}%
\]
(here, we have substituted $\left(  k,m-k\right)  $ for $\left(  j,i\right)  $
in the sum, since the map%
\begin{align*}
\left\{  0,1,\ldots,m\right\}   &  \rightarrow\left\{  \left(  j,i\right)
\in\mathbb{N}^{2}\ \mid\ j+i=m\right\}  ,\\
k  &  \mapsto\left(  k,m-k\right)
\end{align*}
is a bijection\footnote{In informal terms, this is just saying that each pair
$\left(  j,i\right)  \in\mathbb{N}^{2}$ of nonnegative integers satisfying
$j+i=m$ has the form $\left(  k,m-k\right)  $ for a unique $k\in\left\{
0,1,\ldots,m\right\}  $ (namely, for $k=j$), and conversely, any pair of the
latter form is a pair $\left(  j,i\right)  \in\mathbb{N}^{2}$ of nonnegative
integers satisfying $j+i=m$.}).

Comparing this with (\ref{sol.binom.genfun.minus-vd.a.R}), we find
\[
\sum_{k=0}^{m}\left(  -1\right)  ^{k}\dbinom{n}{k}\dbinom{n}{m-k}=%
\begin{cases}
\left(  -1\right)  ^{m/2}\dbinom{n}{m/2}, & \text{if }m\text{ is even;}\\
0, & \text{if }m\text{ is odd}%
\end{cases}
.
\]
This solves Exercise \ref{exe.binom.genfun.minus-vd} \textbf{(a)}. \medskip

\textbf{(b)} This is a matter of applying Corollary \ref{cor.polidtrick-c}.
Indeed, let us fix $m\in\mathbb{N}$. Define two polynomials $P$ and $Q$ (in
one variable $X$, with real coefficients) by%
\begin{equation}
P=\sum_{k=0}^{m}\left(  -1\right)  ^{k}\dbinom{X}{k}\dbinom{X}{m-k}
\label{sol.binom.genfun.minus-vd.P=}%
\end{equation}
and%
\begin{equation}
Q=%
\begin{cases}
\left(  -1\right)  ^{m/2}\dbinom{X}{m/2}, & \text{if }m\text{ is even;}\\
0, & \text{if }m\text{ is odd}%
\end{cases}
. \label{sol.binom.genfun.minus-vd.Q=}%
\end{equation}
(Both $P$ and $Q$ are indeed polynomials, since $m$ is fixed!)

Now, recall Proposition \ref{prop.polidtrick.subst-into-bin}. This proposition
says that if we substitute a real number $n\in\mathbb{R}$ into the polynomial
$\dbinom{X}{k}$ (for some given $k\in\mathbb{R}$), then we obtain the number
$\dbinom{n}{k}$. Renaming the number $n$ as $x$ in this statement, we obtain
the following: If we substitute a real number $x\in\mathbb{R}$ into the
polynomial $\dbinom{X}{k}$ (for some given $k\in\mathbb{R}$), then we obtain
the number $\dbinom{x}{k}$.

Hence, for each $x\in\mathbb{R}$, we have%
\begin{equation}
P\left(  x\right)  =\sum_{k=0}^{m}\left(  -1\right)  ^{k}\dbinom{x}{k}%
\dbinom{x}{m-k} \label{sol.binom.genfun.minus-vd.Px=}%
\end{equation}
(indeed, this follows by substituting $x$ on both sides of
(\ref{sol.binom.genfun.minus-vd.P=})) and%
\begin{equation}
Q\left(  x\right)  =%
\begin{cases}
\left(  -1\right)  ^{m/2}\dbinom{x}{m/2}, & \text{if }m\text{ is even;}\\
0, & \text{if }m\text{ is odd}%
\end{cases}
\label{sol.binom.genfun.minus-vd.Qx=}%
\end{equation}
(likewise). Hence, for each $x\in\mathbb{N}$, we have%
\begin{align*}
P\left(  x\right)   &  =\sum_{k=0}^{m}\left(  -1\right)  ^{k}\dbinom{x}%
{k}\dbinom{x}{m-k}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{sol.binom.genfun.minus-vd.Px=})}\right) \\
&  =%
\begin{cases}
\left(  -1\right)  ^{m/2}\dbinom{x}{m/2}, & \text{if }m\text{ is even;}\\
0, & \text{if }m\text{ is odd}%
\end{cases}
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Exercise \ref{exe.binom.genfun.minus-vd}
\textbf{(a)}, applied to }n=x\right) \\
&  =Q\left(  x\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{sol.binom.genfun.minus-vd.Qx=})}\right)  .
\end{align*}
Therefore, Corollary \ref{cor.polidtrick-c} yields $P=Q$. Thus, $P\left(
x\right)  =Q\left(  x\right)  $ for all $x\in\mathbb{R}$. In view of
(\ref{sol.binom.genfun.minus-vd.Px=}) and (\ref{sol.binom.genfun.minus-vd.Qx=}%
), we can rewrite this as follows:%
\[
\sum_{k=0}^{m}\left(  -1\right)  ^{k}\dbinom{x}{k}\dbinom{x}{m-k}=%
\begin{cases}
\left(  -1\right)  ^{m/2}\dbinom{x}{m/2}, & \text{if }m\text{ is even;}\\
0, & \text{if }m\text{ is odd}%
\end{cases}
\ \ \ \ \ \ \ \ \ \ \text{for all }x\in\mathbb{R}.
\]
Renaming the variable $x$ as $n$ in this result, we obtain the following:%
\[
\sum_{k=0}^{m}\left(  -1\right)  ^{k}\dbinom{n}{k}\dbinom{n}{m-k}=%
\begin{cases}
\left(  -1\right)  ^{m/2}\dbinom{n}{m/2}, & \text{if }m\text{ is even;}\\
0, & \text{if }m\text{ is odd}%
\end{cases}
\ \ \ \ \ \ \ \ \ \ \text{for all }n\in\mathbb{R}.
\]
In other words, the claim of Exercise \ref{exe.binom.genfun.minus-vd}
\textbf{(a)} holds for all $n\in\mathbb{R}$ (rather than only for
$n\in\mathbb{N}$). This solves Exercise \ref{exe.binom.genfun.minus-vd}
\textbf{(b)}. \medskip

\textbf{(c)} Let $n\in\mathbb{N}$. Then,%
\begin{align*}
&  \sum_{k=0}^{n}\left(  -1\right)  ^{k}\underbrace{\dbinom{n}{k}^{2}%
}_{=\dbinom{n}{k}\dbinom{n}{k}}\\
&  =\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n}{k}\underbrace{\dbinom
{n}{k}}_{\substack{=\dbinom{n}{n-k}\\\text{(by Theorem \ref{thm.binom.sym})}%
}}\\
&  =\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n}{k}\dbinom{n}{n-k}=%
\begin{cases}
\left(  -1\right)  ^{n/2}\dbinom{n}{n/2}, & \text{if }n\text{ is even;}\\
0, & \text{if }n\text{ is odd}%
\end{cases}
\end{align*}
(by Exercise \ref{exe.binom.genfun.minus-vd} \textbf{(a)}, applied to $m=n$).
This solves Exercise \ref{exe.binom.genfun.minus-vd} \textbf{(c)}.
\end{proof}

\subsection{Solution to Exercise \ref{exe.binom.GM400}}

Exercise \ref{exe.binom.GM400} is Gazeta Matematica problem \#400, proposed by
Mihal Prunescu. Here is a solution using Exercise
\ref{exe.binom.genfun.minus-vd} \textbf{(c)}:

\begin{proof}
[Solution to Exercise \ref{exe.binom.GM400}.]First, we shall show that
\begin{equation}
2^{m}=\sum_{i=0}^{n}\dbinom{m}{i} \label{sol.binom.GM400.1}%
\end{equation}
for each $m\in\left\{  0,1,\ldots,n\right\}  $.

[\textit{Proof of (\ref{sol.binom.GM400.1}):} Let $m\in\left\{  0,1,\ldots
,n\right\}  $. Each $k\in\left\{  m+1,m+2,\ldots,n\right\}  $ satisfies $k\geq
m+1>m$ and therefore%
\begin{equation}
\dbinom{m}{k}=0 \label{sol.binom.GM400.1.pf.2}%
\end{equation}
(by Proposition \ref{prop.binom.0}, applied to $m$ instead of $n$).

However, from $m\in\left\{  0,1,\ldots,n\right\}  $, we obtain $0\leq m\leq
n$. Hence, we can split the sum $\sum_{k=0}^{n}\dbinom{m}{k}$ as follows:%
\[
\sum_{k=0}^{n}\dbinom{m}{k}=\underbrace{\sum_{k=0}^{m}\dbinom{m}{k}%
}_{\substack{=2^{m}\\\text{(by Corollary \ref{cor.binom.2pown},}%
\\\text{applied to }m\text{ instead of }n\text{)}}}+\sum_{k=m+1}%
^{n}\underbrace{\dbinom{m}{k}}_{\substack{=0\\\text{(by
(\ref{sol.binom.GM400.1.pf.2}))}}}=2^{m}+\underbrace{\sum_{k=m+1}^{n}0}%
_{=0}=2^{m}.
\]
Therefore,%
\[
2^{m}=\sum_{k=0}^{n}\dbinom{m}{k}=\sum_{i=0}^{n}\dbinom{m}{i}%
\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we renamed the}\\
\text{summation index }k\text{ as }i
\end{array}
\right)  .
\]
This proves (\ref{sol.binom.GM400.1}).] \medskip

Now, we have%
\begin{align}
&  \sum_{k=0}^{n}\underbrace{\left(  -2\right)  ^{k}}_{=\left(  -1\right)
^{k}2^{k}}\dbinom{n}{k}\dbinom{2n-k}{n-k}\nonumber\\
&  =\sum_{k=0}^{n}\left(  -1\right)  ^{k}\underbrace{2^{k}}_{\substack{=\sum
_{i=0}^{n}\dbinom{k}{i}\\\text{(by (\ref{sol.binom.GM400.1}),}\\\text{applied
to }m=k\text{)}}}\dbinom{n}{k}\dbinom{2n-k}{n-k}\nonumber\\
&  =\sum_{k=0}^{n}\underbrace{\left(  -1\right)  ^{k}\left(  \sum_{i=0}%
^{n}\dbinom{k}{i}\right)  \dbinom{n}{k}\dbinom{2n-k}{n-k}}_{=\sum_{i=0}%
^{n}\left(  -1\right)  ^{k}\dbinom{k}{i}\dbinom{n}{k}\dbinom{2n-k}{n-k}%
}\nonumber\\
&  =\underbrace{\sum_{k=0}^{n}\ \ \sum_{i=0}^{n}}_{=\sum_{i=0}^{n}%
\ \ \sum_{k=0}^{n}}\left(  -1\right)  ^{k}\underbrace{\dbinom{k}{i}\dbinom
{n}{k}}_{=\dbinom{n}{k}\dbinom{k}{i}}\dbinom{2n-k}{n-k}\nonumber\\
&  =\sum_{i=0}^{n}\ \ \sum_{k=0}^{n}\left(  -1\right)  ^{k}\underbrace{\dbinom
{n}{k}\dbinom{k}{i}}_{\substack{=\dbinom{n}{i}\dbinom{n-i}{k-i}\\\text{(by
Proposition \ref{prop.binom.trin-rev},}\\\text{applied to }a=k\text{ and
}b=i\text{)}}}\dbinom{2n-k}{n-k}\nonumber\\
&  =\sum_{i=0}^{n}\ \ \underbrace{\sum_{k=0}^{n}\left(  -1\right)  ^{k}%
\dbinom{n}{i}\dbinom{n-i}{k-i}\dbinom{2n-k}{n-k}}_{=\dbinom{n}{i}\sum
_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n-i}{k-i}\dbinom{2n-k}{n-k}%
}\nonumber\\
&  =\sum_{i=0}^{n}\dbinom{n}{i}\sum_{k=0}^{n}\left(  -1\right)  ^{k}%
\dbinom{n-i}{k-i}\dbinom{2n-k}{n-k}. \label{sol.binom.GM400.2}%
\end{align}


Now, we shall show that
\begin{equation}
\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n-i}{k-i}\dbinom{2n-k}%
{n-k}=\left(  -1\right)  ^{i}\dbinom{n}{i} \label{sol.binom.GM400.3}%
\end{equation}
for each $i\in\left\{  0,1,\ldots,n\right\}  $.

[\textit{Proof of (\ref{sol.binom.GM400.3}):} Let $i\in\left\{  0,1,\ldots
,n\right\}  $. Thus, $0\leq i\leq n$. From $i\leq n$, we obtain $n-i\geq0$,
thus $n-i\in\mathbb{N}$.

For each $k\in\mathbb{Z}$, we have%
\begin{align}
\dbinom{2n-k}{n-k}  &  =\dbinom{-\left(  k-2n\right)  }{n-k}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }2n-k=-\left(  k-2n\right)  \right)
\nonumber\\
&  =\left(  -1\right)  ^{n-k}\dbinom{\left(  k-2n\right)  +\left(  n-k\right)
-1}{n-k}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Proposition \ref{prop.binom.upneg},}\\
\text{applied to }k-2n\text{ and }n-k\\
\text{instead of }n\text{ and }k
\end{array}
\right) \nonumber\\
&  =\left(  -1\right)  ^{n-k}\dbinom{-n-1}{n-k} \label{sol.binom.GM400.3.pf.1}%
\end{align}
(since $\left(  k-2n\right)  +\left(  n-k\right)  -1=-n-1$). Hence,
\begin{align}
&  \sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n-i}{k-i}\underbrace{\dbinom
{2n-k}{n-k}}_{\substack{=\left(  -1\right)  ^{n-k}\dbinom{-n-1}{n-k}%
\\\text{(by (\ref{sol.binom.GM400.3.pf.1}))}}}\nonumber\\
&  =\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n-i}{k-i}\left(  -1\right)
^{n-k}\dbinom{-n-1}{n-k}\nonumber\\
&  =\sum_{k=0}^{n}\underbrace{\left(  -1\right)  ^{k}\left(  -1\right)
^{n-k}}_{\substack{=\left(  -1\right)  ^{k+\left(  n-k\right)  }=\left(
-1\right)  ^{n}\\\text{(since }k+\left(  n-k\right)  =n\text{)}}}\dbinom
{n-i}{k-i}\dbinom{-n-1}{n-k}\nonumber\\
&  =\sum_{k=0}^{n}\left(  -1\right)  ^{n}\dbinom{n-i}{k-i}\dbinom{-n-1}{n-k}.
\label{sol.binom.GM400.3.pf.2}%
\end{align}


However, each $k\in\left\{  0,1,\ldots,i-1\right\}  $ satisfies $k\leq i-1<i$
and thus $k-i<0$, so that $k-i\notin\mathbb{N}$ and therefore
\begin{equation}
\dbinom{n-i}{k-i}=0 \label{sol.binom.GM400.3.pf.3}%
\end{equation}
(by (\ref{eq.def.binom.def.b}), applied to $n-i$ and $k-i$ instead of $n$ and
$k$). Now, (\ref{sol.binom.GM400.3.pf.2}) becomes%
\begin{align}
&  \sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n-i}{k-i}\dbinom{2n-k}%
{n-k}\nonumber\\
&  =\sum_{k=0}^{n}\left(  -1\right)  ^{n}\dbinom{n-i}{k-i}\dbinom{-n-1}%
{n-k}\nonumber\\
&  =\sum_{k=0}^{i-1}\left(  -1\right)  ^{n}\underbrace{\dbinom{n-i}{k-i}%
}_{\substack{=0\\\text{(by (\ref{sol.binom.GM400.3.pf.3}))}}}\dbinom
{-n-1}{n-k}+\sum_{k=i}^{n}\left(  -1\right)  ^{n}\dbinom{n-i}{k-i}%
\dbinom{-n-1}{n-k}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have split
the sum, because }0\leq i\leq n\right) \nonumber\\
&  =\underbrace{\sum_{k=0}^{i-1}\left(  -1\right)  ^{n}0\dbinom{-n-1}{n-k}%
}_{=0}+\sum_{k=i}^{n}\left(  -1\right)  ^{n}\dbinom{n-i}{k-i}\dbinom
{-n-1}{n-k}\nonumber\\
&  =\sum_{k=i}^{n}\left(  -1\right)  ^{n}\dbinom{n-i}{k-i}\dbinom{-n-1}%
{n-k}\nonumber\\
&  =\sum_{k=0}^{n-i}\left(  -1\right)  ^{n}\underbrace{\dbinom{n-i}{\left(
k+i\right)  -i}}_{\substack{=\dbinom{n-i}{k}\\\text{(since }\left(
k+i\right)  -i=k\text{)}}}\ \ \underbrace{\dbinom{-n-1}{n-\left(  k+i\right)
}}_{\substack{=\dbinom{-n-1}{\left(  n-i\right)  -k}\\\text{(since }n-\left(
k+i\right)  =\left(  n-i\right)  -k\text{)}}}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have substituted }k+i\\
\text{for }k\text{ in the sum}%
\end{array}
\right) \nonumber\\
&  =\sum_{k=0}^{n-i}\left(  -1\right)  ^{n}\dbinom{n-i}{k}\dbinom
{-n-1}{\left(  n-i\right)  -k}\nonumber\\
&  =\left(  -1\right)  ^{n}\sum_{k=0}^{n-i}\dbinom{n-i}{k}\dbinom
{-n-1}{\left(  n-i\right)  -k}. \label{sol.binom.GM400.3.pf.4}%
\end{align}


Now, recall that $n-i\in\mathbb{N}$. Thus, the Chu--Vandermonde identity
(\ref{eq.thm.binom.vanderRR.k=0-n}) (applied to $n-i$, $n-i$ and $-n-1$
instead of $n$, $x$ and $y$) yields%
\[
\dbinom{\left(  n-i\right)  +\left(  -n-1\right)  }{n-i}=\sum_{k=0}%
^{n-i}\dbinom{n-i}{k}\dbinom{-n-1}{\left(  n-i\right)  -k}.
\]
Therefore,%
\begin{align*}
&  \sum_{k=0}^{n-i}\dbinom{n-i}{k}\dbinom{-n-1}{\left(  n-i\right)  -k}\\
&  =\dbinom{\left(  n-i\right)  +\left(  -n-1\right)  }{n-i}\\
&  =\dbinom{-\left(  i+1\right)  }{n-i}\ \ \ \ \ \ \ \ \ \ \left(  \text{since
}\left(  n-i\right)  +\left(  -n-1\right)  =-\left(  i+1\right)  \right) \\
&  =\left(  -1\right)  ^{n-i}\dbinom{\left(  i+1\right)  +\left(  n-i\right)
-1}{n-i}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Proposition \ref{prop.binom.upneg},}\\
\text{applied to }i+1\text{ and }n-i\\
\text{instead of }n\text{ and }k
\end{array}
\right) \\
&  =\left(  -1\right)  ^{n-i}\underbrace{\dbinom{n}{n-i}}_{\substack{=\dbinom
{n}{n-\left(  n-i\right)  }\\\text{(by Theorem \ref{thm.binom.sym}%
,}\\\text{applied to }k=n-i\text{)}}}\ \ \ \ \ \ \ \ \ \ \left(  \text{since
}\left(  i+1\right)  +\left(  n-i\right)  -1=n\right) \\
&  =\left(  -1\right)  ^{n-i}\dbinom{n}{n-\left(  n-i\right)  }=\left(
-1\right)  ^{n-i}\dbinom{n}{i}\ \ \ \ \ \ \ \ \ \ \left(  \text{since
}n-\left(  n-i\right)  =i\right)  .
\end{align*}
Hence, we can rewrite (\ref{sol.binom.GM400.3.pf.4}) as
\[
\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n-i}{k-i}\dbinom{2n-k}%
{n-k}=\underbrace{\left(  -1\right)  ^{n}\left(  -1\right)  ^{n-i}%
}_{\substack{=\left(  -1\right)  ^{n+\left(  n-i\right)  }=\left(  -1\right)
^{i}\\\text{(since }n+\left(  n-i\right)  =2n-i\equiv i\operatorname{mod}%
2\text{)}}}\dbinom{n}{i}=\left(  -1\right)  ^{i}\dbinom{n}{i}.
\]
This proves (\ref{sol.binom.GM400.3}).] \medskip

Now, (\ref{sol.binom.GM400.2}) becomes%
\begin{align*}
&  \sum_{k=0}^{n}\left(  -2\right)  ^{k}\dbinom{n}{k}\dbinom{2n-k}{n-k}\\
&  =\sum_{i=0}^{n}\dbinom{n}{i}\underbrace{\sum_{k=0}^{n}\left(  -1\right)
^{k}\dbinom{n-i}{k-i}\dbinom{2n-k}{n-k}}_{\substack{=\left(  -1\right)
^{i}\dbinom{n}{i}\\\text{(by (\ref{sol.binom.GM400.3}))}}}=\sum_{i=0}%
^{n}\underbrace{\dbinom{n}{i}\left(  -1\right)  ^{i}\dbinom{n}{i}}_{=\left(
-1\right)  ^{i}\dbinom{n}{i}^{2}}\\
&  =\sum_{i=0}^{n}\left(  -1\right)  ^{i}\dbinom{n}{i}^{2}\\
&  =\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n}{k}^{2}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have renamed the summation index
}i\text{ as }k\right) \\
&  =%
\begin{cases}
\left(  -1\right)  ^{n/2}\dbinom{n}{n/2}, & \text{if }n\text{ is even;}\\
0, & \text{if }n\text{ is odd}%
\end{cases}
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Exercise \ref{exe.binom.genfun.minus-vd}
\textbf{(c)}}\right)  .
\end{align*}
This solves Exercise \ref{exe.binom.GM400}.
\end{proof}

\subsection{Reference to solution to Exercise \ref{exe.DIE.destruct1}}

Proposition \ref{prop.DIE.destruct2} appears (with proof) in \cite[Proposition
6.4]{18f-hw3s} (with $S$ and $T$ renamed as $G$ and $S$).

\subsection{Solution to Exercise \ref{exe.pie.owr-a}}

Before we solve Exercise \ref{exe.pie.owr-a}, let us recall two fundamental
facts from elementary set theory (often called
\href{https://en.wikipedia.org/wiki/De_Morgan's_laws#Set_theory_and_Boolean_algebra}{de
Morgan's laws}):

\begin{proposition}
\label{prop.sets.demorgan2} Let $U$, $X$ and $Y$ be three sets. Then:

\textbf{(a)} We have $U\setminus\left(  X\cup Y\right)  =\left(  U\setminus
X\right)  \cap\left(  U\setminus Y\right)  $.

\textbf{(b)} We have $U\setminus\left(  X\cap Y\right)  =\left(  U\setminus
X\right)  \cup\left(  U\setminus Y\right)  $.
\end{proposition}

We will not prove Proposition \ref{prop.sets.demorgan2}, as it is the domain
of introductory textbooks on proofs and sets; suffice to say that both parts
of the proposition can be proved in straightforward ways using basic logic and
the fact that two sets $P$ and $Q$ satisfy $P=Q$ if and only if $\left(
P\subseteq Q\text{ and }Q\subseteq P\right)  $.

We will use the following generalization of Proposition
\ref{prop.sets.demorgan2} to multiple sets:

\begin{proposition}
\label{prop.sets.demorgank} Let $k$ be a positive integer. Let $U$ be a set.
Let $P_{1},P_{2},\ldots,P_{k}$ be any $k$ sets. Then:

\textbf{(a)} We have
\[
U\setminus\left(  P_{1}\cup P_{2}\cup\cdots\cup P_{k}\right)  =\left(
U\setminus P_{1}\right)  \cap\left(  U\setminus P_{2}\right)  \cap\cdots
\cap\left(  U\setminus P_{k}\right)  .
\]


\textbf{(b)} We have
\[
U\setminus\left(  P_{1}\cap P_{2}\cap\cdots\cap P_{k}\right)  =\left(
U\setminus P_{1}\right)  \cup\left(  U\setminus P_{2}\right)  \cup\cdots
\cup\left(  U\setminus P_{k}\right)  .
\]

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.sets.demorgank}.]\textbf{(a)} We shall prove
Proposition \ref{prop.sets.demorgank} \textbf{(a)} by induction on $k$:

\textit{Induction base:} It is easy to see that Proposition
\ref{prop.sets.demorgank} \textbf{(a)} holds for $k=1$%
\ \ \ \ \footnote{\textit{Proof.} If $U$ is a set, and if $P_{1},P_{2}%
,\ldots,P_{1}$ are any $1$ sets, then%
\[
U\setminus\underbrace{\left(  P_{1}\cup P_{2}\cup\cdots\cup P_{1}\right)
}_{=P_{1}}=U\setminus P_{1}=\left(  U\setminus P_{1}\right)  \cap\left(
U\setminus P_{2}\right)  \cap\cdots\cap\left(  U\setminus P_{1}\right)
\]
(since $\left(  U\setminus P_{1}\right)  \cap\left(  U\setminus P_{2}\right)
\cap\cdots\cap\left(  U\setminus P_{1}\right)  =U\setminus P_{1}$). In other
words, Proposition \ref{prop.sets.demorgank} \textbf{(a)} holds for $k=1$.}.
This completes the induction base.

\textit{Induction step:} Let $m$ be a positive integer. Assume that
Proposition \ref{prop.sets.demorgank} \textbf{(a)} holds for $k=m$. We must
prove that Proposition \ref{prop.sets.demorgank} \textbf{(a)} holds for
$k=m+1$.

Let $U$ be a set. Let $P_{1},P_{2},\ldots,P_{m+1}$ be any $m+1$ sets. We have
assumed that Proposition \ref{prop.sets.demorgank} \textbf{(a)} holds for
$k=m$. Thus, Proposition \ref{prop.sets.demorgank} \textbf{(a)} (applied to
$k=m$) yields
\[
U\setminus\left(  P_{1}\cup P_{2}\cup\cdots\cup P_{m}\right)  =\left(
U\setminus P_{1}\right)  \cap\left(  U\setminus P_{2}\right)  \cap\cdots
\cap\left(  U\setminus P_{m}\right)  .
\]
Now,%
\begin{align*}
&  U\setminus\underbrace{\left(  P_{1}\cup P_{2}\cup\cdots\cup P_{m+1}\right)
}_{=\left(  P_{1}\cup P_{2}\cup\cdots\cup P_{m}\right)  \cup P_{m+1}}\\
&  =U\setminus\left(  \left(  P_{1}\cup P_{2}\cup\cdots\cup P_{m}\right)  \cup
P_{m+1}\right) \\
&  =\underbrace{\left(  U\setminus\left(  P_{1}\cup P_{2}\cup\cdots\cup
P_{m}\right)  \right)  }_{=\left(  U\setminus P_{1}\right)  \cap\left(
U\setminus P_{2}\right)  \cap\cdots\cap\left(  U\setminus P_{m}\right)  }%
\cap\left(  U\setminus P_{m+1}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition \ref{prop.sets.demorgan2}
\textbf{(a)}, applied to }X=P_{1}\cup P_{2}\cup\cdots\cup P_{m}\text{ and
}Y=P_{m+1}\right) \\
&  =\left(  \left(  U\setminus P_{1}\right)  \cap\left(  U\setminus
P_{2}\right)  \cap\cdots\cap\left(  U\setminus P_{m}\right)  \right)
\cap\left(  U\setminus P_{m+1}\right) \\
&  =\left(  U\setminus P_{1}\right)  \cap\left(  U\setminus P_{2}\right)
\cap\cdots\cap\left(  U\setminus P_{m+1}\right)  .
\end{align*}


Now, forget that we fixed $U$ and $P_{1},P_{2},\ldots,P_{m+1}$. We thus have
shown that if $U$ is a set, and if $P_{1},P_{2},\ldots,P_{m+1}$ are any $m+1$
sets, then
\[
U\setminus\left(  P_{1}\cup P_{2}\cup\cdots\cup P_{m+1}\right)  =\left(
U\setminus P_{1}\right)  \cap\left(  U\setminus P_{2}\right)  \cap\cdots
\cap\left(  U\setminus P_{m+1}\right)  .
\]
In other words, Proposition \ref{prop.sets.demorgank} \textbf{(a)} holds for
$k=m+1$. This completes the induction step. Hence, Proposition
\ref{prop.sets.demorgank} \textbf{(a)} is proved by induction.

\textbf{(b)} In order to obtain a proof of Proposition
\ref{prop.sets.demorgank} \textbf{(b)}, it suffices to make some simple
modifications to our above proof of Proposition \ref{prop.sets.demorgank}
\textbf{(a)} (namely: replace all \textquotedblleft$\cup$\textquotedblright%
\ signs by \textquotedblleft$\cap$\textquotedblright\ signs and vice versa,
and replace the reference to Proposition \ref{prop.sets.demorgan2}
\textbf{(a)} by a reference to Proposition \ref{prop.sets.demorgan2}
\textbf{(b)}).
\end{proof}

Now, let us solve Exercise \ref{exe.pie.owr-a}:

\begin{proof}
[Solution to Exercise \ref{exe.pie.owr-a}.]Let $U$ be the set $A_{1}\cup
A_{2}\cup\cdots\cup A_{n}$. Thus, $U$ is the union of the $n$ finite sets
$A_{1},A_{2},\ldots,A_{n}$, and thus itself a finite set. Moreover, all the
$n$ sets $A_{1},A_{2},\ldots,A_{n}$ clearly are subsets of their union
$A_{1}\cup A_{2}\cup\cdots\cup A_{n}$. In other words, all the $n$ sets
$A_{1},A_{2},\ldots,A_{n}$ are subsets of $U$ (since $U=A_{1}\cup A_{2}%
\cup\cdots\cup A_{n}$).

For each $i\in\left\{  1,2,\ldots,n\right\}  $, we define a set $B_{i}$ by
$B_{i}=U\setminus A_{i}$. Thus, for each $i\in\left\{  1,2,\ldots,n\right\}
$, the set $B_{i}$ is a subset of the set $U$ (since $B_{i}=U\setminus A_{i}%
$), and thus is finite (since $U$ is finite). Hence, Theorem
\ref{thm.pie.a-ik} (applied to $B_{i}$ instead of $A_{i}$) yields%
\begin{align}
&  \left\vert B_{1}\cup B_{2}\cup\cdots\cup B_{n}\right\vert \nonumber\\
&  =\sum_{m=1}^{n}\left(  -1\right)  ^{m-1}\sum_{\substack{\left(  i_{1}%
,i_{2},\ldots,i_{m}\right)  \in\left[  n\right]  ^{m};\\i_{1}<i_{2}%
<\cdots<i_{m}}}\left\vert B_{i_{1}}\cap B_{i_{2}}\cap\cdots\cap B_{i_{m}%
}\right\vert . \label{sol.pie.owr-a.sizeunionB=}%
\end{align}
On the other hand, Theorem \ref{thm.pie.a-ik} (applied to $U$ instead of
$A_{i}$) yields%
\begin{align*}
\left\vert \underbrace{U\cup U\cup\cdots\cup U}_{n\text{ times}}\right\vert
&  =\sum_{m=1}^{n}\left(  -1\right)  ^{m-1}\sum_{\substack{\left(  i_{1}%
,i_{2},\ldots,i_{m}\right)  \in\left[  n\right]  ^{m};\\i_{1}<i_{2}%
<\cdots<i_{m}}}\left\vert \underbrace{\underbrace{U\cap U\cap\cdots\cap
U}_{m\text{ times}}}_{\substack{=U\\\text{(since }m\geq1\text{)}}}\right\vert
\\
&  =\sum_{m=1}^{n}\left(  -1\right)  ^{m-1}\sum_{\substack{\left(  i_{1}%
,i_{2},\ldots,i_{m}\right)  \in\left[  n\right]  ^{m};\\i_{1}<i_{2}%
<\cdots<i_{m}}}\left\vert U\right\vert .
\end{align*}
In view of
\[
\underbrace{U\cup U\cup\cdots\cup U}_{n\text{ times}}%
=U\ \ \ \ \ \ \ \ \ \ \left(  \text{since }n\text{ is positive}\right)  ,
\]
this rewrites as
\begin{equation}
\left\vert U\right\vert =\sum_{m=1}^{n}\left(  -1\right)  ^{m-1}%
\sum_{\substack{\left(  i_{1},i_{2},\ldots,i_{m}\right)  \in\left[  n\right]
^{m};\\i_{1}<i_{2}<\cdots<i_{m}}}\left\vert U\right\vert .
\label{sol.pie.owr-a.sizeU=}%
\end{equation}


However, we have the following two statements:

\begin{statement}
\textit{Statement 1:} We have%
\[
\left\vert B_{1}\cup B_{2}\cup\cdots\cup B_{n}\right\vert =\left\vert
U\right\vert -\left\vert A_{1}\cap A_{2}\cap\cdots\cap A_{n}\right\vert .
\]

\end{statement}

\begin{statement}
\textit{Statement 2:} Let $m\in\left\{  1,2,\ldots,n\right\}  $. Let $\left(
i_{1},i_{2},\ldots,i_{m}\right)  \in\left[  n\right]  ^{m}$. Then,%
\[
\left\vert B_{i_{1}}\cap B_{i_{2}}\cap\cdots\cap B_{i_{m}}\right\vert
=\left\vert U\right\vert -\left\vert A_{i_{1}}\cup A_{i_{2}}\cup\cdots\cup
A_{i_{m}}\right\vert .
\]

\end{statement}

[\textit{Proof of Statement 1:} Recall that all the $n$ sets $A_{1}%
,A_{2},\ldots,A_{n}$ are subsets of $U$. Thus, in particular, $A_{1}$ is a
subset of $U$. In other words, $A_{1}\subseteq U$. Hence, $A_{1}\cap A_{2}%
\cap\cdots\cap A_{n}$ is a subset of $U$ as well (since $A_{1}\cap A_{2}%
\cap\cdots\cap A_{n}\subseteq A_{1}\subseteq U$). Hence, Theorem
\ref{thm.subset-leq} \textbf{(a)} (applied to $U$ and $A_{1}\cap A_{2}%
\cap\cdots\cap A_{n}$ instead of $A$ and $B$) yields%
\begin{equation}
\left\vert U\setminus\left(  A_{1}\cap A_{2}\cap\cdots\cap A_{n}\right)
\right\vert =\left\vert U\right\vert -\left\vert A_{1}\cap A_{2}\cap\cdots\cap
A_{n}\right\vert . \label{sol.pie.owr-a.s1.pf.1}%
\end{equation}
But each $i\in\left\{  1,2,\ldots,n\right\}  $ satisfies $B_{i}=U\setminus
A_{i}$ (by the definition of $B_{i}$). Hence,%
\[
\left(  B_{1},B_{2},\ldots,B_{n}\right)  =\left(  U\setminus A_{1},U\setminus
A_{2},\ldots,U\setminus A_{n}\right)  .
\]
Thus,%
\[
B_{1}\cup B_{2}\cup\cdots\cup B_{n}=\left(  U\setminus A_{1}\right)
\cup\left(  U\setminus A_{2}\right)  \cup\cdots\cup\left(  U\setminus
A_{n}\right)  .
\]
But Proposition \ref{prop.sets.demorgank} \textbf{(b)} (applied to $k=n$ and
$P_{j}=A_{j}$) yields%
\[
U\setminus\left(  A_{1}\cap A_{2}\cap\cdots\cap A_{n}\right)  =\left(
U\setminus A_{1}\right)  \cup\left(  U\setminus A_{2}\right)  \cup\cdots
\cup\left(  U\setminus A_{n}\right)  .
\]
Comparing these two equalities, we obtain%
\[
U\setminus\left(  A_{1}\cap A_{2}\cap\cdots\cap A_{n}\right)  =B_{1}\cup
B_{2}\cup\cdots\cup B_{n}.
\]
In light of this equality, we can rewrite (\ref{sol.pie.owr-a.s1.pf.1}) as%
\[
\left\vert B_{1}\cup B_{2}\cup\cdots\cup B_{n}\right\vert =\left\vert
U\right\vert -\left\vert A_{1}\cap A_{2}\cap\cdots\cap A_{n}\right\vert .
\]
This proves Statement 1.]

[\textit{Proof of Statement 2:} We have $\left(  i_{1},i_{2},\ldots
,i_{m}\right)  \in\left[  n\right]  ^{m}$. Thus, $i_{1},i_{2},\ldots,i_{m}$
are elements of $\left[  n\right]  =\left\{  1,2,\ldots,n\right\}  $.

Recall that all the $n$ sets $A_{1},A_{2},\ldots,A_{n}$ are subsets of $U$.
Hence, in particular, the sets $A_{i_{1}},A_{i_{2}},\ldots,A_{i_{m}}$ are
subsets of $U$ (since $i_{1},i_{2},\ldots,i_{m}$ are elements of $\left\{
1,2,\ldots,n\right\}  $). Thus, their union $A_{i_{1}}\cup A_{i_{2}}\cup
\cdots\cup A_{i_{m}}$ is a subset of $U$ as well (since a union of subsets of
$U$ is always a subset of $U$). Hence, Theorem \ref{thm.subset-leq}
\textbf{(a)} (applied to $U$ and $A_{i_{1}}\cup A_{i_{2}}\cup\cdots\cup
A_{i_{m}}$ instead of $A$ and $B$) yields%
\begin{equation}
\left\vert U\setminus\left(  A_{i_{1}}\cup A_{i_{2}}\cup\cdots\cup A_{i_{m}%
}\right)  \right\vert =\left\vert U\right\vert -\left\vert A_{i_{1}}\cup
A_{i_{2}}\cup\cdots\cup A_{i_{m}}\right\vert . \label{sol.pie.owr-a.s2.pf.1}%
\end{equation}
But each $j\in\left\{  1,2,\ldots,m\right\}  $ satisfies $B_{i_{j}}=U\setminus
A_{i_{j}}$ (by the definition of $B_{i_{j}}$). Hence,%
\[
\left(  B_{i_{1}},B_{i_{2}},\ldots,B_{i_{m}}\right)  =\left(  U\setminus
A_{i_{1}},U\setminus A_{i_{2}},\ldots,U\setminus A_{i_{m}}\right)  .
\]
Thus,%
\[
B_{i_{1}}\cap B_{i_{2}}\cap\cdots\cap B_{i_{m}}=\left(  U\setminus A_{i_{1}%
}\right)  \cap\left(  U\setminus A_{i_{2}}\right)  \cap\cdots\cap\left(
U\setminus A_{i_{m}}\right)  .
\]
But Proposition \ref{prop.sets.demorgank} \textbf{(a)} (applied to $k=m$ and
$P_{j}=A_{i_{j}}$) yields%
\[
U\setminus\left(  A_{i_{1}}\cup A_{i_{2}}\cup\cdots\cup A_{i_{m}}\right)
=\left(  U\setminus A_{i_{1}}\right)  \cap\left(  U\setminus A_{i_{2}}\right)
\cap\cdots\cap\left(  U\setminus A_{i_{m}}\right)  .
\]
Comparing these two equalities, we obtain%
\[
U\setminus\left(  A_{i_{1}}\cup A_{i_{2}}\cup\cdots\cup A_{i_{m}}\right)
=B_{i_{1}}\cap B_{i_{2}}\cap\cdots\cap B_{i_{m}}.
\]
In light of this equality, we can rewrite (\ref{sol.pie.owr-a.s2.pf.1}) as%
\[
\left\vert B_{i_{1}}\cap B_{i_{2}}\cap\cdots\cap B_{i_{m}}\right\vert
=\left\vert U\right\vert -\left\vert A_{i_{1}}\cup A_{i_{2}}\cup\cdots\cup
A_{i_{m}}\right\vert .
\]
This proves Statement 2.]

Now, (\ref{sol.pie.owr-a.sizeunionB=}) becomes%
\begin{align}
&  \left\vert B_{1}\cup B_{2}\cup\cdots\cup B_{n}\right\vert \nonumber\\
&  =\sum_{m=1}^{n}\left(  -1\right)  ^{m-1}\sum_{\substack{\left(  i_{1}%
,i_{2},\ldots,i_{m}\right)  \in\left[  n\right]  ^{m};\\i_{1}<i_{2}%
<\cdots<i_{m}}}\underbrace{\left\vert B_{i_{1}}\cap B_{i_{2}}\cap\cdots\cap
B_{i_{m}}\right\vert }_{\substack{=\left\vert U\right\vert -\left\vert
A_{i_{1}}\cup A_{i_{2}}\cup\cdots\cup A_{i_{m}}\right\vert \\\text{(by
Statement 2)}}}\nonumber\\
&  =\sum_{m=1}^{n}\left(  -1\right)  ^{m-1}\underbrace{\sum_{\substack{\left(
i_{1},i_{2},\ldots,i_{m}\right)  \in\left[  n\right]  ^{m};\\i_{1}%
<i_{2}<\cdots<i_{m}}}\left(  \left\vert U\right\vert -\left\vert A_{i_{1}}\cup
A_{i_{2}}\cup\cdots\cup A_{i_{m}}\right\vert \right)  }_{=\sum
_{\substack{\left(  i_{1},i_{2},\ldots,i_{m}\right)  \in\left[  n\right]
^{m};\\i_{1}<i_{2}<\cdots<i_{m}}}\left\vert U\right\vert -\sum
_{\substack{\left(  i_{1},i_{2},\ldots,i_{m}\right)  \in\left[  n\right]
^{m};\\i_{1}<i_{2}<\cdots<i_{m}}}\left\vert A_{i_{1}}\cup A_{i_{2}}\cup
\cdots\cup A_{i_{m}}\right\vert }\nonumber\\
&  =\sum_{m=1}^{n}\underbrace{\left(  -1\right)  ^{m-1}\left(  \sum
_{\substack{\left(  i_{1},i_{2},\ldots,i_{m}\right)  \in\left[  n\right]
^{m};\\i_{1}<i_{2}<\cdots<i_{m}}}\left\vert U\right\vert -\sum
_{\substack{\left(  i_{1},i_{2},\ldots,i_{m}\right)  \in\left[  n\right]
^{m};\\i_{1}<i_{2}<\cdots<i_{m}}}\left\vert A_{i_{1}}\cup A_{i_{2}}\cup
\cdots\cup A_{i_{m}}\right\vert \right)  }_{=\left(  -1\right)  ^{m-1}%
\sum_{\substack{\left(  i_{1},i_{2},\ldots,i_{m}\right)  \in\left[  n\right]
^{m};\\i_{1}<i_{2}<\cdots<i_{m}}}\left\vert U\right\vert -\left(  -1\right)
^{m-1}\sum_{\substack{\left(  i_{1},i_{2},\ldots,i_{m}\right)  \in\left[
n\right]  ^{m};\\i_{1}<i_{2}<\cdots<i_{m}}}\left\vert A_{i_{1}}\cup A_{i_{2}%
}\cup\cdots\cup A_{i_{m}}\right\vert }\nonumber\\
&  =\sum_{m=1}^{n}\left(  \left(  -1\right)  ^{m-1}\sum_{\substack{\left(
i_{1},i_{2},\ldots,i_{m}\right)  \in\left[  n\right]  ^{m};\\i_{1}%
<i_{2}<\cdots<i_{m}}}\left\vert U\right\vert -\left(  -1\right)  ^{m-1}%
\sum_{\substack{\left(  i_{1},i_{2},\ldots,i_{m}\right)  \in\left[  n\right]
^{m};\\i_{1}<i_{2}<\cdots<i_{m}}}\left\vert A_{i_{1}}\cup A_{i_{2}}\cup
\cdots\cup A_{i_{m}}\right\vert \right) \nonumber\\
&  =\underbrace{\sum_{m=1}^{n}\left(  -1\right)  ^{m-1}\sum_{\substack{\left(
i_{1},i_{2},\ldots,i_{m}\right)  \in\left[  n\right]  ^{m};\\i_{1}%
<i_{2}<\cdots<i_{m}}}\left\vert U\right\vert }_{\substack{=\left\vert
U\right\vert \\\text{(by (\ref{sol.pie.owr-a.sizeU=}))}}}-\sum_{m=1}%
^{n}\left(  -1\right)  ^{m-1}\sum_{\substack{\left(  i_{1},i_{2},\ldots
,i_{m}\right)  \in\left[  n\right]  ^{m};\\i_{1}<i_{2}<\cdots<i_{m}%
}}\left\vert A_{i_{1}}\cup A_{i_{2}}\cup\cdots\cup A_{i_{m}}\right\vert
\nonumber\\
&  =\left\vert U\right\vert -\sum_{m=1}^{n}\left(  -1\right)  ^{m-1}%
\sum_{\substack{\left(  i_{1},i_{2},\ldots,i_{m}\right)  \in\left[  n\right]
^{m};\\i_{1}<i_{2}<\cdots<i_{m}}}\left\vert A_{i_{1}}\cup A_{i_{2}}\cup
\cdots\cup A_{i_{m}}\right\vert . \label{sol.pie.owr-a.at}%
\end{align}


Now, Statement 1 yields%
\[
\left\vert B_{1}\cup B_{2}\cup\cdots\cup B_{n}\right\vert =\left\vert
U\right\vert -\left\vert A_{1}\cap A_{2}\cap\cdots\cap A_{n}\right\vert .
\]
Solving this equality for $\left\vert A_{1}\cap A_{2}\cap\cdots\cap
A_{n}\right\vert $, we find
\begin{align*}
&  \left\vert A_{1}\cap A_{2}\cap\cdots\cap A_{n}\right\vert \\
&  =\left\vert U\right\vert -\underbrace{\left\vert B_{1}\cup B_{2}\cup
\cdots\cup B_{n}\right\vert }_{\substack{=\left\vert U\right\vert -\sum
_{m=1}^{n}\left(  -1\right)  ^{m-1}\sum_{\substack{\left(  i_{1},i_{2}%
,\ldots,i_{m}\right)  \in\left[  n\right]  ^{m};\\i_{1}<i_{2}<\cdots<i_{m}%
}}\left\vert A_{i_{1}}\cup A_{i_{2}}\cup\cdots\cup A_{i_{m}}\right\vert
\\\text{(by (\ref{sol.pie.owr-a.at}))}}}\\
&  =\left\vert U\right\vert -\left(  \left\vert U\right\vert -\sum_{m=1}%
^{n}\left(  -1\right)  ^{m-1}\sum_{\substack{\left(  i_{1},i_{2},\ldots
,i_{m}\right)  \in\left[  n\right]  ^{m};\\i_{1}<i_{2}<\cdots<i_{m}%
}}\left\vert A_{i_{1}}\cup A_{i_{2}}\cup\cdots\cup A_{i_{m}}\right\vert
\right) \\
&  =\sum_{m=1}^{n}\left(  -1\right)  ^{m-1}\sum_{\substack{\left(  i_{1}%
,i_{2},\ldots,i_{m}\right)  \in\left[  n\right]  ^{m};\\i_{1}<i_{2}%
<\cdots<i_{m}}}\left\vert A_{i_{1}}\cup A_{i_{2}}\cup\cdots\cup A_{i_{m}%
}\right\vert .
\end{align*}
This solves Exercise \ref{exe.pie.owr-a}.
\end{proof}

\subsection{Solution to Exercise \ref{exe.count.dera.subfix.details}}

\begin{proof}
[Solution to Exercise \ref{exe.count.dera.subfix.details}.]Here are the
statements that were left unproved in our (sketched) proof of Proposition
\ref{prop.count.dera.subfix}:\footnote{Statement 2 shows that the map $A$ is
well-defined. Statement 4 shows that the map $B$ is well-defined. Statement 5
and Statement 6 (when combined) show that the maps $A$ and $B$ are mutually
inverse.}

\begin{statement}
\textit{Statement 1:} Let $\sigma\in S_{X}$ be a permutation satisfying
$\left(  \sigma\left(  i\right)  =i\text{ for each }i\in I\right)  $. Then, we
can define a map $\widetilde{\sigma}:X\setminus I\rightarrow X\setminus I$ by
setting%
\[
\widetilde{\sigma}\left(  p\right)  =\sigma\left(  p\right)
\ \ \ \ \ \ \ \ \ \ \text{for each }p\in X\setminus I.
\]

\end{statement}

\begin{statement}
\textit{Statement 2:} Let $\sigma\in S_{X}$ be a permutation satisfying
$\left(  \sigma\left(  i\right)  =i\text{ for each }i\in I\right)  $. Then,
the map $\widetilde{\sigma}:X\setminus I\rightarrow X\setminus I$ defined in
Statement 1 is a permutation of $X\setminus I$ (and thus belongs to
$S_{X\setminus I}$).
\end{statement}

\begin{statement}
\textit{Statement 3:} Let $\tau$ be a permutation of $X\setminus I$. Then, we
can define a map $\widehat{\tau}:X\rightarrow X$ by setting%
\[
\widehat{\tau}\left(  p\right)  =%
\begin{cases}
\tau\left(  p\right)  , & \text{if }p\notin I;\\
p, & \text{if }p\in I
\end{cases}
\ \ \ \ \ \ \ \ \ \ \text{for each }p\in X.
\]

\end{statement}

\begin{statement}
\textit{Statement 4:} Let $\tau$ be a permutation of $X\setminus I$. Then, the
map $\widehat{\tau}:X\rightarrow X$ defined in Statement 3 is a permutation in
$S_{X}$ satisfying $\left(  \widehat{\tau}\left(  i\right)  =i\text{ for each
}i\in I\right)  $ (and thus belongs to $\left\{  \sigma\in S_{X}\ \mid
\ \sigma\left(  i\right)  =i\text{ for each }i\in I\right\}  $).
\end{statement}

\begin{statement}
\textit{Statement 5:} The maps $A$ and $B$ satisfy $A\circ
B=\operatorname*{id}$.
\end{statement}

\begin{statement}
\textit{Statement 6:} The maps $A$ and $B$ satisfy $B\circ
A=\operatorname*{id}$.
\end{statement}

Let us now prove these statements:

[\textit{Proof of Statement 1:} We have $\sigma\left(  p\right)  \in
X\setminus I$ for each $p\in X\setminus I$\ \ \ \ \footnote{\textit{Proof.}
Let $p\in X\setminus I$. We must prove that $\sigma\left(  p\right)  \in
X\setminus I$.
\par
Assume the contrary. Thus, $\sigma\left(  p\right)  \notin X\setminus I$.
Combining $\sigma\left(  p\right)  \in X$ with $\sigma\left(  p\right)  \notin
X\setminus I$, we obtain $\sigma\left(  p\right)  \in X\setminus\left(
X\setminus I\right)  \subseteq I$.
\par
Now, recall that $\left(  \sigma\left(  i\right)  =i\text{ for each }i\in
I\right)  $. Applying this to $i=\sigma\left(  p\right)  $, we obtain
$\sigma\left(  \sigma\left(  p\right)  \right)  =\sigma\left(  p\right)  $.
\par
But the map $\sigma$ is a permutation of $X$ (since $\sigma\in S_{X}$), thus a
bijection from $X$ to $X$. Hence, $\sigma$ is bijective, thus injective. In
other words, if $u$ and $v$ are two elements of $X$ such that $\sigma\left(
u\right)  =\sigma\left(  v\right)  $, then $u=v$. Applying this to
$u=\sigma\left(  p\right)  $ and $v=p$, we find $\sigma\left(  p\right)  =p$
(since $\sigma\left(  \sigma\left(  p\right)  \right)  =\sigma\left(
p\right)  $). Hence, $\sigma\left(  p\right)  =p\in X\setminus I$, so that
$\sigma\left(  p\right)  \notin I$. This contradicts $\sigma\left(  p\right)
\in I$. This contradiction shows that our assumption was wrong. Hence,
$\sigma\left(  p\right)  \in X\setminus I$ is proved.}. Hence, we can define a
map $\widetilde{\sigma}:X\setminus I\rightarrow X\setminus I$ by setting%
\[
\widetilde{\sigma}\left(  p\right)  =\sigma\left(  p\right)
\ \ \ \ \ \ \ \ \ \ \text{for each }p\in X\setminus I.
\]
This proves Statement 1.]

[\textit{Proof of Statement 2:} The map $\sigma$ is a permutation of $X$
(since $\sigma\in S_{X}$), thus a bijection from $X$ to $X$. Hence, $\sigma$
is bijective, thus injective and surjective.

We must prove that $\widetilde{\sigma}$ is a permutation of $X\setminus I$. In
other words, we must prove that $\widetilde{\sigma}$ is a bijection from
$X\setminus I$ to $X\setminus I$.

It is easy to see that the map $\widetilde{\sigma}$ is
injective\footnote{\textit{Proof.} Let $u$ and $v$ be two elements of
$X\setminus I$ such that $\widetilde{\sigma}\left(  u\right)
=\widetilde{\sigma}\left(  v\right)  $. We shall show that $u=v$.
\par
The definition of $\widetilde{\sigma}$ yields $\widetilde{\sigma}\left(
u\right)  =\sigma\left(  u\right)  $ and $\widetilde{\sigma}\left(  v\right)
=\sigma\left(  v\right)  $. Hence, $\sigma\left(  u\right)  =\widetilde{\sigma
}\left(  u\right)  =\widetilde{\sigma}\left(  v\right)  =\sigma\left(
v\right)  $. Since $\sigma$ is injective, we can thus conclude that $u=v$.
\par
Now, forget that we fixed $u$ and $v$. We thus have proved that if $u$ and $v$
are two elements of $X\setminus I$ such that $\widetilde{\sigma}\left(
u\right)  =\widetilde{\sigma}\left(  v\right)  $, then $u=v$. In other words,
the map $\widetilde{\sigma}$ is injective.} and
surjective\footnote{\textit{Proof.} Let $p\in X\setminus I$. We shall prove
that there exists some $x\in X\setminus I$ such that $p=\widetilde{\sigma
}\left(  x\right)  $.
\par
Recall that the map $\sigma$ is injective. Thus, there exists some $q\in X$
such that $p=\sigma\left(  q\right)  $. Consider this $q$. Thus,
$\sigma\left(  q\right)  =p\notin I$ (since $p\in X\setminus I$).
\par
If we had $q\in I$, then we would have $\sigma\left(  q\right)  =q$ (by the
assumption \textquotedblleft$\sigma\left(  i\right)  =i$ for each $i\in
I$\textquotedblright, applied to $i=q$), which would entail $\sigma\left(
q\right)  =q\in I$; but this would contradict $\sigma\left(  q\right)  \notin
I$. This, we cannot have $q\in I$. Hence, we have $q\notin I$. Combining $q\in
X$ with $q\notin I$, we obtain $q\in X\setminus I$. Hence, $\widetilde{\sigma
}\left(  q\right)  $ is well-defined. Moreover, the definition of
$\widetilde{\sigma}$ yields $\widetilde{\sigma}\left(  q\right)
=\sigma\left(  q\right)  =p$. In other words, $p=\widetilde{\sigma}\left(
q\right)  $. Hence, there exists some $x\in X\setminus I$ such that
$p=\widetilde{\sigma}\left(  x\right)  $ (namely, $x=q$).
\par
Forget that we fixed $p$. We thus have proved that for each $p\in X\setminus
I$, there exists some $x\in X\setminus I$ such that $p=\widetilde{\sigma
}\left(  x\right)  $. In other words, $\widetilde{\sigma}$ is surjective.}.
Hence, $\widetilde{\sigma}$ is bijective. In other words, $\widetilde{\sigma}$
is a bijection from $X$ to $X$. Hence, $\widetilde{\sigma}$ is a permutation
of $X\setminus I$. In other words, $\widetilde{\sigma}$ belongs to
$S_{X\setminus I}$. This proves Statement 2.]

[\textit{Proof of Statement 3:} Let $p\in X$. We claim that $%
\begin{cases}
\tau\left(  p\right)  , & \text{if }p\notin I;\\
p, & \text{if }p\in I
\end{cases}
\in X$.

Indeed, if $p\in I$, then this follows from%
\begin{align*}%
\begin{cases}
\tau\left(  p\right)  , & \text{if }p\notin I;\\
p, & \text{if }p\in I
\end{cases}
&  =p\ \ \ \ \ \ \ \ \ \ \left(  \text{since }p\in I\right) \\
&  \in X.
\end{align*}
Hence, for the rest of this proof, we WLOG assume that $p\notin I$. Hence,
$p\in X\setminus I$ (since $p\in X$ and $p\notin I$), so that $\tau\left(
p\right)  $ is well-defined (since $\tau$ is a permutation of $X\setminus I$).
Moreover,%
\begin{align*}%
\begin{cases}
\tau\left(  p\right)  , & \text{if }p\notin I;\\
p, & \text{if }p\in I
\end{cases}
&  =\tau\left(  p\right)  \in X\setminus I\ \ \ \ \ \ \ \ \ \ \left(
\text{since }\tau\text{ is a permutation of }X\setminus I\right) \\
&  \subseteq X.
\end{align*}
Thus, $%
\begin{cases}
\tau\left(  p\right)  , & \text{if }p\notin I;\\
p, & \text{if }p\in I
\end{cases}
\in X$ is proved.

Now, forget that we fixed $p$. We thus have shown that $%
\begin{cases}
\tau\left(  p\right)  , & \text{if }p\notin I;\\
p, & \text{if }p\in I
\end{cases}
\in X$ for each $p\in X$. Hence, we can define a map $\widehat{\tau
}:X\rightarrow X$ by setting%
\[
\widehat{\tau}\left(  p\right)  =%
\begin{cases}
\tau\left(  p\right)  , & \text{if }p\notin I;\\
p, & \text{if }p\in I
\end{cases}
\ \ \ \ \ \ \ \ \ \ \text{for each }p\in X.
\]
This proves Statement 3.]

[\textit{Proof of Statement 4:} We shall first prove that $\widehat{\tau}$ is
a permutation of $X$.

There are two ways to prove this. One way to do so is by showing that
$\widehat{\tau}$ is both surjective and injective. This is straightforward but
boring. A slicker approach is by constructing its inverse map. Let us do the latter.

The map $\tau$ is a permutation of $X\setminus I$, thus a bijection from
$X\setminus I$ to $X\setminus I$. Hence, its inverse $\tau^{-1}$ is
well-defined, and is also a bijection from $X\setminus I$ to $X\setminus I$.
In other words, $\tau^{-1}$ is also a permutation of $X\setminus I$. Thus,
Statement 4 (applied to $\tau^{-1}$ instead of $\tau$) shows that we can
define a map $\widehat{\tau^{-1}}:X\rightarrow X$ by setting%
\[
\widehat{\tau^{-1}}\left(  p\right)  =%
\begin{cases}
\tau^{-1}\left(  p\right)  , & \text{if }p\notin I;\\
p, & \text{if }p\in I
\end{cases}
\ \ \ \ \ \ \ \ \ \ \text{for each }p\in X.
\]
Consider this map $\widehat{\tau^{-1}}$. Note that $\tau\circ\tau
^{-1}=\operatorname*{id}$ and $\tau^{-1}\circ\tau=\operatorname*{id}$. We
shall now prove that $\widehat{\tau}\circ\widehat{\tau^{-1}}%
=\operatorname*{id}$ and $\widehat{\tau^{-1}}\circ\widehat{\tau}%
=\operatorname*{id}$.

[\textit{Proof of }$\widehat{\tau}\circ\widehat{\tau^{-1}}=\operatorname*{id}%
$\textit{:} Let $q\in X$. We shall show that $\left(  \widehat{\tau}%
\circ\widehat{\tau^{-1}}\right)  \left(  q\right)  =q$.

Indeed, we are in one of the following two cases:

\textit{Case 1:} We have $q\in I$.

\textit{Case 2:} We have $q\notin I$.

Let us first consider Case 1. In this case, we have $q\in I$. Now, the
definition of $\widehat{\tau^{-1}}$ yields $\widehat{\tau^{-1}}\left(
q\right)  =%
\begin{cases}
\tau^{-1}\left(  q\right)  , & \text{if }q\notin I;\\
q, & \text{if }q\in I
\end{cases}
=q$ (since $q\in I$). Applying the map $\widehat{\tau}$ to both sides of this
equality, we find%
\begin{align*}
\widehat{\tau}\left(  \underbrace{\widehat{\tau^{-1}}\left(  q\right)  }%
_{=q}\right)   &  =\widehat{\tau}\left(  q\right)  =%
\begin{cases}
\tau\left(  q\right)  , & \text{if }q\notin I;\\
q, & \text{if }q\in I
\end{cases}
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }\widehat{\tau}\right)
\\
&  =q\ \ \ \ \ \ \ \ \ \ \left(  \text{since }q\in I\right)  .
\end{align*}
Hence, $\left(  \widehat{\tau}\circ\widehat{\tau^{-1}}\right)  \left(
q\right)  =\widehat{\tau}\left(  \widehat{\tau^{-1}}\left(  q\right)  \right)
=q$. Thus, $\left(  \widehat{\tau}\circ\widehat{\tau^{-1}}\right)  \left(
q\right)  =q$ is proven in Case 1.

Let us next consider Case 2. In this case, we have $q\notin I$. Combining
$q\in X$ with $q\notin I$, we find $q\in X\setminus I$. Hence, $\tau
^{-1}\left(  q\right)  $ is well-defined (since $\tau^{-1}$ is a map from from
$X\setminus I$ to $X\setminus I$) and satisfies $\tau^{-1}\left(  q\right)
\in X\setminus I$ (for the same reason). From $\tau^{-1}\left(  q\right)  \in
X\setminus I$, we obtain $\tau^{-1}\left(  q\right)  \in X$ and $\tau
^{-1}\left(  q\right)  \notin I$.

The definition of $\widehat{\tau^{-1}}$ yields $\widehat{\tau^{-1}}\left(
q\right)  =%
\begin{cases}
\tau^{-1}\left(  q\right)  , & \text{if }q\notin I;\\
q, & \text{if }q\in I
\end{cases}
=\tau^{-1}\left(  q\right)  $ (since $q\notin I$). Applying the map
$\widehat{\tau}$ to both sides of this equality, we find%
\begin{align*}
\widehat{\tau}\left(  \underbrace{\widehat{\tau^{-1}}\left(  q\right)  }%
_{=q}\right)   &  =\widehat{\tau}\left(  \tau^{-1}\left(  q\right)  \right) \\
&  =%
\begin{cases}
\tau\left(  \tau^{-1}\left(  q\right)  \right)  , & \text{if }\tau^{-1}\left(
q\right)  \notin I;\\
\tau^{-1}\left(  q\right)  , & \text{if }\tau^{-1}\left(  q\right)  \in I
\end{cases}
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }\widehat{\tau}\right)
\\
&  =\tau\left(  \tau^{-1}\left(  q\right)  \right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\tau^{-1}\left(  q\right)  \notin
I\right) \\
&  =q.
\end{align*}
Hence, $\left(  \widehat{\tau}\circ\widehat{\tau^{-1}}\right)  \left(
q\right)  =\widehat{\tau}\left(  \widehat{\tau^{-1}}\left(  q\right)  \right)
=q$. Thus, $\left(  \widehat{\tau}\circ\widehat{\tau^{-1}}\right)  \left(
q\right)  =q$ is proven in Case 2.

We have now proved $\left(  \widehat{\tau}\circ\widehat{\tau^{-1}}\right)
\left(  q\right)  =q$ in each of the two Cases 1 and 2. Thus, $\left(
\widehat{\tau}\circ\widehat{\tau^{-1}}\right)  \left(  q\right)  =q$ always
holds. Hence, $\left(  \widehat{\tau}\circ\widehat{\tau^{-1}}\right)  \left(
q\right)  =q=\operatorname*{id}\left(  q\right)  $.

Now, forget that we fixed $q$. We thus know that $\left(  \widehat{\tau}%
\circ\widehat{\tau^{-1}}\right)  \left(  q\right)  =\operatorname*{id}\left(
q\right)  $ for each $q\in X$. In other words, $\widehat{\tau}\circ
\widehat{\tau^{-1}}=\operatorname*{id}$. The same argument (but with the roles
of $\tau$ and $\tau^{-1}$ interchanged\footnote{This means that the roles of
$\widehat{\tau}$ and $\widehat{\tau^{-1}}$ also get interchanged.}) shows that
$\widehat{\tau^{-1}}\circ\widehat{\tau}=\operatorname*{id}$. Combining these
two equalities, we conclude that the maps $\widehat{\tau}$ and $\widehat{\tau
^{-1}}$ are mutually inverse. Hence, the map $\widehat{\tau}$ is invertible.
In other words, $\widehat{\tau}$ is a bijection from $X$ to $X$. In other
words, $\widehat{\tau}$ is a permutation of $X$. In other words,
$\widehat{\tau}\in S_{X}$.

For each $i\in I$, we have%
\begin{align*}
\widehat{\tau}\left(  i\right)   &  =%
\begin{cases}
\tau\left(  i\right)  , & \text{if }i\notin I;\\
i, & \text{if }i\in I
\end{cases}
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }\widehat{\tau}\right)
\\
&  =i\ \ \ \ \ \ \ \ \ \ \left(  \text{since }i\in I\right)  .
\end{align*}
Thus, we have shown that $\left(  \widehat{\tau}\left(  i\right)  =i\text{ for
each }i\in I\right)  $. Hence, $\widehat{\tau}$ is an element of $S_{X}$ that
satisfies $\left(  \widehat{\tau}\left(  i\right)  =i\text{ for each }i\in
I\right)  $.

In other words, $\widehat{\tau}$ belongs to $\left\{  \sigma\in S_{X}%
\ \mid\ \sigma\left(  i\right)  =i\text{ for each }i\in I\right\}  $. This
proves Statement 4.]

[\textit{Proof of Statement 5:} Let $\tau\in S_{X\setminus I}$. We shall show
that $\left(  A\circ B\right)  \left(  \tau\right)  =\tau$.

Indeed, let $p\in X\setminus I$. Thus, $p\in X$ and $p\notin I$. Now,
$B\left(  \tau\right)  =\widehat{\tau}$ (by the definition of $B$). Also,%
\[
\left(  A\circ B\right)  \left(  \tau\right)  =A\left(  B\left(  \tau\right)
\right)  =\widetilde{B\left(  \tau\right)  }\ \ \ \ \ \ \ \ \ \ \left(
\text{by the definition of }A\right)  .
\]
Applying both sides of this equality to $p$, we obtain
\begin{align*}
\left(  \left(  A\circ B\right)  \left(  \tau\right)  \right)  \left(
p\right)   &  =\left(  \widetilde{B\left(  \tau\right)  }\right)  \left(
p\right)  =\underbrace{\left(  B\left(  \tau\right)  \right)  }%
_{=\widehat{\tau}}\left(  p\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the
definition of }\widetilde{B\left(  \tau\right)  }\right) \\
&  =\widehat{\tau}\left(  p\right)  =%
\begin{cases}
\tau\left(  p\right)  , & \text{if }p\notin I;\\
p, & \text{if }p\in I
\end{cases}
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }\widehat{\tau}\right)
\\
&  =\tau\left(  p\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }p\notin
I\right)  .
\end{align*}


Forget that we fixed $p$. We thus have shown that $\left(  \left(  A\circ
B\right)  \left(  \tau\right)  \right)  \left(  p\right)  =\tau\left(
p\right)  $ for each $p\in X\setminus I$. In other words, $\left(  A\circ
B\right)  \left(  \tau\right)  =\tau=\operatorname*{id}\left(  \tau\right)  $.

Forget that we fixed $\tau$. We thus have shown that $\left(  A\circ B\right)
\left(  \tau\right)  =\operatorname*{id}\left(  \tau\right)  $ for each
$\tau\in S_{X\setminus I}$. In other words, $A\circ B=\operatorname*{id}$.
This proves Statement 5.]

[\textit{Proof of Statement 6:} Let $\gamma\in\left\{  \sigma\in S_{X}%
\ \mid\ \sigma\left(  i\right)  =i\text{ for each }i\in I\right\}  $. We shall
show that $\left(  B\circ A\right)  \left(  \gamma\right)  =\gamma$.

We have $\gamma\in\left\{  \sigma\in S_{X}\ \mid\ \sigma\left(  i\right)
=i\text{ for each }i\in I\right\}  $. In other words, $\gamma$ is a $\sigma\in
S_{X}$ such that $\left(  \sigma\left(  i\right)  =i\text{ for each }i\in
I\right)  $. In other words, $\gamma$ is an element of $S_{X}$ and satisfies
\begin{equation}
\left(  \gamma\left(  i\right)  =i\text{ for each }i\in I\right)  .
\label{sol.count.dera.subfix.details.s6.pf.1}%
\end{equation}
Thus, $\gamma$ is a permutation of $X$ (since $\gamma\in S_{X}$).

Now, let $p\in X$. We shall show that $\left(  \left(  B\circ A\right)
\left(  \gamma\right)  \right)  \left(  p\right)  =\gamma\left(  p\right)  $.

We have $A\left(  \gamma\right)  =\widetilde{\gamma}$ (by the definition of
$A$). Furthermore,%
\[
\left(  B\circ A\right)  \left(  \gamma\right)  =B\left(  A\left(
\gamma\right)  \right)  =\widehat{A\left(  \gamma\right)  }.
\]
Applying both sides of this equality to $p$, we obtain
\begin{align}
\left(  \left(  B\circ A\right)  \left(  \gamma\right)  \right)  \left(
p\right)   &  =\left(  \widehat{A\left(  \gamma\right)  }\right)  \left(
p\right) \nonumber\\
&  =%
\begin{cases}
\left(  A\left(  \gamma\right)  \right)  \left(  p\right)  , & \text{if
}p\notin I;\\
p, & \text{if }p\in I
\end{cases}
\label{sol.count.dera.subfix.details.s6.pf.2}%
\end{align}
(by the definition of $\widehat{A\left(  \gamma\right)  }$).

Now, we are in one of the following two cases:

\textit{Case 1:} We have $p\in I$.

\textit{Case 2:} We have $p\notin I$.

Let us first consider Case 1. In this case, we have $p\in I$. Thus,
$\gamma\left(  p\right)  =p$ (by (\ref{sol.count.dera.subfix.details.s6.pf.1}%
), applied to $i=p$). But (\ref{sol.count.dera.subfix.details.s6.pf.2})
becomes%
\begin{align*}
\left(  \left(  B\circ A\right)  \left(  \gamma\right)  \right)  \left(
p\right)   &  =%
\begin{cases}
\left(  A\left(  \gamma\right)  \right)  \left(  p\right)  , & \text{if
}p\notin I;\\
p, & \text{if }p\in I
\end{cases}
=p\ \ \ \ \ \ \ \ \ \ \left(  \text{since }p\in I\right) \\
&  =\gamma\left(  p\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }%
\gamma\left(  p\right)  =p\right)  .
\end{align*}
Hence, $\left(  \left(  B\circ A\right)  \left(  \gamma\right)  \right)
\left(  p\right)  =\gamma\left(  p\right)  $ is proved in Case 1.

Let us now consider Case 2. In this case, we have $p\notin I$. Thus, $p\in
X\setminus I$ (since $p\in X$ and $p\notin I$). Now,
(\ref{sol.count.dera.subfix.details.s6.pf.2}) becomes%
\begin{align*}
\left(  \left(  B\circ A\right)  \left(  \gamma\right)  \right)  \left(
p\right)   &  =%
\begin{cases}
\left(  A\left(  \gamma\right)  \right)  \left(  p\right)  , & \text{if
}p\notin I;\\
p, & \text{if }p\in I
\end{cases}
=\underbrace{\left(  A\left(  \gamma\right)  \right)  }_{=\widetilde{\gamma}%
}\left(  p\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }p\notin I\right)
\\
&  =\widetilde{\gamma}\left(  p\right)  =\gamma\left(  p\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }\widetilde{\gamma
}\right)  .
\end{align*}
Hence, $\left(  \left(  B\circ A\right)  \left(  \gamma\right)  \right)
\left(  p\right)  =\gamma\left(  p\right)  $ is proved in Case 2.

We have now proved $\left(  \left(  B\circ A\right)  \left(  \gamma\right)
\right)  \left(  p\right)  =\gamma\left(  p\right)  $ in each of the two Cases
1 and 2. Thus, $\left(  \left(  B\circ A\right)  \left(  \gamma\right)
\right)  \left(  p\right)  =\gamma\left(  p\right)  $ always holds.

Forget that we fixed $p$. We thus have proved that $\left(  \left(  B\circ
A\right)  \left(  \gamma\right)  \right)  \left(  p\right)  =\gamma\left(
p\right)  $ for each $p\in X$. In other words, $\left(  B\circ A\right)
\left(  \gamma\right)  =\gamma=\operatorname*{id}\left(  \gamma\right)  $.

Forget that we fixed $\gamma$. We thus have proved that $\left(  B\circ
A\right)  \left(  \gamma\right)  =\operatorname*{id}\left(  \gamma\right)  $
for each $\gamma\in\left\{  \sigma\in S_{X}\ \mid\ \sigma\left(  i\right)
=i\text{ for each }i\in I\right\}  $. In other words, $B\circ
A=\operatorname*{id}$. This proves Statement 6.]

We have now proved all six Statements 1, 2, 3, 4, 5 and 6. This fills all the
gaps in our proof of Proposition \ref{prop.count.dera.subfix}. Thus, Exercise
\ref{exe.count.dera.subfix.details} is solved.
\end{proof}

\subsection{Solution to Exercise \ref{exe.count.dera.teasers.abc}}

In order to solve Exercise \ref{exe.count.dera.teasers.abc}, we have to prove
parts \textbf{(a)}, \textbf{(b)} and \textbf{(c)} of Theorem
\ref{thm.count.dera.teasers}. In doing so, we can use part \textbf{(d)} of
this theorem, since it has already been proven.

\begin{proof}
[Proof of Theorem \ref{thm.count.dera.teasers} \textbf{(b)}.]Let $n$ be an
integer such that $n\geq1$. Thus, $n$ is a positive integer, so that
$n\in\mathbb{N}$ and $n-1\in\mathbb{N}$. Hence, Theorem
\ref{thm.count.dera.teasers} \textbf{(d)} (applied to $n-1$ instead of $n$)
yields%
\begin{equation}
D_{n-1}=\sum_{k=0}^{n-1}\left(  -1\right)  ^{k}\dfrac{\left(  n-1\right)
!}{k!}. \label{pf.thm.count.dera.teasers.b.1}%
\end{equation}
Also, Theorem \ref{thm.count.dera.teasers} \textbf{(d)} yields%
\begin{align*}
D_{n}  &  =\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dfrac{n!}{k!}=\left(
-1\right)  ^{n}\underbrace{\dfrac{n!}{n!}}_{=1}+\sum_{k=0}^{n-1}\left(
-1\right)  ^{k}\underbrace{\dfrac{n!}{k!}}_{\substack{=\dfrac{\left(
n-1\right)  !\cdot n}{k!}\\\text{(since Proposition \ref{prop.factorial.rec}%
}\\\text{yields }n!=\left(  n-1\right)  !\cdot n)}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have split off the addend for
}k=n\text{ from the sum}\right) \\
&  =\left(  -1\right)  ^{n}+\sum_{k=0}^{n-1}\underbrace{\left(  -1\right)
^{k}\dfrac{\left(  n-1\right)  !\cdot n}{k!}}_{=n\left(  -1\right)  ^{k}%
\dfrac{\left(  n-1\right)  !}{k!}}=\left(  -1\right)  ^{n}+\underbrace{\sum
_{k=0}^{n-1}n\left(  -1\right)  ^{k}\dfrac{\left(  n-1\right)  !}{k!}}%
_{=n\sum_{k=0}^{n-1}\left(  -1\right)  ^{k}\dfrac{\left(  n-1\right)  !}{k!}%
}\\
&  =\left(  -1\right)  ^{n}+n\underbrace{\sum_{k=0}^{n-1}\left(  -1\right)
^{k}\dfrac{\left(  n-1\right)  !}{k!}}_{\substack{=D_{n-1}\\\text{(by
(\ref{pf.thm.count.dera.teasers.b.1}))}}}=\left(  -1\right)  ^{n}%
+nD_{n-1}=nD_{n-1}+\left(  -1\right)  ^{n}.
\end{align*}
This proves Theorem \ref{thm.count.dera.teasers} \textbf{(b)}.
\end{proof}

Now that we have proved Theorem \ref{thm.count.dera.teasers} \textbf{(b)}, we
shall derive Theorem \ref{thm.count.dera.teasers} \textbf{(a)} from it. In
doing so, we shall use the following simple lemma (\cite[Exercise 5]{19f-hw1s}):

\begin{lemma}
\label{lem.19f-hw1s.exe5}Let $\left(  u_{0},u_{1},u_{2},\ldots\right)  $ be a
sequence of real numbers such that every integer $n\geq1$ satisfies
\begin{equation}
u_{n}=nu_{n-1}+\left(  -1\right)  ^{n}. \label{eq.exe.derangements-u.1}%
\end{equation}
Then, $u_{n}=\left(  n-1\right)  \left(  u_{n-1}+u_{n-2}\right)  $ for each
integer $n\geq2$.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.19f-hw1s.exe5}.]Let $n\geq2$ be an integer. Thus,
$n-1\geq2-1=1$. Hence, \eqref{eq.exe.derangements-u.1} (applied to $n-1$
instead of $n$) yields
\begin{align*}
u_{n-1}  &  =\left(  n-1\right)  \underbrace{u_{\left(  n-1\right)  -1}%
}_{\substack{=u_{n-2}}}+\underbrace{\left(  -1\right)  ^{n-1}}%
_{\substack{=-\left(  -1\right)  ^{n}}}=\left(  n-1\right)  u_{n-2}+\left(
-\left(  -1\right)  ^{n}\right) \\
&  =\left(  n-1\right)  u_{n-2}-\left(  -1\right)  ^{n}.
\end{align*}
Thus,
\begin{equation}
u_{n-1}+\left(  -1\right)  ^{n}=\left(  n-1\right)  u_{n-2}.
\label{pf.lem.19f-hw1s.exe5.1}%
\end{equation}
But $n\geq2\geq1$. Hence, \eqref{eq.exe.derangements-u.1} yields
\begin{align*}
u_{n}  &  =\underbrace{n}_{\substack{=\left(  n-1\right)  +1}}u_{n-1}+\left(
-1\right)  ^{n}=\underbrace{\left(  \left(  n-1\right)  +1\right)  u_{n-1}%
}_{\substack{=\left(  n-1\right)  u_{n-1}+u_{n-1}}}+\left(  -1\right)  ^{n}\\
&  =\left(  n-1\right)  u_{n-1}+\underbrace{u_{n-1}+\left(  -1\right)  ^{n}%
}_{\substack{=\left(  n-1\right)  u_{n-2}\\\text{(by
(\ref{pf.lem.19f-hw1s.exe5.1}))}}}=\left(  n-1\right)  u_{n-1}+\left(
n-1\right)  u_{n-2}\\
&  =\left(  n-1\right)  \left(  u_{n-1}+u_{n-2}\right)  .
\end{align*}
This proves Lemma \ref{lem.19f-hw1s.exe5}.
\end{proof}

\begin{proof}
[Proof of Theorem \ref{thm.count.dera.teasers} \textbf{(a)}.]Theorem
\ref{thm.count.dera.teasers} \textbf{(b)} shows that every integer $n\geq1$
satisfies $D_{n}=nD_{n-1}+\left(  -1\right)  ^{n}$. Hence, Lemma
\ref{lem.19f-hw1s.exe5} (applied to $u_{j}=D_{j}$) shows that $D_{n}=\left(
n-1\right)  \left(  D_{n-1}+D_{n-2}\right)  $ for each integer $n\geq2$. This
proves Theorem \ref{thm.count.dera.teasers} \textbf{(a)}.
\end{proof}

It remains to prove Theorem \ref{thm.count.dera.teasers} \textbf{(c)}. There
are several ways to do this. In particular, there is a rather simple
double-counting argument, which uses the following concept:

\begin{definition}
Let $X$ be a set. Let $f:X\rightarrow X$ be any map. Then,
$\operatorname*{Fix}f$ shall denote the set of all fixed points of $f$.
\end{definition}

We will need a fact similar to Proposition \ref{prop.count.dera.subfix}:

\begin{proposition}
\label{prop.count.dera.sub=fix}Let $X$ be a set. Let $I$ be a subset of $X$.
Then, there is a bijection%
\[
\text{from }\left\{  \sigma\in S_{X}\ \mid\ \operatorname*{Fix}\sigma
=I\right\}  \text{ to }\left\{  \text{derangements of }X\setminus I\right\}
.
\]

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.count.dera.sub=fix}.]Let us first give a
sketch of the proof (similarly to the proof of Proposition
\ref{prop.count.dera.subfix} we sketched), and then fill in the details
(similarly to the solution of Exercise \ref{exe.count.dera.subfix.details}):

To each permutation $\sigma\in S_{X}$ satisfying $\operatorname*{Fix}\sigma
=I$, we can assign a derangement $\widetilde{\sigma}$ of $X\setminus I$ by
letting%
\[
\widetilde{\sigma}\left(  p\right)  =\sigma\left(  p\right)
\ \ \ \ \ \ \ \ \ \ \text{for each }p\in X\setminus I.
\]
\footnote{Why is this map $\widetilde{\sigma}$ well-defined, and why is it
really a derangement of $X\setminus I$ ? This will follow from Statement 1'
and Statement 2' further below.} This defines a map%
\begin{align*}
A:\left\{  \sigma\in S_{X}\ \mid\ \operatorname*{Fix}\sigma=I\right\}   &
\rightarrow\left\{  \text{derangements of }X\setminus I\right\}  ,\\
\sigma &  \mapsto\widetilde{\sigma}.
\end{align*}
Conversely, to each derangement $\tau$ of $X\setminus I$, we can assign a
permutation $\widehat{\tau}\in S_{X}$ satisfying $\operatorname*{Fix}%
\widehat{\tau}=I$ by setting%
\[
\widehat{\tau}\left(  p\right)  =%
\begin{cases}
\tau\left(  p\right)  , & \text{if }p\notin I;\\
p, & \text{if }p\in I
\end{cases}
\ \ \ \ \ \ \ \ \ \ \text{for each }p\in X.
\]
\footnote{Again, this will be proved below.} This defines a map%
\begin{align*}
B:\left\{  \text{derangements of }X\setminus I\right\}   &  \rightarrow
\left\{  \sigma\in S_{X}\ \mid\ \operatorname*{Fix}\sigma=I\right\}  ,\\
\tau &  \mapsto\widehat{\tau}.
\end{align*}
The maps $A$ and $B$ are well-defined and mutually inverse\footnote{Again,
this will be proved below.}. Hence, they are bijections. Thus, there is a
bijection from the set $\left\{  \sigma\in S_{X}\ \mid\ \operatorname*{Fix}%
\sigma=I\right\}  $ to the set $\left\{  \text{derangements of }X\setminus
I\right\}  $ (namely, $A$). This proves Proposition
\ref{prop.count.dera.sub=fix}, once the details are filled in.

Let us now fill in the details. Here are the statements that were left
unproved in our above proof:\footnote{Statement 2' shows that the map $A$ is
well-defined. Statement 4' shows that the map $B$ is well-defined. Statement
5' and Statement 6' (when combined) show that the maps $A$ and $B$ are
mutually inverse.}

\begin{statement}
\textit{Statement 1':} Let $\sigma\in S_{X}$ be a permutation satisfying
$\operatorname*{Fix}\sigma=I$. Then, we can define a map $\widetilde{\sigma
}:X\setminus I\rightarrow X\setminus I$ by setting%
\[
\widetilde{\sigma}\left(  p\right)  =\sigma\left(  p\right)
\ \ \ \ \ \ \ \ \ \ \text{for each }p\in X\setminus I.
\]

\end{statement}

\begin{statement}
\textit{Statement 2':} Let $\sigma\in S_{X}$ be a permutation satisfying
$\operatorname*{Fix}\sigma=I$. Then, the map $\widetilde{\sigma}:X\setminus
I\rightarrow X\setminus I$ defined in Statement 1' is a derangement of
$X\setminus I$ (and thus belongs to $\left\{  \text{derangements of
}X\setminus I\right\}  $).
\end{statement}

\begin{statement}
\textit{Statement 3':} Let $\tau$ be a derangement of $X\setminus I$. Then, we
can define a map $\widehat{\tau}:X\rightarrow X$ by setting%
\[
\widehat{\tau}\left(  p\right)  =%
\begin{cases}
\tau\left(  p\right)  , & \text{if }p\notin I;\\
p, & \text{if }p\in I
\end{cases}
\ \ \ \ \ \ \ \ \ \ \text{for each }p\in X.
\]

\end{statement}

\begin{statement}
\textit{Statement 4':} Let $\tau$ be a derangement of $X\setminus I$. Then,
the map $\widehat{\tau}:X\rightarrow X$ defined in Statement 3' is a
permutation in $S_{X}$ satisfying $\operatorname*{Fix}\widehat{\tau}=I$ (and
thus belongs to $\left\{  \sigma\in S_{X}\ \mid\ \operatorname*{Fix}%
\sigma=I\right\}  $).
\end{statement}

\begin{statement}
\textit{Statement 5':} The maps $A$ and $B$ satisfy $A\circ
B=\operatorname*{id}$.
\end{statement}

\begin{statement}
\textit{Statement 6':} The maps $A$ and $B$ satisfy $B\circ
A=\operatorname*{id}$.
\end{statement}

Let us now prove these statements:

[\textit{Proof of Statement 1':} Let $i\in I$. Then, $i\in
I=\operatorname*{Fix}\sigma$ (since $\operatorname*{Fix}\sigma=I$). This means
that $i$ is a fixed point of $\sigma$ (since $\operatorname*{Fix}\sigma$ was
defined as the set of all fixed points of $\sigma$). In other words,
$\sigma\left(  i\right)  =i$ (by the definition of \textquotedblleft fixed
point\textquotedblright).

Forget that we fixed $i$. We thus have shown that $\sigma\left(  i\right)  =i$
for each $i\in I$. Thus, Statement 1 from our above solution to Exercise
\ref{exe.count.dera.subfix.details} shows that we can define a map
$\widetilde{\sigma}:X\setminus I\rightarrow X\setminus I$ by setting%
\[
\widetilde{\sigma}\left(  p\right)  =\sigma\left(  p\right)
\ \ \ \ \ \ \ \ \ \ \text{for each }p\in X\setminus I.
\]
This proves Statement 1'.]

[\textit{Proof of Statement 2':} The map $\sigma$ is a permutation of $X$
(since $\sigma\in S_{X}$), thus a bijection from $X$ to $X$. Moreover, we have
$\sigma\left(  i\right)  =i$ for each $i\in I$. (Indeed, this can be proven
just as in our proof of Statement 1' above.) Thus, Statement 2 from our above
solution to Exercise \ref{exe.count.dera.subfix.details} shows that
$\widetilde{\sigma}$ is a permutation of $X\setminus I$. Moreover, this
permutation $\widetilde{\sigma}$ has no fixed points\footnote{\textit{Proof.}
Let $z$ be a fixed point of $\widetilde{\sigma}$. Thus, $z$ is an element of
$X\setminus I$ satisfying $\widetilde{\sigma}\left(  z\right)  =z$ (by the
definition of \textquotedblleft fixed point\textquotedblright). But the
definition of $\widetilde{\sigma}$ yields $\widetilde{\sigma}\left(  z\right)
=\sigma\left(  z\right)  $, so that $\sigma\left(  z\right)
=\widetilde{\sigma}\left(  z\right)  =z$. In other words, $z$ is a fixed point
of $\sigma$. In other words, $z\in\operatorname*{Fix}\sigma$ (by the
definition of $\operatorname*{Fix}\sigma$). Hence, $z\in\operatorname*{Fix}%
\sigma=I$. But recall that $z\in X\setminus I$, so that $z\in X$ and $z\notin
I$. Now, $z\in I$ contradicts $z\notin I$.
\par
Forget that we fixed $z$. We thus have obtained a contradiction for each fixed
point $z$ of $\widetilde{\sigma}$. Hence, there exist no fixed points of
$\widetilde{\sigma}$. In other words, $\widetilde{\sigma}$ has no fixed
points.}; in other words, $\widetilde{\sigma}$ is a derangement of $X\setminus
I$ (by the definition of \textquotedblleft derangement\textquotedblright). In
other words, $\widetilde{\sigma}$ belongs to $\left\{  \text{derangements of
}X\setminus I\right\}  $. This proves Statement 2'.]

[\textit{Proof of Statement 3':} The map $\tau$ is a derangement of
$X\setminus I$, and thus is a permutation of $X\setminus I$ (since any
derangement is a permutation). Hence, Statement 3 from our above solution to
Exercise \ref{exe.count.dera.subfix.details} shows that we can define a map
$\widehat{\tau}:X\rightarrow X$ by setting%
\[
\widehat{\tau}\left(  p\right)  =%
\begin{cases}
\tau\left(  p\right)  , & \text{if }p\notin I;\\
p, & \text{if }p\in I
\end{cases}
\ \ \ \ \ \ \ \ \ \ \text{for each }p\in X.
\]
This proves Statement 3'.]

[\textit{Proof of Statement 4':} The map $\tau$ is a derangement of
$X\setminus I$, and thus is a permutation of $X\setminus I$ (since any
derangement is a permutation). Hence, Statement 4 from our above solution to
Exercise \ref{exe.count.dera.subfix.details} shows that the map $\widehat{\tau
}:X\rightarrow X$ is a permutation in $S_{X}$ satisfying $\left(
\widehat{\tau}\left(  i\right)  =i\text{ for each }i\in I\right)  $. Now, we
shall show that $\operatorname*{Fix}\widehat{\tau}=I$.

Indeed, $I\subseteq\operatorname*{Fix}\widehat{\tau}$%
\ \ \ \ \footnote{\textit{Proof.} Let $i\in I$. The definition of
$\widehat{\tau}$ yields $\widehat{\tau}\left(  i\right)  =%
\begin{cases}
\tau\left(  i\right)  , & \text{if }i\notin I;\\
i, & \text{if }i\in I
\end{cases}
=i$ (since $i\in I$). In other words, $i$ is a fixed point of $\widehat{\tau}%
$. In other words, $i\in\operatorname*{Fix}\widehat{\tau}$ (by the definition
of $\operatorname*{Fix}\widehat{\tau}$).
\par
Forget that we fixed $i$. We thus have showed that $i\in\operatorname*{Fix}%
\widehat{\tau}$ for each $i\in I$. In other words, $I\subseteq
\operatorname*{Fix}\widehat{\tau}$.} and $\operatorname*{Fix}\widehat{\tau
}\subseteq I$\ \ \ \ \footnote{\textit{Proof.} Let $p\in\operatorname*{Fix}%
\widehat{\tau}$. Thus, $p$ is a fixed point of $\widehat{\tau}$ (by the
definition of $\operatorname*{Fix}\widehat{\tau}$). In other words, $p$ is an
element of $X$ satisfying $\widehat{\tau}\left(  p\right)  =p$.
\par
We want to prove that $p\in I$. Indeed, assume the contrary. Thus, $p\notin
I$. Combining $p\in X$ with $p\notin I$, we obtain $p\in X\setminus I$. Now,
the definition of $\widehat{\tau}$ yields%
\[
\widehat{\tau}\left(  p\right)  =%
\begin{cases}
\tau\left(  p\right)  , & \text{if }p\notin I;\\
p, & \text{if }p\in I
\end{cases}
=\tau\left(  p\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }p\notin
I\right)  ,
\]
so that $\tau\left(  p\right)  =\widehat{\tau}\left(  p\right)  =p$. In other
words, $p$ is a fixed point of $\tau$. But the permutation $\tau$ is a
derangement, and thus has no fixed points (by the definition of
\textquotedblleft derangement\textquotedblright). Hence, $p$ cannot be a fixed
point of $\tau$. This contradicts the fact that $p$ is a fixed point of $\tau
$. This contradiction shows that our assumption was false. Hence, $p\in I$ is
proven.
\par
Now, forget that we fixed $p$. We thus have proved that $p\in I$ for each
$p\in\operatorname*{Fix}\widehat{\tau}$. In other words, $\operatorname*{Fix}%
\widehat{\tau}\subseteq I$.}. Combining these two facts, we obtain
$\operatorname*{Fix}\widehat{\tau}=I$. Thus, we have showed that
$\widehat{\tau}$ is an element of $S_{X}$ that satisfies $\operatorname*{Fix}%
\widehat{\tau}=I$.

In other words, $\widehat{\tau}$ belongs to $\left\{  \sigma\in S_{X}%
\ \mid\ \operatorname*{Fix}\sigma=I\right\}  $. This proves Statement 4'.]

[\textit{Proof of Statement 5':} The proof of Statement 5' is entirely
analogous to the proof of Statement 5 in our above solution to Exercise
\ref{exe.count.dera.subfix.details} (since any derangement of $X\setminus I$
is a permutation of $X\setminus I$).]

[\textit{Proof of Statement 6':} The proof of Statement 6' is entirely
analogous to the proof of Statement 6 in our above solution to Exercise
\ref{exe.count.dera.subfix.details}.]

We have now proved all six Statements 1', 2', 3', 4', 5' and 6'. This fills
all the gaps in our above argument. Hence, Proposition
\ref{prop.count.dera.sub=fix} is completely proved.
\end{proof}

We can draw the following conclusion from Proposition
\ref{prop.count.dera.sub=fix} (analogous to Corollary
\ref{cor.count.dera.subfix-size}):

\begin{corollary}
\label{cor.count.dera.sub=fix-size}Let $n\in\mathbb{N}$. Let $X$ be an
$n$-element set. Let $I$ be a subset of $X$. Then,
\[
\left\vert \left\{  \sigma\in S_{X}\ \mid\ \operatorname*{Fix}\sigma
=I\right\}  \right\vert =D_{n-\left\vert I\right\vert }.
\]

\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.count.dera.sub=fix-size}.]The set $X\setminus I$
is finite and satisfies $\left\vert X\setminus I\right\vert =n-\left\vert
I\right\vert $. (This can be proved in the same way as in our above proof of
Corollary \ref{cor.count.dera.subfix-size}.)

Proposition \ref{prop.count.dera.sub=fix} shows that there is a bijection%
\[
\text{from }\left\{  \sigma\in S_{X}\ \mid\ \operatorname*{Fix}\sigma
=I\right\}  \text{ to }\left\{  \text{derangements of }X\setminus I\right\}
.
\]
Hence, the bijection principle yields%
\begin{align*}
\left\vert \left\{  \sigma\in S_{X}\ \mid\ \operatorname*{Fix}\sigma
=I\right\}  \right\vert  &  =\left\vert \left\{  \text{derangements of
}X\setminus I\right\}  \right\vert \\
&  =\left(  \text{\# of derangements of }X\setminus I\right)  .
\end{align*}
But $X\setminus I$ is an $\left(  n-\left\vert I\right\vert \right)  $-element
set (since $\left\vert X\setminus I\right\vert =n-\left\vert I\right\vert $),
and we have $n-\left\vert I\right\vert =\left\vert X\setminus I\right\vert
\in\mathbb{N}$. Hence, Lemma \ref{lem.count.dera.X=n} (applied to $X\setminus
I$ and $n-\left\vert I\right\vert $ instead of $X$ and $n$) shows that%
\[
\left(  \text{\# of derangements of }X\setminus I\right)  =\left(  \text{\# of
derangements of }\left[  n-\left\vert I\right\vert \right]  \right)
=D_{n-\left\vert I\right\vert }%
\]
(since $D_{n-\left\vert I\right\vert }$ is defined as the \# of derangements
of $\left[  n-\left\vert I\right\vert \right]  $). Thus,%
\[
\left\vert \left\{  \sigma\in S_{X}\ \mid\ \operatorname*{Fix}\sigma
=I\right\}  \right\vert =\left(  \text{\# of derangements of }X\setminus
I\right)  =D_{n-\left\vert I\right\vert }.
\]
This proves Corollary \ref{cor.count.dera.sub=fix-size}.
\end{proof}

We can now prove Theorem \ref{thm.count.dera.teasers} \textbf{(c)} at last:

\begin{proof}
[Proof of Theorem \ref{thm.count.dera.teasers} \textbf{(c)}.]Let
$n\in\mathbb{N}$. Then, $\operatorname*{Fix}\sigma$ is a subset of $\left[
n\right]  $ for each permutation $\sigma\in S_{\left[  n\right]  }$ (by the
definition of $\operatorname*{Fix}\sigma$). Hence, the sum rule (Theorem
\ref{thm.sumrule2}) yields%
\[
\left\vert S_{\left[  n\right]  }\right\vert =\sum_{I\text{ is a subset of
}\left[  n\right]  }\left(  \text{\# of }\sigma\in S_{\left[  n\right]
}\text{ satisfying }\operatorname*{Fix}\sigma=I\right)  .
\]
Comparing this with%
\begin{align*}
\left\vert S_{\left[  n\right]  }\right\vert  &  =\underbrace{\left\vert
\left[  n\right]  \right\vert }_{=n}!\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{eq.count.perms.absSX=}), applied to }X=\left[  n\right]  \right) \\
&  =n!,
\end{align*}
we obtain%
\begin{align}
n!  &  =\sum_{I\text{ is a subset of }\left[  n\right]  }\underbrace{\left(
\text{\# of }\sigma\in S_{\left[  n\right]  }\text{ satisfying }%
\operatorname*{Fix}\sigma=I\right)  }_{\substack{=\left\vert \left\{
\sigma\in S_{\left[  n\right]  }\ \mid\ \operatorname*{Fix}\sigma=I\right\}
\right\vert \\=D_{n-\left\vert I\right\vert }\\\text{(by Corollary
\ref{cor.count.dera.sub=fix-size}, applied to }X=\left[  n\right]  \text{)}%
}}\nonumber\\
&  =\sum_{I\text{ is a subset of }\left[  n\right]  }D_{n-\left\vert
I\right\vert }. \label{pf.thm.count.dera.teasers.c.2}%
\end{align}


Now, let us note that each subset $I$ of $\left[  n\right]  $ satisfies
$\left\vert I\right\vert \in\left\{  0,1,\ldots,n\right\}  $ (since Theorem
\ref{thm.subset-leq} \textbf{(b)} yields $\left\vert I\right\vert
\leq\left\vert \left[  n\right]  \right\vert =n$). Hence, we can split the sum
$\sum_{I\text{ is a subset of }\left[  n\right]  }D_{n-\left\vert I\right\vert
}$ according to the value of $\left\vert I\right\vert $, obtaining the
following:%
\begin{align*}
\sum_{I\text{ is a subset of }\left[  n\right]  }D_{n-\left\vert I\right\vert
}  &  =\sum_{k\in\left\{  0,1,\ldots,n\right\}  }\ \ \sum_{\substack{I\text{
is a subset of }\left[  n\right]  ;\\\left\vert I\right\vert =k}%
}\underbrace{D_{n-\left\vert I\right\vert }}_{\substack{=D_{n-k}\\\text{(since
}\left\vert I\right\vert =k\text{)}}}\\
&  =\underbrace{\sum_{k\in\left\{  0,1,\ldots,n\right\}  }}_{=\sum_{k=0}^{n}%
}\ \ \underbrace{\sum_{\substack{I\text{ is a subset of }\left[  n\right]
;\\\left\vert I\right\vert =k}}D_{n-k}}_{=\left(  \text{\# of subsets }I\text{
of }\left[  n\right]  \text{ satisfying }\left\vert I\right\vert =k\right)
D_{n-k}}\\
&  =\sum_{k=0}^{n}\underbrace{\left(  \text{\# of subsets }I\text{ of }\left[
n\right]  \text{ satisfying }\left\vert I\right\vert =k\right)  }%
_{\substack{=\left(  \text{\# of }k\text{-element subsets of }\left[
n\right]  \right)  \\=\dbinom{n}{k}\\\text{(by Theorem \ref{thm.binom.comb},
applied to }S=\left[  n\right]  \text{)}}}D_{n-k}\\
&  =\sum_{k=0}^{n}\dbinom{n}{k}D_{n-k}.
\end{align*}
Thus, (\ref{pf.thm.count.dera.teasers.c.2}) becomes%
\[
n!=\sum_{I\text{ is a subset of }\left[  n\right]  }D_{n-\left\vert
I\right\vert }=\sum_{k=0}^{n}\dbinom{n}{k}D_{n-k}.
\]
This proves Theorem \ref{thm.count.dera.teasers} \textbf{(c).}
\end{proof}

We have now proved parts \textbf{(a)}, \textbf{(b)} and \textbf{(c)} of
Theorem \ref{thm.count.dera.teasers}. This solves Exercise
\ref{exe.count.dera.teasers.abc}.

\subsection{Reference to solution to Exercise \ref{exe.ent.phi.even}}

Exercise \ref{exe.ent.phi.even} is \cite[Exercise 2.14.4]{19s}.

\subsection{Reference to solution to Exercise \ref{exe.ent.phi.gauss}}

Exercise \ref{exe.ent.phi.gauss} is \cite[Exercise 2.14.5]{19s}.

\subsection{Reference to solution to Exercise \ref{exe.eulerphi.proda}}

Exercise \ref{exe.eulerphi.proda} asks us to prove Lemma
\ref{lem.eulerphi.proda}.

Lemma \ref{lem.eulerphi.proda} appears (with a sketch of a proof) in
\cite[Lemma 16.2]{Galvin}. Alternatively, it can be proved by induction on
$n$, similarly to how Theorem \ref{thm.subsets.2pown} was proved in our
solution of Exercise \ref{exe.subsets.2pown}. (Actually, if we apply Lemma
\ref{lem.eulerphi.proda} \textbf{(a)} to $a_{i}=1$, then we obtain $\left(
\text{\# of subsets of }\left[  n\right]  \right)  =2^{n}$, which is exactly
what Theorem \ref{thm.subsets.2pown} says for $S=\left[  n\right]  $.)

Alternatively, Lemma \ref{lem.eulerphi.proda} can be easily obtained from the
following identity:

\begin{lemma}
\label{lem.eulerphi.prodab}Let $n\in\mathbb{N}$. Let $a_{1},a_{2},\ldots
,a_{n}$ be $n$ numbers. Let $b_{1},b_{2},\ldots,b_{n}$ be $n$ further numbers.
Then,%
\[
\prod_{i=1}^{n}\left(  a_{i}+b_{i}\right)  =\sum_{I\subseteq\left[  n\right]
}\left(  \prod_{i\in I}a_{i}\right)  \left(  \prod_{i\in\left[  n\right]
\setminus I}b_{i}\right)  .
\]

\end{lemma}

Lemma \ref{lem.eulerphi.prodab} appears (with detailed proof) in
\cite[Exercise 6.1 \textbf{(a)}]{detnotes}. Now, Lemma
\ref{lem.eulerphi.proda} can easily be derived from it:

\begin{proof}
[Proof of Lemma \ref{lem.eulerphi.proda}.]\textbf{(a)} Lemma
\ref{lem.eulerphi.prodab} (applied to $b_{i}=1$) yields%
\[
\prod_{i=1}^{n}\left(  a_{i}+1\right)  =\sum_{I\subseteq\left[  n\right]
}\left(  \prod_{i\in I}a_{i}\right)  \underbrace{\left(  \prod_{i\in\left[
n\right]  \setminus I}1\right)  }_{=1}=\sum_{I\subseteq\left[  n\right]
}\prod_{i\in I}a_{i}.
\]
Hence,
\[
\sum_{I\subseteq\left[  n\right]  }\prod_{i\in I}a_{i}=\prod_{i=1}%
^{n}\underbrace{\left(  a_{i}+1\right)  }_{=1+a_{i}}=\prod_{i=1}^{n}\left(
1+a_{i}\right)  =\left(  1+a_{1}\right)  \left(  1+a_{2}\right)  \cdots\left(
1+a_{n}\right)  .
\]
This proves Lemma \ref{lem.eulerphi.proda} \textbf{(a)}.

\textbf{(b)} Lemma \ref{lem.eulerphi.proda} \textbf{(a)} (applied to $-a_{i}$
instead of $a_{i}$) yields%
\begin{align*}
\sum_{I\subseteq\left[  n\right]  }\prod_{i\in I}\left(  -a_{i}\right)   &
=\left(  1+\left(  -a_{1}\right)  \right)  \left(  1+\left(  -a_{2}\right)
\right)  \cdots\left(  1+\left(  -a_{n}\right)  \right) \\
&  =\left(  1-a_{1}\right)  \left(  1-a_{2}\right)  \cdots\left(
1-a_{n}\right)
\end{align*}
(since $1+\left(  -a_{i}\right)  =1-a_{i}$ for each $i\in\left[  n\right]  $).
Comparing this with%
\[
\sum_{I\subseteq\left[  n\right]  }\underbrace{\prod_{i\in I}\left(
-a_{i}\right)  }_{=\left(  -1\right)  ^{\left\vert I\right\vert }\prod_{i\in
I}a_{i}}=\sum_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\prod_{i\in I}a_{i},
\]
we obtain%
\[
\sum_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\prod_{i\in I}a_{i}=\left(  1-a_{1}\right)  \left(
1-a_{2}\right)  \cdots\left(  1-a_{n}\right)  .
\]
This proves Lemma \ref{lem.eulerphi.proda} \textbf{(b)}.
\end{proof}

\subsection{Solution to Exercise \ref{exe.eulerphi.prime-prod}}

In order to solve Exercise \ref{exe.eulerphi.prime-prod}, we need to prove
Lemma \ref{lem.eulerphi.prime-prod}. First, we will show an auxiliary fact:

\begin{lemma}
\label{lem.eulerphi.dist-pri-copri}Any two distinct primes are coprime.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.eulerphi.dist-pri-copri}.]Let $p$ and $q$ be two
distinct primes. We must prove that $p$ and $q$ are coprime. In other words,
we must prove that $\gcd\left(  p,q\right)  =1$ (since this is what it means
for $p$ and $q$ to be coprime).

Assume the contrary. Thus, $\gcd\left(  p,q\right)  \neq1$.

The definition of $\gcd\left(  p,q\right)  $ shows that $\gcd\left(
p,q\right)  $ is the greatest positive integer that divides both $p$ and $q$.
Thus, $\gcd\left(  p,q\right)  $ is a positive integer and divides both $p$
and $q$. In particular, $\gcd\left(  p,q\right)  $ is a positive divisor of
$p$ (since $\gcd\left(  p,q\right)  $ is positive and divides $p$).

But $p$ is prime. In other words, $p$ is an integer greater than $1$ and
having the property that the only positive divisors of $p$ are $1$ and $p$. In
particular, the only positive divisors of $p$ are $1$ and $p$. Hence,
$\gcd\left(  p,q\right)  $ must be either $1$ or $p$ (since $\gcd\left(
p,q\right)  $ is a positive divisor of $p$). Since $\gcd\left(  p,q\right)  $
cannot be $1$ (because $\gcd\left(  p,q\right)  \neq1$), we thus conclude that
$\gcd\left(  p,q\right)  =p$.

Similarly, we obtain $\gcd\left(  p,q\right)  =q$ (since $\gcd\left(
p,q\right)  $ divides not only $p$ but also $q$).

Comparing $\gcd\left(  p,q\right)  =p$ with $\gcd\left(  p,q\right)  =q$, we
obtain $p=q$. This contradicts the fact that $p$ and $q$ are distinct. This
contradiction shows that our assumption was false. Hence, $\gcd\left(
p,q\right)  =1$ is proved. In other words, $p$ and $q$ are coprime. This
proves Lemma \ref{lem.eulerphi.dist-pri-copri}.
\end{proof}

We can now prove Lemma \ref{lem.eulerphi.prime-prod}:

\begin{proof}
[Proof of Lemma \ref{lem.eulerphi.prime-prod}.]The $k$ numbers $b_{1}%
,b_{2},\ldots,b_{k}$ are primes, and thus are positive integers.

Lemma \ref{lem.eulerphi.dist-pri-copri} shows that any two distinct primes are
coprime. Hence, any $k$ distinct primes are mutually coprime. Thus, the $k$
positive integers $b_{1},b_{2},\ldots,b_{k}$ are mutually coprime (since they
are $k$ distinct primes). Thus, Lemma \ref{lem.eulerphi.coprime-prod} shows
that $b_{1}b_{2}\cdots b_{k}\mid c$. This proves Lemma
\ref{lem.eulerphi.prime-prod}.
\end{proof}

Thus, Exercise \ref{exe.eulerphi.prime-prod} is solved.

\subsection{Solution to Exercise \ref{exe.eulerphi.2}}

In order to solve Exercise \ref{exe.eulerphi.2}, we must prove Lemma
\ref{lem.eulerphi.2}.

\begin{proof}
[Proof of Lemma \ref{lem.eulerphi.2}.]We must prove the equivalence
(\ref{eq.lem.eulerphi.2.equiv}). We shall do this by separately proving the
\textquotedblleft$\Longrightarrow$\textquotedblright\ and \textquotedblleft%
$\Longleftarrow$\textquotedblright\ implications of this equivalence:

\textit{Proof of the \textquotedblleft}$\Longrightarrow$%
\textit{\textquotedblright\ implication of (\ref{eq.lem.eulerphi.2.equiv}):}
Assume that $p_{j}$ divides $m$ for each $j\in I$. We must show that
$\prod_{i\in I}p_{i}$ divides $m$.

Let $h_{1},h_{2},\ldots,h_{k}$ be all elements of $I$, listed in some order
(with no repetitions). Thus, $I=\left\{  h_{1},h_{2},\ldots,h_{k}\right\}  $
and $\prod_{i\in I}p_{i}=p_{h_{1}}p_{h_{2}}\cdots p_{h_{k}}$.

The primes $p_{h_{1}},p_{h_{2}},\ldots,p_{h_{k}}$ are
distinct\footnote{\textit{Proof.} Let $u$ and $v$ be two elements of $\left[
k\right]  $ such that $u\neq v$. We shall show that $p_{h_{u}}\neq p_{h_{v}}$.
\par
The elements $h_{1},h_{2},\ldots,h_{k}$ are distinct (since they are all
elements of $I$, listed \textbf{with no repetitions}). Hence, from $u\neq v$,
we obtain $h_{u}\neq h_{v}$. Therefore, $p_{h_{u}}\neq p_{h_{v}}$, since all
the primes $p_{i}$ (for different $i\in I$) are distinct.
\par
Forget that we fixed $u$ and $v$. We thus have shown that if $u$ and $v$ are
two elements of $\left[  k\right]  $ such that $u\neq v$, then $p_{h_{u}}\neq
p_{h_{v}}$. In other words, the primes $p_{h_{1}},p_{h_{2}},\ldots,p_{h_{k}}$
are distinct.}.

Let $i\in\left\{  1,2,\ldots,k\right\}  $. Hence, $h_{i}\in\left\{
h_{1},h_{2},\ldots,h_{k}\right\}  =I$. But $p_{j}$ divides $m$ for each $j\in
I$ (by our assumption). Applying this to $j=h_{i}$, we obtain that $p_{h_{i}}$
divides $m$ (since $h_{i}\in I$). In other words, $p_{h_{i}}\mid m$.

Forget that we fixed $i$. We thus have showed that $p_{h_{i}}\mid m$ for each
$i\in\left\{  1,2,\ldots,k\right\}  $. Hence, Lemma
\ref{lem.eulerphi.prime-prod} (applied to $b_{i}=p_{h_{i}}$) shows that
$p_{h_{1}}p_{h_{2}}\cdots p_{h_{k}}\mid m$ (since $p_{h_{1}},p_{h_{2}}%
,\ldots,p_{h_{k}}$ are $k$ distinct primes). In view of $\prod_{i\in I}%
p_{i}=p_{h_{1}}p_{h_{2}}\cdots p_{h_{k}}$, this rewrites as $\prod_{i\in
I}p_{i}\mid m$. In other words, $\prod_{i\in I}p_{i}$ divides $m$.

We thus have shown that if $p_{j}$ divides $m$ for each $j\in I$, then
$\prod_{i\in I}p_{i}$ divides $m$. In other words, we have proved the
\textquotedblleft$\Longrightarrow$\textquotedblright\ implication of
(\ref{eq.lem.eulerphi.2.equiv}).

\textit{Proof of the \textquotedblleft}$\Longleftarrow$%
\textit{\textquotedblright\ implication of (\ref{eq.lem.eulerphi.2.equiv}):}
Assume that $\prod_{i\in I}p_{i}$ divides $m$. We must show that $p_{j}$
divides $m$ for each $j\in I$.

Fix $j\in I$. Then, we can split off the factor for $i=j$ from the product
$\prod_{i\in I}p_{i}$. We thus obtain
\[
\prod_{i\in I}p_{i}=p_{j}\cdot\underbrace{\prod_{i\in I\setminus\left\{
j\right\}  }p_{i}}_{\text{an integer}}.
\]
Hence, $p_{j}\mid\prod_{i\in I}p_{i}$. But $\prod_{i\in I}p_{i}\mid m$ (since
$\prod_{i\in I}p_{i}$ divides $m$). Combining the preceding two sentences, we
conclude that $p_{j}\mid\prod_{i\in I}p_{i}\mid m$, thus $p_{j}\mid
m$\ \ \ \ \footnote{Here we are using the \emph{transitivity of divisibility}
(i.e., the fact that if $a$, $b$ and $c$ are three integers satisfying $a\mid
b$ and $b\mid c$, then $a\mid c$). This is \cite[Proposition 2.2.4
\textbf{(b)}]{19s} (and is easy to prove).}. In other words, $p_{j}$ divides
$m$.

Forget that we fixed $j$. We thus have proved that $p_{j}$ divides $m$ for
each $j\in I$.

We thus have shown that if $\prod_{i\in I}p_{i}$ divides $m$, then $p_{j}$
divides $m$ for each $j\in I$. In other words, we have proved the
\textquotedblleft$\Longleftarrow$\textquotedblright\ implication of
(\ref{eq.lem.eulerphi.2.equiv}).

We now have proved both \textquotedblleft$\Longrightarrow$\textquotedblright%
\ and \textquotedblleft$\Longleftarrow$\textquotedblright\ implications of
(\ref{eq.lem.eulerphi.2.equiv}). Thus, (\ref{eq.lem.eulerphi.2.equiv}) holds,
and therefore Lemma \ref{lem.eulerphi.2} is proved.
\end{proof}

This solves Exercise \ref{exe.eulerphi.2}.

\subsection{Solution to Exercise \ref{exe.eulerphi.3}}

In order to solve Exercise \ref{exe.eulerphi.3}, we must prove Lemma
\ref{lem.eulerphi.3}. First, we recall a very elementary fact
(\cite[Proposition 2.13.8]{19s}):

\begin{proposition}
\label{prop.ent.prime.ex-pri-div}Let $n>1$ be an integer. Then, there exists
at least one prime $p$ such that $p\mid n$.
\end{proposition}

\begin{proof}
[Proof of Lemma \ref{lem.eulerphi.3}.]We must prove the equivalence%
\begin{align}
&  \ \left(  m\text{ is coprime to }u\right) \nonumber\\
&  \Longleftrightarrow\ \left(  \left(  p_{i}\text{ does not divide }m\right)
\text{ for each }i\in\left[  n\right]  \right)  .
\label{pf.lem.eulerphi.3.goal}%
\end{align}
We shall do this by separately proving the \textquotedblleft$\Longrightarrow
$\textquotedblright\ and \textquotedblleft$\Longleftarrow$\textquotedblright%
\ implications of this equivalence:

\textit{Proof of the \textquotedblleft}$\Longrightarrow$%
\textit{\textquotedblright\ implication of (\ref{pf.lem.eulerphi.3.goal}):}
Assume that $m$ is coprime to $u$. We must show that $\left(  p_{i}\text{ does
not divide }m\right)  $ for each $i\in\left[  n\right]  $.

Fix $i\in\left[  n\right]  $. We shall show that $p_{i}$ does not divide $m$.

Indeed, assume the contrary. Thus, $p_{i}$ divides $m$. But $p_{i}$ is a prime
that divides $u$ (since all of $p_{1},p_{2},\ldots,p_{n}$ are primes that
divide $u$); thus, $p_{i}$ divides $u$. Hence, the positive integer $p_{i}$
divides both $m$ and $u$. Since $p_{i}$ is a prime, we have $p_{i}>1$.

We have assumed that $m$ is coprime to $u$. In other words, $\gcd\left(
m,u\right)  =1$ (by the definition of \textquotedblleft
coprime\textquotedblright). But $\gcd\left(  m,u\right)  $ is defined to be
the greatest positive integer that divides both $m$ and $u$. Therefore, if $r$
is any positive integer that divides both $m$ and $u$, then $r\leq\gcd\left(
m,u\right)  $. Applying this to $r=p_{i}$, we obtain $p_{i}\leq\gcd\left(
m,u\right)  $ (since $p_{i}$ is a positive integer that divides both $m$ and
$u$). Thus, $p_{i}\leq\gcd\left(  m,u\right)  =1$. This contradicts $p_{i}>1$.

This contradiction shows that our assumption was wrong. Hence, $p_{i}$ does
not divide $m$.

Forget that we fixed $i$. We thus have proved that $\left(  p_{i}\text{ does
not divide }m\right)  $ for each $i\in\left[  n\right]  $.

We thus have shown that if $m$ is coprime to $u$, then $\left(  p_{i}\text{
does not divide }m\right)  $ for each $i\in\left[  n\right]  $. In other
words, we have proved the \textquotedblleft$\Longrightarrow$\textquotedblright%
\ implication of (\ref{pf.lem.eulerphi.3.goal}).

\textit{Proof of the \textquotedblleft}$\Longleftarrow$%
\textit{\textquotedblright\ implication of (\ref{pf.lem.eulerphi.3.goal}):}
Assume that $\left(  p_{i}\text{ does not divide }m\right)  $ for each
$i\in\left[  n\right]  $. We must show that $m$ is coprime to $u$. In other
words, we must show that $\gcd\left(  m,u\right)  =1$ (because this is what it
means for $m$ to be coprime to $u$).

Indeed, assume the contrary. Thus, $\gcd\left(  m,u\right)  \neq1$. But
$\gcd\left(  m,u\right)  $ is the greatest positive integer that divides both
$m$ and $u$ (by the definition of $\gcd\left(  m,u\right)  $). Hence,
$\gcd\left(  m,u\right)  $ is a positive integer. Therefore, from $\gcd\left(
m,u\right)  \neq1$, we obtain $\gcd\left(  m,u\right)  >1$. Hence, Proposition
\ref{prop.ent.prime.ex-pri-div} (applied to $\gcd\left(  m,u\right)  $ instead
of $n$) yields that there exists at least one prime $p$ such that $p\mid
\gcd\left(  m,u\right)  $. Consider this $p$.

Recall that $\gcd\left(  m,u\right)  $ divides both $m$ and $u$. In other
words, $\gcd\left(  m,u\right)  \mid m$ and $\gcd\left(  m,u\right)  \mid u$.

We have $p\mid\gcd\left(  m,u\right)  $ and $\gcd\left(  m,u\right)  \mid m$.
Combining these two divisibilities, we find $p\mid\gcd\left(  m,u\right)  \mid
m$, thus $p\mid m$\ \ \ \ \footnote{Here we are using the \emph{transitivity
of divisibility} (i.e., the fact that if $a$, $b$ and $c$ are three integers
satisfying $a\mid b$ and $b\mid c$, then $a\mid c$). This is \cite[Proposition
2.2.4 \textbf{(b)}]{19s} (and is easy to prove).}. Likewise, combining
$p\mid\gcd\left(  m,u\right)  $ with $\gcd\left(  m,u\right)  \mid u$, we find
$p\mid\gcd\left(  m,u\right)  \mid u$, so that $p\mid u$%
\ \ \ \ \footnote{again, by the transitivity of divisibility}. Thus, $p$ is a
prime that divides $u$ (since $p$ is a prime). Hence, $p$ must be one of the
$n$ primes $p_{1},p_{2},\ldots,p_{n}$ (since these $n$ primes $p_{1}%
,p_{2},\ldots,p_{n}$ are precisely the distinct primes that divide $u$). In
other words, $p=p_{j}$ for some $j\in\left[  n\right]  $. Consider this $j$.

Recall that we assumed that $\left(  p_{i}\text{ does not divide }m\right)  $
for each $i\in\left[  n\right]  $. Applying this to $i=j$, we conclude that
$p_{j}$ does not divide $m$. In other words, $p$ does not divide $m$ (since
$p=p_{j}$). But this contradicts $p\mid m$. This contradiction shows that our
assumption was false. Hence, we have proved that $\gcd\left(  m,u\right)  =1$.
In other words, $m$ is coprime to $u$.

We thus have shown that if $\left(  p_{i}\text{ does not divide }m\right)  $
for each $i\in\left[  n\right]  $, then $m$ is coprime to $u$. In other words,
we have proved the \textquotedblleft$\Longleftarrow$\textquotedblright%
\ implication of (\ref{pf.lem.eulerphi.3.goal}).

We now have proved both \textquotedblleft$\Longrightarrow$\textquotedblright%
\ and \textquotedblleft$\Longleftarrow$\textquotedblright\ implications of
(\ref{pf.lem.eulerphi.3.goal}). Thus, (\ref{pf.lem.eulerphi.3.goal}) holds,
and therefore Lemma \ref{lem.eulerphi.3} is proved.
\end{proof}

This solves Exercise \ref{exe.eulerphi.3}.

\subsection{Solution to Exercise \ref{exe.DIE.etabasis-lem}}

\begin{proof}
[Solution to Exercise \ref{exe.DIE.etabasis-lem}.]We proceed similarly to the
second proof of Proposition \ref{prop.DIE.destruct1}.

We are in one of the following two cases:

\textit{Case 1:} We have $S\subseteq T$.

\textit{Case 2:} We don't have $S\subseteq T$.

Let us first consider Case 1. In this case, we have $S\subseteq T$. Hence,
every subset $I$ of $S$ satisfies%
\begin{equation}
\left(  -1\right)  ^{\left\vert I\setminus T\right\vert }=1.
\label{sol.DIE.etabasis-lem.c1.1}%
\end{equation}


[\textit{Proof of (\ref{sol.DIE.etabasis-lem.c1.1}):} Let $I$ be a subset of
$S$. Thus, $I\subseteq S\subseteq T$, so that $I\setminus T=\varnothing$.
Thus, $\left\vert I\setminus T\right\vert =\left\vert \varnothing\right\vert
=0$. Hence, $\left(  -1\right)  ^{\left\vert I\setminus T\right\vert }=\left(
-1\right)  ^{0}=1$. This proves (\ref{sol.DIE.etabasis-lem.c1.1}).]

On the other hand, $S$ is a $\left\vert S\right\vert $-element set. Hence,
Theorem \ref{thm.subsets.2pown} (applied to $n=\left\vert S\right\vert $)
yields $\left(  \text{\# of subsets of }S\right)  =2^{\left\vert S\right\vert
}$.

Now,%
\begin{align*}
\sum_{I\subseteq S}\underbrace{\left(  -1\right)  ^{\left\vert I\setminus
T\right\vert }}_{\substack{=1\\\text{(by (\ref{sol.DIE.etabasis-lem.c1.1}))}%
}}  &  =\sum_{I\subseteq S}1=\left(  \text{\# of subsets }I\text{ of
}S\right)  \cdot1\\
&  =\left(  \text{\# of subsets }I\text{ of }S\right)  =\left(  \text{\# of
subsets of }S\right)  =2^{\left\vert S\right\vert }.
\end{align*}
Comparing this with%
\[%
\begin{cases}
2^{\left\vert S\right\vert }, & \text{if }S\subseteq T;\\
0, & \text{otherwise}%
\end{cases}
=2^{\left\vert S\right\vert }\ \ \ \ \ \ \ \ \ \ \left(  \text{since
}S\subseteq T\right)  ,
\]
we obtain
\[
\sum_{I\subseteq S}\left(  -1\right)  ^{\left\vert I\setminus T\right\vert }=%
\begin{cases}
2^{\left\vert S\right\vert }, & \text{if }S\subseteq T;\\
0, & \text{otherwise}%
\end{cases}
\ \ .
\]
Thus, Exercise \ref{exe.DIE.etabasis-lem} is solved in Case 1.

Let us now consider Case 2. In this case, we don't have $S\subseteq T$. Hence,
there exists some $g\in S$ such that $g\notin T$. Consider this $g$. (We can
have many choices for $g$, but we just pick one.) Note that the sets $\left\{
g\right\}  $ and $T$ are disjoint (since $g\notin T$). Hence, $\left\{
g\right\}  \setminus T=\left\{  g\right\}  $.

Each subset $I$ of $S$ must satisfy either $g\in I$ or $g\notin I$ (but not
both at the same time). Hence, we can split the sum $\sum_{I\subseteq
S}\left(  -1\right)  ^{\left\vert I\setminus T\right\vert }$as follows:%
\begin{equation}
\sum_{I\subseteq S}\left(  -1\right)  ^{\left\vert I\setminus T\right\vert
}=\sum_{\substack{I\subseteq S;\\g\in I}}\left(  -1\right)  ^{\left\vert
I\setminus T\right\vert }+\sum_{\substack{I\subseteq S;\\g\notin I}}\left(
-1\right)  ^{\left\vert I\setminus T\right\vert }.
\label{sol.DIE.etabasis-lem.c2.1}%
\end{equation}


The map\footnote{The notation \textquotedblleft$\left\{  I\subseteq
S\ \mid\ g\notin I\right\}  $\textquotedblright\ means \textquotedblleft the
set of all subsets $I$ of $S$ satisfying $g\notin I$\textquotedblright.
Similarly, the notation \textquotedblleft$\left\{  I\subseteq S\ \mid\ g\in
I\right\}  $\textquotedblright\ means \textquotedblleft the set of all subsets
$I$ of $S$ satisfying $g\in I$\textquotedblright.}%
\begin{align*}
\left\{  I\subseteq S\ \mid\ g\notin I\right\}   &  \rightarrow\left\{
I\subseteq S\ \mid\ g\in I\right\}  ,\\
J  &  \mapsto J\cup\left\{  g\right\}
\end{align*}
is a bijection. (This can be proved in the exact same way as it was proved
during our second proof of Proposition \ref{prop.DIE.destruct1}.)

Moreover, every subset $J$ of $S$ satisfying $g\notin J$ must satisfy
\begin{equation}
\left(  -1\right)  ^{\left\vert \left(  J\cup\left\{  g\right\}  \right)
\setminus T\right\vert }=-\left(  -1\right)  ^{\left\vert J\setminus
T\right\vert }. \label{sol.DIE.etabasis-lem.c2.sign}%
\end{equation}


[\textit{Proof of (\ref{sol.DIE.etabasis-lem.c2.sign}):} Let $J$ be a subset
of $S$ satisfying $g\notin J$. Then, we cannot have $g\in J\setminus T$ (since
$g\in J\setminus T$ would imply $g\in J\setminus T\subseteq J$, which would
contradict $g\notin J$). Thus, we must have $g\notin J\setminus T$. But any
three sets $X$, $Y$ and $Z$ satisfy $\left(  X\cup Y\right)  \setminus
Z=\left(  X\setminus Z\right)  \cup\left(  Y\setminus Z\right)  $. Applying
this to $X=J$, $Y=\left\{  g\right\}  $ and $Z=T$, we find%
\[
\left(  J\cup\left\{  g\right\}  \right)  \setminus T=\left(  J\setminus
T\right)  \cup\underbrace{\left(  \left\{  g\right\}  \setminus T\right)
}_{=\left\{  g\right\}  }=\left(  J\setminus T\right)  \cup\left\{  g\right\}
.
\]
Hence, $\left\vert \left(  J\cup\left\{  g\right\}  \right)  \setminus
T\right\vert =\left\vert \left(  J\setminus T\right)  \cup\left\{  g\right\}
\right\vert =\left\vert J\setminus T\right\vert +1$ (since $g\notin J\setminus
T$). Thus, $\left(  -1\right)  ^{\left\vert \left(  J\cup\left\{  g\right\}
\right)  \setminus T\right\vert }=\left(  -1\right)  ^{\left\vert J\setminus
T\right\vert +1}=-\left(  -1\right)  ^{\left\vert J\setminus T\right\vert }$.
This proves (\ref{sol.DIE.etabasis-lem.c2.sign}).]

Now, we can substitute $J\cup\left\{  g\right\}  $ for $I$ in the sum
$\sum_{\substack{I\subseteq S;\\g\in I}}\left(  -1\right)  ^{\left\vert
I\setminus T\right\vert }$ (since the map $\left\{  I\subseteq S\ \mid
\ g\notin I\right\}  \rightarrow\left\{  I\subseteq S\ \mid\ g\in I\right\}
,\ J\mapsto J\cup\left\{  g\right\}  $ is a bijection). We thus obtain%
\begin{align}
\sum_{\substack{I\subseteq S;\\g\in I}}\left(  -1\right)  ^{\left\vert
I\setminus T\right\vert }  &  =\sum_{\substack{J\subseteq S;\\g\notin
J}}\underbrace{\left(  -1\right)  ^{\left\vert \left(  J\cup\left\{
g\right\}  \right)  \setminus T\right\vert }}_{\substack{=-\left(  -1\right)
^{\left\vert J\setminus T\right\vert }\\\text{(by
(\ref{sol.DIE.etabasis-lem.c2.sign}))}}}=\sum_{\substack{J\subseteq
S;\\g\notin J}}\left(  -\left(  -1\right)  ^{\left\vert J\setminus
T\right\vert }\right)  =-\sum_{\substack{J\subseteq S;\\g\notin J}}\left(
-1\right)  ^{\left\vert J\setminus T\right\vert }\nonumber\\
&  =-\sum_{\substack{I\subseteq S;\\g\notin I}}\left(  -1\right)  ^{\left\vert
I\setminus T\right\vert } \label{sol.DIE.etabasis-lem.c2.2}%
\end{align}
(here, we have renamed the summation index $J$ as $I$).

Now, (\ref{sol.DIE.etabasis-lem.c2.1}) becomes%
\[
\sum_{I\subseteq S}\left(  -1\right)  ^{\left\vert I\setminus T\right\vert
}=\underbrace{\sum_{\substack{I\subseteq S;\\g\in I}}\left(  -1\right)
^{\left\vert I\setminus T\right\vert }}_{\substack{=-\sum
_{\substack{I\subseteq S;\\g\notin I}}\left(  -1\right)  ^{\left\vert
I\setminus T\right\vert }\\\text{(by (\ref{sol.DIE.etabasis-lem.c2.2}))}%
}}+\sum_{\substack{I\subseteq S;\\g\notin I}}\left(  -1\right)  ^{\left\vert
I\setminus T\right\vert }=-\sum_{\substack{I\subseteq S;\\g\notin I}}\left(
-1\right)  ^{\left\vert I\setminus T\right\vert }+\sum_{\substack{I\subseteq
S;\\g\notin I}}\left(  -1\right)  ^{\left\vert I\setminus T\right\vert }=0.
\]
Comparing this with%
\[%
\begin{cases}
2^{\left\vert S\right\vert }, & \text{if }S\subseteq T;\\
0, & \text{otherwise}%
\end{cases}
=0\ \ \ \ \ \ \ \ \ \ \left(  \text{since we don't have }S\subseteq T\right)
,
\]
we obtain
\[
\sum_{I\subseteq S}\left(  -1\right)  ^{\left\vert I\setminus T\right\vert }=%
\begin{cases}
2^{\left\vert S\right\vert }, & \text{if }S\subseteq T;\\
0, & \text{otherwise}%
\end{cases}
\ \ .
\]
Thus, Exercise \ref{exe.DIE.etabasis-lem} is solved in Case 2.

Thus, Exercise \ref{exe.DIE.etabasis-lem} is solved (since we have solved it
in both Cases 1 and 2).
\end{proof}

\subsection{Reference to solution to Exercise \ref{exe.DIE.destructXY}}

Exercise \ref{exe.DIE.destructXY} is \cite[Exercise 2]{19f-mt2s}.

\subsection{Solution to Exercise \ref{exe.binom.compos.count0}}

\begin{proof}
[Solution to Exercise \ref{exe.binom.compos.count0}.]\textbf{(a)} Let
$n\in\mathbb{N}$ and $k\in\mathbb{N}$. We must prove that%
\begin{equation}
\dbinom{n-1}{n-k}=%
\begin{cases}
\dbinom{n-1}{k-1}, & \text{if }n>0;\\
\left[  k=0\right]  , & \text{if }n=0
\end{cases}
. \label{sol.binom.compos.count0.b.goal}%
\end{equation}


We are in one of the following two cases:

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

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

Let us first consider Case 1. In this case, we have $n=0$. We are in one of
the following two subcases:

\textit{Subcase 1.1:} We have $k=0$.

\textit{Subcase 1.2:} We have $k\neq0$.

Let us first consider Subcase 1.1. In this subcase, we have $k=0$. From $n=0$
and $k=0$, we obtain $\dbinom{n-1}{n-k}=\dbinom{0-1}{0-0}=\dbinom{-1}{0}=1$
(by (\ref{eq.exa.binom.small.nC0})). Comparing this with%
\begin{align*}%
\begin{cases}
\dbinom{n-1}{k-1}, & \text{if }n>0;\\
\left[  k=0\right]  , & \text{if }n=0
\end{cases}
&  =\left[  k=0\right]  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }n=0\right) \\
&  =1\ \ \ \ \ \ \ \ \ \ \left(  \text{since }k=0\right)  ,
\end{align*}
we find $\dbinom{n-1}{n-k}=%
\begin{cases}
\dbinom{n-1}{k-1}, & \text{if }n>0;\\
\left[  k=0\right]  , & \text{if }n=0
\end{cases}
$. Thus, (\ref{sol.binom.compos.count0.b.goal}) is proved in Subcase 1.1.

Let us next consider Subcase 1.2. In this subcase, we have $k\neq0$. Hence,
$k>0$ (since $k\in\mathbb{N}$), so that $-k<0$ and therefore $-k\notin%
\mathbb{N}$. Thus, $\underbrace{n}_{=0}-k=0-k=-k\notin\mathbb{N}$. Therefore,
(\ref{eq.def.binom.def.b}) (applied to $n-1$ and $n-k$ instead of $n$ and $k$)
yields $\dbinom{n-1}{n-k}=0$. Comparing this with%
\begin{align*}%
\begin{cases}
\dbinom{n-1}{k-1}, & \text{if }n>0;\\
\left[  k=0\right]  , & \text{if }n=0
\end{cases}
&  =\left[  k=0\right]  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }n=0\right) \\
&  =0\ \ \ \ \ \ \ \ \ \ \left(  \text{since }k\neq0\right)  ,
\end{align*}
we find $\dbinom{n-1}{n-k}=%
\begin{cases}
\dbinom{n-1}{k-1}, & \text{if }n>0;\\
\left[  k=0\right]  , & \text{if }n=0
\end{cases}
$. Thus, (\ref{sol.binom.compos.count0.b.goal}) is proved in Subcase 1.2.

We have now proved (\ref{sol.binom.compos.count0.b.goal}) in each of the two
Subcases 1.1 and 1.2. Hence, (\ref{sol.binom.compos.count0.b.goal}) is proved
in Case 1 (since Subcases 1.1 and 1.2 cover Case 1).

Let us next consider Case 2. In this case, we have $n\neq0$. Hence, $n$ is a
positive integer (since $n\in\mathbb{N}$). Thus, $n\geq1$, so that
$n-1\in\mathbb{N}$. Therefore, Theorem \ref{thm.binom.sym} (applied to $n-1$
and $n-k$ instead of $n$ and $k$) yields%
\[
\dbinom{n-1}{n-k}=\dbinom{n-1}{\left(  n-1\right)  -\left(  n-k\right)
}=\dbinom{n-1}{k-1}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left(
n-1\right)  -\left(  n-k\right)  =k-1\right)  .
\]
Comparing this with%
\[%
\begin{cases}
\dbinom{n-1}{k-1}, & \text{if }n>0;\\
\left[  k=0\right]  , & \text{if }n=0
\end{cases}
=\dbinom{n-1}{k-1}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }n>0\text{ (because
}n\geq1\text{)}\right)  ,
\]
we obtain $\dbinom{n-1}{n-k}=%
\begin{cases}
\dbinom{n-1}{k-1}, & \text{if }n>0;\\
\left[  k=0\right]  , & \text{if }n=0
\end{cases}
$. Thus, (\ref{sol.binom.compos.count0.b.goal}) is proved in Case 2.

We have now proved (\ref{sol.binom.compos.count0.b.goal}) in each of the two
Cases 1 and 2. Hence, (\ref{sol.binom.compos.count0.b.goal}) always holds.

Thus, we have proved (\ref{sol.binom.compos.count0.b.goal}). This solves
Exercise \ref{exe.binom.compos.count0} \textbf{(a)}.

\textbf{(b)} We must prove that Theorem \ref{thm.binom.compos.count} holds for
$n=0$.

So let $n\in\mathbb{N}$ and $k\in\mathbb{N}$, and assume that $n=0$. We must
prove the claim of Theorem \ref{thm.binom.compos.count}.

We shall first prove (\ref{eq.thm.binom.compos.count.r1}). We are in one of
the following two cases:

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

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

Let us first consider Case 1. In this case, we have $k=0$. Hence,
\begin{align*}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in
\mathbb{P}^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n\right) \\
&  =\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{0}\right)
\in\mathbb{P}^{0}\text{ satisfying }\underbrace{x_{1}+x_{2}+\cdots+x_{0}%
}_{=\left(  \text{empty sum}\right)  =0}=\underbrace{n}_{=0}\right) \\
&  =\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{0}\right)
\in\mathbb{P}^{0}\text{ satisfying }0=0\right) \\
&  =\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{0}\right)
\in\mathbb{P}^{0}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{since every }\left(
x_{1},x_{2},\ldots,x_{0}\right)  \in\mathbb{P}^{0}\text{ satisfies }0=0\right)
\\
&  =1
\end{align*}
(because there exists exactly one $0$-tuple $\left(  x_{1},x_{2},\ldots
,x_{0}\right)  \in\mathbb{P}^{0}$: namely, the empty list $\left(  {}\right)
$). Comparing this with%
\begin{align*}
\dbinom{n-1}{n-k}  &  =\dbinom{0-1}{0-0}\ \ \ \ \ \ \ \ \ \ \left(
\text{since }n=0\text{ and }k=0\right) \\
&  =\dbinom{0-1}{0}=1\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{eq.exa.binom.small.nC0})}\right)  ,
\end{align*}
we obtain
\[
\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in
\mathbb{P}^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n\right)
=\dbinom{n-1}{n-k}.
\]
Hence, (\ref{eq.thm.binom.compos.count.r1}) is proved in Case 1.

Let us next consider Case 2. In this case, we have $k\neq0$. Hence, $k>0$
(since $k\in\mathbb{N}$), so that $n-\underbrace{k}_{>0}<n=0$ and therefore
$n-k\notin\mathbb{N}$. Thus, (\ref{eq.def.binom.def.b}) (applied to $n-1$ and
$n-k$ instead of $n$ and $k$) yields $\dbinom{n-1}{n-k}=0$.

We have $k>0$. Thus, $x_{1}+x_{2}+\cdots+x_{k}\neq n$ for each $\left(
x_{1},x_{2},\ldots,x_{k}\right)  \in\mathbb{P}^{k}$%
\ \ \ \ \footnote{\textit{Proof.} Let $\left(  x_{1},x_{2},\ldots
,x_{k}\right)  \in\mathbb{P}^{k}$. Thus, $x_{1},x_{2},\ldots,x_{k}$ are
elements of $\mathbb{P}$; in other words, $x_{1},x_{2},\ldots x_{k}$ are
positive integers (since $\mathbb{P}$ is the set of all positive integers).
Thus, $x_{1}+x_{2}+\cdots+x_{k}$ is a sum of $k$ positive integers. Thus,
$x_{1}+x_{2}+\cdots+x_{k}$ is a positive integer itself (since any sum of $k$
positive integers is a positive integer (because $k\neq0$)). Hence,
$x_{1}+x_{2}+\cdots+x_{k}>0$, so that $x_{1}+x_{2}+\cdots+x_{k}\neq0$. In
other words, $x_{1}+x_{2}+\cdots+x_{k}\neq n$ (since $n=0$). Qed.}. In other
words, there exists no $\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in
\mathbb{P}^{k}$ satisfying $x_{1}+x_{2}+\cdots+x_{k}=n$. Thus,%
\[
\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in
\mathbb{P}^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n\right)  =0.
\]
Comparing this with $\dbinom{n-1}{n-k}=0$, we obtain
\[
\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in
\mathbb{P}^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n\right)
=\dbinom{n-1}{n-k}.
\]
Hence, (\ref{eq.thm.binom.compos.count.r1}) is proved in Case 2.

Hence, we have proved (\ref{eq.thm.binom.compos.count.r1}) in each of the two
Cases 1 and 2. Thus, (\ref{eq.thm.binom.compos.count.r1}) always holds.

Now, (\ref{eq.thm.binom.compos.count.r1}) yields%
\begin{align*}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in
\mathbb{P}^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n\right) \\
&  =\dbinom{n-1}{n-k}=%
\begin{cases}
\dbinom{n-1}{k-1}, & \text{if }n>0;\\
\left[  k=0\right]  , & \text{if }n=0
\end{cases}
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Exercise \ref{exe.binom.compos.count0}
\textbf{(a)}}\right)  .
\end{align*}
Thus, we have proved Theorem \ref{thm.binom.compos.count} under the assumption
that $n=0$. So we know that Theorem \ref{thm.binom.compos.count} holds for
$n=0$. This completes the solution to Exercise \ref{exe.binom.compos.count0}
\textbf{(b)}.

\textbf{(c)} We must prove that Theorem \ref{thm.binom.compos.count} holds for
$k=0$.

So let $n\in\mathbb{N}$ and $k\in\mathbb{N}$, and assume that $k=0$. We must
prove the claim of Theorem \ref{thm.binom.compos.count}.

If $n=0$, then this follows from Exercise \ref{exe.binom.compos.count0}
\textbf{(b)} (which was solved above). Hence, for the rest of this proof, we
WLOG assume that $n\neq0$. Hence, $n\geq1$ (since $n\in\mathbb{N}$), so that
$n-1\geq0$ and thus $n-1\in\mathbb{N}$. Moreover, $n-\underbrace{k}%
_{=0}=n>n-1$. Hence, Proposition \ref{prop.binom.0} (applied to $n-1$ and
$n-k$ instead of $n$ and $k$) yields $\dbinom{n-1}{n-k}=0$.

Also, we have $x_{1}+x_{2}+\cdots+x_{k}\neq n$ for each $\left(  x_{1}%
,x_{2},\ldots,x_{k}\right)  \in\mathbb{P}^{k}$%
\ \ \ \ \footnote{\textit{Proof.} Let $\left(  x_{1},x_{2},\ldots
,x_{k}\right)  \in\mathbb{P}^{k}$. From $k=0$, we obtain $x_{1}+x_{2}%
+\cdots+x_{k}=x_{1}+x_{2}+\cdots+x_{0}=\left(  \text{empty sum}\right)  =0\neq
n$ (since $n\neq0$). Qed.}. In other words, there exists no $\left(
x_{1},x_{2},\ldots,x_{k}\right)  \in\mathbb{P}^{k}$ satisfying $x_{1}%
+x_{2}+\cdots+x_{k}=n$. Thus,%
\[
\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in
\mathbb{P}^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n\right)  =0.
\]
Comparing this with $\dbinom{n-1}{n-k}=0$, we obtain
\begin{align*}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in
\mathbb{P}^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n\right) \\
&  =\dbinom{n-1}{n-k}=%
\begin{cases}
\dbinom{n-1}{k-1}, & \text{if }n>0;\\
\left[  k=0\right]  , & \text{if }n=0
\end{cases}
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Exercise \ref{exe.binom.compos.count0}
\textbf{(a)}}\right)  .
\end{align*}
Thus, we have proved Theorem \ref{thm.binom.compos.count} under the assumption
that $k=0$. So we know that Theorem \ref{thm.binom.compos.count} holds for
$k=0$. This completes the solution to Exercise \ref{exe.binom.compos.count0}
\textbf{(c)}.
\end{proof}

\subsection{Solution to Exercise \ref{exe.binom.compos.count2}}

In order to solve Exercise \ref{exe.binom.compos.count2}, we need to give an
alternative proof of Theorem \ref{thm.binom.compos.count}.

\begin{proof}
[Second proof of Theorem \ref{thm.binom.compos.count}.]Forget that we fixed
$n$ and $k$.

First, we shall prove (\ref{eq.thm.binom.compos.count.r1}) by induction on $k$.

\textit{Induction base:} We know (from Exercise \ref{exe.binom.compos.count0}
\textbf{(c)}) that Theorem \ref{thm.binom.compos.count} holds for $k=0$.
Hence, in particular, (\ref{eq.thm.binom.compos.count.r1}) holds for $k=0$.
This completes the induction base.

\textit{Induction step:} Let $q$ be a positive integer. Assume (as the
induction hypothesis) that (\ref{eq.thm.binom.compos.count.r1}) holds for
$k=q-1$. We must show that (\ref{eq.thm.binom.compos.count.r1}) holds for
$k=q$.

We have assumed that (\ref{eq.thm.binom.compos.count.r1}) holds for $k=q-1$.
In other words, we have%
\begin{align}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{q-1}\right)
\in\mathbb{P}^{q-1}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{q-1}=n\right)
\nonumber\\
&  =\dbinom{n-1}{n-\left(  q-1\right)  } \label{sol.binom.compos.count2.3.IH}%
\end{align}
for each $n\in\mathbb{N}$.

Now, let $n\in\mathbb{N}$. We shall compute the \# of $\left(  x_{1}%
,x_{2},\ldots,x_{q}\right)  \in\mathbb{P}^{q}$ satisfying $x_{1}+x_{2}%
+\cdots+x_{q}=n$.

First, we notice that if $\left(  x_{1},x_{2},\ldots,x_{q}\right)
\in\mathbb{P}^{q}$ satisfies $x_{1}+x_{2}+\cdots+x_{q}=n$, then $x_{q}%
\in\left[  n\right]  $\ \ \ \ \footnote{\textit{Proof.} Let $\left(
x_{1},x_{2},\ldots,x_{q}\right)  \in\mathbb{P}^{q}$ be such that $x_{1}%
+x_{2}+\cdots+x_{q}=n$. We must prove that $x_{q}\in\left[  n\right]  $.
\par
We have $x_{1},x_{2},\ldots,x_{q}\in\mathbb{P}$ (since $\left(  x_{1}%
,x_{2},\ldots,x_{q}\right)  \in\mathbb{P}^{q}$). In other words, $x_{1}%
,x_{2},\ldots,x_{q}$ are positive integers (since $\mathbb{P}$ is the set of
all positive integers). Thus, in particular, $x_{q}$ is a positive integer.
Moreover, $x_{1}+x_{2}+\cdots+x_{q-1}$ is a sum of positive integers (since
$x_{1},x_{2},\ldots,x_{q}$ are positive integers), and thus nonnegative.
Hence, $x_{1}+x_{2}+\cdots+x_{q-1}\geq0$. Now,%
\[
n=x_{1}+x_{2}+\cdots+x_{q}=\underbrace{\left(  x_{1}+x_{2}+\cdots
+x_{q-1}\right)  }_{\geq0}+x_{q}\geq x_{q}.
\]
In other words, $x_{q}\leq n$. Since $x_{q}$ is a positive integer, we thus
obtain $x_{q}\in\left\{  1,2,\ldots,n\right\}  =\left[  n\right]  $. Qed.}.
Hence, the sum rule (Theorem \ref{thm.sumrule2}) yields%
\begin{align*}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{q}\right)  \in
\mathbb{P}^{q}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{q}=n\right) \\
&  =\sum_{p\in\left[  n\right]  }\left(  \text{\# of }\left(  x_{1}%
,x_{2},\ldots,x_{q}\right)  \in\mathbb{P}^{q}\text{ satisfying }x_{1}%
+x_{2}+\cdots+x_{q}=n\text{ and }x_{q}=p\right)  .
\end{align*}


Now, let $p\in\left[  n\right]  $. Then, $p$ is a positive integer, so that
$p\in\mathbb{P}$. Moreover, from $p\in\left[  n\right]  =\left\{
1,2,\ldots,n\right\}  $, we obtain $p\leq n$, so that $n-p\in\mathbb{N}$.
Hence, (\ref{sol.binom.compos.count2.3.IH}) (applied to $n-p$ instead of $n$)
yields%
\begin{align}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{q-1}\right)
\in\mathbb{P}^{q-1}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{q-1}=n-p\right)
\nonumber\\
&  =\dbinom{\left(  n-p\right)  -1}{\left(  n-p\right)  -\left(  q-1\right)
}. \label{sol.binom.compos.count2.1}%
\end{align}


If $\left(  x_{1},x_{2},\ldots,x_{q}\right)  \in\mathbb{P}^{q}$ satisfies
$x_{1}+x_{2}+\cdots+x_{q}=n$ and $x_{q}=p$, then $x_{1}+x_{2}+\cdots
+x_{q-1}=n-p$\ \ \ \ \footnote{because $n=x_{1}+x_{2}+\cdots+x_{q}=\left(
x_{1}+x_{2}+\cdots+x_{q-1}\right)  +\underbrace{x_{q}}_{=p}=\left(
x_{1}+x_{2}+\cdots+x_{q-1}\right)  +p$}. Hence, we can define a map%
\begin{align*}
&  \left\{  \left(  x_{1},x_{2},\ldots,x_{q}\right)  \in\mathbb{P}^{q}\text{
}\mid\text{ }x_{1}+x_{2}+\cdots+x_{q}=n\text{ and }x_{q}=p\right\} \\
&  \rightarrow\left\{  \left(  x_{1},x_{2},\ldots,x_{q-1}\right)
\in\mathbb{P}^{q-1}\text{ }\mid\text{ }x_{1}+x_{2}+\cdots+x_{q-1}=n-p\right\}
\end{align*}
that sends each $q$-tuple $\left(  x_{1},x_{2},\ldots,x_{q}\right)  $ to
$\left(  x_{1},x_{2},\ldots,x_{q-1}\right)  $. Conversely, we can define a map%
\begin{align*}
&  \left\{  \left(  x_{1},x_{2},\ldots,x_{q-1}\right)  \in\mathbb{P}%
^{q-1}\text{ }\mid\text{ }x_{1}+x_{2}+\cdots+x_{q-1}=n-p\right\} \\
&  \rightarrow\left\{  \left(  x_{1},x_{2},\ldots,x_{q}\right)  \in
\mathbb{P}^{q}\text{ }\mid\text{ }x_{1}+x_{2}+\cdots+x_{q}=n\text{ and }%
x_{q}=p\right\}
\end{align*}
that sends each $\left(  q-1\right)  $-tuple $\left(  x_{1},x_{2}%
,\ldots,x_{q-1}\right)  $ to $\left(  x_{1},x_{2},\ldots,x_{q-1},p\right)  $
(because if $\left(  x_{1},x_{2},\ldots,x_{q-1}\right)  \in\mathbb{P}^{q-1}$
satisfies $x_{1}+x_{2}+\cdots+x_{q-1}=n-p$, then the entries of the $q$-tuple
$\left(  x_{1},x_{2},\ldots,x_{q-1},p\right)  $ sum up to $\underbrace{x_{1}%
+x_{2}+\cdots+x_{q-1}}_{=n-p}+p=\left(  n-p\right)  +p=n$). These two maps are
mutually inverse, and thus are bijections. Hence, the bijection principle
yields%
\begin{align}
&  \left\vert \left\{  \left(  x_{1},x_{2},\ldots,x_{q}\right)  \in
\mathbb{P}^{q}\text{ }\mid\text{ }x_{1}+x_{2}+\cdots+x_{q}=n\text{ and }%
x_{q}=p\right\}  \right\vert \nonumber\\
&  =\left\vert \left\{  \left(  x_{1},x_{2},\ldots,x_{q-1}\right)
\in\mathbb{P}^{q-1}\text{ }\mid\text{ }x_{1}+x_{2}+\cdots+x_{q-1}=n-p\right\}
\right\vert \nonumber\\
&  =\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{q-1}\right)
\in\mathbb{P}^{q-1}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{q-1}=n-p\right)
\nonumber\\
&  =\dbinom{\left(  n-p\right)  -1}{\left(  n-p\right)  -\left(  q-1\right)
}\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{sol.binom.compos.count2.1}%
)}\right)  . \label{sol.binom.compos.count2.5}%
\end{align}


Forget that we fixed $p$. We thus have proved (\ref{sol.binom.compos.count2.5}%
) for each $p\in\left[  n\right]  $. Now, we can continue our computation from
before:
\begin{align}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{q}\right)  \in
\mathbb{P}^{q}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{q}=n\right) \nonumber\\
&  =\sum_{p\in\left[  n\right]  }\underbrace{\left(  \text{\# of }\left(
x_{1},x_{2},\ldots,x_{q}\right)  \in\mathbb{P}^{q}\text{ satisfying }%
x_{1}+x_{2}+\cdots+x_{q}=n\text{ and }x_{q}=p\right)  }_{\substack{=\left\vert
\left\{  \left(  x_{1},x_{2},\ldots,x_{q}\right)  \in\mathbb{P}^{q}\text{
}\mid\text{ }x_{1}+x_{2}+\cdots+x_{q}=n\text{ and }x_{q}=p\right\}
\right\vert \\=\dbinom{\left(  n-p\right)  -1}{\left(  n-p\right)  -\left(
q-1\right)  }\\\text{(by (\ref{sol.binom.compos.count2.5}))}}}\nonumber\\
&  =\underbrace{\sum_{p\in\left[  n\right]  }}_{=\sum_{p=1}^{n}}%
\dbinom{\left(  n-p\right)  -1}{\left(  n-p\right)  -\left(  q-1\right)
}=\sum_{p=1}^{n}\dbinom{\left(  n-p\right)  -1}{\left(  n-p\right)  -\left(
q-1\right)  }\nonumber\\
&  =\sum_{j=0}^{n-1}\dbinom{j-1}{j-\left(  q-1\right)  }
\label{sol.binom.compos.count2.7}%
\end{align}
(here, we have substituted $j$ for $n-p$ in the sum).

But let $j\in\mathbb{Z}$. Then, Theorem \ref{thm.binom.rec} (applied to $j$
and $j-\left(  q-1\right)  $ instead of $n$ and $k$) yields%
\[
\dbinom{j}{j-\left(  q-1\right)  }=\dbinom{j-1}{j-\left(  q-1\right)
-1}+\dbinom{j-1}{j-\left(  q-1\right)  }=\dbinom{j-1}{j-q}+\dbinom
{j-1}{j-\left(  q-1\right)  }%
\]
(since $j-\left(  q-1\right)  -1=j-q$). Solving this equation for
$\dbinom{j-1}{j-\left(  q-1\right)  }$, we obtain%
\begin{align}
\dbinom{j-1}{j-\left(  q-1\right)  }  &  =\underbrace{\dbinom{j}{j-\left(
q-1\right)  }}_{\substack{=\dbinom{\left(  j+1\right)  -1}{\left(  \left(
j+1\right)  -1\right)  -\left(  q-1\right)  }\\\text{(since }j=\left(
j+1\right)  -1\text{)}}}-\dbinom{j-1}{j-q}\nonumber\\
&  =\dbinom{\left(  j+1\right)  -1}{\left(  \left(  j+1\right)  -1\right)
-\left(  q-1\right)  }-\dbinom{j-1}{j-q}\nonumber\\
&  =\dbinom{\left(  j+1\right)  -1}{\left(  j+1\right)  -q}-\dbinom{j-1}{j-q}
\label{sol.binom.compos.count2.9}%
\end{align}
(since $\left(  \left(  j+1\right)  -1\right)  -\left(  q-1\right)  =\left(
j+1\right)  -q$).

Forget that we fixed $j$. We thus have proved (\ref{sol.binom.compos.count2.9}%
) for each $j\in\mathbb{Z}$.

Now, (\ref{sol.binom.compos.count2.7}) becomes%
\begin{align*}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{q}\right)  \in
\mathbb{P}^{q}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{q}=n\right) \\
&  =\sum_{j=0}^{n-1}\underbrace{\dbinom{j-1}{j-\left(  q-1\right)  }%
}_{\substack{=\dbinom{\left(  j+1\right)  -1}{\left(  j+1\right)  -q}%
-\dbinom{j-1}{j-q}\\\text{(by (\ref{sol.binom.compos.count2.9}))}}}\\
&  =\sum_{j=0}^{n-1}\left(  \dbinom{\left(  j+1\right)  -1}{\left(
j+1\right)  -q}-\dbinom{j-1}{j-q}\right)  =\dbinom{\left(  \left(  n-1\right)
+1\right)  -1}{\left(  \left(  n-1\right)  +1\right)  -q}-\dbinom{0-1}{0-q}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.sum.telesc-sum},
applied to }u=0\text{ and }v=n-1\text{ and }a_{j}=\dbinom{j-1}{j-q}\right) \\
&  =\dbinom{n-1}{n-q}-\dbinom{0-1}{-q}\ \ \ \ \ \ \ \ \ \ \left(  \text{since
}\left(  n-1\right)  +1=n\text{ and }0-q=-q\right)  .
\end{align*}


But $q$ is positive, and thus $-q$ is negative. Hence, $-q\notin\mathbb{N}$.
Hence, (\ref{eq.def.binom.def.b}) (applied to $0-1$ and $-q$ instead of $n$
and $k$) yields $\dbinom{0-1}{-q}=0$. Thus, we obtain%
\begin{align*}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{q}\right)  \in
\mathbb{P}^{q}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{q}=n\right) \\
&  =\dbinom{n-1}{n-q}-\underbrace{\dbinom{0-1}{-q}}_{=0}=\dbinom{n-1}{n-q}.
\end{align*}


Now, forget that we fixed $n$. We thus have proved that
\[
\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{q}\right)  \in
\mathbb{P}^{q}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{q}=n\right)
=\dbinom{n-1}{n-q}%
\]
for each $n\in\mathbb{N}$. In other words, (\ref{eq.thm.binom.compos.count.r1}%
) holds for $k=q$. This completes the induction step.

Thus, we have proved (\ref{eq.thm.binom.compos.count.r1}) by induction. Now,
for each $n\in\mathbb{N}$ and $k\in\mathbb{N}$, we have%
\begin{align*}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in
\mathbb{P}^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n\right) \\
&  =\dbinom{n-1}{n-k}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{eq.thm.binom.compos.count.r1})}\right) \\
&  =%
\begin{cases}
\dbinom{n-1}{k-1}, & \text{if }n>0;\\
\left[  k=0\right]  , & \text{if }n=0
\end{cases}
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Exercise \ref{exe.binom.compos.count0}
\textbf{(a)}}\right)  .
\end{align*}
This proves Theorem \ref{thm.binom.compos.count}.
\end{proof}

\subsection{Solution to Exercise \ref{exe.binom.bicompos.count2}}

In order to solve Exercise \ref{exe.binom.bicompos.count2}, we need to give an
alternative proof of Theorem \ref{thm.binom.bicompos.count}.

\begin{proof}
[Second proof of Theorem \ref{thm.binom.bicompos.count}.]Forget that we fixed
$n$ and $k$.

We shall prove Theorem \ref{thm.binom.bicompos.count} by induction on $k$.

\textit{Induction base:} It is easy to see that Theorem
\ref{thm.binom.bicompos.count} holds for $k=0$%
\ \ \ \ \footnote{\textit{Proof.} Assume that $k=0$. Let $n\in\mathbb{Z}$ be
arbitrary. Now,%
\begin{align*}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{
0,1\right\}  ^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n\right) \\
&  =\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{0}\right)  \in\left\{
0,1\right\}  ^{0}\text{ satisfying }\underbrace{x_{1}+x_{2}+\cdots+x_{0}%
}_{=\left(  \text{empty sum}\right)  =0}=n\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{since }k=0\right) \\
&  =\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{0}\right)  \in\left\{
0,1\right\}  ^{0}\text{ satisfying }0=n\right)  .
\end{align*}
But the right hand side is easy to compute:
\par
\begin{itemize}
\item If $n=0$, then $\left(  \text{\# of }\left(  x_{1},x_{2},\ldots
,x_{0}\right)  \in\left\{  0,1\right\}  ^{0}\text{ satisfying }0=n\right)  =1$
(because there is exactly one $0$-tuple $\left(  x_{1},x_{2},\ldots
,x_{0}\right)  \in\left\{  0,1\right\}  ^{0}$ (namely, the empty list $\left(
{}\right)  $), and clearly this $0$-tuple satisfies $0=n$ (since $n=0$)).
\par
\item If $n\neq0$, then $\left(  \text{\# of }\left(  x_{1},x_{2},\ldots
,x_{0}\right)  \in\left\{  0,1\right\}  ^{0}\text{ satisfying }0=n\right)  =0$
(because there is no $0$-tuple $\left(  x_{1},x_{2},\ldots,x_{0}\right)
\in\left\{  0,1\right\}  ^{0}$ satisfying $0=n$ (since $0\neq n$)).
\end{itemize}
\par
Combining these two observations, we conclude that%
\[
\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{0}\right)  \in\left\{
0,1\right\}  ^{0}\text{ satisfying }0=n\right)  =%
\begin{cases}
1, & \text{if }n=0;\\
0, & \text{if }n\neq0
\end{cases}
.
\]
Comparing this with%
\begin{align*}
\dbinom{k}{n}  &  =\dbinom{0}{n}\ \ \ \ \ \ \ \ \ \ \left(  \text{since
}k=0\right) \\
&  =\left[  n=0\right]  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Lemma
\ref{lem.binom.0Ck}, applied to }n\text{ instead of }k\right) \\
&  =%
\begin{cases}
1, & \text{if }n=0;\\
0, & \text{otherwise}%
\end{cases}
=%
\begin{cases}
1, & \text{if }n=0;\\
0, & \text{if }n\neq0
\end{cases}
,
\end{align*}
we obtain%
\[
\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{0}\right)  \in\left\{
0,1\right\}  ^{0}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{0}=n\right)
=\dbinom{k}{n}.
\]
Hence,%
\begin{align*}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{
0,1\right\}  ^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n\right) \\
&  =\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{0}\right)  \in\left\{
0,1\right\}  ^{0}\text{ satisfying }0=n\right)  =\dbinom{k}{n}.
\end{align*}
In other words, Theorem \ref{thm.binom.bicompos.count} holds for our $k$ and
$n$. We have thus shown that Theorem \ref{thm.binom.bicompos.count} holds
under the assumption that $k=0$. Hence, Theorem \ref{thm.binom.bicompos.count}
holds for $k=0$.}. This completes the induction base.

\textit{Induction step:} Let $q$ be a positive integer. Assume (as the
induction hypothesis) that Theorem \ref{thm.binom.bicompos.count} holds for
$k=q-1$. We must show that Theorem \ref{thm.binom.bicompos.count} holds for
$k=q$.

We have assumed that Theorem \ref{thm.binom.bicompos.count} holds for $k=q-1$.
In other words, we have%
\begin{align}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{q-1}\right)  \in\left\{
0,1\right\}  ^{q-1}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{q-1}=n\right)
\nonumber\\
&  =\dbinom{q-1}{n} \label{sol.binom.bicompos.count2.3.IH}%
\end{align}
for each $n\in\mathbb{Z}$.

Now, let $n\in\mathbb{Z}$. We shall compute the \# of $\left(  x_{1}%
,x_{2},\ldots,x_{q}\right)  \in\left\{  0,1\right\}  ^{q}$ satisfying
$x_{1}+x_{2}+\cdots+x_{q}=n$.

Clearly, if $\left(  x_{1},x_{2},\ldots,x_{q}\right)  \in\left\{  0,1\right\}
^{q}$ satisfies $x_{1}+x_{2}+\cdots+x_{q}=n$, then $x_{q}\in\left\{
0,1\right\}  $. Hence, the sum rule (Theorem \ref{thm.sumrule2}) yields%
\begin{align*}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{q}\right)  \in\left\{
0,1\right\}  ^{q}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{q}=n\right) \\
&  =\sum_{p\in\left\{  0,1\right\}  }\left(  \text{\# of }\left(  x_{1}%
,x_{2},\ldots,x_{q}\right)  \in\left\{  0,1\right\}  ^{q}\text{ satisfying
}x_{1}+x_{2}+\cdots+x_{q}=n\text{ and }x_{q}=p\right)  .
\end{align*}


Now, let $p\in\left\{  0,1\right\}  $. Then,
(\ref{sol.binom.bicompos.count2.3.IH}) (applied to $n-p$ instead of $n$)
yields%
\begin{align}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{q-1}\right)  \in\left\{
0,1\right\}  ^{q-1}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{q-1}=n-p\right)
\nonumber\\
&  =\dbinom{q-1}{n-p}. \label{sol.binom.bicompos.count2.1}%
\end{align}


If $\left(  x_{1},x_{2},\ldots,x_{q}\right)  \in\left\{  0,1\right\}  ^{q}$
satisfies $x_{1}+x_{2}+\cdots+x_{q}=n$ and $x_{q}=p$, then $x_{1}+x_{2}%
+\cdots+x_{q-1}=n-p$\ \ \ \ \footnote{because $n=x_{1}+x_{2}+\cdots
+x_{q}=\left(  x_{1}+x_{2}+\cdots+x_{q-1}\right)  +\underbrace{x_{q}}%
_{=p}=\left(  x_{1}+x_{2}+\cdots+x_{q-1}\right)  +p$}. Hence, we can define a
map%
\begin{align*}
&  \left\{  \left(  x_{1},x_{2},\ldots,x_{q}\right)  \in\left\{  0,1\right\}
^{q}\text{ }\mid\text{ }x_{1}+x_{2}+\cdots+x_{q}=n\text{ and }x_{q}=p\right\}
\\
&  \rightarrow\left\{  \left(  x_{1},x_{2},\ldots,x_{q-1}\right)  \in\left\{
0,1\right\}  ^{q-1}\text{ }\mid\text{ }x_{1}+x_{2}+\cdots+x_{q-1}=n-p\right\}
\end{align*}
that sends each $q$-tuple $\left(  x_{1},x_{2},\ldots,x_{q}\right)  $ to
$\left(  x_{1},x_{2},\ldots,x_{q-1}\right)  $. Conversely, we can define a map%
\begin{align*}
&  \left\{  \left(  x_{1},x_{2},\ldots,x_{q-1}\right)  \in\left\{
0,1\right\}  ^{q-1}\text{ }\mid\text{ }x_{1}+x_{2}+\cdots+x_{q-1}=n-p\right\}
\\
&  \rightarrow\left\{  \left(  x_{1},x_{2},\ldots,x_{q}\right)  \in\left\{
0,1\right\}  ^{q}\text{ }\mid\text{ }x_{1}+x_{2}+\cdots+x_{q}=n\text{ and
}x_{q}=p\right\}
\end{align*}
that sends each $\left(  q-1\right)  $-tuple $\left(  x_{1},x_{2}%
,\ldots,x_{q-1}\right)  $ to $\left(  x_{1},x_{2},\ldots,x_{q-1},p\right)  $
(because if $\left(  x_{1},x_{2},\ldots,x_{q-1}\right)  \in\left\{
0,1\right\}  ^{q-1}$ satisfies $x_{1}+x_{2}+\cdots+x_{q-1}=n-p$, then the
entries of the $q$-tuple $\left(  x_{1},x_{2},\ldots,x_{q-1},p\right)  $ sum
up to $\underbrace{x_{1}+x_{2}+\cdots+x_{q-1}}_{=n-p}+p=\left(  n-p\right)
+p=n$). These two maps are mutually inverse, and thus are bijections. Hence,
the bijection principle yields%
\begin{align}
&  \left\vert \left\{  \left(  x_{1},x_{2},\ldots,x_{q}\right)  \in\left\{
0,1\right\}  ^{q}\text{ }\mid\text{ }x_{1}+x_{2}+\cdots+x_{q}=n\text{ and
}x_{q}=p\right\}  \right\vert \nonumber\\
&  =\left\vert \left\{  \left(  x_{1},x_{2},\ldots,x_{q-1}\right)  \in\left\{
0,1\right\}  ^{q-1}\text{ }\mid\text{ }x_{1}+x_{2}+\cdots+x_{q-1}=n-p\right\}
\right\vert \nonumber\\
&  =\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{q-1}\right)
\in\left\{  0,1\right\}  ^{q-1}\text{ satisfying }x_{1}+x_{2}+\cdots
+x_{q-1}=n-p\right) \nonumber\\
&  =\dbinom{q-1}{n-p}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{sol.binom.bicompos.count2.1})}\right)  .
\label{sol.binom.bicompos.count2.5}%
\end{align}


Forget that we fixed $p$. We thus have proved
(\ref{sol.binom.bicompos.count2.5}) for each $p\in\left\{  0,1\right\}  $.
Now, we can continue our computation from before:
\begin{align}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{q}\right)  \in\left\{
0,1\right\}  ^{q}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{q}=n\right)
\nonumber\\
&  =\sum_{p\in\left\{  0,1\right\}  }\underbrace{\left(  \text{\# of }\left(
x_{1},x_{2},\ldots,x_{q}\right)  \in\left\{  0,1\right\}  ^{q}\text{
satisfying }x_{1}+x_{2}+\cdots+x_{q}=n\text{ and }x_{q}=p\right)
}_{\substack{=\left\vert \left\{  \left(  x_{1},x_{2},\ldots,x_{q}\right)
\in\left\{  0,1\right\}  ^{q}\text{ }\mid\text{ }x_{1}+x_{2}+\cdots
+x_{q}=n\text{ and }x_{q}=p\right\}  \right\vert \\=\dbinom{q-1}%
{n-p}\\\text{(by (\ref{sol.binom.bicompos.count2.5}))}}}\nonumber\\
&  =\sum_{p\in\left\{  0,1\right\}  }\dbinom{q-1}{n-p}=\dbinom{q-1}%
{n-0}+\dbinom{q-1}{n-1}=\dbinom{q-1}{n-1}+\dbinom{q-1}{n-0}\nonumber\\
&  =\dbinom{q-1}{n-1}+\dbinom{q-1}{n}\ \ \ \ \ \ \ \ \ \ \left(  \text{since
}n-0=n\right)  .\nonumber
\end{align}
Comparing this with%
\[
\dbinom{q}{n}=\dbinom{q-1}{n-1}+\dbinom{q-1}{n}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Theorem \ref{thm.binom.rec}, applied to }q\text{ and }n\\
\text{instead of }n\text{ and }k
\end{array}
\right)  ,
\]
we obtain%
\[
\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{q}\right)  \in\left\{
0,1\right\}  ^{q}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{q}=n\right)
=\dbinom{q}{n}.
\]


Forget that we fixed $n$. We thus have proved
\[
\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{q}\right)  \in\left\{
0,1\right\}  ^{q}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{q}=n\right)
=\dbinom{q}{n}%
\]
for each $n\in\mathbb{Z}$. In other words, Theorem
\ref{thm.binom.bicompos.count} holds for $k=q$. This completes the induction
step. Thus, Theorem \ref{thm.binom.bicompos.count} is proved by induction.
\end{proof}

\subsection{Solution to Exercise \ref{exe.binom.wecompos.count0}}

\begin{proof}
[Solution to Exercise \ref{exe.binom.wecompos.count0}.]Let $n\in\mathbb{N}$
and $k\in\mathbb{N}$. We are in one of the following two cases:

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

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

Let us first consider Case 1. In this case, we have $k=0$. We are in one of
the following two subcases:

\textit{Subcase 1.1:} We have $n=0$.

\textit{Subcase 1.2:} We have $n\neq0$.

Let us first consider Subcase 1.1. In this subcase, we have $n=0$. From $n=0$
and $k=0$, we obtain $\dbinom{n+k-1}{n}=\dbinom{0+0-1}{0}=1$ (by
(\ref{eq.exa.binom.small.nC0})). Comparing this with%
\begin{align*}%
\begin{cases}
\dbinom{n+k-1}{k-1}, & \text{if }k>0;\\
\left[  n=0\right]  , & \text{if }k=0
\end{cases}
&  =\left[  n=0\right]  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }k=0\right) \\
&  =1\ \ \ \ \ \ \ \ \ \ \left(  \text{since }n=0\right)  ,
\end{align*}
we find $\dbinom{n+k-1}{n}=%
\begin{cases}
\dbinom{n+k-1}{k-1}, & \text{if }k>0;\\
\left[  n=0\right]  , & \text{if }k=0
\end{cases}
$. Thus, Exercise \ref{exe.binom.wecompos.count0} is proved in Subcase 1.1.

Let us next consider Subcase 1.2. In this subcase, we have $n\neq0$. Hence,
$n\geq1$ (since $n\in\mathbb{N}$), so that $n-1\geq0$ and thus $n-1\in
\mathbb{N}$. Hence, Proposition \ref{prop.binom.0} (applied to $n-1$ and $n$
instead of $n$ and $k$) yields $\dbinom{n-1}{n}=0$ (since $n>n-1$). Now,
$n+\underbrace{k}_{=0}-1=n-1$, so that $\dbinom{n+k-1}{n}=\dbinom{n-1}{n}=0$.
Comparing this with%
\begin{align*}%
\begin{cases}
\dbinom{n+k-1}{k-1}, & \text{if }k>0;\\
\left[  n=0\right]  , & \text{if }k=0
\end{cases}
&  =\left[  n=0\right]  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }k=0\right) \\
&  =0\ \ \ \ \ \ \ \ \ \ \left(  \text{since }n\neq0\right)  ,
\end{align*}
we find $\dbinom{n+k-1}{n}=%
\begin{cases}
\dbinom{n+k-1}{k-1}, & \text{if }k>0;\\
\left[  n=0\right]  , & \text{if }k=0
\end{cases}
$. Thus, Exercise \ref{exe.binom.wecompos.count0} is proved in Subcase 1.2.

We have now proved Exercise \ref{exe.binom.wecompos.count0} in each of the two
Subcases 1.1 and 1.2. Hence, Exercise \ref{exe.binom.wecompos.count0} is
proved in Case 1 (since Subcases 1.1 and 1.2 cover Case 1).

Let us next consider Case 2. In this case, we have $k\neq0$. Hence, $k\geq1$
(since $k\in\mathbb{N}$), so that $n+\underbrace{k}_{\geq1}-1\geq
n+1-1=n\geq0$ (since $n\in\mathbb{N}$). Hence, $n+k-1\in\mathbb{N}$.
Therefore, Theorem \ref{thm.binom.sym} (applied to $n+k-1$ and $n$ instead of
$n$ and $k$) yields%
\[
\dbinom{n+k-1}{n}=\dbinom{n+k-1}{\left(  n+k-1\right)  -n}=\dbinom{n+k-1}%
{k-1}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left(  n+k-1\right)
-n=k-1\right)  .
\]
Comparing this with%
\[%
\begin{cases}
\dbinom{n+k-1}{k-1}, & \text{if }k>0;\\
\left[  n=0\right]  , & \text{if }k=0
\end{cases}
=\dbinom{n+k-1}{k-1}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }k>0\text{
(because }k\geq1\text{)}\right)  ,
\]
we obtain $\dbinom{n+k-1}{n}=%
\begin{cases}
\dbinom{n+k-1}{k-1}, & \text{if }k>0;\\
\left[  n=0\right]  , & \text{if }k=0
\end{cases}
$. Thus, Exercise \ref{exe.binom.wecompos.count0} is proved in Case 2.

We have now proved Exercise \ref{exe.binom.wecompos.count0} in each of the two
Cases 1 and 2. Hence, Exercise \ref{exe.binom.wecompos.count0} always holds.
\end{proof}

\subsection{Solution to Exercise \ref{exe.binom.compos.12}}

Our solution to Exercise \ref{exe.binom.compos.12} will use the following
simple lemma:

\begin{lemma}
\label{lem.compos.lenleq}Let $n\in\mathbb{N}$. Let $\left(  x_{1},x_{2}%
,\ldots,x_{k}\right)  $ be a composition of $n$. Then, $k\leq n$.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.compos.lenleq}.]We know that $\left(  x_{1}%
,x_{2},\ldots,x_{k}\right)  $ is a composition of $n$. In other words,
$\left(  x_{1},x_{2},\ldots,x_{k}\right)  $ is a tuple of positive integers
whose sum is $n$ (by Definition \ref{def.compos} \textbf{(c)}). Hence,
$x_{1},x_{2},\ldots,x_{k}$ are positive integers whose sum is $n$. In other
words, $x_{1},x_{2},\ldots,x_{k}$ are positive integers and satisfy
$x_{1}+x_{2}+\cdots+x_{k}=n$.

For each $i\in\left\{  1,2,\ldots,k\right\}  $, the number $x_{i}$ is a
positive integer (since $x_{1},x_{2},\ldots,x_{k}$ are positive integers) and
thus satisfies $x_{i}\geq1$ (since any positive integer is $\geq1$). Summing
up these inequalities for all $i\in\left\{  1,2,\ldots,k\right\}  $, we obtain
$x_{1}+x_{2}+\cdots+x_{k}\geq\underbrace{1+1+\cdots+1}_{k\text{ times}}%
=k\cdot1=k$. In view of $x_{1}+x_{2}+\cdots+x_{k}=n$, this rewrites as $n\geq
k$. In other words, $k\leq n$. This proves Lemma \ref{lem.compos.lenleq}.
\end{proof}

\begin{proof}
[Solution to Exercise \ref{exe.binom.compos.12}.]There are many ways to solve
Exercise \ref{exe.binom.compos.12} \textbf{(a)}. One way is to use strong
induction on $n$. Another is to construct a bijection
\[
\left\{  \left\{  1,2\right\}  \text{-compositions of }n\right\}
\rightarrow\left\{  \text{lacunar subsets of }\left[  n-1\right]  \right\}
\]
(defined in the same way as the bijection $C$ in our first proof of Theorem
\ref{thm.binom.compos.count}), and then use the bijection principle (and
Proposition \ref{prop.1.35}). Yet another is to find a bijection%
\[
\left\{  \left\{  1,2\right\}  \text{-compositions of }n\right\}
\rightarrow\left\{  \text{domino tilings of }R_{n,2}\right\}  ,
\]
and then use the bijection principle (and Proposition \ref{prop.1.5}). All
these approaches can be easily adapted to yield Exercise
\ref{exe.binom.compos.12} \textbf{(b)} as well.

We shall, however, use the conceptually simplest approach: We will first solve
Exercise \ref{exe.binom.compos.12} \textbf{(b)} by deriving it from Theorem
\ref{thm.binom.bicompos.count}, and then solve Exercise
\ref{exe.binom.compos.12} \textbf{(a)} by summing the result over all $k$. So
let us start with the solution to Exercise \ref{exe.binom.compos.12}
\textbf{(b)}:

\textbf{(b)} If $\left(  u_{1},u_{2},\ldots,u_{k}\right)  $ is a $\left\{
1,2\right\}  $-composition of $n$ into $k$ parts, then \newline$\left(
u_{1}-1,u_{2}-1,\ldots,u_{k}-1\right)  $ is a $k$-tuple $\left(  x_{1}%
,x_{2},\ldots,x_{k}\right)  \in\left\{  0,1\right\}  ^{k}$ satisfying
$x_{1}+x_{2}+\cdots+x_{k}=n-k$\ \ \ \ \footnote{\textit{Proof.} Let $\left(
u_{1},u_{2},\ldots,u_{k}\right)  $ be a $\left\{  1,2\right\}  $-composition
of $n$ into $k$ parts. We must show that $\left(  u_{1}-1,u_{2}-1,\ldots
,u_{k}-1\right)  $ is a $k$-tuple $\left(  x_{1},x_{2},\ldots,x_{k}\right)
\in\left\{  0,1\right\}  ^{k}$ satisfying $x_{1}+x_{2}+\cdots+x_{k}=n-k$.
\par
We know that $\left(  u_{1},u_{2},\ldots,u_{k}\right)  $ is a $\left\{
1,2\right\}  $-composition of $n$ into $k$ parts. In other words, $\left(
u_{1},u_{2},\ldots,u_{k}\right)  $ is a composition $\left(  x_{1}%
,x_{2},\ldots,x_{k}\right)  $ of $n$ into $k$ parts such that $x_{1}%
,x_{2},\ldots,x_{k}\in\left\{  1,2\right\}  $ (by the definition of a
\textquotedblleft$\left\{  1,2\right\}  $-composition of $n$ into $k$
parts\textquotedblright). In other words, $\left(  u_{1},u_{2},\ldots
,u_{k}\right)  $ is a composition of $n$ into $k$ parts and satisfies
$u_{1},u_{2},\ldots,u_{k}\in\left\{  1,2\right\}  $. From $u_{1},u_{2}%
,\ldots,u_{k}\in\left\{  1,2\right\}  $, we obtain $u_{1}-1,u_{2}%
-1,\ldots,u_{k}-1\in\left\{  0,1\right\}  $ (since $p-1\in\left\{
0,1\right\}  $ for each $p\in\left\{  1,2\right\}  $). In other words,
$\left(  u_{1}-1,u_{2}-1,\ldots,u_{k}-1\right)  \in\left\{  0,1\right\}  ^{k}%
$. Moreover, $\left(  u_{1},u_{2},\ldots,u_{k}\right)  $ is a composition of
$n$ into $k$ parts; in other words, $\left(  u_{1},u_{2},\ldots,u_{k}\right)
$ is a $k$-tuple of positive integers whose sum is $n$ (by Definition
\ref{def.compos} \textbf{(d)}). In other words, $\left(  u_{1},u_{2}%
,\ldots,u_{k}\right)  $ is a $k$-tuple of positive integers and satisfies
$u_{1}+u_{2}+\cdots+u_{k}=n$. Hence,
\[
\left(  u_{1}-1\right)  +\left(  u_{2}-1\right)  +\cdots+\left(
u_{k}-1\right)  =\underbrace{\left(  u_{1}+u_{2}+\cdots+u_{k}\right)  }%
_{=n}-\underbrace{\underbrace{\left(  1+1+\cdots+1\right)  }_{k\text{ times}}%
}_{=k}=n-k.
\]
\par
Thus, we have shown that $\left(  u_{1}-1,u_{2}-1,\ldots,u_{k}-1\right)
\in\left\{  0,1\right\}  ^{k}$ and $\left(  u_{1}-1\right)  +\left(
u_{2}-1\right)  +\cdots+\left(  u_{k}-1\right)  =n-k$. In other words,
$\left(  u_{1}-1,u_{2}-1,\ldots,u_{k}-1\right)  $ is a $k$-tuple $\left(
x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{  0,1\right\}  ^{k}$ satisfying
$x_{1}+x_{2}+\cdots+x_{k}=n-k$. Qed.}. Hence, we can define a map%
\begin{align*}
A  &  :\left\{  \left\{  1,2\right\}  \text{-compositions of }n\text{ into
}k\text{ parts}\right\} \\
&  \rightarrow\left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{
0,1\right\}  ^{k}\ \mid\ x_{1}+x_{2}+\cdots+x_{k}=n-k\right\}  ,\\
\left(  u_{1},u_{2},\ldots,u_{k}\right)   &  \mapsto\left(  u_{1}%
-1,u_{2}-1,\ldots,u_{k}-1\right)  .
\end{align*}


Let us now construct a map in the opposite direction.

If $\left(  p_{1},p_{2},\ldots,p_{k}\right)  \in\left\{  \left(  x_{1}%
,x_{2},\ldots,x_{k}\right)  \in\left\{  0,1\right\}  ^{k}\ \mid\ x_{1}%
+x_{2}+\cdots+x_{k}=n-k\right\}  $, then $\left(  p_{1}+1,p_{2}+1,\ldots
,p_{k}+1\right)  $ is a $\left\{  1,2\right\}  $-composition of $n$ into $k$
parts\footnote{\textit{Proof.} Let $\left(  p_{1},p_{2},\ldots,p_{k}\right)
\in\left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{  0,1\right\}
^{k}\ \mid\ x_{1}+x_{2}+\cdots+x_{k}=n-k\right\}  $. Thus, $\left(
p_{1},p_{2},\ldots,p_{k}\right)  $ is a $k$-tuple $\left(  x_{1},x_{2}%
,\ldots,x_{k}\right)  \in\left\{  0,1\right\}  ^{k}$ satisfying $x_{1}%
+x_{2}+\cdots+x_{k}=n-k$. In other words, $\left(  p_{1},p_{2},\ldots
,p_{k}\right)  \in\left\{  0,1\right\}  ^{k}$ is a $k$-tuple satisfying
$p_{1}+p_{2}+\cdots+p_{k}=n-k$. We must prove that $\left(  p_{1}%
+1,p_{2}+1,\ldots,p_{k}+1\right)  $ is a $\left\{  1,2\right\}  $-composition
of $n$ into $k$ parts.
\par
We have $\left(  p_{1},p_{2},\ldots,p_{k}\right)  \in\left\{  0,1\right\}
^{k}$. In other words, $p_{1},p_{2},\ldots,p_{k}\in\left\{  0,1\right\}  $.
Hence, $p_{1}+1,p_{2}+1,\ldots,p_{k}+1\in\left\{  1,2\right\}  $ (since
$q+1\in\left\{  1,2\right\}  $ for each $q\in\left\{  0,1\right\}  $). Hence,
$\left(  p_{1}+1,p_{2}+1,\ldots,p_{k}+1\right)  \in\left\{  1,2\right\}
^{k}\subseteq\mathbb{P}^{k}$ (since $\left\{  1,2\right\}  \subseteq
\mathbb{P}$). In other words, $\left(  p_{1}+1,p_{2}+1,\ldots,p_{k}+1\right)
$ is a $k$-tuple of positive integers (since $\mathbb{P}$ is the set of all
positive integers). Moreover, the sum of the entries of the $k$-tuple $\left(
p_{1}+1,p_{2}+1,\ldots,p_{k}+1\right)  $ is
\[
\left(  p_{1}+1\right)  +\left(  p_{2}+1\right)  +\cdots+\left(
p_{k}+1\right)  =\underbrace{\left(  p_{1}+p_{2}+\cdots+p_{k}\right)  }%
_{=n-k}+\underbrace{\underbrace{\left(  1+1+\cdots+1\right)  }_{k\text{
times}}}_{=k}=\left(  n-k\right)  +k=n.
\]
Hence, $\left(  p_{1}+1,p_{2}+1,\ldots,p_{k}+1\right)  $ is a $k$-tuple of
positive integers whose sum is $n$. In other words, $\left(  p_{1}%
+1,p_{2}+1,\ldots,p_{k}+1\right)  $ is a composition of $n$ into $k$ parts.
Therefore, $\left(  p_{1}+1,p_{2}+1,\ldots,p_{k}+1\right)  $ is a composition
$\left(  x_{1},x_{2},\ldots,x_{k}\right)  $ of $n$ into $k$ parts such that
$x_{1},x_{2},\ldots,x_{k}\in\left\{  1,2\right\}  $ (since $p_{1}%
+1,p_{2}+1,\ldots,p_{k}+1\in\left\{  1,2\right\}  $). In other words, $\left(
p_{1}+1,p_{2}+1,\ldots,p_{k}+1\right)  $ is a $\left\{  1,2\right\}
$-composition of $n$ into $k$ parts (by the definition of a \textquotedblleft%
$\left\{  1,2\right\}  $-composition of $n$ into $k$ parts\textquotedblright).
Qed.}. Hence, we can define a map%
\begin{align*}
B  &  :\left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{
0,1\right\}  ^{k}\ \mid\ x_{1}+x_{2}+\cdots+x_{k}=n-k\right\} \\
&  \rightarrow\left\{  \left\{  1,2\right\}  \text{-compositions of }n\text{
into }k\text{ parts}\right\}  ,\\
\left(  p_{1},p_{2},\ldots,p_{k}\right)   &  \mapsto\left(  p_{1}%
+1,p_{2}+1,\ldots,p_{k}+1\right)  .
\end{align*}


Clearly, the maps $A$ and $B$ are mutually inverse (since the map $A$
subtracts $1$ from each entry of the $k$-tuple it is applied to, whereas the
map $B$ adds $1$ to each entry of the $k$-tuple it is applied to). Thus, the
map $A$ is invertible, i.e., is a bijection. Hence, the bijection principle
yields%
\begin{align*}
&  \left\vert \left\{  \left\{  1,2\right\}  \text{-compositions of }n\text{
into }k\text{ parts}\right\}  \right\vert \\
&  =\left\vert \left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{
0,1\right\}  ^{k}\ \mid\ x_{1}+x_{2}+\cdots+x_{k}=n-k\right\}  \right\vert \\
&  =\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{
0,1\right\}  ^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n-k\right) \\
&  =\dbinom{k}{n-k}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem
\ref{thm.binom.bicompos.count}, applied to }n-k\text{ instead of }n\right)  .
\end{align*}
Hence,%
\begin{align*}
&  \left(  \text{\# of }\left\{  1,2\right\}  \text{-compositions of }n\text{
into }k\text{ parts}\right) \\
&  =\left\vert \left\{  \left\{  1,2\right\}  \text{-compositions of }n\text{
into }k\text{ parts}\right\}  \right\vert \\
&  =\dbinom{k}{n-k}.
\end{align*}
This solves Exercise \ref{exe.binom.compos.12} \textbf{(b)}.

\textbf{(a)} Recall that the \emph{length} of a list is the number of entries
of this list. Thus, the length of a list $\left(  a_{1},a_{2},\ldots
,a_{p}\right)  $ is the integer $p$.

Let $k\in\mathbb{N}$. Comparing the definitions of \textquotedblleft
composition of $n$\textquotedblright\ and \textquotedblleft composition of $n$
into $k$ parts\textquotedblright, we see that a composition of $n$ into $k$
parts is the same thing as a composition of $n$ that is a $k$-tuple. In other
words, a composition of $n$ into $k$ parts is the same thing as a composition
of $n$ whose length is $k$.

Thus, comparing the definitions of \textquotedblleft$\left\{  1,2\right\}
$-composition of $n$\textquotedblright\ and \textquotedblleft$\left\{
1,2\right\}  $-composition of $n$ into $k$ parts\textquotedblright, we
conclude that a $\left\{  1,2\right\}  $-composition of $n$ into $k$ parts is
the same thing as a $\left\{  1,2\right\}  $-composition of $n$ whose length
is $k$. Thus,%
\begin{align*}
&  \left(  \text{\# of }\left\{  1,2\right\}  \text{-compositions of }n\text{
into }k\text{ parts}\right) \\
&  =\left(  \text{\# of }\left\{  1,2\right\}  \text{-compositions of }n\text{
whose length is }k\right)  .
\end{align*}
Hence,%
\begin{align}
&  \left(  \text{\# of }\left\{  1,2\right\}  \text{-compositions of }n\text{
whose length is }k\right) \nonumber\\
&  =\left(  \text{\# of }\left\{  1,2\right\}  \text{-compositions of }n\text{
into }k\text{ parts}\right) \nonumber\\
&  =\dbinom{k}{n-k} \label{sol.binom.compos.12.a.2}%
\end{align}
(by Exercise \ref{exe.binom.compos.12} \textbf{(b)}).

Now, forget that we fixed $k$. We thus have proved
(\ref{sol.binom.compos.12.a.2}) for each $k\in\mathbb{N}$.

If $\mathbf{s}$ is a $\left\{  1,2\right\}  $-composition of $n$, then the
length of $\mathbf{s}$ is an element of $\left\{  0,1,\ldots,n\right\}
$\ \ \ \ \footnote{\textit{Proof.} Let $\mathbf{s}$ be a $\left\{
1,2\right\}  $-composition of $n$. We must prove that the length of
$\mathbf{s}$ is an element of $\left\{  0,1,\ldots,n\right\}  $.
\par
We know that $\mathbf{s}$ is a $\left\{  1,2\right\}  $-composition of $n$. In
other words, $\mathbf{s}$ is a composition $\left(  x_{1},x_{2},\ldots
,x_{k}\right)  $ of $n$ such that $x_{1},x_{2},\ldots,x_{k}\in\left\{
1,2\right\}  $ (by the definition of a \textquotedblleft$\left\{  1,2\right\}
$-composition of $n$\textquotedblright). Hence, $\mathbf{s}$ has the form
$\mathbf{s}=\left(  x_{1},x_{2},\ldots,x_{k}\right)  $, where $\left(
x_{1},x_{2},\ldots,x_{k}\right)  $ is a composition of $n$ such that
$x_{1},x_{2},\ldots,x_{k}\in\left\{  1,2\right\}  $. Consider this $\left(
x_{1},x_{2},\ldots,x_{k}\right)  $. From $\mathbf{s}=\left(  x_{1}%
,x_{2},\ldots,x_{k}\right)  $, we conclude that the length of $\mathbf{s}$ is
$k$.
\par
Lemma \ref{lem.compos.lenleq} yields $k\leq n$. Hence, $k\in\left\{
0,1,\ldots,n\right\}  $ (since $k\in\mathbb{N}$). In other words, $k$ is an
element of $\left\{  0,1,\ldots,n\right\}  $. In other words, the length of
$\mathbf{s}$ is an element of $\left\{  0,1,\ldots,n\right\}  $ (since the
length of $\mathbf{s}$ is $k$). Qed.}. Hence, the sum rule (Theorem
\ref{thm.sumrule2}) yields%
\begin{align*}
&  \left(  \text{\# of }\left\{  1,2\right\}  \text{-compositions of }n\right)
\\
&  =\underbrace{\sum_{k\in\left\{  0,1,\ldots,n\right\}  }}_{=\sum_{k=0}^{n}%
}\underbrace{\left(  \text{\# of }\left\{  1,2\right\}  \text{-compositions of
}n\text{ whose length is }k\right)  }_{\substack{=\dbinom{k}{n-k}\\\text{(by
(\ref{sol.binom.compos.12.a.2}))}}}\\
&  =\sum_{k=0}^{n}\dbinom{k}{n-k}=\sum_{k=0}^{n}\underbrace{\dbinom
{n-k}{n-\left(  n-k\right)  }}_{\substack{=\dbinom{n-k}{k}\\\text{(since
}n-\left(  n-k\right)  =k\text{)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have substituted }n-k\text{ for
}k\text{ in the sum}\right) \\
&  =\sum_{k=0}^{n}\dbinom{n-k}{k}.
\end{align*}


But Proposition \ref{prop.binom.fib} yields%
\[
f_{n+1}=\sum_{k=0}^{n}\dbinom{n-k}{k}.
\]
Comparing these two equalities, we obtain%
\[
\left(  \text{\# of }\left\{  1,2\right\}  \text{-compositions of }n\right)
=f_{n+1}.
\]
This solves Exercise \ref{exe.binom.compos.12} \textbf{(a)}.
\end{proof}

\subsection{Solution to Exercise \ref{exe.binom.compos.p}}

For our solution to Exercise \ref{exe.binom.compos.p}, we will need a minor
generalization of (\ref{eq.thm.binom.wecompos.count.r1}):

\begin{lemma}
\label{lem.binom.wecompos.count.r1-gen}Let $n\in\mathbb{Z}$ and $k\in
\mathbb{N}$. Then,%
\begin{equation}
\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in
\mathbb{N}^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n\right)
=\dbinom{n+k-1}{n}.\nonumber
\end{equation}

\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.binom.wecompos.count.r1-gen}.]If $n\in\mathbb{N}$,
then this follows immediately from (\ref{eq.thm.binom.wecompos.count.r1}).
Hence, for the rest of this proof, we WLOG assume that $n\notin\mathbb{N}$.
Hence, (\ref{eq.def.binom.def.b}) (applied to $n+k-1$ and $n$ instead of $n$
and $k$) yields $\dbinom{n+k-1}{n}=0$.

But there exists no $\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in
\mathbb{N}^{k}$ satisfying $x_{1}+x_{2}+\cdots+x_{k}=n$%
\ \ \ \ \footnote{\textit{Proof.} Let $\left(  x_{1},x_{2},\ldots
,x_{k}\right)  \in\mathbb{N}^{k}$. Hence, the $k$ elements $x_{1},x_{2}%
,\ldots,x_{k}$ are $k$ elements of $\mathbb{N}$. Thus, the sum $x_{1}%
+x_{2}+\cdots+x_{k}$ of these $k$ elements must also be an element of
$\mathbb{N}$. In other words, $x_{1}+x_{2}+\cdots+x_{k}\in\mathbb{N}$. If we
had $x_{1}+x_{2}+\cdots+x_{k}=n$, then this would entail that $n=x_{1}%
+x_{2}+\cdots+x_{k}\in\mathbb{N}$, which would contradict $n\notin\mathbb{N}$.
Hence, we cannot have $x_{1}+x_{2}+\cdots+x_{k}=n$. In other words, we have
$x_{1}+x_{2}+\cdots+x_{k}\neq n$.
\par
Forget that we fixed $\left(  x_{1},x_{2},\ldots,x_{k}\right)  $. We thus have
showed that each $\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\mathbb{N}^{k}$
satisfies $x_{1}+x_{2}+\cdots+x_{k}\neq n$. In other words, there exists no
$\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\mathbb{N}^{k}$ satisfying
$x_{1}+x_{2}+\cdots+x_{k}=n$.}. Hence,
\[
\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in
\mathbb{N}^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n\right)  =0.
\]
Comparing this with $\dbinom{n+k-1}{n}=0$, we obtain%
\begin{equation}
\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in
\mathbb{N}^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n\right)
=\dbinom{n+k-1}{n}.\nonumber
\end{equation}
Thus, Lemma \ref{lem.binom.wecompos.count.r1-gen} is proved.
\end{proof}

\begin{proof}
[Solution to Exercise \ref{exe.binom.compos.p}.]Set
\begin{equation}
U=\left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\mathbb{N}^{k}%
\ \mid\ x_{1}+x_{2}+\cdots+x_{k}=n\right\}  . \label{sol.binom.compos.p.U=}%
\end{equation}
Thus,%
\begin{align*}
\left\vert U\right\vert  &  =\left\vert \left\{  \left(  x_{1},x_{2}%
,\ldots,x_{k}\right)  \in\mathbb{N}^{k}\ \mid\ x_{1}+x_{2}+\cdots
+x_{k}=n\right\}  \right\vert \\
&  =\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)
\in\mathbb{N}^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n\right) \\
&  =\dbinom{n+k-1}{n}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Lemma
\ref{lem.binom.wecompos.count.r1-gen}}\right)  .
\end{align*}
This shows that $U$ is a finite set. Also, clearly, $U\subseteq\mathbb{N}^{k}$
(by the definition of $U$).

For each $i\in\left\{  1,2,\ldots,k\right\}  $, we define a subset $A_{i}$ of
$U$ by%
\begin{equation}
A_{i}=\left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in U\ \mid\ x_{i}\geq
p\right\}  . \label{sol.binom.compos.p.Ai=}%
\end{equation}
Then, $A_{1},A_{2},\ldots,A_{k}$ are $k$ subsets of $U$. Moreover, for any
$\left(  y_{1},y_{2},\ldots,y_{k}\right)  \in U$ and any $i\in\left\{
1,2,\ldots,k\right\}  $, we have the logical equivalence%
\begin{equation}
\left(  \left(  y_{1},y_{2},\ldots,y_{k}\right)  \in A_{i}\right)
\ \Longleftrightarrow\ \left(  y_{i}\geq p\right)
\label{sol.binom.compos.p.Aieq}%
\end{equation}
(by (\ref{sol.binom.compos.p.Ai=})).

Now, we claim the following:

\begin{statement}
\textit{Statement 1:} We have
\begin{align*}
&  U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{k}\right) \\
&  =\left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{
0,1,\ldots,p-1\right\}  ^{k}\ \mid\ x_{1}+x_{2}+\cdots+x_{k}=n\right\}  .
\end{align*}

\end{statement}

[\textit{Proof of Statement 1:} It is easy to see that%
\begin{align}
&  U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{k}\right) \nonumber\\
&  \subseteq\left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{
0,1,\ldots,p-1\right\}  ^{k}\ \mid\ x_{1}+x_{2}+\cdots+x_{k}=n\right\}  .
\label{sol.binom.compos.p.s1.pf.1}%
\end{align}
\footnote{\textit{Proof of (\ref{sol.binom.compos.p.s1.pf.1}):} Let
$\mathbf{t}\in U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{k}\right)
$. Thus, $\mathbf{t}\in U$ and $\mathbf{t}\notin A_{1}\cup A_{2}\cup\cdots\cup
A_{k}$. From
\[
\mathbf{t}\in U=\left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)
\in\mathbb{N}^{k}\ \mid\ x_{1}+x_{2}+\cdots+x_{k}=n\right\}  ,
\]
we conclude that $\mathbf{t}$ can be written in the form $\mathbf{t}=\left(
x_{1},x_{2},\ldots,x_{k}\right)  $ for some $\left(  x_{1},x_{2},\ldots
,x_{k}\right)  \in\mathbb{N}^{k}$ satisfying $x_{1}+x_{2}+\cdots+x_{k}=n$.
Consider this $\left(  x_{1},x_{2},\ldots,x_{k}\right)  $, and denote it by
$\left(  y_{1},y_{2},\ldots,y_{k}\right)  $. Thus, $\left(  y_{1},y_{2}%
,\ldots,y_{k}\right)  \in\mathbb{N}^{k}$ satisfies $y_{1}+y_{2}+\cdots
+y_{k}=n$ and $\mathbf{t}=\left(  y_{1},y_{2},\ldots,y_{k}\right)  $.
\par
Let $i\in\left\{  1,2,\ldots,k\right\}  $. If we had $\mathbf{t}\in A_{i}$,
then we would have $\mathbf{t}\in A_{i}\subseteq A_{1}\cup A_{2}\cup\cdots\cup
A_{k}$, which would contradict $\mathbf{t}\notin A_{1}\cup A_{2}\cup\cdots\cup
A_{k}$. Hence, we do not have $\mathbf{t}\in A_{i}$. In other words, we do not
have $\left(  y_{1},y_{2},\ldots,y_{k}\right)  \in A_{i}$ (since
$\mathbf{t}=\left(  y_{1},y_{2},\ldots,y_{k}\right)  $). Because of the
equivalence (\ref{sol.binom.compos.p.Aieq}), we can thus conclude that we do
not have $y_{i}\geq p$. In other words, we have $y_{i}<p$. But $y_{i}%
\in\mathbb{N}$ (since $\left(  y_{1},y_{2},\ldots,y_{k}\right)  \in
\mathbb{N}^{k}$). Hence, $y_{i}\in\left\{  0,1,\ldots,p-1\right\}  $ (since
$y_{i}\in\mathbb{N}$ and $y_{i}<p$).
\par
Forget that we fixed $i$. We thus have proved that $y_{i}\in\left\{
0,1,\ldots,p-1\right\}  $ for each $i\in\left\{  1,2,\ldots,k\right\}  $.
Therefore, $\left(  y_{1},y_{2},\ldots,y_{k}\right)  \in\left\{
0,1,\ldots,p-1\right\}  ^{k}$. Thus, $\left(  y_{1},y_{2},\ldots,y_{k}\right)
$ is an $\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{  0,1,\ldots
,p-1\right\}  ^{k}$ satisfying $x_{1}+x_{2}+\cdots+x_{k}=n$ (since
$y_{1}+y_{2}+\cdots+y_{k}=n$). In other words,%
\[
\left(  y_{1},y_{2},\ldots,y_{k}\right)  \in\left\{  \left(  x_{1}%
,x_{2},\ldots,x_{k}\right)  \in\left\{  0,1,\ldots,p-1\right\}  ^{k}%
\ \mid\ x_{1}+x_{2}+\cdots+x_{k}=n\right\}  .
\]
In view of $\mathbf{t}=\left(  y_{1},y_{2},\ldots,y_{k}\right)  $, this
rewrites as%
\[
\mathbf{t}\in\left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{
0,1,\ldots,p-1\right\}  ^{k}\ \mid\ x_{1}+x_{2}+\cdots+x_{k}=n\right\}  .
\]
\par
Forget that we fixed $\mathbf{t}$. We thus have showed that
\[
\mathbf{t}\in\left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{
0,1,\ldots,p-1\right\}  ^{k}\ \mid\ x_{1}+x_{2}+\cdots+x_{k}=n\right\}
\]
for each $\mathbf{t}\in U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup
A_{k}\right)  $. In other words,%
\[
U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{k}\right)  \subseteq
\left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{  0,1,\ldots
,p-1\right\}  ^{k}\ \mid\ x_{1}+x_{2}+\cdots+x_{k}=n\right\}  .
\]
This proves (\ref{sol.binom.compos.p.s1.pf.1}).}

It is also easy to see that%
\begin{align}
&  \left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{
0,1,\ldots,p-1\right\}  ^{k}\ \mid\ x_{1}+x_{2}+\cdots+x_{k}=n\right\}
\nonumber\\
&  \subseteq U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{k}\right)  .
\label{sol.binom.compos.p.s1.pf.2}%
\end{align}
\footnote{\textit{Proof of (\ref{sol.binom.compos.p.s1.pf.2}):} Let
$\mathbf{s}\in\left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{
0,1,\ldots,p-1\right\}  ^{k}\ \mid\ x_{1}+x_{2}+\cdots+x_{k}=n\right\}  $.
Thus, $\mathbf{s}$ can be written in the form $\mathbf{s}=\left(  x_{1}%
,x_{2},\ldots,x_{k}\right)  $ for some $\left(  x_{1},x_{2},\ldots
,x_{k}\right)  \in\left\{  0,1,\ldots,p-1\right\}  ^{k}$ satisfying
$x_{1}+x_{2}+\cdots+x_{k}=n$. Consider this $\left(  x_{1},x_{2},\ldots
,x_{k}\right)  $, and denote it by $\left(  y_{1},y_{2},\ldots,y_{k}\right)
$. Thus, $\left(  y_{1},y_{2},\ldots,y_{k}\right)  \in\left\{  0,1,\ldots
,p-1\right\}  ^{k}$ satisfies $y_{1}+y_{2}+\cdots+y_{k}=n$ and $\mathbf{s}%
=\left(  y_{1},y_{2},\ldots,y_{k}\right)  $.
\par
We have $\left(  y_{1},y_{2},\ldots,y_{k}\right)  \in\left\{  0,1,\ldots
,p-1\right\}  ^{k}\subseteq\mathbb{N}^{k}$ (since $\left\{  0,1,\ldots
,p-1\right\}  \subseteq\mathbb{N}$). Hence, $\left(  y_{1},y_{2},\ldots
,y_{k}\right)  $ is an $\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in
\mathbb{N}^{k}$ satisfying $x_{1}+x_{2}+\cdots+x_{k}=n$ (since $y_{1}%
+y_{2}+\cdots+y_{k}=n$). In other words,%
\[
\left(  y_{1},y_{2},\ldots,y_{k}\right)  \in\left\{  \left(  x_{1}%
,x_{2},\ldots,x_{k}\right)  \in\mathbb{N}^{k}\ \mid\ x_{1}+x_{2}+\cdots
+x_{k}=n\right\}  .
\]
In view of (\ref{sol.binom.compos.p.U=}), this rewrites as $\left(
y_{1},y_{2},\ldots,y_{k}\right)  \in U$. Hence, $\mathbf{s}=\left(
y_{1},y_{2},\ldots,y_{k}\right)  \in U$.
\par
Next, we shall prove that $\mathbf{s}\notin A_{1}\cup A_{2}\cup\cdots\cup
A_{k}$. Indeed, assume the contrary. Thus, $\mathbf{s}\in A_{1}\cup A_{2}%
\cup\cdots\cup A_{k}$. In other words, $\mathbf{s}\in A_{i}$ for some
$i\in\left\{  1,2,\ldots,k\right\}  $. Consider this $i$. We have $\left(
y_{1},y_{2},\ldots,y_{k}\right)  =\mathbf{s}\in A_{i}$. Because of the
equivalence (\ref{sol.binom.compos.p.Aieq}), this entails that $y_{i}\geq p$.
But from $\left(  y_{1},y_{2},\ldots,y_{k}\right)  \in\left\{  0,1,\ldots
,p-1\right\}  ^{k}$, we obtain $y_{i}\in\left\{  0,1,\ldots,p-1\right\}  $, so
that $y_{i}\leq p-1<p$. This contradicts $y_{i}\geq p$. This contradiction
shows that our assumption was wrong. Hence, we have proved that $\mathbf{s}%
\notin A_{1}\cup A_{2}\cup\cdots\cup A_{k}$.
\par
Combining $\mathbf{s}\in U$ with $\mathbf{s}\notin A_{1}\cup A_{2}\cup
\cdots\cup A_{k}$, we obtain $\mathbf{s}\in U\setminus\left(  A_{1}\cup
A_{2}\cup\cdots\cup A_{k}\right)  $.
\par
Forget that we fixed $\mathbf{s}$. We thus have proved that $\mathbf{s}\in
U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{k}\right)  $ for each
$\mathbf{s}\in\left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{
0,1,\ldots,p-1\right\}  ^{k}\ \mid\ x_{1}+x_{2}+\cdots+x_{k}=n\right\}  $. In
other words,%
\[
\left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{  0,1,\ldots
,p-1\right\}  ^{k}\ \mid\ x_{1}+x_{2}+\cdots+x_{k}=n\right\}  \subseteq
U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{k}\right)  .
\]
This proves (\ref{sol.binom.compos.p.s1.pf.2}).}

Combining (\ref{sol.binom.compos.p.s1.pf.1}) with
(\ref{sol.binom.compos.p.s1.pf.2}), we obtain%
\begin{align*}
&  U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{k}\right) \\
&  =\left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{
0,1,\ldots,p-1\right\}  ^{k}\ \mid\ x_{1}+x_{2}+\cdots+x_{k}=n\right\}  .
\end{align*}
This proves Statement 1.]

Next, we claim the following:

\begin{statement}
\textit{Statement 2:} Let $I$ be a subset of $\left[  k\right]  $. Then,%
\[
\left\vert \left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\}
\right\vert =\dbinom{n-p\left\vert I\right\vert +k-1}{n-p\left\vert
I\right\vert }.
\]

\end{statement}

[\textit{Proof of Statement 2:} We shall use the Iverson bracket notation (as
defined in Definition \ref{def.iverson}). Corollary \ref{prop.count.rollcall}
\textbf{(a)} (applied to $S=\left[  k\right]  $ and $T=I$) yields%
\begin{equation}
\left\vert I\right\vert =\sum_{s\in\left[  k\right]  }\left[  s\in I\right]
=\sum_{i\in\left[  k\right]  }\left[  i\in I\right]
\label{sol.binom.compos.p.s2.pf.ive-sum}%
\end{equation}
(here, we have renamed the summation index $s$ as $i$).

Define two sets%
\begin{align*}
P  &  =\left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\}
\ \ \ \ \ \ \ \ \ \ \text{and}\\
Q  &  =\left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\mathbb{N}%
^{k}\ \mid\ x_{1}+x_{2}+\cdots+x_{k}=n-p\left\vert I\right\vert \right\}  .
\end{align*}
We shall find a bijection from $P$ to $Q$.

The definition of $P$ shows that $P\subseteq U\subseteq\mathbb{N}^{k}$, so
that every element of $P$ is a $k$-tuple of nonnegative integers. The same
holds for $Q$ (since the definition of $Q$ shows that $Q\subseteq
\mathbb{N}^{k}$).

For each $i\in\left\{  1,2,\ldots,k\right\}  $, we define an integer $q_{i}$
by $q_{i}=p\left[  i\in I\right]  $. Thus, we have defined $k$ integers
$q_{1},q_{2},\ldots,q_{k}$. Their sum is%
\begin{align*}
q_{1}+q_{2}+\cdots+q_{k}  &  =\underbrace{\sum_{i=1}^{k}}_{\substack{=\sum
_{i\in\left\{  1,2,\ldots,k\right\}  }\\=\sum_{i\in\left[  k\right]  }%
}}\underbrace{q_{i}}_{\substack{=p\left[  i\in I\right]  \\\text{(by the
definition of }q_{i}\text{)}}}=\sum_{i\in\left[  k\right]  }p\left[  i\in
I\right]  =p\underbrace{\sum_{i\in\left[  k\right]  }\left[  i\in I\right]
}_{\substack{=\left\vert I\right\vert \\\text{(by
(\ref{sol.binom.compos.p.s2.pf.ive-sum}))}}}\\
&  =p\left\vert I\right\vert .
\end{align*}


If $\left(  y_{1},y_{2},\ldots,y_{k}\right)  \in P$, then $\left(  y_{1}%
-q_{1},y_{2}-q_{2},\ldots,y_{k}-q_{k}\right)  \in Q$%
\ \ \ \ \footnote{\textit{Proof.} Let $\left(  y_{1},y_{2},\ldots
,y_{k}\right)  \in P$. Thus,%
\[
\left(  y_{1},y_{2},\ldots,y_{k}\right)  \in P\subseteq U=\left\{  \left(
x_{1},x_{2},\ldots,x_{k}\right)  \in\mathbb{N}^{k}\ \mid\ x_{1}+x_{2}%
+\cdots+x_{k}=n\right\}  .
\]
In other words, $\left(  y_{1},y_{2},\ldots,y_{k}\right)  $ is an $\left(
x_{1},x_{2},\ldots,x_{k}\right)  \in\mathbb{N}^{k}$ satisfying $x_{1}%
+x_{2}+\cdots+x_{k}=n$. In other words, $\left(  y_{1},y_{2},\ldots
,y_{k}\right)  $ is an element of $\mathbb{N}^{k}$ and satisfies $y_{1}%
+y_{2}+\cdots+y_{k}=n$.
\par
Recall that $\left(  y_{1},y_{2},\ldots,y_{k}\right)  \in P=\left\{  s\in
U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\}  $. In other words, $\left(
y_{1},y_{2},\ldots,y_{k}\right)  $ is an $s\in U$ satisfying $s\in A_{i}$ for
all $i\in I$. In other words, $\left(  y_{1},y_{2},\ldots,y_{k}\right)  $ is
an element of $U$ and satisfies%
\begin{equation}
\left(  y_{1},y_{2},\ldots,y_{k}\right)  \in A_{i}%
\ \ \ \ \ \ \ \ \ \ \text{for all }i\in I.
\label{sol.binom.compos.p.s2.pf.fn1.1}%
\end{equation}
\par
Now, let $i\in\left\{  1,2,\ldots,k\right\}  $. Then, $y_{i}\in\mathbb{N}$
(since $\left(  y_{1},y_{2},\ldots,y_{k}\right)  $ is an element of
$\mathbb{N}^{k}$). We shall now show that $y_{i}-q_{i}\in\mathbb{N}$. Indeed,
this is obvious in the case when $q_{i}=0$ (because in this case, we have
$y_{i}-\underbrace{q_{i}}_{=0}=y_{i}\in\mathbb{N}$). Hence, for the rest of
this proof of $y_{i}-q_{i}\in\mathbb{N}$, we WLOG assume that $q_{i}\neq0$.
Hence, we have $i\in I$ (since otherwise, we would have $\left[  i\in
I\right]  =0$ and thus $q_{i}=p\underbrace{\left[  i\in I\right]  }_{=0}=0$,
which would contradict $q_{i}\neq0$). Hence,
(\ref{sol.binom.compos.p.s2.pf.fn1.1}) yields $\left(  y_{1},y_{2}%
,\ldots,y_{k}\right)  \in A_{i}$. Because of the equivalence
(\ref{sol.binom.compos.p.Aieq}), this entails that $y_{i}\geq p$. Thus,
$y_{i}-p\geq0$, so that $y_{i}-p\in\mathbb{N}$. Now, $q_{i}%
=p\underbrace{\left[  i\in I\right]  }_{\substack{=1\\\text{(since }i\in
I\text{)}}}=p$. Hence, $y_{i}-\underbrace{q_{i}}_{=p}=y_{i}-p\in\mathbb{N}$.
Thus, $y_{i}-q_{i}\in\mathbb{N}$ is proved.
\par
Now, forget that we fixed $i$. We thus have showed that $y_{i}-q_{i}%
\in\mathbb{N}$ for each $i\in\left\{  1,2,\ldots,k\right\}  $. In other words,
$\left(  y_{1}-q_{1},y_{2}-q_{2},\ldots,y_{k}-q_{k}\right)  \in\mathbb{N}^{k}%
$. Moreover,
\[
\left(  y_{1}-q_{1}\right)  +\left(  y_{2}-q_{2}\right)  +\cdots+\left(
y_{k}-q_{k}\right)  =\underbrace{\left(  y_{1}+y_{2}+\cdots+y_{k}\right)
}_{=n}-\underbrace{\left(  q_{1}+q_{2}+\cdots+q_{k}\right)  }_{=p\left\vert
I\right\vert }=n-p\left\vert I\right\vert .
\]
Hence, $\left(  y_{1}-q_{1},y_{2}-q_{2},\ldots,y_{k}-q_{k}\right)  $ is an
$\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\mathbb{N}^{k}$ satisfying
$x_{1}+x_{2}+\cdots+x_{k}=n-p\left\vert I\right\vert $ (since $\left(
y_{1}-q_{1},y_{2}-q_{2},\ldots,y_{k}-q_{k}\right)  \in\mathbb{N}^{k}$). In
other words,%
\[
\left(  y_{1}-q_{1},y_{2}-q_{2},\ldots,y_{k}-q_{k}\right)  \in\left\{  \left(
x_{1},x_{2},\ldots,x_{k}\right)  \in\mathbb{N}^{k}\ \mid\ x_{1}+x_{2}%
+\cdots+x_{k}=n-p\left\vert I\right\vert \right\}  .
\]
In other words, $\left(  y_{1}-q_{1},y_{2}-q_{2},\ldots,y_{k}-q_{k}\right)
\in Q$ (since $Q=\left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)
\in\mathbb{N}^{k}\ \mid\ x_{1}+x_{2}+\cdots+x_{k}=n-p\left\vert I\right\vert
\right\}  $). Qed.}. Hence, we can define a map%
\begin{align*}
\alpha:P  &  \rightarrow Q,\\
\left(  y_{1},y_{2},\ldots,y_{k}\right)   &  \mapsto\left(  y_{1}-q_{1}%
,y_{2}-q_{2},\ldots,y_{k}-q_{k}\right)  .
\end{align*}


If $\left(  z_{1},z_{2},\ldots,z_{k}\right)  \in Q$, then $\left(  z_{1}%
+q_{1},z_{2}+q_{2},\ldots,z_{k}+q_{k}\right)  \in P$%
\ \ \ \ \footnote{\textit{Proof.} Let $\left(  z_{1},z_{2},\ldots
,z_{k}\right)  \in Q$. Thus,%
\[
\left(  z_{1},z_{2},\ldots,z_{k}\right)  \in Q=\left\{  \left(  x_{1}%
,x_{2},\ldots,x_{k}\right)  \in\mathbb{N}^{k}\ \mid\ x_{1}+x_{2}+\cdots
+x_{k}=n-p\left\vert I\right\vert \right\}  .
\]
In other words, $\left(  z_{1},z_{2},\ldots,z_{k}\right)  $ is an $\left(
x_{1},x_{2},\ldots,x_{k}\right)  \in\mathbb{N}^{k}$ satisfying $x_{1}%
+x_{2}+\cdots+x_{k}=n-p\left\vert I\right\vert $. In other words, $\left(
z_{1},z_{2},\ldots,z_{k}\right)  $ is an element of $\mathbb{N}^{k}$ and
satisfies $z_{1}+z_{2}+\cdots+z_{k}=n-p\left\vert I\right\vert $.
\par
For each $i\in\left\{  1,2,\ldots,k\right\}  $, we have $z_{i}\in\mathbb{N}$
(since $\left(  z_{1},z_{2},\ldots,z_{k}\right)  $ is an element of
$\mathbb{N}^{k}$) and thus%
\[
\underbrace{z_{i}}_{\in\mathbb{N}}+\underbrace{q_{i}}_{\substack{=p\left[
i\in I\right]  \in\mathbb{N}\\\text{(since }p\in\mathbb{N}\text{ and }\left[
i\in I\right]  \in\mathbb{N}\text{)}}}\in\mathbb{N}.
\]
In other words, $\left(  z_{1}+q_{1},z_{2}+q_{2},\ldots,z_{k}+q_{k}\right)
\in\mathbb{N}^{k}$. Moreover,
\begin{align*}
&  \left(  z_{1}+q_{1}\right)  +\left(  z_{2}+q_{2}\right)  +\cdots+\left(
z_{k}+q_{k}\right) \\
&  =\underbrace{\left(  z_{1}+z_{2}+\cdots+z_{k}\right)  }_{=n-p\left\vert
I\right\vert }+\underbrace{\left(  q_{1}+q_{2}+\cdots+q_{k}\right)
}_{=p\left\vert I\right\vert }=\left(  n-p\left\vert I\right\vert \right)
+p\left\vert I\right\vert =n.
\end{align*}
Hence, $\left(  z_{1}+q_{1},z_{2}+q_{2},\ldots,z_{k}+q_{k}\right)  $ is an
$\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\mathbb{N}^{k}$ satisfying
$x_{1}+x_{2}+\cdots+x_{k}=n$ (since $\left(  z_{1}+q_{1},z_{2}+q_{2}%
,\ldots,z_{k}+q_{k}\right)  \in\mathbb{N}^{k}$). In other words,%
\[
\left(  z_{1}+q_{1},z_{2}+q_{2},\ldots,z_{k}+q_{k}\right)  \in\left\{  \left(
x_{1},x_{2},\ldots,x_{k}\right)  \in\mathbb{N}^{k}\ \mid\ x_{1}+x_{2}%
+\cdots+x_{k}=n\right\}  .
\]
In view of (\ref{sol.binom.compos.p.U=}), this rewrites as $\left(
z_{1}+q_{1},z_{2}+q_{2},\ldots,z_{k}+q_{k}\right)  \in U$.
\par
Now, let $i\in I$. We shall show that $\left(  z_{1}+q_{1},z_{2}+q_{2}%
,\ldots,z_{k}+q_{k}\right)  \in A_{i}$.
\par
Indeed, $i\in I$, so that $\left[  i\in I\right]  =1$. Hence, the definition
of $q_{i}$ yields $q_{i}=p\underbrace{\left[  i\in I\right]  }_{=1}=p$. Also,
$z_{i}\in\mathbb{N}$ (since $\left(  z_{1},z_{2},\ldots,z_{k}\right)  $ is an
element of $\mathbb{N}^{k}$) and thus $z_{i}\geq0$. Thus, $\underbrace{z_{i}%
}_{\geq0}+\underbrace{q_{i}}_{=p}\geq0+p=p$. Hence, $\left(  z_{1}+q_{1}%
,z_{2}+q_{2},\ldots,z_{k}+q_{k}\right)  $ is an $\left(  x_{1},x_{2}%
,\ldots,x_{k}\right)  \in U$ satisfying $x_{i}\geq p$ (since $\left(
z_{1}+q_{1},z_{2}+q_{2},\ldots,z_{k}+q_{k}\right)  \in U$). In other words,%
\[
\left(  z_{1}+q_{1},z_{2}+q_{2},\ldots,z_{k}+q_{k}\right)  \in\left\{  \left(
x_{1},x_{2},\ldots,x_{k}\right)  \in U\ \mid\ x_{i}\geq p\right\}  .
\]
In view of (\ref{sol.binom.compos.p.Ai=}), this rewrites as $\left(
z_{1}+q_{1},z_{2}+q_{2},\ldots,z_{k}+q_{k}\right)  \in A_{i}$.
\par
Now, forget that we fixed $i$. We thus have showed that $\left(  z_{1}%
+q_{1},z_{2}+q_{2},\ldots,z_{k}+q_{k}\right)  \in A_{i}$ for all $i\in I$.
Hence, $\left(  z_{1}+q_{1},z_{2}+q_{2},\ldots,z_{k}+q_{k}\right)  $ is an
$s\in U$ that satisfies $\left(  s\in A_{i}\text{ for all }i\in I\right)  $
(since $\left(  z_{1}+q_{1},z_{2}+q_{2},\ldots,z_{k}+q_{k}\right)  \in U$). In
other words,%
\[
\left(  z_{1}+q_{1},z_{2}+q_{2},\ldots,z_{k}+q_{k}\right)  \in\left\{  s\in
U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\}  .
\]
In view of $P=\left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\}
$, this rewrites as $\left(  z_{1}+q_{1},z_{2}+q_{2},\ldots,z_{k}%
+q_{k}\right)  \in P$. Qed.}. Hence, we can define a map
\begin{align*}
\beta:Q  &  \rightarrow P,\\
\left(  z_{1},z_{2},\ldots,z_{k}\right)   &  \mapsto\left(  z_{1}+q_{1}%
,z_{2}+q_{2},\ldots,z_{k}+q_{k}\right)  .
\end{align*}


The maps $\alpha$ and $\beta$ are mutually inverse\footnote{Indeed, the map
$\alpha$ subtracts $q_{1},q_{2},\ldots,q_{k}$ from the entries of the
$k$-tuple that it is applied to, whereas the map $\beta$ adds $q_{1}%
,q_{2},\ldots,q_{k}$ to the entries of the $k$-tuple that it is applied to.
Thus, the maps $\alpha$ and $\beta$ clearly undo each other. Hence, they are
mutually inverse.}, and thus are bijective. Hence, in particular, $\alpha$ is
a bijection. Thus, the bijection principle yields%
\begin{align*}
\left\vert P\right\vert  &  =\left\vert Q\right\vert =\left\vert \left\{
\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\mathbb{N}^{k}\ \mid\ x_{1}%
+x_{2}+\cdots+x_{k}=n-p\left\vert I\right\vert \right\}  \right\vert \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }Q=\left\{  \left(  x_{1}%
,x_{2},\ldots,x_{k}\right)  \in\mathbb{N}^{k}\ \mid\ x_{1}+x_{2}+\cdots
+x_{k}=n-p\left\vert I\right\vert \right\}  \right) \\
&  =\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)
\in\mathbb{N}^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n-p\left\vert
I\right\vert \right) \\
&  =\dbinom{n-p\left\vert I\right\vert +k-1}{n-p\left\vert I\right\vert
}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Lemma
\ref{lem.binom.wecompos.count.r1-gen}, applied to }n-p\left\vert I\right\vert
\text{ instead of }n\right)  .
\end{align*}
In view of $P=\left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\}
$, this rewrites as%
\[
\left\vert \left\{  s\in U\ \mid\ s\in A_{i}\text{ for all }i\in I\right\}
\right\vert =\dbinom{n-p\left\vert I\right\vert +k-1}{n-p\left\vert
I\right\vert }.
\]
This proves Statement 2.]

Now, let us note that each subset $I$ of $\left[  k\right]  $ satisfies
$\left\vert I\right\vert \in\left\{  0,1,\ldots,k\right\}  $ (since Theorem
\ref{thm.subset-leq} \textbf{(b)} yields $\left\vert I\right\vert
\leq\left\vert \left[  k\right]  \right\vert =k$).

But Statement 1 yields%
\begin{align*}
&  U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{k}\right) \\
&  =\left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{
0,1,\ldots,p-1\right\}  ^{k}\ \mid\ x_{1}+x_{2}+\cdots+x_{k}=n\right\}  .
\end{align*}
Hence,%
\begin{align*}
&  \left\vert U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{k}\right)
\right\vert \\
&  =\left\vert \left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{
0,1,\ldots,p-1\right\}  ^{k}\ \mid\ x_{1}+x_{2}+\cdots+x_{k}=n\right\}
\right\vert \\
&  =\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{
0,1,\ldots,p-1\right\}  ^{k}\text{ satisfying }x_{1}+x_{2}+\cdots
+x_{k}=n\right)  .
\end{align*}
Thus,%
\begin{align*}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\left\{
0,1,\ldots,p-1\right\}  ^{k}\text{ satisfying }x_{1}+x_{2}+\cdots
+x_{k}=n\right) \\
&  =\left\vert U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{k}\right)
\right\vert \\
&  =\sum_{I\subseteq\left[  k\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\underbrace{\left\vert \left\{  s\in U\ \mid\ s\in A_{i}\text{
for all }i\in I\right\}  \right\vert }_{\substack{=\dbinom{n-p\left\vert
I\right\vert +k-1}{n-p\left\vert I\right\vert }\\\text{(by Statement 2)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.pie.bU} (applied to
}k\text{ instead of }n\text{)}\right) \\
&  =\sum_{I\subseteq\left[  k\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\dbinom{n-p\left\vert I\right\vert +k-1}{n-p\left\vert
I\right\vert }=\sum_{j=0}^{k}\ \ \sum_{\substack{I\subseteq\left[  k\right]
;\\\left\vert I\right\vert =j}}\underbrace{\left(  -1\right)  ^{\left\vert
I\right\vert }\dbinom{n-p\left\vert I\right\vert +k-1}{n-p\left\vert
I\right\vert }}_{\substack{=\left(  -1\right)  ^{j}\dbinom{n-pj+k-1}%
{n-pj}\\\text{(since }\left\vert I\right\vert =j\text{)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by an application of (\ref{eq.sum.sheph}), since}\\
\text{each subset }I\text{ of }\left[  k\right]  \text{ satisfies }\left\vert
I\right\vert \in\left\{  0,1,\ldots,k\right\}
\end{array}
\right) \\
&  =\sum_{j=0}^{k}\underbrace{\sum_{\substack{I\subseteq\left[  k\right]
;\\\left\vert I\right\vert =j}}\left(  -1\right)  ^{j}\dbinom{n-pj+k-1}{n-pj}%
}_{=\left(  \text{\# of subsets }I\text{ of }\left[  k\right]  \text{
satisfying }\left\vert I\right\vert =j\right)  \cdot\left(  -1\right)
^{j}\dbinom{n-pj+k-1}{n-pj}}\\
&  =\sum_{j=0}^{k}\underbrace{\left(  \text{\# of subsets }I\text{ of }\left[
k\right]  \text{ satisfying }\left\vert I\right\vert =j\right)  }%
_{\substack{=\left(  \text{\# of }j\text{-element subsets of }\left[
k\right]  \right)  =\dbinom{k}{j}\\\text{(by Theorem \ref{thm.binom.comb},
applied to }\left[  k\right]  \text{, }k\text{ and }j\\\text{instead of
}S\text{, }n\text{ and }k\text{)}}}\cdot\left(  -1\right)  ^{j}\dbinom
{n-pj+k-1}{n-pj}\\
&  =\sum_{j=0}^{k}\dbinom{k}{j}\cdot\left(  -1\right)  ^{j}\dbinom
{n-pj+k-1}{n-pj}=\sum_{j=0}^{k}\left(  -1\right)  ^{j}\dbinom{k}{j}%
\dbinom{n-pj+k-1}{n-pj}.
\end{align*}
This solves Exercise \ref{exe.binom.compos.p}.
\end{proof}

\subsection{Solution to Exercise \ref{exe.binom.nCk-2i-qedmo}}

Our solution to Exercise \ref{exe.binom.nCk-2i-qedmo} is taken from
\cite{QEDMO4-13}. We first recall some notations and basic facts from number theory:

\begin{definition}
If $a$ is an integer and $b$ is a positive integer, then

\begin{itemize}
\item we let $a\sslash b$ denote the quotient obtained when dividing $a$ by
$b$ (in the sense of division with remainder);

\item we let $a\%b$ denote the remainder obtained when dividing $a$ by $b$.
\end{itemize}
\end{definition}

\begin{proposition}
\label{prop.quorem.basics}Let $b$ be a positive integer.

\textbf{(a)} We have $a=\left(  a\sslash b\right)  \cdot b+\left(
a\%b\right)  $ for every $a\in\mathbb{Z}$.

\textbf{(b)} We have $a\%b\in\left\{  0,1,\ldots,b-1\right\}  $ for every
$a\in\mathbb{Z}$.

\textbf{(c)} If $a\in\mathbb{N}$, then $a\sslash b\in\mathbb{N}$.

\textbf{(d)} Any $q\in\mathbb{Z}$ and $r\in\left\{  0,1,\ldots,b-1\right\}  $
satisfy $\left(  qb+r\right)  \sslash b=q$.

\textbf{(e)} Any $q\in\mathbb{Z}$ and $r\in\left\{  0,1,\ldots,b-1\right\}  $
satisfy $\left(  qb+r\right)  \%b=r$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.quorem.basics}.]\textbf{(a)} Proposition
\ref{prop.quorem.basics} \textbf{(a)} is \cite[Corollary 2.6.9 \textbf{(d)}%
]{19s} (with $u$ and $n$ renamed as $a$ and $b$).

\textbf{(b)} Proposition \ref{prop.quorem.basics} \textbf{(b)} is the first
claim of \cite[Corollary 2.6.9 \textbf{(a)}]{19s} (with $u$ and $n$ renamed as
$a$ and $b$).

\textbf{(c)} Let $a\in\mathbb{N}$. Then, Proposition \ref{prop.quorem.basics}
\textbf{(b)} yields $a\%b\in\left\{  0,1,\ldots,b-1\right\}  $, so that
$a\%b\leq b-1<b$. But Proposition \ref{prop.quorem.basics} \textbf{(a)} yields%
\[
a=\left(  a\sslash b\right)  \cdot b+\underbrace{\left(  a\%b\right)  }%
_{<b}<\left(  a\sslash b\right)  \cdot b+b=\left(  \left(  a\sslash b\right)
+1\right)  b.
\]
Hence,%
\[
\left(  \left(  a\sslash b\right)  +1\right)  b>a\geq
0\ \ \ \ \ \ \ \ \ \ \left(  \text{since }a\in\mathbb{N}\right)  .
\]
We can divide both sides of this inequality by $b$ (since $b$ is positive),
and thus obtain $\left(  a\sslash b\right)  +1>0$. In other words, $a\sslash
b>-1$. Since $a\sslash b\in\mathbb{Z}$, we thus conclude that $a\sslash
b\geq\left(  -1\right)  +1=0$. In other words, $a\sslash b\in\mathbb{N}$. This
proves Proposition \ref{prop.quorem.basics} \textbf{(c)}.

\textbf{(d)} Proposition \ref{prop.quorem.basics} \textbf{(d)} is
\cite[Exercise 2.6.4 \textbf{(c)}]{19s} (with $n$ renamed as $b$).

\textbf{(e)} Proposition \ref{prop.quorem.basics} \textbf{(e)} is
\cite[Exercise 2.6.4 \textbf{(d)}]{19s} (with $n$ renamed as $b$).
\end{proof}

\begin{proof}
[Solution to Exercise \ref{exe.binom.nCk-2i-qedmo}.]This will be a proof by
double counting. We shall count the $n$-tuples $\left(  x_{1},x_{2}%
,\ldots,x_{n}\right)  \in\mathbb{N}^{n}$ satisfying $x_{1}+x_{2}+\cdots
+x_{n}=k$ in two different ways.

The first way is easy: The equality (\ref{eq.thm.binom.wecompos.count.r1})
(applied to $k$ and $n$ instead of $n$ and $k$) shows that%
\begin{align}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{n}\right)  \in
\mathbb{N}^{n}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{n}=k\right)
=\dbinom{k+n-1}{k}\nonumber\\
&  =\dbinom{n+k-1}{k} \label{sol.binom.nCk-2i-qedmo.count1}%
\end{align}
(since $k+n=n+k$).

The second way is trickier. Let me first outline the idea, before showing the
argument in full detail.

\bigskip

\textit{Outline:} It is well-known (a particular case of division with
remainder) that any nonnegative integer $x$ can be written as $x=2q+r$ for a
unique $q\in\mathbb{N}$ and a unique $r\in\left\{  0,1\right\}  $. Thus, each
$n$-tuple $\left(  x_{1},x_{2},\ldots,x_{n}\right)  \in\mathbb{N}^{n}$ can be
written uniquely in the form $\left(  2q_{1}+r_{1},2q_{2}+r_{2},\ldots
,2q_{n}+r_{n}\right)  $ for some $q_{1},q_{2},\ldots,q_{n}\in\mathbb{N}$ and
some $r_{1},r_{2},\ldots,r_{n}\in\left\{  0,1\right\}  $. In other words, for
each $n$-tuple $\left(  x_{1},x_{2},\ldots,x_{n}\right)  \in\mathbb{N}^{n}$,
there exists a unique $2\times n$-table $\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  $ with $q_{1},q_{2},\ldots,q_{n}\in\mathbb{N}$ and $r_{1}%
,r_{2},\ldots,r_{n}\in\left\{  0,1\right\}  $ satisfying $\left(  x_{1}%
,x_{2},\ldots,x_{n}\right)  =\left(  2q_{1}+r_{1},2q_{2}+r_{2},\ldots
,2q_{n}+r_{n}\right)  $. Moreover, an $n$-tuple $\left(  x_{1},x_{2}%
,\ldots,x_{n}\right)  \in\mathbb{N}^{n}$ satisfies $x_{1}+x_{2}+\cdots
+x_{n}=k$ if and only if the corresponding $2\times n$-table $\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  $ satisfies $2\left(  q_{1}+q_{2}+\cdots+q_{n}\right)  +\left(
r_{1}+r_{2}+\cdots+r_{n}\right)  =k$. Thus, there is a bijection%
\begin{align*}
&  \left\{  2\times n\text{-tables }\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  \text{ with }q_{1},q_{2},\ldots,q_{n}\in\mathbb{N}\text{ and }%
r_{1},r_{2},\ldots,r_{n}\in\left\{  0,1\right\}  \right. \\
&  \ \ \ \ \ \ \ \ \ \ \left.
\vphantom{\begin{pmatrix}a\\ a\end{pmatrix}}\text{ satisfying }2\left(
q_{1}+q_{2}+\cdots+q_{n}\right)  +\left(  r_{1}+r_{2}+\cdots+r_{n}\right)
=k\right\} \\
&  \rightarrow\left\{  n\text{-tuples }\left(  x_{1},x_{2},\ldots
,x_{n}\right)  \in\mathbb{N}^{n}\text{ satisfying }x_{1}+x_{2}+\cdots
+x_{n}=k\right\}
\end{align*}
that sends%
\begin{align*}
&  \text{each }2\times n\text{-table }\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right) \\
&  \text{to the }n\text{-tuple }\left(  2q_{1}+r_{1},2q_{2}+r_{2}%
,\ldots,2q_{n}+r_{n}\right)  .
\end{align*}
Hence, the bijection principle yields%
\begin{align}
&  \left(  \text{\# of }n\text{-tuples }\left(  x_{1},x_{2},\ldots
,x_{n}\right)  \in\mathbb{N}^{n}\text{ satisfying }x_{1}+x_{2}+\cdots
+x_{n}=k\right) \nonumber\\
&  =\left(  \text{\# of nice tables}\right)  ,
\label{sol.binom.nCk-2i-qedmo.outline.3}%
\end{align}
where a \textquotedblleft\emph{nice table}\textquotedblright\ shall mean a
$2\times n$-table $\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  $ with $q_{1},q_{2},\ldots,q_{n}\in\mathbb{N}$ and $r_{1}%
,r_{2},\ldots,r_{n}\in\left\{  0,1\right\}  $ satisfying $2\left(  q_{1}%
+q_{2}+\cdots+q_{n}\right)  +\left(  r_{1}+r_{2}+\cdots+r_{n}\right)  =k$. It
thus remains to count the nice tables. But we can do this using the sum rule:
Define the \emph{top-sum} of a nice table $\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  $ to be the sum $q_{1}+q_{2}+\cdots+q_{n}$. The top-sum of a nice
table is always a nonnegative integer $\leq k$ (actually, $\leq\left\lfloor
k/2\right\rfloor $, but we will not use this stronger statement), i.e., an
element of $\left\{  0,1,\ldots,k\right\}  $. Moreover, for each $i\in\left\{
0,1,\ldots,k\right\}  $, the product rule yields%
\[
\left(  \text{\# of nice tables with top-sum }i\right)  =\dbinom{n+i-1}%
{i}\dbinom{n}{k-2i},
\]
because we can construct a nice table $\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  $ with top-sum $i$ by the following algorithm:

\begin{itemize}
\item First, choose the $n$ entries $q_{1},q_{2},\ldots,q_{n}$ of the top row
of the table. These $n$ entries must belong to $\mathbb{N}$ and sum to
$q_{1}+q_{2}+\cdots+q_{n}=i$; in other words, we are choosing an $n$-tuple
$\left(  q_{1},q_{2},\ldots,q_{n}\right)  \in\mathbb{N}^{n}$ satisfying
$q_{1}+q_{2}+\cdots+q_{n}=i$. Thus, (\ref{eq.thm.binom.wecompos.count.r1})
(applied to $i$ and $n$ instead of $n$ and $k$) shows that the \# of options
at this step is $\dbinom{i+n-1}{i}=\dbinom{n+i-1}{i}$.

\item Then, choose the $n$ entries $r_{1},r_{2},\ldots,r_{n}$ of the bottom
row of the table. These $n$ entries must belong to $\left\{  0,1\right\}  $
and sum to $r_{1}+r_{2}+\cdots+r_{n}=k-2i$ (since we want to have $2\left(
q_{1}+q_{2}+\cdots+q_{n}\right)  +\left(  r_{1}+r_{2}+\cdots+r_{n}\right)
=k$, but we have $q_{1}+q_{2}+\cdots+q_{n}=i$); in other words, we are
choosing an $n$-tuple $\left(  r_{1},r_{2},\ldots,r_{n}\right)  \in\left\{
0,1\right\}  ^{n}$ satisfying $r_{1}+r_{2}+\cdots+r_{n}=k-2i$. Thus, Theorem
\ref{thm.binom.bicompos.count} (applied to $k-2i$ and $n$ instead of $n$ and
$k$) shows that the \# of options at this step is $\dbinom{n}{k-2i}$.
\end{itemize}

\noindent Combining these observations using the sum rule, we obtain $\left(
\text{\# of nice tables}\right)  =\sum_{i=0}^{k}\dbinom{n+i-1}{i}\dbinom
{n}{k-2i}$. In view of (\ref{sol.binom.nCk-2i-qedmo.outline.3}), this rewrites
as%
\begin{align*}
&  \left(  \text{\# of }n\text{-tuples }\left(  x_{1},x_{2},\ldots
,x_{n}\right)  \in\mathbb{N}^{n}\text{ satisfying }x_{1}+x_{2}+\cdots
+x_{n}=k\right) \\
&  =\sum_{i=0}^{k}\dbinom{n+i-1}{i}\dbinom{n}{k-2i}.
\end{align*}
Comparing this with (\ref{sol.binom.nCk-2i-qedmo.count1}), we obtain the claim
of the exercise.

\bigskip

\textit{Detailed argument:} Here comes the detailed (and formalized) version
of the argument we just outlined.

We define a \emph{nice table}\ to mean a $2\times n$-table\footnote{i.e., a
rectangular table with $2$ rows and $n$ columns} $\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  $ with $q_{1},q_{2},\ldots,q_{n}\in\mathbb{N}$ and $r_{1}%
,r_{2},\ldots,r_{n}\in\left\{  0,1\right\}  $ satisfying $2\left(  q_{1}%
+q_{2}+\cdots+q_{n}\right)  +\left(  r_{1}+r_{2}+\cdots+r_{n}\right)  =k$.

The \emph{top-sum} of a nice table $\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  $ is defined to be the sum $q_{1}+q_{2}+\cdots+q_{n}$.

We now state our first observation:

\begin{statement}
\textit{Statement 1:} We have%
\begin{align*}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{n}\right)  \in
\mathbb{N}^{n}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{n}=k\right) \\
&  =\left(  \text{\# of nice tables}\right)  .
\end{align*}

\end{statement}

[\textit{Proof of Statement 1:} If $\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  $ is a nice table, then \newline$\left(  2q_{1}+r_{1},2q_{2}%
+r_{2},\ldots,2q_{n}+r_{n}\right)  $ is an $n$-tuple $\left(  x_{1}%
,x_{2},\ldots,x_{n}\right)  \in\mathbb{N}^{n}$ satisfying $x_{1}+x_{2}%
+\cdots+x_{n}=k$\ \ \ \ \footnote{\textit{Proof.} Let $\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  $ be a nice table. According to the definition of a \textquotedblleft
nice table\textquotedblright, this means that $q_{1},q_{2},\ldots,q_{n}%
\in\mathbb{N}$ and $r_{1},r_{2},\ldots,r_{n}\in\left\{  0,1\right\}  $ and
$2\left(  q_{1}+q_{2}+\cdots+q_{n}\right)  +\left(  r_{1}+r_{2}+\cdots
+r_{n}\right)  =k$. Hence, for each $i\in\left[  n\right]  $, we have
$q_{i}\in\mathbb{N}$ (since $q_{1},q_{2},\ldots,q_{n}\in\mathbb{N}$) and
$r_{i}\in\left\{  0,1\right\}  $ (since $r_{1},r_{2},\ldots,r_{n}\in\left\{
0,1\right\}  $) and thus, $2\underbrace{q_{i}}_{\in\mathbb{N}}%
+\underbrace{r_{i}}_{\in\left\{  0,1\right\}  \subseteq\mathbb{N}}%
\in\mathbb{N}$. In other words, the $n$ numbers $2q_{1}+r_{1},2q_{2}%
+r_{2},\ldots,2q_{n}+r_{n}$ all belong to $\mathbb{N}$. In other words,
$\left(  2q_{1}+r_{1},2q_{2}+r_{2},\ldots,2q_{n}+r_{n}\right)  \in
\mathbb{N}^{n}$.
\par
Hence, $\left(  2q_{1}+r_{1},2q_{2}+r_{2},\ldots,2q_{n}+r_{n}\right)  $ is an
$n$-tuple $\left(  x_{1},x_{2},\ldots,x_{n}\right)  \in\mathbb{N}^{n}$
satisfying $x_{1}+x_{2}+\cdots+x_{n}=k$ (since%
\[
\left(  2q_{1}+r_{1}\right)  +\left(  2q_{2}+r_{2}\right)  +\cdots+\left(
2q_{n}+r_{n}\right)  =2\left(  q_{1}+q_{2}+\cdots+q_{n}\right)  +\left(
r_{1}+r_{2}+\cdots+r_{n}\right)  =k
\]
). Qed.}. Hence, we can define a map%
\begin{align*}
A:\left\{  \text{nice tables}\right\}   &  \rightarrow\left\{  \left(
x_{1},x_{2},\ldots,x_{n}\right)  \in\mathbb{N}^{n}\text{ }\mid\text{ }%
x_{1}+x_{2}+\cdots+x_{n}=k\right\}  ,\\
\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)   &  \mapsto\left(  2q_{1}+r_{1},2q_{2}+r_{2},\ldots,2q_{n}%
+r_{n}\right)  .
\end{align*}
Consider this map $A$.

Now, if $\left(  x_{1},x_{2},\ldots,x_{n}\right)  \in\mathbb{N}^{n}$ is an
$n$-tuple satisfying $x_{1}+x_{2}+\cdots+x_{n}=k$, then
\[
\left(
\begin{array}
[c]{cccc}%
x_{1}\sslash2 & x_{2}\sslash2 & \cdots & x_{n}\sslash2\\
x_{1}\%2 & x_{2}\%2 & \cdots & x_{n}\%2
\end{array}
\right)
\]
is a nice table\footnote{\textit{Proof.} Let $\left(  x_{1},x_{2},\ldots
,x_{n}\right)  \in\mathbb{N}^{n}$ be an $n$-tuple satisfying $x_{1}%
+x_{2}+\cdots+x_{n}=k$. We have $x_{1},x_{2},\ldots,x_{n}\in\mathbb{N}$ (since
$\left(  x_{1},x_{2},\ldots,x_{n}\right)  \in\mathbb{N}^{n}$). Thus, for each
$i\in\left[  n\right]  $, we have $x_{i}\in\mathbb{N}$ and therefore
$x_{i}\sslash2\in\mathbb{N}$ (by Proposition \ref{prop.quorem.basics}
\textbf{(c)}, applied to $a=x_{i}$ and $b=2$). In other words, the $n$ numbers
$x_{1}\sslash2,x_{2}\sslash2,\ldots,x_{n}\sslash2$ all belong to $\mathbb{N}$.
In other words, $x_{1}\sslash2,x_{2}\sslash2,\ldots,x_{n}\sslash2\in
\mathbb{N}$.
\par
Furthermore, for each $i\in\left[  n\right]  $, we have
\begin{align*}
x_{i}\%2  &  \in\left\{  0,1,\ldots,2-1\right\}  \ \ \ \ \ \ \ \ \ \ \left(
\text{by Proposition \ref{prop.quorem.basics} \textbf{(b)}, applied to
}a=x_{i}\text{ and }b=2\right) \\
&  =\left\{  0,1\right\}  .
\end{align*}
In other words, the $n$ numbers $x_{1}\%2,x_{2}\%2,\ldots,x_{n}\%2$ all belong
to $\left\{  0,1\right\}  $. In other words, $x_{1}\%2,x_{2}\%2,\ldots
,x_{n}\%2\in\left\{  0,1\right\}  $.
\par
Finally, for each $i\in\left[  n\right]  $, we have $x_{i}=\left(
x_{i}\sslash2\right)  \cdot2+\left(  x_{i}\%2\right)  $ (by Proposition
\ref{prop.quorem.basics} \textbf{(a)}, applied to $a=x_{i}$ and $b=2$). In
other words, we have the $n$ equalities%
\begin{align*}
x_{1}  &  =\left(  x_{1}\sslash2\right)  \cdot2+\left(  x_{1}\%2\right)  ,\\
x_{2}  &  =\left(  x_{2}\sslash2\right)  \cdot2+\left(  x_{2}\%2\right)  ,\\
&  \vdots\\
x_{n}  &  =\left(  x_{n}\sslash2\right)  \cdot2+\left(  x_{n}\%2\right)  .
\end{align*}
Adding these $n$ equalities together, we find%
\begin{align*}
&  x_{1}+x_{2}+\cdots+x_{n}\\
&  =\left(  \left(  x_{1}\sslash2\right)  \cdot2+\left(  x_{1}\%2\right)
\right)  +\left(  \left(  x_{2}\sslash2\right)  \cdot2+\left(  x_{2}%
\%2\right)  \right)  +\cdots+\left(  \left(  x_{n}\sslash2\right)
\cdot2+\left(  x_{n}\%2\right)  \right) \\
&  =\left(  \left(  x_{1}\sslash2\right)  +\left(  x_{2}\sslash2\right)
+\cdots+\left(  x_{n}\sslash2\right)  \right)  \cdot2+\left(  \left(
x_{1}\%2\right)  +\left(  x_{2}\%2\right)  +\cdots+\left(  x_{n}\%2\right)
\right) \\
&  =2\left(  \left(  x_{1}\sslash2\right)  +\left(  x_{2}\sslash2\right)
+\cdots+\left(  x_{n}\sslash2\right)  \right)  +\left(  \left(  x_{1}%
\%2\right)  +\left(  x_{2}\%2\right)  +\cdots+\left(  x_{n}\%2\right)
\right)  .
\end{align*}
Comparing this with $x_{1}+x_{2}+\cdots+x_{n}=k$, we obtain%
\[
2\left(  \left(  x_{1}\sslash2\right)  +\left(  x_{2}\sslash2\right)
+\cdots+\left(  x_{n}\sslash2\right)  \right)  +\left(  \left(  x_{1}%
\%2\right)  +\left(  x_{2}\%2\right)  +\cdots+\left(  x_{n}\%2\right)
\right)  =k.
\]
\par
Thus, we have proved that $x_{1}\sslash2,x_{2}\sslash2,\ldots,x_{n}%
\sslash2\in\mathbb{N}$ and $x_{1}\%2,x_{2}\%2,\ldots,x_{n}\%2\in\left\{
0,1\right\}  $ and%
\[
2\left(  \left(  x_{1}\sslash2\right)  +\left(  x_{2}\sslash2\right)
+\cdots+\left(  x_{n}\sslash2\right)  \right)  +\left(  \left(  x_{1}%
\%2\right)  +\left(  x_{2}\%2\right)  +\cdots+\left(  x_{n}\%2\right)
\right)  =k.
\]
In other words,
\[
\left(
\begin{array}
[c]{cccc}%
x_{1}\sslash2 & x_{2}\sslash2 & \cdots & x_{n}\sslash2\\
x_{1}\%2 & x_{2}\%2 & \cdots & x_{n}\%2
\end{array}
\right)
\]
is a $2\times n$-table $\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  $ with $q_{1},q_{2},\ldots,q_{n}\in\mathbb{N}$ and $r_{1}%
,r_{2},\ldots,r_{n}\in\left\{  0,1\right\}  $ satisfying $2\left(  q_{1}%
+q_{2}+\cdots+q_{n}\right)  +\left(  r_{1}+r_{2}+\cdots+r_{n}\right)  =k$. In
other words,
\[
\left(
\begin{array}
[c]{cccc}%
x_{1}\sslash2 & x_{2}\sslash2 & \cdots & x_{n}\sslash2\\
x_{1}\%2 & x_{2}\%2 & \cdots & x_{n}\%2
\end{array}
\right)
\]
is a nice table (because this is how a \textquotedblleft nice
table\textquotedblright\ was defined). Qed.}. Hence, we can define a map%
\begin{align*}
&  B:\left\{  \left(  x_{1},x_{2},\ldots,x_{n}\right)  \in\mathbb{N}^{n}\text{
}\mid\text{ }x_{1}+x_{2}+\cdots+x_{n}=k\right\}  \rightarrow\left\{
\text{nice tables}\right\}  ,\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  x_{1}%
,x_{2},\ldots,x_{n}\right)  \mapsto\left(
\begin{array}
[c]{cccc}%
x_{1}\sslash2 & x_{2}\sslash2 & \cdots & x_{n}\sslash2\\
x_{1}\%2 & x_{2}\%2 & \cdots & x_{n}\%2
\end{array}
\right)  .
\end{align*}
Consider this map $B$.

It is easy to see that $A\circ B=\operatorname*{id}$%
\ \ \ \ \footnote{\textit{Proof.} Let $\mathbf{x}\in\left\{  \left(
x_{1},x_{2},\ldots,x_{n}\right)  \in\mathbb{N}^{n}\text{ }\mid\text{ }%
x_{1}+x_{2}+\cdots+x_{n}=k\right\}  $. Thus, $\mathbf{x}$ can be written in
the form $\mathbf{x}=\left(  x_{1},x_{2},\ldots,x_{n}\right)  $ for some
$\left(  x_{1},x_{2},\ldots,x_{n}\right)  \in\mathbb{N}^{n}$ satisfying
$x_{1}+x_{2}+\cdots+x_{n}=k$. Consider this $\left(  x_{1},x_{2},\ldots
,x_{n}\right)  $. The definition of $B$ yields $B\left(  x_{1},x_{2}%
,\ldots,x_{n}\right)  =\left(
\begin{array}
[c]{cccc}%
x_{1}\sslash2 & x_{2}\sslash2 & \cdots & x_{n}\sslash2\\
x_{1}\%2 & x_{2}\%2 & \cdots & x_{n}\%2
\end{array}
\right)  $. Applying the map $B$ to both sides of the equality $\mathbf{x}%
=\left(  x_{1},x_{2},\ldots,x_{n}\right)  $, we obtain%
\[
B\left(  \mathbf{x}\right)  =B\left(  x_{1},x_{2},\ldots,x_{n}\right)
=\left(
\begin{array}
[c]{cccc}%
x_{1}\sslash2 & x_{2}\sslash2 & \cdots & x_{n}\sslash2\\
x_{1}\%2 & x_{2}\%2 & \cdots & x_{n}\%2
\end{array}
\right)  .
\]
Applying the map $A$ to both sides of this equality, we find%
\begin{align}
A\left(  B\left(  \mathbf{x}\right)  \right)   &  =A\left(  \left(
\begin{array}
[c]{cccc}%
x_{1}\sslash2 & x_{2}\sslash2 & \cdots & x_{n}\sslash2\\
x_{1}\%2 & x_{2}\%2 & \cdots & x_{n}\%2
\end{array}
\right)  \right) \nonumber\\
&  =\left(  2\left(  x_{1}\sslash2\right)  +\left(  x_{1}\%2\right)  ,2\left(
x_{2}\sslash2\right)  +\left(  x_{2}\%2\right)  ,\ldots,2\left(
x_{n}\sslash2\right)  +\left(  x_{n}\%2\right)  \right)
\label{sol.binom.nCk-2i-qedmo.AB.fn.1}%
\end{align}
(by the definition of the map $A$).
\par
On the other hand, for each $i\in\left[  n\right]  $, we have%
\begin{align*}
x_{i}  &  =\left(  x_{i}\sslash2\right)  \cdot2+\left(  x_{i}\%2\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition \ref{prop.quorem.basics}
\textbf{(a)}, applied to }a=x_{i}\text{ and }b=2\right) \\
&  =2\left(  x_{i}\sslash2\right)  +\left(  x_{i}\%2\right)  .
\end{align*}
In other words, we have the $n$ equalities%
\begin{align*}
x_{1}  &  =2\left(  x_{1}\sslash2\right)  +\left(  x_{1}\%2\right)  ,\\
x_{2}  &  =2\left(  x_{2}\sslash2\right)  +\left(  x_{2}\%2\right)  ,\\
&  \vdots\\
x_{n}  &  =2\left(  x_{n}\sslash2\right)  +\left(  x_{n}\%2\right)  .
\end{align*}
Hence,%
\[
\left(  x_{1},x_{2},\ldots,x_{n}\right)  =\left(  2\left(  x_{1}%
\sslash2\right)  +\left(  x_{1}\%2\right)  ,2\left(  x_{2}\sslash2\right)
+\left(  x_{2}\%2\right)  ,\ldots,2\left(  x_{n}\sslash2\right)  +\left(
x_{n}\%2\right)  \right)  .
\]
Comparing this with (\ref{sol.binom.nCk-2i-qedmo.AB.fn.1}), we obtain%
\[
A\left(  B\left(  \mathbf{x}\right)  \right)  =\left(  x_{1},x_{2}%
,\ldots,x_{n}\right)  =\mathbf{x}=\operatorname*{id}\left(  \mathbf{x}\right)
.
\]
Hence, $\left(  A\circ B\right)  \left(  \mathbf{x}\right)  =A\left(  B\left(
\mathbf{x}\right)  \right)  =\operatorname*{id}\left(  \mathbf{x}\right)  $.
\par
Forget that we fixed $\mathbf{x}$. We thus have showed that $\left(  A\circ
B\right)  \left(  \mathbf{x}\right)  =\operatorname*{id}\left(  \mathbf{x}%
\right)  $ for each $\mathbf{x}\in\left\{  \left(  x_{1},x_{2},\ldots
,x_{n}\right)  \in\mathbb{N}^{n}\text{ }\mid\text{ }x_{1}+x_{2}+\cdots
+x_{n}=k\right\}  $. In other words, $A\circ B=\operatorname*{id}$.} and
$B\circ A=\operatorname*{id}$\ \ \ \ \footnote{\textit{Proof.} Let
$\mathbf{T}\in\left\{  \text{nice tables}\right\}  $. We shall show that
$\left(  B\circ A\right)  \left(  \mathbf{T}\right)  =\mathbf{T}$.
\par
We have $\mathbf{T}\in\left\{  \text{nice tables}\right\}  $; in other words,
$\mathbf{T}$ is a nice table. In other words, $\mathbf{T}$ is a $2\times
n$-table $\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  $ with $q_{1},q_{2},\ldots,q_{n}\in\mathbb{N}$ and $r_{1}%
,r_{2},\ldots,r_{n}\in\left\{  0,1\right\}  $ satisfying $2\left(  q_{1}%
+q_{2}+\cdots+q_{n}\right)  +\left(  r_{1}+r_{2}+\cdots+r_{n}\right)  =k$
(since this is how a \textquotedblleft nice table\textquotedblright\ is
defined). Consider these $q_{1},q_{2},\ldots,q_{n}$ and $r_{1},r_{2}%
,\ldots,r_{n}$. Thus,
\begin{equation}
\mathbf{T}=\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  . \label{sol.binom.nCk-2i-qedmo.BA.fn.0}%
\end{equation}
\par
Applying the map $A$ to both sides of this equality, we obtain%
\begin{equation}
A\left(  \mathbf{T}\right)  =A\left(  \left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  \right)  =\left(  2q_{1}+r_{1},2q_{2}+r_{2},\ldots,2q_{n}%
+r_{n}\right)  \label{sol.binom.nCk-2i-qedmo.BA.fn.1}%
\end{equation}
(by the definition of $A$). Define an integer $x_{i}$ by $x_{i}=2q_{i}+r_{i}$
for each $i\in\left[  n\right]  $. Thus,%
\[
\left(  x_{1},x_{2},\ldots,x_{n}\right)  =\left(  2q_{1}+r_{1},2q_{2}%
+r_{2},\ldots,2q_{n}+r_{n}\right)  .
\]
Comparing this with (\ref{sol.binom.nCk-2i-qedmo.BA.fn.1}), we obtain
$A\left(  \mathbf{T}\right)  =\left(  x_{1},x_{2},\ldots,x_{n}\right)  $.
Applying the map $B$ to both sides of this equality, we find%
\begin{equation}
B\left(  A\left(  \mathbf{T}\right)  \right)  =B\left(  x_{1},x_{2}%
,\ldots,x_{n}\right)  =\left(
\begin{array}
[c]{cccc}%
x_{1}\sslash2 & x_{2}\sslash2 & \cdots & x_{n}\sslash2\\
x_{1}\%2 & x_{2}\%2 & \cdots & x_{n}\%2
\end{array}
\right)  \label{sol.binom.nCk-2i-qedmo.BA.fn.2}%
\end{equation}
(by the definition of $B$).
\par
Now, let $i\in\left[  n\right]  $. The definition of $x_{i}$ yields
$x_{i}=2q_{i}+r_{i}=q_{i}\cdot2+r_{i}$. From $q_{1},q_{2},\ldots,q_{n}%
\in\mathbb{N}$, we obtain $q_{i}\in\mathbb{N}\subseteq\mathbb{Z}$. Also, from
$r_{1},r_{2},\ldots,r_{n}\in\left\{  0,1\right\}  $, we obtain $r_{i}%
\in\left\{  0,1\right\}  =\left\{  0,1,\ldots,2-1\right\}  $. Hence,
Proposition \ref{prop.quorem.basics} \textbf{(d)} (applied to $b=2$ and
$q=q_{i}$ and $r=r_{i}$) yields $\left(  q_{i}\cdot2+r_{i}\right)
\sslash2=q_{i}$. In view of $x_{i}=q_{i}\cdot2+r_{i}$, this rewrites as
$x_{i}\sslash2=q_{i}$. Furthermore, Proposition \ref{prop.quorem.basics}
\textbf{(e)} (applied to $b=2$ and $q=q_{i}$ and $r=r_{i}$) yields $\left(
q_{i}\cdot2+r_{i}\right)  \%2=r_{i}$. In view of $x_{i}=q_{i}\cdot2+r_{i}$,
this rewrites as $x_{i}\%2=r_{i}$.
\par
Now, forget that we fixed $i$. We thus have proved that
\[
x_{i}\sslash2=q_{i}\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ x_{i}%
\%2=r_{i}%
\]
for each $i\in\left[  n\right]  $. In other words,%
\[
\left(
\begin{array}
[c]{cccc}%
x_{1}\sslash2 & x_{2}\sslash2 & \cdots & x_{n}\sslash2\\
x_{1}\%2 & x_{2}\%2 & \cdots & x_{n}\%2
\end{array}
\right)  =\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  .
\]
Hence, (\ref{sol.binom.nCk-2i-qedmo.BA.fn.2}) becomes%
\[
B\left(  A\left(  \mathbf{T}\right)  \right)  =\left(
\begin{array}
[c]{cccc}%
x_{1}\sslash2 & x_{2}\sslash2 & \cdots & x_{n}\sslash2\\
x_{1}\%2 & x_{2}\%2 & \cdots & x_{n}\%2
\end{array}
\right)  =\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  =\mathbf{T}%
\]
(by (\ref{sol.binom.nCk-2i-qedmo.BA.fn.0})). Thus, $\left(  B\circ A\right)
\left(  \mathbf{T}\right)  =B\left(  A\left(  \mathbf{T}\right)  \right)
=\mathbf{T}=\operatorname*{id}\left(  \mathbf{T}\right)  $.
\par
Forget that we fixed $\mathbf{T}$. We thus have proved that $\left(  B\circ
A\right)  \left(  \mathbf{T}\right)  =\operatorname*{id}\left(  \mathbf{T}%
\right)  $ for each $\mathbf{T}\in\left\{  \text{nice tables}\right\}  $. In
other words, $B\circ A=\operatorname*{id}$.}. Combining these two equalities,
we conclude that the maps $A$ and $B$ are mutually inverse. Hence, the map $B$
is invertible, i.e., is a bijection. Thus, the bijection principle yields%
\begin{align*}
&  \left\vert \left\{  \left(  x_{1},x_{2},\ldots,x_{n}\right)  \in
\mathbb{N}^{n}\text{ }\mid\text{ }x_{1}+x_{2}+\cdots+x_{n}=k\right\}
\right\vert \\
&  =\left\vert \left\{  \text{nice tables}\right\}  \right\vert .
\end{align*}
In other words,%
\begin{align*}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{n}\right)  \in
\mathbb{N}^{n}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{n}=k\right) \\
&  =\left(  \text{\# of nice tables}\right)  .
\end{align*}
This proves Statement 1.]

The next observation is simpler:

\begin{statement}
\textit{Statement 2:} The top-sum of any nice table belongs to $\left\{
0,1,\ldots,k\right\}  $.
\end{statement}

[\textit{Proof of Statement 2:} Let $\mathbf{T}$ be a nice table. We must show
that the top-sum of $\mathbf{T}$ belongs to $\left\{  0,1,\ldots,k\right\}  $.

We have assumed that $\mathbf{T}$ is a nice table. According to the definition
of a \textquotedblleft nice table\textquotedblright, this means that
$\mathbf{T}$ is a $2\times n$-table $\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  $ with $q_{1},q_{2},\ldots,q_{n}\in\mathbb{N}$ and $r_{1}%
,r_{2},\ldots,r_{n}\in\left\{  0,1\right\}  $ satisfying $2\left(  q_{1}%
+q_{2}+\cdots+q_{n}\right)  +\left(  r_{1}+r_{2}+\cdots+r_{n}\right)  =k$.
Consider these $q_{1},q_{2},\ldots,q_{n}$ and $r_{1},r_{2},\ldots,r_{n}$.
Thus, $\mathbf{T}=\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  $. Hence, the top-sum of $\mathbf{T}$ is $q_{1}+q_{2}+\cdots+q_{n}$
(by the definition of \textquotedblleft top-sum\textquotedblright).

We have $r_{1},r_{2},\ldots,r_{n}\in\left\{  0,1\right\}  $. Thus,
$r_{1},r_{2},\ldots,r_{n}$ are nonnegative integers. Hence, their sum
$r_{1}+r_{2}+\cdots+r_{n}$ is a nonnegative integer. Thus, $r_{1}+r_{2}%
+\cdots+r_{n}\geq0$.

Moreover, from $q_{1},q_{2},\ldots,q_{n}\in\mathbb{N}$, we obtain $q_{1}%
+q_{2}+\cdots+q_{n}\in\mathbb{N}$. Thus, $q_{1}+q_{2}+\cdots+q_{n}\geq0$, so
that%
\[
2\left(  q_{1}+q_{2}+\cdots+q_{n}\right)  \geq q_{1}+q_{2}+\cdots+q_{n}.
\]
But from $2\left(  q_{1}+q_{2}+\cdots+q_{n}\right)  +\left(  r_{1}%
+r_{2}+\cdots+r_{n}\right)  =k$, we obtain%
\begin{align*}
k  &  =2\left(  q_{1}+q_{2}+\cdots+q_{n}\right)  +\underbrace{\left(
r_{1}+r_{2}+\cdots+r_{n}\right)  }_{\geq0}\\
&  \geq2\left(  q_{1}+q_{2}+\cdots+q_{n}\right)  \geq q_{1}+q_{2}+\cdots
+q_{n}.
\end{align*}
In other words, $q_{1}+q_{2}+\cdots+q_{n}\leq k$. Combining this with
$q_{1}+q_{2}+\cdots+q_{n}\in\mathbb{N}$, we obtain $q_{1}+q_{2}+\cdots
+q_{n}\in\left\{  0,1,\ldots,k\right\}  $. In other words, $q_{1}+q_{2}%
+\cdots+q_{n}$ belongs to $\left\{  0,1,\ldots,k\right\}  $. In other words,
the top-sum of $\mathbf{T}$ belongs to $\left\{  0,1,\ldots,k\right\}  $
(since the top-sum of $\mathbf{T}$ is $q_{1}+q_{2}+\cdots+q_{n}$). This
completes the proof of Statement 2.]

Finally, let us count the nice tables with a given top-sum $i\in\left\{
0,1,\ldots,k\right\}  $:

\begin{statement}
\textit{Statement 3:} Let $i\in\left\{  0,1,\ldots,k\right\}  $. Then,%
\[
\left(  \text{\# of nice tables having top-sum }i\right)  =\dbinom{n+i-1}%
{i}\dbinom{n}{k-2i}.
\]

\end{statement}

[\textit{Proof of Statement 3:} Define a set%
\[
Q=\left\{  \left(  x_{1},x_{2},\ldots,x_{n}\right)  \in\mathbb{N}^{n}%
\ \mid\ x_{1}+x_{2}+\cdots+x_{n}=i\right\}  .
\]
Thus,%
\begin{align}
\left\vert Q\right\vert  &  =\left\vert \left\{  \left(  x_{1},x_{2}%
,\ldots,x_{n}\right)  \in\mathbb{N}^{n}\ \mid\ x_{1}+x_{2}+\cdots
+x_{n}=i\right\}  \right\vert \nonumber\\
&  =\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{n}\right)
\in\mathbb{N}^{n}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{n}=i\right)
\nonumber\\
&  =\dbinom{i+n-1}{i}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{eq.thm.binom.wecompos.count.r1})
(applied to }i\text{ and }n\text{ instead of }n\text{ and }k\text{)}\right)
\nonumber\\
&  =\dbinom{n+i-1}{i}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }i+n=n+i\right)
. \label{sol.binom.nCk-2i-qedmo.s3.pf.sizeQ=}%
\end{align}


Define a set%
\[
R=\left\{  \left(  x_{1},x_{2},\ldots,x_{n}\right)  \in\left\{  0,1\right\}
^{n}\ \mid\ x_{1}+x_{2}+\cdots+x_{n}=k-2i\right\}  .
\]
Thus,%
\begin{align}
\left\vert R\right\vert  &  =\left\vert \left\{  \left(  x_{1},x_{2}%
,\ldots,x_{n}\right)  \in\left\{  0,1\right\}  ^{n}\ \mid\ x_{1}+x_{2}%
+\cdots+x_{n}=k-2i\right\}  \right\vert \nonumber\\
&  =\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{n}\right)  \in\left\{
0,1\right\}  ^{n}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{n}=k-2i\right)
\nonumber\\
&  =\dbinom{n}{k-2i}\label{sol.binom.nCk-2i-qedmo.s3.pf.sizeR=}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.binom.bicompos.count}
(applied to }k-2i\text{ and }n\text{ instead of }n\text{ and }k\text{)}%
\right)  .\nonumber
\end{align}


Now, if $\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  $ is a nice table having top-sum $i$, then%
\[
\left(  \left(  q_{1},q_{2},\ldots,q_{n}\right)  ,\left(  r_{1},r_{2}%
,\ldots,r_{n}\right)  \right)  \in Q\times R
\]
\footnote{\textit{Proof.} Let $\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  $ be a nice table having top-sum $i$. We must prove that $\left(
\left(  q_{1},q_{2},\ldots,q_{n}\right)  ,\left(  r_{1},r_{2},\ldots
,r_{n}\right)  \right)  \in Q\times R$.
\par
We know that $\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  $ is a nice table. According to the definition of a \textquotedblleft
nice table\textquotedblright, this means that $q_{1},q_{2},\ldots,q_{n}%
\in\mathbb{N}$ and $r_{1},r_{2},\ldots,r_{n}\in\left\{  0,1\right\}  $ and
$2\left(  q_{1}+q_{2}+\cdots+q_{n}\right)  +\left(  r_{1}+r_{2}+\cdots
+r_{n}\right)  =k$.
\par
Also, we know that the nice table $\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  $ has top-sum $i$. Hence, the top-sum of the nice table $\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  $ is $i$. Thus,%
\[
i=\left(  \text{the top-sum of the nice table }\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  \right)  =q_{1}+q_{2}+\cdots+q_{n}%
\]
(by the definition of \textquotedblleft top-sum\textquotedblright). Thus,
$q_{1}+q_{2}+\cdots+q_{n}=i$. Moreover, from $2\left(  q_{1}+q_{2}%
+\cdots+q_{n}\right)  +\left(  r_{1}+r_{2}+\cdots+r_{n}\right)  =k$, we obtain%
\[
r_{1}+r_{2}+\cdots+r_{n}=k-2\underbrace{\left(  q_{1}+q_{2}+\cdots
+q_{n}\right)  }_{=i}=k-2i.
\]
\par
Now, $\left(  q_{1},q_{2},\ldots,q_{n}\right)  $ is an element of
$\mathbb{N}^{n}$ (since $q_{1},q_{2},\ldots,q_{n}\in\mathbb{N}$) and satisfies
$q_{1}+q_{2}+\cdots+q_{n}=i$. In other words, $\left(  q_{1},q_{2}%
,\ldots,q_{n}\right)  $ is an $\left(  x_{1},x_{2},\ldots,x_{n}\right)
\in\mathbb{N}^{n}$ satisfying $x_{1}+x_{2}+\cdots+x_{n}=i$. In other words,
$\left(  q_{1},q_{2},\ldots,q_{n}\right)  \in\left\{  \left(  x_{1}%
,x_{2},\ldots,x_{n}\right)  \in\mathbb{N}^{n}\ \mid\ x_{1}+x_{2}+\cdots
+x_{n}=i\right\}  $. This rewrites as $\left(  q_{1},q_{2},\ldots
,q_{n}\right)  \in Q$ (since $Q=\left\{  \left(  x_{1},x_{2},\ldots
,x_{n}\right)  \in\mathbb{N}^{n}\ \mid\ x_{1}+x_{2}+\cdots+x_{n}=i\right\}
$).
\par
Also, $\left(  r_{1},r_{2},\ldots,r_{n}\right)  $ is an element of $\left\{
0,1\right\}  ^{n}$ (since $r_{1},r_{2},\ldots,r_{n}\in\left\{  0,1\right\}  $)
and satisfies $r_{1}+r_{2}+\cdots+r_{n}=k-2i$. In other words, $\left(
r_{1},r_{2},\ldots,r_{n}\right)  $ is an $\left(  x_{1},x_{2},\ldots
,x_{n}\right)  \in\left\{  0,1\right\}  ^{n}$ satisfying $x_{1}+x_{2}%
+\cdots+x_{n}=k-2i$. In other words, $\left(  r_{1},r_{2},\ldots,r_{n}\right)
\in\left\{  \left(  x_{1},x_{2},\ldots,x_{n}\right)  \in\left\{  0,1\right\}
^{n}\ \mid\ x_{1}+x_{2}+\cdots+x_{n}=k-2i\right\}  $. This rewrites as
$\left(  r_{1},r_{2},\ldots,r_{n}\right)  \in R$ (since $R=\left\{  \left(
x_{1},x_{2},\ldots,x_{n}\right)  \in\left\{  0,1\right\}  ^{n}\ \mid
\ x_{1}+x_{2}+\cdots+x_{n}=k-2i\right\}  $).
\par
Combining $\left(  q_{1},q_{2},\ldots,q_{n}\right)  \in Q$ with $\left(
r_{1},r_{2},\ldots,r_{n}\right)  \in R$, we obtain $\left(  \left(
q_{1},q_{2},\ldots,q_{n}\right)  ,\left(  r_{1},r_{2},\ldots,r_{n}\right)
\right)  \in Q\times R$. Qed.}. Thus, we can define a map%
\begin{align*}
C:\left\{  \text{nice tables having top-sum }i\right\}   &  \rightarrow
Q\times R,\\
\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)   &  \mapsto\left(  \left(  q_{1},q_{2},\ldots,q_{n}\right)  ,\left(
r_{1},r_{2},\ldots,r_{n}\right)  \right)  .
\end{align*}
Consider this map $C$.

On the other hand, any element of $Q\times R$ has the form $\left(  \left(
q_{1},q_{2},\ldots,q_{n}\right)  ,\left(  r_{1},r_{2},\ldots,r_{n}\right)
\right)  $ for some $\left(  q_{1},q_{2},\ldots,q_{n}\right)  \in
\mathbb{N}^{n}$ and some $\left(  r_{1},r_{2},\ldots,r_{n}\right)  \in\left\{
0,1\right\}  ^{n}$ (since any element of $Q$ has the form $\left(  q_{1}%
,q_{2},\ldots,q_{n}\right)  $ for some $\left(  q_{1},q_{2},\ldots
,q_{n}\right)  \in\mathbb{N}^{n}$, whereas any element of $R$ has the form
$\left(  r_{1},r_{2},\ldots,r_{n}\right)  $ for some $\left(  r_{1}%
,r_{2},\ldots,r_{n}\right)  \in\left\{  0,1\right\}  ^{n}$). For any $\left(
\left(  q_{1},q_{2},\ldots,q_{n}\right)  ,\left(  r_{1},r_{2},\ldots
,r_{n}\right)  \right)  \in Q\times R$, we have%
\[
\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  \in\left\{  \text{nice tables having top-sum }i\right\}
\]
\footnote{\textit{Proof.} Let $\left(  \left(  q_{1},q_{2},\ldots
,q_{n}\right)  ,\left(  r_{1},r_{2},\ldots,r_{n}\right)  \right)  \in Q\times
R$. We must prove that $\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  \in\left\{  \text{nice tables having top-sum }i\right\}  $.
\par
We have $\left(  \left(  q_{1},q_{2},\ldots,q_{n}\right)  ,\left(  r_{1}%
,r_{2},\ldots,r_{n}\right)  \right)  \in Q\times R$. In other words, $\left(
q_{1},q_{2},\ldots,q_{n}\right)  \in Q$ and $\left(  r_{1},r_{2},\ldots
,r_{n}\right)  \in R$.
\par
We have $\left(  q_{1},q_{2},\ldots,q_{n}\right)  \in Q=\left\{  \left(
x_{1},x_{2},\ldots,x_{n}\right)  \in\mathbb{N}^{n}\ \mid\ x_{1}+x_{2}%
+\cdots+x_{n}=i\right\}  $. In other words, $\left(  q_{1},q_{2},\ldots
,q_{n}\right)  $ is an $\left(  x_{1},x_{2},\ldots,x_{n}\right)  \in
\mathbb{N}^{n}$ satisfying $x_{1}+x_{2}+\cdots+x_{n}=i$. In other words,
$\left(  q_{1},q_{2},\ldots,q_{n}\right)  \in\mathbb{N}^{n}$ and $q_{1}%
+q_{2}+\cdots+q_{n}=i$.
\par
We have $\left(  r_{1},r_{2},\ldots,r_{n}\right)  \in R=\left\{  \left(
x_{1},x_{2},\ldots,x_{n}\right)  \in\left\{  0,1\right\}  ^{n}\ \mid
\ x_{1}+x_{2}+\cdots+x_{n}=k-2i\right\}  $. In other words, $\left(
r_{1},r_{2},\ldots,r_{n}\right)  $ is an $\left(  x_{1},x_{2},\ldots
,x_{n}\right)  \in\left\{  0,1\right\}  ^{n}$ satisfying $x_{1}+x_{2}%
+\cdots+x_{n}=k-2i$. In other words, $\left(  r_{1},r_{2},\ldots,r_{n}\right)
\in\left\{  0,1\right\}  ^{n}$ and $r_{1}+r_{2}+\cdots+r_{n}=k-2i$.
\par
Now,%
\[
2\underbrace{\left(  q_{1}+q_{2}+\cdots+q_{n}\right)  }_{=i}%
+\underbrace{\left(  r_{1}+r_{2}+\cdots+r_{n}\right)  }_{=k-2i}=2i+\left(
k-2i\right)  =k.
\]
\par
Now, we have $q_{1},q_{2},\ldots,q_{n}\in\mathbb{N}$ (since $\left(
q_{1},q_{2},\ldots,q_{n}\right)  \in\mathbb{N}^{n}$) and $r_{1},r_{2}%
,\ldots,r_{n}\in\left\{  0,1\right\}  $ (since $\left(  r_{1},r_{2}%
,\ldots,r_{n}\right)  \in\left\{  0,1\right\}  ^{n}$).
\par
Thus, we know that the $2\times n$-table $\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  $ satisfies $q_{1},q_{2},\ldots,q_{n}\in\mathbb{N}$ and $r_{1}%
,r_{2},\ldots,r_{n}\in\left\{  0,1\right\}  $ and $2\left(  q_{1}+q_{2}%
+\cdots+q_{n}\right)  +\left(  r_{1}+r_{2}+\cdots+r_{n}\right)  =k$. In other
words, $\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  $ is a nice table (because this is how a \textquotedblleft nice
table\textquotedblright\ was defined). Furthermore, the top-sum of this nice
table $\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  $ is
\begin{align*}
&  q_{1}+q_{2}+\cdots+q_{n}\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition
of the \textquotedblleft top-sum\textquotedblright}\right) \\
&  =i.
\end{align*}
Hence, $\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  $ is a nice table having top-sum $i$. In other words, $\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  \in\left\{  \text{nice tables having top-sum }i\right\}  $. Qed.}.
Hence, we can define a map%
\begin{align*}
D:Q\times R  &  \rightarrow\left\{  \text{nice tables having top-sum
}i\right\}  ,\\
\left(  \left(  q_{1},q_{2},\ldots,q_{n}\right)  ,\left(  r_{1},r_{2}%
,\ldots,r_{n}\right)  \right)   &  \mapsto\left(
\begin{array}
[c]{cccc}%
q_{1} & q_{2} & \cdots & q_{n}\\
r_{1} & r_{2} & \cdots & r_{n}%
\end{array}
\right)  .
\end{align*}
Consider this map $D$.

The maps $C$ and $D$ are mutually inverse\footnote{\textit{Proof.} This
follows immediately from the definitions of $C$ and $D$.}. Hence, the map $C$
is invertible, i.e., is a bijection. Thus, the bijection principle yields%
\begin{align*}
&  \left\vert \left\{  \text{nice tables having top-sum }i\right\}
\right\vert \\
&  =\left\vert Q\times R\right\vert =\left\vert Q\right\vert \cdot\left\vert
R\right\vert \ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.prodrule2},
applied to }X=Q\text{ and }Y=R\right)  .
\end{align*}
Hence,%
\begin{align*}
&  \left(  \text{\# of nice tables having top-sum }i\right) \\
&  =\left\vert \left\{  \text{nice tables having top-sum }i\right\}
\right\vert \\
&  =\underbrace{\left\vert Q\right\vert }_{\substack{=\dbinom{n+i-1}%
{i}\\\text{(by (\ref{sol.binom.nCk-2i-qedmo.s3.pf.sizeQ=}))}}}\cdot
\underbrace{\left\vert R\right\vert }_{\substack{=\dbinom{n}{k-2i}\\\text{(by
(\ref{sol.binom.nCk-2i-qedmo.s3.pf.sizeR=}))}}}=\dbinom{n+i-1}{i}\dbinom
{n}{k-2i}.
\end{align*}
This proves Statement 3.]

Now, we have almost solved the exercise. Statement 2 shows that the top-sum of
any nice table belongs to $\left\{  0,1,\ldots,k\right\}  $. Hence, the sum
rule (specifically, Theorem \ref{thm.sumrule2}) yields%
\begin{align*}
\left(  \text{\# of nice tables}\right)   &  =\sum_{i\in\left\{
0,1,\ldots,k\right\}  }\underbrace{\left(  \text{\# of nice tables having
top-sum }i\right)  }_{\substack{=\dbinom{n+i-1}{i}\dbinom{n}{k-2i}\\\text{(by
Statement 3)}}}\\
&  =\underbrace{\sum_{i\in\left\{  0,1,\ldots,k\right\}  }}_{=\sum_{i=0}^{k}%
}\dbinom{n+i-1}{i}\dbinom{n}{k-2i}=\sum_{i=0}^{k}\dbinom{n+i-1}{i}\dbinom
{n}{k-2i}.
\end{align*}
But Statement 1 yields%
\begin{align*}
&  \left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{n}\right)  \in
\mathbb{N}^{n}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{n}=k\right) \\
&  =\left(  \text{\# of nice tables}\right)  =\sum_{i=0}^{k}\dbinom{n+i-1}%
{i}\dbinom{n}{k-2i}.
\end{align*}
Comparing this with (\ref{sol.binom.nCk-2i-qedmo.count1}), we find%
\[
\sum_{i=0}^{k}\dbinom{n+i-1}{i}\dbinom{n}{k-2i}=\dbinom{n+k-1}{k}.
\]
This solves Exercise \ref{exe.binom.nCk-2i-qedmo}.
\end{proof}

\subsection{Solution to Exercise \ref{exe.binom.nCk-2i-qedmo-gen}}

Exercise \ref{exe.binom.nCk-2i-qedmo-gen} wants us to generalize Exercise
\ref{exe.binom.nCk-2i-qedmo} to all $n\in\mathbb{R}$. Here is this generalization:

\begin{proposition}
\label{prop.binom.nCk-2i-qedmo-gen}Let $n\in\mathbb{R}$ and $k\in\mathbb{N}$.
Prove that
\[
\sum_{i=0}^{k}\dbinom{n+i-1}{i}\dbinom{n}{k-2i}=\dbinom{n+k-1}{k}.
\]

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.binom.nCk-2i-qedmo-gen}.]For each
$x\in\mathbb{N}$, we have%
\begin{equation}
\sum_{i=0}^{k}\dbinom{x+i-1}{i}\dbinom{x}{k-2i}=\dbinom{x+k-1}{k}
\label{pf.prop.binom.nCk-2i-qedmo-gen.1}%
\end{equation}
(by Exercise \ref{exe.binom.nCk-2i-qedmo} (applied to $x$ instead of $n$)).

Define two polynomials $P$ and $Q$ (in $1$ variable $X$, with real
coefficients) by%
\[
P=\sum_{i=0}^{k}\dbinom{X+i-1}{i}\dbinom{X}{k-2i}%
\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ Q=\dbinom{X+k-1}{k}.
\]
These are well-defined polynomials\footnote{They can be written explicitly as
follows:%
\begin{align*}
P  &  =\sum_{i=0}^{k}\dbinom{X+i-1}{i}\dbinom{X}{k-2i}\\
&  =\sum_{i=0}^{k}\dfrac{\left(  X+i-1\right)  \left(  X+i-2\right)
\cdots\left(  X+1\right)  X}{i!}\\
&  \ \ \ \ \ \ \ \ \ \ \cdot%
\begin{cases}
\dfrac{X\left(  X-1\right)  \left(  X-2\right)  \cdots\left(  X-\left(
k-2i\right)  +1\right)  }{\left(  k-2i\right)  !}, & \text{if }k-2i\in
\mathbb{N};\\
0, & \text{if }k-2i\notin\mathbb{N}%
\end{cases}
\end{align*}
and%
\[
Q=\dbinom{X+k-1}{k}=\dfrac{\left(  X+k-1\right)  \left(  X+k-2\right)
\cdots\left(  X+1\right)  X}{k!}.
\]
}.

Now, for each $x\in\mathbb{R}$, we have%
\[
Q\left(  x\right)  =\dbinom{x+k-1}{k}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
Proposition \ref{prop.polidtrick.subst-into-bin}, since }Q=\dbinom{X+k-1}%
{k}\right)
\]
and%
\[
P\left(  x\right)  =\sum_{i=0}^{k}\dbinom{x+i-1}{i}\dbinom{x}{k-2i}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{likewise}\right)  .
\]
In view of these two equalities, we can rewrite
(\ref{pf.prop.binom.nCk-2i-qedmo-gen.1}) as%
\[
P\left(  x\right)  =Q\left(  x\right)  .
\]
Hence, we know that $P\left(  x\right)  =Q\left(  x\right)  $ holds for all
$x\in\mathbb{N}$ (because we know that (\ref{pf.prop.binom.nCk-2i-qedmo-gen.1}%
) holds for all $x\in\mathbb{N}$). Therefore, Corollary \ref{cor.polidtrick-c}
yields $P=Q$. Thus, $P\left(  x\right)  =Q\left(  x\right)  $ for all
$x\in\mathbb{R}$. In other words,
\[
\sum_{i=0}^{k}\dbinom{x+i-1}{i}\dbinom{x}{k-2i}=\dbinom{x+k-1}{k}%
\]
for all $x\in\mathbb{R}$ (since $Q\left(  x\right)  =\dbinom{x+k-1}{k}$ and
$P\left(  x\right)  =\sum_{i=0}^{k}\dbinom{x+i-1}{i}\dbinom{x}{k-2i}$ for each
$x\in\mathbb{R}$). Applying this to $x=n$, we obtain%
\[
\sum_{i=0}^{k}\dbinom{n+i-1}{i}\dbinom{n}{k-2i}=\dbinom{n+k-1}{k}.
\]
This proves Proposition \ref{prop.binom.nCk-2i-qedmo-gen}.
\end{proof}

Thus, Exercise \ref{exe.binom.nCk-2i-qedmo-gen} is solved.

\subsection{Solution to Exercise \ref{exe.binom.compos.sum-len}}

Exercise \ref{exe.binom.compos.sum-len} is \cite[Exercise 6]{18s-mt2s}, and
two solutions can be found on
\href{http://www.cip.ifi.lmu.de/~grinberg/t/18s/}{the course website}
(\href{http://www.cip.ifi.lmu.de/~grinberg/t/18s/mt2s-gorski.pdf}{1} and
\href{http://www.cip.ifi.lmu.de/~grinberg/t/18s/mt2s-olson.pdf}{2}). Let us
give another, based on the following lemma:

\begin{lemma}
\label{lem.binom.compos.sum-len-binom}Let $n$ be a positive integer. Then,%
\[
\sum\limits_{k=0}^{n}k\dbinom{n-1}{k-1}=\left(  n+1\right)  2^{n-2}.
\]

\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.binom.compos.sum-len-binom}.]We have $n-1\in
\mathbb{N}$ (since $n$ is a positive integer).

We can split off the addend for $k=0$ from the sum $\sum\limits_{k=0}%
^{n}k\dbinom{n-1}{k-1}$. This yields%
\begin{align*}
\sum\limits_{k=0}^{n}k\dbinom{n-1}{k-1}  &  =\underbrace{0\dbinom{n-1}{0-1}%
}_{=0}+\sum\limits_{k=1}^{n}k\dbinom{n-1}{k-1}=\sum\limits_{k=1}^{n}%
k\dbinom{n-1}{k-1}\\
&  =\sum\limits_{k=0}^{n-1}\left(  k+1\right)  \underbrace{\dbinom
{n-1}{\left(  k+1\right)  -1}}_{=\dbinom{n-1}{k}}\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have
substituted }k+1\text{ for }k\text{ in the sum}\right) \\
&  =\sum\limits_{k=0}^{n-1}\underbrace{\left(  k+1\right)  \dbinom{n-1}{k}%
}_{=k\dbinom{n-1}{k}+\dbinom{n-1}{k}}=\sum\limits_{k=0}^{n-1}\left(
k\dbinom{n-1}{k}+\dbinom{n-1}{k}\right) \\
&  =\underbrace{\sum\limits_{k=0}^{n-1}k\dbinom{n-1}{k}}_{\substack{=\left(
n-1\right)  \cdot2^{\left(  n-1\right)  -1}\\\text{(by Exercise
\ref{exe.binom.knCk},}\\\text{applied to }n-1\text{ instead of }n\text{)}%
}}+\underbrace{\sum\limits_{k=0}^{n-1}\dbinom{n-1}{k}}_{\substack{=2^{n-1}%
\\\text{(by Corollary \ref{cor.binom.2pown},}\\\text{applied to }n-1\text{
instead of }n\text{)}}}\\
&  =\left(  n-1\right)  \cdot\underbrace{2^{\left(  n-1\right)  -1}}%
_{=2^{n-2}}+\underbrace{2^{n-1}}_{=2\cdot2^{n-2}}=\left(  n-1\right)
\cdot2^{n-2}+2\cdot2^{n-2}\\
&  =\underbrace{\left(  \left(  n-1\right)  +2\right)  }_{=n+1}2^{n-2}=\left(
n+1\right)  2^{n-2}.
\end{align*}
This proves Lemma \ref{lem.binom.compos.sum-len-binom}.
\end{proof}

\begin{proof}
[Solution to Exercise \ref{exe.binom.compos.sum-len}.]Let $\mathbb{P}=\left\{
1,2,3,\ldots\right\}  $ be the set of all positive integers.

If $\alpha$ is any composition of $n$, then $\left(  \text{the length of
}\alpha\right)  \in\left\{  0,1,\ldots,n\right\}  $%
\ \ \ \ \footnote{\textit{Proof.} Let $\alpha$ be a composition of $n$.
\par
Write $\alpha$ in the form $\alpha=\left(  x_{1},x_{2},\ldots,x_{k}\right)  $.
Then, $\alpha$ is a $k$-tuple; thus, the length of $\alpha$ is $k$ (by the
definition of \textquotedblleft length\textquotedblright). But $\alpha$ is a
composition of $n$; in other words, $\left(  x_{1},x_{2},\ldots,x_{k}\right)
$ is a composition of $n$ (since $\alpha=\left(  x_{1},x_{2},\ldots
,x_{k}\right)  $). Hence, Proposition \ref{lem.compos.lenleq} yields $k\leq
n$. Thus, $k$ is an element of $\left\{  0,1,\ldots,n\right\}  $ (since
$k\in\mathbb{N}$). In other words, the length of $\alpha$ is an element of
$\left\{  0,1,\ldots,n\right\}  $ (since the length of $\alpha$ is $k$). In
other words, $\left(  \text{the length of }\alpha\right)  \in\left\{
0,1,\ldots,n\right\}  $. Qed.}.

Let $k\in\mathbb{N}$. Then, a $k$-tuple of positive integers is the same as an
element of $\mathbb{P}^{k}$ (since $\mathbb{P}$ is the set of all positive integers).

Recall that a composition of $n$ is the same as a tuple of positive integers
whose sum is $n$ (by the definition of a \textquotedblleft composition of
$n$\textquotedblright). Hence,
\begin{align*}
&  \left\{  \alpha\text{ is a composition of }n\ \mid\ \left(  \text{the
length of }\alpha\right)  =k\right\} \\
&  =\left\{  \alpha\text{ is a tuple of positive integers whose sum is
}n\ \mid\ \left(  \text{the length of }\alpha\right)  =k\right\} \\
&  =\left\{  \alpha\text{ is a tuple of positive integers whose sum is
}n\ \mid\ \alpha\text{ is a }k\text{-tuple}\right\} \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{because a tuple }\alpha\text{ satisfies }\left(  \text{the length of
}\alpha\right)  =k\text{ if and only if}\\
\text{it is a }k\text{-tuple}%
\end{array}
\right) \\
&  =\left\{  \alpha\text{ is a }k\text{-tuple of positive integers whose sum
is }n\right\} \\
&  =\left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \text{ is a
}k\text{-tuple of positive integers whose sum is }n\right\} \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have renamed the index }%
\alpha\text{ as }\left(  x_{1},x_{2},\ldots,x_{k}\right)  \right) \\
&  =\left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \text{ is a
}k\text{-tuple of positive integers }\mid\ x_{1}+x_{2}+\cdots+x_{k}=n\right\}
\\
&  =\left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in\mathbb{P}^{k}\text{
}\mid\ x_{1}+x_{2}+\cdots+x_{k}=n\right\} \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since a }k\text{-tuple of positive
integers is the same as an element of }\mathbb{P}^{k}\right)  .
\end{align*}
Therefore,%
\begin{align}
&  \left\vert \left\{  \alpha\text{ is a composition of }n\ \mid\ \left(
\text{the length of }\alpha\right)  =k\right\}  \right\vert \nonumber\\
&  =\left\vert \left\{  \left(  x_{1},x_{2},\ldots,x_{k}\right)  \in
\mathbb{P}^{k}\text{ }\mid\ x_{1}+x_{2}+\cdots+x_{k}=n\right\}  \right\vert
\nonumber\\
&  =\left(  \text{\# of }\left(  x_{1},x_{2},\ldots,x_{k}\right)
\in\mathbb{P}^{k}\text{ satisfying }x_{1}+x_{2}+\cdots+x_{k}=n\right)
\nonumber\\
&  =%
\begin{cases}
\dbinom{n-1}{k-1}, & \text{if }n>0;\\
\left[  k=0\right]  , & \text{if }n=0
\end{cases}
\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{eq.thm.binom.compos.count.r2}%
)}\right) \nonumber\\
&  =\dbinom{n-1}{k-1}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }n>0\right)  .
\label{sol.binom.compos.sum-len.4}%
\end{align}


Forget that we fixed $k$. We thus have proved
(\ref{sol.binom.compos.sum-len.4}) for each $k\in\mathbb{N}$.

Now,%
\begin{align*}
&  \left(  \text{the sum of the lengths of all compositions of }n\right) \\
&  =\sum_{\alpha\text{ is a composition of }n}\left(  \text{the length of
}\alpha\right) \\
&  =\sum_{k\in\left\{  0,1,\ldots,n\right\}  }\ \ \sum_{\substack{\alpha\text{
is a composition of }n;\\\left(  \text{the length of }\alpha\right)
=k}}\underbrace{\left(  \text{the length of }\alpha\right)  }_{=k}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by (\ref{eq.sum.sheph}), because if }\alpha\text{ is any composition of
}n\text{,}\\
\text{then }\left(  \text{the length of }\alpha\right)  \in\left\{
0,1,\ldots,n\right\}
\end{array}
\right) \\
&  =\sum_{k\in\left\{  0,1,\ldots,n\right\}  }\ \ \underbrace{\sum
_{\substack{\alpha\text{ is a composition of }n;\\\left(  \text{the length of
}\alpha\right)  =k}}k}_{=\left\vert \left\{  \alpha\text{ is a composition of
}n\ \mid\ \left(  \text{the length of }\alpha\right)  =k\right\}  \right\vert
\cdot k}\\
&  =\underbrace{\sum_{k\in\left\{  0,1,\ldots,n\right\}  }}_{=\sum_{k=0}^{n}%
}\underbrace{\left\vert \left\{  \alpha\text{ is a composition of }%
n\ \mid\ \left(  \text{the length of }\alpha\right)  =k\right\}  \right\vert
}_{\substack{=\dbinom{n-1}{k-1}\\\text{(by (\ref{sol.binom.compos.sum-len.4}%
))}}}\cdot\, k\\
&  =\sum_{k=0}^{n}\dbinom{n-1}{k-1}\cdot k=\sum_{k=0}^{n}k\dbinom{n-1}%
{k-1}=\left(  n+1\right)  2^{n-2}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Lemma
\ref{lem.binom.compos.sum-len-binom}}\right)  .
\end{align*}
This solves Exercise \ref{exe.binom.compos.sum-len}.
\end{proof}

\subsection{Solution to Exercise \ref{exe.mulsub.size1}}

Before we solve Exercise \ref{exe.mulsub.size1}, let us recall the definition
of the multisubset \newline$\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}$:

\begin{definition}
\label{def.mulsub.a1a2ak}Let $T$ be a set. Let $k\in\mathbb{N}$. Let
$a_{1},a_{2},\ldots,a_{k}$ be any $k$ elements of $T$ (not necessarily
distinct). Then, $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}$ is the multisubset of $T$ defined as the map
\begin{align*}
T  &  \rightarrow\mathbb{N},\\
t  &  \mapsto\left(  \text{\# of }i\in\left[  k\right]  \text{ satisfying
}a_{i}=t\right)  .
\end{align*}

\end{definition}

Indeed, Definition \ref{def.mulsub.a1a2ak} is simply a restatement of the last
sentence of Definition \ref{def.mulsub} \textbf{(c)}.

\begin{proof}
[Solution to Exercise \ref{exe.mulsub.size1}.]Definition
\ref{def.mulsub.a1a2ak} shows that $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}$ is the multisubset of $T$ defined as the map
\begin{align*}
T  &  \rightarrow\mathbb{N},\\
t  &  \mapsto\left(  \text{\# of }i\in\left[  k\right]  \text{ satisfying
}a_{i}=t\right)  .
\end{align*}
Let us denote this map by $f$. Thus, $\left\{  a_{1},a_{2},\ldots
,a_{k}\right\}  _{\operatorname*{multi}}=f$. Hence,%
\begin{align*}
\left(  \text{the size of }\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}\right)   &  =\left(  \text{the size of }f\right) \\
&  =\sum_{t\in T}\underbrace{f\left(  t\right)  }_{\substack{=\left(  \text{\#
of }i\in\left[  k\right]  \text{ satisfying }a_{i}=t\right)  \\\text{(by the
definition of }f\text{)}}}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Definition
\ref{def.mulsub.size}}\right) \\
&  =\sum_{t\in T}\left(  \text{\# of }i\in\left[  k\right]  \text{ satisfying
}a_{i}=t\right)  .
\end{align*}
Comparing this with%
\begin{align*}
k  &  =\left\vert \left[  k\right]  \right\vert \ \ \ \ \ \ \ \ \ \ \left(
\text{since }\left[  k\right]  =\left\{  1,2,\ldots,k\right\}  \text{ is a
}k\text{-element set}\right) \\
&  =\sum_{t\in T}\left(  \text{\# of }i\in\left[  k\right]  \text{ satisfying
}a_{i}=t\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the sum rule (Theorem
\ref{thm.sumrule2}), since }a_{i}\in T\text{ for each }i\in\left[  k\right]
\right)  ,
\end{align*}
we obtain $\left(  \text{the size of }\left\{  a_{1},a_{2},\ldots
,a_{k}\right\}  _{\operatorname*{multi}}\right)  =k$. In other words, the
multisubset $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}$ of $T$ has size $k$. This solves Exercise
\ref{exe.mulsub.size1}.
\end{proof}

\subsection{\label{sect.sol.prop.mulsub.inclist}Solution to Exercise
\ref{exe.prop.mulsub.inclist}}

Exercise \ref{exe.prop.mulsub.inclist} asks us to prove Proposition
\ref{prop.mulsub.inclist} and Proposition \ref{prop.mulsub.inclist-k}. We
shall prove Proposition \ref{prop.mulsub.inclist} first. This proof will
imitate the proof of Proposition \ref{prop.intset.inclist} that is given in
\cite[proof of Theorem 2.46]{detnotes}. First, however, we need to build up
some basics of the theory of multisubsets. Since these fundamental
constructions are hard to find in the mathematical literature, I will do them
in detail; very little (if anything) in them is non-obvious.

We recall that multisubsets of a set $T$ have been defined as (certain) maps
from $T$ to $\mathbb{N}$. Even if we can think of them as analogues of sets,
they are thus (formally speaking) maps. Hence, we will tend to use letters
like $f,g,h$ (rather than $S$ or $A$) for them in this section.

\begin{definition}
\label{def.mulsub.absf=}Let $T$ be a set. Let $f$ be any multisubset of $T$.
Then, we let $\left\vert f\right\vert $ denote the size of $f$. Thus,%
\begin{equation}
\left\vert f\right\vert =\left(  \text{the size of }f\right)  =\sum
\limits_{t\in T}f\left(  t\right)  \label{eq.def.mulsub.absf=.1}%
\end{equation}
(by the definition of the size of a multisubset).
\end{definition}

Let us next define a concept of inclusion for multisubsets of $T$:

\begin{definition}
\label{def.mulsub.inc}Let $T$ be a set. Let $f$ and $g$ be two multisubsets of
$T$. Then, we shall say that $f\subseteq g$ if and only if each $t\in T$
satisfies $f\left(  t\right)  \leq g\left(  t\right)  $.
\end{definition}

Thus, we have defined a relation \textquotedblleft$\subseteq$%
\textquotedblright\ between multisubsets of $T$. It is an analogue of the
relation \textquotedblleft$\subseteq$\textquotedblright\ between sets, but it
takes the multiplicities into account: Two multisubsets $f$ and $g$ of $T$
satisfy $f\subseteq g$ if and only if each element of $T$ appears at most as
often in $f$ as it appears in $g$. For example, we have $\left\{
1,3,3,5,6\right\}  _{\operatorname*{multi}}\subseteq\left\{
1,1,3,3,3,5,6,7\right\}  _{\operatorname*{multi}}$, but we don't have
$\left\{  1,3,3,5\right\}  _{\operatorname*{multi}}\subseteq\left\{
1,1,3,5,5\right\}  _{\operatorname*{multi}}$.

\begin{definition}
\label{def.mulsub.union}Let $T$ be a set. Let $f$ and $g$ be two multisubsets
of $T$. Then, the map%
\begin{align*}
T  &  \rightarrow\mathbb{N},\\
t  &  \mapsto f\left(  t\right)  +g\left(  t\right)
\end{align*}
is a multisubset of $T$ (by Proposition \ref{prop.mulsub.union.size}
\textbf{(a)} below). This multisubset of $T$ will be denoted by $f\cup g$.
\end{definition}

The multisubset $f\cup g$ is an analogue of the union of two sets, but it
takes the multiplicities into account: If an element of $T$ appears $a$ times
in $f$ and appears $b$ times in $g$, then it appears $a+b$ times in $f\cup g$.
For example, $\left\{  1,3,4,4,5\right\}  _{\operatorname*{multi}}\cup\left\{
2,3,4\right\}  _{\operatorname*{multi}}=\left\{  1,2,3,3,4,4,4,5\right\}
_{\operatorname*{multi}}$.

Let us prove a few properties of this \textquotedblleft multisubset
union\textquotedblright\ $f\cup g$:

\begin{proposition}
\label{prop.mulsub.union.size}Let $T$ be a set. Let $f$ and $g$ be two
multisubsets of $T$. Then:

\textbf{(a)} The map%
\begin{align*}
T  &  \rightarrow\mathbb{N},\\
t  &  \mapsto f\left(  t\right)  +g\left(  t\right)
\end{align*}
is a multisubset of $T$.

\textbf{(b)} We have $\left\vert f\cup g\right\vert =\left\vert f\right\vert
+\left\vert g\right\vert $.

\textbf{(c)} We have $f\subseteq f\cup g$ and $g\subseteq f\cup g$.

\textbf{(d)} We have $f\cup g=g\cup f$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.mulsub.union.size}.]We know that $f$ and $g$
are multisubsets of $T$; thus, $f$ and $g$ are maps from $T$ to $\mathbb{N}$.

We know that $f$ is a multisubset of $T$. According to Definition
\ref{def.mulsub} \textbf{(a)}, this means that only finitely many $t\in T$
satisfy $f\left(  t\right)  \neq0$. Hence, we know that only finitely many
$t\in T$ satisfy $f\left(  t\right)  \neq0$. In other words, the set $\left\{
t\in T\ \mid\ f\left(  t\right)  \neq0\right\}  $ is finite. Similarly, the
set $\left\{  t\in T\ \mid\ g\left(  t\right)  \neq0\right\}  $ is finite.

\textbf{(a)} We know that $f$ and $g$ are maps from $T$ to $\mathbb{N}$.
Hence, each $t\in T$ satisfies $f\left(  t\right)  \in\mathbb{N}$ and
$g\left(  t\right)  \in\mathbb{N}$ and therefore $f\left(  t\right)  +g\left(
t\right)  \in\mathbb{N}$. Thus, the map%
\begin{align*}
T  &  \rightarrow\mathbb{N},\\
t  &  \mapsto f\left(  t\right)  +g\left(  t\right)
\end{align*}
is well-defined. Moreover, it is easy to see that this map is a multisubset of
$T$\ \ \ \ \footnote{\textit{Proof.} We need to show that the map
\begin{align*}
T  &  \rightarrow\mathbb{N},\\
t  &  \mapsto f\left(  t\right)  +g\left(  t\right)
\end{align*}
is a multisubset of $T$. According to Definition \ref{def.mulsub}
\textbf{(a)}, this means showing that only finitely many $t\in T$ satisfy
$f\left(  t\right)  +g\left(  t\right)  \neq0$. Thus, we need to show that
only finitely many $t\in T$ satisfy $f\left(  t\right)  +g\left(  t\right)
\neq0$. In other words, we need to show that the set $\left\{  t\in
T\ \mid\ f\left(  t\right)  +g\left(  t\right)  \neq0\right\}  $ is finite.
\par
Let $s\in\left\{  t\in T\ \mid\ f\left(  t\right)  +g\left(  t\right)
\neq0\right\}  $. We shall show that $s\in\left\{  t\in T\ \mid\ f\left(
t\right)  \neq0\right\}  \cup\left\{  t\in T\ \mid\ g\left(  t\right)
\neq0\right\}  $.
\par
Indeed, assume the contrary. Hence, $s\notin\left\{  t\in T\ \mid\ f\left(
t\right)  \neq0\right\}  \cup\left\{  t\in T\ \mid\ g\left(  t\right)
\neq0\right\}  $. In other words, we have both $s\notin\left\{  t\in
T\ \mid\ f\left(  t\right)  \neq0\right\}  $ and $s\notin\left\{  t\in
T\ \mid\ g\left(  t\right)  \neq0\right\}  $.
\par
But $s\in\left\{  t\in T\ \mid\ f\left(  t\right)  +g\left(  t\right)
\neq0\right\}  $. Thus, $s$ is a $t\in T$ satisfying $f\left(  t\right)
+g\left(  t\right)  \neq0$. In other words, $s\in T$ and $f\left(  s\right)
+g\left(  s\right)  \neq0$.
\par
If we had $f\left(  s\right)  \neq0$, then $s$ would be an element $t\in T$
satisfying $f\left(  t\right)  \neq0$, and therefore we would have
$s\in\left\{  t\in T\ \mid\ f\left(  t\right)  \neq0\right\}  $; but this
would contradict $s\notin\left\{  t\in T\ \mid\ f\left(  t\right)
\neq0\right\}  $. Hence, we cannot have $f\left(  s\right)  \neq0$. Thus, we
must have $f\left(  s\right)  =0$. Similarly, $g\left(  s\right)  =0$. Hence,
$\underbrace{f\left(  s\right)  }_{=0}+\underbrace{g\left(  s\right)  }%
_{=0}=0$, which contradicts $f\left(  s\right)  +g\left(  s\right)  \neq0$.
\par
This contradiction shows that our assumption was false. Hence, $s\in\left\{
t\in T\ \mid\ f\left(  t\right)  \neq0\right\}  \cup\left\{  t\in
T\ \mid\ g\left(  t\right)  \neq0\right\}  $ is proved.
\par
Now, forget that we fixed $s$. We thus have proved that $s\in\left\{  t\in
T\ \mid\ f\left(  t\right)  \neq0\right\}  \cup\left\{  t\in T\ \mid\ g\left(
t\right)  \neq0\right\}  $ for each $s\in\left\{  t\in T\ \mid\ f\left(
t\right)  +g\left(  t\right)  \neq0\right\}  $. In other words,
\[
\left\{  t\in T\ \mid\ f\left(  t\right)  +g\left(  t\right)  \neq0\right\}
\text{ is a subset of }\left\{  t\in T\ \mid\ f\left(  t\right)
\neq0\right\}  \cup\left\{  t\in T\ \mid\ g\left(  t\right)  \neq0\right\}  .
\]
But the set $\left\{  t\in T\ \mid\ f\left(  t\right)  \neq0\right\}
\cup\left\{  t\in T\ \mid\ g\left(  t\right)  \neq0\right\}  $ is finite
(since it is the union of the two finite sets $\left\{  t\in T\ \mid\ f\left(
t\right)  \neq0\right\}  $ and $\left\{  t\in T\ \mid\ g\left(  t\right)
\neq0\right\}  $). Hence, its subset $\left\{  t\in T\ \mid\ f\left(
t\right)  +g\left(  t\right)  \neq0\right\}  $ must be finite as well (since a
subset of a finite set is always finite). In other words, only finitely many
$t\in T$ satisfy $f\left(  t\right)  +g\left(  t\right)  \neq0$. In other
words, the map
\begin{align*}
T  &  \rightarrow\mathbb{N},\\
t  &  \mapsto f\left(  t\right)  +g\left(  t\right)
\end{align*}
is a multisubset of $T$. Qed.}. This proves Proposition
\ref{prop.mulsub.union.size} \textbf{(a)}.

\textbf{(b)} The equality (\ref{eq.def.mulsub.absf=.1}) yields $\left\vert
f\right\vert =\sum_{t\in T}f\left(  t\right)  $. Also, applying
(\ref{eq.def.mulsub.absf=.1}) to $g$ instead of $f$, we find $\left\vert
g\right\vert =\sum_{t\in T}g\left(  t\right)  $. Adding these two equalities
together, we obtain%
\[
\left\vert f\right\vert +\left\vert g\right\vert =\sum_{t\in T}f\left(
t\right)  +\sum_{t\in T}g\left(  t\right)  =\sum_{t\in T}\left(  f\left(
t\right)  +g\left(  t\right)  \right)  .
\]
Comparing this with%
\begin{align*}
\left\vert f\cup g\right\vert  &  =\sum\limits_{t\in T}\underbrace{\left(
f\cup g\right)  \left(  t\right)  }_{\substack{=f\left(  t\right)  +g\left(
t\right)  \\\text{(by the definition of }f\cup g\text{)}}%
}\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{eq.def.mulsub.absf=.1}), applied
to }f\cup g\text{ instead of }f\right) \\
&  =\sum_{t\in T}\left(  f\left(  t\right)  +g\left(  t\right)  \right)  ,
\end{align*}
we obtain $\left\vert f\cup g\right\vert =\left\vert f\right\vert +\left\vert
g\right\vert $. This proves Proposition \ref{prop.mulsub.union.size}
\textbf{(b)}.

\textbf{(c)} Each $t\in T$ satisfies%
\begin{align*}
\left(  f\cup g\right)  \left(  t\right)   &  =f\left(  t\right)
+\underbrace{g\left(  t\right)  }_{\substack{\geq0\\\text{(since }g\left(
t\right)  \in\mathbb{N}\\\text{(because }g\text{ is a map from }T\text{ to
}\mathbb{N}\text{))}}}\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of
}f\cup g\right) \\
&  \geq f\left(  t\right)  .
\end{align*}
In other words, each $t\in T$ satisfies $f\left(  t\right)  \leq\left(  f\cup
g\right)  \left(  t\right)  $. In other words, $f\subseteq f\cup g$ (according
to Definition \ref{def.mulsub.inc}). An analogous argument shows that
$g\subseteq f\cup g$. Hence, Proposition \ref{prop.mulsub.union.size}
\textbf{(c)} is proved.

\textbf{(d)} For each $t\in T$, we have
\begin{equation}
\left(  f\cup g\right)  \left(  t\right)  =f\left(  t\right)  +g\left(
t\right)  \label{pf.prop.mulsub.union.size.c.1}%
\end{equation}
(by the definition of $f\cup g$) and
\begin{equation}
\left(  g\cup f\right)  \left(  t\right)  =g\left(  t\right)  +f\left(
t\right)  \label{pf.prop.mulsub.union.size.c.2}%
\end{equation}
(by the definition of $g\cup f$). Hence, for each $t\in T$, we have%
\begin{align*}
\left(  f\cup g\right)  \left(  t\right)   &  =f\left(  t\right)  +g\left(
t\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.prop.mulsub.union.size.c.1})}\right) \\
&  =g\left(  t\right)  +f\left(  t\right)  =\left(  g\cup f\right)  \left(
t\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.prop.mulsub.union.size.c.2})}\right)  .
\end{align*}
In other words, $f\cup g=g\cup f$ (since both $f\cup g$ and $g\cup f$ are maps
from $T$ to $\mathbb{N}$). This proves Proposition
\ref{prop.mulsub.union.size} \textbf{(d)}.
\end{proof}

\begin{proposition}
\label{prop.mulsub.union.list}Let $T$ be a set. Let $k\in\mathbb{N}$ and
$\ell\in\mathbb{N}$. Let $a_{1},a_{2},\ldots,a_{k}$ be any $k$ elements of $T$
(not necessarily distinct). Let $b_{1},b_{2},\ldots,b_{\ell}$ be any $\ell$
elements of $T$ (not necessarily distinct). Then,%
\[
\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}%
\cup\left\{  b_{1},b_{2},\ldots,b_{\ell}\right\}  _{\operatorname*{multi}%
}=\left\{  a_{1},a_{2},\ldots,a_{k},b_{1},b_{2},\ldots,b_{\ell}\right\}
_{\operatorname*{multi}}.
\]

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.mulsub.union.list}.]Definition
\ref{def.mulsub.a1a2ak} says that $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}$ is the multisubset of $T$ defined as the map
\begin{align*}
T  &  \rightarrow\mathbb{N},\\
t  &  \mapsto\left(  \text{\# of }i\in\left[  k\right]  \text{ satisfying
}a_{i}=t\right)  .
\end{align*}
Hence, for each $t\in T$, we have\footnote{Recall that any multisubset of $T$
is a map from $T$ to $\mathbb{N}$. Hence, for example, the multisubset
$\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}$ of $T$
is a map from $T$ to $\mathbb{N}$, and thus can be evaluated at $t\in T$.
Thus, expressions like \textquotedblleft$\left\{  a_{1},a_{2},\ldots
,a_{k}\right\}  _{\operatorname*{multi}}\left(  t\right)  $\textquotedblright%
\ make sense.}%
\begin{align}
&  \left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}\left(
t\right) \nonumber\\
&  =\left(  \text{\# of }i\in\left[  k\right]  \text{ satisfying }%
a_{i}=t\right) \nonumber\\
&  =\left(  \text{\# of times }t\text{ appears in the }k\text{-tuple }\left(
a_{1},a_{2},\ldots,a_{k}\right)  \right)  .
\label{pf.prop.mulsub.union.list.1}%
\end{align}
Likewise, for each $t\in T$, we have%
\begin{align}
&  \left\{  b_{1},b_{2},\ldots,b_{\ell}\right\}  _{\operatorname*{multi}%
}\left(  t\right) \nonumber\\
&  =\left(  \text{\# of times }t\text{ appears in the }\ell\text{-tuple
}\left(  b_{1},b_{2},\ldots,b_{\ell}\right)  \right)  .
\label{pf.prop.mulsub.union.list.2}%
\end{align}
Likewise, for each $t\in T$, we have%
\begin{align*}
&  \left\{  a_{1},a_{2},\ldots,a_{k},b_{1},b_{2},\ldots,b_{\ell}\right\}
_{\operatorname*{multi}}\left(  t\right) \\
&  =\left(  \text{\# of times }t\text{ appears in the }\left(  k+\ell\right)
\text{-tuple }\left(  a_{1},a_{2},\ldots,a_{k},b_{1},b_{2},\ldots,b_{\ell
}\right)  \right)  .
\end{align*}
Hence, for each $t\in T$, we have%
\begin{align}
&  \left\{  a_{1},a_{2},\ldots,a_{k},b_{1},b_{2},\ldots,b_{\ell}\right\}
_{\operatorname*{multi}}\left(  t\right) \nonumber\\
&  =\left(  \text{\# of times }t\text{ appears in the }\left(  k+\ell\right)
\text{-tuple }\left(  a_{1},a_{2},\ldots,a_{k},b_{1},b_{2},\ldots,b_{\ell
}\right)  \right) \nonumber\\
&  =\underbrace{\left(  \text{\# of times }t\text{ appears in the
}k\text{-tuple }\left(  a_{1},a_{2},\ldots,a_{k}\right)  \right)
}_{\substack{=\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}\left(  t\right)  \\\text{(by
(\ref{pf.prop.mulsub.union.list.1}))}}}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ +\underbrace{\left(  \text{\# of times }t\text{ appears
in the }\ell\text{-tuple }\left(  b_{1},b_{2},\ldots,b_{\ell}\right)  \right)
}_{\substack{=\left\{  b_{1},b_{2},\ldots,b_{\ell}\right\}
_{\operatorname*{multi}}\left(  t\right)  \\\text{(by
(\ref{pf.prop.mulsub.union.list.2}))}}}\nonumber\\
&  =\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}\left(
t\right)  +\left\{  b_{1},b_{2},\ldots,b_{\ell}\right\}
_{\operatorname*{multi}}\left(  t\right)  .
\label{pf.prop.mulsub.union.list.4}%
\end{align}


On the other hand, for each $t\in T$, we have%
\begin{align*}
&  \left(  \left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}%
}\cup\left\{  b_{1},b_{2},\ldots,b_{\ell}\right\}  _{\operatorname*{multi}%
}\right)  \left(  t\right) \\
&  =\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}\left(
t\right)  +\left\{  b_{1},b_{2},\ldots,b_{\ell}\right\}
_{\operatorname*{multi}}\left(  t\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of the map }\left\{
a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}\cup\left\{
b_{1},b_{2},\ldots,b_{\ell}\right\}  _{\operatorname*{multi}}\right) \\
&  =\left\{  a_{1},a_{2},\ldots,a_{k},b_{1},b_{2},\ldots,b_{\ell}\right\}
_{\operatorname*{multi}}\left(  t\right)
\end{align*}
(by (\ref{pf.prop.mulsub.union.list.4})). In other words,
\[
\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}%
\cup\left\{  b_{1},b_{2},\ldots,b_{\ell}\right\}  _{\operatorname*{multi}%
}=\left\{  a_{1},a_{2},\ldots,a_{k},b_{1},b_{2},\ldots,b_{\ell}\right\}
_{\operatorname*{multi}}%
\]
(because both $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}\cup\left\{  b_{1},b_{2},\ldots,b_{\ell}\right\}
_{\operatorname*{multi}}$ and $\left\{  a_{1},a_{2},\ldots,a_{k},b_{1}%
,b_{2},\ldots,b_{\ell}\right\}  _{\operatorname*{multi}}$ are maps from $T$ to
$\mathbb{N}$). This proves Proposition \ref{prop.mulsub.union.list}.
\end{proof}

Having defined the \textquotedblleft union\textquotedblright\ $f\cup g$ of two
multisubsets $f$ and $g$, let us next define their \textquotedblleft
difference\textquotedblright\ $g\setminus f$. This is an analogue of the set
difference of two sets, but we shall only define it in the simplest case --
namely, when $f\subseteq g$. (This is the only case in which we will need it.)

\begin{definition}
\label{def.mulsub.diff}Let $T$ be a set. Let $f$ and $g$ be two multisubsets
of $T$ such that $f\subseteq g$. Then, the map%
\begin{align*}
T  &  \rightarrow\mathbb{N},\\
t  &  \mapsto g\left(  t\right)  -f\left(  t\right)
\end{align*}
is a multisubset of $T$ (by Proposition \ref{prop.mulsub.diff} \textbf{(a)}
further below). This multisubset of $T$ is denoted by $g\setminus f$.
\end{definition}

\begin{proposition}
\label{prop.mulsub.diff}Let $T$ be a set. Let $f$ and $g$ be two multisubsets
of $T$ such that $f\subseteq g$.

\textbf{(a)} The map
\begin{align*}
T  &  \rightarrow\mathbb{N},\\
t  &  \mapsto g\left(  t\right)  -f\left(  t\right)
\end{align*}
is a multisubset of $T$.

\textbf{(b)} We have $\left(  g\setminus f\right)  \cup f=g$.

\textbf{(c)} We have $g\setminus f\subseteq g$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.mulsub.diff}.]\textbf{(a)} We have $f\subseteq
g$. In other words, each $t\in T$ satisfies $f\left(  t\right)  \leq g\left(
t\right)  $ (by Definition \ref{def.mulsub.inc}). Hence, each $t\in T$
satisfies $g\left(  t\right)  -f\left(  t\right)  \in\mathbb{N}$ (since the
previous sentence says that $f\left(  t\right)  \leq g\left(  t\right)  $,
hence $g\left(  t\right)  \geq f\left(  t\right)  $ and therefore $g\left(
t\right)  -f\left(  t\right)  \in\mathbb{N}$\ \ \ \ \footnote{since $g\left(
t\right)  -f\left(  t\right)  $ is an integer}). Thus, the map
\begin{align*}
T  &  \rightarrow\mathbb{N},\\
t  &  \mapsto g\left(  t\right)  -f\left(  t\right)
\end{align*}
is well-defined. Moreover, it is easy to see that this map is a multisubset of
$T$\ \ \ \ \footnote{The proof of this fact is analogous to our proof (during
the proof of Proposition \ref{prop.mulsub.union.size} \textbf{(a)} above) of
the fact that%
\begin{align*}
T  &  \rightarrow\mathbb{N},\\
t  &  \mapsto f\left(  t\right)  +g\left(  t\right)
\end{align*}
is a multisubset of $T$.}. This proves Proposition \ref{prop.mulsub.diff}
\textbf{(a)}.

\textbf{(b)} For each $t\in T$, we have
\begin{equation}
\left(  g\setminus f\right)  \left(  t\right)  =g\left(  t\right)  -f\left(
t\right)  \label{pf.prop.mulsub.diff.b.1}%
\end{equation}
(by the definition of $g\setminus f$). Hence, for each $t\in T$, we have%
\begin{align*}
\left(  \left(  g\setminus f\right)  \cup f\right)  \left(  t\right)   &
=\left(  g\setminus f\right)  \left(  t\right)  +f\left(  t\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }\left(  g\setminus
f\right)  \cup f\right) \\
&  =g\left(  t\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.prop.mulsub.diff.b.1})}\right)  .
\end{align*}
In other words, $\left(  g\setminus f\right)  \cup f=g$ (since both $\left(
g\setminus f\right)  \cup f$ and $g$ are maps from $T$ to $\mathbb{N}$). This
proves Proposition \ref{prop.mulsub.diff} \textbf{(b)}.

\textbf{(c)} Proposition \ref{prop.mulsub.union.size} \textbf{(c)} (applied to
$g\setminus f$ and $f$ instead of $f$ and $g$) yields $g\setminus
f\subseteq\left(  g\setminus f\right)  \cup f$ and $f\subseteq\left(
g\setminus f\right)  \cup f$. Thus, in particular, $g\setminus f\subseteq
\left(  g\setminus f\right)  \cup f=g$ (by Proposition \ref{prop.mulsub.diff}
\textbf{(b)}). This proves Proposition \ref{prop.mulsub.diff} \textbf{(c)}.
\end{proof}

Proposition \ref{prop.mulsub.diff} \textbf{(b)} is a multiset analogue of the
standard fact that if $A$ and $B$ are two sets satisfying $A\subseteq B$, then
$\left(  B\setminus A\right)  \cup A=B$. A similar fact is that if $A$ and $B$
are two disjoint sets, then $\left(  B\cup A\right)  \setminus A=B$. This,
too, has a multiset analogue (but without any disjointness requirement):

\begin{proposition}
\label{prop.mulsub.diff2}Let $T$ be a set. Let $f$ and $g$ be two multisubsets
of $T$. Then, $\left(  g\cup f\right)  \setminus f=g$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.mulsub.diff2}.]Proposition
\ref{prop.mulsub.union.size} \textbf{(c)} (applied to $g$ and $f$ instead of
$f$ and $g$) yields $g\subseteq g\cup f$ and $f\subseteq g\cup f$. Hence,
$\left(  g\cup f\right)  \setminus f$ is well-defined. Moreover, for each
$t\in T$, we have
\begin{equation}
\left(  g\cup f\right)  \left(  t\right)  =g\left(  t\right)  +f\left(
t\right)  \label{pf.prop.mulsub.diff2.1}%
\end{equation}
(by the definition of $g\cup f$). Hence, for each $t\in T$, we have%
\begin{align*}
\left(  \left(  g\cup f\right)  \setminus f\right)  \left(  t\right)   &
=\left(  g\cup f\right)  \left(  t\right)  -f\left(  t\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }\left(  g\cup
f\right)  \setminus f\right) \\
&  =g\left(  t\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.prop.mulsub.diff2.1})}\right)  .
\end{align*}
In other words, $\left(  g\cup f\right)  \setminus f=g$ (since both $\left(
g\cup f\right)  \setminus f$ and $g$ are maps from $T$ to $\mathbb{N}$). This
proves Proposition \ref{prop.mulsub.diff2}.
\end{proof}

Next, we define the \emph{support} of a multisubset $f$ of $T$:

\begin{definition}
\label{def.mulsub.Supp}Let $T$ be a set. Let $f$ be a multisubset of $T$.
Then, we define $\operatorname*{Supp}f$ to be the set $\left\{  t\in
T\ \mid\ f\left(  t\right)  \neq0\right\}  $. We call this set
$\operatorname*{Supp}f$ the \emph{support} of $f$.
\end{definition}

Thus, the support of a multisubset $f$ of $T$ is the set of all $t\in T$ that
occur in $f$ (with a positive multiplicity). Thus, intuitively speaking, the
support of a multisubset $f$ is obtained by turning $f$ into a set (by
forgetting the multiplicities). From this viewpoint, the following fact should
be evident:

\begin{proposition}
\label{prop.mulsub.Supp1}Let $T$ be a set. Let $k\in\mathbb{N}$. Let
$a_{1},a_{2},\ldots,a_{k}$ be any $k$ elements of $T$ (not necessarily
distinct). Then,%
\[
\operatorname*{Supp}\left(  \left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}\right)  =\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
.
\]

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.mulsub.Supp1}.]The definition of
$\operatorname*{Supp}\left(  \left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}\right)  $ yields%
\begin{align}
&  \operatorname*{Supp}\left(  \left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}\right) \nonumber\\
&  =\left\{  t\in T\ \mid\ \left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}\left(  t\right)  \neq0\right\}  .
\label{pf.prop.mulsub.Supp1.0}%
\end{align}


Now, let $u\in\operatorname*{Supp}\left(  \left\{  a_{1},a_{2},\ldots
,a_{k}\right\}  _{\operatorname*{multi}}\right)  $. We shall show that
$u\in\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  $.

We have $u\in\operatorname*{Supp}\left(  \left\{  a_{1},a_{2},\ldots
,a_{k}\right\}  _{\operatorname*{multi}}\right)  =\left\{  t\in T\ \mid
\ \left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}\left(
t\right)  \neq0\right\}  $ (by (\ref{pf.prop.mulsub.Supp1.0})). In other
words, $u$ is a $t\in T$ satisfying $\left\{  a_{1},a_{2},\ldots
,a_{k}\right\}  _{\operatorname*{multi}}\left(  t\right)  \neq0$. In other
words, $u\in T$ and $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}\left(  u\right)  \neq0$.

But recall how the map $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}$ was defined in Definition \ref{def.mulsub.a1a2ak}.
This definition shows that%
\[
\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}\left(
u\right)  =\left(  \text{\# of }i\in\left[  k\right]  \text{ satisfying }%
a_{i}=u\right)  .
\]
Hence, $\left(  \text{\# of }i\in\left[  k\right]  \text{ satisfying }%
a_{i}=u\right)  =\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}\left(  u\right)  \neq0$. In other words, there exists
at least one $i\in\left[  k\right]  $ satisfying $a_{i}=u$. Consider this $i$.
Hence, $u=a_{i}\in\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  $.

Forget that we fixed $u$. We thus have proved that $u\in\left\{  a_{1}%
,a_{2},\ldots,a_{k}\right\}  $ for each $u\in\operatorname*{Supp}\left(
\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}\right)  $.
In other words,%
\begin{equation}
\operatorname*{Supp}\left(  \left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}\right)  \subseteq\left\{  a_{1},a_{2},\ldots
,a_{k}\right\}  . \label{pf.prop.mulsub.Supp1.dir1}%
\end{equation}


Next, let $v\in\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  $. We shall show
that $v\in\operatorname*{Supp}\left(  \left\{  a_{1},a_{2},\ldots
,a_{k}\right\}  _{\operatorname*{multi}}\right)  $.

We have $v\in\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  $. In other words,
$v=a_{j}$ for some $j\in\left[  k\right]  $. Consider this $j$. We have
$v=a_{j}\in T$ (since $a_{1},a_{2},\ldots,a_{k}$ are elements of $T$). Also,
$v=a_{j}$, so that $a_{j}=v$. Hence, there exists at least one $i\in\left[
k\right]  $ satisfying $a_{i}=v$ (namely, $i=j$).

Recall how the map $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}$ was defined in Definition \ref{def.mulsub.a1a2ak}.
This definition shows that%
\[
\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}\left(
v\right)  =\left(  \text{\# of }i\in\left[  k\right]  \text{ satisfying }%
a_{i}=v\right)  \geq1
\]
(since there exists at least one $i\in\left[  k\right]  $ satisfying $a_{i}%
=v$). Thus, $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}\left(  v\right)  \geq1>0$, so that $\left\{
a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}\left(  v\right)
\neq0$.

Now, we know that $v\in T$ and $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}\left(  v\right)  \neq0$. In other words, $v$ is a
$t\in T$ satisfying $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}\left(  t\right)  \neq0$. In other words,
\newline$v\in\left\{  t\in T\ \mid\ \left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}\left(  t\right)  \neq0\right\}  $. In view of
(\ref{pf.prop.mulsub.Supp1.0}), this rewrites as $v\in\operatorname*{Supp}%
\left(  \left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}%
}\right)  $.

Forget that we fixed $v$. We thus have proved that $v\in\operatorname*{Supp}%
\left(  \left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}%
}\right)  $ for each $v\in\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  $. In
other words,%
\[
\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  \subseteq\operatorname*{Supp}%
\left(  \left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}%
}\right)  .
\]
Combining this with (\ref{pf.prop.mulsub.Supp1.dir1}), we obtain
$\operatorname*{Supp}\left(  \left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}\right)  =\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
$. This proves Proposition \ref{prop.mulsub.Supp1}.
\end{proof}

Here are three more simple properties of supports:

\begin{proposition}
\label{prop.mulsub.Supp2}Let $T$ be a set. Let $f$ be a multisubset of $T$.
Let $u\in\operatorname*{Supp}f$. Then:

\textbf{(a)} We have $\left\{  u\right\}  _{\operatorname*{multi}}\subseteq f$.

\textbf{(b)} We have $\left\vert f\setminus\left\{  u\right\}
_{\operatorname*{multi}}\right\vert =\left\vert f\right\vert -1$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.mulsub.Supp2}.]We know that $f$ is a
multisubset of $T$, thus a map from $T$ to $\mathbb{N}$.

\textbf{(a)} The definition of $\operatorname*{Supp}f$ yields
$\operatorname*{Supp}f=\left\{  t\in T\ \mid\ f\left(  t\right)
\neq0\right\}  =\left\{  s\in T\ \mid\ f\left(  s\right)  \neq0\right\}  $
(here, we have renamed the index $t$ as $s$).

Definition \ref{def.mulsub.a1a2ak} (applied to $1$ and the $1$-tuple $\left(
u\right)  $ instead of $k$ and the $k$-tuple $\left(  a_{1},a_{2},\ldots
,a_{k}\right)  $) tells us that $\left\{  u\right\}  _{\operatorname*{multi}}$
is defined as the map
\begin{align*}
T  &  \rightarrow\mathbb{N},\\
t  &  \mapsto\left(  \text{\# of }i\in\left[  1\right]  \text{ satisfying
}u=t\right)  .
\end{align*}
Hence,%
\begin{equation}
\left\{  u\right\}  _{\operatorname*{multi}}\left(  t\right)  =\left(
\text{\# of }i\in\left[  1\right]  \text{ satisfying }u=t\right)
\label{pf.prop.mulsub.Supp2.1}%
\end{equation}
for each $t\in T$.

Let $t\in T$. We shall show that $\left\{  u\right\}  _{\operatorname*{multi}%
}\left(  t\right)  \leq f\left(  t\right)  $.

Indeed, assume the contrary. Thus, $\left\{  u\right\}
_{\operatorname*{multi}}\left(  t\right)  >f\left(  t\right)  $. But $f\left(
t\right)  \in\mathbb{N}$ (since $f$ is a map from $T$ to $\mathbb{N}$), hence
$f\left(  t\right)  \geq0$. Thus, $\left\{  u\right\}  _{\operatorname*{multi}%
}\left(  t\right)  >f\left(  t\right)  \geq0$. In view of
(\ref{pf.prop.mulsub.Supp2.1}), this rewrites as $\left(  \text{\# of }%
i\in\left[  1\right]  \text{ satisfying }u=t\right)  >0$. In other words,
there exists at least one $i\in\left[  1\right]  $ satisfying $u=t$. Thus, of
course, we have $u=t$ (since the statement \textquotedblleft$u=t$%
\textquotedblright\ does not depend on $i$). Hence, $t=u\in
\operatorname*{Supp}f=\left\{  s\in T\ \mid\ f\left(  s\right)  \neq0\right\}
$. In other words, $t$ is an $s\in T$ such that $f\left(  s\right)  \neq0$. In
other words, $t\in T$ and $f\left(  t\right)  \neq0$. From $f\left(  t\right)
\neq0$, we obtain $f\left(  t\right)  \geq1$ (since $f\left(  t\right)
\in\mathbb{N}$). Hence, $\left\{  u\right\}  _{\operatorname*{multi}}\left(
t\right)  >f\left(  t\right)  \geq1$.

But (\ref{pf.prop.mulsub.Supp2.1}) becomes%
\begin{align*}
\left\{  u\right\}  _{\operatorname*{multi}}\left(  t\right)   &  =\left(
\text{\# of }i\in\left[  1\right]  \text{ satisfying }u=t\right) \\
&  =\left(  \text{\# of }i\in\left[  1\right]  \right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{since we know that }u=t\right) \\
&  =\left\vert \left[  1\right]  \right\vert =1.
\end{align*}
This contradicts $\left\{  u\right\}  _{\operatorname*{multi}}\left(
t\right)  >1$. This contradiction shows that our assumption was wrong. Hence,
$\left\{  u\right\}  _{\operatorname*{multi}}\left(  t\right)  \leq f\left(
t\right)  $ is proven.

Forget that we fixed $t$. We thus have showed that each $t\in T$ satisfies
$\left\{  u\right\}  _{\operatorname*{multi}}\left(  t\right)  \leq f\left(
t\right)  $. This means that $\left\{  u\right\}  _{\operatorname*{multi}%
}\subseteq f$ (according to Definition \ref{def.mulsub.inc}). Thus, we have
shown that $\left\{  u\right\}  _{\operatorname*{multi}}\subseteq f$. This
proves Proposition \ref{prop.mulsub.Supp2} \textbf{(a)}.

\textbf{(b)} Exercise \ref{exe.mulsub.size1} (applied to $1$ and the $1$-tuple
$\left(  u\right)  $ instead of $k$ and the $k$-tuple $\left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  $) yields that the multisubset $\left\{
u\right\}  _{\operatorname*{multi}}$ of $T$ has size $1$. In other words,
$\left\vert \left\{  u\right\}  _{\operatorname*{multi}}\right\vert =1$ (since
the size of $\left\{  u\right\}  _{\operatorname*{multi}}$ is denoted by
$\left\vert \left\{  u\right\}  _{\operatorname*{multi}}\right\vert $).

We have $\left\{  u\right\}  _{\operatorname*{multi}}\subseteq f$ (by
Proposition \ref{prop.mulsub.Supp2} \textbf{(a)}). Thus, Proposition
\ref{prop.mulsub.diff} \textbf{(b)} (applied to $\left\{  u\right\}
_{\operatorname*{multi}}$ and $f$ instead of $f$ and $g$) yields $\left(
f\setminus\left\{  u\right\}  _{\operatorname*{multi}}\right)  \cup\left\{
u\right\}  _{\operatorname*{multi}}=f$. Hence, $f=\left(  f\setminus\left\{
u\right\}  _{\operatorname*{multi}}\right)  \cup\left\{  u\right\}
_{\operatorname*{multi}}$. Thus,%
\begin{align*}
\left\vert f\right\vert  &  =\left\vert \left(  f\setminus\left\{  u\right\}
_{\operatorname*{multi}}\right)  \cup\left\{  u\right\}
_{\operatorname*{multi}}\right\vert =\left\vert f\setminus\left\{  u\right\}
_{\operatorname*{multi}}\right\vert +\underbrace{\left\vert \left\{
u\right\}  _{\operatorname*{multi}}\right\vert }_{=1}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Proposition \ref{prop.mulsub.union.size} \textbf{(b)},}\\
\text{applied to }f\setminus\left\{  u\right\}  _{\operatorname*{multi}}\text{
and }\left\{  u\right\}  _{\operatorname*{multi}}\text{ instead of }f\text{
and }g
\end{array}
\right) \\
&  =\left\vert f\setminus\left\{  u\right\}  _{\operatorname*{multi}%
}\right\vert +1.
\end{align*}
In other words, $\left\vert f\setminus\left\{  u\right\}
_{\operatorname*{multi}}\right\vert =\left\vert f\right\vert -1$. This proves
Proposition \ref{prop.mulsub.Supp2} \textbf{(b)}.
\end{proof}

\begin{proposition}
\label{prop.mulsub.Supp3}Let $T$ be a set. Let $f$ be a multisubset of $T$.

\textbf{(a)} The set $\operatorname*{Supp}f$ is finite.

\textbf{(b)} We have $\left\vert f\right\vert =\sum_{t\in\operatorname*{Supp}%
f}f\left(  t\right)  $.

\textbf{(c)} Assume that $\left\vert f\right\vert >0$. Then,
$\operatorname*{Supp}f$ is a finite nonempty subset of $T$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.mulsub.Supp3}.]We know that $f$ is a
multisubset of $T$. According to Definition \ref{def.mulsub} \textbf{(a)},
this means that only finitely many $t\in T$ satisfy $f\left(  t\right)  \neq
0$. Hence, we know that only finitely many $t\in T$ satisfy $f\left(
t\right)  \neq0$. In other words, the set $\left\{  t\in T\ \mid\ f\left(
t\right)  \neq0\right\}  $ is finite. Since $\operatorname*{Supp}f=\left\{
t\in T\ \mid\ f\left(  t\right)  \neq0\right\}  $ (by the definition of
$\operatorname*{Supp}f$), we can rewrite this as follows: The set
$\operatorname*{Supp}f$ is finite. This proves Proposition
\ref{prop.mulsub.Supp3} \textbf{(a)}.

\textbf{(b)} From (\ref{eq.def.mulsub.absf=.1}), we obtain%
\begin{align*}
\left\vert f\right\vert  &  =\sum_{t\in T}f\left(  t\right)  =\sum
_{\substack{t\in T;\\f\left(  t\right)  =0}}\underbrace{f\left(  t\right)
}_{=0}+\sum_{\substack{t\in T;\\f\left(  t\right)  \neq0}}f\left(  t\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since each }t\in T\text{ satisfies either
}f\left(  t\right)  =0\text{ or }f\left(  t\right)  \neq0\text{ (but not
both)}\right) \\
&  =\underbrace{\sum_{\substack{t\in T;\\f\left(  t\right)  =0}}0}_{=0}%
+\sum_{\substack{t\in T;\\f\left(  t\right)  \neq0}}f\left(  t\right)
=\sum_{\substack{t\in T;\\f\left(  t\right)  \neq0}}f\left(  t\right)  .
\end{align*}
Comparing this with%
\[
\underbrace{\sum_{t\in\operatorname*{Supp}f}}_{\substack{=\sum_{\substack{t\in
T;\\f\left(  t\right)  \neq0}}\\\text{(since }\operatorname*{Supp}f=\left\{
t\in T\ \mid\ f\left(  t\right)  \neq0\right\}  \text{)}}}f\left(  t\right)
=\sum_{\substack{t\in T;\\f\left(  t\right)  \neq0}}f\left(  t\right)  ,
\]
we obtain $\left\vert f\right\vert =\sum_{t\in\operatorname*{Supp}f}f\left(
t\right)  $. Thus, Proposition \ref{prop.mulsub.Supp3} \textbf{(b)} is proved.

\textbf{(c)} Proposition \ref{prop.mulsub.Supp3} \textbf{(b)} yields
$\left\vert f\right\vert =\sum_{t\in\operatorname*{Supp}f}f\left(  t\right)
$, thus $\sum_{t\in\operatorname*{Supp}f}f\left(  t\right)  =\left\vert
f\right\vert >0$. If we had $\operatorname*{Supp}f=\varnothing$, then we would
have%
\[
\sum_{t\in\operatorname*{Supp}f}f\left(  t\right)  =\sum_{t\in\varnothing
}f\left(  t\right)  =\left(  \text{empty sum}\right)  =0,
\]
which would contradict $\sum_{t\in\operatorname*{Supp}f}f\left(  t\right)
>0$. Thus, we cannot have $\operatorname*{Supp}f=\varnothing$. Hence,
$\operatorname*{Supp}f\neq\varnothing$. In other words, $\operatorname*{Supp}%
f$ is nonempty. Moreover, $\operatorname*{Supp}f$ is finite (by Proposition
\ref{prop.mulsub.Supp3} \textbf{(a)}). Finally, $\operatorname*{Supp}%
f=\left\{  t\in T\ \mid\ f\left(  t\right)  \neq0\right\}  \subseteq T$.
Hence, $\operatorname*{Supp}f$ is a subset of $T$. Altogether, this proves
Proposition \ref{prop.mulsub.Supp3} \textbf{(c)}.
\end{proof}

\begin{proposition}
\label{prop.mulsub.Supp4}Let $T$ be a set. Let $f$ and $g$ be two multisubsets
of $T$ such that $f\subseteq g$. Then, $\operatorname*{Supp}f\subseteq
\operatorname*{Supp}g$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.mulsub.Supp4}.]Let $u\in\operatorname*{Supp}%
f$. We shall show that $u\in\operatorname*{Supp}g$.

The definition of $\operatorname*{Supp}f$ yields $\operatorname*{Supp}%
f=\left\{  t\in T\ \mid\ f\left(  t\right)  \neq0\right\}  $. The definition
of $\operatorname*{Supp}g$ yields $\operatorname*{Supp}g=\left\{  t\in
T\ \mid\ g\left(  t\right)  \neq0\right\}  $.

Now, $u\in\operatorname*{Supp}f=\left\{  t\in T\ \mid\ f\left(  t\right)
\neq0\right\}  $; in other words, $u$ is a $t\in T$ satisfying $f\left(
t\right)  \neq0$. In other words, $u\in T$ and $f\left(  u\right)  \neq0$. But
$f$ is a multisubset of $T$, thus a map from $T$ to $\mathbb{N}$. Hence,
$f\left(  u\right)  \in\mathbb{N}$. Thus, from $f\left(  u\right)  \neq0$, we
obtain $f\left(  u\right)  >0$.

But $f\subseteq g$. In other words, each $t\in T$ satisfies $f\left(
t\right)  \leq g\left(  t\right)  $ (by Definition \ref{def.mulsub.inc}).
Applying this to $t=u$, we obtain $f\left(  u\right)  \leq g\left(  u\right)
$. Hence, $g\left(  u\right)  \geq f\left(  u\right)  >0$, so that $g\left(
u\right)  \neq0$. Hence, $u$ is a $t\in T$ satisfying $g\left(  t\right)
\neq0$ (since $u\in T$). In other words, $u\in\left\{  t\in T\ \mid\ g\left(
t\right)  \neq0\right\}  $. This rewrites as $u\in\operatorname*{Supp}g$
(since $\operatorname*{Supp}g=\left\{  t\in T\ \mid\ g\left(  t\right)
\neq0\right\}  $).

Forget that we fixed $u$. We thus have proved that $u\in\operatorname*{Supp}g$
for each $u\in\operatorname*{Supp}f$. In other words, $\operatorname*{Supp}%
f\subseteq\operatorname*{Supp}g$. This proves Proposition
\ref{prop.mulsub.Supp4}.
\end{proof}

Next, let us introduce a word for the kind of tuple whose existence (and
uniqueness) is claimed in Proposition \ref{prop.mulsub.inclist}:

\begin{definition}
Let $T$ be a set of integers. Let $f$ be a multisubset of $T$. An
\emph{increasing list} of $f$ shall mean a tuple $\left(  s_{1},s_{2}%
,\ldots,s_{k}\right)  $ of elements of $T$ such that $f=\left\{  s_{1}%
,s_{2},\ldots,s_{k}\right\}  _{\operatorname*{multi}}$ and $s_{1}\leq
s_{2}\leq\cdots\leq s_{k}$.
\end{definition}

Our goal is thus to prove the following:

\begin{proposition}
\label{prop.mulsub.inclist.rewr}Let $T$ be a set of integers. Let $f$ be a
multisubset of $T$. Then, $f$ has exactly one increasing list.
\end{proposition}

We shall prove this by induction on the size of this multisubset; the
induction base will rely on the following simple fact (an analogue of
\cite[Proposition 2.48]{detnotes}):

\begin{proposition}
\label{prop.mulsub.inclist.empty}Let $T$ be a set. Let $f$ be a multisubset of
$T$ such that $\left\vert f\right\vert =0$. Then:

\textbf{(a)} We have $f=\left\{  {}\right\}  _{\operatorname*{multi}}$.

\textbf{(b)} Now, assume that $T$ is a set of integers. Then, the multisubset
$f$ has exactly one increasing list: namely, the empty list $\left(
{}\right)  $.
\end{proposition}

Of course, the multisubset $\left\{  {}\right\}  _{\operatorname*{multi}}$ is
a multiset analogue of the empty set $\varnothing$.

\begin{proof}
[Proof of Proposition \ref{prop.mulsub.inclist.empty}.]This is an essentially
trivial argument that takes long to explain due to the notational awkwardness
of working with the empty multisubset and the empty list. So here we go:

From (\ref{eq.def.mulsub.absf=.1}), we obtain $\left\vert f\right\vert
=\sum\limits_{t\in T}f\left(  t\right)  $. Hence, $\sum\limits_{t\in
T}f\left(  t\right)  =\left\vert f\right\vert =0$.

But $f$ is a multisubset of $T$, thus a map from $T$ to $\mathbb{N}$. Hence,
each $t\in T$ satisfies $f\left(  t\right)  \in\mathbb{N}$. Therefore, all
addends of the sum $\sum\limits_{t\in T}f\left(  t\right)  $ are nonnegative
integers. Thus, $\sum\limits_{t\in T}f\left(  t\right)  $ is a sum of
nonnegative integers. But this sum equals $0$ (since $\sum\limits_{t\in
T}f\left(  t\right)  =0$).

If a sum of nonnegative integers equals $0$, then all its addends must be $0$
(since otherwise, the sum would be positive rather than $0$). We can apply
this to the sum $\sum\limits_{t\in T}f\left(  t\right)  $ (because
$\sum\limits_{t\in T}f\left(  t\right)  $ is a sum of nonnegative integers and
equals $0$). Thus, we conclude that all addends of this sum must be $0$. In
other words,%
\begin{equation}
f\left(  t\right)  =0\ \ \ \ \ \ \ \ \ \ \text{for each }t\in T\text{.}
\label{pf.prop.mulsub.inclist.empty.f=0}%
\end{equation}


Let us denote the $0$-tuple $\left(  {}\right)  $ by $\left(  a_{1}%
,a_{2},\ldots,a_{0}\right)  $. Thus, $\left(  a_{1},a_{2},\ldots,a_{0}\right)
=\left(  {}\right)  $, so that $\left\{  a_{1},a_{2},\ldots,a_{0}\right\}
_{\operatorname*{multi}}=\left\{  {}\right\}  _{\operatorname*{multi}}$.

Definition \ref{def.mulsub.a1a2ak} (applied to $0$ and the $0$-tuple $\left(
a_{1},a_{2},\ldots,a_{0}\right)  $ instead of $k$ and the $k$-tuple $\left(
a_{1},a_{2},\ldots,a_{k}\right)  $) tells us that $\left\{  a_{1},a_{2}%
,\ldots,a_{0}\right\}  _{\operatorname*{multi}}$ is defined as the map
\begin{align*}
T  &  \rightarrow\mathbb{N},\\
t  &  \mapsto\left(  \text{\# of }i\in\left[  0\right]  \text{ satisfying
}a_{i}=t\right)  .
\end{align*}
\footnote{Being able to write down this map is the reason why we denoted the
$0$-tuple $\left(  {}\right)  $ by $\left(  a_{1},a_{2},\ldots,a_{0}\right)
$.} Hence, for each $t\in T$, we have%
\begin{equation}
\left\{  a_{1},a_{2},\ldots,a_{0}\right\}  _{\operatorname*{multi}}\left(
t\right)  =\left(  \text{\# of }i\in\left[  0\right]  \text{ satisfying }%
a_{i}=t\right)  =0 \label{pf.prop.mulsub.inclist.empty.2}%
\end{equation}
(since there exist no $i\in\left[  0\right]  $ satisfying $a_{i}=t$ (because
$\left[  0\right]  $ is an empty set)).

Now, for each $t\in T$, we have%
\begin{align*}
f\left(  t\right)   &  =0\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.prop.mulsub.inclist.empty.f=0})}\right) \\
&  =\underbrace{\left\{  a_{1},a_{2},\ldots,a_{0}\right\}
_{\operatorname*{multi}}}_{=\left\{  {}\right\}  _{\operatorname*{multi}}%
}\left(  t\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.prop.mulsub.inclist.empty.2})}\right) \\
&  =\left\{  {}\right\}  _{\operatorname*{multi}}\left(  t\right)  .
\end{align*}
In other words, $f=\left\{  {}\right\}  _{\operatorname*{multi}}$ (since both
$f$ and $\left\{  {}\right\}  _{\operatorname*{multi}}$ are maps from $T$ to
$\mathbb{N}$). This proves Proposition \ref{prop.mulsub.inclist.empty}
\textbf{(a)}.

\textbf{(b)} The empty list $\left(  {}\right)  $ satisfies $f=\left\{
{}\right\}  _{\operatorname*{multi}}$ (as we have just proved). Thus, the
empty list $\left(  {}\right)  $ is a tuple $\left(  s_{1},s_{2},\ldots
,s_{k}\right)  $ of elements of $T$ such that $f=\left\{  s_{1},s_{2}%
,\ldots,s_{k}\right\}  _{\operatorname*{multi}}$ and $s_{1}\leq s_{2}%
\leq\cdots\leq s_{k}$ (indeed, the chain of inequalities $s_{1}\leq s_{2}%
\leq\cdots\leq s_{k}$ is vacuously true for the empty list $\left(  {}\right)
$, because it contains no inequality signs). In other words, the empty list
$\left(  {}\right)  $ is an increasing list of $f$ (by the definition of an
increasing list). It remains to show that it is the only increasing list of
$f$.

Let $\left(  s_{1},s_{2},\ldots,s_{k}\right)  $ be any increasing list of $f$.
Thus, $\left(  s_{1},s_{2},\ldots,s_{k}\right)  $ is a tuple of elements of
$T$ such that $f=\left\{  s_{1},s_{2},\ldots,s_{k}\right\}
_{\operatorname*{multi}}$ and $s_{1}\leq s_{2}\leq\cdots\leq s_{k}$ (by the
definition of an increasing list). But Exercise \ref{exe.mulsub.size1}
(applied to $a_{i}=s_{i}$) yields that the multisubset $\left\{  s_{1}%
,s_{2},\ldots,s_{k}\right\}  _{\operatorname*{multi}}$ of $T$ has size $k$. In
other words, the multisubset $f$ of $T$ has size $k$ (since $f=\left\{
s_{1},s_{2},\ldots,s_{k}\right\}  _{\operatorname*{multi}}$). In other words,
$\left\vert f\right\vert =k$ (since the size of $f$ is denoted by $\left\vert
f\right\vert $). Thus, $k=\left\vert f\right\vert =0$. Hence, $\left(
s_{1},s_{2},\ldots,s_{k}\right)  =\left(  s_{1},s_{2},\ldots,s_{0}\right)
=\left(  {}\right)  $.

Now, forget that we fixed $\left(  s_{1},s_{2},\ldots,s_{k}\right)  $. We thus
have shown that if $\left(  s_{1},s_{2},\ldots,s_{k}\right)  $ is any
increasing list of $f$, then $\left(  s_{1},s_{2},\ldots,s_{k}\right)
=\left(  {}\right)  $. In other words, any increasing list of $f$ is $\left(
{}\right)  $. Therefore, the multisubset $f$ has exactly one increasing list:
namely, the empty list $\left(  {}\right)  $ (since we already know that
$\left(  {}\right)  $ is an increasing list of $f$). This proves Proposition
\ref{prop.mulsub.inclist.empty} \textbf{(b)}.
\end{proof}

The induction step of our proof of Proposition \ref{prop.mulsub.inclist.rewr}
will rely on the following fact (an analogue of \cite[Proposition
2.49]{detnotes}):

\begin{proposition}
\label{prop.mulsub.inclist.nonempty1}Let $T$ be a set of integers. Let $f$ be
a multisubset of $T$ such that $\left\vert f\right\vert >0$. Let $m$ be the
largest element of $\operatorname*{Supp}f$. Let $\left(  s_{1},s_{2}%
,\ldots,s_{k}\right)  $ be an increasing list of $f$. Then:

\textbf{(a)} We have $k\geq1$ and $s_{k}=m$.

\textbf{(b)} We have $\left\{  m\right\}  _{\operatorname*{multi}}\subseteq f$.

\textbf{(c)} The list $\left(  s_{1},s_{2},\ldots,s_{k-1}\right)  $ is an
increasing list of the multisubset $f\setminus\left\{  m\right\}
_{\operatorname*{multi}}$ of $T$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.mulsub.inclist.nonempty1}.]We know that
$\left(  s_{1},s_{2},\ldots,s_{k}\right)  $ is an increasing list of $f$. In
other words, $\left(  s_{1},s_{2},\ldots,s_{k}\right)  $ is a list of elements
of $T$ such that $f=\left\{  s_{1},s_{2},\ldots,s_{k}\right\}
_{\operatorname*{multi}}$ and $s_{1}\leq s_{2}\leq\cdots\leq s_{k}$ (by the
definition of an \textquotedblleft increasing list\textquotedblright).

Exercise \ref{exe.mulsub.size1} (applied to $a_{i}=s_{i}$) yields that the
multisubset $\left\{  s_{1},s_{2},\ldots,s_{k}\right\}
_{\operatorname*{multi}}$ of $T$ has size $k$. In other words, the multisubset
$f$ of $T$ has size $k$ (since $f=\left\{  s_{1},s_{2},\ldots,s_{k}\right\}
_{\operatorname*{multi}}$). In other words, $\left\vert f\right\vert =k$
(since the size of $f$ is denoted by $\left\vert f\right\vert $). Hence,
$k=\left\vert f\right\vert >0$. Thus, $k\geq1$ (since $k$ is an integer).
Therefore, $s_{k}$ is well-defined. Clearly, $k\in\left[  k\right]  $ (since
$k\geq1$).

Proposition \ref{prop.mulsub.Supp1} (applied to $a_{i}=s_{i}$) yields
\newline$\operatorname*{Supp}\left(  \left\{  s_{1},s_{2},\ldots
,s_{k}\right\}  _{\operatorname*{multi}}\right)  =\left\{  s_{1},s_{2}%
,\ldots,s_{k}\right\}  $. Thus,%
\begin{align}
\operatorname*{Supp}\underbrace{f}_{=\left\{  s_{1},s_{2},\ldots
,s_{k}\right\}  _{\operatorname*{multi}}}  &  =\operatorname*{Supp}\left(
\left\{  s_{1},s_{2},\ldots,s_{k}\right\}  _{\operatorname*{multi}}\right)
\nonumber\\
&  =\left\{  s_{1},s_{2},\ldots,s_{k}\right\}  .
\label{pf.prop.mulsub.inclist.nonempty1.Supp}%
\end{align}


We have $s_{1}\leq s_{2}\leq\cdots\leq s_{k}$. Hence, the largest element of
$\left\{  s_{1},s_{2},\ldots,s_{k}\right\}  $ is $s_{k}$. In view of
(\ref{pf.prop.mulsub.inclist.nonempty1.Supp}), this rewrites as follows: The
largest element of $\operatorname*{Supp}f$ is $s_{k}$. In other words, $m$ is
$s_{k}$ (since $m$ is the largest element of $\operatorname*{Supp}f$). In
other words, $m=s_{k}$. Hence, $s_{k}=m$. This completes the proof of
Proposition \ref{prop.mulsub.inclist.nonempty1} \textbf{(a)}.

\textbf{(b)} We have $m=s_{k}\in\left\{  s_{1},s_{2},\ldots,s_{k}\right\}
=\operatorname*{Supp}f$ (by (\ref{pf.prop.mulsub.inclist.nonempty1.Supp})).
Hence, Proposition \ref{prop.mulsub.Supp2} \textbf{(a)} (applied to $u=m$)
yields $\left\{  m\right\}  _{\operatorname*{multi}}\subseteq f$. This proves
Proposition \ref{prop.mulsub.inclist.nonempty1} \textbf{(b)}.

\textbf{(c)} From $s_{1}\leq s_{2}\leq\cdots\leq s_{k}$, we obtain $s_{1}\leq
s_{2}\leq\cdots\leq s_{k-1}$.

Furthermore, $k-1\in\mathbb{N}$ (since $k\geq1$). Hence, Proposition
\ref{prop.mulsub.union.list} (applied to $k-1$ and $1$ and the $\left(
k-1\right)  $-tuple $\left(  s_{1},s_{2},\ldots,s_{k-1}\right)  $ and the
$1$-tuple $\left(  s_{k}\right)  $ instead of $k$ and $\ell$ and the $k$-tuple
$\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ and the $\ell$-tuple $\left(
b_{1},b_{2},\ldots,b_{\ell}\right)  $) yields
\[
\left\{  s_{1},s_{2},\ldots,s_{k-1}\right\}  _{\operatorname*{multi}}%
\cup\left\{  s_{k}\right\}  _{\operatorname*{multi}}=\left\{  s_{1}%
,s_{2},\ldots,s_{k-1},s_{k}\right\}  _{\operatorname*{multi}}=\left\{
s_{1},s_{2},\ldots,s_{k}\right\}  _{\operatorname*{multi}}.
\]


Now, Proposition \ref{prop.mulsub.diff2} (applied to $\left\{  s_{1}%
,s_{2},\ldots,s_{k-1}\right\}  _{\operatorname*{multi}}$ and $\left\{
s_{k}\right\}  _{\operatorname*{multi}}$ instead of $g$ and $f$) yields%
\[
\left(  \left\{  s_{1},s_{2},\ldots,s_{k-1}\right\}  _{\operatorname*{multi}%
}\cup\left\{  s_{k}\right\}  _{\operatorname*{multi}}\right)  \setminus
\left\{  s_{k}\right\}  _{\operatorname*{multi}}=\left\{  s_{1},s_{2}%
,\ldots,s_{k-1}\right\}  _{\operatorname*{multi}}.
\]
Hence,%
\begin{align*}
\left\{  s_{1},s_{2},\ldots,s_{k-1}\right\}  _{\operatorname*{multi}}  &
=\underbrace{\left(  \left\{  s_{1},s_{2},\ldots,s_{k-1}\right\}
_{\operatorname*{multi}}\cup\left\{  s_{k}\right\}  _{\operatorname*{multi}%
}\right)  }_{\substack{=\left\{  s_{1},s_{2},\ldots,s_{k}\right\}
_{\operatorname*{multi}}=f\\\text{(since }f=\left\{  s_{1},s_{2},\ldots
,s_{k}\right\}  _{\operatorname*{multi}}\text{)}}}\setminus\left\{
\underbrace{s_{k}}_{=m}\right\}  _{\operatorname*{multi}}\\
&  =f\setminus\left\{  m\right\}  _{\operatorname*{multi}}.
\end{align*}
Thus, $f\setminus\left\{  m\right\}  _{\operatorname*{multi}}=\left\{
s_{1},s_{2},\ldots,s_{k-1}\right\}  _{\operatorname*{multi}}$.

Now, we know that $\left(  s_{1},s_{2},\ldots,s_{k-1}\right)  $ is a list of
elements of $T$ such that $f\setminus\left\{  m\right\}
_{\operatorname*{multi}}=\left\{  s_{1},s_{2},\ldots,s_{k-1}\right\}
_{\operatorname*{multi}}$ and $s_{1}\leq s_{2}\leq\cdots\leq s_{k-1}$. In
other words, $\left(  s_{1},s_{2},\ldots,s_{k-1}\right)  $ is an increasing
list of $f\setminus\left\{  m\right\}  _{\operatorname*{multi}}$ (by the
definition of an \textquotedblleft increasing list\textquotedblright). This
proves Proposition \ref{prop.mulsub.inclist.nonempty1} \textbf{(c)}.
\end{proof}

We are now ready to prove Proposition \ref{prop.mulsub.inclist.rewr}:

\begin{proof}
[Proof of Proposition \ref{prop.mulsub.inclist.rewr}.]We shall prove
Proposition \ref{prop.mulsub.inclist.rewr} by induction on $\left\vert
f\right\vert $:

\textit{Induction base:} Proposition \ref{prop.mulsub.inclist.rewr} holds
under the condition that $\left\vert f\right\vert =0$%
\ \ \ \ \footnote{\textit{Proof.} Let $f$ be as in Proposition
\ref{prop.mulsub.inclist.rewr}, and assume that $\left\vert f\right\vert =0$.
We must show that the claim of Proposition \ref{prop.mulsub.inclist.rewr}
holds.
\par
Indeed, Proposition \ref{prop.mulsub.inclist.empty} \textbf{(b)} shows that
the multisubset $f$ has exactly one increasing list. Thus, the claim of
Proposition \ref{prop.mulsub.inclist.rewr} holds. This completes our proof.}.
This completes the induction base.

\textit{Induction step:} Let $g\in\mathbb{N}$. Assume that Proposition
\ref{prop.mulsub.inclist.rewr} holds under the condition that $\left\vert
f\right\vert =g$. We shall now show that Proposition
\ref{prop.mulsub.inclist.rewr} holds under the condition that $\left\vert
f\right\vert =g+1$.

We have assumed that Proposition \ref{prop.mulsub.inclist.rewr} holds under
the condition that $\left\vert f\right\vert =g$. In other words,%
\begin{equation}
\left(
\begin{array}
[c]{c}%
\text{if }f\text{ is a multisubset of }T\text{ satisfying }\left\vert
f\right\vert =g\text{,}\\
\text{then }f\text{ has exactly one increasing list}%
\end{array}
\right)  . \label{pf.prop.mulsub.inclist.rewr.IH}%
\end{equation}


Now, let $f$ be a multisubset of $T$ satisfying $\left\vert f\right\vert
=g+1$. We want to prove that $f$ has exactly one increasing list.

We have $\left\vert f\right\vert =g+1>g\geq0$. Hence, Proposition
\ref{prop.mulsub.Supp3} \textbf{(c)} shows that $\operatorname*{Supp}f$ is a
finite nonempty subset of $T$. Hence, $\operatorname*{Supp}f$ is a finite
nonempty set of integers (since $T$ is a set of integers). Thus,
$\operatorname*{Supp}f$ has a largest element (since any finite nonempty set
of integers has a largest element). Let $m$ be this largest element.

Thus, $m$ is the largest element of $\operatorname*{Supp}f$. Hence, in
particular, $m$ is an element of $\operatorname*{Supp}f$, so that we have
$m\in\operatorname*{Supp}f$. Hence, Proposition \ref{prop.mulsub.Supp2}
\textbf{(a)} (applied to $u=m$) yields $\left\{  m\right\}
_{\operatorname*{multi}}\subseteq f$. Also, Proposition
\ref{prop.mulsub.Supp2} \textbf{(b)} (applied to $u=m$) yields $\left\vert
f\setminus\left\{  m\right\}  _{\operatorname*{multi}}\right\vert =\left\vert
f\right\vert -1=g$ (since $\left\vert f\right\vert =g+1$). Hence,
(\ref{pf.prop.mulsub.inclist.rewr.IH}) (applied to $f\setminus\left\{
m\right\}  _{\operatorname*{multi}}$ instead of $f$) shows that $f\setminus
\left\{  m\right\}  _{\operatorname*{multi}}$ has exactly one increasing list.
Let $\left(  t_{1},t_{2},\ldots,t_{j}\right)  $ be this list. We extend this
list to a $\left(  j+1\right)  $-tuple $\left(  t_{1},t_{2},\ldots
,t_{j+1}\right)  $ by setting $t_{j+1}=m$. Thus, $t_{j+1}=m\in
\operatorname*{Supp}f\subseteq T$ (since $\operatorname*{Supp}f$ is a subset
of $T$).

Recall that $\left\{  m\right\}  _{\operatorname*{multi}}\subseteq f$. Hence,
Proposition \ref{prop.mulsub.diff} \textbf{(c)} (applied to $\left\{
m\right\}  _{\operatorname*{multi}}$ and $f$ instead of $f$ and $g$) yields
$f\setminus\left\{  m\right\}  _{\operatorname*{multi}}\subseteq f$.
Therefore, Proposition \ref{prop.mulsub.Supp4} (applied to $f\setminus\left\{
m\right\}  _{\operatorname*{multi}}$ and $f$ instead of $f$ and $g$) yields
$\operatorname*{Supp}\left(  f\setminus\left\{  m\right\}
_{\operatorname*{multi}}\right)  \subseteq\operatorname*{Supp}f$.

We have defined $\left(  t_{1},t_{2},\ldots,t_{j}\right)  $ as an increasing
list of the multisubset $f\setminus\left\{  m\right\}  _{\operatorname*{multi}%
}$. In other words, $\left(  t_{1},t_{2},\ldots,t_{j}\right)  $ is a tuple of
elements of $T$ such that $f\setminus\left\{  m\right\}
_{\operatorname*{multi}}=\left\{  t_{1},t_{2},\ldots,t_{j}\right\}
_{\operatorname*{multi}}$ and $t_{1}\leq t_{2}\leq\cdots\leq t_{j}$ (by the
definition of an \textquotedblleft increasing list\textquotedblright). Thus,
$t_{1},t_{2},\ldots,t_{j}$ are elements of $T$ (since $\left(  t_{1}%
,t_{2},\ldots,t_{j}\right)  $ is a tuple of elements of $T$).

Proposition \ref{prop.mulsub.Supp1} (applied to $j$ and the $j$-tuple $\left(
t_{1},t_{2},\ldots,t_{j}\right)  $ instead of $k$ and the $k$-tuple $\left(
a_{1},a_{2},\ldots,a_{k}\right)  $) yields%
\[
\operatorname*{Supp}\left(  \left\{  t_{1},t_{2},\ldots,t_{j}\right\}
_{\operatorname*{multi}}\right)  =\left\{  t_{1},t_{2},\ldots,t_{j}\right\}
.
\]
In view of $f\setminus\left\{  m\right\}  _{\operatorname*{multi}}=\left\{
t_{1},t_{2},\ldots,t_{j}\right\}  _{\operatorname*{multi}}$, this rewrites as%
\[
\operatorname*{Supp}\left(  f\setminus\left\{  m\right\}
_{\operatorname*{multi}}\right)  =\left\{  t_{1},t_{2},\ldots,t_{j}\right\}
.
\]
Hence,
\[
\left\{  t_{1},t_{2},\ldots,t_{j}\right\}  =\operatorname*{Supp}\left(
f\setminus\left\{  m\right\}  _{\operatorname*{multi}}\right)  \subseteq
\operatorname*{Supp}f.
\]


We claim that%
\begin{equation}
t_{1}\leq t_{2}\leq\cdots\leq t_{j+1}. \label{pf.prop.mulsub.inclist.rewr.1}%
\end{equation}


[\textit{Proof of (\ref{pf.prop.mulsub.inclist.rewr.1}):} If $j+1\leq1$, then
the chain of inequalities (\ref{pf.prop.mulsub.inclist.rewr.1}) is vacuously
true (since it contains no inequality signs). Thus, for the rest of this proof
of (\ref{pf.prop.mulsub.inclist.rewr.1}), we WLOG assume that we don't have
$j+1\leq1$. Hence, $j+1>1$, so that $j>0$ and thus $j\geq1$ (since $j$ is an
integer). Hence, $t_{j}$ is well-defined. We have $j\geq1$ and thus
$j\in\left[  j\right]  $. Hence, $t_{j}\in\left\{  t_{1},t_{2},\ldots
,t_{j}\right\}  \subseteq\operatorname*{Supp}f$.

But $m$ is the largest element of $\operatorname*{Supp}f$. Hence, $m\geq x$
for each $x\in\operatorname*{Supp}f$. Applying this to $x=t_{j}$, we obtain
$m\geq t_{j}$ (since $t_{j}\in\operatorname*{Supp}f$). Thus, $t_{j}\leq
m=t_{j+1}$ (since $t_{j+1}=m$). Combining the chain of inequalities $t_{1}\leq
t_{2}\leq\cdots\leq t_{j}$ with the single inequality $t_{j}\leq t_{j+1}$, we
obtain the longer chain of inequalities $t_{1}\leq t_{2}\leq\cdots\leq
t_{j}\leq t_{j+1}$. In other words, $t_{1}\leq t_{2}\leq\cdots\leq t_{j+1}$.
This proves (\ref{pf.prop.mulsub.inclist.rewr.1}).]

Next, we shall prove that%
\begin{equation}
f=\left\{  t_{1},t_{2},\ldots,t_{j+1}\right\}  _{\operatorname*{multi}}.
\label{pf.prop.mulsub.inclist.rewr.2}%
\end{equation}


[\textit{Proof of (\ref{pf.prop.mulsub.inclist.rewr.2}):} We have $\left\{
m\right\}  _{\operatorname*{multi}}\subseteq f$ and thus $\left(
f\setminus\left\{  m\right\}  _{\operatorname*{multi}}\right)  \cup\left\{
m\right\}  _{\operatorname*{multi}}=f$ (by Proposition \ref{prop.mulsub.diff}
\textbf{(b)}, applied to $\left\{  m\right\}  _{\operatorname*{multi}}$ and
$f$ instead of $f$ and $g$). Thus,%
\begin{align*}
f  &  =\left(  \underbrace{f\setminus\left\{  m\right\}
_{\operatorname*{multi}}}_{=\left\{  t_{1},t_{2},\ldots,t_{j}\right\}
_{\operatorname*{multi}}}\right)  \cup\left\{  \underbrace{m}_{=t_{j+1}%
}\right\}  _{\operatorname*{multi}}=\left\{  t_{1},t_{2},\ldots,t_{j}\right\}
_{\operatorname*{multi}}\cup\left\{  t_{j+1}\right\}  _{\operatorname*{multi}%
}\\
&  =\left\{  t_{1},t_{2},\ldots,t_{j},t_{j+1}\right\}  _{\operatorname*{multi}%
}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Proposition \ref{prop.mulsub.union.list}, applied to the numbers
}j\text{ and }1\text{ and}\\
\text{the }j\text{-tuple }\left(  t_{1},t_{2},\ldots,t_{j}\right)  \text{ and
the }1\text{-tuple }\left(  t_{j+1}\right)  \text{ instead of the numbers }k\\
\text{and }\ell\text{ and the }k\text{-tuple }\left(  a_{1},a_{2},\ldots
,a_{k}\right)  \text{ and the }\ell\text{-tuple }\left(  b_{1},b_{2}%
,\ldots,b_{\ell}\right)
\end{array}
\right) \\
&  =\left\{  t_{1},t_{2},\ldots,t_{j+1}\right\}  _{\operatorname*{multi}}.
\end{align*}
This proves (\ref{pf.prop.mulsub.inclist.rewr.2}).]

Clearly, $t_{1},t_{2},\ldots,t_{j+1}$ are elements of the set $T$ (since
$t_{1},t_{2},\ldots,t_{j}$ are elements of $T$, and since $t_{j+1}\in T$).
Hence, $\left(  t_{1},t_{2},\ldots,t_{j+1}\right)  $ is a tuple of elements of
$T$.

Thus, $\left(  t_{1},t_{2},\ldots,t_{j+1}\right)  $ is a tuple of elements of
$T$ such that $f=\left\{  t_{1},t_{2},\ldots,t_{j+1}\right\}
_{\operatorname*{multi}}$ (by (\ref{pf.prop.mulsub.inclist.rewr.2})) and
$t_{1}\leq t_{2}\leq\cdots\leq t_{j+1}$ (by
(\ref{pf.prop.mulsub.inclist.rewr.1})). In other words, $\left(  t_{1}%
,t_{2},\ldots,t_{j+1}\right)  $ is an increasing list of $f$ (by the
definition of an \textquotedblleft increasing list\textquotedblright). Hence,
the multisubset $f$ has \textbf{at least} one increasing list (namely,
$\left(  t_{1},t_{2},\ldots,t_{j+1}\right)  $).

We shall next show that $\left(  t_{1},t_{2},\ldots,t_{j+1}\right)  $ is the
only increasing list of $f$. Indeed, let $\left(  s_{1},s_{2},\ldots
,s_{k}\right)  $ be any increasing list of $f$. Then, Proposition
\ref{prop.mulsub.inclist.nonempty1} \textbf{(a)} shows that $k\geq1$ and
$s_{k}=m$. Also, Proposition \ref{prop.mulsub.inclist.nonempty1} \textbf{(c)}
shows that the list $\left(  s_{1},s_{2},\ldots,s_{k-1}\right)  $ is an
increasing list of the multisubset $f\setminus\left\{  m\right\}
_{\operatorname*{multi}}$ of $T$.

But recall that $f\setminus\left\{  m\right\}  _{\operatorname*{multi}}$ has
exactly one increasing list. Thus, in particular, $f\setminus\left\{
m\right\}  _{\operatorname*{multi}}$ has \textbf{at most} one increasing list.
In other words, any two increasing lists of $f\setminus\left\{  m\right\}
_{\operatorname*{multi}}$ are equal. Hence, the lists $\left(  s_{1}%
,s_{2},\ldots,s_{k-1}\right)  $ and $\left(  t_{1},t_{2},\ldots,t_{j}\right)
$ must be equal (since both of these lists are increasing lists of
$f\setminus\left\{  m\right\}  _{\operatorname*{multi}}$). In other words,
$\left(  s_{1},s_{2},\ldots,s_{k-1}\right)  =\left(  t_{1},t_{2},\ldots
,t_{j}\right)  $. In other words, $k-1=j$ and%
\begin{equation}
\left(  s_{i}=t_{i}\text{ for each }i\in\left\{  1,2,\ldots,k-1\right\}
\right)  . \label{pf.prop.mulsub.inclist.rewr.3}%
\end{equation}


From $k-1=j$, we obtain $k=j+1$. Hence, $t_{k}=t_{j+1}=m$. Next, we claim that%
\begin{equation}
s_{i}=t_{i}\text{ for each }i\in\left\{  1,2,\ldots,k\right\}  .
\label{pf.prop.mulsub.inclist.rewr.4}%
\end{equation}


[\textit{Proof of (\ref{pf.prop.mulsub.inclist.rewr.4}):} Let $i\in\left\{
1,2,\ldots,k\right\}  $. We must prove that $s_{i}=t_{i}$. If $i\in\left\{
1,2,\ldots,k-1\right\}  $, then this follows from
(\ref{pf.prop.mulsub.inclist.rewr.3}). Hence, for the rest of this proof, we
WLOG assume that we don't have $i\in\left\{  1,2,\ldots,k-1\right\}  $. Hence,
$i\notin\left\{  1,2,\ldots,k-1\right\}  $. Combining $i\in\left\{
1,2,\ldots,k\right\}  $ with $i\notin\left\{  1,2,\ldots,k-1\right\}  $, we
obtain%
\[
i\in\left\{  1,2,\ldots,k\right\}  \setminus\left\{  1,2,\ldots,k-1\right\}
=\left\{  k\right\}  .
\]
In other words, $i=k$. Hence, $s_{i}=s_{k}=m=t_{k}$ (since $t_{k}=m$). In view
of $k=i$, this rewrites as $s_{i}=t_{i}$. This proves
(\ref{pf.prop.mulsub.inclist.rewr.4}).]

From (\ref{pf.prop.mulsub.inclist.rewr.4}), we obtain $\left(  s_{1}%
,s_{2},\ldots,s_{k}\right)  =\left(  t_{1},t_{2},\ldots,t_{k}\right)  =\left(
t_{1},t_{2},\ldots,t_{j+1}\right)  $ (since $k=j+1$).

Now, forget that we fixed $\left(  s_{1},s_{2},\ldots,s_{k}\right)  $. We thus
have proven that if $\left(  s_{1},s_{2},\ldots,s_{k}\right)  $ is any
increasing list of $f$, then $\left(  s_{1},s_{2},\ldots,s_{k}\right)
=\left(  t_{1},t_{2},\ldots,t_{j+1}\right)  $. In other words, any increasing
list of $f$ equals $\left(  t_{1},t_{2},\ldots,t_{j+1}\right)  $. Thus, the
multisubset $f$ has \textbf{at most} one increasing list. Since we also know
that the multisubset $f$ has \textbf{at least} one increasing list, we thus
conclude that $f$ has exactly one increasing list.

Now, forget that we fixed $f$. We thus have shown that%
\[
\left(
\begin{array}
[c]{c}%
\text{if }f\text{ is a multisubset of $T$ satisfying }\left\vert f\right\vert
=g+1\text{,}\\
\text{then }f\text{ has exactly one increasing list}%
\end{array}
\right)  .
\]
In other words, Proposition \ref{prop.mulsub.inclist.rewr} holds under the
condition that $\left\vert f\right\vert =g+1$. This completes the induction
step. Hence, Proposition \ref{prop.mulsub.inclist.rewr} is proven by induction.
\end{proof}

It is now easy to prove the two propositions that Exercise
\ref{exe.prop.mulsub.inclist} wants us to prove:

\begin{proof}
[Proof of Proposition \ref{prop.mulsub.inclist}.]Proposition
\ref{prop.mulsub.inclist.rewr} (applied to $f=S$) shows that $S$ has exactly
one increasing list. In other words, there exists exactly one increasing list
of $S$. In other words, there exists a unique increasing list of $S$. In other
words, there exists a unique tuple $\left(  s_{1},s_{2},\ldots,s_{k}\right)  $
of elements of $T$ such that $S=\left\{  s_{1},s_{2},\ldots,s_{k}\right\}
_{\operatorname*{multi}}$ and $s_{1}\leq s_{2}\leq\cdots\leq s_{k}$ (because
an increasing list of $S$ is defined to be a tuple $\left(  s_{1},s_{2}%
,\ldots,s_{k}\right)  $ of elements of $T$ such that $S=\left\{  s_{1}%
,s_{2},\ldots,s_{k}\right\}  _{\operatorname*{multi}}$ and $s_{1}\leq
s_{2}\leq\cdots\leq s_{k}$). In other words, there exists a unique tuple
$\left(  s_{1},s_{2},\ldots,s_{k}\right)  $ of integers in $T$ satisfying
$S=\left\{  s_{1},s_{2},\ldots,s_{k}\right\}  _{\operatorname*{multi}}$ and
$s_{1}\leq s_{2}\leq\cdots\leq s_{k}$ (because elements of $T$ are the same as
integers in $T$). In other words, there exists a unique tuple $\left(
s_{1},s_{2},\ldots,s_{k}\right)  $ of integers in $T$ satisfying $\left\{
s_{1},s_{2},\ldots,s_{k}\right\}  _{\operatorname*{multi}}=S$ and $s_{1}\leq
s_{2}\leq\cdots\leq s_{k}$ (because \textquotedblleft$S=\left\{  s_{1}%
,s_{2},\ldots,s_{k}\right\}  _{\operatorname*{multi}}$\textquotedblright\ is
equivalent to \textquotedblleft$\left\{  s_{1},s_{2},\ldots,s_{k}\right\}
_{\operatorname*{multi}}=S$\textquotedblright). This proves Proposition
\ref{prop.mulsub.inclist}.
\end{proof}

Now, Proposition \ref{prop.mulsub.inclist-k} can be derived from Proposition
\ref{prop.mulsub.inclist} in the same way as Proposition
\ref{prop.intset.inclist-k} was derived from Proposition
\ref{prop.intset.inclist} (in the solution to Exercise
\ref{exe.intset.inclist-k}):

\begin{proof}
[Proof of Proposition \ref{prop.mulsub.inclist-k}.]Proposition
\ref{prop.mulsub.inclist} yields that there exists a unique tuple $\left(
s_{1},s_{2},\ldots,s_{k}\right)  $ of integers in $T$ satisfying $\left\{
s_{1},s_{2},\ldots,s_{k}\right\}  _{\operatorname*{multi}}=S$ and $s_{1}\leq
s_{2}\leq\cdots\leq s_{k}$. Consider this tuple, and denote it by $\left(
t_{1},t_{2},\ldots,t_{p}\right)  $. Thus, $\left(  t_{1},t_{2},\ldots
,t_{p}\right)  $ is the unique tuple of integers in $T$ satisfying $\left\{
t_{1},t_{2},\ldots,t_{p}\right\}  _{\operatorname*{multi}}=S$ and $t_{1}\leq
t_{2}\leq\cdots\leq t_{p}$.

Exercise \ref{exe.mulsub.size1} (applied to $p$ and $t_{i}$ instead of $k$ and
$a_{i}$) yields that the multisubset $\left\{  t_{1},t_{2},\ldots
,t_{p}\right\}  _{\operatorname*{multi}}$ of $T$ has size $p$. In other words,
the multisubset $S$ of $T$ has size $p$ (since $\left\{  t_{1},t_{2}%
,\ldots,t_{p}\right\}  _{\operatorname*{multi}}=S$). This rewrites as
$\left\vert S\right\vert =p$ (since the size of $S$ is denoted by $\left\vert
S\right\vert $). But we know that $S$ has size $m$; in other words, we have
$\left\vert S\right\vert =m$ (since the size of $S$ is denoted by $\left\vert
S\right\vert $). Comparing this with $\left\vert S\right\vert =p$, we obtain
$p=m$.

Recall that the tuple $\left(  t_{1},t_{2},\ldots,t_{p}\right)  $ is a
$p$-tuple of integers in $T$ satisfying \newline$\left\{  t_{1},t_{2}%
,\ldots,t_{p}\right\}  _{\operatorname*{multi}}=S$ and $t_{1}\leq t_{2}%
\leq\cdots\leq t_{p}$. In view of $p=m$, we can rewrite this as follows: The
tuple $\left(  t_{1},t_{2},\ldots,t_{m}\right)  $ is an $m$-tuple of integers
in $T$ satisfying $\left\{  t_{1},t_{2},\ldots,t_{m}\right\}
_{\operatorname*{multi}}=S$ and $t_{1}\leq t_{2}\leq\cdots\leq t_{m}$. Hence,
there exists \textbf{at least one} $m$-tuple $\left(  s_{1},s_{2},\ldots
,s_{m}\right)  $ of integers in $T$ satisfying $\left\{  s_{1},s_{2}%
,\ldots,s_{m}\right\}  _{\operatorname*{multi}}=S$ and $s_{1}\leq s_{2}%
\leq\cdots\leq s_{m}$ (namely, the $m$-tuple $\left(  t_{1},t_{2},\ldots
,t_{m}\right)  $). Furthermore, there exists \textbf{at most one} such
$m$-tuple $\left(  s_{1},s_{2},\ldots,s_{m}\right)  $%
\ \ \ \ \footnote{\textit{Proof.} Recall that $\left(  t_{1},t_{2}%
,\ldots,t_{p}\right)  $ is the \textbf{unique} tuple $\left(  s_{1}%
,s_{2},\ldots,s_{k}\right)  $ of integers in $T$ satisfying $\left\{
s_{1},s_{2},\ldots,s_{k}\right\}  _{\operatorname*{multi}}=S$ and $s_{1}\leq
s_{2}\leq\cdots\leq s_{k}$. Hence, if $\left(  s_{1},s_{2},\ldots
,s_{k}\right)  $ is any tuple of integers in $T$ satisfying $\left\{
s_{1},s_{2},\ldots,s_{k}\right\}  _{\operatorname*{multi}}=S$ and $s_{1}\leq
s_{2}\leq\cdots\leq s_{k}$, then $\left(  s_{1},s_{2},\ldots,s_{k}\right)  $
must equal $\left(  t_{1},t_{2},\ldots,t_{p}\right)  $. Applying this to
$k=m$, we conclude that if $\left(  s_{1},s_{2},\ldots,s_{m}\right)  $ is any
$m$-tuple of integers in $T$ satisfying $\left\{  s_{1},s_{2},\ldots
,s_{m}\right\}  _{\operatorname*{multi}}=S$ and $s_{1}\leq s_{2}\leq\cdots\leq
s_{m}$, then $\left(  s_{1},s_{2},\ldots,s_{m}\right)  $ must equal $\left(
t_{1},t_{2},\ldots,t_{p}\right)  $. Thus, there exists \textbf{at most one}
such $m$-tuple $\left(  s_{1},s_{2},\ldots,s_{m}\right)  $.}. Combining the
claims of the preceding two sentences, we conclude that there exists a
\textbf{unique} $m$-tuple $\left(  s_{1},s_{2},\ldots,s_{m}\right)  $ of
integers in $T$ satisfying $\left\{  s_{1},s_{2},\ldots,s_{m}\right\}
_{\operatorname*{multi}}=S$ and $s_{1}\leq s_{2}\leq\cdots\leq s_{m}$. This
proves Proposition \ref{prop.mulsub.inclist-k}.
\end{proof}

Thus, Proposition \ref{prop.mulsub.inclist} and Proposition
\ref{prop.mulsub.inclist-k} are proven, so that Exercise
\ref{exe.prop.mulsub.inclist} is solved.

\subsection{Solution to Exercise \ref{exe.prop.multinom.formulas}}

In order to solve Exercise \ref{exe.prop.multinom.formulas}, we need to prove
Proposition \ref{prop.multinom.formulas}.

\begin{proof}
[Proof of Proposition \ref{prop.multinom.formulas}.]By assumption, we have
$n_{1}+n_{2}+\cdots+n_{k}=n$, so that $n=n_{1}+n_{2}+\cdots+n_{k}$.

For each $i\in\left[  k+1\right]  $, we define a nonnegative integer $s_{i}%
\in\mathbb{N}$ by $s_{i}=n_{i}+n_{i+1}+\cdots+n_{k}$. Thus, in particular,
$s_{1}=n_{1}+n_{2}+\cdots+n_{k}=n$ and $s_{k+1}=n_{k+1}+n_{k+2}+\cdots
+n_{k}=\left(  \text{empty sum}\right)  =0$.

For each $i\in\left[  k+1\right]  $, we have%
\begin{align}
\underbrace{n}_{=n_{1}+n_{2}+\cdots+n_{k}}-n_{1}-n_{2}-\cdots-n_{i-1}  &
=\left(  n_{1}+n_{2}+\cdots+n_{k}\right)  -n_{1}-n_{2}-\cdots-n_{i-1}%
\nonumber\\
&  =n_{i}+n_{i+1}+\cdots+n_{k}=s_{i} \label{pf.prop.multinom.formulas.1}%
\end{align}
(since $s_{i}$ is defined by $s_{i}=n_{i}+n_{i+1}+\cdots+n_{k}$).

\textbf{(a)} It is easy to see that Proposition \ref{prop.multinom.formulas}
\textbf{(a)} holds if $k=0$\ \ \ \ \footnote{\textit{Proof.} Assume that
$k=0$. Then,%
\begin{align*}
n  &  =n_{1}+n_{2}+\cdots+n_{k}=\left(  \text{empty sum}\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }k=0\right) \\
&  =0.
\end{align*}
Thus, the definition of $\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}$ yields%
\begin{align*}
\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}  &  =\dfrac{n!}{n_{1}!n_{2}!\cdots
n_{k}!}=\dfrac{1}{n_{1}!n_{2}!\cdots n_{0}!}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }\underbrace{n}_{=0}!=0!=1\text{
and }k=0\right) \\
&  =\dfrac{1}{1}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }n_{1}!n_{2}!\cdots
n_{0}!=\left(  \text{empty product}\right)  =1\right) \\
&  =1.
\end{align*}
Moreover, the products%
\begin{align*}
&  \prod_{i=1}^{k}\dbinom{n-n_{1}-n_{2}-\cdots-n_{i-1}}{n_{i}},\\
&  \dbinom{n}{n_{1}}\dbinom{n-n_{1}}{n_{2}}\dbinom{n-n_{1}-n_{2}}{n_{3}}%
\cdots\underbrace{\dbinom{n-n_{1}-n_{2}-\cdots-n_{k-1}}{n_{k}}}_{=1},\\
&  \prod_{i=1}^{k-1}\dbinom{n-n_{1}-n_{2}-\cdots-n_{i-1}}{n_{i}}%
\end{align*}
are all empty products (since $k=0$) and thus equal $1$ as well. Hence, the
claim of Proposition \ref{prop.multinom.formulas} \textbf{(a)} boils down to
$1=1=1=1$, which is obvious. Thus, Proposition \ref{prop.multinom.formulas}
\textbf{(a)} is proved under the assumption that $k=0$.}. Hence, for the rest
of this proof, we WLOG assume that $k\neq0$. Hence, $k\geq1$.

We shall now show two simple observations:

\begin{statement}
\textit{Observation 1:} We have $\dbinom{n-n_{1}-n_{2}-\cdots-n_{i-1}}{n_{i}%
}=\dfrac{s_{i}!}{n_{i}!\cdot s_{i+1}!}$ for each $i\in\left[  k\right]  $.
\end{statement}

[\textit{Proof of Observation 1:} Let $i\in\left[  k\right]  $. Then, the
definition of $s_{i+1}$ yields $s_{i+1}=n_{i+1}+n_{i+2}+\cdots+n_{k}$. But the
definition of $s_{i}$ yields%
\[
s_{i}=n_{i}+n_{i+1}+\cdots+n_{k}=n_{i}+\underbrace{\left(  n_{i+1}%
+n_{i+2}+\cdots+n_{k}\right)  }_{=s_{i+1}}=n_{i}+s_{i+1}.
\]
Hence, $s_{i}-n_{i}=s_{i+1}\geq0$ (since $s_{i+1}\in\mathbb{N}$), so that
$n_{i}\leq s_{i}$. Thus, Proposition \ref{thm.binom.fac} (applied to $s_{i}$
and $n_{i}$ instead of $n$ and $k$) yields%
\[
\dbinom{s_{i}}{n_{i}}=\dfrac{s_{i}!}{n_{i}!\cdot\left(  s_{i}-n_{i}\right)
!}=\dfrac{s_{i}!}{n_{i}!\cdot s_{i+1}!}\ \ \ \ \ \ \ \ \ \ \left(  \text{since
}s_{i}-n_{i}=s_{i+1}\right)  .
\]


But (\ref{pf.prop.multinom.formulas.1}) yields $n-n_{1}-n_{2}-\cdots
-n_{i-1}=s_{i}$. Thus,%
\[
\dbinom{n-n_{1}-n_{2}-\cdots-n_{i-1}}{n_{i}}=\dbinom{s_{i}}{n_{i}}%
=\dfrac{s_{i}!}{n_{i}!\cdot s_{i+1}!}.
\]
This proves Observation 1.]

\begin{statement}
\textit{Observation 2:} We have $\dbinom{n-n_{1}-n_{2}-\cdots-n_{k-1}}{n_{k}%
}=1$.
\end{statement}

[\textit{Proof of Observation 2:} We have $k\in\left[  k\right]  $ (since
$k\geq1$). From $n=n_{1}+n_{2}+\cdots+n_{k}$, we obtain%
\[
\underbrace{n}_{=n_{1}+n_{2}+\cdots+n_{k}}-n_{1}-n_{2}-\cdots-n_{k-1}=\left(
n_{1}+n_{2}+\cdots+n_{k}\right)  -n_{1}-n_{2}-\cdots-n_{k-1}=n_{k}.
\]
Hence, $\dbinom{n-n_{1}-n_{2}-\cdots-n_{k-1}}{n_{k}}=\dbinom{n_{k}}{n_{k}}=1$
(by Exercise \ref{exe.binom.nn}, applied to $n_{k}$ instead of $n$). This
proves Observation 2.]

Now,
\begin{align}
&  \prod_{i=1}^{k}\underbrace{\dbinom{n-n_{1}-n_{2}-\cdots-n_{i-1}}{n_{i}}%
}_{\substack{=\dfrac{s_{i}!}{n_{i}!\cdot s_{i+1}!}\\\text{(by Observation 1)}%
}}\nonumber\\
&  =\prod_{i=1}^{k}\dfrac{s_{i}!}{n_{i}!\cdot s_{i+1}!}=\dfrac{\prod_{i=1}%
^{k}s_{i}!}{\left(  \prod_{i=1}^{k}n_{i}!\right)  \cdot\left(  \prod_{i=1}%
^{k}s_{i+1}!\right)  }\nonumber\\
&  =\dfrac{s_{1}!\cdot\left(  s_{2}!s_{3}!\cdots s_{k}!\right)  }{\left(
n_{1}!n_{2}!\cdots n_{k}!\right)  \cdot\left(  s_{2}!s_{3}!\cdots
s_{k}!\right)  \cdot s_{k+1}!}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since }\prod_{i=1}^{k}s_{i}!=s_{1}!s_{2}!\cdots s_{k}!=s_{1}%
!\cdot\left(  s_{2}!s_{3}!\cdots s_{k}!\right) \\
\text{and }\prod_{i=1}^{k}n_{i}!=n_{1}!n_{2}!\cdots n_{k}!\\
\text{and }\prod_{i=1}^{k}s_{i+1}!=s_{2}!s_{3}!\cdots s_{k+1}!=\left(
s_{2}!s_{3}!\cdots s_{k}!\right)  \cdot s_{k+1}!
\end{array}
\right) \nonumber\\
&  =\dfrac{s_{1}!}{\left(  n_{1}!n_{2}!\cdots n_{k}!\right)  \cdot s_{k+1}%
!}=\dfrac{n!}{\left(  n_{1}!n_{2}!\cdots n_{k}!\right)  \cdot1}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }s_{1}=n\text{ and }%
\underbrace{s_{k+1}}_{=0}!=0!=1\right) \nonumber\\
&  =\dfrac{n!}{n_{1}!n_{2}!\cdots n_{k}!}.
\label{pf.prop.multinom.formulas.a.1}%
\end{align}


But the definition of $\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}$ yields
\begin{align*}
\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}  &  =\dfrac{n!}{n_{1}!n_{2}!\cdots
n_{k}!}\\
&  =\prod_{i=1}^{k}\dbinom{n-n_{1}-n_{2}-\cdots-n_{i-1}}{n_{i}}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{pf.prop.multinom.formulas.a.1}%
)}\right) \\
&  =\dbinom{n}{n_{1}}\dbinom{n-n_{1}}{n_{2}}\dbinom{n-n_{1}-n_{2}}{n_{3}%
}\cdots\dbinom{n-n_{1}-n_{2}-\cdots-n_{k-1}}{n_{k}}\\
&  =\dbinom{n}{n_{1}}\dbinom{n-n_{1}}{n_{2}}\dbinom{n-n_{1}-n_{2}}{n_{3}%
}\cdots\dbinom{n-n_{1}-n_{2}-\cdots-n_{k-2}}{n_{k-1}}\\
&  \ \ \ \ \ \ \ \ \ \ \cdot\underbrace{\dbinom{n-n_{1}-n_{2}-\cdots-n_{k-1}%
}{n_{k}}}_{\substack{=1\\\text{(by Observation 2)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have split off the last factor
from our product}\right) \\
&  =\dbinom{n}{n_{1}}\dbinom{n-n_{1}}{n_{2}}\dbinom{n-n_{1}-n_{2}}{n_{3}%
}\cdots\dbinom{n-n_{1}-n_{2}-\cdots-n_{k-2}}{n_{k-1}}\\
&  =\prod_{i=1}^{k-1}\dbinom{n-n_{1}-n_{2}-\cdots-n_{i-1}}{n_{i}}.
\end{align*}
Thus, Proposition \ref{prop.multinom.formulas} \textbf{(a)} is proved.

\textbf{(b)} Proposition \ref{prop.multinom.formulas} \textbf{(a)} yields%
\[
\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}=\prod_{i=1}^{k}\underbrace{\dbinom
{n-n_{1}-n_{2}-\cdots-n_{i-1}}{n_{i}}}_{\substack{=\dbinom{s_{i}}{n_{i}%
}\\\text{(since (\ref{pf.prop.multinom.formulas.1}) yields }n-n_{1}%
-n_{2}-\cdots-n_{i-1}=s_{i}\text{)}}}=\prod_{i=1}^{k}\underbrace{\dbinom
{s_{i}}{n_{i}}}_{\substack{\in\mathbb{N}\\\text{(by Lemma \ref{lem.binom.NN}%
,}\\\text{applied to }s_{i}\text{ and }n_{i}\\\text{instead of }n\text{ and
}k\text{)}}}\in\mathbb{N}%
\]
(since any product of elements of $\mathbb{N}$ must itself belong to
$\mathbb{N}$). This proves Proposition \ref{prop.multinom.formulas}
\textbf{(b)}. \footnote{This proof of Proposition \ref{prop.multinom.formulas}
\textbf{(b)} is essentially taken from \cite[solution to Exercise
3.1]{detnotes}.}
\end{proof}

\subsection{Solution to Exercise \ref{exe.prop.multinom.maps}}

In order to solve Exercise \ref{exe.prop.multinom.maps}, we first introduce a
convenient notation:

\begin{definition}
\label{def.multinom.fine-map}Let $A$ be a set. Let $k\in\mathbb{N}$. Let
$n_{1},n_{2},\ldots,n_{k}\in\mathbb{N}$. A map $f:A\rightarrow\left[
k\right]  $ is said to be $\left(  n_{1},n_{2},\ldots,n_{k}\right)
$\emph{-fine} if it satisfies
\begin{equation}
\left(  \text{\# of }a\in A\text{ such that }f\left(  a\right)  =i\right)
=n_{i}\ \ \ \ \ \ \ \ \ \ \text{for each }i\in\left[  k\right]  .
\label{eq.def.multinom.fine-map.cond}%
\end{equation}

\end{definition}

\begin{example}
The map $f:\left\{  2,5,6,9,10\right\}  \rightarrow\left[  2\right]  $ that
sends $2,6,9$ to $1$ and sends $5,10$ to $2$ is $\left(  3,2\right)  $-fine,
since it satisfies%
\begin{align*}
\left(  \text{\# of }a\in\left\{  2,5,6,9,10\right\}  \text{ such that
}f\left(  a\right)  =1\right)   &  =\left\vert \left\{  2,6,9\right\}
\right\vert =3\ \ \ \ \ \ \ \ \ \ \text{and}\\
\left(  \text{\# of }a\in\left\{  2,5,6,9,10\right\}  \text{ such that
}f\left(  a\right)  =2\right)   &  =\left\vert \left\{  5,10\right\}
\right\vert =2.
\end{align*}

\end{example}

We can now (slightly) generalize Proposition \ref{prop.multinom.maps} as follows:

\begin{proposition}
\label{prop.multinom.maps-gen}Let $n\in\mathbb{N}$ and $n_{1},n_{2}%
,\ldots,n_{k}\in\mathbb{N}$ be such that $n_{1}+n_{2}+\cdots+n_{k}=n$. Let $A$
be a set such that $\left\vert A\right\vert =n$. Then, the \# of $\left(
n_{1},n_{2},\ldots,n_{k}\right)  $-fine maps $f:A\rightarrow\left[  k\right]
$ is $\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}$.
\end{proposition}

Proposition \ref{prop.multinom.maps} is the particular case of Proposition
\ref{prop.multinom.maps-gen} when $A=\left[  n\right]  $.

We shall now prove Proposition \ref{prop.multinom.maps-gen}.

\begin{proof}
[Proof of Proposition \ref{prop.multinom.maps-gen}.]We shall prove Proposition
\ref{prop.multinom.maps-gen} by induction on $k$.

\textit{Induction base:} It is easy to see that Proposition
\ref{prop.multinom.maps-gen} holds when $k=0$\ \ \ \ \footnote{\textit{Proof.}
Consider the situation of Proposition \ref{prop.multinom.maps-gen}, and assume
that $k=0$. We must show that Proposition \ref{prop.multinom.maps-gen} holds.
\par
Definition \ref{def.multinom} yields%
\begin{align*}
\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}  &  =\dfrac{n!}{n_{1}!n_{2}!\cdots
n_{k}!}=\dfrac{0!}{n_{1}!n_{2}!\cdots n_{0}!}\ \ \ \ \ \ \ \ \ \ \left(
\text{since }k=0\text{ and }n=0\right) \\
&  =\dfrac{0!}{1}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }n_{1}!n_{2}!\cdots
n_{0}!=\left(  \text{empty product}\right)  =1\right) \\
&  =0!=1.
\end{align*}
\par
We have
\begin{align*}
\left\vert A\right\vert  &  =n=n_{1}+n_{2}+\cdots+n_{k}=n_{1}+n_{2}%
+\cdots+n_{0}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }k=0\right) \\
&  =\left(  \text{empty sum}\right)  =0.
\end{align*}
Hence, $A=\varnothing$. Also, $k=0$ and thus $\left[  k\right]  =\left[
0\right]  =\varnothing$. Thus, there exists no $i\in\left[  k\right]  $.
\par
Both sets $A$ and $\left[  k\right]  $ are empty (since $A=\varnothing$ and
$\left[  k\right]  =\varnothing$). Hence, there exists exactly one map
$f:A\rightarrow\left[  k\right]  $ (namely, the map that sends nothing to
nothing). This map $f$ satisfies (\ref{eq.def.multinom.fine-map.cond}) (since
(\ref{eq.def.multinom.fine-map.cond}) is a vacuously true statement (because
there exists no $i\in\left[  k\right]  $)), and thus is $\left(  n_{1}%
,n_{2},\ldots,n_{k}\right)  $-fine (by the definition of \textquotedblleft%
$\left(  n_{1},n_{2},\ldots,n_{k}\right)  $-fine\textquotedblright). Thus,
there exists exactly one $\left(  n_{1},n_{2},\ldots,n_{k}\right)  $-fine map
$f:A\rightarrow\left[  k\right]  $ (namely, the map we just found). In other
words, the \# of $\left(  n_{1},n_{2},\ldots,n_{k}\right)  $-fine maps
$f:A\rightarrow\left[  k\right]  $ is $1$. In view of $\dbinom{n}{n_{1}%
,n_{2},\ldots,n_{k}}=1$, we can rewrite this as follows: The \# of $\left(
n_{1},n_{2},\ldots,n_{k}\right)  $-fine maps $f:A\rightarrow\left[  k\right]
$ is $\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}$. Hence, Proposition
\ref{prop.multinom.maps-gen} is proved (under the assumption that $k=0$).
Thus, Proposition \ref{prop.multinom.maps-gen} holds when $k=0$.}. This
completes the induction base.

\textit{Induction step:} Let $m$ be a positive integer. Assume that
Proposition \ref{prop.multinom.maps-gen} holds when $k=m-1$. We must prove
that Proposition \ref{prop.multinom.maps-gen} holds when $k=m$.

Note that $m\in\left[  m\right]  $ (since $m$ is positive).

We have assumed that Proposition \ref{prop.multinom.maps-gen} holds when
$k=m-1$. In other words, the following statement holds:

\begin{statement}
\textit{Statement 1:} Let $n\in\mathbb{N}$ and $n_{1},n_{2},\ldots,n_{m-1}%
\in\mathbb{N}$ be such that $n_{1}+n_{2}+\cdots+n_{m-1}=n$. Let $A$ be a set
such that $\left\vert A\right\vert =n$. Then, the \# of $\left(  n_{1}%
,n_{2},\ldots,n_{m-1}\right)  $-fine maps $f:A\rightarrow\left[  m-1\right]  $
is $\dbinom{n}{n_{1},n_{2},\ldots,n_{m-1}}$.
\end{statement}

We must prove that Proposition \ref{prop.multinom.maps-gen} holds when $k=m$.
In other words, we must prove the following statement:

\begin{statement}
\textit{Statement 2:} Let $n\in\mathbb{N}$ and $n_{1},n_{2},\ldots,n_{m}%
\in\mathbb{N}$ be such that $n_{1}+n_{2}+\cdots+n_{m}=n$. Let $A$ be a set
such that $\left\vert A\right\vert =n$. Then, the \# of $\left(  n_{1}%
,n_{2},\ldots,n_{m}\right)  $-fine maps $f:A\rightarrow\left[  m\right]  $ is
$\dbinom{n}{n_{1},n_{2},\ldots,n_{m}}$.
\end{statement}

[\textit{Proof of Statement 2:} The following proof is rather similar to the
1st approach to counting $\operatorname*{sur}\left(  m,n\right)  $ in
Subsection \ref{subsect.binom.maps.sur}.

From $n_{1}+n_{2}+\cdots+n_{m}=n$, we obtain%
\[
n=n_{1}+n_{2}+\cdots+n_{m}=\left(  n_{1}+n_{2}+\cdots+n_{m-1}\right)  +n_{m}.
\]
Thus, $n-n_{m}=n_{1}+n_{2}+\cdots+n_{m-1}\in\mathbb{N}$ (since $n_{1}%
,n_{2},\ldots,n_{m-1}\in\mathbb{N}$). Hence, $n-n_{m}\geq0$, so that
$n_{m}\leq n$. Thus, Theorem \ref{thm.binom.fac} (applied to $k=n_{m}$) yields%
\begin{equation}
\dbinom{n}{n_{m}}=\dfrac{n!}{n_{m}!\cdot\left(  n-n_{m}\right)  !}.
\label{pf.prop.multinom.maps-gen.bincoeff}%
\end{equation}


But $A$ is an $n$-element set (since $\left\vert A\right\vert =n$). Hence,
Theorem \ref{thm.binom.comb} (applied to $k=n_{m}$ and $S=A$) yields%
\begin{align*}
\dbinom{n}{n_{m}}  &  =\left(  \text{\# of }n_{m}\text{-element subsets of
}A\right) \\
&  =\left(  \text{\# of subsets }J\text{ of }A\text{ satisfying }\left\vert
J\right\vert =n_{m}\right)  .
\end{align*}
Comparing this with (\ref{pf.prop.multinom.maps-gen.bincoeff}), we obtain%
\begin{equation}
\left(  \text{\# of subsets }J\text{ of }A\text{ satisfying }\left\vert
J\right\vert =n_{m}\right)  =\dfrac{n!}{n_{m}!\cdot\left(  n-n_{m}\right)  !}.
\label{pf.prop.multinom.maps-gen.bincoeff2}%
\end{equation}


Given a map $f:A\rightarrow\left[  m\right]  $, we let $J_{f}$ be the set of
all $a\in A$ such that $f\left(  a\right)  =m$.\ \ \ \ \footnote{For example,
if $A=\left\{  2,5,6,9,13\right\}  $ and $m=2$, and if $f:A\rightarrow\left[
m\right]  $ is the map written in two-line notation as $\left(
\begin{array}
[c]{ccccc}%
2 & 5 & 6 & 9 & 13\\
2 & 1 & 2 & 2 & 1
\end{array}
\right)  $, then $J_{f}=\left\{  2,6,9\right\}  $, because $2,6,9$ are
precisely the $a\in A$ such that $f\left(  a\right)  =2$.} Clearly, this set
$J_{f}$ is a subset of $A$. Moreover, if $f:A\rightarrow\left[  m\right]  $ is
an $\left(  n_{1},n_{2},\ldots,n_{m}\right)  $-fine map, then this subset
$J_{f}$ of $A$ satisfies $\left\vert J_{f}\right\vert =n_{m}$%
\ \ \ \ \footnote{\textit{Proof.} Let $f:A\rightarrow\left[  m\right]  $ be an
$\left(  n_{1},n_{2},\ldots,n_{m}\right)  $-fine map. Thus, we have%
\[
\left(  \text{\# of }a\in A\text{ such that }f\left(  a\right)  =i\right)
=n_{i}\ \ \ \ \ \ \ \ \ \ \text{for each }i\in\left[  m\right]
\]
(by the definition of \textquotedblleft$\left(  n_{1},n_{2},\ldots
,n_{m}\right)  $-fine\textquotedblright). We can apply this to $i=m$ (since
$m\in\left[  m\right]  $), and thus obtain%
\[
\left(  \text{\# of }a\in A\text{ such that }f\left(  a\right)  =m\right)
=n_{m}.
\]
But $J_{f}$ was defined as the set of all $a\in A$ such that $f\left(
a\right)  =m$. Hence,%
\[
\left\vert J_{f}\right\vert =\left(  \text{\# of }a\in A\text{ such that
}f\left(  a\right)  =m\right)  =n_{m}.
\]
Qed.}. Hence, the sum rule yields%
\begin{align}
&  \left(  \text{\# of all }\left(  n_{1},n_{2},\ldots,n_{m}\right)
\text{-fine maps }f:A\rightarrow\left[  m\right]  \right) \nonumber\\
&  =\sum_{\substack{J\subseteq A;\\\left\vert J\right\vert =n_{m}}}\left(
\text{\# of all }\left(  n_{1},n_{2},\ldots,n_{m}\right)  \text{-fine maps
}f:A\rightarrow\left[  m\right]  \text{ satisfying }J_{f}=J\right)  .
\label{pf.prop.multinom.maps-gen.0}%
\end{align}


Now, fix a subset $J$ of $A$ that satisfies $\left\vert J\right\vert =n_{m}$.
What is the \# of all $\left(  n_{1},n_{2},\ldots,n_{m}\right)  $-fine maps
$f:A\rightarrow\left[  m\right]  $ satisfying $J_{f}=J$ ? Such a map $f$ must
satisfy%
\[
J=J_{f}=\left\{  a\in A\ \mid\ f\left(  a\right)  =m\right\}
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }J_{f}\right)  .
\]
In other words, such a map $f$ must send all elements of $J$, but no other
elements, to $m$. In other words, it must send all elements of $J$ to $m$, and
send all other elements of $A$ to numbers different from $m$. The latter
numbers are, of course, the elements of $\left[  m\right]  \setminus\left\{
m\right\}  =\left[  m-1\right]  $. Thus, an $\left(  n_{1},n_{2},\ldots
,n_{m}\right)  $-fine map $f:A\rightarrow\left[  m\right]  $ satisfying
$J_{f}=J$ must send all elements of $J$ to $m$, and send all elements of
$A\setminus J$ to elements of $\left[  m-1\right]  $. Hence, if $f$ is such a
map, then $f$ is uniquely determined by its values at the elements of
$A\setminus J$, and said values must belong to $\left[  m-1\right]  $. In
other words, if $f$ is such a map, then $f$ is uniquely determined by its
restriction $f\mid_{A\setminus J}$, and furthermore this restriction must
\textquotedblleft actually\textquotedblright\ be a map from $A\setminus J$ to
$\left[  m-1\right]  $, in the sense that all its values belong to $\left[
m-1\right]  $. Moreover, in order for the map $f$ to be $\left(  n_{1}%
,n_{2},\ldots,n_{m}\right)  $-fine, its restriction $f\mid_{A\setminus J}$
(regarded as a map from $A\setminus J$ to $\left[  m-1\right]  $) must be
$\left(  n_{1},n_{2},\ldots,n_{m-1}\right)  $-fine\footnote{\textit{Proof.}
Let $f:A\rightarrow\left[  m\right]  $ be a map satisfying $J_{f}=J$. We must
prove that the map $f$ is $\left(  n_{1},n_{2},\ldots,n_{m}\right)  $-fine if
and only if its restriction $f\mid_{A\setminus J}$ (regarded as a map from
$A\setminus J$ to $\left[  m-1\right]  $) is $\left(  n_{1},n_{2}%
,\ldots,n_{m-1}\right)  $-fine.
\par
For each $i\in\left[  m\right]  $, we let $\mathcal{A}_{i}$ be the logical
statement \textquotedblleft$\left(  \text{\# of }a\in A\text{ such that
}f\left(  a\right)  =i\right)  =n_{i}$\textquotedblright.
\par
Recall that $J_{f}=J$, so that%
\[
J=J_{f}=\left\{  a\in A\ \mid\ f\left(  a\right)  =m\right\}
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }J_{f}\right)  .
\]
Hence, $\left\vert J\right\vert =\left\vert \left\{  a\in A\ \mid\ f\left(
a\right)  =m\right\}  \right\vert =\left(  \text{\# of }a\in A\text{ such that
}f\left(  a\right)  =m\right)  $. Therefore,%
\[
\left(  \text{\# of }a\in A\text{ such that }f\left(  a\right)  =m\right)
=\left\vert J\right\vert =n_{m}.
\]
In other words, the statement $\mathcal{A}_{m}$ holds (since $\mathcal{A}_{m}$
was defined to be the logical statement \textquotedblleft$\left(  \text{\# of
}a\in A\text{ such that }f\left(  a\right)  =m\right)  =n_{m}$%
\textquotedblright). In logical notation, this rewrites as follows:
$\mathcal{A}_{m}\Longleftrightarrow\left(  \text{true}\right)  $.
\par
Now, let $i\in\left[  m-1\right]  $. Then, $i\leq m-1<m$, so that $i\neq m$.
But $J=\left\{  a\in A\ \mid\ f\left(  a\right)  =m\right\}  $. Hence,
\begin{equation}
\text{each }a\in J\text{ satisfies }f\left(  a\right)  =m.
\label{pf.prop.multinom.maps-gen.fn1.fa=m}%
\end{equation}
Hence, if there was an element $a\in A$ satisfying both $f\left(  a\right)
=i$ and $a\in J$ at the same time, then this element would satisfy $f\left(
a\right)  =m$ (by (\ref{pf.prop.multinom.maps-gen.fn1.fa=m})), which would
contradict $f\left(  a\right)  =i\neq m$. Thus, there is no such element $a$.
In other words, there exists no $a\in A$ such that $f\left(  a\right)  =i$ and
$a\in J$. In other words,%
\[
\left(  \text{\# of }a\in A\text{ such that }f\left(  a\right)  =i\text{ and
}a\in J\right)  =0.
\]
\par
But each $a\in A$ satisfies either $a\in J$ or $a\notin J$ (but not both at
the same time). Hence, the sum rule yields%
\begin{align*}
&  \left(  \text{\# of }a\in A\text{ such that }f\left(  a\right)  =i\right)
\\
&  =\underbrace{\left(  \text{\# of }a\in A\text{ such that }f\left(
a\right)  =i\text{ and }a\in J\right)  }_{\substack{=0}}+\left(  \text{\# of
}a\in A\text{ such that }f\left(  a\right)  =i\text{ and }a\notin J\right) \\
&  =\left(  \text{\# of }a\in A\text{ such that }f\left(  a\right)  =i\text{
and }a\notin J\right) \\
&  =\left(  \text{\# of }a\in A\text{ such that }a\notin J\text{ and }f\left(
a\right)  =i\right) \\
&  =\left(  \text{\# of }a\in A\setminus J\text{ such that }f\left(  a\right)
=i\right)
\end{align*}
(since the $a\in A$ satisfying $a\notin J$ are precisely the elements of
$A\setminus J$).
\par
Now, forget that we fixed $i$. We thus have proved that%
\begin{align}
&  \left(  \text{\# of }a\in A\text{ such that }f\left(  a\right)  =i\right)
\nonumber\\
&  =\left(  \text{\# of }a\in A\setminus J\text{ such that }f\left(  a\right)
=i\right)  \label{pf.prop.multinom.maps-gen.fn1.A=AoJ}%
\end{align}
for each $i\in\left[  m-1\right]  $.
\par
We have the following chain of logical equivalences:%
\begin{align}
&  \left(  f\mid_{A\setminus J}\text{ (regarded as a map from }A\setminus
J\text{ to }\left[  m-1\right]  \text{) is }\left(  n_{1},n_{2},\ldots
,n_{m-1}\right)  \text{-fine}\right) \nonumber\\
&  \Longleftrightarrow\ \left(  \left(  \text{\# of }a\in A\setminus J\text{
such that }\underbrace{\left(  f\mid_{A\setminus J}\right)  \left(  a\right)
}_{=f\left(  a\right)  }=i\right)  =n_{i}\text{ for each }i\in\left[
m-1\right]  \right) \nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of
\textquotedblleft}\left(  n_{1},n_{2},\ldots,n_{m-1}\right)
\text{-fine\textquotedblright}\right) \nonumber\\
&  \Longleftrightarrow\ \left(  \underbrace{\left(  \text{\# of }a\in
A\setminus J\text{ such that }f\left(  a\right)  =i\right)  }%
_{\substack{=\left(  \text{\# of }a\in A\text{ such that }f\left(  a\right)
=i\right)  \\\text{(by (\ref{pf.prop.multinom.maps-gen.fn1.A=AoJ}))}}%
}=n_{i}\text{ for each }i\in\left[  m-1\right]  \right) \nonumber\\
&  \Longleftrightarrow\ \left(  \underbrace{\left(  \text{\# of }a\in A\text{
such that }f\left(  a\right)  =i\right)  =n_{i}}%
_{\substack{\Longleftrightarrow\ \left(  \mathcal{A}_{i}\text{ holds}\right)
\\\text{(since }\mathcal{A}_{i}\text{ is the logical statement
\textquotedblleft}\left(  \text{\# of }a\in A\text{ such that }f\left(
a\right)  =i\right)  =n_{i}\text{\textquotedblright)}}}\text{ for each }%
i\in\left[  m-1\right]  \right) \nonumber\\
&  \Longleftrightarrow\ \left(  \mathcal{A}_{i}\text{ holds for each }%
i\in\left[  m-1\right]  \right) \nonumber\\
&  \Longleftrightarrow\ \left(  \mathcal{A}_{1}\wedge\mathcal{A}_{2}%
\wedge\cdots\wedge\mathcal{A}_{m-1}\right)  .
\label{pf.prop.multinom.maps-gen.fn1.m-1eq}%
\end{align}
On the other hand, we have the following chain of logical equivalences:%
\begin{align*}
&  \ \left(  f\text{ is }\left(  n_{1},n_{2},\ldots,n_{m}\right)
\text{-fine}\right) \\
&  \Longleftrightarrow\ \left(  \underbrace{\left(  \text{\# of }a\in A\text{
such that }f\left(  a\right)  =i\right)  =n_{i}}%
_{\substack{\Longleftrightarrow\ \left(  \mathcal{A}_{i}\text{ holds}\right)
\\\text{(since }\mathcal{A}_{i}\text{ is the logical statement
\textquotedblleft}\left(  \text{\# of }a\in A\text{ such that }f\left(
a\right)  =i\right)  =n_{i}\text{\textquotedblright)}}}\text{ for each }%
i\in\left[  m\right]  \right) \\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of
\textquotedblleft}\left(  n_{1},n_{2},\ldots,n_{m}\right)
\text{-fine\textquotedblright}\right) \\
&  \Longleftrightarrow\ \left(  \mathcal{A}_{i}\text{ holds for each }%
i\in\left[  m\right]  \right) \\
&  \Longleftrightarrow\ \left(  \mathcal{A}_{1}\wedge\mathcal{A}_{2}%
\wedge\cdots\wedge\mathcal{A}_{m}\right) \\
&  \Longleftrightarrow\ \left(  \left(  \mathcal{A}_{1}\wedge\mathcal{A}%
_{2}\wedge\cdots\wedge\mathcal{A}_{m-1}\right)  \wedge\underbrace{\mathcal{A}%
_{m}}_{\Longleftrightarrow\left(  \text{true}\right)  }\right) \\
&  \Longleftrightarrow\ \left(  \left(  \mathcal{A}_{1}\wedge\mathcal{A}%
_{2}\wedge\cdots\wedge\mathcal{A}_{m-1}\right)  \wedge\left(  \text{true}%
\right)  \right) \\
&  \Longleftrightarrow\ \left(  \mathcal{A}_{1}\wedge\mathcal{A}_{2}%
\wedge\cdots\wedge\mathcal{A}_{m-1}\right) \\
&  \Longleftrightarrow\ \left(  f\mid_{A\setminus J}\text{ (regarded as a map
from }A\setminus J\text{ to }\left[  m-1\right]  \text{) is }\left(
n_{1},n_{2},\ldots,n_{m-1}\right)  \text{-fine}\right)
\end{align*}
(by (\ref{pf.prop.multinom.maps-gen.fn1.m-1eq})). In other words, the map $f$
is $\left(  n_{1},n_{2},\ldots,n_{m}\right)  $-fine if and only if its
restriction $f\mid_{A\setminus J}$ (regarded as a map from $A\setminus J$ to
$\left[  m-1\right]  $) is $\left(  n_{1},n_{2},\ldots,n_{m-1}\right)  $-fine.
Qed.}. This is actually a necessary and sufficient condition; i.e., if
$f:A\rightarrow\left[  m\right]  $ is a map satisfying $J_{f}=J$, and if its
restriction $f\mid_{A\setminus J}$ (regarded as a map from $A\setminus J$ to
$\left[  m-1\right]  $) is $\left(  n_{1},n_{2},\ldots,n_{m-1}\right)  $-fine,
then the map $f$ itself must be $\left(  n_{1},n_{2},\ldots,n_{m}\right)
$-fine\footnote{This was proven in the previous footnote.}. Thus, in order to
construct an $\left(  n_{1},n_{2},\ldots,n_{m}\right)  $-fine map
$f:A\rightarrow\left[  m\right]  $ satisfying $J_{f}=J$, we need to construct
an $\left(  n_{1},n_{2},\ldots,n_{m-1}\right)  $-fine map $f:A\setminus
J\rightarrow\left[  m-1\right]  $. Hence,%
\begin{align}
&  \left(  \text{\# of all }\left(  n_{1},n_{2},\ldots,n_{m}\right)
\text{-fine maps }f:A\rightarrow\left[  m\right]  \text{ satisfying }%
J_{f}=J\right) \nonumber\\
&  =\left(  \text{\# of all }\left(  n_{1},n_{2},\ldots,n_{m-1}\right)
\text{-fine maps }f:A\setminus J\rightarrow\left[  m-1\right]  \right)  .
\label{pf.prop.multinom.maps-gen.1a}%
\end{align}
(Formally speaking, this can be proved using the bijection
principle\footnote{More precisely, we need to apply the bijection principle to
the bijection%
\begin{align*}
&  \left\{  \left(  n_{1},n_{2},\ldots,n_{m}\right)  \text{-fine maps
}f:A\rightarrow\left[  m\right]  \text{ satisfying }J_{f}=J\right\} \\
&  \rightarrow\left\{  \left(  n_{1},n_{2},\ldots,n_{m-1}\right)  \text{-fine
maps }f:A\setminus J\rightarrow\left[  m-1\right]  \right\}
\end{align*}
that sends each $f$ to its restriction $f\mid_{A\setminus J}$ (considered as a
map from $A\setminus J$ to $\left[  m-1\right]  $).
\par
Here, of course, we are using the fact that if an $\left(  n_{1},n_{2}%
,\ldots,n_{m}\right)  $-fine map $f:A\rightarrow\left[  m\right]  $ satisfies
$J_{f}=J$, then the restriction $f\mid_{A\setminus J}$ can be considered as a
map from $A\setminus J$ to $\left[  m-1\right]  $, since it does not take the
value $m$.}.)

On the other hand, $J\subseteq A$, and thus an application of Theorem
\ref{thm.subset-leq} \textbf{(a)} yields $\left\vert A\setminus J\right\vert
=\underbrace{\left\vert A\right\vert }_{=n}-\underbrace{\left\vert
J\right\vert }_{=n_{m}}=n-n_{m}\in\mathbb{N}$. Also, recall that
$n-n_{m}=n_{1}+n_{2}+\cdots+n_{m-1}$, so that $n_{1}+n_{2}+\cdots
+n_{m-1}=n-n_{m}$. Hence, Statement 1 (applied to $n-n_{m}$ and $A\setminus J$
instead of $n$ and $A$) yields that the \# of $\left(  n_{1},n_{2}%
,\ldots,n_{m-1}\right)  $-fine maps $f:A\setminus J\rightarrow\left[
m-1\right]  $ is $\dbinom{n-n_{m}}{n_{1},n_{2},\ldots,n_{m-1}}$. In other
words,%
\begin{align*}
&  \left(  \text{\# of all }\left(  n_{1},n_{2},\ldots,n_{m-1}\right)
\text{-fine maps }f:A\setminus J\rightarrow\left[  m-1\right]  \right) \\
&  =\dbinom{n-n_{m}}{n_{1},n_{2},\ldots,n_{m-1}}=\dfrac{\left(  n-n_{m}%
\right)  !}{n_{1}!n_{2}!\cdots n_{m-1}!}%
\end{align*}
(by the definition of $\dbinom{n-n_{m}}{n_{1},n_{2},\ldots,n_{m-1}}$). Thus,
(\ref{pf.prop.multinom.maps-gen.1a}) becomes%
\begin{align}
&  \left(  \text{\# of all }\left(  n_{1},n_{2},\ldots,n_{m}\right)
\text{-fine maps }f:A\rightarrow\left[  m\right]  \text{ satisfying }%
J_{f}=J\right) \nonumber\\
&  =\left(  \text{\# of all }\left(  n_{1},n_{2},\ldots,n_{m-1}\right)
\text{-fine maps }f:A\setminus J\rightarrow\left[  m-1\right]  \right)
\nonumber\\
&  =\dfrac{\left(  n-n_{m}\right)  !}{n_{1}!n_{2}!\cdots n_{m-1}!}.
\label{pf.prop.multinom.maps-gen.1b}%
\end{align}


Now, forget that we fixed $J$. We thus have proved
(\ref{pf.prop.multinom.maps-gen.1b}) for each subset $J$ of $A$ satisfying
$\left\vert J\right\vert =n_{m}$. Hence, (\ref{pf.prop.multinom.maps-gen.0})
becomes%
\begin{align*}
&  \left(  \text{\# of all }\left(  n_{1},n_{2},\ldots,n_{m}\right)
\text{-fine maps }f:A\rightarrow\left[  m\right]  \right) \\
&  =\sum_{\substack{J\subseteq A;\\\left\vert J\right\vert =n_{m}%
}}\underbrace{\left(  \text{\# of all }\left(  n_{1},n_{2},\ldots
,n_{m}\right)  \text{-fine maps }f:A\rightarrow\left[  m\right]  \text{
satisfying }J_{f}=J\right)  }_{\substack{=\dfrac{\left(  n-n_{m}\right)
!}{n_{1}!n_{2}!\cdots n_{m-1}!}\\\text{(by (\ref{pf.prop.multinom.maps-gen.1b}%
))}}}\\
&  =\sum_{\substack{J\subseteq A;\\\left\vert J\right\vert =n_{m}}%
}\dfrac{\left(  n-n_{m}\right)  !}{n_{1}!n_{2}!\cdots n_{m-1}!}%
=\underbrace{\left(  \text{\# of subsets }J\text{ of }A\text{ satisfying
}\left\vert J\right\vert =n_{m}\right)  }_{\substack{=\dfrac{n!}{n_{m}%
!\cdot\left(  n-n_{m}\right)  !}\\\text{(by
(\ref{pf.prop.multinom.maps-gen.bincoeff2}))}}}\dfrac{\left(  n-n_{m}\right)
!}{n_{1}!n_{2}!\cdots n_{m-1}!}\\
&  =\dfrac{n!}{n_{m}!\cdot\left(  n-n_{m}\right)  !}\cdot\dfrac{\left(
n-n_{m}\right)  !}{n_{1}!n_{2}!\cdots n_{m-1}!}=\dfrac{n!}{n_{m}!\cdot\left(
n_{1}!n_{2}!\cdots n_{m-1}!\right)  }=\dfrac{n!}{n_{1}!n_{2}!\cdots n_{m}!}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }n_{m}!\cdot\left(  n_{1}%
!n_{2}!\cdots n_{m-1}!\right)  =\left(  n_{1}!n_{2}!\cdots n_{m-1}!\right)
\cdot n_{m}!=n_{1}!n_{2}!\cdots n_{m}!\right) \\
&  =\dbinom{n}{n_{1},n_{2},\ldots,n_{m}}%
\end{align*}
(since $\dbinom{n}{n_{1},n_{2},\ldots,n_{m}}$ was defined to be $\dfrac
{n!}{n_{1}!n_{2}!\cdots n_{m}!}$). In other words, the \# of $\left(
n_{1},n_{2},\ldots,n_{m}\right)  $-fine maps $f:A\rightarrow\left[  m\right]
$ is $\dbinom{n}{n_{1},n_{2},\ldots,n_{m}}$. This proves Statement 2.]

Now, Statement 2 is proven. In other words, Proposition
\ref{prop.multinom.maps-gen} holds when $k=m$. This completes the induction
step. Thus, Proposition \ref{prop.multinom.maps-gen} is proved.
\end{proof}

\begin{proof}
[Proof of Proposition \ref{prop.multinom.maps}.]We have $\left\vert \left[
n\right]  \right\vert =n$. Hence, Proposition \ref{prop.multinom.maps-gen}
(applied to $A=\left[  n\right]  $) yields that the \# of $\left(  n_{1}%
,n_{2},\ldots,n_{k}\right)  $-fine maps $f:\left[  n\right]  \rightarrow
\left[  k\right]  $ is $\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}$. In other words,
the \# of maps $f:\left[  n\right]  \rightarrow\left[  k\right]  $ satisfying%
\begin{equation}
\left(  \text{\# of }a\in\left[  n\right]  \text{ such that }f\left(
a\right)  =i\right)  =n_{i}\ \ \ \ \ \ \ \ \ \ \text{for each }i\in\left[
k\right]  \label{pf.prop.multinom.maps.1}%
\end{equation}
is $\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}$ (because the $\left(  n_{1}%
,n_{2},\ldots,n_{k}\right)  $-fine maps $f:\left[  n\right]  \rightarrow
\left[  k\right]  $ are precisely the maps $f:\left[  n\right]  \rightarrow
\left[  k\right]  $ satisfying (\ref{pf.prop.multinom.maps.1})\footnote{by the
definition of \textquotedblleft$\left(  n_{1},n_{2},\ldots,n_{k}\right)
$-fine\textquotedblright}). This proves Proposition \ref{prop.multinom.maps}.
\end{proof}

Thus, Exercise \ref{exe.prop.multinom.maps} is solved.

\subsection{Solution to Exercise \ref{exe.multinom.anagr.formal1}}

\begin{proof}
[Solution to Exercise \ref{exe.multinom.anagr.formal1}.]Write the $n$-tuple
$\alpha\in X^{n}$ in the form $\alpha=\left(  \alpha_{1},\alpha_{2}%
,\ldots,\alpha_{n}\right)  $. Thus,%
\begin{equation}
\left(  \text{\# of times }i\text{ appears in }\alpha\right)  =\left(
\text{\# of }a\in\left[  n\right]  \text{ such that }\alpha_{a}=i\right)  .
\label{sol.multinom.anagr.formal1.numa=}%
\end{equation}


We have assumed that $\beta$ is an anagram of the $n$-tuple $\alpha$. Thus,
$\beta$ is an $n$-tuple that can be obtained from $\alpha$ by permuting its
entries (by the definition of an \textquotedblleft anagram\textquotedblright).
In other words, $\beta$ is an $n$-tuple of the form $\left(  \alpha
_{\sigma\left(  1\right)  },\alpha_{\sigma\left(  2\right)  },\ldots
,\alpha_{\sigma\left(  n\right)  }\right)  $, where $\sigma$ is a permutation
of $\left[  n\right]  $. Consider this $\sigma$.

Thus, $\beta=\left(  \alpha_{\sigma\left(  1\right)  },\alpha_{\sigma\left(
2\right)  },\ldots,\alpha_{\sigma\left(  n\right)  }\right)  $. Thus,%
\begin{equation}
\left(  \text{\# of times }i\text{ appears in }\beta\right)  =\left(  \text{\#
of }b\in\left[  n\right]  \text{ such that }\alpha_{\sigma\left(  b\right)
}=i\right)  . \label{sol.multinom.anagr.formal1.numb=}%
\end{equation}


But $\sigma$ is a permutation of $\left[  n\right]  $. In other words,
$\sigma$ is a bijection from $\left[  n\right]  $ to $\left[  n\right]  $ (by
the definition of a permutation). Hence, its inverse map $\sigma^{-1}:\left[
n\right]  \rightarrow\left[  n\right]  $ is well-defined.

If $a\in\left[  n\right]  $ satisfies $\alpha_{a}=i$, then the element
$\sigma^{-1}\left(  a\right)  $ is a $b\in\left[  n\right]  $ such that
$\alpha_{\sigma\left(  b\right)  }=i$\ \ \ \ \footnote{\textit{Proof.} Let
$a\in\left[  n\right]  $ satisfy $\alpha_{a}=i$. We must prove that the
element $\sigma^{-1}\left(  a\right)  $ is a $b\in\left[  n\right]  $ such
that $\alpha_{\sigma\left(  b\right)  }=i$.
\par
Clearly, $\sigma^{-1}\left(  a\right)  \in\left[  n\right]  $. Also,
$\sigma\left(  \sigma^{-1}\left(  a\right)  \right)  =a$, so that
$\alpha_{\sigma\left(  \sigma^{-1}\left(  a\right)  \right)  }=\alpha_{a}=i$.
Thus, $\sigma^{-1}\left(  a\right)  $ is a $b\in\left[  n\right]  $ such that
$\alpha_{\sigma\left(  b\right)  }=i$ (since $\sigma^{-1}\left(  a\right)
\in\left[  n\right]  $ and $\alpha_{\sigma\left(  \sigma^{-1}\left(  a\right)
\right)  }=i$). Qed.}. Hence, the map%
\begin{align*}
f:\left\{  a\in\left[  n\right]  \ \mid\ \alpha_{a}=i\right\}   &
\rightarrow\left\{  b\in\left[  n\right]  \ \mid\ \alpha_{\sigma\left(
b\right)  }=i\right\}  ,\\
a  &  \mapsto\sigma^{-1}\left(  a\right)
\end{align*}
is well-defined. Consider this map $f$.

If $b\in\left[  n\right]  $ satisfies $\alpha_{\sigma\left(  b\right)  }=i$,
then the element $\sigma\left(  b\right)  $ is an $a\in\left[  n\right]  $
such that $\alpha_{a}=i$\ \ \ \ \footnote{\textit{Proof.} Let $b\in\left[
n\right]  $ satisfy $\alpha_{\sigma\left(  b\right)  }=i$. We must prove that
the element $\sigma\left(  b\right)  $ is an $a\in\left[  n\right]  $ such
that $\alpha_{a}=i$. In other words, we must prove that $\sigma\left(
b\right)  \in\left[  n\right]  $ and $\alpha_{\sigma\left(  b\right)  }=i$.
But this is obvious. Qed.}. Hence, the map%
\begin{align*}
g:\left\{  b\in\left[  n\right]  \ \mid\ \alpha_{\sigma\left(  b\right)
}=i\right\}   &  \rightarrow\left\{  a\in\left[  n\right]  \ \mid\ \alpha
_{a}=i\right\}  ,\\
b  &  \mapsto\sigma\left(  b\right)
\end{align*}
is well-defined. Consider this map $g$.

It is easy to see that $f\circ g=\operatorname*{id}$%
\ \ \ \ \footnote{\textit{Proof.} Let $c\in\left\{  b\in\left[  n\right]
\ \mid\ \alpha_{\sigma\left(  b\right)  }=i\right\}  $. We shall show that
$\left(  f\circ g\right)  \left(  c\right)  =\operatorname*{id}\left(
c\right)  $.
\par
Indeed, the definition of $g$ yields $g\left(  c\right)  =\sigma\left(
c\right)  $. But $\left(  f\circ g\right)  \left(  c\right)  =f\left(
g\left(  c\right)  \right)  =\sigma^{-1}\left(  g\left(  c\right)  \right)  $
(by the definition of $f$). Thus, $\left(  f\circ g\right)  \left(  c\right)
=\sigma^{-1}\left(  \underbrace{g\left(  c\right)  }_{=\sigma\left(  c\right)
}\right)  =\sigma^{-1}\left(  \sigma\left(  c\right)  \right)
=c=\operatorname*{id}\left(  c\right)  $.
\par
Forget that we fixed $c$. We thus have shown that $\left(  f\circ g\right)
\left(  c\right)  =\operatorname*{id}\left(  c\right)  $ for each
$c\in\left\{  b\in\left[  n\right]  \ \mid\ \alpha_{\sigma\left(  b\right)
}=i\right\}  $. In other words, $f\circ g=\operatorname*{id}$.}. Similarly,
$g\circ f=\operatorname*{id}$. Combining $f\circ g=\operatorname*{id}$ with
$g\circ f=\operatorname*{id}$, we conclude that the maps $f$ and $g$ are
mutually inverse. Hence, the map $f:\left\{  a\in\left[  n\right]
\ \mid\ \alpha_{a}=i\right\}  \rightarrow\left\{  b\in\left[  n\right]
\ \mid\ \alpha_{\sigma\left(  b\right)  }=i\right\}  $ is invertible, i.e., is
bijective. Thus, the bijection principle yields%
\[
\left\vert \left\{  a\in\left[  n\right]  \ \mid\ \alpha_{a}=i\right\}
\right\vert =\left\vert \left\{  b\in\left[  n\right]  \ \mid\ \alpha
_{\sigma\left(  b\right)  }=i\right\}  \right\vert .
\]


Now, (\ref{sol.multinom.anagr.formal1.numa=}) yields%
\begin{align*}
\left(  \text{\# of times }i\text{ appears in }\alpha\right)   &  =\left(
\text{\# of }a\in\left[  n\right]  \text{ such that }\alpha_{a}=i\right) \\
&  =\left\vert \left\{  a\in\left[  n\right]  \ \mid\ \alpha_{a}=i\right\}
\right\vert =\left\vert \left\{  b\in\left[  n\right]  \ \mid\ \alpha
_{\sigma\left(  b\right)  }=i\right\}  \right\vert \\
&  =\left(  \text{\# of }b\in\left[  n\right]  \text{ such that }%
\alpha_{\sigma\left(  b\right)  }=i\right) \\
&  =\left(  \text{\# of times }i\text{ appears in }\beta\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{sol.multinom.anagr.formal1.numb=}%
)}\right)  .
\end{align*}
In other words, $\left(  \text{\# of times }i\text{ appears in }\beta\right)
=\left(  \text{\# of times }i\text{ appears in }\alpha\right)  $. This solves
Exercise \ref{exe.multinom.anagr.formal1}.
\end{proof}

\subsection{Solution to Exercise \ref{exe.multinom.anagr.formal2}}

Instead of solving Exercise \ref{exe.multinom.anagr.formal2} directly, we
shall first prove a more general statement (stated in the more flexible
language of maps instead of tuples):

\begin{theorem}
\label{thm.multinom.anagr.formal2-gen}Let $A$ and $B$ be two finite sets. Let
$X$ be any set. Let $f:A\rightarrow X$ and $g:B\rightarrow X$ be two maps.
Assume that%
\begin{align}
&  \left(  \text{\# of }a\in A\text{ such that }f\left(  a\right)  =i\right)
\nonumber\\
&  =\left(  \text{\# of }b\in B\text{ such that }g\left(  b\right)  =i\right)
\label{eq.thm.multinom.anagr.formal2-gen.ass}%
\end{align}
for each $i\in X$. Then, there exists a bijection $\sigma:A\rightarrow B$ such
that $f=g\circ\sigma$.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.multinom.anagr.formal2-gen}.]The set $A$ is finite;
i.e., there are only finitely many $a\in A$. Likewise, there are only finitely
many $b\in B$.

Let $Y$ be the subset $\left\{  f\left(  a\right)  \ \mid\ a\in A\right\}  $
of $X$. Then, $Y$ is finite (since there are only finitely many $a\in A$).

Let $Z$ be the subset $\left\{  g\left(  b\right)  \ \mid\ b\in B\right\}  $
of $X$. Then, $Z$ is finite (since there are only finitely many $b\in B$).

Let $W$ be the union $Y\cup Z$. This set $W$ is a finite set (since it is the
union of the two finite sets $Y$ and $Z$) and is a subset of $X$ (since $Y$
and $Z$ are subsets of $X$).

It is easy to see that%
\begin{equation}
f\left(  c\right)  \in W\ \ \ \ \ \ \ \ \ \ \text{for each }c\in A
\label{pf.thm.multinom.anagr.formal2-gen.fainW}%
\end{equation}
\footnote{\textit{Proof.} Let $c\in A$. We have $Y=\left\{  f\left(  a\right)
\ \mid\ a\in A\right\}  $ (by the definition of $Y$). But from $c\in A$, we
obtain $f\left(  c\right)  \in\left\{  f\left(  a\right)  \ \mid\ a\in
A\right\}  =Y\subseteq Y\cup Z=W$ (since $W$ was defined to be $Y\cup Z$).
This proves (\ref{pf.thm.multinom.anagr.formal2-gen.fainW}).}. Likewise,%
\begin{equation}
g\left(  d\right)  \in W\ \ \ \ \ \ \ \ \ \ \text{for each }d\in B.
\label{pf.thm.multinom.anagr.formal2-gen.gbinW}%
\end{equation}


Let $i\in W$. We shall construct a bijection from the set $\left\{  a\in
A\ \mid\ f\left(  a\right)  =i\right\}  $ to the set $\left\{  b\in
B\ \mid\ g\left(  b\right)  =i\right\}  $.

Indeed, $i\in W\subseteq X$. Also, we have%
\begin{align*}
\left\vert \left\{  a\in A\ \mid\ f\left(  a\right)  =i\right\}  \right\vert
&  =\left(  \text{\# of }a\in A\text{ such that }f\left(  a\right)  =i\right)
\\
&  =\left(  \text{\# of }b\in B\text{ such that }g\left(  b\right)  =i\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{eq.thm.multinom.anagr.formal2-gen.ass})}\right) \\
&  =\left\vert \left\{  b\in B\ \mid\ g\left(  b\right)  =i\right\}
\right\vert .
\end{align*}
In other words, $\left\{  a\in A\ \mid\ f\left(  a\right)  =i\right\}  $ and
$\left\{  b\in B\ \mid\ g\left(  b\right)  =i\right\}  $ are two sets of the
same size. Thus, Theorem \ref{thm.bij-rule-conv} (applied to $\left\{  a\in
A\ \mid\ f\left(  a\right)  =i\right\}  $ and $\left\{  b\in B\ \mid\ g\left(
b\right)  =i\right\}  $ instead of $X$ and $Y$) yields that there exists a
bijection from $\left\{  a\in A\ \mid\ f\left(  a\right)  =i\right\}  $ to
$\left\{  b\in B\ \mid\ g\left(  b\right)  =i\right\}  $. Choose such a
bijection, and denote it by $h_{i}$.

Forget that we fixed $i$. Thus, for each $i\in W$, we have found%
\[
\text{a bijection }h_{i}\text{ from }\left\{  a\in A\ \mid\ f\left(  a\right)
=i\right\}  \text{ to }\left\{  b\in B\ \mid\ g\left(  b\right)  =i\right\}
.
\]
\footnote{If you are aware of the Axiom of Choice, you might wonder whether we
have used it here. The answer is \textquotedblleft no, not
really\textquotedblright. We have made a choice (namely, choosing a bijection
$h_{i}$) for each $i\in W$. This amounts to finitely many choices (since $W$
is a finite set). But you can make finitely many choices without invoking the
Axiom of Choice (indeed, this can easily be proved by induction on the number
of choices). Thus, we are not using the Axiom of Choice here.}

We shall now \textquotedblleft glue\textquotedblright\ these bijections
$h_{i}$ together to a single bijection $u:A\rightarrow B$ which will satisfy
$f=g\circ u$. Here is how this is done in detail:

For each $c\in A$, the element $h_{f\left(  c\right)  }\left(  c\right)  \in
B$ is well-defined\footnote{\textit{Proof.} Let $c\in A$. Let $i=f\left(
c\right)  $. Then, $c$ is an $a\in A$ satisfying $f\left(  a\right)  =i$
(since $c\in A$ and $f\left(  c\right)  =i$). In other words, $c\in\left\{
a\in A\ \mid\ f\left(  a\right)  =i\right\}  $.
\par
But $i=f\left(  c\right)  \in W$ (by
(\ref{pf.thm.multinom.anagr.formal2-gen.fainW})). Hence, $h_{i}$ is a
bijection from $\left\{  a\in A\ \mid\ f\left(  a\right)  =i\right\}  $ to
$\left\{  b\in B\ \mid\ g\left(  b\right)  =i\right\}  $ (by the definition of
$h_{i}$). Therefore, $h_{i}\left(  c\right)  $ is a well-defined element of
$\left\{  b\in B\ \mid\ g\left(  b\right)  =i\right\}  $ (since $c\in\left\{
a\in A\ \mid\ f\left(  a\right)  =i\right\}  $). Thus, $h_{i}\left(  c\right)
\in\left\{  b\in B\ \mid\ g\left(  b\right)  =i\right\}  \subseteq B$. In view
of $i=f\left(  c\right)  $, this rewrites as $h_{f\left(  c\right)  }\left(
c\right)  \in B$. Thus, the element $h_{f\left(  c\right)  }\left(  c\right)
\in B$ is well-defined. Qed.}. Hence, we can define a map%
\begin{align*}
u:A  &  \rightarrow B,\\
c  &  \mapsto h_{f\left(  c\right)  }\left(  c\right)  .
\end{align*}


For each $d\in B$, the element $\left(  h_{g\left(  d\right)  }\right)
^{-1}\left(  d\right)  \in A$ is well-defined\footnote{\textit{Proof.} Let
$d\in B$. Let $i=g\left(  d\right)  $. Then, $d$ is a $b\in B$ satisfying
$g\left(  b\right)  =i$ (since $d\in B$ and $g\left(  d\right)  =i$). In other
words, $d\in\left\{  b\in B\ \mid\ g\left(  b\right)  =i\right\}  $.
\par
But $i=g\left(  d\right)  \in W$ (by
(\ref{pf.thm.multinom.anagr.formal2-gen.gbinW})). Hence, $h_{i}$ is a
bijection from $\left\{  a\in A\ \mid\ f\left(  a\right)  =i\right\}  $ to
$\left\{  b\in B\ \mid\ g\left(  b\right)  =i\right\}  $ (by the definition of
$h_{i}$). Thus, the inverse map $\left(  h_{i}\right)  ^{-1}$ is a bijection
from $\left\{  b\in B\ \mid\ g\left(  b\right)  =i\right\}  $ to $\left\{
a\in A\ \mid\ f\left(  a\right)  =i\right\}  $. Therefore, $\left(
h_{i}\right)  ^{-1}\left(  d\right)  $ is a well-defined element of $\left\{
a\in A\ \mid\ f\left(  a\right)  =i\right\}  $ (since $d\in\left\{  b\in
B\ \mid\ g\left(  b\right)  =i\right\}  $). Thus, $\left(  h_{i}\right)
^{-1}\left(  d\right)  \in\left\{  a\in A\ \mid\ f\left(  a\right)
=i\right\}  \subseteq A$. In view of $i=g\left(  d\right)  $, this rewrites as
$\left(  h_{g\left(  d\right)  }\right)  ^{-1}\left(  d\right)  \in A$. Thus,
the element $\left(  h_{g\left(  d\right)  }\right)  ^{-1}\left(  d\right)
\in A$ is well-defined. Qed.}. Hence, we can define a map
\begin{align*}
v:B  &  \rightarrow A,\\
d  &  \mapsto\left(  h_{g\left(  d\right)  }\right)  ^{-1}\left(  d\right)  .
\end{align*}


We have $u\circ v=\operatorname*{id}$\ \ \ \ \footnote{\textit{Proof.} Let
$d\in B$. Let $i=g\left(  d\right)  $. Then, $d$ is a $b\in B$ satisfying
$g\left(  b\right)  =i$ (since $d\in B$ and $g\left(  d\right)  =i$). In other
words, $d\in\left\{  b\in B\ \mid\ g\left(  b\right)  =i\right\}  $.
\par
But $i=g\left(  d\right)  \in W$ (by
(\ref{pf.thm.multinom.anagr.formal2-gen.gbinW})). Hence, $h_{i}$ is a
bijection from $\left\{  a\in A\ \mid\ f\left(  a\right)  =i\right\}  $ to
$\left\{  b\in B\ \mid\ g\left(  b\right)  =i\right\}  $ (by the definition of
$h_{i}$). Thus, the inverse map $\left(  h_{i}\right)  ^{-1}$ is a bijection
from $\left\{  b\in B\ \mid\ g\left(  b\right)  =i\right\}  $ to $\left\{
a\in A\ \mid\ f\left(  a\right)  =i\right\}  $. Therefore, $\left(
h_{i}\right)  ^{-1}\left(  d\right)  $ is a well-defined element of $\left\{
a\in A\ \mid\ f\left(  a\right)  =i\right\}  $ (since $d\in\left\{  b\in
B\ \mid\ g\left(  b\right)  =i\right\}  $). Thus, $\left(  h_{i}\right)
^{-1}\left(  d\right)  \in\left\{  a\in A\ \mid\ f\left(  a\right)
=i\right\}  $.
\par
But the definition of $v$ yields $v\left(  d\right)  =\left(  h_{g\left(
d\right)  }\right)  ^{-1}\left(  d\right)  =\left(  h_{i}\right)  ^{-1}\left(
d\right)  $ (since $g\left(  d\right)  =i$). Hence, $h_{i}\left(  v\left(
d\right)  \right)  =d$.
\par
Also, $v\left(  d\right)  =\left(  h_{i}\right)  ^{-1}\left(  d\right)
\in\left\{  a\in A\ \mid\ f\left(  a\right)  =i\right\}  $. In other words,
$v\left(  d\right)  $ is an $a\in A$ satisfying $f\left(  a\right)  =i$. In
other words, $v\left(  d\right)  \in A$ and $f\left(  v\left(  d\right)
\right)  =i$. Now,%
\begin{align*}
\left(  u\circ v\right)  \left(  d\right)   &  =u\left(  v\left(  d\right)
\right)  =h_{f\left(  v\left(  d\right)  \right)  }\left(  v\left(  d\right)
\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }u\right) \\
&  =h_{i}\left(  v\left(  d\right)  \right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{since }f\left(  v\left(  d\right)  \right)  =i\right) \\
&  =d=\operatorname*{id}\left(  d\right)  .
\end{align*}
\par
Forget that we fixed $d$. We thus have proved that $\left(  u\circ v\right)
\left(  d\right)  =\operatorname*{id}\left(  d\right)  $ for each $d\in B$. In
other words, $u\circ v=\operatorname*{id}$.} and $v\circ u=\operatorname*{id}%
$\ \ \ \ \footnote{\textit{Proof.} Let $c\in A$. Let $i=f\left(  c\right)  $.
Then, $c$ is an $a\in A$ satisfying $f\left(  a\right)  =i$ (since $c\in A$
and $f\left(  c\right)  =i$). In other words, $c\in\left\{  a\in
A\ \mid\ f\left(  a\right)  =i\right\}  $.
\par
But $i=f\left(  c\right)  \in W$ (by
(\ref{pf.thm.multinom.anagr.formal2-gen.fainW})). Hence, $h_{i}$ is a
bijection from $\left\{  a\in A\ \mid\ f\left(  a\right)  =i\right\}  $ to
$\left\{  b\in B\ \mid\ g\left(  b\right)  =i\right\}  $ (by the definition of
$h_{i}$). Therefore, $h_{i}\left(  c\right)  $ is a well-defined element of
$\left\{  b\in B\ \mid\ g\left(  b\right)  =i\right\}  $ (since $c\in\left\{
a\in A\ \mid\ f\left(  a\right)  =i\right\}  $). Thus, $h_{i}\left(  c\right)
\in\left\{  b\in B\ \mid\ g\left(  b\right)  =i\right\}  \subseteq B$.
\par
But the definition of $u$ yields $u\left(  c\right)  =h_{f\left(  c\right)
}\left(  c\right)  =h_{i}\left(  c\right)  $ (since $f\left(  c\right)  =i$).
\par
Also, $u\left(  c\right)  =h_{i}\left(  c\right)  \in\left\{  b\in
B\ \mid\ g\left(  b\right)  =i\right\}  $. In other words, $u\left(  c\right)
$ is a $b\in B$ satisfying $g\left(  b\right)  =i$. In other words, $u\left(
c\right)  \in B$ and $g\left(  u\left(  c\right)  \right)  =i$. Now,%
\begin{align*}
\left(  v\circ u\right)  \left(  c\right)   &  =v\left(  u\left(  c\right)
\right)  =\left(  h_{g\left(  u\left(  c\right)  \right)  }\right)
^{-1}\left(  u\left(  c\right)  \right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
the definition of }v\right) \\
&  =\left(  h_{i}\right)  ^{-1}\left(  u\left(  c\right)  \right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }g\left(  u\left(  c\right)  \right)
=i\right) \\
&  =c\ \ \ \ \ \ \ \ \ \ \left(  \text{since }u\left(  c\right)  =h_{i}\left(
c\right)  \right) \\
&  =\operatorname*{id}\left(  c\right)  .
\end{align*}
\par
Forget that we fixed $c$. We thus have proved that $\left(  v\circ u\right)
\left(  c\right)  =\operatorname*{id}\left(  c\right)  $ for each $c\in A$. In
other words, $v\circ u=\operatorname*{id}$.}. Thus, the maps $u$ and $v$ are
mutually inverse. Hence, the map $u:A\rightarrow B$ is invertible, i.e.,
bijective. In other words, $u:A\rightarrow B$ is a bijection. Moreover, we
have $f=g\circ u$\ \ \ \ \footnote{\textit{Proof.} Let $c\in A$. Let
$i=f\left(  c\right)  $. Then, $c$ is an $a\in A$ satisfying $f\left(
a\right)  =i$ (since $c\in A$ and $f\left(  c\right)  =i$). In other words,
$c\in\left\{  a\in A\ \mid\ f\left(  a\right)  =i\right\}  $.
\par
But $i=f\left(  c\right)  \in W$ (by
(\ref{pf.thm.multinom.anagr.formal2-gen.fainW})). Hence, $h_{i}$ is a
bijection from $\left\{  a\in A\ \mid\ f\left(  a\right)  =i\right\}  $ to
$\left\{  b\in B\ \mid\ g\left(  b\right)  =i\right\}  $ (by the definition of
$h_{i}$). Therefore, $h_{i}\left(  c\right)  $ is a well-defined element of
$\left\{  b\in B\ \mid\ g\left(  b\right)  =i\right\}  $ (since $c\in\left\{
a\in A\ \mid\ f\left(  a\right)  =i\right\}  $). Thus, $h_{i}\left(  c\right)
\in\left\{  b\in B\ \mid\ g\left(  b\right)  =i\right\}  $.
\par
But the definition of $u$ yields $u\left(  c\right)  =h_{f\left(  c\right)
}\left(  c\right)  =h_{i}\left(  c\right)  $ (since $f\left(  c\right)  =i$).
Hence, $u\left(  c\right)  =h_{i}\left(  c\right)  \in\left\{  b\in
B\ \mid\ g\left(  b\right)  =i\right\}  $. In other words, $u\left(  c\right)
$ is a $b\in B$ satisfying $g\left(  b\right)  =i$. In other words, $u\left(
c\right)  \in B$ and $g\left(  u\left(  c\right)  \right)  =i$. Comparing
$f\left(  c\right)  =i$ with $\left(  g\circ u\right)  \left(  c\right)
=g\left(  u\left(  c\right)  \right)  =i$, we obtain $f\left(  c\right)
=\left(  g\circ u\right)  \left(  c\right)  $.
\par
Forget that we fixed $c$. We thus have proved that $f\left(  c\right)
=\left(  g\circ u\right)  \left(  c\right)  $ for each $c\in A$. In other
words, $f=g\circ u$.}. Hence, there exists a bijection $\sigma:A\rightarrow B$
such that $f=g\circ\sigma$ (namely, $\sigma=u$). This proves Theorem
\ref{thm.multinom.anagr.formal2-gen}.
\end{proof}

Exercise \ref{exe.multinom.anagr.formal2} now easily follows:

\begin{proof}
[Solution to Exercise \ref{exe.multinom.anagr.formal2}.]Write the $n$-tuple
$\alpha\in X^{n}$ in the form $\alpha=\left(  \alpha_{1},\alpha_{2}%
,\ldots,\alpha_{n}\right)  $. Thus, for each $i\in X$, we have%
\begin{equation}
\left(  \text{\# of times }i\text{ appears in }\alpha\right)  =\left(
\text{\# of }a\in\left[  n\right]  \text{ such that }\alpha_{a}=i\right)  .
\label{sol.multinom.anagr.formal2.numalpha=}%
\end{equation}


Write the $n$-tuple $\beta\in X^{n}$ in the form $\beta=\left(  \beta
_{1},\beta_{2},\ldots,\beta_{n}\right)  $. Thus, for each $i\in X$, we have%
\begin{equation}
\left(  \text{\# of times }i\text{ appears in }\beta\right)  =\left(  \text{\#
of }b\in\left[  n\right]  \text{ such that }\beta_{b}=i\right)  .
\label{sol.multinom.anagr.formal2.numbeta=}%
\end{equation}


Define a map%
\begin{align*}
f:\left[  n\right]   &  \rightarrow X,\\
a  &  \mapsto\beta_{a}.
\end{align*}


Define a map%
\begin{align*}
g:\left[  n\right]   &  \rightarrow X,\\
b  &  \mapsto\alpha_{b}.
\end{align*}


For each $i\in X$, we have%
\begin{align}
&  \left(  \text{\# of }a\in\left[  n\right]  \text{ such that }%
\underbrace{f\left(  a\right)  }_{\substack{=\beta_{a}\\\text{(by the
definition of }f\text{)}}}=i\right) \nonumber\\
&  =\left(  \text{\# of }a\in\left[  n\right]  \text{ such that }\beta
_{a}=i\right) \nonumber\\
&  =\left(  \text{\# of }b\in\left[  n\right]  \text{ such that }\beta
_{b}=i\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have renamed the
index }a\text{ as }b\right) \nonumber\\
&  =\left(  \text{\# of times }i\text{ appears in }\beta\right)
\label{sol.multinom.anagr.formal2.1}%
\end{align}
(by (\ref{sol.multinom.anagr.formal2.numbeta=})). Likewise, for each $i\in X$,
we have%
\begin{align}
&  \left(  \text{\# of }b\in\left[  n\right]  \text{ such that }g\left(
b\right)  =i\right) \nonumber\\
&  =\left(  \text{\# of times }i\text{ appears in }\alpha\right)  .
\label{sol.multinom.anagr.formal2.2}%
\end{align}
Now, for each $i\in X$, we have%
\begin{align*}
&  \left(  \text{\# of }a\in\left[  n\right]  \text{ such that }f\left(
a\right)  =i\right) \\
&  =\left(  \text{\# of times }i\text{ appears in }\beta\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{sol.multinom.anagr.formal2.1}%
)}\right) \\
&  =\left(  \text{\# of times }i\text{ appears in }\alpha\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{eq.exe.multinom.anagr.formal2.ass}%
)}\right) \\
&  =\left(  \text{\# of }b\in\left[  n\right]  \text{ such that }g\left(
b\right)  =i\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{sol.multinom.anagr.formal2.2})}\right)  .
\end{align*}
Hence, Theorem \ref{thm.multinom.anagr.formal2-gen} (applied to $A=\left[
n\right]  $ and $B=\left[  n\right]  $) yields that there exists a bijection
$\sigma:\left[  n\right]  \rightarrow\left[  n\right]  $ such that
$f=g\circ\sigma$. Consider this $\sigma$.

The map $\sigma$ is a bijection from $\left[  n\right]  $ to $\left[
n\right]  $. In other words, $\sigma$ is a permutation of $\left[  n\right]
$. Moreover, we have $\beta_{i}=\alpha_{\sigma\left(  i\right)  }$ for each
$i\in\left[  n\right]  $\ \ \ \ \footnote{\textit{Proof.} Let $i\in\left[
n\right]  $. The definition of $f$ yields $f\left(  i\right)  =\beta_{i}$.
Hence, $\beta_{i}=\underbrace{f}_{=g\circ\sigma}\left(  i\right)  =\left(
g\circ\sigma\right)  \left(  i\right)  =g\left(  \sigma\left(  i\right)
\right)  =\alpha_{\sigma\left(  i\right)  }$ (by the definition of $g$).
Qed.}. In other words, $\left(  \beta_{1},\beta_{2},\ldots,\beta_{n}\right)
=\left(  \alpha_{\sigma\left(  1\right)  },\alpha_{\sigma\left(  2\right)
},\ldots,\alpha_{\sigma\left(  n\right)  }\right)  $.

Hence, $\beta=\left(  \beta_{1},\beta_{2},\ldots,\beta_{n}\right)  =\left(
\alpha_{\sigma\left(  1\right)  },\alpha_{\sigma\left(  2\right)  }%
,\ldots,\alpha_{\sigma\left(  n\right)  }\right)  $. Thus, the $n$-tuple
$\beta$ is obtained from the $n$-tuple $\left(  \alpha_{1},\alpha_{2}%
,\ldots,\alpha_{n}\right)  $ by permuting its entries (namely, using the
permutation $\sigma$). In other words, $\beta$ is an anagram of $\left(
\alpha_{1},\alpha_{2},\ldots,\alpha_{n}\right)  $ (by the definition of an
anagram). In other words, $\beta$ is an anagram of $\alpha$ (since
$\alpha=\left(  \alpha_{1},\alpha_{2},\ldots,\alpha_{n}\right)  $). This
solves Exercise \ref{exe.multinom.anagr.formal2}.
\end{proof}

\subsection{Solution to Exercise \ref{exe.multinom.anagr-gen}}

To solve Exercise \ref{exe.multinom.anagr-gen}, we need to prove Proposition
\ref{prop.multinom.anagr-gen}. This proof is a straightforward generalization
of the proof of Proposition \ref{prop.multinom.anagr}; we give it here for the
sake of convenience:

\begin{proof}
[Proof of Proposition \ref{prop.multinom.anagr-gen}.]We define a \emph{good
tuple} to mean an $n$-tuple $\left(  u_{1},u_{2},\ldots,u_{n}\right)
\in\left[  k\right]  ^{n}$ satisfying%
\[
\left(  \text{\# of }a\in\left[  n\right]  \text{ such that }u_{a}=i\right)
=n_{i}\ \ \ \ \ \ \ \ \ \ \text{for each }i\in\left[  k\right]  .
\]
Then, Proposition \ref{prop.multinom.tups} shows that the \# of good tuples is
$\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}$.

Now, we shall show that the good tuples are precisely the anagrams of $\alpha
$. In order to do so, we must prove the following two claims:

\begin{statement}
\textit{Claim 1:} Each good tuple is an anagram of $\alpha$.
\end{statement}

\begin{statement}
\textit{Claim 2:} Each anagram of $\alpha$ is a good tuple.
\end{statement}

[\textit{Proof of Claim 1:} Let $\beta$ be a good tuple. Thus, $\beta$ is an
$n$-tuple $\left(  u_{1},u_{2},\ldots,u_{n}\right)  \in\left[  k\right]  ^{n}$
satisfying%
\begin{equation}
\left(  \text{\# of }a\in\left[  n\right]  \text{ such that }u_{a}=i\right)
=n_{i}\ \ \ \ \ \ \ \ \ \ \text{for each }i\in\left[  k\right]
\label{pf.prop.multinom.anagr-gen.c1.1}%
\end{equation}
(by the definition of a \textquotedblleft good tuple\textquotedblright).
Consider this $\left(  u_{1},u_{2},\ldots,u_{n}\right)  $. Hence,
$\beta=\left(  u_{1},u_{2},\ldots,u_{n}\right)  \in\left[  k\right]  ^{n}$.

For each $i\in\left[  k\right]  $, we have%
\begin{align*}
&  \left(  \text{\# of }a\in\left[  n\right]  \text{ such that }u_{a}=i\right)
\\
&  =n_{i}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.prop.multinom.anagr-gen.c1.1})}\right) \\
&  =\left(  \text{\# of times }i\text{ appears in }\alpha\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{eq.prop.multinom.anagr-gen.ass}%
)}\right)  .
\end{align*}
Hence, for each $i\in\left[  k\right]  $, we have%
\begin{align*}
&  \left(  \text{\# of times }i\text{ appears in }\alpha\right) \\
&  =\left(  \text{\# of }a\in\left[  n\right]  \text{ such that }%
u_{a}=i\right) \\
&  =\left(  \text{\# of times }i\text{ appears in }\left(  u_{1},u_{2}%
,\ldots,u_{n}\right)  \right) \\
&  =\left(  \text{\# of times }i\text{ appears in }\beta\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left(  u_{1},u_{2},\ldots
,u_{n}\right)  =\beta\right)  .
\end{align*}
In other words, for each $i\in\left[  k\right]  $, we have
\[
\left(  \text{\# of times }i\text{ appears in }\beta\right)  =\left(  \text{\#
of times }i\text{ appears in }\alpha\right)  .
\]


So we have $\alpha\in\left[  k\right]  ^{n}$ and $\beta\in\left[  k\right]
^{n}$, and we have shown that
\[
\left(  \text{\# of times }i\text{ appears in }\beta\right)  =\left(  \text{\#
of times }i\text{ appears in }\alpha\right)
\]
for each $i\in\left[  k\right]  $. Therefore, Exercise
\ref{exe.multinom.anagr.formal2} (applied to $X=\left[  k\right]  $) yields
that $\beta$ is an anagram of $\alpha$.

Forget that we fixed $\beta$. We thus have shown that each good tuple $\beta$
is an anagram of $\alpha$. This proves Claim 1.]

[\textit{Proof of Claim 2:} Let $\beta$ be an anagram of $\alpha$. Then, for
each $i\in\left[  k\right]  $, we have%
\begin{align}
&  \left(  \text{\# of times }i\text{ appears in }\beta\right) \nonumber\\
&  =\left(  \text{\# of times }i\text{ appears in }\alpha\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Exercise \ref{exe.multinom.anagr.formal1}%
, applied to }X=\left[  k\right]  \right) \nonumber\\
&  =n_{i}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{eq.prop.multinom.anagr-gen.ass})}\right)  .
\label{pf.prop.multinom.anagr-gen.c2.1}%
\end{align}


Moreover, $\beta$ is an anagram of $\alpha$, and therefore is an $n$-tuple
(since $\alpha$ is an $n$-tuple). Hence, we can write $\beta$ in the form
$\beta=\left(  u_{1},u_{2},\ldots,u_{n}\right)  $. Consider this $\left(
u_{1},u_{2},\ldots,u_{n}\right)  $. Hence, $\beta=\left(  u_{1},u_{2}%
,\ldots,u_{n}\right)  \in\left[  k\right]  ^{n}$. Moreover, for each
$i\in\left[  k\right]  $, we have%
\begin{align}
&  \left(  \text{\# of }a\in\left[  n\right]  \text{ such that }u_{a}=i\right)
\nonumber\\
&  =\left(  \text{\# of times }i\text{ appears in }\left(  u_{1},u_{2}%
,\ldots,u_{n}\right)  \right) \nonumber\\
&  =\left(  \text{\# of times }i\text{ appears in }\beta\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left(  u_{1},u_{2},\ldots
,u_{n}\right)  =\beta\right) \nonumber\\
&  =n_{i}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.prop.multinom.anagr-gen.c2.1})}\right)  .
\label{pf.prop.multinom.anagr-gen.c2.2}%
\end{align}


We have now shown that $\beta$ is an $n$-tuple $\left(  u_{1},u_{2}%
,\ldots,u_{n}\right)  \in\left[  k\right]  ^{n}$ satisfying%
\[
\left(  \text{\# of }a\in\left[  n\right]  \text{ such that }u_{a}=i\right)
=n_{i}\ \ \ \ \ \ \ \ \ \ \text{for each }i\in\left[  k\right]
\]
(by (\ref{pf.prop.multinom.anagr-gen.c2.2})). In other words, $\beta$ is a
good tuple (by the definition of a good tuple).

Forget that we fixed $\beta$. We thus have shown that if $\beta$ is an anagram
of $\alpha$, then $\beta$ is a good tuple. In other words, each anagram of
$\alpha$ is a good tuple. This proves Claim 2.]

Combining Claim 1 with Claim 2, we see that the anagrams of $\alpha$ are
precisely the good tuples. Hence,%
\[
\left(  \text{\# of anagrams of }\alpha\right)  =\left(  \text{\# of good
tuples}\right)  =\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}%
\]
(since we have already shown that the \# of good tuples is $\dbinom{n}%
{n_{1},n_{2},\ldots,n_{k}}$). In other words, the \# of distinct anagrams of
$\alpha$ is $\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}$. This proves Proposition
\ref{prop.multinom.anagr-gen}.
\end{proof}

\subsection{Solution to Exercise \ref{exe.multinom.rec}}

In order to solve Exercise \ref{exe.multinom.rec}, we need to prove Theorem
\ref{thm.multinom.rec}. We shall do this, after first proving a lemma:

\begin{lemma}
\label{lem.multinom.rec-lem}Let $n\in\mathbb{N}$ and $n_{1},n_{2},\ldots
,n_{k}\in\mathbb{N}$ be such that $n_{1}+n_{2}+\cdots+n_{k}=n>0$. Let
$i\in\left[  k\right]  $. Then,%
\[
\underbrace{\dbinom{n-1}{n_{1},\ldots,n_{i-1},n_{i}-1,n_{i+1},\ldots,n_{k}}%
}_{\text{This should be interpreted as }0\text{ if }n_{i}=0}=\dfrac{n_{i}}%
{n}\cdot\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}.
\]

\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.multinom.rec-lem}.]We first observe that the
multinomial coefficient $\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}$ is
well-defined, since $n_{1}+n_{2}+\cdots+n_{k}=n$. Its definition yields%
\begin{equation}
\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}=\dfrac{n!}{n_{1}!n_{2}!\cdots n_{k}!}.
\label{pf.lem.multinom.rec-lem.1}%
\end{equation}


If $n_{i}=0$, then the claim of Lemma \ref{lem.multinom.rec-lem} is easily
seen to be true\footnote{\textit{Proof.} Assume that $n_{i}=0$. Then,
\[
\underbrace{\dbinom{n-1}{n_{1},\ldots,n_{i-1},n_{i}-1,n_{i+1},\ldots,n_{k}}%
}_{\text{This should be interpreted as }0\text{ if }n_{i}=0}%
=0\ \ \ \ \ \ \ \ \ \ \left(  \text{since }n_{i}=0\right)  .
\]
Comparing this with%
\begin{align*}
\dfrac{n_{i}}{n}\cdot\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}  &  =\dfrac{0}%
{n}\cdot\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}\ \ \ \ \ \ \ \ \ \ \left(
\text{since }n_{i}=0\right) \\
&  =0,
\end{align*}
we obtain $\underbrace{\dbinom{n-1}{n_{1},\ldots,n_{i-1},n_{i}-1,n_{i+1}%
,\ldots,n_{k}}}_{\text{This should be interpreted as }0\text{ if }n_{i}%
=0}=\dfrac{n_{i}}{n}\cdot\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}$. Thus, Lemma
\ref{lem.multinom.rec-lem} is true (under the assumption that $n_{i}=0$).}.
Hence, for the rest of this proof, we WLOG that $n_{i}\neq0$. Therefore,
$n_{i}\geq1$ (since $n_{i}\in\mathbb{N}$), so that $n_{i}-1\in\mathbb{N}$.
Moreover, $n\geq1$ (since $n\in\mathbb{N}$ and $n>0$), so that $n-1\in
\mathbb{N}$. Proposition \ref{prop.factorial.rec} yields $n!=\left(
n-1\right)  !\cdot n$, so that $\left(  n-1\right)  !=n!/n$. Moreover,
Proposition \ref{prop.factorial.rec} (applied to $n_{i}$ instead of $n$)
yields $n_{i}!=\left(  n_{i}-1\right)  !\cdot n_{i}$, so that $\left(
n_{i}-1\right)  !=n_{i}!/n_{i}$.

The multinomial coefficient $\dbinom{n-1}{n_{1},\ldots,n_{i-1},n_{i}%
-1,n_{i+1},\ldots,n_{k}}$ is well-defined, since%
\[
n_{1}+\cdots+n_{i-1}+\left(  n_{i}-1\right)  +n_{i+1}+\cdots+n_{k}%
=\underbrace{\left(  n_{1}+n_{2}+\cdots+n_{k}\right)  }_{=n}-1=n-1
\]
(and since $n-1\in\mathbb{N}$ and since $n_{1},\ldots,n_{i-1},n_{i}%
-1,n_{i+1},\ldots,n_{k}\in\mathbb{N}$). Its definition yields%
\begin{align*}
&  \dbinom{n-1}{n_{1},\ldots,n_{i-1},n_{i}-1,n_{i+1},\ldots,n_{k}}\\
&  =\dfrac{\left(  n-1\right)  !}{n_{1}!\cdots n_{i-1}!\left(  n_{i}-1\right)
!n_{i+1}!\cdots n_{k}!}\\
&  =\dfrac{n!/n}{n_{1}!\cdots n_{i-1}!\cdot\left(  n_{i}!/n_{i}\right)  \cdot
n_{i+1}!\cdots n_{k}!}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since }\left(  n-1\right)  !=n!/n\\
\text{and }\left(  n_{i}-1\right)  !=n_{i}!/n_{i}%
\end{array}
\right) \\
&  =\dfrac{n_{i}}{n}\cdot\dfrac{n!}{n_{1}!\cdots n_{i-1}!\cdot n_{i}!\cdot
n_{i+1}!\cdots n_{k}!}\\
&  =\dfrac{n_{i}}{n}\cdot\underbrace{\dfrac{n!}{n_{1}!n_{2}!\cdots n_{k}!}%
}_{\substack{=\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}\\\text{(by
(\ref{pf.lem.multinom.rec-lem.1}))}}}\ \ \ \ \ \ \ \ \ \ \left(  \text{since
}n_{1}!\cdots n_{i-1}!\cdot n_{i}!\cdot n_{i+1}!\cdots n_{k}!=n_{1}%
!n_{2}!\cdots n_{k}!\right) \\
&  =\dfrac{n_{i}}{n}\cdot\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}.
\end{align*}
This proves Lemma \ref{lem.multinom.rec-lem}.
\end{proof}

We are now ready to prove Theorem \ref{thm.multinom.rec} (and thus solve
Exercise \ref{exe.multinom.rec}):

\begin{proof}
[Proof of Theorem \ref{thm.multinom.rec}.]We have%
\[
\sum_{i=1}^{k}\dfrac{n_{i}}{n}=\dfrac{\sum_{i=1}^{k}n_{i}}{n}%
=1\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\sum_{i=1}^{k}n_{i}=n_{1}%
+n_{2}+\cdots+n_{k}=n\right)  .
\]
Now,%
\begin{align*}
\sum_{i=1}^{k}\underbrace{\dbinom{n-1}{n_{1},\ldots,n_{i-1},n_{i}%
-1,n_{i+1},\ldots,n_{k}}}_{\substack{=\dfrac{n_{i}}{n}\cdot\dbinom{n}%
{n_{1},n_{2},\ldots,n_{k}}\\\text{(by Lemma \ref{lem.multinom.rec-lem})}}}  &
=\sum_{i=1}^{k}\dfrac{n_{i}}{n}\cdot\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}\\
&  =\underbrace{\left(  \sum_{i=1}^{k}\dfrac{n_{i}}{n}\right)  }_{=1}%
\cdot\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}\\
&  =\dbinom{n}{n_{1},n_{2},\ldots,n_{k}}.
\end{align*}
This proves Theorem \ref{thm.multinom.rec}.
\end{proof}

\subsection{Solution to Exercise \ref{exe.12fold.eqrel.un-k-tup-eq}}

Our solution to Exercise \ref{exe.12fold.eqrel.un-k-tup-eq} will rest on the
following two basic facts about permutations:

\begin{proposition}
\label{prop.perm.compose-perm}\textbf{(a)} If $\sigma_{1}$ and $\sigma_{2}$
are two permutations of a set $S$, then their composition $\sigma_{1}%
\circ\sigma_{2}$ is a permutation of $S$.

\textbf{(b)} If $\sigma$ is a permutation of a set $S$, then its inverse
$\sigma^{-1}$ is a permutation of $S$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.perm.compose-perm}.]Recall that a permutation
of a set $S$ is the same as a bijection from $S$ to $S$. Thus, Proposition
\ref{prop.perm.compose-perm} \textbf{(a)} follows from the well-known fact
that the composition of two bijections is a bijection. Likewise, Proposition
\ref{prop.perm.compose-perm} \textbf{(b)} follows from the fact that the
inverse of a bijection is a bijection.
\end{proof}

\begin{proof}
[Solution to Exercise \ref{exe.12fold.eqrel.un-k-tup-eq}.]For any two
$k$-tuples $\mathbf{p},\mathbf{q}\in A^{k}$, we have the logical equivalence
\begin{equation}
\left(  \mathbf{p}\underset{\operatorname{perm}}{\sim}\mathbf{q}\right)
\Longleftrightarrow\left(  \mathbf{p}\text{ is an anagram of }\mathbf{q}%
\right)  \label{sol.12fold.eqrel.un-k-tup-eq.1}%
\end{equation}
(by the definition of the relation $\underset{\operatorname{perm}}{\sim}$).
Using this, we quickly obtain the following two observations:

\begin{statement}
\textit{Observation 1:} Let $\left(  a_{1},a_{2},\ldots,a_{k}\right)  \in
A^{k}$ and $\left(  b_{1},b_{2},\ldots,b_{k}\right)  \in A^{k}$ be two
$k$-tuples such that $\left(  a_{1},a_{2},\ldots,a_{k}\right)
\underset{\operatorname{perm}}{\sim}\left(  b_{1},b_{2},\ldots,b_{k}\right)
$. Then, there exists a permutation $\pi$ of $\left[  k\right]  $ such that
$\left(  a_{1},a_{2},\ldots,a_{k}\right)  =\left(  b_{\pi\left(  1\right)
},b_{\pi\left(  2\right)  },\ldots,b_{\pi\left(  k\right)  }\right)  $.
\end{statement}

\begin{statement}
\textit{Observation 2:} Let $\left(  a_{1},a_{2},\ldots,a_{k}\right)  \in
A^{k}$ and $\left(  b_{1},b_{2},\ldots,b_{k}\right)  \in A^{k}$ be two
$k$-tuples, and let $\omega$ be a permutation of $\left[  k\right]  $ such
that $\left(  a_{1},a_{2},\ldots,a_{k}\right)  =\left(  b_{\omega\left(
1\right)  },b_{\omega\left(  2\right)  },\ldots,b_{\omega\left(  k\right)
}\right)  $. Then, $\left(  a_{1},a_{2},\ldots,a_{k}\right)
\underset{\operatorname{perm}}{\sim}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $.
\end{statement}

[\textit{Proof of Observation 1:} Applying
(\ref{sol.12fold.eqrel.un-k-tup-eq.1}) to $\mathbf{p}=\left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  $ and $\mathbf{q}=\left(  b_{1},b_{2},\ldots
,b_{k}\right)  $, we obtain the logical equivalence
\begin{align*}
&  \ \left(  \left(  a_{1},a_{2},\ldots,a_{k}\right)
\underset{\operatorname{perm}}{\sim}\left(  b_{1},b_{2},\ldots,b_{k}\right)
\right) \\
\Longleftrightarrow &  \ \left(  \left(  a_{1},a_{2},\ldots,a_{k}\right)
\text{ is an anagram of }\left(  b_{1},b_{2},\ldots,b_{k}\right)  \right)  .
\end{align*}
Hence, $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ is an anagram of $\left(
b_{1},b_{2},\ldots,b_{k}\right)  $ (since we have $\left(  a_{1},a_{2}%
,\ldots,a_{k}\right)  \underset{\operatorname{perm}}{\sim}\left(  b_{1}%
,b_{2},\ldots,b_{k}\right)  $). In other words, $\left(  a_{1},a_{2}%
,\ldots,a_{k}\right)  $ is a $k$-tuple of the form $\left(  b_{\pi\left(
1\right)  },b_{\pi\left(  2\right)  },\ldots,b_{\pi\left(  k\right)  }\right)
$, where $\pi$ is a permutation of $\left[  k\right]  $ (since an anagram of
$\left(  b_{1},b_{2},\ldots,b_{k}\right)  $ is defined to be a $k$-tuple of
the form $\left(  b_{\pi\left(  1\right)  },b_{\pi\left(  2\right)  }%
,\ldots,b_{\pi\left(  k\right)  }\right)  $, where $\pi$ is a permutation of
$\left[  k\right]  $). In other words, there exists a permutation $\pi$ of
$\left[  k\right]  $ such that $\left(  a_{1},a_{2},\ldots,a_{k}\right)
=\left(  b_{\pi\left(  1\right)  },b_{\pi\left(  2\right)  },\ldots
,b_{\pi\left(  k\right)  }\right)  $. This proves Observation 1.] \medskip

[\textit{Proof of Observation 2:} We have $\left(  a_{1},a_{2},\ldots
,a_{k}\right)  =\left(  b_{\omega\left(  1\right)  },b_{\omega\left(
2\right)  },\ldots,b_{\omega\left(  k\right)  }\right)  $. Hence, there exists
a permutation $\pi$ of $\left[  k\right]  $ such that $\left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  =\left(  b_{\pi\left(  1\right)  },b_{\pi\left(
2\right)  },\ldots,b_{\pi\left(  k\right)  }\right)  $ (namely, $\pi=\omega$).
In other words, the tuple $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ is a
$k$-tuple of the form $\left(  b_{\pi\left(  1\right)  },b_{\pi\left(
2\right)  },\ldots,b_{\pi\left(  k\right)  }\right)  $, where $\pi$ is a
permutation of $\left[  k\right]  $. In other words, the tuple $\left(
a_{1},a_{2},\ldots,a_{k}\right)  $ is an anagram of $\left(  b_{1}%
,b_{2},\ldots,b_{k}\right)  $ (since an anagram of $\left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  $ is defined to be a $k$-tuple of the form $\left(
b_{\pi\left(  1\right)  },b_{\pi\left(  2\right)  },\ldots,b_{\pi\left(
k\right)  }\right)  $, where $\pi$ is a permutation of $\left[  k\right]  $).

However, applying (\ref{sol.12fold.eqrel.un-k-tup-eq.1}) to $\mathbf{p}%
=\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ and $\mathbf{q}=\left(
b_{1},b_{2},\ldots,b_{k}\right)  $, we obtain the logical equivalence
\begin{align*}
&  \ \left(  \left(  a_{1},a_{2},\ldots,a_{k}\right)
\underset{\operatorname{perm}}{\sim}\left(  b_{1},b_{2},\ldots,b_{k}\right)
\right) \\
&  \Longleftrightarrow\ \left(  \left(  a_{1},a_{2},\ldots,a_{k}\right)
\text{ is an anagram of }\left(  b_{1},b_{2},\ldots,b_{k}\right)  \right)  .
\end{align*}
Therefore, we have $\left(  a_{1},a_{2},\ldots,a_{k}\right)
\underset{\operatorname{perm}}{\sim}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $
(since $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ is an anagram of $\left(
b_{1},b_{2},\ldots,b_{k}\right)  $). This proves Observation 2.] \medskip

Now, let us prove that the relation $\underset{\operatorname{perm}}{\sim}$ is
an equivalence relation. To that end, we need to prove that this relation
$\underset{\operatorname{perm}}{\sim}$is reflexive, symmetric and transitive.
We shall prove these three properties one by one: \medskip

[\textit{Proof of reflexivity:} We must show that the relation
$\underset{\operatorname{perm}}{\sim}$ is reflexive. In other words, we must
prove that every $a\in A^{k}$ satisfies $a\underset{\operatorname{perm}}{\sim
}a$.

So let $a\in A^{k}$ be arbitrary. Write this $k$-tuple $a$ in the form
$a=\left(  a_{1},a_{2},\ldots,a_{k}\right)  $.

Now, let $\operatorname*{id}$ denote the identity map $\operatorname*{id}%
\nolimits_{\left[  k\right]  }:\left[  k\right]  \rightarrow\left[  k\right]
$. This identity map $\operatorname*{id}$ is a permutation of $\left[
k\right]  $. Moreover, each $i\in\left[  k\right]  $ satisfies $a_{i}%
=a_{\operatorname*{id}\left(  i\right)  }$ (since $i=\operatorname*{id}\left(
i\right)  $). In other words, $\left(  a_{1},a_{2},\ldots,a_{k}\right)
=\left(  a_{\operatorname*{id}\left(  1\right)  },a_{\operatorname*{id}\left(
2\right)  },\ldots,a_{\operatorname*{id}\left(  k\right)  }\right)  $. Hence,
Observation 2 (applied to $\left(  b_{1},b_{2},\ldots,b_{k}\right)  =\left(
a_{1},a_{2},\ldots,a_{k}\right)  $ and $\omega=\operatorname*{id}$) yields
$\left(  a_{1},a_{2},\ldots,a_{k}\right)  \underset{\operatorname{perm}}{\sim
}\left(  a_{1},a_{2},\ldots,a_{k}\right)  $. In view of $a=\left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  $, we can rewrite this as
$a\underset{\operatorname{perm}}{\sim}a$.

We thus have shown that every $a\in A^{k}$ satisfies
$a\underset{\operatorname{perm}}{\sim}a$. In other words, the relation
$\underset{\operatorname{perm}}{\sim}$ is reflexive.] \medskip

[\textit{Proof of symmetry:} We must show that the relation
$\underset{\operatorname{perm}}{\sim}$ is symmetric. In other words, we must
prove that every $a,b\in A^{k}$ satisfying $a\underset{\operatorname{perm}%
}{\sim}b$ satisfy $b\underset{\operatorname{perm}}{\sim}a$.

So let $a,b\in A^{k}$ satisfy $a\underset{\operatorname{perm}}{\sim}b$. Write
the $k$-tuples $a$ and $b$ in the forms
\begin{equation}
a=\left(  a_{1},a_{2},\ldots,a_{k}\right)  \ \ \ \ \ \ \ \ \ \ \text{and}%
\ \ \ \ \ \ \ \ \ \ b=\left(  b_{1},b_{2},\ldots,b_{k}\right)  .
\label{sol.12fold.eqrel.un-k-tup-eq.s1}%
\end{equation}


We have $a\underset{\operatorname{perm}}{\sim}b$. In view of
(\ref{sol.12fold.eqrel.un-k-tup-eq.s1}), we can rewrite this as
\[
\left(  a_{1},a_{2},\ldots,a_{k}\right)  \underset{\operatorname{perm}}{\sim
}\left(  b_{1},b_{2},\ldots,b_{k}\right)  .
\]
Hence, Observation 1 shows that there exists a permutation $\pi$ of $\left[
k\right]  $ such that $\left(  a_{1},a_{2},\ldots,a_{k}\right)  =\left(
b_{\pi\left(  1\right)  },b_{\pi\left(  2\right)  },\ldots,b_{\pi\left(
k\right)  }\right)  $. Consider this $\pi$. Proposition
\ref{prop.perm.compose-perm} \textbf{(b)} (applied to $S=\left[  k\right]  $
and $\sigma=\pi$) yields that $\pi^{-1}$ is a permutation of $\left[
k\right]  $. Moreover, each $i\in\left[  k\right]  $ satisfies%
\begin{equation}
a_{i}=b_{\pi\left(  i\right)  } \label{sol.12fold.eqrel.un-k-tup-eq.s2}%
\end{equation}
(since $\left(  a_{1},a_{2},\ldots,a_{k}\right)  =\left(  b_{\pi\left(
1\right)  },b_{\pi\left(  2\right)  },\ldots,b_{\pi\left(  k\right)  }\right)
$).

Now, let $j\in\left[  k\right]  $. Then, $\pi^{-1}\left(  j\right)  \in\left[
k\right]  $. Thus, (\ref{sol.12fold.eqrel.un-k-tup-eq.s2}) (applied to
$i=\pi^{-1}\left(  j\right)  $) yields $a_{\pi^{-1}\left(  j\right)  }%
=b_{\pi\left(  \pi^{-1}\left(  j\right)  \right)  }=b_{j}$ (since $\pi\left(
\pi^{-1}\left(  j\right)  \right)  =j$). In other words, $b_{j}=a_{\pi
^{-1}\left(  j\right)  }$.

Forget that we fixed $j$. We thus have shown that $b_{j}=a_{\pi^{-1}\left(
j\right)  }$ for each $j\in\left[  k\right]  $. In other words,%
\[
\left(  b_{1},b_{2},\ldots,b_{k}\right)  =\left(  a_{\pi^{-1}\left(  1\right)
},a_{\pi^{-1}\left(  2\right)  },\ldots,a_{\pi^{-1}\left(  k\right)  }\right)
.
\]
Hence, Observation 2 (applied to $\left(  b_{1},b_{2},\ldots,b_{k}\right)  $,
$\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ and $\pi^{-1}$ instead of $\left(
a_{1},a_{2},\ldots,a_{k}\right)  $, $\left(  b_{1},b_{2},\ldots,b_{k}\right)
$ and $\omega$) yields $\left(  b_{1},b_{2},\ldots,b_{k}\right)
\underset{\operatorname{perm}}{\sim}\left(  a_{1},a_{2},\ldots,a_{k}\right)
$. In view of (\ref{sol.12fold.eqrel.un-k-tup-eq.s1}), we can rewrite this as
$b\underset{\operatorname{perm}}{\sim}a$.

We thus have shown that every $a,b\in A^{k}$ satisfying
$a\underset{\operatorname{perm}}{\sim}b$ satisfy
$b\underset{\operatorname{perm}}{\sim}a$. In other words, the relation
$\underset{\operatorname{perm}}{\sim}$ is symmetric.] \medskip

[\textit{Proof of transitivity:} We must show that the relation
$\underset{\operatorname{perm}}{\sim}$ is transitive. In other words, we must
prove that every $a,b,c\in A^{k}$ satisfying $a\underset{\operatorname{perm}%
}{\sim}b$ and $b\underset{\operatorname{perm}}{\sim}c$ satisfy
$a\underset{\operatorname{perm}}{\sim}c$.

So let $a,b,c\in A^{k}$ satisfy $a\underset{\operatorname{perm}}{\sim}b$ and
$b\underset{\operatorname{perm}}{\sim}c$. Write the $k$-tuples $a$, $b$ and
$c$ in the forms
\begin{align}
a  &  =\left(  a_{1},a_{2},\ldots,a_{k}\right)
,\label{sol.12fold.eqrel.un-k-tup-eq.t1}\\
b  &  =\left(  b_{1},b_{2},\ldots,b_{k}\right)
,\ \ \ \ \ \ \ \ \ \ \text{and}\label{sol.12fold.eqrel.un-k-tup-eq.t2}\\
c  &  =\left(  c_{1},c_{2},\ldots,c_{k}\right)  .
\label{sol.12fold.eqrel.un-k-tup-eq.t3}%
\end{align}


We have $a\underset{\operatorname{perm}}{\sim}b$. In view of
(\ref{sol.12fold.eqrel.un-k-tup-eq.t1}) and
(\ref{sol.12fold.eqrel.un-k-tup-eq.t2}), we can rewrite this as
\[
\left(  a_{1},a_{2},\ldots,a_{k}\right)  \underset{\operatorname{perm}}{\sim
}\left(  b_{1},b_{2},\ldots,b_{k}\right)  .
\]
Hence, Observation 1 shows that there exists a permutation $\pi$ of $\left[
k\right]  $ such that $\left(  a_{1},a_{2},\ldots,a_{k}\right)  =\left(
b_{\pi\left(  1\right)  },b_{\pi\left(  2\right)  },\ldots,b_{\pi\left(
k\right)  }\right)  $. Let us denote this $\pi$ by $\sigma$. Thus, $\sigma$ is
a permutation of $\left[  k\right]  $ and satisfies $\left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  =\left(  b_{\sigma\left(  1\right)  }%
,b_{\sigma\left(  2\right)  },\ldots,b_{\sigma\left(  k\right)  }\right)  $.
Each $i\in\left[  k\right]  $ satisfies%
\begin{equation}
a_{i}=b_{\sigma\left(  i\right)  } \label{sol.12fold.eqrel.un-k-tup-eq.t4}%
\end{equation}
(since $\left(  a_{1},a_{2},\ldots,a_{k}\right)  =\left(  b_{\sigma\left(
1\right)  },b_{\sigma\left(  2\right)  },\ldots,b_{\sigma\left(  k\right)
}\right)  $).

We have $b\underset{\operatorname{perm}}{\sim}c$. In view of
(\ref{sol.12fold.eqrel.un-k-tup-eq.t2}) and
(\ref{sol.12fold.eqrel.un-k-tup-eq.t3}), we can rewrite this as
\[
\left(  b_{1},b_{2},\ldots,b_{k}\right)  \underset{\operatorname{perm}}{\sim
}\left(  c_{1},c_{2},\ldots,c_{k}\right)  .
\]
Therefore, Observation 1 (applied to $\left(  b_{1},b_{2},\ldots,b_{k}\right)
$ and $\left(  c_{1},c_{2},\ldots,c_{k}\right)  $ instead of $\left(
a_{1},a_{2},\ldots,a_{k}\right)  $ and $\left(  b_{1},b_{2},\ldots
,b_{k}\right)  $) shows that there exists a permutation $\pi$ of $\left[
k\right]  $ such that $\left(  b_{1},b_{2},\ldots,b_{k}\right)  =\left(
c_{\pi\left(  1\right)  },c_{\pi\left(  2\right)  },\ldots,c_{\pi\left(
k\right)  }\right)  $. Consider this $\pi$. Each $j\in\left[  k\right]  $
satisfies%
\begin{equation}
b_{j}=c_{\pi\left(  j\right)  } \label{sol.12fold.eqrel.un-k-tup-eq.t5}%
\end{equation}
(since $\left(  b_{1},b_{2},\ldots,b_{k}\right)  =\left(  c_{\pi\left(
1\right)  },c_{\pi\left(  2\right)  },\ldots,c_{\pi\left(  k\right)  }\right)
$).

Note that $\pi$ and $\sigma$ are permutations of $\left[  k\right]  $. Hence,
their composition $\pi\circ\sigma$ is a permutation of $\left[  k\right]  $ as
well (by Proposition \ref{prop.perm.compose-perm} \textbf{(a)}, applied to
$S=\left[  k\right]  $, $\sigma_{1}=\pi$ and $\sigma_{2}=\sigma$).

Now, let $i\in\left[  k\right]  $. Then, $\sigma\left(  i\right)  \in\left[
k\right]  $. Thus, (\ref{sol.12fold.eqrel.un-k-tup-eq.t5}) (applied to
$j=\sigma\left(  i\right)  $) yields $b_{\sigma\left(  i\right)  }%
=c_{\pi\left(  \sigma\left(  i\right)  \right)  }=c_{\left(  \pi\circ
\sigma\right)  \left(  i\right)  }$ (since $\pi\left(  \sigma\left(  i\right)
\right)  =\left(  \pi\circ\sigma\right)  \left(  i\right)  $). However,
(\ref{sol.12fold.eqrel.un-k-tup-eq.t4}) yields $a_{i}=b_{\sigma\left(
i\right)  }=c_{\left(  \pi\circ\sigma\right)  \left(  i\right)  }$.

Forget that we fixed $i$. We thus have shown that $a_{i}=c_{\left(  \pi
\circ\sigma\right)  \left(  i\right)  }$ for each $i\in\left[  k\right]  $. In
other words,%
\[
\left(  a_{1},a_{2},\ldots,a_{k}\right)  =\left(  c_{\left(  \pi\circ
\sigma\right)  \left(  1\right)  },c_{\left(  \pi\circ\sigma\right)  \left(
2\right)  },\ldots,c_{\left(  \pi\circ\sigma\right)  \left(  k\right)
}\right)  .
\]
Hence, Observation 2 (applied to $\left(  c_{1},c_{2},\ldots,c_{k}\right)  $
and $\pi\circ\sigma$ instead of $\left(  b_{1},b_{2},\ldots,b_{k}\right)  $
and $\omega$) yields $\left(  a_{1},a_{2},\ldots,a_{k}\right)
\underset{\operatorname{perm}}{\sim}\left(  c_{1},c_{2},\ldots,c_{k}\right)  $
(since $\pi\circ\sigma$ is a permutation of $\left[  k\right]  $). In view of
(\ref{sol.12fold.eqrel.un-k-tup-eq.t1}) and
(\ref{sol.12fold.eqrel.un-k-tup-eq.t3}), we can rewrite this as
$a\underset{\operatorname{perm}}{\sim}c$.

We thus have shown that every $a,b,c\in A^{k}$ satisfying
$a\underset{\operatorname{perm}}{\sim}b$ and $b\underset{\operatorname{perm}%
}{\sim}c$ satisfy $a\underset{\operatorname{perm}}{\sim}c$. In other words,
the relation $\underset{\operatorname{perm}}{\sim}$ is transitive.] \medskip

We have now proved that the relation $\underset{\operatorname{perm}}{\sim}$ is
reflexive, symmetric and transitive. In other words, this relation
$\underset{\operatorname{perm}}{\sim}$ is an equivalence relation. This solves
Exercise \ref{exe.12fold.eqrel.un-k-tup-eq}.
\end{proof}

\subsection{Solution to Exercise \ref{exe.12fold.eqrel.un-k-tup}}

In order to solve Exercise \ref{exe.12fold.eqrel.un-k-tup}, we first derive a
few properties of multisubsets. The first one is a kind of converse to
Exercise \ref{exe.mulsub.size1}:

\begin{proposition}
\label{prop.mulsub.exist-list}Let $T$ be a set. Let $m\in\mathbb{N}$. Let $S$
be a multisubset of $T$ having size $m$. Then, there exists an $m$-tuple
$\left(  s_{1},s_{2},\ldots,s_{m}\right)  $ of elements of $T$ satisfying
$\left\{  s_{1},s_{2},\ldots,s_{m}\right\}  _{\operatorname*{multi}}=S$.
\end{proposition}

Note that this proposition is a weaker version of Proposition
\ref{prop.mulsub.inclist} (weaker because it neither provides for $s_{1}\leq
s_{2}\leq\cdots\leq s_{m}$ nor claims uniqueness), which however has the
advantage of holding for any set $T$ (rather than only for sets of integers).

\begin{proof}
[Proof of Proposition \ref{prop.mulsub.exist-list}.]We shall prove Proposition
\ref{prop.mulsub.exist-list} by induction on $m$:

\textit{Induction base:} Proposition \ref{prop.mulsub.exist-list} holds for
$m=0$\ \ \ \ \footnote{\textit{Proof.} Let $T$ be a set. Let $S$ be a
multisubset of $T$ having size $0$. We must prove that there exists a
$0$-tuple $\left(  s_{1},s_{2},\ldots,s_{0}\right)  $ of elements of $T$
satisfying $\left\{  s_{1},s_{2},\ldots,s_{0}\right\}  _{\operatorname*{multi}%
}=S$.
\par
The multisubset $S$ has size $0$. In other words, $\left\vert S\right\vert =0$
(since $\left\vert S\right\vert $ denotes the size of $S$). Hence, Proposition
\ref{prop.mulsub.inclist.empty} \textbf{(a)} (applied to $f=S$) yields
$S=\left\{  {}\right\}  _{\operatorname*{multi}}$. Thus, $\left\{  {}\right\}
_{\operatorname*{multi}}=S$. In other words, if we denote the $0$-tuple
$\left(  {}\right)  $ by $\left(  s_{1},s_{2},\ldots,s_{0}\right)  $, then
$\left\{  s_{1},s_{2},\ldots,s_{0}\right\}  _{\operatorname*{multi}}=S$.
\par
Hence, there exists a $0$-tuple $\left(  s_{1},s_{2},\ldots,s_{0}\right)  $ of
elements of $T$ satisfying $\left\{  s_{1},s_{2},\ldots,s_{0}\right\}
_{\operatorname*{multi}}=S$ (namely, the $0$-tuple $\left(  {}\right)  $).
\par
Forget that we fixed $T$ and $S$. We thus have shown that if $T$ is a set, and
if $S$ is a multisubset of $T$ having size $0$, then there exists a $0$-tuple
$\left(  s_{1},s_{2},\ldots,s_{0}\right)  $ of elements of $T$ satisfying
$\left\{  s_{1},s_{2},\ldots,s_{0}\right\}  _{\operatorname*{multi}}=S$. In
other words, Proposition \ref{prop.mulsub.exist-list} holds for $m=0$.}. This
completes the induction base.

\textit{Induction step:} Let $g\in\mathbb{N}$. Assume that Proposition
\ref{prop.mulsub.exist-list} holds for $m=g$. We shall now show that
Proposition \ref{prop.mulsub.exist-list} holds for $m=g+1$.

We have assumed that Proposition \ref{prop.mulsub.exist-list} holds for $m=g$.
In other words,%
\begin{equation}
\left(
\begin{array}
[c]{c}%
\text{if }T\text{ is a set, and if }S\text{ is a multisubset of }T\\
\text{having size }g\text{, then there exists}\\
\text{a }g\text{-tuple }\left(  s_{1},s_{2},\ldots,s_{g}\right)  \text{ of
elements of }T\\
\text{satisfying }\left\{  s_{1},s_{2},\ldots,s_{g}\right\}
_{\operatorname*{multi}}=S
\end{array}
\right)  . \label{pf.prop.mulsub.exist-list.IH}%
\end{equation}


Now, let $T$ be a set, and let $S$ be a multisubset of $T$ having size $g+1$.
We want to prove that there exists a $\left(  g+1\right)  $-tuple $\left(
s_{1},s_{2},\ldots,s_{g+1}\right)  $ of elements of $T$ satisfying $\left\{
s_{1},s_{2},\ldots,s_{g+1}\right\}  _{\operatorname*{multi}}=S$.

We shall use Definition \ref{def.mulsub.inc}, Definition
\ref{def.mulsub.union}, Definition \ref{def.mulsub.diff} and Definition
\ref{def.mulsub.Supp}.

We have assumed that $S$ has size $g+1$. In other words, $\left\vert
S\right\vert =g+1$ (since $\left\vert S\right\vert $ denotes the size of $S$).
Thus, $\left\vert S\right\vert =g+1>g\geq0$. Hence, Proposition
\ref{prop.mulsub.Supp3} \textbf{(c)} (applied to $f=S$) shows that
$\operatorname*{Supp}S$ is a finite nonempty subset of $T$. Hence, there
exists some $u\in\operatorname*{Supp}S$ (since $\operatorname*{Supp}S$ is
nonempty). Consider this $u$.

Now, Proposition \ref{prop.mulsub.Supp2} \textbf{(a)} (applied to $f=S$)
yields $\left\{  u\right\}  _{\operatorname*{multi}}\subseteq S$. Also,
Proposition \ref{prop.mulsub.Supp2} \textbf{(b)} (applied to $f=S$) yields
$\left\vert S\setminus\left\{  u\right\}  _{\operatorname*{multi}}\right\vert
=\left\vert S\right\vert -1=g$ (since $\left\vert S\right\vert =g+1$). In
other words, the multisubset $S\setminus\left\{  u\right\}
_{\operatorname*{multi}}$ of $T$ has size $g$.

Hence, (\ref{pf.prop.mulsub.exist-list.IH}) (applied to $S\setminus\left\{
u\right\}  _{\operatorname*{multi}}$ instead of $S$) shows that there exists a
$g$-tuple $\left(  s_{1},s_{2},\ldots,s_{g}\right)  $ of elements of $T$
satisfying $\left\{  s_{1},s_{2},\ldots,s_{g}\right\}  _{\operatorname*{multi}%
}=S\setminus\left\{  u\right\}  _{\operatorname*{multi}}$. Let us pick such a
$g$-tuple $\left(  s_{1},s_{2},\ldots,s_{g}\right)  $ and denote it by
$\left(  t_{1},t_{2},\ldots,t_{g}\right)  $.

We extend this $g$-tuple $\left(  t_{1},t_{2},\ldots,t_{g}\right)  $ to a
$\left(  g+1\right)  $-tuple $\left(  t_{1},t_{2},\ldots,t_{g+1}\right)  $ by
setting $t_{g+1}=u$. Thus, $t_{g+1}=u\in\operatorname*{Supp}S\subseteq T$
(since $\operatorname*{Supp}S$ is a subset of $T$). Therefore, $\left\{
t_{g+1}\right\}  \subseteq T$.

We have defined $\left(  t_{1},t_{2},\ldots,t_{g}\right)  $ as a $g$-tuple
$\left(  s_{1},s_{2},\ldots,s_{g}\right)  $ of elements of $T$ satisfying
$\left\{  s_{1},s_{2},\ldots,s_{g}\right\}  _{\operatorname*{multi}%
}=S\setminus\left\{  u\right\}  _{\operatorname*{multi}}$. In other words,
$\left(  t_{1},t_{2},\ldots,t_{g}\right)  $ is a $g$-tuple of elements of $T$
and satisfies
\begin{equation}
\left\{  t_{1},t_{2},\ldots,t_{g}\right\}  _{\operatorname*{multi}}%
=S\setminus\left\{  u\right\}  _{\operatorname*{multi}}.
\label{pf.prop.mulsub.exist-list.1}%
\end{equation}


Note that $t_{1},t_{2},\ldots,t_{g}$ are elements of $T$ (since $\left(
t_{1},t_{2},\ldots,t_{g}\right)  $ is a $g$-tuple of elements of $T$).
Therefore, $\left\{  t_{1},t_{2},\ldots,t_{g}\right\}  \subseteq T$.

Next, we shall prove that%
\begin{equation}
S=\left\{  t_{1},t_{2},\ldots,t_{g+1}\right\}  _{\operatorname*{multi}}.
\label{pf.prop.mulsub.exist-list.2}%
\end{equation}


[\textit{Proof of (\ref{pf.prop.mulsub.exist-list.2}):} We have $\left\{
u\right\}  _{\operatorname*{multi}}\subseteq S$ and thus $\left(
S\setminus\left\{  u\right\}  _{\operatorname*{multi}}\right)  \cup\left\{
u\right\}  _{\operatorname*{multi}}=S$ (by Proposition \ref{prop.mulsub.diff}
\textbf{(b)}, applied to $\left\{  u\right\}  _{\operatorname*{multi}}$ and
$S$ instead of $f$ and $g$). Thus,%
\begin{align*}
S  &  =\underbrace{\left(  S\setminus\left\{  u\right\}
_{\operatorname*{multi}}\right)  }_{\substack{=\left\{  t_{1},t_{2}%
,\ldots,t_{g}\right\}  _{\operatorname*{multi}}\\\text{(by
(\ref{pf.prop.mulsub.exist-list.1}))}}}\cup\left\{  \underbrace{u}_{=t_{g+1}%
}\right\}  _{\operatorname*{multi}}=\left\{  t_{1},t_{2},\ldots,t_{g}\right\}
_{\operatorname*{multi}}\cup\left\{  t_{g+1}\right\}  _{\operatorname*{multi}%
}\\
&  =\left\{  t_{1},t_{2},\ldots,t_{g},t_{g+1}\right\}  _{\operatorname*{multi}%
}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Proposition \ref{prop.mulsub.union.list}, applied to the numbers
}g\text{ and }1\text{ and}\\
\text{the }g\text{-tuple }\left(  t_{1},t_{2},\ldots,t_{g}\right)  \text{ and
the }1\text{-tuple }\left(  t_{g+1}\right)  \text{ instead of the numbers }k\\
\text{and }\ell\text{ and the }k\text{-tuple }\left(  a_{1},a_{2},\ldots
,a_{k}\right)  \text{ and the }\ell\text{-tuple }\left(  b_{1},b_{2}%
,\ldots,b_{\ell}\right)
\end{array}
\right) \\
&  =\left\{  t_{1},t_{2},\ldots,t_{g+1}\right\}  _{\operatorname*{multi}}.
\end{align*}
This proves (\ref{pf.prop.mulsub.exist-list.1}).]

Clearly,
\[
\left\{  t_{1},t_{2},\ldots,t_{g+1}\right\}  =\underbrace{\left\{  t_{1}%
,t_{2},\ldots,t_{g}\right\}  }_{\subseteq T}\cup\underbrace{\left\{
t_{g+1}\right\}  }_{\subseteq T}\subseteq T\cup T=T.
\]
Thus, $t_{1},t_{2},\ldots,t_{g+1}$ are elements of the set $T$. Hence,
$\left(  t_{1},t_{2},\ldots,t_{g+1}\right)  $ is a $\left(  g+1\right)
$-tuple of elements of $T$.

Altogether, we have now shown that $\left(  t_{1},t_{2},\ldots,t_{g+1}\right)
$ is a $\left(  g+1\right)  $-tuple of elements of $T$ and satisfies $\left\{
t_{1},t_{2},\ldots,t_{g+1}\right\}  _{\operatorname*{multi}}=S$ (by
(\ref{pf.prop.mulsub.exist-list.2})). Hence, there exists a $\left(
g+1\right)  $-tuple $\left(  s_{1},s_{2},\ldots,s_{g+1}\right)  $ of elements
of $T$ satisfying $\left\{  s_{1},s_{2},\ldots,s_{g+1}\right\}
_{\operatorname*{multi}}=S$ (namely, the $\left(  g+1\right)  $-tuple $\left(
t_{1},t_{2},\ldots,t_{g+1}\right)  $).

Forget that we fixed $T$ and $S$. We thus have shown that
\[
\left(
\begin{array}
[c]{c}%
\text{if }T\text{ is a set, and if }S\text{ is a multisubset of }T\\
\text{having size }g+1\text{, then there exists}\\
\text{a }\left(  g+1\right)  \text{-tuple }\left(  s_{1},s_{2},\ldots
,s_{g+1}\right)  \text{ of elements of }T\\
\text{satisfying }\left\{  s_{1},s_{2},\ldots,s_{g+1}\right\}
_{\operatorname*{multi}}=S
\end{array}
\right)  .
\]
In other words, Proposition \ref{prop.mulsub.exist-list} holds for $m=g+1$.
This completes the induction step. Hence, Proposition
\ref{prop.mulsub.exist-list} is proven by induction.
\end{proof}

Our next proposition is an easy consequence of Exercise
\ref{exe.multinom.anagr.formal1}:

\begin{proposition}
\label{prop.12fold.eqrel.un-k-tup.1}Let $A$ be a set, and let $k\in\mathbb{N}%
$. Let $\left(  a_{1},a_{2},\ldots,a_{k}\right)  \in A^{k}$ and $\left(
b_{1},b_{2},\ldots,b_{k}\right)  \in A^{k}$ be two $k$-tuples of elements of
$A$ that satisfy
\[
\left(  a_{1},a_{2},\ldots,a_{k}\right)  \underset{\operatorname{perm}}{\sim
}\left(  b_{1},b_{2},\ldots,b_{k}\right)  .
\]
Then,%
\[
\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}=\left\{
b_{1},b_{2},\ldots,b_{k}\right\}  _{\operatorname*{multi}}.
\]

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.12fold.eqrel.un-k-tup.1}.]For any two
$k$-tuples $\mathbf{p}\in A^{k}$ and $\mathbf{q}\in A^{k}$, we have the
logical equivalence%
\[
\left(  \mathbf{p}\underset{\operatorname{perm}}{\sim}\mathbf{q}\right)
\Longleftrightarrow\left(  \mathbf{p}\text{ is an anagram of }\mathbf{q}%
\right)
\]
(by the definition of the relation $\underset{\operatorname{perm}}{\sim}$).
Applying this to $\mathbf{p}=\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ and
$\mathbf{q}=\left(  b_{1},b_{2},\ldots,b_{k}\right)  $, we obtain the
equivalence%
\begin{align*}
&  \ \left(  \left(  a_{1},a_{2},\ldots,a_{k}\right)
\underset{\operatorname{perm}}{\sim}\left(  b_{1},b_{2},\ldots,b_{k}\right)
\right) \\
&  \Longleftrightarrow\ \left(  \left(  a_{1},a_{2},\ldots,a_{k}\right)
\text{ is an anagram of }\left(  b_{1},b_{2},\ldots,b_{k}\right)  \right)  .
\end{align*}
Hence, $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ is an anagram of $\left(
b_{1},b_{2},\ldots,b_{k}\right)  $ (since we have $\left(  a_{1},a_{2}%
,\ldots,a_{k}\right)  \underset{\operatorname{perm}}{\sim}\left(  b_{1}%
,b_{2},\ldots,b_{k}\right)  $). Thus, each $t\in A$ satisfies%
\begin{align}
&  \left(  \text{\# of times }t\text{ appears in }\left(  a_{1},a_{2}%
,\ldots,a_{k}\right)  \right) \nonumber\\
&  =\left(  \text{\# of times }t\text{ appears in }\left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  \right)  \label{pf.prop.12fold.eqrel.un-k-tup.1.1}%
\end{align}
(by Exercise \ref{exe.multinom.anagr.formal1}, applied to $X=A$, $n=k$,
$\alpha=\left(  b_{1},b_{2},\ldots,b_{k}\right)  $, $\beta=\left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  $ and $i=t$).

Both $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}$ and
$\left\{  b_{1},b_{2},\ldots,b_{k}\right\}  _{\operatorname*{multi}}$ are
multisubsets of $A$. Hence, both $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}$ and $\left\{  b_{1},b_{2},\ldots,b_{k}\right\}
_{\operatorname*{multi}}$ are maps from $A$ to $\mathbb{N}$ (since any
multisubset of $A$ is a map from $A$ to $\mathbb{N}$).

Definition \ref{def.mulsub.a1a2ak} (applied to $T=A$) says that the
multisubset $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}$ is defined as the map
\begin{align*}
A  &  \rightarrow\mathbb{N},\\
t  &  \mapsto\left(  \text{\# of }i\in\left[  k\right]  \text{ satisfying
}a_{i}=t\right)  .
\end{align*}
Thus, for each $t\in A$, we have%
\begin{equation}
\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}\left(
t\right)  =\left(  \text{\# of }i\in\left[  k\right]  \text{ satisfying }%
a_{i}=t\right)  . \label{pf.prop.12fold.eqrel.un-k-tup.1.2}%
\end{equation}


Similarly, for each $t\in A$, we have%
\begin{equation}
\left\{  b_{1},b_{2},\ldots,b_{k}\right\}  _{\operatorname*{multi}}\left(
t\right)  =\left(  \text{\# of }i\in\left[  k\right]  \text{ satisfying }%
b_{i}=t\right)  . \label{pf.prop.12fold.eqrel.un-k-tup.1.3}%
\end{equation}


Hence, for each $t\in A$, we have%
\begin{align*}
\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}\left(
t\right)   &  =\left(  \text{\# of }i\in\left[  k\right]  \text{ satisfying
}a_{i}=t\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.prop.12fold.eqrel.un-k-tup.1.2})}\right) \\
&  =\left(  \text{\# of times }t\text{ appears in }\left(  a_{1},a_{2}%
,\ldots,a_{k}\right)  \right) \\
&  =\left(  \text{\# of times }t\text{ appears in }\left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  \right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.prop.12fold.eqrel.un-k-tup.1.1})}\right) \\
&  =\left(  \text{\# of }i\in\left[  k\right]  \text{ satisfying }%
b_{i}=t\right) \\
&  =\left\{  b_{1},b_{2},\ldots,b_{k}\right\}  _{\operatorname*{multi}}\left(
t\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.prop.12fold.eqrel.un-k-tup.1.3})}\right)  .
\end{align*}
This shows that $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}=\left\{  b_{1},b_{2},\ldots,b_{k}\right\}
_{\operatorname*{multi}}$ (because both $\left\{  a_{1},a_{2},\ldots
,a_{k}\right\}  _{\operatorname*{multi}}$ and $\left\{  b_{1},b_{2}%
,\ldots,b_{k}\right\}  _{\operatorname*{multi}}$ are maps from $A$ to
$\mathbb{N}$). Thus, Proposition \ref{prop.12fold.eqrel.un-k-tup.1} is proven.
\end{proof}

The converse of Proposition \ref{prop.12fold.eqrel.un-k-tup.1} is an easy
consequence of Exercise \ref{exe.multinom.anagr.formal2}:

\begin{proposition}
\label{prop.12fold.eqrel.un-k-tup.2}Let $A$ be a set, and let $k\in\mathbb{N}%
$. Let $\left(  a_{1},a_{2},\ldots,a_{k}\right)  \in A^{k}$ and $\left(
b_{1},b_{2},\ldots,b_{k}\right)  \in A^{k}$ be two $k$-tuples of elements of
$A$ that satisfy
\[
\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}=\left\{
b_{1},b_{2},\ldots,b_{k}\right\}  _{\operatorname*{multi}}.
\]
Then,%
\[
\left(  a_{1},a_{2},\ldots,a_{k}\right)  \underset{\operatorname{perm}}{\sim
}\left(  b_{1},b_{2},\ldots,b_{k}\right)  .
\]

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.12fold.eqrel.un-k-tup.2}.]Definition
\ref{def.mulsub.a1a2ak} (applied to $T=A$) says that the multisubset $\left\{
a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}$ of $A$ is defined
as the map
\begin{align*}
A  &  \rightarrow\mathbb{N},\\
t  &  \mapsto\left(  \text{\# of }i\in\left[  k\right]  \text{ satisfying
}a_{i}=t\right)  .
\end{align*}
Thus, for each $t\in A$, we have%
\begin{equation}
\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}\left(
t\right)  =\left(  \text{\# of }i\in\left[  k\right]  \text{ satisfying }%
a_{i}=t\right)  . \label{pf.prop.12fold.eqrel.un-k-tup.2.1}%
\end{equation}


Similarly, for each $t\in A$, we have%
\begin{equation}
\left\{  b_{1},b_{2},\ldots,b_{k}\right\}  _{\operatorname*{multi}}\left(
t\right)  =\left(  \text{\# of }i\in\left[  k\right]  \text{ satisfying }%
b_{i}=t\right)  . \label{pf.prop.12fold.eqrel.un-k-tup.2.2}%
\end{equation}


Now, for each $t\in A$, we have%
\begin{align*}
&  \left(  \text{\# of times }t\text{ appears in }\left(  a_{1},a_{2}%
,\ldots,a_{k}\right)  \right) \\
&  =\left(  \text{\# of }i\in\left[  k\right]  \text{ satisfying }%
a_{i}=t\right) \\
&  =\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}\left(
t\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.prop.12fold.eqrel.un-k-tup.2.1})}\right) \\
&  =\left\{  b_{1},b_{2},\ldots,b_{k}\right\}  _{\operatorname*{multi}}\left(
t\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left\{  a_{1},a_{2}%
,\ldots,a_{k}\right\}  _{\operatorname*{multi}}=\left\{  b_{1},b_{2}%
,\ldots,b_{k}\right\}  _{\operatorname*{multi}}\right) \\
&  =\left(  \text{\# of }i\in\left[  k\right]  \text{ satisfying }%
b_{i}=t\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.prop.12fold.eqrel.un-k-tup.2.2})}\right) \\
&  =\left(  \text{\# of times }t\text{ appears in }\left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  \right)  .
\end{align*}
Renaming the index $t$ as $i$ in this sentence, we obtain the following: For
each $i\in A$, we have
\[
\left(  \text{\# of times }i\text{ appears in }\left(  a_{1},a_{2}%
,\ldots,a_{k}\right)  \right)  =\left(  \text{\# of times }i\text{ appears in
}\left(  b_{1},b_{2},\ldots,b_{k}\right)  \right)  .
\]


Now, $\left(  b_{1},b_{2},\ldots,b_{k}\right)  \in A^{k}$ and $\left(
a_{1},a_{2},\ldots,a_{k}\right)  \in A^{k}$ are two $k$-tuples, and we know
that
\[
\left(  \text{\# of times }i\text{ appears in }\left(  a_{1},a_{2}%
,\ldots,a_{k}\right)  \right)  =\left(  \text{\# of times }i\text{ appears in
}\left(  b_{1},b_{2},\ldots,b_{k}\right)  \right)
\]
for each $i\in A$ (according to the previous sentence). Hence, Exercise
\ref{exe.multinom.anagr.formal2} (applied to $X=A$, $n=k$, $\alpha=\left(
b_{1},b_{2},\ldots,b_{k}\right)  $ and $\beta=\left(  a_{1},a_{2},\ldots
,a_{k}\right)  $) shows that $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ is an
anagram of $\left(  b_{1},b_{2},\ldots,b_{k}\right)  $.

For any two $k$-tuples $\mathbf{p}\in A^{k}$ and $\mathbf{q}\in A^{k}$, we
have the logical equivalence%
\[
\left(  \mathbf{p}\underset{\operatorname{perm}}{\sim}\mathbf{q}\right)
\Longleftrightarrow\left(  \mathbf{p}\text{ is an anagram of }\mathbf{q}%
\right)
\]
(by the definition of the relation $\underset{\operatorname{perm}}{\sim}$).
Applying this to $\mathbf{p}=\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ and
$\mathbf{q}=\left(  b_{1},b_{2},\ldots,b_{k}\right)  $, we obtain the
equivalence%
\begin{align*}
&  \ \left(  \left(  a_{1},a_{2},\ldots,a_{k}\right)
\underset{\operatorname{perm}}{\sim}\left(  b_{1},b_{2},\ldots,b_{k}\right)
\right) \\
&  \Longleftrightarrow\ \left(  \left(  a_{1},a_{2},\ldots,a_{k}\right)
\text{ is an anagram of }\left(  b_{1},b_{2},\ldots,b_{k}\right)  \right)  .
\end{align*}
Hence, $\left(  a_{1},a_{2},\ldots,a_{k}\right)  \underset{\operatorname{perm}%
}{\sim}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $ (since $\left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  $ is an anagram of $\left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  $). This proves Proposition
\ref{prop.12fold.eqrel.un-k-tup.2}.
\end{proof}

We can now easily solve Exercise \ref{exe.12fold.eqrel.un-k-tup}:

\begin{proof}
[Solution to Exercise \ref{exe.12fold.eqrel.un-k-tup}.]We begin with three
simple observations:

\begin{statement}
\textit{Observation 1:} Each $\alpha\in\left\{  \text{unordered }%
k\text{-tuples of elements of }A\right\}  $ can be written in the form
$\left[  \left(  a_{1},a_{2},\ldots,a_{k}\right)  \right]
_{\underset{\operatorname{perm}}{\sim}}$ for some $\left(  a_{1},a_{2}%
,\ldots,a_{k}\right)  \in A^{k}$.
\end{statement}

[\textit{Proof of Observation 1:} Let $\alpha\in\left\{  \text{unordered
}k\text{-tuples of elements of }A\right\}  $. Thus, $\alpha$ is an unordered
$k$-tuple of elements of $A$. In other words, $\alpha$ is an equivalence class
of $\underset{\operatorname{perm}}{\sim}$ (since the unordered $k$-tuples of
elements of $A$ are defined to be the equivalence classes of
$\underset{\operatorname{perm}}{\sim}$). In other words, $\alpha=\left[
\mathbf{a}\right]  _{\underset{\operatorname{perm}}{\sim}}$ for some
$\mathbf{a}\in A^{k}$. Consider this $\mathbf{a}$. We can write $\mathbf{a}$
in the form $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ (since $\mathbf{a}\in
A^{k}$). If we write $\mathbf{a}$ in this form, then we obtain%
\[
\alpha=\left[  \mathbf{a}\right]  _{\underset{\operatorname{perm}}{\sim}%
}=\left[  \left(  a_{1},a_{2},\ldots,a_{k}\right)  \right]
_{\underset{\operatorname{perm}}{\sim}}\ \ \ \ \ \ \ \ \ \ \left(  \text{since
}\mathbf{a}=\left(  a_{1},a_{2},\ldots,a_{k}\right)  \right)  .
\]
Thus, we conclude that $\alpha$ can be written in the form $\left[  \left(
a_{1},a_{2},\ldots,a_{k}\right)  \right]  _{\underset{\operatorname{perm}%
}{\sim}}$ for some $\left(  a_{1},a_{2},\ldots,a_{k}\right)  \in A^{k}$.

Forget that we fixed $\alpha$. We thus have shown that each \newline$\alpha
\in\left\{  \text{unordered }k\text{-tuples of elements of }A\right\}  $ can
be written in the form $\left[  \left(  a_{1},a_{2},\ldots,a_{k}\right)
\right]  _{\underset{\operatorname{perm}}{\sim}}$ for some $\left(
a_{1},a_{2},\ldots,a_{k}\right)  \in A^{k}$. This proves Observation 1.]

\begin{statement}
\textit{Observation 2:} Let $\left(  a_{1},a_{2},\ldots,a_{k}\right)  \in
A^{k}$. Then, the multisubset $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}$ of $A$ has size $k$.
\end{statement}

[\textit{Proof of Observation 2:} Clearly, $a_{1},a_{2},\ldots,a_{k}$ are $k$
elements of $A$ (since $\left(  a_{1},a_{2},\ldots,a_{k}\right)  \in A^{k}$).
Hence, Exercise \ref{exe.mulsub.size1} (applied to $T=A$) shows that the
multisubset $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}$ of $A$ has size $k$. This proves Observation 2.]

\begin{statement}
\textit{Observation 3:} Let $\alpha\in\left\{  \text{unordered }k\text{-tuples
of elements of }A\right\}  $. Assume that $\alpha$ has been written in the
form $\left[  \left(  a_{1},a_{2},\ldots,a_{k}\right)  \right]
_{\underset{\operatorname{perm}}{\sim}}$ for some $\left(  a_{1},a_{2}%
,\ldots,a_{k}\right)  \in A^{k}$. Then, the multisubset $\left\{  a_{1}%
,a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}$ of $A$ depends only on
$\alpha$ (but not on the choice of $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $).
\end{statement}

[\textit{Proof of Observation 3:} We must show that any two choices of
$\left(  a_{1},a_{2},\ldots,a_{k}\right)  \in A^{k}$ satisfying $\alpha
=\left[  \left(  a_{1},a_{2},\ldots,a_{k}\right)  \right]
_{\underset{\operatorname{perm}}{\sim}}$ will lead to one and the same
multisubset $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}$.

So let $\left(  b_{1},b_{2},\ldots,b_{k}\right)  $ and $\left(  c_{1}%
,c_{2},\ldots,c_{k}\right)  $ be two choices of $\left(  a_{1},a_{2}%
,\ldots,a_{k}\right)  \in A^{k}$ satisfying $\alpha=\left[  \left(
a_{1},a_{2},\ldots,a_{k}\right)  \right]  _{\underset{\operatorname{perm}%
}{\sim}}$. We must prove that%
\[
\left\{  b_{1},b_{2},\ldots,b_{k}\right\}  _{\operatorname*{multi}}=\left\{
c_{1},c_{2},\ldots,c_{k}\right\}  _{\operatorname*{multi}}.
\]


We have $\alpha=\left[  \left(  b_{1},b_{2},\ldots,b_{k}\right)  \right]
_{\underset{\operatorname{perm}}{\sim}}$ (since $\left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  $ is a choice of $\left(  a_{1},a_{2},\ldots
,a_{k}\right)  \in A^{k}$ satisfying $\alpha=\left[  \left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  \right]  _{\underset{\operatorname{perm}}{\sim}}%
$). Similarly, $\alpha=\left[  \left(  c_{1},c_{2},\ldots,c_{k}\right)
\right]  _{\underset{\operatorname{perm}}{\sim}}$. Comparing these two
equalities, we obtain $\left[  \left(  b_{1},b_{2},\ldots,b_{k}\right)
\right]  _{\underset{\operatorname{perm}}{\sim}}=\left[  \left(  c_{1}%
,c_{2},\ldots,c_{k}\right)  \right]  _{\underset{\operatorname{perm}}{\sim}}$.

Exercise \ref{exe.12fold.eqrel.un-k-tup-eq} shows that
$\underset{\operatorname{perm}}{\sim}$ is an equivalence relation on the set
$A^{k}$. Hence, Proposition \ref{prop.12fold.eqcl.eqcl.3} \textbf{(e)}
(applied to $S=A^{k}$, $\left.  \sim\right.  =\left.
\underset{\operatorname{perm}}{\sim}\right.  $, $x=\left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  $ and $y=\left(  c_{1},c_{2},\ldots,c_{k}\right)  $)
shows that we have $\left(  b_{1},b_{2},\ldots,b_{k}\right)
\underset{\operatorname{perm}}{\sim}\left(  c_{1},c_{2},\ldots,c_{k}\right)  $
if and only if $\left[  \left(  b_{1},b_{2},\ldots,b_{k}\right)  \right]
_{\underset{\operatorname{perm}}{\sim}}=\left[  \left(  c_{1},c_{2}%
,\ldots,c_{k}\right)  \right]  _{\underset{\operatorname{perm}}{\sim}}$. Thus,
we have%
\[
\left(  b_{1},b_{2},\ldots,b_{k}\right)  \underset{\operatorname{perm}}{\sim
}\left(  c_{1},c_{2},\ldots,c_{k}\right)
\]
(since we have $\left[  \left(  b_{1},b_{2},\ldots,b_{k}\right)  \right]
_{\underset{\operatorname{perm}}{\sim}}=\left[  \left(  c_{1},c_{2}%
,\ldots,c_{k}\right)  \right]  _{\underset{\operatorname{perm}}{\sim}}$).
Therefore, Proposition \ref{prop.12fold.eqrel.un-k-tup.1} (applied to $\left(
b_{1},b_{2},\ldots,b_{k}\right)  $ and $\left(  c_{1},c_{2},\ldots
,c_{k}\right)  $ instead of $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ and
$\left(  b_{1},b_{2},\ldots,b_{k}\right)  $) yields%
\[
\left\{  b_{1},b_{2},\ldots,b_{k}\right\}  _{\operatorname*{multi}}=\left\{
c_{1},c_{2},\ldots,c_{k}\right\}  _{\operatorname*{multi}}.
\]


Thus, we have proved $\left\{  b_{1},b_{2},\ldots,b_{k}\right\}
_{\operatorname*{multi}}=\left\{  c_{1},c_{2},\ldots,c_{k}\right\}
_{\operatorname*{multi}}$. As explained, this shows that any any two choices
of $\left(  a_{1},a_{2},\ldots,a_{k}\right)  \in A^{k}$ satisfying
$\alpha=\left[  \left(  a_{1},a_{2},\ldots,a_{k}\right)  \right]
_{\underset{\operatorname{perm}}{\sim}}$ will lead to one and the same
multisubset $\left\{  a_{1},a_{2},\ldots,a_{k}\right\}
_{\operatorname*{multi}}$. Thus, Observation 3 is proven.] \medskip

Now, let $\Phi$ denote the map%
\begin{align*}
\left\{  \text{unordered }k\text{-tuples of elements of }A\right\}   &
\rightarrow\left\{  \text{size-}k\text{ multisubsets of }A\right\}  ,\\
\left[  \left(  a_{1},a_{2},\ldots,a_{k}\right)  \right]
_{\underset{\operatorname{perm}}{\sim}}  &  \mapsto\left\{  a_{1},a_{2}%
,\ldots,a_{k}\right\}  _{\operatorname*{multi}}.
\end{align*}
This map is well-defined, because:

\begin{itemize}
\item Each $\alpha\in\left\{  \text{unordered }k\text{-tuples of elements of
}A\right\}  $ can be written in the form $\left[  \left(  a_{1},a_{2}%
,\ldots,a_{k}\right)  \right]  _{\underset{\operatorname{perm}}{\sim}}$ for
some $\left(  a_{1},a_{2},\ldots,a_{k}\right)  \in A^{k}$ (by Observation 1).

\item If we write an element $\alpha\in\left\{  \text{unordered }%
k\text{-tuples of elements of }A\right\}  $ in the form $\left[  \left(
a_{1},a_{2},\ldots,a_{k}\right)  \right]  _{\underset{\operatorname{perm}%
}{\sim}}$ for some $\left(  a_{1},a_{2},\ldots,a_{k}\right)  \in A^{k}$, then
$\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}%
\in\left\{  \text{size-}k\text{ multisubsets of }A\right\}  $ (since
Observation 2 shows that the multisubset $\left\{  a_{1},a_{2},\ldots
,a_{k}\right\}  _{\operatorname*{multi}}$ of $A$ has size $k$).

\item If we write an element $\alpha\in\left\{  \text{unordered }%
k\text{-tuples of elements of }A\right\}  $ in the form $\left[  \left(
a_{1},a_{2},\ldots,a_{k}\right)  \right]  _{\underset{\operatorname{perm}%
}{\sim}}$ for some $\left(  a_{1},a_{2},\ldots,a_{k}\right)  \in A^{k}$, then
$\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}$ depends
only on $\alpha$ (but not on the choice of $\left(  a_{1},a_{2},\ldots
,a_{k}\right)  $) (by Observation 3).
\end{itemize}

Now, we shall show that the map $\Phi$ is bijective. Indeed, let us prove that
$\Phi$ is injective and surjective:

[\textit{Proof of the injectivity of }$\Phi$\textit{:} Let $\alpha,\beta
\in\left\{  \text{unordered }k\text{-tuples of elements of }A\right\}  $ be
such that $\Phi\left(  \alpha\right)  =\Phi\left(  \beta\right)  $. We must
show that $\alpha=\beta$.

Observation 1 shows that the element $\alpha$ can be written in the form
$\left[  \left(  a_{1},a_{2},\ldots,a_{k}\right)  \right]
_{\underset{\operatorname{perm}}{\sim}}$ for some $\left(  a_{1},a_{2}%
,\ldots,a_{k}\right)  \in A^{k}$. Similarly, the element $\beta$ can be
written in the form $\left[  \left(  b_{1},b_{2},\ldots,b_{k}\right)  \right]
_{\underset{\operatorname{perm}}{\sim}}$ for some $\left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  \in A^{k}$. Consider this $\left(  a_{1},a_{2}%
,\ldots,a_{k}\right)  $ and this $\left(  b_{1},b_{2},\ldots,b_{k}\right)  $.

From $\alpha=\left[  \left(  a_{1},a_{2},\ldots,a_{k}\right)  \right]
_{\underset{\operatorname{perm}}{\sim}}$, we obtain
\begin{equation}
\Phi\left(  \alpha\right)  =\Phi\left(  \left[  \left(  a_{1},a_{2}%
,\ldots,a_{k}\right)  \right]  _{\underset{\operatorname{perm}}{\sim}}\right)
=\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}
\label{sol.12fold.eqrel.un-k-tup.inj.1}%
\end{equation}
(by the definition of the map $\Phi$). Similarly, from $\beta=\left[  \left(
b_{1},b_{2},\ldots,b_{k}\right)  \right]  _{\underset{\operatorname{perm}%
}{\sim}}$, we obtain%
\[
\Phi\left(  \beta\right)  =\left\{  b_{1},b_{2},\ldots,b_{k}\right\}
_{\operatorname*{multi}}.
\]
Thus,%
\[
\Phi\left(  \alpha\right)  =\Phi\left(  \beta\right)  =\left\{  b_{1}%
,b_{2},\ldots,b_{k}\right\}  _{\operatorname*{multi}}.
\]
Comparing this with (\ref{sol.12fold.eqrel.un-k-tup.inj.1}), we obtain%
\[
\left\{  a_{1},a_{2},\ldots,a_{k}\right\}  _{\operatorname*{multi}}=\left\{
b_{1},b_{2},\ldots,b_{k}\right\}  _{\operatorname*{multi}}.
\]
Thus, Proposition \ref{prop.12fold.eqrel.un-k-tup.2} yields
\[
\left(  a_{1},a_{2},\ldots,a_{k}\right)  \underset{\operatorname{perm}}{\sim
}\left(  b_{1},b_{2},\ldots,b_{k}\right)  .
\]


Exercise \ref{exe.12fold.eqrel.un-k-tup-eq} shows that
$\underset{\operatorname{perm}}{\sim}$ is an equivalence relation on the set
$A^{k}$. Hence, Proposition \ref{prop.12fold.eqcl.eqcl.3} \textbf{(e)}
(applied to $S=A^{k}$, $\left.  \sim\right.  =\left.
\underset{\operatorname{perm}}{\sim}\right.  $, $x=\left(  a_{1},a_{2}%
,\ldots,a_{k}\right)  $ and $y=\left(  b_{1},b_{2},\ldots,b_{k}\right)  $)
shows that we have $\left(  a_{1},a_{2},\ldots,a_{k}\right)
\underset{\operatorname{perm}}{\sim}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $
if and only if $\left[  \left(  a_{1},a_{2},\ldots,a_{k}\right)  \right]
_{\underset{\operatorname{perm}}{\sim}}=\left[  \left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  \right]  _{\underset{\operatorname{perm}}{\sim}}$. Thus,
we have%
\[
\left[  \left(  a_{1},a_{2},\ldots,a_{k}\right)  \right]
_{\underset{\operatorname{perm}}{\sim}}=\left[  \left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  \right]  _{\underset{\operatorname{perm}}{\sim}}%
\]
(since we have $\left(  a_{1},a_{2},\ldots,a_{k}\right)
\underset{\operatorname{perm}}{\sim}\left(  b_{1},b_{2},\ldots,b_{k}\right)
$). In other words, $\alpha=\beta$ (since $\alpha=\left[  \left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  \right]  _{\underset{\operatorname{perm}}{\sim}}$
and $\beta=\left[  \left(  b_{1},b_{2},\ldots,b_{k}\right)  \right]
_{\underset{\operatorname{perm}}{\sim}}$).

Forget that we fixed $\alpha$ and $\beta$. We thus have shown that if
\newline$\alpha,\beta\in\left\{  \text{unordered }k\text{-tuples of elements
of }A\right\}  $ are two elements such that $\Phi\left(  \alpha\right)
=\Phi\left(  \beta\right)  $, then $\alpha=\beta$. In other words, the map
$\Phi$ is injective.]

[\textit{Proof of the surjectivity of }$\Phi$: Let $S\in\left\{
\text{size-}k\text{ multisubsets of }A\right\}  $. We shall construct an
$\alpha\in\left\{  \text{unordered }k\text{-tuples of elements of }A\right\}
$ such that $S=\Phi\left(  \alpha\right)  $.

Indeed, $S$ is a size-$k$ multisubset of $A$ (since $S\in\left\{
\text{size-}k\text{ multisubsets of }A\right\}  $). In other words, $S$ is a
multisubset of $A$ having size $k$. Hence, Proposition
\ref{prop.mulsub.exist-list} (applied to $T=A$ and $m=k$) yields that there
exists a $k$-tuple $\left(  s_{1},s_{2},\ldots,s_{k}\right)  $ of elements of
$A$ satisfying $\left\{  s_{1},s_{2},\ldots,s_{k}\right\}
_{\operatorname*{multi}}=S$. Consider this $\left(  s_{1},s_{2},\ldots
,s_{k}\right)  $. Consider the corresponding unordered $k$-tuple $\left[
\left(  s_{1},s_{2},\ldots,s_{k}\right)  \right]
_{\underset{\operatorname{perm}}{\sim}}$ of elements of $A$.

The definition of $\Phi$ yields
\[
\Phi\left(  \left[  \left(  s_{1},s_{2},\ldots,s_{k}\right)  \right]
_{\underset{\operatorname{perm}}{\sim}}\right)  =\left\{  s_{1},s_{2}%
,\ldots,s_{k}\right\}  _{\operatorname*{multi}}=S.
\]
Hence, $S=\Phi\left(  \left[  \left(  s_{1},s_{2},\ldots,s_{k}\right)
\right]  _{\underset{\operatorname{perm}}{\sim}}\right)  $. Thus, there exists
an \newline$\alpha\in\left\{  \text{unordered }k\text{-tuples of elements of
}A\right\}  $ such that $S=\Phi\left(  \alpha\right)  $ (namely,
$\alpha=\left[  \left(  s_{1},s_{2},\ldots,s_{k}\right)  \right]
_{\underset{\operatorname{perm}}{\sim}}$).

Forget that we fixed $S$. We thus have shown that for each $S\in\left\{
\text{size-}k\text{ multisubsets of }A\right\}  $, there exists an $\alpha
\in\left\{  \text{unordered }k\text{-tuples of elements of }A\right\}  $ such
that $S=\Phi\left(  \alpha\right)  $. In other words, the map $\Phi$ is surjective.]

We have now proved that the map $\Phi$ is injective and that the map $\Phi$ is
surjective. Hence, the map $\Phi$ is bijective. In other words, the map%
\begin{align*}
\left\{  \text{unordered }k\text{-tuples of elements of }A\right\}   &
\rightarrow\left\{  \text{size-}k\text{ multisubsets of }A\right\}  ,\\
\left[  \left(  a_{1},a_{2},\ldots,a_{k}\right)  \right]
_{\underset{\operatorname{perm}}{\sim}}  &  \mapsto\left\{  a_{1},a_{2}%
,\ldots,a_{k}\right\}  _{\operatorname*{multi}}%
\end{align*}
is bijective (since this map is precisely the map we called $\Phi$). Moreover,
as we have already seen, this map is well-defined. Since this map is
bijective, we conclude that the unordered $k$-tuples of elements of $A$ are in
bijection with the size-$k$ multisubsets of $A$. Thus, Exercise
\ref{exe.12fold.eqrel.un-k-tup} is solved.
\end{proof}

\subsection{Solution to Exercise \ref{exe.12fold.boxeq.equiv}}

In order to solve Exercise \ref{exe.12fold.boxeq.equiv}, we need to prove
Proposition \ref{prop.12fold.boxeq.equiv}.

\begin{proof}
[Proof of Proposition \ref{prop.12fold.boxeq.equiv}.]Let us first prove that
the relation $\underset{\operatorname*{ball}}{\overset{\operatorname*{box}%
}{\sim}}$ is an equivalence relation. To that end, we need to prove that this
relation $\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}%
}$ is reflexive, symmetric and transitive. We shall prove these three
properties one by one: \medskip

[\textit{Proof of reflexivity:} We must show that the relation
$\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}$ is
reflexive. In other words, we must prove that every $a\in\left\{  \text{maps
}A\rightarrow X\right\}  $ satisfies $a\underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}a$.

So let $a\in\left\{  \text{maps }A\rightarrow X\right\}  $ be arbitrary. Thus,
$a$ is a map from $A$ to $X$. Now, the identity maps $\operatorname*{id}%
\nolimits_{X}:X\rightarrow X$ and $\operatorname*{id}\nolimits_{A}%
:A\rightarrow A$ are permutations of $X$ and $A$, respectively, and satisfy
$a=\operatorname*{id}\nolimits_{X}\circ a\circ\operatorname*{id}\nolimits_{A}%
$. Hence, there exist a permutation $\sigma$ of $X$ and a permutation $\tau$
of $A$ such that $a=\sigma\circ a\circ\tau$ (namely, $\sigma
=\operatorname*{id}\nolimits_{X}$ and $\tau=\operatorname*{id}\nolimits_{A}$).
In other words, we have $a\underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}a$ (by the definition of the relation
$\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}$).

We thus have shown that every $a\in\left\{  \text{maps }A\rightarrow
X\right\}  $ satisfies $a\underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}a$. In other words, the relation
$\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}$ is
reflexive.] \medskip

[\textit{Proof of symmetry:} We must show that the relation
$\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}$ is
symmetric. In other words, we must prove that every $a,b\in\left\{  \text{maps
}A\rightarrow X\right\}  $ satisfying $a\underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}b$ satisfy
$b\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}a$.

So let $a,b\in\left\{  \text{maps }A\rightarrow X\right\}  $ satisfy
$a\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}b$.
Thus, $a$ and $b$ are maps from $A$ to $X$. From
$a\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}b$, we
conclude that there exist a permutation $\sigma$ of $X$ and a permutation
$\tau$ of $A$ such that $a=\sigma\circ b\circ\tau$ (by the definition of the
relation $\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}%
}$). Let us consider these $\sigma$ and $\tau$, and denote them by $\xi$ and
$\alpha$, respectively. Thus, $\xi$ is a permutation of $X$, and $\alpha$ is a
permutation of $A$, and they satisfy $a=\xi\circ b\circ\alpha$. The two maps
$\xi$ and $\alpha$ are bijective (since they are permutations), therefore
invertible. Hence, their inverses $\xi^{-1}$ and $\alpha^{-1}$ exist.

However, Proposition \ref{prop.perm.compose-perm} \textbf{(b)} (applied to
$S=X$ and $\sigma=\xi$) yields that $\xi^{-1}$ is a permutation of $X$ (since
$\xi$ is a permutation of $X$). Likewise, $\alpha^{-1}$ is a permutation of
$A$. Moreover, solving the equality $a=\xi\circ b\circ\alpha$ for $b$, we
obtain $b=\xi^{-1}\circ a\circ\alpha^{-1}$ (since $\xi^{-1}\circ
\underbrace{a}_{=\xi\circ b\circ\alpha}\circ\alpha^{-1}=\underbrace{\xi
^{-1}\circ\xi}_{=\operatorname*{id}\nolimits_{X}}\circ b\circ
\underbrace{\alpha\circ\alpha^{-1}}_{=\operatorname*{id}\nolimits_{A}}=b$).
Thus, there exist a permutation $\sigma$ of $X$ and a permutation $\tau$ of
$A$ such that $b=\sigma\circ a\circ\tau$ (namely, $\sigma=\xi^{-1}$ and
$\tau=\alpha^{-1}$). In other words, we have $b\underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}a$ (by the definition of the relation
$\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}$).

We thus have shown that every $a,b\in\left\{  \text{maps }A\rightarrow
X\right\}  $ satisfying $a\underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}b$ satisfy
$b\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}a$. In
other words, the relation $\underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}$ is symmetric.] \medskip

[\textit{Proof of transitivity:} We must show that the relation
$\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}$ is
transitive. In other words, we must prove that every $a,b,c\in\left\{
\text{maps }A\rightarrow X\right\}  $ satisfying
$a\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}b$ and
$b\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}c$
satisfy $a\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}%
}c$.

So let $a,b,c\in\left\{  \text{maps }A\rightarrow X\right\}  $ satisfy
$a\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}b$ and
$b\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}c$.
Thus, $a$, $b$ and $c$ are maps from $A$ to $X$.

From $a\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}b$,
we conclude that there exist a permutation $\sigma$ of $X$ and a permutation
$\tau$ of $A$ such that $a=\sigma\circ b\circ\tau$ (by the definition of the
relation $\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}%
}$). Let us consider these $\sigma$ and $\tau$, and denote them by $\sigma
_{1}$ and $\tau_{1}$, respectively. Thus, $\sigma_{1}$ is a permutation of
$X$, and $\tau_{1}$ is a permutation of $A$, and they satisfy $a=\sigma
_{1}\circ b\circ\tau_{1}$.

From $b\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}c$,
we conclude that there exist a permutation $\sigma$ of $X$ and a permutation
$\tau$ of $A$ such that $b=\sigma\circ c\circ\tau$ (by the definition of the
relation $\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}%
}$). Let us consider these $\sigma$ and $\tau$, and denote them by $\sigma
_{2}$ and $\tau_{2}$, respectively. Thus, $\sigma_{2}$ is a permutation of
$X$, and $\tau_{2}$ is a permutation of $A$, and they satisfy $b=\sigma
_{2}\circ c\circ\tau_{2}$.

Proposition \ref{prop.perm.compose-perm} \textbf{(a)} (applied to $S=X$)
yields that $\sigma_{1}\circ\sigma_{2}$ is a permutation of $X$ (since
$\sigma_{1}$ and $\sigma_{2}$ are permutations of $X$). Likewise, using
Proposition \ref{prop.perm.compose-perm} \textbf{(a)}, we see that $\tau
_{2}\circ\tau_{1}$ is a permutation of $A$ (since $\tau_{2}$ and $\tau_{1}$
are permutations of $A$). Moreover, we have%
\[
a=\sigma_{1}\circ\underbrace{b}_{=\sigma_{2}\circ c\circ\tau_{2}}\circ\tau
_{1}=\sigma_{1}\circ\sigma_{2}\circ c\circ\tau_{2}\circ\tau_{1}=\left(
\sigma_{1}\circ\sigma_{2}\right)  \circ c\circ\left(  \tau_{2}\circ\tau
_{1}\right)  .
\]
Thus, there exist a permutation $\sigma$ of $X$ and a permutation $\tau$ of
$A$ such that $a=\sigma\circ c\circ\tau$ (namely, $\sigma=\sigma_{1}%
\circ\sigma_{2}$ and $\tau=\tau_{2}\circ\tau_{1}$). In other words, we have
$a\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}c$ (by
the definition of the relation $\underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}$).

We thus have shown that every $a,b,c\in\left\{  \text{maps }A\rightarrow
X\right\}  $ satisfying $a\underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}b$ and $b\underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}c$ satisfy
$a\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}c$. In
other words, the relation $\underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}$ is transitive.] \medskip

We have now proved that the relation $\underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}$ is reflexive, symmetric and
transitive. In other words, this relation $\underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}$ is an equivalence relation. Analogous
arguments show that the relations $\overset{\operatorname*{box}}{\sim}$ and
$\overset{\operatorname*{ball}}{\sim}$ are equivalence relations. Thus,
Proposition \ref{prop.12fold.boxeq.equiv} is proved.
\end{proof}

\subsection{Solution to Exercise \ref{exe.12fold.boxeq.jectivities}}

In order to solve Exercise \ref{exe.12fold.boxeq.jectivities}, we need to
prove Proposition \ref{prop.12fold.boxeq.jectivities} and Corollary
\ref{cor.12fold.boxeq.jectivities}. Let us do this:

\begin{proof}
[Proof of Proposition \ref{prop.12fold.boxeq.jectivities}.]\textbf{(a)} Assume
that $f$ is injective. We must prove that $g$ is injective.

We have assumed that $f\overset{\operatorname*{box}}{\sim}g$ or
$f\overset{\operatorname*{ball}}{\sim}g$ or $f\underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}g$. Thus, we are in one of the following
three cases:

\textit{Case 1:} We have $f\overset{\operatorname*{box}}{\sim}g$.

\textit{Case 2:} We have $f\underset{\operatorname*{ball}}{\sim}g$.

\textit{Case 3:} We have $f\underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}g$.

We shall only consider Case 3, since the arguments in the other two cases are
very similar.

So let us consider Case 3. In this case, we have
$f\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}g$. In
other words, there exist a permutation $\sigma$ of $X$ and a permutation
$\tau$ of $A$ such that $f=\sigma\circ g\circ\tau$ (by the definition of the
relation $\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}%
}$). Consider these $\sigma$ and $\tau$.

The maps $\sigma$ and $\tau$ are bijective (because they are permutations),
and thus invertible. Hence, their inverses $\sigma^{-1}$ and $\tau^{-1}$ are
well-defined. These inverses $\sigma^{-1}$ and $\tau^{-1}$ are furthermore
invertible, thus bijective, thus injective.

Moreover, from $f=\sigma\circ g\circ\tau$, we obtain%
\[
\sigma^{-1}\circ\underbrace{f}_{=\sigma\circ g\circ\tau}\circ\tau
^{-1}=\underbrace{\sigma^{-1}\circ\sigma}_{=\operatorname*{id}\nolimits_{X}%
}\circ g\circ\underbrace{\tau\circ\tau^{-1}}_{=\operatorname*{id}%
\nolimits_{A}}=g.
\]
However, a composition of several injective maps is always injective. Thus,
the map $\sigma^{-1}\circ f\circ\tau^{-1}$ is injective (since it is the
composition of the injective maps $\sigma^{-1}$, $f$ and $\tau^{-1}$). In
other words, the map $g$ is injective (since $\sigma^{-1}\circ f\circ\tau
^{-1}=g$). Hence, we have completed the proof of Proposition
\ref{prop.12fold.boxeq.jectivities} \textbf{(a)} in Case 3. As we said above,
the other two cases are very similar. Hence, Proposition
\ref{prop.12fold.boxeq.jectivities} \textbf{(a)} is proven.

\textbf{(b)} The proof of Proposition \ref{prop.12fold.boxeq.jectivities}
\textbf{(b)} is analogous to the proof of Proposition
\ref{prop.12fold.boxeq.jectivities} \textbf{(a)}; we just need to replace the
word \textquotedblleft injective\textquotedblright\ by the word
\textquotedblleft surjective\textquotedblright\ everywhere.
\end{proof}

\begin{proof}
[Proof of Corollary \ref{cor.12fold.boxeq.jectivities}.]\textbf{(a)} Assume
that $C$ contains an injective map. We must prove that every map in $C$ is injective.

We have assumed that $C$ is a $U\rightarrow L$ placement or an $L\rightarrow
U$ placement or a $U\rightarrow U$ placement. Thus, we are in one of the
following three cases:

\textit{Case 1:} The set $C$ is a $U\rightarrow L$ placement.

\textit{Case 2:} The set $C$ is an $L\rightarrow U$ placement.

\textit{Case 3:} The set $C$ is a $U\rightarrow U$ placement.

We shall only consider Case 3, since the arguments in the other two cases are analogous.

So let us consider Case 3. In this case, $C$ is a $U\rightarrow U$ placement.
In other words, $C$ is a $\underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}$-equivalence class (since the
$U\rightarrow U$ placements are defined to be the
$\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}%
$-equivalence classes). In other words, $C=\left[  a\right]
_{\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}}$ for
some $a\in\left\{  \text{maps }A\rightarrow X\right\}  $ (since the
$\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}%
$-equivalence classes are defined to be the sets of the form $\left[
a\right]  _{\underset{\operatorname*{ball}}{\overset{\operatorname*{box}%
}{\sim}}}$ for $a\in\left\{  \text{maps }A\rightarrow X\right\}  $). Consider
this $a$.

Recall that the relation $\underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}$ is an equivalence relation, thus is transitive.

We have assumed that $C$ contains an injective map. Let $f$ be this map. Thus,
$f$ is an injective map from $A$ to $X$, and belongs to $C$. Hence, $f\in
C=\left[  a\right]  _{\underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}}\subseteq\left\{  \text{maps
}A\rightarrow X\right\}  $. However, Proposition \ref{prop.12fold.eqcl.eqcl.3}
\textbf{(c)} (applied to $S=\left\{  \text{maps }A\rightarrow X\right\}  $,
$\left.  \sim\right.  =\left.  \underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}\right.  $, $x=f$ and $y=a$) yields that
we have $f\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}%
}a$ if and only if $f\in\left[  a\right]  _{\underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}}$. Hence, we have
$f\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}a$
(since we have $f\in\left[  a\right]  _{\underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}}$).

Now, let $g\in C$ be arbitrary. Thus, $g\in C=\left[  a\right]
_{\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}%
}\subseteq\left\{  \text{maps }A\rightarrow X\right\}  $. However, Proposition
\ref{prop.12fold.eqcl.eqcl.3} \textbf{(d)} (applied to $S=\left\{  \text{maps
}A\rightarrow X\right\}  $, $\left.  \sim\right.  =\left.
\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}\right.
$, $x=a$ and $y=g$) yields that we have $a\underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}g$ if and only if $g\in\left[  a\right]
_{\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}}$.
Thus, we have $a\underset{\operatorname*{ball}}{\overset{\operatorname*{box}%
}{\sim}}g$ (since we have $g\in\left[  a\right]
_{\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}}$).

Combining $f\underset{\operatorname*{ball}}{\overset{\operatorname*{box}%
}{\sim}}a$ and $a\underset{\operatorname*{ball}}{\overset{\operatorname*{box}%
}{\sim}}g$, we obtain $f\underset{\operatorname*{ball}%
}{\overset{\operatorname*{box}}{\sim}}g$ (since the relation
$\underset{\operatorname*{ball}}{\overset{\operatorname*{box}}{\sim}}$ is
transitive). Therefore, Proposition \ref{prop.12fold.boxeq.jectivities}
\textbf{(a)} yields that $g$ is injective (since $f$ is injective).

Forget that we fixed $g$. We thus have proved that every $g\in C$ is
injective. In other words, every map in $C$ is injective. This proves
Corollary \ref{cor.12fold.boxeq.jectivities} \textbf{(a)} in Case 3. As we
mentioned above, the other two cases are analogous. Hence, Corollary
\ref{cor.12fold.boxeq.jectivities} \textbf{(a)} is proven.

\textbf{(b)} The proof of Corollary \ref{cor.12fold.boxeq.jectivities}
\textbf{(b)} is analogous to the proof of Corollary
\ref{cor.12fold.boxeq.jectivities} \textbf{(a)}; we just need to replace the
word \textquotedblleft injective\textquotedblright\ by the word
\textquotedblleft surjective\textquotedblright\ everywhere (and use
Proposition \ref{prop.12fold.boxeq.jectivities} \textbf{(b)} instead of
Proposition \ref{prop.12fold.boxeq.jectivities} \textbf{(a)}).
\end{proof}

\begin{thebibliography}{999999999}                                                                                        %


\bibitem[17f-hw1s]{17f-hw1s}Darij Grinberg, \textit{UMN Fall 2017 Math 4707 \&
Math 4990 homework set \#1 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/17f/hw1s.pdf}

\bibitem[17f-hw2s]{17f-hw2s}Darij Grinberg, \textit{UMN Fall 2017 \textit{Math
4707 \& Math 4990} homework set \#2 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/17f/hw2s.pdf}

\bibitem[17f-hw3s]{17f-hw3s}Darij Grinberg, \textit{UMN Fall 2017 Math 4990
homework set \#3 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/17f/hw3os.pdf}

\bibitem[17f-hw4s]{17f-hw4s}Darij Grinberg, \textit{UMN Fall 2017 Math 4990
homework set \#4 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/17f/hw4os.pdf}

\bibitem[17f-hw5s]{17f-hw5s}Darij Grinberg, \textit{UMN Fall 2017 Math 4990
homework set \#5 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/17f/hw5os.pdf}

\bibitem[17f-hw6s]{17f-hw6s}Darij Grinberg, \textit{UMN Fall 2017 Math 4990
homework set \#6 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/17f/hw6os.pdf}

\bibitem[17f-hw7s]{17f-hw7s}Darij Grinberg, \textit{UMN Fall 2017 Math 4990
homework set \#7 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/17f/hw7os.pdf}

\bibitem[17f-hw8s]{17f-hw8s}Darij Grinberg, \textit{UMN Fall 2017 Math 4990
homework set \#8 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/17f/hw8os.pdf}

\bibitem[18f]{18f}Darij Grinberg, \textit{UMN Fall 2018 Math 5705:
\textquotedblleft black\textquotedblright board notes}, \url{https://www.cip.ifi.lmu.de/~grinberg/t/18f/}

\bibitem[18f-hw1s]{18f-hw1s}Darij Grinberg, \textit{UMN Fall 2018 Math 5705
homework set \#1 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/18f/hw1s.pdf}

\bibitem[18f-hw2s]{18f-hw2s}Darij Grinberg, \textit{UMN Fall 2018 Math 5705
homework set \#2 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/18f/hw2s.pdf}

\bibitem[18f-hw3s]{18f-hw3s}Darij Grinberg, \textit{UMN Fall 2018 Math 5705
homework set \#3 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/18f/hw3s.pdf}

\bibitem[18f-hw4s]{18f-hw4s}Darij Grinberg, \textit{UMN Fall 2018 Math 5705
homework set \#4 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/18f/hw4s.pdf}

\bibitem[18f-mt1s]{18f-mt1s}Darij Grinberg, \textit{UMN Fall 2018 Math 5705
midterm \#1 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/18f/mt1s.pdf}

\bibitem[18f-mt2s]{18f-mt2s}Darij Grinberg, \textit{UMN Fall 2018 Math 5705
midterm \#2 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/18f/mt2s.pdf}

\bibitem[18f-mt3s]{18f-mt3s}Darij Grinberg, \textit{UMN Fall 2018 Math 5705
midterm \#3 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/18f/mt3s.pdf}

\bibitem[18s]{18s}Darij Grinberg, \textit{UMN Spring 2018 Math 4707:
\textquotedblleft black\textquotedblright board notes}, \url{https://www.cip.ifi.lmu.de/~grinberg/t/18s/}

\bibitem[18s-hw1s]{18s-hw1s}Darij Grinberg, \textit{UMN Spring 2018 Math 4707
homework set \#1 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/18s/hw1s.pdf}

\bibitem[18s-hw2s]{18s-hw2s}Darij Grinberg, \textit{UMN Spring 2018 Math 4707
homework set \#2 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/18s/hw2s.pdf}

\bibitem[18s-hw3s]{18s-hw3s}Darij Grinberg, \textit{UMN Spring 2018 Math 4707
homework set \#3 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/18s/hw3s.pdf}

\bibitem[18s-hw4s]{18s-hw4s}Darij Grinberg, \textit{UMN Spring 2018 Math 4707
homework set \#4 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/18s/hw4s.pdf}

\bibitem[18s-hw5s]{18s-hw5s}Darij Grinberg, \textit{UMN Spring 2018 Math 4707
homework set \#5 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/18s/hw5s.pdf}

\bibitem[18s-mt1s]{18s-mt1s}Darij Grinberg, \textit{UMN Spring 2018 Math 4707
midterm \#1 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/18s/mt1s.pdf}

\bibitem[18s-mt2s]{18s-mt2s}Darij Grinberg, \textit{UMN Spring 2018 Math 4707
midterm \#2 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/18s/mt2s.pdf}

\bibitem[19f-hw0s]{19f-hw0s}Darij Grinberg, \textit{Drexel Fall 2019 Math 222
homework set \#0 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/19fco/hw0s.pdf}

\bibitem[19f-hw1s]{19f-hw1s}Darij Grinberg, \textit{Drexel Fall 2019 Math 222
homework set \#1 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/19fco/hw1s.pdf}

\bibitem[19f-hw2s]{19f-hw2s}Darij Grinberg, \textit{Drexel Fall 2019 Math 222
homework set \#2 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/19fco/hw2s.pdf}

\bibitem[19f-hw3s]{19f-hw3s}Darij Grinberg, \textit{Drexel Fall 2019 Math 222
homework set \#3 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/19fco/hw3s.pdf}

\bibitem[19f-hw4s]{19f-hw4s}Darij Grinberg, \textit{Drexel Fall 2019 Math 222
homework set \#4 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/19fco/hw4s.pdf}

\bibitem[19f-mt1s]{19f-mt1s}Darij Grinberg, \textit{Drexel Fall 2019 Math 222
midterm \#1 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/19fco/mt1s.pdf}

\bibitem[19f-mt2s]{19f-mt2s}Darij Grinberg, \textit{Drexel Fall 2019 Math 222
midterm \#2 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/19fco/mt2s.pdf}

\bibitem[19f-mt3s]{19f-mt3s}Darij Grinberg, \textit{Drexel Fall 2019 Math 222
midterm \#3 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/19fco/mt3s.pdf}

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

\bibitem[19s-hw0s]{19s-hw0s}Darij Grinberg, \textit{UMN Spring 2019 Math 4281
homework set \#0 with solutions}, \url{http://www.cip.ifi.lmu.de/~grinberg/t/19s/hw0s.pdf}

\bibitem[21s]{21s}Darij Grinberg, \textit{Algebraic Combinatorics (Drexel
Spring 2021 Math 701 lecture notes)}, 4 May 2021.\newline\url{https://www.cip.ifi.lmu.de/~grinberg/t/21s/lecs.pdf}

\bibitem[Aigner07]{Aigner07}%
\href{http://doi.org/10.1007/978-3-540-39035-0}{Martin Aigner, \textit{A
Course in Enumeration}, Graduate Texts in Mathematics \#238, Springer 2007.}

\bibitem[AigZie14]{AigZie}%
\href{https://doi.org/10.1007/978-3-662-44205-0}{Martin Aigner, G\"{u}nter M.
Ziegler, \textit{Proofs from the Book}, 6th edition, Springer 2018.}

\bibitem[AndEri04]{AndEri04}%
\href{https://doi.org/10.1017/CBO9781139167239}{George E. Andrews, Kimmo
Eriksson, \textit{Integer Partitions}, Cambridge University Press 2004}.

\bibitem[AndFen04]{AndFen04}%
\href{https://doi.org/10.1007/978-0-8176-8154-8}{Titu Andreescu, Zuming Feng,
\textit{A Path to Combinatorics for Undergraduates: Counting Strategies},
Springer 2004.}

\bibitem[Andrew16]{Andrews317}George E. Andrews, \textit{Euler's Partition
Identity -- Finite Version}, 2016.\newline\url{http://www.personal.psu.edu/gea1/pdf/317.pdf}

\bibitem[ArdSta10]{ArdSta10}%
\href{https://doi.org/10.1007/s00283-010-9160-9}{Federico Ardila, Richard P.
Stanley, \textit{Tilings}, The Mathematical Intelligencer \textbf{32} (2010),
pp. 32--43}. A preprint can be found at
\href{https://arxiv.org/abs/math/0501170v3}{arXiv:math/0501170v3} .

\bibitem[BCHR11]{BCHR11}Fred Butler, Mahir Can, Jim Haglund, Jeffrey B.
Remmel, \textit{Rook Theory Notes}, 3 January 2011.\newline\url{https://mathweb.ucsd.edu/~remmel/files/Book.pdf}

\bibitem[BenDre07]{BenDre-Vand}%
\href{https://web.archive.org/web/20160729183227/http://home.wlu.edu/~dresdeng/papers/VDM.pdf}{Arthur
T. Benjamin and Gregory P. Dresden, \textit{A Combinatorial Proof of
Vandermonde's Determinant}, The American Mathematical Monthly, Vol. 114, No. 4
(Apr., 2007), pp. 338--341.} \newline(Also available at
\url{http://scholarship.claremont.edu/hmc_fac_pub/524/} .)

\bibitem[BenQui03]{BenQui03}Arthur T. Benjamin and Jennifer J. Quinn,
\textit{Proofs that Really Count: The Art of Combinatorial Proof}, Dolciani
Mathematical Expositions \textbf{27}, The Mathematical Association of America, 2003.

\bibitem[BenQui04]{BenQui-fib}%
\href{https://math.hmc.edu/benjamin/wp-content/uploads/sites/5/2019/06/Proofs-that-Really-Count.pdf}{Arthur
T. Benjamin and Jennifer J. Quinn, \textit{Proofs that Really Count: The Magic
of Fibonacci Numbers and More}, Mathematical Adventures for Students and
Amateurs, (David F. Hayes and Tatiana Shubin, editors), Spectrum Series of
MAA, pp. 83--98, 2004.}

\bibitem[BenQui08]{BenQui08}%
\href{https://web.archive.org/web/20170809070707/https://www.math.hmc.edu/~benjamin/papers/DIE.pdf}{Arthur
T. Benjamin and Jennifer J. Quinn, \textit{An Alternate Approach to
Alternating Sums: A Method to DIE for}, The College Mathematics Journal,
Volume 39, Number 3, May 2008, pp. 191-202(12).}

\bibitem[Bona22]{Bona22}Miklos B\'{o}na, \textit{Combinatorics of
Permutations}, 3rd edition, Taylor\&Francis 2022.\newline\url{https://doi.org/10.1201/9780429274107}

\bibitem[Bourba68]{Bourba68}%
\href{https://link.springer.com/book/10.1007/978-3-642-59309-3}{Nicolas
Bourbaki, \textit{Theory of Sets}, Springer 1968}.

\bibitem[Chu19]{Chu19}H\`{u}ng Vi\d{\^{e}}t Chu, \textit{The Fibonacci
Sequence and Schreier-Zeckendorf Sets}, Journal of Integer Sequences,
\textbf{22} (2019), Article 19.6.5.\newline\url{https://cs.uwaterloo.ca/journals/JIS/VOL22/Chu2/chu9.html}

\bibitem[CoLiOs15]{CoLiOs15}%
\href{https://doi.org/10.1007/978-3-319-16721-3}{David A. Cox, John Little,
Donal O'Shea, \textit{Ideals, Varieties, and Algorithms: An Introduction to
Computational Algebraic Geometry and Commutative Algebra}, 4th edition,
Springer 2015}.

\bibitem[Comtet74]{Comtet74}%
\href{https://doi.org/10.1007/978-94-010-2196-8}{Louis Comtet,
\textit{Advanced Combinatorics: The Art of Finite and Infinite Expansions}, D.
Reidel Publishing Company, 1974.}

\bibitem[Day16]{Day-proofs}Martin V. Day, \textit{An Introduction to Proofs
and the Mathematical Vernacular}, 7 December 2016. \newline%
\url{https://web.archive.org/web/20180712152432/https://www.math.vt.edu/people/day/ProofsBook/IPaMV.pdf}
.

\bibitem[Elman22]{Elman18}Richard Elman, \textit{Lectures on Abstract
Algebra}, 8 September 2022.\newline\url{https://www.math.ucla.edu/~rse/algebra_book.pdf}

\bibitem[GalQua22]{GalQua22}Jean Gallier and Jocelyn Quaintance,
\textit{Algebra, Topology, Differential Calculus, and Optimization Theory For
Computer Science and Machine Learning}, 18 March 2022.\newline\url{https://www.cis.upenn.edu/~jean/gbooks/geomath.html}

\bibitem[Galvin17]{Galvin}David Galvin, \textit{Basic discrete mathematics},
13 December 2017.\newline%
\url{http://www-users.math.umn.edu/~dgrinber/comb/60610lectures2017-Galvin.pdf}
\newline(The URL might change, and the text may get updated. In order to
reliably obtain the version of 13 December 2017, you can use the archive.org
Wayback Machine:
\url{https://web.archive.org/web/20180205122609/http://www-users.math.umn.edu/~dgrinber/comb/60610lectures2017-Galvin.pdf}
.)

\bibitem[Goodma15]{Goodman}Frederick M. Goodman, \textit{Algebra: Abstract and
Concrete}, edition 2.6, 1 May 2015.\newline%
\url{http://homepage.math.uiowa.edu/~goodman/algebrabook.dir/book.2.6.pdf} .

\bibitem[Gould72]{Gould72}%
\href{https://doi.org/10.1016/0097-3165(72)90031-3}{H. W. Gould, \textit{A New
Symmetrical Combinatorial Identity}, Journal of Combinatorial Theory A
\textbf{13} (1972), pp. 278--286.}

\bibitem[Granvi05]{Granvi05}Andrew Granville, \textit{Binomial coefficients
modulo prime powers}, preprint.\newline\url{https://web.archive.org/web/20181024055320/http://ebooks.bharathuniv.ac.in/gdlc1/gdlc1/Engineering Merged Library v3.0/Andrew Granville/Binomial Coefficients Modulo Prime Powers (5579)/Binomial Coefficients Modulo Prime Powers - Andrew Granville.pdf}

\bibitem[Grinbe15]{detnotes}Darij Grinberg, \textit{Notes on the combinatorial
fundamentals of algebra}, 15 September 2022.\newline%
\url{http://www.cip.ifi.lmu.de/~grinberg/primes2015/sols.pdf} \newline The
numbering of theorems and formulas in this link might shift when the project
gets updated; for a \textquotedblleft frozen\textquotedblright\ version whose
numbering is guaranteed to match that in the citations above, see
\url{https://github.com/darijgr/detnotes/releases/tag/2022-09-15c} .

\bibitem[Grinbe16a]{Gri-lina}Darij Grinberg, \textit{Notes on linear algebra},
version of 13 December 2016.\newline\url{https://github.com/darijgr/lina}

\bibitem[Grinbe16b]{QEDMO4-13}Darij Grinberg, \textit{4th QEDMO, Problem 13
with solution}, version of 28 May 2016.\newline\url{http://www.cip.ifi.lmu.de/~grinberg/QEDMO4P13.pdf}

\bibitem[Grinbe17]{lucas}Darij Grinberg, \textit{The Lucas and Babbage
congruences}, 10 January 2019.\newline\url{https://www.cip.ifi.lmu.de/~grinberg/lucascong.pdf}

\bibitem[GrKnPa94]{GKP}Ronald L. Graham, Donald E. Knuth, Oren Patashnik,
\textit{Concrete Mathematics, Second Edition}, Addison-Wesley 1994.\newline
See \url{https://www-cs-faculty.stanford.edu/~knuth/gkp.html} for errata.

\bibitem[Guicha20]{Guicha20}David Guichard, \textit{An Introduction to
Combinatorics and Graph Theory}, 4 March 2023.\newline\url{https://www.whitman.edu/mathematics/cgt_online/book/}

\bibitem[Hammac15]{Hammac15}Richard Hammack, \textit{Book of Proof}, 3rd
edition.\newline\url{https://www.people.vcu.edu/~rhammack/BookOfProof/}

\bibitem[Joyce17]{Joyce17}David Joyce, \textit{Introduction to Modern
Algebra}, 5 December 2017.\newline\url{https://mathcs.clarku.edu/~djoyce/ma225/algebra.pdf}

\bibitem[Joyner08]{Joyner08}W. D. Joyner, \textit{Mathematics of the Rubik's
cube}, 19 August 2008.\newline%
\url{https://web.archive.org/web/20160304122348/http://www.permutationpuzzles.org/rubik/webnotes/}
(link to the PDF at the bottom).

\bibitem[Kastel61]{Kastel61}P. W. Kasteleyn, \textit{The statistics of dimers
on a lattice: I. The number of dimer arrangements on a quadratic lattice},
Physica \textbf{27} (1961), pp. 1209--1225.\newline\url{https://doi.org/10.1016/0031-8914(61)90063-5}

\bibitem[Knapp16]{Knapp1}Anthony W. Knapp, \textit{Basic Algebra}, digital
second edition 2016.\newline\url{http://www.math.stonybrook.edu/~aknapp/download.html}

\bibitem[Knuth93]{Knuth93}Donald E. Knuth, \textit{Johann Faulhaber and sums
of powers}, Math. Comp. \textbf{61} (1993), no. 203, 277--294.\newline\url{https://www.ams.org/journals/mcom/1993-61-203/S0025-5718-1993-1197512-7/}

\bibitem[Kratte17]{Kratte17}Christian Krattenthaler, \textit{Lattice Path
Enumeration}, arXiv:1503.05930v3, published in: Handbook of Enumerative
Combinatorics, M. B\'{o}na (ed.), Discrete Math. and Its Appl., CRC Press,
Boca Raton-London-New York, 2015, pp. 589--678.\newline\url{https://arxiv.org/abs/1503.05930v3}

\bibitem[LeLeMe16]{LeLeMe16}Eric Lehman, F. Thomson Leighton, Albert R. Meyer,
\textit{Mathematics for Computer Science}, revised Tuesday 6th June 2018,
\newline\url{https://courses.csail.mit.edu/6.042/spring18/mcs.pdf} .

\bibitem[LLPT95]{LLPT95}D. Laksov, A. Lascoux, P. Pragacz, and A. Thorup,
\textit{The LLPT Notes}, edited by A. Thorup, 1995,\newline%
\url{https://web.math.ku.dk/noter/filer/sympol.pdf} .

\bibitem[Loehr11]{Loehr-BC}%
\href{https://personal.math.vt.edu/nloehr/bijbook.html}{Nicholas A. Loehr,
\textit{Bijective Combinatorics}, Chapman \& Hall/CRC 2011.}

\bibitem[Loehr20]{Loehr20}Nicholas A. Loehr, \textit{An Introduction to
Mathematical Proofs}, CRC Press 2020.

\bibitem[Mestro14]{Mestro14}\href{https://arxiv.org/abs/1409.3820v1}{Romeo
Me\v{s}trovi\'{c}, \textit{Lucas' theorem: its generalizations, extensions and
applications (1878--2014)}, arXiv:1409.3820v1.}

\bibitem[MusPro07]{MusPro07}Gregg Musiker, James Propp, \textit{Combinatorial
Interpretations for Rank-Two Cluster Algebras of Affine Type}, The Electronic
Journal of Combinatorics \textbf{14} (2007), \#R15.\newline\url{http://www.combinatorics.org/ojs/index.php/eljc/article/view/v14i1r15}

\bibitem[Newste19]{Newste19}Clive Newstead, \textit{An Infinite Descent into
Pure Mathematics}, version 0.4, 1 January 2020.\newline\url{https://infinitedescent.xyz}

\bibitem[Niven69]{Niven69}Ivan Niven, \textit{Formal Power Series}, The
American Mathematical Monthly \textbf{76}, No. 8 (Oct., 1969), pp.
871--889.\newline\url{https://www.maa.org/programs/maa-awards/writing-awards/formal-power-series}

\bibitem[Read80]{Read80}Ronald C. Read, \textit{A Note on Tiling Rectangles
with Dominoes}, Fibonacci Quarterly \textbf{18} (1980), pp. 24--27.\newline\url{https://www.fq.math.ca/Scanned/18-1/read.pdf}

\bibitem[Sagan01]{Sagan01}Bruce Sagan, \textit{The Symmetric Group}, Graduate
Texts in Mathematics \textbf{203}, 2nd edition 2001.\newline%
\url{https://doi.org/10.1007/978-1-4757-6804-6}\newline See
\url{https://users.math.msu.edu/users/bsagan/Books/Sym/errata.pdf} for errata.

\bibitem[Sagan19]{Sagan19}Bruce Sagan, \textit{Combinatorics: The Art of
Counting}, preliminary version, 7 January 2020.\newline\url{https://users.math.msu.edu/users/bsagan/Books/Aoc/final.pdf}

\bibitem[sage]{sage}The Sage Developers, \textit{SageMath, the Sage
Mathematics Software System (Version 9.0)}, 2019,
\url{https://www.sagemath.org} .

\bibitem[SageBook]{SageBook}Paul Zimmermann et al, \textit{Computational
Mathematics with SageMath}, December 2018.\newline\url{https://www.sagemath.org/sagebook/}

\bibitem[Siu84]{Siu84}%
\href{https://www.maa.org/sites/default/files/Siu15722.pdf}{Man-Keung Siu,
\textit{Proof without words: Sum of squares}, Mathematics Magazine \textbf{57}
(1984), issue 2, page 92.}

\bibitem[Smid09]{Smid09}Vita Smid, \textit{Inclusion-Exclusion Principle:
Proof by Mathematical Induction}, 2 December 2009.\newline\url{https://faculty.math.illinois.edu/~nirobles/files453/iep_proof.pdf}

\bibitem[Stanle15]{Stanle15}%
\href{https://doi.org/10.1017/CBO9781139871495}{Richard P. Stanley,
\textit{Catalan Numbers}, 1st edition 2015}.\newline See
\url{http://math.mit.edu/~rstan/catalan/} for errata.

\bibitem[Stanle11]{Stanley-EC1}Richard P. Stanley, \textit{Enumerative
Combinatorics, volume 1}, Second edition, version of 15 July 2011. Available
at \url{http://math.mit.edu/~rstan/ec/} .\newline See
\url{http://math.mit.edu/~rstan/ec/} for errata.

\bibitem[Stanle01]{Stanley-EC2}Richard P. Stanley, \textit{Enumerative
Combinatorics, volume 2}, First edition, Cambridge University Press
2001.\newline See \url{http://math.mit.edu/~rstan/ec/} for errata.

\bibitem[Strick13]{Strick13}Neil Strickland, \textit{MAS201 Linear Mathematics
for Applications}, lecture notes, 28 September 2013.\newline\url{https://neilstrickland.github.io/linear_maths/}

\bibitem[Stucky15]{Stucky15}Eric Stucky, \textit{An Exposition of Kasteleyn's
Solution of the Dimer Model}, senior thesis at Harvey Mudd College,
2015.\newline\url{https://scholarship.claremont.edu/hmc_theses/89/}

\bibitem[Tou17]{Tou17}Erik R. Tou, \textit{Math Origins: The Totient
Function}, Convergence (September 2017),
DOI:10.4169/convergence20170923.\newline\url{https://www.maa.org/press/periodicals/convergence/math-origins-the-totient-function}

\bibitem[Uecker17]{Ueckerdt}Torsten Ueckerdt, \textit{Lecture Notes
Combinatorics (2017)}, 30 May 2017.\newline%
\url{http://www.math.kit.edu/iag6/lehre/combinatorics2017s/media/script.pdf}\newline
See
\url{http://www.cip.ifi.lmu.de/~grinberg/algebra/ueckerdt-script2017-errata.pdf}
for an inofficial list of errata.

\bibitem[UspHea39]{UspHea39}J. V. Uspensky, M. A. Heaslet, \textit{Elementary
Number Theory}, McGraw-Hill 1939.

\bibitem[Vorobi02]{Vorobi02}%
\href{https://doi.org/10.1007/978-3-0348-8107-4}{Nicolai N. Vorobiev,
\textit{Fibonacci Numbers}, Translated from the Russian by Mircea Martin,
Springer 2002 (translation of the 6th Russian edition)}.

\bibitem[Walker87]{Walker87}%
\href{https://web.archive.org/web/20170809055317/https://www.math.nmsu.edu/~elbert/AbsAlgeb.pdf}{Elbert
A. Walker, \textit{Introduction to Abstract Algebra}, Random House/Birkhauser,
New York, 1987.}

\bibitem[Ward91]{Ward91}James Ward, \textit{100 years of Dixon's identity},
Irish Mathematical Society Bulletin \textbf{27} (1991), pp. 46--54.\newline\url{https://www.maths.tcd.ie/pub/ims/bull27/bull27_46-54.pdf}

\bibitem[Warner71]{Warner71}Seth Warner, \textit{Classical Modern Algebra},
Prentice-Hall 1971.

\bibitem[White10]{White10}Dennis White, \textit{Math 4707: Inclusion-Exclusion
and Derangements}, 18 October 2010.\newline\url{https://www-users.cse.umn.edu/~reiner/Classes/Derangements.pdf}

\bibitem[Wilf04]{Wilf04}Herbert S. Wilf, \textit{generatingfunctionology}, 2nd
edition 2004.\newline\url{https://www2.math.upenn.edu/~wilf/DownldGF.html}

\bibitem[Wilf09]{Wilf09}Herbert S. Wilf, \textit{Lectures on Integer
Partitions}, 2009.\newline\url{https://www2.math.upenn.edu/~wilf/PIMS/PIMSLectures.pdf}

\bibitem[Yashin15]{Yashin15}Allan Yashinski, \textit{Math 325 -- Equivalence
Relations, Well-definedness, Modular Arithmetic, and the Rational Numbers}, 13
October 2015.\newline\url{https://math.hawaii.edu/~allan/WellDefinedness.pdf}
\end{thebibliography}


\end{document}