\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=Saturday, December 03, 2022 01:05:06}
%TCIDATA{SuppressPackageManagement}
%TCIDATA{<META NAME="GraphicsSave" CONTENT="32">}
%TCIDATA{<META NAME="SaveForMode" CONTENT="1">}
%TCIDATA{BibliographyScheme=Manual}
%TCIDATA{Language=American English}
%BeginMSIPreambleData
\providecommand{\U}[1]{\protect\rule{.1in}{.1in}}
%EndMSIPreambleData
\usetikzlibrary{arrows.meta}
\usetikzlibrary{chains}
\usetikzlibrary{shapes}
\usetikzlibrary{decorations.pathmorphing}
\newcounter{exer}
\newcounter{exera}
\theoremstyle{definition}
\newtheorem{theo}{Theorem}[subsection]
\newenvironment{theorem}[1][]
{\begin{theo}[#1]\begin{leftbar}}
{\end{leftbar}\end{theo}}
\newtheorem{lem}[theo]{Lemma}
\newenvironment{lemma}[1][]
{\begin{lem}[#1]\begin{leftbar}}
{\end{leftbar}\end{lem}}
\newtheorem{prop}[theo]{Proposition}
\newenvironment{proposition}[1][]
{\begin{prop}[#1]\begin{leftbar}}
{\end{leftbar}\end{prop}}
\newtheorem{defi}[theo]{Definition}
\newenvironment{definition}[1][]
{\begin{defi}[#1]\begin{leftbar}}
{\end{leftbar}\end{defi}}
\newtheorem{remk}[theo]{Remark}
\newenvironment{remark}[1][]
{\begin{remk}[#1]\begin{leftbar}}
{\end{leftbar}\end{remk}}
\newtheorem{coro}[theo]{Corollary}
\newenvironment{corollary}[1][]
{\begin{coro}[#1]\begin{leftbar}}
{\end{leftbar}\end{coro}}
\newtheorem{conv}[theo]{Convention}
\newenvironment{convention}[1][]
{\begin{conv}[#1]\begin{leftbar}}
{\end{leftbar}\end{conv}}
\newtheorem{quest}[theo]{Question}
\newenvironment{question}[1][]
{\begin{quest}[#1]\begin{leftbar}}
{\end{leftbar}\end{quest}}
\newtheorem{warn}[theo]{Warning}
\newenvironment{warning}[1][]
{\begin{warn}[#1]\begin{leftbar}}
{\end{leftbar}\end{warn}}
\newtheorem{conj}[theo]{Conjecture}
\newenvironment{conjecture}[1][]
{\begin{conj}[#1]\begin{leftbar}}
{\end{leftbar}\end{conj}}
\newtheorem{exam}[theo]{Example}
\newenvironment{example}[1][]
{\begin{exam}[#1]\begin{leftbar}}
{\end{leftbar}\end{exam}}
\newtheorem{exmp}[exer]{Exercise}
\newenvironment{exercise}[1][]
{\begin{exmp}[#1]\begin{leftbar}}
{\end{leftbar}\end{exmp}}
\newenvironment{statement}{\begin{quote}}{\end{quote}}
\newenvironment{fineprint}{\begin{small}}{\end{small}}
\iffalse
\newenvironment{proof}[1][Proof]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\newenvironment{convention}[1][Convention]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\newenvironment{question}[1][Question]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\fi
\let\sumnonlimits\sum
\let\prodnonlimits\prod
\let\cupnonlimits\bigcup
\let\capnonlimits\bigcap
\renewcommand{\sum}{\sumnonlimits\limits}
\renewcommand{\prod}{\prodnonlimits\limits}
\renewcommand{\bigcup}{\cupnonlimits\limits}
\renewcommand{\bigcap}{\capnonlimits\limits}
\newcommand\arxiv[1]{\href{http://www.arxiv.org/abs/#1}{\texttt{arXiv:#1}}}
\setlength\tablinesep{3pt}
\setlength\arraylinesep{3pt}
\setlength\extrarulesep{3pt}
\setlength\textheight{22.5cm}
\setlength\textwidth{14.8cm}
\newenvironment{verlong}{}{}
\newenvironment{vershort}{}{}
\newenvironment{noncompile}{}{}
\excludecomment{verlong}
\includecomment{vershort}
\excludecomment{noncompile}
\newcommand{\defn}[1]{{\color{darkred}\emph{#1}}}
\newcommand{\CC}{\mathbb{C}}
\newcommand{\RR}{\mathbb{R}}
\newcommand{\QQ}{\mathbb{Q}}
\newcommand{\NN}{\mathbb{N}}
\newcommand{\ZZ}{\mathbb{Z}}
\newcommand{\KK}{\mathbb{K}}
\newcommand{\set}[1]{\left\{ #1 \right\}}
\newcommand{\abs}[1]{\left| #1 \right|}
\newcommand{\tup}[1]{\left( #1 \right)}
\newcommand{\ive}[1]{\left[ #1 \right]}
\newcommand{\floor}[1]{\left\lfloor #1 \right\rfloor}
\newcommand{\are}{\ar@{-}}
\newcommand{\arebi}[1][]{\ar@{<-}@/_/[#1] \ar@/^/[#1]}
\newcommand{\of}{\text{ of }}
\newtheoremstyle{plainsl}
{8pt plus 2pt minus 4pt}
{8pt plus 2pt minus 4pt}
{\slshape}
{0pt}
{\bfseries}
{.}
{5pt plus 1pt minus 1pt}
{}
\theoremstyle{plainsl}
\ihead{Lecture 4, version \today}
\ohead{page \thepage}
\cfoot{}
\begin{document}
\section*{Math 222 Fall 2022, Lecture 4: Introduction}

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

\section{Introduction (cont'd)}

\setcounter{subsection}{1}

\subsection{Sums of powers}

\subsubsection{The sum $1+2+...+n$}

We now change the topic and recall a famous result (known to the Ancient
Greeks, but colloquially known as the \textquotedblleft\textbf{Little Gauss
formula}\textquotedblright\ due to
\href{https://www.nctm.org/Publications/TCM-blog/Blog/The-Story-of-Gauss/}{a
famous anecdote about Gauss discovering it in middle school}):

\begin{theorem}
[\textquotedblleft Little Gauss formula\textquotedblright]\label{thm.sum.pow1}%
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}$ by our conventions. So Theorem
\ref{thm.sum.pow1} applies to $n=0$ in particular. In this case, the sum
$1+2+\cdots+n$ is an empty sum (i.e., it has no addends), and is understood to
be $0$ by convention. Thus, Theorem \ref{thm.sum.pow1} says that
$0=\dfrac{0\left(  0+1\right)  }{2}$ for $n=0$.

\begin{proof}
[First proof of Theorem \ref{thm.sum.pow1}.]Induction on $n$. The details are
straightforward and LTTR (= left to the reader).
\end{proof}

\begin{proof}
[Second proof of Theorem \ref{thm.sum.pow1}.]We observe the following general
fact: If $a_{1},a_{2},\ldots,a_{n}$ and $b_{1},b_{2},\ldots,b_{n}$ are
arbitrary numbers, then%
\begin{align*}
&  \left(  a_{1}+a_{2}+\cdots+a_{n}\right)  +\left(  b_{1}+b_{2}+\cdots
+b_{n}\right) \\
&  =\left(  a_{1}+b_{1}\right)  +\left(  a_{2}+b_{2}\right)  +\cdots+\left(
a_{n}+b_{n}\right)  .
\end{align*}
Hence,%
\begin{align*}
&  \left(  1+2+\cdots+n\right)  +\left(  n+\left(  n-1\right)  +\cdots
+1\right) \\
&  =\underbrace{\left(  1+n\right)  }_{=n+1}+\underbrace{\left(  2+\left(
n-1\right)  \right)  }_{=n+1}+\cdots+\underbrace{\left(  n+1\right)  }%
_{=n+1}\\
&  =\underbrace{\left(  n+1\right)  +\left(  n+1\right)  +\cdots+\left(
n+1\right)  }_{n\text{ many }\left(  n+1\right)  \text{'s}}\\
&  =n\left(  n+1\right)  .
\end{align*}
Thus,%
\begin{align*}
n\left(  n+1\right)   &  =\left(  1+2+\cdots+n\right)  +\underbrace{\left(
n+\left(  n-1\right)  +\cdots+1\right)  }_{=1+2+\cdots+n}\\
&  =\left(  1+2+\cdots+n\right)  +\left(  1+2+\cdots+n\right) \\
&  =2\cdot\left(  1+2+\cdots+n\right)  .
\end{align*}
Dividing this by $2$, we get%
\[
\dfrac{n\left(  n+1\right)  }{2}=1+2+\cdots+n,
\]
qed.
\end{proof}

\begin{proof}
[Third proof of Theorem \ref{thm.sum.pow1}.]Here is a picture proof (shown
here 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.0228pc}%
\]
This is a $4\times3$-rectangle\footnote{Each square of this rectangle is
marked with an asterisk.} (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. 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}$.

But we can also compute this area in a different way: 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.sum.pow1} 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.sum.pow1} for
arbitrary $n$.

Now, of course, picture proofs aren't the most convincing thing in mathematics
(there is \href{https://www.youtube.com/watch?v=VYQVlVoWoPY}{a wonderful
3blue1brown video} showing four different fake \textquotedblleft picture
proofs\textquotedblright, with subsequent revelation). Fortunately, the above
picture proof is actually a combinatorial proof in disguise, and once we have
stripped it down to this combinatorial core, its correctness will be easy to ascertain.

Here is an outline of how to make this picture proof rigorous using
combinatorics (see my 2019 notes\footnote{the Third proof of Theorem 1.2.1 in
those notes, in particular} for more details). As for domino tilings, we think
of the $\left(  n+1\right)  \times n$-rectangle as the set $\left[
n+1\right]  \times\left[  n\right]  $ consisting of all pairs $\left(
i,j\right)  $ of integers $i\in\left[  n+1\right]  $ and $j\in\left[
n\right]  $. Set%
\begin{align*}
A  &  :=\left\{  \left(  i,j\right)  \in\left[  n+1\right]  \times\left[
n\right]  \ \mid\ i\leq j\right\}  ;\\
B  &  :=\left\{  \left(  i,j\right)  \in\left[  n+1\right]  \times\left[
n\right]  \ \mid\ i>j\right\}  .
\end{align*}
The set $A$ consists of all squares in our rectangle that lie above the broken
line on the picture; the set $B$ consists of all squares in our rectangle that
lie below that broken line.

The sum rule yields $\left\vert \left[  n+1\right]  \times\left[  n\right]
\right\vert =\left\vert A\right\vert +\left\vert B\right\vert $, since $A$ and
$B$ are two disjoint finite sets whose union is $\left[  n+1\right]
\times\left[  n\right]  $. Thus,%
\[
\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(  n+1\right)  \cdot n=n\left(  n+1\right)
.
\]


On the other hand, the set $B$ consists of all pairs $\left(  i,j\right)
\in\left[  n+1\right]  \times\left[  n\right]  $ such that $i>j$. As we said,
the elements of $B$ are the squares in our rectangle that lie below the broken
line. In our picture proof above, we counted these squares column by column.
Combinatorially, this corresponds to counting the pairs $\left(  i,j\right)
\in B$ according to the value of their first entry $i$ (since the square
$\left(  i,j\right)  $ lies in the $i$-th column). In other words, we count
the pairs $\left(  1,j\right)  \in B$, the pairs $\left(  2,j\right)  \in B$,
the pairs $\left(  3,j\right)  \in B$, and so on, and then we add all the
resulting numbers together. Thus, we obtain%
\begin{align*}
\left\vert B\right\vert  &  =\left(  \text{\# of pairs }\left(  i,j\right)
\in\left[  n+1\right]  \times\left[  n\right]  \text{ such that }i>j\right) \\
&  =\underbrace{\left(  \text{\# of pairs }\left(  1,j\right)  \in\left[
n+1\right]  \times\left[  n\right]  \text{ such that }1>j\right)
}_{\substack{=0\\\text{(since there are no such pairs)}}}\\
&  \ \ \ \ \ \ \ \ \ \ +\underbrace{\left(  \text{\# of pairs }\left(
2,j\right)  \in\left[  n+1\right]  \times\left[  n\right]  \text{ such that
}2>j\right)  }_{\substack{=1\\\text{(since the only such pair is }\left(
2,1\right)  \text{)}}}\\
&  \ \ \ \ \ \ \ \ \ \ +\underbrace{\left(  \text{\# of pairs }\left(
3,j\right)  \in\left[  n+1\right]  \times\left[  n\right]  \text{ such that
}3>j\right)  }_{\substack{=2\\\text{(since the only such pairs are }\left(
3,1\right)  \text{ and }\left(  3,2\right)  \text{)}}}\\
&  \ \ \ \ \ \ \ \ \ \ +\cdots\\
&  \ \ \ \ \ \ \ \ \ \ +\underbrace{\left(  \text{\# of pairs }\left(
n+1,j\right)  \in\left[  n+1\right]  \times\left[  n\right]  \text{ such that
}n+1>j\right)  }_{\substack{=n\\\text{(since all such pairs are }\left(
n+1,1\right)  \text{, }\left(  n+1,2\right)  \text{, }\ldots\text{, }\left(
n+1,n\right)  \text{)}}}\\
&  =0+1+2+\cdots+n=1+2+\cdots+n.
\end{align*}


On the other hand, there is a bijection from $A$ to $B$, which flips a square
across the center of the rectangle. Rigorously speaking, it is the map%
\begin{align*}
A  &  \rightarrow B,\\
\left(  i,j\right)   &  \mapsto\left(  n+2-i,\ n+1-j\right)  .
\end{align*}
By the bijection principle, we thus obtain $\left\vert A\right\vert
=\left\vert B\right\vert $. Hence, $\left\vert A\right\vert +\left\vert
B\right\vert =\left\vert B\right\vert +\left\vert B\right\vert =2\cdot
\left\vert B\right\vert $, so that%
\[
\left\vert B\right\vert =\dfrac{\left\vert A\right\vert +\left\vert
B\right\vert }{2}=\dfrac{n\left(  n+1\right)  }{2}\ \ \ \ \ \ \ \ \ \ \left(
\text{since }\left\vert A\right\vert +\left\vert B\right\vert =n\left(
n+1\right)  \right)  .
\]
Since $\left\vert B\right\vert =1+2+\cdots+n$, this yields%
\[
1+2+\cdots+n=\dfrac{n\left(  n+1\right)  }{2}.
\]
Thus, Theorem \ref{thm.sum.pow1} is proved again.
\end{proof}

\subsubsection{Some words on finite sums}

The expression $1+2+\cdots+n$ in Theorem \ref{thm.sum.pow1} is an example of a
finite sum. Rigorously speaking, it is not a-priori clear that such
expressions are well-defined; this relies on the theorem that if you have $n$
numbers $a_{1},a_{2},\ldots,a_{n}$, then any way of summing them together will
produce the same result. For example,%
\[
\left(  \left(  a_{1}+a_{2}\right)  +a_{3}\right)  +a_{4}=a_{1}+\left(
\left(  a_{2}+a_{3}\right)  +a_{4}\right)  =\left(  a_{2}+a_{4}\right)
+\left(  a_{1}+a_{3}\right)  =\cdots.
\]
The 2019 notes (\S 1.2.2) give references to some proofs of this theorem. We
will not focus on such foundational matters here.

\bigskip

We will see lots of finite sums over this course; they are one of its main
characters. Thus, we introduce a more systematic notation for such sums:

\begin{definition}
Let $S$ be a finite set. For each $s\in S$, let $a_{s}$ be a 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
pronounced \textquotedblleft the sum of the $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}$ for $s$
running through $S$\textquotedblright. The symbol \textquotedblleft$\sum
$\textquotedblright\ is called the \textbf{summation sign}.
\end{definition}

\begin{example}
We have%
\begin{align*}
\sum_{s\in\left\{  1,2,3,4\right\}  }s  &  =1+2+3+4=10;\\
\sum_{s\in\left\{  1,2,3,4\right\}  }s^{2}  &  =1^{2}+2^{2}+3^{2}+4^{2}=30;\\
\sum_{s\in\left\{  -3,0,3\right\}  }s^{2}  &  =\left(  -3\right)  ^{2}%
+0^{2}+3^{2}=18.
\end{align*}

\end{example}

A few conventions and observations about summation signs:

\begin{itemize}
\item The letter \textquotedblleft$s$\textquotedblright\ in the notation
\textquotedblleft$\sum_{s\in S}a_{s}$\textquotedblright\ is called the
\textbf{summation index}. It can be any letter or symbol. For example, you can
rewrite $\sum\limits_{s\in\left\{  1,2,3,4\right\}  }s^{2}$ as $\sum
\limits_{i\in\left\{  1,2,3,4\right\}  }i^{2}$ or $\sum\limits_{\spadesuit
\in\left\{  1,2,3,4\right\}  }\spadesuit^{2}$.

\item The set $S$ in \textquotedblleft$\sum_{s\in S}a_{s}$\textquotedblright%
\ is called the \textbf{indexing set}.

The numbers $a_{s}$ are called the \textbf{addends} of the sum.

The whole expression $\sum_{s\in S}a_{s}$ is called a \textbf{finite sum}.

\item If $S=\varnothing$, then the sum $\sum_{s\in S}a_{s}$ is $0$ by
definition.\footnote{The idea is that if you sum no numbers, then you end up
with $0$.} Such a sum is called an \textbf{empty sum}.

\item The summation index doesn't have to be a single letter. For example,%
\[
\sum_{\left(  x,y\right)  \in\left\{  1,2\right\}  ^{2}}\dfrac{x}{y}=\dfrac
{1}{1}+\dfrac{1}{2}+\dfrac{2}{1}+\dfrac{2}{2}.
\]


\item Let $\mathcal{P}\left(  A\right)  $ denote the powerset of a set $A$
(that is, the set of all subsets of $A$). Then, the sum of the sizes of all
subsets of $\left\{  1,2,3\right\}  $ can be written as%
\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\{  2,3\right\}  \right\vert +\left\vert \left\{
1,3\right\}  \right\vert +\left\vert \left\{  1,2,3\right\}  \right\vert \\
&  =0+1+1+1+2+2+2+3=12.
\end{align*}


\item The expression \textquotedblleft$\sum\limits_{B\in\mathcal{P}\left(
A\right)  }$\textquotedblright\ is often abbreviated \textquotedblleft%
$\sum\limits_{B\subseteq A}$\textquotedblright. So we have just seen that
$\sum\limits_{B\subseteq\left\{  1,2,3\right\}  }\left\vert B\right\vert =12$.

\item A summation sign of the form%
\[
\sum_{s\in\left\{  p,p+1,\ldots,q\right\}  }%
\]
(where $p$ and $q$ are integers) is usually written as%
\[
\sum_{s=p}^{q}.
\]
When $p>q$, this is always understood to be an empty sum. For example:%
\begin{align*}
\sum_{s=4}^{7}s  &  =4+5+6+7;\\
\sum_{i=4}^{4}i  &  =4;\\
\sum_{j=8}^{2}j  &  =\left(  \text{empty sum}\right)  =0.
\end{align*}
Note, in particular, that the summation sign $\sum\limits_{i=1}^{n}$ is
equivalent to $\sum\limits_{i\in\left\{  1,2,\ldots,n\right\}  }$ or to
$\sum\limits_{i\in\left[  n\right]  }$ (since $\left[  n\right]  =\left\{
1,2,\ldots,n\right\}  $).

In the notation \textquotedblleft$\sum\limits_{s=p}^{q}$\textquotedblright,
the integers $p$ and $q$ are called the \textbf{bounds} of the summation.

A sum $\sum_{s=p}^{q}a_{s}$ is also written as $a_{p}+a_{p+1}+\cdots+a_{q}$.

\item There are lots of similarities between definite integrals $\int_{p}%
^{q}f\left(  x\right)  dx$ and finite sums $\sum_{x=p}^{q}f\left(  x\right)
$. However, there are also important dissimilarities. An integral $\int%
_{p}^{p}f\left(  x\right)  dx$ over a length-$0$ interval $\left[  p,p\right]
$ is always $0$, whereas the sum $\sum_{x=p}^{p}f\left(  x\right)  $ equals
$f\left(  p\right)  $. An integral $\int_{p}^{q}f\left(  x\right)  dx$ with
$p>q$ is usually nonzero (and equals $-\int_{q}^{p}f\left(  x\right)  dx$),
whereas such a sum $\sum_{x=p}^{q}f\left(  x\right)  $ equals $0$ by definition.

\item The summation sign $\sum\limits_{f:A\rightarrow B}$ means a sum over all
maps $f$ from $A$ to $B$. It is just shorthand for \textquotedblleft%
$\sum\limits_{f\in\left\{  \text{maps from }A\text{ to }B\right\}  }%
$\textquotedblright. For instance,%
\[
\sum_{f:\left\{  1,2\right\}  \rightarrow\left\{  5,6\right\}  }f\left(
1\right)  =5+5+6+6
\]
(because there are four maps $f$ from $\left\{  1,2\right\}  $ to $\left\{
5,6\right\}  $, and two of them satisfy $f\left(  1\right)  =5$ whereas the
other two satisfy $f\left(  1\right)  =6$).

\item We can put conditions under the summation sign to restrict the index we
are summing over. For example,%
\[
\sum_{\substack{s\in S;\\s\text{ is even}}}a_{s}%
\]
means the sum of all $a_{s}$ where $s$ ranges over all \textbf{even} elements
of $S$. For instance,%
\begin{align*}
\sum_{\substack{s\in\left\{  1,2,3,4,5,6,7\right\}  ;\\s\text{ is even}}}s  &
=2+4+6;\\
\sum_{\substack{s\in\left\{  1,2,3,4,5,6,7\right\}  ;\\s\text{ is odd}}}s  &
=1+3+5+7.
\end{align*}
In general, if $\mathcal{A}\left(  s\right)  $ is some logical statement for
each $s\in S$, then \textquotedblleft$\sum\limits_{\substack{s\in
S;\\\mathcal{A}\left(  s\right)  }}$\textquotedblright\ is shorthand for
\textquotedblleft$\sum\limits_{s\in\left\{  t\in S\ \mid\ \mathcal{A}\left(
t\right)  \right\}  }$\textquotedblright.
\end{itemize}

More can be found in the 2019 notes.

\subsubsection{Some rules for sums}

The summation sign satisfies certain laws. A long list of these rules appears
in the 2019 notes (\S 1.2.3 and \S 1.6). We shall only list a few of them
here. All of these rules are intuitively clear (mostly boiling down to the
idea that the addends of a sum can be arbitrarily reordered without changing
the value of the sum).

\begin{itemize}
\item \textbf{Splitting-off:} If $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.sums.splitoff}%
\end{equation}
In other words, we can split off any addend from any finite sum. Formally,
this rule is the (recursive) definition of finite sums. (I am skipping the
proof that this definition does really give a well-defined result, i.e., that
the right hand side of (\ref{eq.sums.splitoff}) doesn't depend on the choice
of $t$.)

In particular, (\ref{eq.sums.splitoff}) yields%
\[
\sum_{i=p}^{q}a_{i}=a_{p}+\sum_{i=p+1}^{q}a_{i}=a_{q}+\sum_{i=p}^{q-1}%
a_{i}\ \ \ \ \ \ \ \ \ \ \text{if }p\leq q.
\]
(But this does not hold when $p>q$, since we cannot split off an addend from a
sum if the addend is not contained in the sum!)

\item \textbf{Splitting:} If $S$ is the union of two disjoint sets $X$ and
$Y$, then%
\begin{equation}
\sum_{s\in S}a_{s}=\sum_{s\in X}a_{s}+\sum_{s\in Y}a_{s}
\label{eq.sums.split2}%
\end{equation}
(where the right hand side should be understood as $\left(  \sum\limits_{s\in
X}a_{s}\right)  +\left(  \sum\limits_{s\in Y}a_{s}\right)  $; see the 2019
notes for the precise conventions).

For example, we obtain
\[
\sum_{s\in\left\{  1,2,3,4,5,6,7\right\}  }a_{s}=\sum_{\substack{s\in\left\{
1,2,3,4,5,6,7\right\}  ;\\s\text{ is even}}}a_{s}+\sum_{\substack{s\in\left\{
1,2,3,4,5,6,7\right\}  ;\\s\text{ is odd}}}a_{s}%
\]
by applying (%
\index{eq.sums.split2}%
\ref{eq.sums.split2}) to%
\begin{align*}
S  &  =\left\{  1,2,3,4,5,6,7\right\}  ,\\
X  &  =\left\{  \text{all even elements of }\left\{  1,2,3,4,5,6,7\right\}
\right\}  ,\\
Y  &  =\left\{  \text{all odd elements of }\left\{  1,2,3,4,5,6,7\right\}
\right\}  .
\end{align*}


\item \textbf{Splitting an addend:} We have%
\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.sums.as+bs}%
\end{equation}


\item \textbf{Substituting the index:} Let $S$ and $T$ be finite sets, and let
$f:S\rightarrow T$ be a bijection. Then,%
\begin{equation}
\sum_{t\in T}a_{t}=\sum_{s\in S}a_{f\left(  s\right)  }. \label{eq.sums.subs1}%
\end{equation}
When we use this rule, we say that we are \textbf{substituting} $f\left(
s\right)  $ for $t$ in the sum. The idea behind this rule is that the sum on
the left hand side of (\ref{eq.sums.subs1}) and the sum on the right hand side
of (\ref{eq.sums.subs1}) have the same addends, just \textquotedblleft in a
different order\textquotedblright\ (although strictly speaking, they both come
without a definite order).

A particular case of (\ref{eq.sums.subs1}) is the rule saying that we can
reverse the order of the addends of a sum -- i.e., that we have%
\[
a_{1}+a_{2}+\cdots+a_{n}=a_{n}+a_{n-1}+\cdots+a_{1}%
\]
for any numbers $a_{1},a_{2},\ldots,a_{n}$. Indeed, this rule can be rewritten
as%
\[
\sum_{t\in\left[  n\right]  }a_{t}=\sum_{s\in\left[  n\right]  }a_{n+1-s}.
\]
And this is an instance of (\ref{eq.sums.split2}), applied to $S=\left[
n\right]  $, $T=\left[  n\right]  $ and $f\left(  s\right)  =n+1-s$.

\item \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.sums.split-by-f}%
\end{equation}
(the right hand side is a sum of sums, which is why you are seeing two $\sum$
signs side by side).

This is a bit abstract, but the underlying idea is completely elementary: It
says that if we have a \textquotedblleft big sum\textquotedblright%
\ $\sum_{s\in S}a_{s}$, and if each $s\in S$ has a \textquotedblleft lucky
number\textquotedblright\ $f\left(  s\right)  $ assigned to it (it doesn't
have to be an actual number; we're just calling it this way), then we can
compute $\sum_{s\in S}a_{s}$ by first computing the \textquotedblleft small
sum\textquotedblright\ $\sum\limits_{\substack{s\in S;\\f\left(  s\right)
=w}}a_{s}$ for each $w$ (this sum contains only those $a_{s}$ whose
corresponding $s$ has \textquotedblleft lucky number\textquotedblright\ $w$),
and then adding up all the results. In other words, we can split our
\textquotedblleft big sum\textquotedblright\ into little \textquotedblleft
bunches\textquotedblright, then find the sum of each \textquotedblleft
bunch\textquotedblright, then add up these \textquotedblleft bunch
sums\textquotedblright.\footnote{For those who know
\href{https://en.wikipedia.org/wiki/MapReduce}{MapReduce}, this is a simple
instance of MapReduce.}

For example, let $S=\left\{  -5,-4,\ldots,4,5\right\}  $ and $W=\left\{
0,1,\ldots,5\right\}  $ and $f\left(  s\right)  =\left\vert s\right\vert $.
Then, (\ref{eq.sums.split-by-f}) yields%
\[
\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}.
\]
Written out, this is saying that%
\[
a_{-5}+a_{-4}+\cdots+a_{4}+a_{5}=a_{0}+\left(  a_{-1}+a_{1}\right)  +\left(
a_{-2}+a_{2}\right)  +\cdots+\left(  a_{-5}+a_{5}\right)  .
\]

\end{itemize}


\end{document}