\documentclass[11pt]{article}
\usepackage{macros-course-lectures}

\newtheorem{falsethm}[theorem]{False Theorem}

\begin{document}

\begin{titlepage}

\title{\bf Lecture 4a: Fancier Induction, Cont'd}
\author{Nancy Lynch, David Karger}
\date{February 10, 2000}
\maketitle

\end{titlepage}
\renewcommand{\thepage}{\arabic{page}}

\section{Introduction}

Last, time, introduced the strong induction proof method, and showed a
couple of examples.  \\
There are more in the notes. \\
\\
Today continue with more strong induction examples, including 
a bunch of proofs about ranking the players in ``tournaments''. \\
\\
Then on to structural induction. \\
\\
As time allows, we may start the next topic, which is relations. \\
\\
\\
Recall the proof rule for strong induction. \\
Here's the variant starting with $k$ (and with one base case).
%[[[Victor: slide]]]
\begin{tabbing}
XXX\=XXX\=XXX\=XXX\=XXXXXXXXXXXXXXXXXXXXX\=    \kill
Prove: $\forall n \geq k (P(n))$ \\
1. (Base) $P(k)$ \\
2. (Inductive step) 
$\forall n \geq k [(\forall i, k \leq i \leq n (P(n))) \Rightarrow P(n+1)]$ \\
\> 1. Fix $n \geq k$ \\
\> 2. Assume $\forall  i, k \leq i \leq n (P(i))$ \\
\> 3. $P(n+1)$ \\
\> 4. QED
    \> \> \> \> Implication, UG \\
3. QED                        
\> \> \> \> \> Strong induction 
\end{tabbing}

You could also use multiple base cases. \\
E.g., for two: 
%[[[Victor: slide]]]
\begin{tabbing}
XXX\=XXX\=XXX\=XXX\=XXXXXXXXXXXXXXXXXXXXX\=    \kill
Prove: $\forall n \geq k (P(n))$ \\
1. (Base) $P(k)$ \\
2. (Base) $P(k+1)$ \\
3. (Inductive step) 
$\forall n \geq k+1 [(\forall i, k \leq i \leq n (P(n))) \Rightarrow P(n+1)]$ \\
\> 1. Fix $n \geq k+1$ \\
\> 2. Assume $\forall  i, k \leq i \leq n (P(i))$ \\
\> 3. $P(n+1)$ \\
\> 4. QED \\
4. QED                        
\end{tabbing}
Pay attention to the ranges of values used in various places. \\
We're proving $P$ for every value $\geq k$. \\
We special case for the first couple of values, $k$ and $k+1$. \\
For the other values, $k+2$ and larger, we get to use the
assumption about everything smaller than that value, all the way back
down to $k$.

\section{Simple strong induction examples}

\subsection{Fibonacci examples}

Last time, I showed a ``false theorem'' saying all Fib numbers are
even. \\
It was false because the proof didn't include enough base cases. \\
For contrast, here's a true theorem about Fib numbers, giving a lower
bound on their values. 
\begin{tabbing}
XXX\=XXX\=XXX\=XXX\=XXXXXXXXXXXXXXXXXXXXX\=    \kill
Prove: $\forall n \geq 2 (F_n \geq (\frac{3}{2})^{n-2})$
\end{tabbing}

Use strong induction. \\
Let $P(n) = F_n \geq (\frac{3}{2})^{n-2}$
\begin{tabbing}
XXX\=XXX\=XXX\=XXX\=XXXXXXXXXXXXXXXXXXXXX\=    \kill
Prove: $\forall n \geq 2 (P(n))$\\
1. (Base) $P(2)$
\> \> \> \> \>  $F_2 = 1 = (\frac{3}{2})^0$ \\
2. (Base) $P(3)$ 
\> \> \> \> \>  $F_3 = 2 \geq (\frac{3}{2})^1$ \\
3. (Inductive step) $\forall n \geq 3 [(\forall  i, 2 \leq i \leq n (P(i))) \Rightarrow P(n+1)]$\\
\> 1. Fix $n \geq 3$ \\
\> 2. Assume $\forall  i, 2 \leq i \leq n (P(i))$ \\
\> 3. $P(n+1)$
   \> \> \> \> ??? \\
\> 4. QED
    \> \> \> \> Implication, UG \\
4. QED
\> \> \> \> \> Strong induction
\end{tabbing}

\noindent
Now in proving the ??? we are only worrying about $n \geq 3$ and we may
assume the inequality for all $i$ from $2$ up to $n$, inclusive. \\
Because of the way Fibonacci numbers are defined, it turns out that the
ones we need are just $n$ and $n-1$. \\
Those are in the range for which we can assume the property. 
\begin{tabbing}
XXX\=XXX\=XXX\=XXX\=XXXXXXXXXXXXXXXXXXXXX\=    \kill
\> 3. $P(n+1)$ \\
\> \> 1. $F_n \geq (\frac{3}{2})^{n-2}$
      \> \> \> Inductive hypothesis 3.2 \\
\> \> 2. $F_{n-1} \geq (\frac{3}{2})^{n-3}$
      \> \> \> Inductive hypothesis 3.2 \\
\> \> 3. $F_{n+1} = F_n + F_{n-1}$
      \> \> \> Definition \\
\> \> 4. $F_{n+1}\geq (\frac{3}{2})^{n-2} + (\frac{3}{2})^{n-3}$ 
      \> \> \> Plug the inequalities into the equation \\
\> \> 5. QED
      \> \> \> Algebra \\
\> \> \> 1. $\frac{3}{2} + 1 \geq (\frac{3}{2})^2$
         \> \> Arithmetic \\
\> \> \> 2. $(\frac{3}{2})^{n-2} + (\frac{3}{2})^{n-3} \geq (\frac{3}{2})^{n-1}$
         \> \> Algebra \\
\> \> \> 3. $F_{n+1} \geq (\frac{3}{2})^{n-1}$
         \> \> Algebra (3.3.4 and 3.3.5.2) \\
\> \> \> 4. QED
         \> \> Definition of $P(n+1)$ 
\end{tabbing}

\subsection{Prime Factorization}

Recall def of prime. \\
Ex: $2, 3, 5, 7, 11, \ldots$ are primes. \\
$4, 6, 8, 9, 10, 12, \ldots$ are not.\\
Composites. \\
\\
But notice that each composite can be broken down (factored) into
primes: \\
E.g., $12 = 2 \times 2 \times 3$. \\
Can prove that every natural number $\geq 2$ can be written as the
product of one or more primes. \\
Use strong induction, starting from $2$, where $P(n)$ is the predicate
``$n$ can be written as the product of one or more primes''.
\begin{tabbing}\\
XXX\=XXX\=XXX\=XXX\=XXXXXXXXXXXXXXXXXXXXX\=    \kill
Prove:  $\forall n \geq 2 (P(n))$ \\
1. $P(2)$
\> \> \> \> \> Use $2$ itself \\
2. $\forall n \geq 2 [(\forall i, 2 \leq i \leq n) (P(i)) \Rightarrow P(n)]$ \\
\> 1. Fix $n \geq 2$ \\
\> 2. Assume $\forall i, 2 \leq i \leq n(P(i))$, that is, all numbers up
to and including $n$ can be factored into primes \\
\> 3. $P(n+1)$, that is, $n+1$ can be factored into primes. \\
\>  \> \> \> \> ??? \\
\> 4. QED
     \> \> \> \> Implication, UG \\
3. QED
    \> \> \> \> Strong induction 
\end{tabbing}
The argument about factoring $n+1$ breaks down into cases, depending on
whether or not $n+1$ itself is prime:
\begin{tabbing}\\
XXX\=XXX\=XXX\=XXX\=XXXXXXXXXXXXXXXXXXXXX\=    \kill
\> 3. $P(n+1)$, that is, $n+1$ can be factored into primes. \\
\> \> 1. If $n + 1$ is prime, then $n+1$ can be factored into primes. \\

\> \> \> \> \> Use $n+1$ itself \\
\> \> 2. If $n+1$ is not prime, then $n+1$ can be factored into primes.
\\
\> \> \> 1. Assume $n+1$ is not prime. \\
\> \> \> 2. $n+1$ can be written as $a \times b$, where $1 < a, b < n+1$
\\
\> \> \> \> \> Definition of ``prime'' \\
\> \> \> 3. $a$ can be factored into primes. 
      \> \> Strong inductive hypothesis (2.2) \\
\> \> \> 4. $b$ can be factored into primes. 
         \> \> Strong inductive hypothesis (2.2) \\
\> \> \> 5. $n+1$ can be factored into primes. 
         \> \> Use all the factors from $a$ and $b$.  \\
\> \> \> 6. QED
            \> \> Implication \\
\> \> 3. QED
        \> \> \> Cases
\end{tabbing}

A little more carefully:
If $a$ is written as a product $2^{a_2} 3^{a_3} 5^{a_5} \cdots$
and
$b$ is written as a product $2^{b_2} 3^{b_3} 5^{b_5} \cdots$
then $n+1 = ab$ is written as
$2^{a_2+b_2} 3^{a_3+b_3} 5^{a_5+b_5} \cdots$ \\
\\
Adding the number of occurrences of each separate prime factor. \\
\\
Example: \\
A factorization of $144$ can be obtained by noticing that $144 = 8
\times 18$ (among other possibilities).\\
$8$ can be written as $2^3$, and $18$ as $2 \times 3^2$. \\
So, write $144$ as $2^{3+1} 3^2$, or $2^4 3^2$.

\section{Tournaments}

A pure math example, interesting and slightly complicated (ordinary
and strong) inductive proofs. \\
\\
An Internet gaming company is conducting a chess tournament on the Internet. \\
Round robin, not elimination. \\
That is, everyone plays everyone exactly once. \\
Can represent the results nicely by arrows, e.g.:\\
\\
A beats B, C, D \\
B beats D \\
C beats B \\
D beats C \\
\\
Dots-and-arrows structure called a ``digraph''.  Will study them
carefully soon.\\
\\
Now, the gaming company wants to use this information to make some
decisions, e.g., award first prize, rank everyone. \\
It wants to do this in such a way that its customers don't complain
about the rankings being unfair. \\
\\
There are some problems with doing this.

\subsection{Cycles}

Problem: The tournament graph can contain cycles. \\
Example: Above, B beats D beats C beats B. \\
\\
If there's a cycle, then any ranking method is a least a little
problematic:  someone who beat someone else would be ranked lower. \\
\\
Of course, the company has no power to avoid cycles in play
results. \\
The gaming company might hope that ``most of the time'', when there is
a cycle, it's very big (so the people involved aren't likely to
discover this). \\
However, tournaments have an unfortunate property: 
\begin{theorem}
Any tournament that contains any cycle, contains a cycle of length $3$
($3$-cycle).
\end{theorem}

That is, three players, e.g., B, C, D, above, have an ``inconsistent''
set of results. \\
\\
This can be proved by ordinary induction, where $P(n)$ is the
predicate ``Any tournament that contains an $n$-cycle contains a
$3$-cycle.''
\begin{tabbing}\\
XXX\=XXX\=XXX\=XXX\=XXXXXXXXXXXXXXXXXXXXX\=    \kill
Prove: $\forall n \geq 3 (P(n))$ \\
1. (Base) $P(3)$ 
\> \> \> \> \> Trivial by assumption. \\
2. (Inductive step)  $\forall n \geq 3 (P(n) \Rightarrow P(n+1))$ \\
\> 1. Fix $n \geq 3$ \\
\> 2. Assume $P(n)$ \\
\> 3. $P(n+1)$ \\
\> \> 1. Fix $T$, a tournament, and $p_1 \rightarrow p_2 \rightarrow \ldots
\rightarrow p_{n+1} \rightarrow p_1$, an $n+1$-cycle in $T$. \\
\> \> 2. $T$ contains a $3$-cycle. 
      \> \> \> ??? \\
\> \> 3. QED
      \> \> \> Implication, UG \\
\> 4. QED
   \> \> \> \> Implication, UG \\
3. QED
\end{tabbing}
How can we find a $3$-cycle in $T$? \\
Example: (Draw 5-cycle). \\
To get a $3$-cycle, notice that $p_1$ and $p_3$ have an arrow, one way
or the other.  \\
If from $p_3$ to $p_1$, then $p_1,p_2,p_3$ form a cycle.\\
If the other way, then can reduce the size of the cycle to omit $p_2$.
Then use induction on the smaller cycle. \\
This generalizes: 
\begin{tabbing}\\
XXX\=XXX\=XXX\=XXX\=XXXXXXXXXXXXXXXXXXXXX\=    \kill
\> \> 2. $T$ contains a $3$-cycle. \\
\> \> \> 1. If $p_3 \rightarrow p_1$ then $T$ contains a $3$-cycle. 
      \> \> Use $p_1 \rightarrow p_2 \rightarrow p_3 \rightarrow p_1$. \\
\> \> \> 2. If $p_1 \rightarrow p_3$ then $T$ contains a $3$-cycle. \\
\> \> \> \> 1. Assume $p_1 \rightarrow p_3$. \\
\> \> \> \> 2. $T$ contains an $n$-cycle. 
            \> Use $p_1 \rightarrow p_3 \rightarrow p_4 \rightarrow p_{n+1} \rightarrow p_1$. \\
\> \> \> \> 3. $T$ contains a $3$ cycle.
            \> By inductive hypothesis (2.2) \\
\> \> \> 3. QED
         \> \> Cases
\end{tabbing}
A detail to be careful about here: 
This argument depends on the fact that the arrow we add between $p_1$ and
$p_3$ is not already part of the original cycle. \\
That's true because we know that the original cycle had length $n+1$,
which is at least $4$. 

\subsection{Locally fair rankings}

The gaming company decides that, although they cannot avoid inconsistent
orders, they would at least like to make the ranking ``locally fair'',
meaning that if one player $p$ is ranked immediately ahead of another
player $q$, then $p$ must have beaten $q$. \\
\\
(They might want to tell each player who the players were that are
ranked immediately above and below him, and don't want someone to
complain that the guy ranked above him is someone he beat.) \\
\\
They are happy to discover: \\
\\
Theorem: Any tournament has a locally fair ranking.\\
\\
Prove by strong induction, where $P(n)$ says ``any $n$-player
tournament has a locally fair ranking''. \\
The strategy is to ``split'' the players into those that beat and
those that lose to a particular player $x$. \\
Rank those two subsets separately, by using the inductive
hypothesis.\\
(Subtournaments) \\
Then put the rankings together. 
\begin{tabbing}
XXX\=XXX\=XXX\=XXX\=XXXXXXXXXXXXXXXXXXXXX\=    \kill
Prove: $\forall n \geq 1 (P(n))$ \\
1. (Base) $P(1)$ 
\> \> \> \> \> Obvious---just one player to be ranked. \\
2. (Inductive step)
$\forall n \geq 1 [(\forall i, 1 \leq i \leq n (P(n))) \Rightarrow P(n+1)]$ \\
\> 1. Fix $n \geq 1$ \\
\> 2. Assume $\forall i, 1 \leq i \leq n (P(i))$. \\
\> 3. $P(n+1)$ \\
\> \> 1. Fix any $n+1$-player tournament $T$. \\
\> \> 2. $T$ has a locally fair ranking. \\
\> \> \> 1. Choose $x$ to be any player, $B$ the set of players that beat $x$, and \\
\> \> \> \> $L$ the set of players that lose to $x$. \\
\> \> \> 2. $B$ has a locally fair ranking. 
         \> \> Inductive assumption (2.2). \\
\> \> \> 3. $L$ has a locally fair ranking. 
         \> \> Inductive assumption (2.2). \\
\> \> \> 4. Define a ranking $R$ of all the players by: $B$ ranking, then $x$, then $L$ ranking. \\
\> \> \> 5. $R$ is a locally fair ranking for $T$. \\
\> \> \> 6. QED 
         \> \> EG \\
\> \> 3. QED 
      \> \> \> UG \\
\> 4. QED
   \> \> \> \> Implication, UG \\
3. QED                        
\> \> \> \> \> Strong induction 
\end{tabbing}

\subsection{Locally fair rankings and number of wins}

For a while, the customers are happy with just locally fair rankings. \\
But then a game comes up where local fairness doesn't work out so well: \\
\\
Example: \\
A beats B \\
B beats C \\
C beats A,D \\
D beats A,B,E \\
E beats A,B,C \\
(draw) \\
\\
Here, A,B,C,D,E is a locally fair ranking. \\
However, it's in the reverse order according to number of wins. \\
Bad. \\
Now it occurs to the company that it would be nice if the rankings could
also be consistent with number of wins. \\
\\
But can't get this (together with local fairness). \\
\\
Example: 6 players \\
A beats C,D,E,F (4 wins) \\
B beats A,E,F (3 wins) \\
C beats B,F (2 wins) \\
D beats C,B (2 wins) \\
E beats C,D (2 wins) \\
F beats D,E (2 wins) \\
\\
(Draw)
Ordering consistently with number of wins would mean $A$ would have to
be ranked immediately ahead of $B$. \\
But $B$ beats $A$, violating local fairness. \\\
\\
So then they decide they will be happy to settle for a fair ranking in
which the highest ranked player has the largest number of wins (can be
tied). \\
This would rule out the bad example above. \\
\\
Turns out this is possible: \\
In fact, in the event of a tie, the company has the option of choosing
which best player is ranked first: \\
\\
Define $P(n)$: For any $n$-player tournament $T$ and any $z$ that has
the largest number of wins in $T$, there exists a locally fair ranking
with $z$ ranked first. 
\begin{tabbing}
XXX\=XXX\=XXX\=XXX\=XXXXXXXXXXXXXXXXXXXXX\=    \kill
Prove: $\forall n \geq 1 (P(n))$ 
\end{tabbing}

This can be proved by induction, but the inductive step is more
complicated than in the previous proof. \\
\\
First proof attempt: \\
Try a proof like the previous one, this time splitting on some $x$
that loses to $z$. \\
Now split all-but-$x$ into $B$ and $L$ as before, based on their
records w.r.t. $x$. \\
We know that $z$ is in $B$, because it beats $x$. \\
Now try to use the inductive hypothesis to rank $B$ while keeping $z$
first, and to rank $L$. \\
Then combine as before. \\
\\
Sounds plausible---but wrong: \\
Applying the inductive hypothesis requires that $z$ have the best
won-lost record in the ``subtournament'' involving just the $B$
elements. \\
But it might not: \\
\\
Example: \\
Players A, B, x, and a lot of p's \\
A and B beat x \\
x beats all of the p's \\
B beats A \\
A beats all the p's \\
all the p's beat B \\
Doesn't matter what happens among the p's. \\
\\
(diagram) \\
\\
A has the best record overall, but in the two-player subtournament, it
is worse than B. \\
\\
Try again: \\
It turns out that a correct proof can be given using ordinary (not
strong) induction: \\
Recall $P(n)$: For any $n$-player tournament $T$ and any $z$ that has
the largest number of wins in $T$, there exists a locally fair ranking
with $z$ ranked first. 
\begin{tabbing}
XXX\=XXX\=XXX\=XXX\=XXXXXXXXXXXXXXXXXXXXX\=    \kill
Prove: $\forall n \geq 1 (P(n))$ \\
1. (Base) $P(1)$ 
\> \> \> \> \> Only one possibility. \\
2. (Inductive step) $\forall n \geq 1 [P(n) \Rightarrow P(n+1)]$ \\
\> 1. Fix $n \geq 1$. \\
\> 2. Assume $P(n)$. \\
\> 3. $P(n+1)$. \\
\> \> 1. Fix $T$, an $n+1$-player tournament, and $z$, a player with the most wins. \\
\> \> 2. $\exists$ a locally fair ranking of $T$ with $z$ first. 
      \> \> \> ??? \\
\> \> 3. QED 
      \> \> \> UG \\
\> 4. QED   
   \> \> \> \> Implication, UG \\
3. QED                        
\> \> \> \> \> Induction 
\end{tabbing}
The key step will break down into cases, based on whether or not $z$
lost any matches.  \\
The case where $z$ won everything is easy; the other case is tricky:
Here's the easy case:
\begin{tabbing}
XXX\=XXX\=XXX\=XXX\=XXXXXXXXXXXXXXXXXXXXX\=    \kill
\> \> 2. $\exists$ a locally fair ranking of $T$ with $z$ first. \\
\> \> \> 1. If $z$ is undefeated in $T$ then $\exists$ a locally fair
ranking of $T$ with $z$ first. \\
\> \> \> \> 1. Assume $z$ is undefeated in $T$. \\
\> \> \> \> 2. Choose $R$ to be a locally fair ranking of all-but-$z$. \\
\> \> \> \> \> Previous theorem says this exists, EI \\
\> \> \> \> 3. $z$ then $R$ is a locally fair ranking of $T$. \\
\> \> \> \> 4. $\exists$ a locally fair ranking of $T$ with $z$ first. \\
\> \> \> \> \> EG \\
\> \> \> \> 5. QED 
            \> Implication \\
\> \> \> 2. If $z$ is defeated by someone then $\exists$ a locally fair
ranking of $T$ with $z$ first. \\
\> \> \> \> \> ??? \\
\> \> \> 3. QED 
         \> \> Cases
\end{tabbing}

And the tricky case:
\begin{tabbing}
XXX\=XXX\=XXX\=XXX\=XXXXXXXXXXXXXXXXXXXXX\=    \kill
\> \> \> 2. If $z$ is defeated by someone then $\exists$ a locally fair
ranking of $T$ with $z$ first. \\
\> \> \> \> 1. Assume $z$ is defeated by someone. \\
\> \> \> \> 2. Choose $x$ to be someone who defeated $z$. \\
\> \> \> \> 3. $z$ has the best record in the subtournament involving all-but-$x$.\\
\> \> \> \> \> $z$ had the best record in $T$, no wins are removed. \\
\> \> \> \> 4. $\exists$ ranking of subtournament having $z$ first. \\
\> \> \> \> \> Inductive hypothesis, $z$ has best record. \\
\> \> \> \> 5. Choose $R$ to be a ranking of all-but-$x$ having $z$ first. \\
\> \> \> \> \> EI \\
\> \> \> \> 6. In $T$, $x$ is defeated by someone. 
            \> $z$ is defeated, and $x$'s record in $T$ can't be \\
\> \> \> \> \> better than $z$'s. \\
\> \> \> \> 7. Define ranking $S$ to be $R$, with $x$ inserted right after the lowest-ranked player \\
\> \> \> \> that beats $x$. \\
\> \> \> \> 8. $S$ is a locally fair ranking of $T$. \\
\> \> \> \> \> $R$ is locally fair, $x$ is beaten by the player ranked\\
\> \> \> \> \> just above it and beats all ranked below it. \\
\> \> \> \> 9. $z$ is first in $S$. 
            \> $z$ is first in $R$, and $x$ is not inserted at the top. \\
\> \> \> \> 10. $\exists$ a locally fair ranking of $T$ with $z$ first. \\
\> \> \> \> \> $S$ works, EG \\
\> \> \> \> QED 
            \> Implication \\
\end{tabbing}

\end{document}

