Strong Induction
Posted on 2017-04-06 by nbloomf
\(\newcommand{\hyp}[2]{\stackrel{\tiny\text{hyp}}{#2}}\)
\(\newcommand{\let}[2]{\stackrel{\tiny\text{let}}{#2}}\)
\(\newcommand{\a}{a}\)
\(\newcommand{\b}{b}\)
\(\newcommand{\c}{c}\)
\(\newcommand{\p}{p}\)
\(\newcommand{\q}{q}\)
\(\newcommand{\r}{r}\)
\(\newcommand{\s}{s}\)
\(\newcommand{\x}{x}\)
\(\newcommand{\y}{y}\)
\(\newcommand{\z}{z}\)
\(\newcommand{\bool}{\mathbb{B}}\)
\(\newcommand{\btrue}{\mathsf{true}}\)
\(\newcommand{\bfalse}{\mathsf{false}}\)
\(\newcommand{\bnot}{\mathsf{not}}\)
\(\newcommand{\band}{\mathbin{\mathsf{and}}}\)
\(\newcommand{\bor}{\mathbin{\mathsf{or}}}\)
\(\newcommand{\bimpl}{\mathbin{\mathsf{impl}}}\)
\(\newcommand{\beq}{\mathsf{eq}}\)
\(\newcommand{\bif}[3]{\mathsf{if}\left(#1,#2,#3\right)}\)
\(\newcommand{\id}{\mathsf{id}}\)
\(\newcommand{\compose}{\mathsf{compose}}\)
\(\newcommand{\const}{\mathsf{const}}\)
\(\newcommand{\apply}{\mathsf{apply}}\)
\(\newcommand{\flip}{\mathsf{flip}}\)
\(\newcommand{\flipB}{\mathsf{flip2}}\)
\(\newcommand{\flipC}{\mathsf{flip3}}\)
\(\newcommand{\flipD}{\mathsf{flip4}}\)
\(\newcommand{\flipE}{\mathsf{flip5}}\)
\(\newcommand{\clone}{\mathsf{clone}}\)
\(\newcommand{\cloneC}{\mathsf{clone3}}\)
\(\newcommand{\composeAonB}{\mathsf{compose1on2}}\)
\(\newcommand{\composeAonC}{\mathsf{compose1on3}}\)
\(\newcommand{\composeAonD}{\mathsf{compose1on4}}\)
\(\newcommand{\composeBonA}{\mathsf{compose2on1}}\)
\(\newcommand{\composeBonB}{\mathsf{compose2on2}}\)
\(\newcommand{\composeConA}{\mathsf{compose3on1}}\)
\(\newcommand{\ptrue}{\mathsf{ptrue}}\)
\(\newcommand{\pfalse}{\mathsf{pfalse}}\)
\(\newcommand{\pnot}{\mathsf{pnot}}\)
\(\newcommand{\pand}{\mathbin{\mathsf{pand}}}\)
\(\newcommand{\por}{\mathbin{\mathsf{por}}}\)
\(\newcommand{\pimpl}{\mathbin{\mathsf{pimpl}}}\)
\(\newcommand{\fst}{\mathsf{first}}\)
\(\newcommand{\snd}{\mathsf{second}}\)
\(\newcommand{\dup}{\mathsf{dup}}\)
\(\newcommand{\tup}{\mathsf{tup}}\)
\(\newcommand{\tSwap}{\mathsf{swap}_{\times}}\)
\(\newcommand{\tPair}{\mathsf{pair}_{\times}}\)
\(\newcommand{\tAssocL}{\mathsf{assocL}_{\times}}\)
\(\newcommand{\tAssocR}{\mathsf{assocR}_{\times}}\)
\(\newcommand{\tupL}{\mathsf{tupL}}\)
\(\newcommand{\tupR}{\mathsf{tupR}}\)
\(\newcommand{\uncurry}{\mathsf{uncurry}}\)
\(\newcommand{\curry}{\mathsf{curry}}\)
\(\newcommand{\lft}{\mathsf{left}}\)
\(\newcommand{\rgt}{\mathsf{right}}\)
\(\newcommand{\either}{\mathsf{either}}\)
\(\newcommand{\uSwap}{\mathsf{swap}_{+}}\)
\(\newcommand{\uPair}{\mathsf{pair}_{+}}\)
\(\newcommand{\uAssocL}{\mathsf{assocL}_{+}}\)
\(\newcommand{\uAssocR}{\mathsf{assocR}_{+}}\)
\(\newcommand{\isLft}{\mathsf{isLeft}}\)
\(\newcommand{\isRgt}{\mathsf{isRight}}\)
\(\newcommand{\nats}{\mathbb{N}}\)
\(\newcommand{\zero}{\mathsf{0}}\)
\(\newcommand{\next}{\mathsf{next}}\)
\(\newcommand{\unnext}{\mathsf{unnext}}\)
\(\newcommand{\iszero}{\mathsf{isZero}}\)
\(\newcommand{\prev}{\mathsf{prev}}\)
\(\newcommand{\natrec}{\mathsf{natrec}}\)
\(\newcommand{\simprec}{\mathsf{simprec}}\)
\(\newcommand{\bailrec}{\mathsf{bailrec}}\)
\(\newcommand{\mutrec}{\mathsf{mutrec}}\)
\(\newcommand{\dnatrec}{\mathsf{dnatrec}}\)
\(\newcommand{\normrec}{\mathsf{normrec}}\)
\(\newcommand{\findsmallest}{\mathsf{findsmallest}}\)
\(\newcommand{\mnormrec}{\mathsf{mnormrec}}\)
\(\newcommand{\nequal}{\mathsf{eq}}\)
\(\newcommand{\nplus}{\mathsf{plus}}\)
\(\newcommand{\ntimes}{\mathsf{times}}\)
\(\newcommand{\nleq}{\mathsf{leq}}\)
\(\newcommand{\ngeq}{\mathsf{geq}}\)
\(\newcommand{\nminus}{\mathsf{minus}}\)
\(\newcommand{\nmax}{\mathsf{max}}\)
\(\newcommand{\nmin}{\mathsf{min}}\)
\(\newcommand{\ndivalg}{\mathsf{divalg}}\)
\(\newcommand{\nquo}{\mathsf{quo}}\)
\(\newcommand{\nrem}{\mathsf{rem}}\)
\(\newcommand{\ndiv}{\mathsf{div}}\)
\(\newcommand{\ngcd}{\mathsf{gcd}}\)
\(\newcommand{\ncoprime}{\mathsf{coprime}}\)
\(\newcommand{\nlcm}{\mathsf{lcm}}\)
\(\newcommand{\nmindiv}{\mathsf{mindiv}}\)
\(\newcommand{\nisprime}{\mathsf{isPrime}}\)
\(\newcommand{\npower}{\mathsf{power}}\)
\(\newcommand{\nchoose}{\mathsf{choose}}\)
\(\newcommand{\dom}{\mathsf{dom}}\)
\(\newcommand{\cod}{\mathsf{cod}}\)
\(\newcommand{\lists}[1]{\mathsf{List}(#1)}\)
\(\newcommand{\nil}{\mathsf{nil}}\)
\(\newcommand{\cons}{\mathsf{cons}}\)
\(\newcommand{\uncons}{\mathsf{uncons}}\)
\(\newcommand{\isnil}{\mathsf{isNil}}\)
\(\newcommand{\tail}{\mathsf{tail}}\)
\(\newcommand{\head}{\mathsf{head}}\)
\(\newcommand{\foldr}{\mathsf{foldr}}\)
\(\newcommand{\foldl}{\mathsf{foldl}}\)
\(\newcommand{\tacunfoldN}{\mathsf{tacunfoldN}}\)
\(\newcommand{\unfoldN}{\mathsf{unfoldN}}\)
\(\newcommand{\dfoldr}{\mathsf{dfoldr}}\)
\(\newcommand{\cfoldr}{\mathsf{cfoldr}}\)
\(\newcommand{\bfoldr}{\mathsf{bfoldr}}\)
\(\newcommand{\dbfoldr}{\mathsf{dbfoldr}}\)
\(\newcommand{\lfoldr}{\mathsf{lfoldr}}\)
\(\newcommand{\snoc}{\mathsf{snoc}}\)
\(\newcommand{\revcat}{\mathsf{revcat}}\)
\(\newcommand{\rev}{\mathsf{rev}}\)
\(\newcommand{\last}{\mathsf{last}}\)
\(\newcommand{\cat}{\mathsf{cat}}\)
\(\newcommand{\addlength}{\mathsf{addlength}}\)
\(\newcommand{\length}{\mathsf{length}}\)
\(\newcommand{\head}{\mathsf{head}}\)
\(\newcommand{\at}{\mathsf{at}}\)
\(\newcommand{\map}{\mathsf{map}}\)
\(\newcommand{\range}{\mathsf{range}}\)
\(\newcommand{\zip}{\mathsf{zip}}\)
\(\newcommand{\zipPad}{\mathsf{zipPad}}\)
\(\newcommand{\unzip}{\mathsf{unzip}}\)
\(\newcommand{\prefix}{\mathsf{prefix}}\)
\(\newcommand{\suffix}{\mathsf{suffix}}\)
\(\newcommand{\lcp}{\mathsf{lcp}}\)
\(\newcommand{\lcs}{\mathsf{lcs}}\)
\(\newcommand{\all}{\mathsf{all}}\)
\(\newcommand{\any}{\mathsf{any}}\)
\(\newcommand{\tails}{\mathsf{tails}}\)
\(\newcommand{\inits}{\mathsf{inits}}\)
\(\newcommand{\filter}{\mathsf{filter}}\)
\(\newcommand{\elt}{\mathsf{elt}}\)
\(\newcommand{\addcount}{\mathsf{addcount}}\)
\(\newcommand{\count}{\mathsf{count}}\)
\(\newcommand{\repeat}{\mathsf{repeat}}\)
\(\newcommand{\sublist}{\mathsf{sublist}}\)
\(\newcommand{\infix}{\mathsf{infix}}\)
\(\newcommand{\select}{\mathsf{select}}\)
\(\newcommand{\unique}{\mathsf{unique}}\)
\(\newcommand{\delete}{\mathsf{delete}}\)
\(\newcommand{\dedupeL}{\mathsf{dedupeL}}\)
\(\newcommand{\dedupeR}{\mathsf{dedupeR}}\)
\(\newcommand{\common}{\mathsf{common}}\)
\(\newcommand{\disjoint}{\mathsf{disjoint}}\)
\(\newcommand{\sublists}{\mathsf{sublists}}\)
\(\newcommand{\take}{\mathsf{take}}\)
\(\newcommand{\drop}{\mathsf{drop}}\)
\(\newcommand{\takeBut}{\mathsf{takeBut}}\)
\(\newcommand{\dropBut}{\mathsf{dropBut}}\)
\(\newcommand{\takeWhile}{\mathsf{takeWhile}}\)
\(\newcommand{\dropWhile}{\mathsf{dropWhile}}\)
This page is part of a series on Arithmetic Made Difficult.
In this post we’ll take a break from defining programs to establish two important equivalent versions of the induction principle: first a version of induction that allows us to make a much “stronger” induction hypothesis, and then a nonconstructive result about \(\nats\) that will make some proofs easier.
(Strong Induction.) Suppose we have a map \(f : \nats \rightarrow A\) and a subset \(B \subseteq A\) such that the following hold.
- \(f(\zero) \in B\).
- If \(f(k) \in B\) whenever \(\nleq(k,n)\), then \(f(\next(n)) \in B\).
Then \(f(n) \in B\) for all \(n \in \nats\).
Let \(B\) be such a subset.
Define \[T = \{ n \in \nats \mid \mathrm{if}\ \nleq(k,n)\ \mathrm{then}\ f(k) \in B \}.\] We will show that \(T = \nats\) by induction. For the base case \(n = \zero\), note that if \(\nleq(k,\zero)\), then \(k = \zero\), and we have \(f(\zero) \in B\) by condition (1).
Next suppose \(n \in T\), and suppose further that \(\nleq(k,\next(n))\). Now either \(\nleq(k,n)\) or \(k = \next(n)\). If \(\nleq(k,n)\), then since \(n \in T\) we have \(f(k) \in B\). If \(k = \next(n)\), we have \(f(\next(n)) \in B\) by condition (2). Thus \(\next(n) \in T\) as needed.
Now suppose \(n \in \nats\). Since \(\nleq(n,n)\) and \(n \in T\), we have \(f(n) \in B\) as claimed.
As with ordinary induction, we will typically apply this theorem with \(A = \nats\) and \(f\) the identity.
Note that condition (2) in the Strong Induction theorem appears to be much stronger than the corresponding condition in ordinary induction. Here we are allowed to assume that a given statement is true for all integers up to some bound \(n\), while plain induction makes that assumption only for \(n\). However it turns out that these two results are equivalent; in fact it’s not too difficult to see that strong induction implies ordinary induction. Despite this, there are times when the stronger induction hypothesis makes for a simpler proof.
(Strong Induction on \(f\).) Suppose we have a map \(f : A \rightarrow \nats\) and a subset \(B \subseteq A\) satisfying the following.
- If \(f(a) = \zero\), then \(a \in B\).
- If we have \(n \in \nats\) such that if \(f(a) = k\) with \(\nleq(k,n)\) then \(a \in B\), then if \(f(a) = \next(n)\) then \(a \in B\).
Then we have \(B = A\).
Let \(B\) be such a subset. We define \(T \subseteq \nats\) by \[T = \{n \in \nats \mid \forall a \in A, \mathrm{if}\ f(a) = n\ \mathrm{then}\ a \in B\}.\] We will show that \(T = \nats\) by strong induction.
For the base case, suppose \(f(a) = \zero\). By condition (1) we have \(a \in B\). Thus \(\zero \in T\).
For the inductive step, suppose we have \(n \in \nats\) such that \(k \in T\) whenever \(\nleq(k,n)\). Now suppose we have \(a \in A\) such that \(f(a) = \next(n)\). By condition (2) we have \(a \in B\) as needed.
So \(T = \nats\), and thus if \(a \in A\), we have \(f(a) = n\) for some \(n \in \nats\), and thus \(a \in B\).
Again, when using this principle we will say we’re using “strong induction on \(f(a)\)”.
(Well-Ordering Property.) Let \(A\) be a nonempty set and \(f : A \rightarrow \nats\). Then there exists \(a \in A\) such that \(\nleq(f(a),f(b))\) for all \(b \in A\).
Suppose to the contrary that some set \(A\) and map \(f : A \rightarrow \nats\) exist which do not have this property; that is, for all \(a \in A\), there exists \(b \in A\) such that \(\nleq(f(a),f(b))\) is false.
Define \[T = \{ n \in \nats \mid \exists a \in A, n = f(a) \},\] and let \(K = \nats \setminus T\). Note that \(T \neq \emptyset\). We will show that \(K = \nats\) by strong induction.
For the base case, note that if \(f(a) = \zero\), then \(\nleq(f(a),f(b))\) is true for all \(b \in A\). So we have \(\zero \notin T\), and thus \(\zero \in K\).
For the inductive step, suppose we have \(n \in \nats\) such that \(k \in K\) whenever \(\nleq(k,n)\). Now suppose that \(\next(n) \notin K\), that is, \(\next(n) \in T\); say \(\next(n) = f(a)\). Now suppose we have \(b \in A\). If \(\nleq(f(a),f(b))\) is false, then \(\nleq(f(b),f(a))\) is true and \(f(b) \neq \next(n)\). But now \(\nleq(f(b),n)\), so that \(f(b) \in K\), a contradiction. Thus we have \(\nleq(f(a),f(b)) = \btrue\) for all \(b\), a contradiction. So in fact \(\next(n) \in K\).
By induction, then, we have \(K = \nats\), so that \(T = \emptyset\), a contradiction. So in fact no such \(A\) and \(f\) can exist.
Again, in typical applications we will have \(A = \nats\) and \(f\) the identity.