\documentclass[numbers=enddot,12pt,final,onecolumn,notitlepage]{scrartcl}%
\usepackage[headsepline,footsepline,manualmark]{scrlayer-scrpage}
\usepackage[all,cmtip]{xy}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{framed}
\usepackage{comment}
\usepackage{color}
\usepackage[breaklinks=True]{hyperref}
\usepackage[sc]{mathpazo}
\usepackage[T1]{fontenc}
\usepackage{needspace}
\usepackage{tabls}
\usepackage{tikz}
\usepackage{bbding}
%TCIDATA{OutputFilter=latex2.dll}
%TCIDATA{Version=5.50.0.2960}
%TCIDATA{LastRevised=Sunday, December 04, 2022 17:45:37}
%TCIDATA{SuppressPackageManagement}
%TCIDATA{<META NAME="GraphicsSave" CONTENT="32">}
%TCIDATA{<META NAME="SaveForMode" CONTENT="1">}
%TCIDATA{BibliographyScheme=Manual}
%TCIDATA{Language=American English}
%BeginMSIPreambleData
\providecommand{\U}[1]{\protect\rule{.1in}{.1in}}
%EndMSIPreambleData
\usetikzlibrary{arrows.meta}
\usetikzlibrary{chains}
\usetikzlibrary{shapes}
\usetikzlibrary{decorations.pathmorphing}
\newcounter{exer}
\newcounter{exera}
\theoremstyle{definition}
\newtheorem{theo}{Theorem}[subsection]
\newenvironment{theorem}[1][]
{\begin{theo}[#1]\begin{leftbar}}
{\end{leftbar}\end{theo}}
\newtheorem{lem}[theo]{Lemma}
\newenvironment{lemma}[1][]
{\begin{lem}[#1]\begin{leftbar}}
{\end{leftbar}\end{lem}}
\newtheorem{prop}[theo]{Proposition}
\newenvironment{proposition}[1][]
{\begin{prop}[#1]\begin{leftbar}}
{\end{leftbar}\end{prop}}
\newtheorem{defi}[theo]{Definition}
\newenvironment{definition}[1][]
{\begin{defi}[#1]\begin{leftbar}}
{\end{leftbar}\end{defi}}
\newtheorem{remk}[theo]{Remark}
\newenvironment{remark}[1][]
{\begin{remk}[#1]\begin{leftbar}}
{\end{leftbar}\end{remk}}
\newtheorem{coro}[theo]{Corollary}
\newenvironment{corollary}[1][]
{\begin{coro}[#1]\begin{leftbar}}
{\end{leftbar}\end{coro}}
\newtheorem{conv}[theo]{Convention}
\newenvironment{convention}[1][]
{\begin{conv}[#1]\begin{leftbar}}
{\end{leftbar}\end{conv}}
\newtheorem{quest}[theo]{Question}
\newenvironment{question}[1][]
{\begin{quest}[#1]\begin{leftbar}}
{\end{leftbar}\end{quest}}
\newtheorem{warn}[theo]{Warning}
\newenvironment{warning}[1][]
{\begin{warn}[#1]\begin{leftbar}}
{\end{leftbar}\end{warn}}
\newtheorem{conj}[theo]{Conjecture}
\newenvironment{conjecture}[1][]
{\begin{conj}[#1]\begin{leftbar}}
{\end{leftbar}\end{conj}}
\newtheorem{exam}[theo]{Example}
\newenvironment{example}[1][]
{\begin{exam}[#1]\begin{leftbar}}
{\end{leftbar}\end{exam}}
\newtheorem{exmp}[exer]{Exercise}
\newenvironment{exercise}[1][]
{\begin{exmp}[#1]\begin{leftbar}}
{\end{leftbar}\end{exmp}}
\newenvironment{statement}{\begin{quote}}{\end{quote}}
\newenvironment{fineprint}{\begin{small}}{\end{small}}
\iffalse
\newenvironment{proof}[1][Proof]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\newenvironment{convention}[1][Convention]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\newenvironment{question}[1][Question]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\fi
\let\sumnonlimits\sum
\let\prodnonlimits\prod
\let\cupnonlimits\bigcup
\let\capnonlimits\bigcap
\renewcommand{\sum}{\sumnonlimits\limits}
\renewcommand{\prod}{\prodnonlimits\limits}
\renewcommand{\bigcup}{\cupnonlimits\limits}
\renewcommand{\bigcap}{\capnonlimits\limits}
\newcommand\arxiv[1]{\href{http://www.arxiv.org/abs/#1}{\texttt{arXiv:#1}}}
\setlength\tablinesep{3pt}
\setlength\arraylinesep{3pt}
\setlength\extrarulesep{3pt}
\setlength\textheight{22.5cm}
\setlength\textwidth{14.8cm}
\newenvironment{verlong}{}{}
\newenvironment{vershort}{}{}
\newenvironment{noncompile}{}{}
\excludecomment{verlong}
\includecomment{vershort}
\excludecomment{noncompile}
\newcommand{\defn}[1]{{\color{darkred}\emph{#1}}}
\newcommand{\CC}{\mathbb{C}}
\newcommand{\RR}{\mathbb{R}}
\newcommand{\QQ}{\mathbb{Q}}
\newcommand{\NN}{\mathbb{N}}
\newcommand{\ZZ}{\mathbb{Z}}
\newcommand{\KK}{\mathbb{K}}
\newcommand{\set}[1]{\left\{ #1 \right\}}
\newcommand{\abs}[1]{\left| #1 \right|}
\newcommand{\tup}[1]{\left( #1 \right)}
\newcommand{\ive}[1]{\left[ #1 \right]}
\newcommand{\floor}[1]{\left\lfloor #1 \right\rfloor}
\newcommand{\are}{\ar@{-}}
\newcommand{\arebi}[1][]{\ar@{<-}@/_/[#1] \ar@/^/[#1]}
\newcommand{\of}{\text{ of }}
\definecolor{darkgreen}{rgb}{0,.5,0}
\newtheoremstyle{plainsl}
{8pt plus 2pt minus 4pt}
{8pt plus 2pt minus 4pt}
{\slshape}
{0pt}
{\bfseries}
{.}
{5pt plus 1pt minus 1pt}
{}
\theoremstyle{plainsl}
\ihead{Lecture 19, version \today}
\ohead{page \thepage}
\cfoot{}
\begin{document}
\section*{Math 222 Fall 2022, Lecture 19: Binomial coefficients}

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

\setcounter{section}{1}

\section{Binomial coefficients (cont'd)}

\setcounter{subsection}{6}

\subsection{The principle of inclusion and exclusion (aka Sylvester's sieve
formula)}

The principle of inclusion and exclusion is probably the last of the major
counting principles. We will state it in four equivalent forms and prove it
soon after. Then, in the next lecture, we will see some of its applications.

\subsubsection{The principles}

Playing around with finite sets, one may spot a few patterns. For instance,
the size of the union of a few finite sets can be computed using the sizes of
their intersections:

\begin{itemize}
\item For any two finite sets $A$ and $B$, we have%
\begin{equation}
\left\vert A\cup B\right\vert =\left\vert A\right\vert +\left\vert
B\right\vert -\left\vert A\cap B\right\vert . \label{eq.pie.n=2}%
\end{equation}


\item For any three finite sets $A$, $B$ and $C$, we have%
\begin{equation}
\left\vert A\cup B\cup C\right\vert =\left\vert A\right\vert +\left\vert
B\right\vert +\left\vert C\right\vert -\left\vert A\cap B\right\vert
-\left\vert A\cap C\right\vert -\left\vert B\cap C\right\vert +\left\vert
A\cap B\cap C\right\vert . \label{eq.pie.n=3}%
\end{equation}


\item For any four finite sets $A$, $B$, $C$ and $D$, we have%
\begin{align}
&  \left\vert A\cup B\cup C\cup D\right\vert \nonumber\\
&  =\left\vert A\right\vert +\left\vert B\right\vert +\left\vert C\right\vert
+\left\vert D\right\vert \nonumber\\
&  \ \ \ \ \ \ \ \ \ \ -\left\vert A\cap B\right\vert -\left\vert A\cap
C\right\vert -\left\vert A\cap D\right\vert -\left\vert B\cap C\right\vert
-\left\vert B\cap D\right\vert -\left\vert C\cap D\right\vert \nonumber\\
&  \ \ \ \ \ \ \ \ \ \ +\left\vert A\cap B\cap C\right\vert +\left\vert A\cap
B\cap D\right\vert +\left\vert A\cap C\cap D\right\vert +\left\vert B\cap
C\cap D\right\vert \nonumber\\
&  \ \ \ \ \ \ \ \ \ \ -\left\vert A\cap B\cap C\cap D\right\vert .
\label{eq.pie.n=4}%
\end{align}

\end{itemize}

These three equalities all follow the same pattern: On the left is the size of
a union of some finite sets; on the right are the sizes of their intersections
(not just the intersection of all the sets, but also the intersections of some
of them, such as $A\cap B\cap D$ or $B\cap C$ or even $B$). This pattern
remains valid for any (finite) number of finite sets:

\begin{theorem}
\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}) looks
scary, 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
(and with $A_{1},A_{2},A_{3},\ldots$ renamed as $A,B,C,\ldots$).

Theorem \ref{thm.pie.a-ik} is known as the \textbf{Principle of Inclusion and
Exclusion} (short: \textbf{PIE}) or as \textbf{Sylvester's sieve formula}. We
will not prove it right away, but rather rewrite it in several other forms,
some of which are easier to prove and more useful.

For our first restatement, we need a notation from set theory:

\begin{definition}
\label{def.bigcap}Let $I$ be a nonempty set. For each $i\in I$, let $A_{i}$ be
any set. Then, we set%
\[
\bigcap\limits_{i\in I}A_{i}:=\left\{  x\ \mid\ x\in A_{i}\text{ for each
}i\in I\right\}  .
\]
This set $\bigcap\limits_{i\in I}A_{i}$ is called the \textbf{intersection} of
the sets $A_{i}$ for $i\in I$.
\end{definition}

For example:

\begin{itemize}
\item If $I=\left\{  i_{1},i_{2},\ldots,i_{m}\right\}  $ is a finite set, then
$\bigcap\limits_{i\in I}A_{i}=A_{i_{1}}\cap A_{i_{2}}\cap\cdots\cap A_{i_{m}}$.

\item If $I$ is a bunch of people, and if $A_{i}=\left\{  \text{friends of
}i\right\}  $ for each $i\in I$, then $\bigcap\limits_{i\in I}A_{i}=\left\{
x\ \mid\ x\text{ is friends with \textbf{everyone} in }I\right\}  $.
\end{itemize}

Note the similarity between this notation $\bigcap\limits_{i\in I}A_{i}$ and
the well-known notations for finite sums ($\sum\limits_{i\in I}a_{i}$) and
finite products ($\prod\limits_{i\in I}a_{i}$). There is also an analogous
notation $\bigcup\limits_{i\in I}A_{i}$ for the \textbf{union} of some sets.

Now, we can rewrite the RHS of Theorem \ref{thm.pie.a-ik} 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}
If $n=3$, then the claim of Proposition \ref{prop.pie.bigcap-rewritten} takes
the form%
\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}.]Essentially, the reason
is the following: Both the LHS and the RHS are the sum of the sizes of all
possible intersections of some of our $n$ sets $A_{1},A_{2},\ldots,A_{n}$,
with appropriate signs (namely, a \textquotedblleft$+$\textquotedblright\ sign
whenever we are intersecting an odd \# of sets, and a \textquotedblleft%
$-$\textquotedblright\ sign whenever we are intersecting an even \# of sets).
They differ only in their organization (the RHS is taking this sum directly,
whereas the LHS splits it up according to the \# of sets being intersected,
and labels the possible intersections by their indices in increasing order).

For the details of this proof, see the 2019 notes (Proposition 2.9.4).
\end{proof}

We can now restate the Principle of Inclusion and Exclusion as follows:

\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 this theorem (and the previous one). But first, we shall
restate it further, by focussing not on the union $A_{1}\cup A_{2}\cup
\cdots\cup A_{n}$ of our $n$ sets, but rather on the complement of this union
(i.e., on everything that is \textbf{not} in this union). To make sense of
this complement, we need to introduce a \textquotedblleft
universe\textquotedblright\ set $U$ that contains all of our $n$ sets
$A_{1},A_{2},\ldots,A_{n}$ as subsets:

\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\vert A_{1}\right\vert -\left\vert
A_{2}\right\vert +\left\vert A_{1}\cap A_{2}\right\vert .
\end{align*}

\end{example}

Note that $U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right)  $ is
the set of all elements of $U$ that belong to \textbf{none} of $A_{1}%
,A_{2},\ldots,A_{n}$.

Finally, let us restate Theorem \ref{thm.pie.b} in yet another form (which is
both easiest to prove and most convenient for applications):

\begin{theorem}
\label{thm.pie.bUU}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,\footnotemark%
\begin{align*}
&  \left(  \text{\# of all }s\in U\text{ such that }s\notin A_{i}\text{ for
all }i\in\left[  n\right]  \right) \\
&  =\sum_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\left(  \text{\# of all }s\in U\text{ such that }s\in
A_{i}\text{ for all }i\in I\right)  .
\end{align*}

\end{theorem}

\footnotetext{Note that the condition \textquotedblleft$s\in A_{i}$ for all
$i\in I$\textquotedblright\ is vacuously true if the set $I$ is empty. Thus,
if $I$ is empty, then
\[
\left(  \text{\# of all }s\in U\text{ such that }s\in A_{i}\text{ for all
}i\in I\right)  =\left(  \text{\# of all }s\in U\right)  =\left\vert
U\right\vert .
\]
}

\subsubsection{The cancellation lemma}

We have now stated the Principle of Inclusion and Exclusion in four different
forms. Soon we shall prove them. The proof will rely on the following crucial
lemma\footnote{We again use the Iverson bracket notation.}:

\begin{proposition}
[simple cancellation lemma]\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}

\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}
[Proof of Proposition \ref{prop.DIE.destruct1}.]The case $S=\varnothing$ is
clear (since $1=1$). So we WLOG assume that $S\neq\varnothing$. Therefore,
there exists some $g\in S$. Pick such a $g$.

A subset $I$ of $S$ will be called \textbf{green} if it satisfies $g\in I$,
and will be called \textbf{red} otherwise. Then, there is a bijection%
\begin{align*}
\left\{  \text{green subsets}\right\}   &  \rightarrow\left\{  \text{red
subsets}\right\}  ,\\
J  &  \mapsto J\setminus\left\{  g\right\}  ,
\end{align*}
whose inverse map is%
\begin{align*}
\left\{  \text{red subsets}\right\}   &  \rightarrow\left\{  \text{green
subsets}\right\}  ,\\
J  &  \mapsto J\cup\left\{  g\right\}  .
\end{align*}
This bijection allows us to pair up each green subset of $S$ with a red subset
of $S$ (namely, each green subset $J$ gets paired up with the red subset
$J\setminus\left\{  g\right\}  $). In each pair thus obtained, the sizes of
the two subsets differ by $1$, so the corresponding $\left(  -1\right)
^{\left\vert I\right\vert }$ terms add up to $0$. Thus, we have paired up all
the addends in the sum $\sum_{I\subseteq S}\left(  -1\right)  ^{\left\vert
I\right\vert }$ in such a way that each pair sums to $0$ (since the two
addends in the pair cancel each other). Therefore, the whole sum is $0$. But
$\left[  S=\varnothing\right]  $ is also $0$, since $S\neq\varnothing$. So we
obtain $\sum_{I\subseteq S}\left(  -1\right)  ^{\left\vert I\right\vert
}=\left[  S=\varnothing\right]  $, as desired.

(See the 2019 notes (Proposition 2.9.10) for a formalized version of this
proof, as well as for another proof.)
\end{proof}

The reason for the word \textquotedblleft simple\textquotedblright\ in the
name of Proposition \ref{prop.DIE.destruct1} is the existence of the
following, slightly more general, cancellation lemma:

\begin{proposition}
[cancellation lemma]\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{proof}
See Exercise 2.9.1 in the 2019 notes.
\end{proof}

For instance, if $S=\left[  4\right]  $ and $T=\left[  2\right]  $, then
Proposition \ref{prop.DIE.destruct2} is saying that%
\[
\left(  -1\right)  ^{\left\vert \left\{  1,2\right\}  \right\vert }+\left(
-1\right)  ^{\left\vert \left\{  1,2,3\right\}  \right\vert }+\left(
-1\right)  ^{\left\vert \left\{  1,2,4\right\}  \right\vert }+\left(
-1\right)  ^{\left\vert \left\{  1,2,3,4\right\}  \right\vert }=0.
\]


\subsubsection{The proofs}

We are now ready to prove the Principle of Inclusion and Exclusion in all its
forms. We begin with the last form:

\begin{theorem}
[Theorem \ref{thm.pie.bUU}, repeated for convenience]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{align*}
&  \left(  \text{\# of all }s\in U\text{ such that }s\notin A_{i}\text{ for
all }i\in\left[  n\right]  \right) \\
&  =\sum_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\left(  \text{\# of all }s\in U\text{ such that }s\in
A_{i}\text{ for all }i\in I\right)  .
\end{align*}

\end{theorem}

\begin{proof}
This will involve some set juggling. To gain a bit of useful intuition, you
may want to anthropomorphize some of the sets and elements involved. For
instance, you can think

\begin{itemize}
\item of $U$ as a \textbf{u}niversity, defined (somewhat reductionistically)
as a set of \textbf{s}tudents $s\in U$;

\item of $A_{1},A_{2},\ldots,A_{n}$ as \textbf{a}ssociations, each of which
contains some students;

\item of a subset $I\subseteq\left[  n\right]  $ as a choice of associations
(none if $I$ is empty, or all of them if $I=\left[  n\right]  $) to be
\textbf{i}ntersected.
\end{itemize}

The claim of Theorem \ref{thm.pie.bUU} then can be rewritten as follows:%
\begin{align*}
&  \left(  \text{\# of all students }s\text{ that belong to no association}%
\right) \\
&  =\sum_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\left(  \text{\# of all }s\in U\text{ that belong to all
associations }A_{i}\text{ with }i\in I\right)  .
\end{align*}


We shall prove this by the following strategy: We fix a single student $s\in
U$, and we compare its contribution to the \# on the LHS with its contribution
to the sum on the RHS.

The rigorous way to do this is to recall the roll-call principle (Lecture 11,
Proposition 1.6.3 \textbf{(b)}). This principle yields%
\begin{equation}
\left(  \text{\# of all }s\in U\text{ such that }s\notin A_{i}\text{ for all
}i\in\left[  n\right]  \right)  =\sum_{s\in U}\left[  s\notin A_{i}\text{ for
all }i\in\left[  n\right]  \right]  . \label{pf.thm.pie.bUU.1}%
\end{equation}
For the same reason, if $I\subseteq\left[  n\right]  $, then%
\[
\left(  \text{\# of all }s\in U\text{ such that }s\in A_{i}\text{ for all
}i\in I\right)  =\sum_{s\in U}\left[  s\in A_{i}\text{ for all }i\in I\right]
.
\]


Thus,%
\begin{align}
&  \sum_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\underbrace{\left(  \text{\# of all }s\in U\text{ such that
}s\in A_{i}\text{ for all }i\in I\right)  }_{=\sum_{s\in U}\left[  s\in
A_{i}\text{ for all }i\in I\right]  }\nonumber\\
&  =\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]
\nonumber\\
&  =\sum_{I\subseteq\left[  n\right]  }\ \ \sum_{s\in U}\left(  -1\right)
^{\left\vert I\right\vert }\left[  s\in A_{i}\text{ for all }i\in I\right]
\nonumber\\
&  =\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]
\label{pf.thm.pie.bUU.3}%
\end{align}
(here, we have interchanged the two summation signs). Let us now simplify the
inner sum here.

We fix a student $s\in U$, and we let
\[
P_{s}:=\left\{  i\in\left[  n\right]  \ \mid\ s\in A_{i}\right\}  .
\]
We shall refer to $P_{s}$ as the \textquotedblleft\textbf{p}assport of
$s$\textquotedblright, as it records which of our $n$ associations
$A_{1},A_{2},\ldots,A_{n}$ the student $s$ belongs to. Hence, a subset $I$ of
$\left[  n\right]  $ satisfies \textquotedblleft$s\in A_{i}$ for all $i\in
I$\textquotedblright\ if and only if it satisfies $I\subseteq P_{s}$.
Therefore, for any subset $I$ of $\left[  n\right]  $, we have%
\[
\left[  s\in A_{i}\text{ for all }i\in I\right]  =\left[  I\subseteq
P_{s}\right]
\]
(since equivalent statements have the same truth value). Therefore,%
\begin{align}
&  \sum_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\underbrace{\left[  s\in A_{i}\text{ for all }i\in I\right]
}_{=\left[  I\subseteq P_{s}\right]  }\nonumber\\
&  =\sum_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\left[  I\subseteq P_{s}\right]  \nonumber\\
&  =\sum_{\substack{I\subseteq\left[  n\right]  ;\\I\subseteq P_{s}}}\left(
-1\right)  ^{\left\vert I\right\vert }\underbrace{\left[  I\subseteq
P_{s}\right]  }_{=1}+\sum_{\substack{I\subseteq\left[  n\right]
;\\I\not \subseteq P_{s}}}\left(  -1\right)  ^{\left\vert I\right\vert
}\underbrace{\left[  I\subseteq P_{s}\right]  }_{=0}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have split our sum into two parts:}\\
\text{one containing the addends for which }I\subseteq P_{s}\text{,}\\
\text{and one containing all the other addends}%
\end{array}
\right)  \nonumber\\
&  =\sum_{\substack{I\subseteq\left[  n\right]  ;\\I\subseteq P_{s}}}\left(
-1\right)  ^{\left\vert I\right\vert }+\underbrace{\sum_{\substack{I\subseteq
\left[  n\right]  ;\\I\not \subseteq P_{s}}}\left(  -1\right)  ^{\left\vert
I\right\vert }0}_{=0}=\sum_{\substack{I\subseteq\left[  n\right]
;\\I\subseteq P_{s}}}\left(  -1\right)  ^{\left\vert I\right\vert }\nonumber\\
&  =\sum_{I\subseteq P_{s}}\left(  -1\right)  ^{\left\vert I\right\vert
}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since the subsets }I\text{ of }\left[  n\right]  \text{ satisfying
}I\subseteq P_{s}\\
\text{are precisely the subsets of }P_{s}\text{ (because }P_{s}\subseteq
\left[  n\right]  \text{)}%
\end{array}
\right)  \nonumber\\
&  =\left[  P_{s}=\varnothing\right]  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
Proposition \ref{prop.DIE.destruct1}, applied to }S=P_{s}\right)  \nonumber\\
&  =\left[  s\notin A_{i}\text{ for each }i\in\left[  n\right]  \right]
\label{pf.thm.pie.bUU.5}%
\end{align}
(because the passport $P_{s}$ of $s$ is empty if and only if $s$ belongs to no
association, i.e., if and only if we have $s\notin A_{i}$ for each
$i\in\left[  n\right]  $).

Forget that we fixed $s$. We have thus proved (\ref{pf.thm.pie.bUU.5}) for
each $s\in U$. Now, (\ref{pf.thm.pie.bUU.3}) becomes%
\begin{align*}
&  \sum_{I\subseteq\left[  n\right]  }\left(  -1\right)  ^{\left\vert
I\right\vert }\left(  \text{\# of all }s\in U\text{ such that }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\notin A_{i}\text{ for each }i\in\left[
n\right]  \right]  \\\text{(by (\ref{pf.thm.pie.bUU.5}))}}}\\
&  =\sum_{s\in U}\left[  s\notin A_{i}\text{ for each }i\in\left[  n\right]
\right] \\
&  =\left(  \text{\# of all }s\in U\text{ such that }s\notin A_{i}\text{ for
each }i\in\left[  n\right]  \right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.thm.pie.bUU.1})}\right)  .
\end{align*}
This proves Theorem \ref{thm.pie.bUU}.
\end{proof}

As we said, the four versions of the Principle of Inclusion and Exclusion are
restatements of one another, so that, having proved one of them, we can easily
derive the other three:

\begin{proof}
[Proof of Theorem \ref{thm.pie.b}.]Theorem \ref{thm.pie.b} is equivalent to
Theorem \ref{thm.pie.bUU}, since we have%
\begin{align*}
&  \left(  \text{\# of all }s\in U\text{ such that }s\notin A_{i}\text{ for
all }i\in\left[  n\right]  \right) \\
&  =\left(  \text{\# of all }s\in U\text{ such that }s\notin A_{1}\cup
A_{2}\cup\cdots\cup A_{n}\right) \\
&  =\left(  \text{\# of all }s\in U\setminus\left(  A_{1}\cup A_{2}\cup
\cdots\cup A_{n}\right)  \right) \\
&  =\left\vert U\setminus\left(  A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right)
\right\vert
\end{align*}
and since each $I\subseteq\left[  n\right]  $ satisfies\footnote{To be fully
precise, this argument works only for nonempty $I$. If $I$ is empty, a
separate (even more trivial) argument is needed here.}%
\begin{align*}
&  \left(  \text{\# of all }s\in U\text{ such that }s\in A_{i}\text{ for all
}i\in I\right) \\
&  =\left(  \text{\# of all }s\in U\text{ such that }s\in\bigcap_{i\in I}%
A_{i}\right) \\
&  =\left\vert \bigcap_{i\in I}A_{i}\right\vert \ \ \ \ \ \ \ \ \ \ \left(
\text{since }\bigcap_{i\in I}A_{i}\subseteq U\right)  .
\end{align*}

\end{proof}

\begin{proof}
[Proof of Theorem \ref{thm.pie.a}.]Let $U:=A_{1}\cup A_{2}\cup\cdots\cup
A_{n}$. Then, $U$ is a finite set, and $A_{1},A_{2},\ldots,A_{n}$ are $n$
subsets of $U$. Hence, Theorem \ref{thm.pie.b} 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 \bigcap_{i\in I}A_{i}\right\vert .
\]
However, the left hand side of this equality is $0$ (since $U\setminus\left(
A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right)  =\varnothing$). Thus, this
equality rewrites as%
\begin{align*}
0 &  =\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 }}_{=\left(  -1\right)  ^{0}%
=1}\left\vert \underbrace{\bigcap_{i\in\varnothing}A_{i}}%
_{\substack{=U\\\text{(by definition)}}}\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 U\right\vert +\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 =\left\vert
U\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*}
In other words,
\[
\left\vert U\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 .
\]
In view of $U=A_{1}\cup A_{2}\cup\cdots\cup A_{n}$, this is precisely the
claim of Theorem \ref{thm.pie.a}.
\end{proof}

\begin{proof}
[Proof of Theorem \ref{thm.pie.a-ik}.]Proposition
\ref{prop.pie.bigcap-rewritten} shows that the right hand sides of
(\ref{eq.thm.pie.a-ik.claim}) and (\ref{eq.thm.pie.a.claim}) are identical.
Hence, (\ref{eq.thm.pie.a-ik.claim}) follows from (\ref{eq.thm.pie.a.claim}).
Thus, Theorem \ref{thm.pie.a-ik} is proven.
\end{proof}


\end{document}