# Logic for Computer Scientists/Induction

## Induction

Induction plays a crucial role at least in two aspect throughout this book. Firstly, it is one of main proof principles in mathematics and of course in logics. In particular it can be used to investigate properties of infinite sets. Very often it is used as natural induction, namely over the natural numbers. We will introduce it as a more general principle over well founded partial orders, which is called structural induction. The second aspect is, that it can be used as well to define infinite structures, as the set of well formed formulae in a particular logic or the set of binary trees.

We start with a very general structure over arbitrary sets, namely partial orders. A relation ${\displaystyle R}$ over ${\displaystyle A}$ is a partial order iff ${\displaystyle R}$ is reflexive, transitive and anti-symmetric (i.e. ${\displaystyle ((x,y)\in R\land (y,x)\in R\Rightarrow x=y)}$) . Partial ordered sets (p.o. sets) ${\displaystyle A}$ are usually written as ${\displaystyle (A,\leq )}$.

## Definition 1

The necessary structure for our induction principle is a partial order, such that there exist minimal elements. Given a p.o. set ${\displaystyle (A,\leq )}$, we define:

• ${\displaystyle x iff ${\displaystyle x\leq y}$ and ${\displaystyle x\neq y}$.
• ${\displaystyle (A,\leq )}$ is called well-founded iff there is no infinite sequence ${\displaystyle (x_{i})_{i\in N}}$ and ${\displaystyle x_{i+1}.
• ${\displaystyle X\subseteq A}$ is called a chain iff ${\displaystyle \forall x,y\in X:x\leq y}$ or ${\displaystyle y\leq x}$
• ${\displaystyle (A,\leq )}$ is a total ordering iff ${\displaystyle A}$ is a chain.

## Lemma 1

${\displaystyle (A,\leq )}$ is well-founded, if every non-empty subset of ${\displaystyle A}$ has a minimal Element. Proof can be done by contradiction and will be given as an exercise.

We finally have the machinery to introduce the principle of complete induction:

## Definition 2 (Complete (structural) induction)

Given a well-founded p.o. set ${\displaystyle (A,\leq )}$ and a predicate ${\displaystyle P}$, i.e. ${\displaystyle P:A\to \{true,false\}}$. The principle of induction is given by the following (second order) formula
${\displaystyle \forall x\in A\;(\forall y\in A\;(y

## Lemma 2

The induction principle holds for every well-founded set.

Proof: The proof is given by contradiction: Assume the principle is wrong; i.e. the implication is wrong, which means, that we have to assume the premise as true:

${\displaystyle {\begin{matrix}\forall x\in A\;(\forall y\in A\;(y

and the conclusion as wrong:

${\displaystyle {\begin{matrix}\forall z\in A\;(P(z))\equiv =false=(conclusion)\end{matrix}}}$

Hence we can assume that the set ${\displaystyle X=\{x\in A\mid P(x)=false\}}$ is not empty.

Since ${\displaystyle X}$ is a subset of a well-founded set, it has a minimal element, say ${\displaystyle b}$. From assumption (premise) we conclude

${\displaystyle {\begin{matrix}(\forall y\in A\;(y

Now we can distinguish two cases:

• ${\displaystyle b}$ is minimal in ${\displaystyle A}$: Hence there is no ${\displaystyle y\in A}$, such that ${\displaystyle y. Hence the premise ${\displaystyle \forall y\in A\;(y of the implication in (inst) is true, which implies that the conclusion ${\displaystyle P(b)}$ is true. This is a contradiction to the assumption that
${\displaystyle b\in X}$!
• ${\displaystyle b}$ is not minimal in ${\displaystyle A}$: ${\displaystyle \forall y\in A\;(y holds and it must be that ${\displaystyle P(y)}$ is true, because otherwise it would be that ${\displaystyle y\in X}$ and ${\displaystyle b}$ not minimal in ${\displaystyle X}$. Hence, again the premise ${\displaystyle \forall y\in A\;(y of the implication in (inst) is true, which implies that the conclusion ${\displaystyle P(b)}$ is true. This is a contradiction to the assumption that ${\displaystyle b\in X}$!

## An Example

In this subsection we will carry out a proof with induction in detail. For this we need the extension of p.O. sets:

## Definition 3 (Lexicographic Ordering)

A p.O. set ${\displaystyle (A,\leq )}$ induces an ordering ${\displaystyle \ll }$ over ${\displaystyle A\times A}$: ${\displaystyle \forall x,y,x\prime ,y\prime \in A:(x,y)\ll (x\prime ,y\prime )}$ iff

• ${\displaystyle x=x\prime }$ and ${\displaystyle y=y\prime }$ or
• ${\displaystyle x or
• ${\displaystyle x=x\prime }$ and ${\displaystyle y

## Lemma 3

If ${\displaystyle (A,\leq )}$ is a well-founded set, then ${\displaystyle (A\times A,\ll )}$ is well-founded as well.

## Theorem 1

The Ackermann-function ${\displaystyle ACK}$ defined by the following recursion is a total function over ${\displaystyle N\times N}$

  ACK(x,y) =
if x=0  then y+1 else
if y=0 then ACK(x-1,1)
else ACK(x-1,ACK(x, y-1))


Proof: For the induction start we take the minimal element ${\displaystyle (0,0)}$ of the well-founded set,
${\displaystyle (N\times N,\ll )}$, where ${\displaystyle \ll }$ is the lexicographic ordering induced by ${\displaystyle (N,\leq )}$. Hence, assume ${\displaystyle x=0,y=0}$. By definition of
${\displaystyle ACK}$, we conclude ${\displaystyle ACK(0,0)=1}$ and hence defined. Assume for an an arbitrary ${\displaystyle (m,n)}$, that

${\displaystyle ACK(m',n')}$ is defined for all ${\displaystyle (m'.n')\ll (m,n)}$, if ${\displaystyle (m,n)\neq (m',n')}$

We distinguish the following cases:

• ${\displaystyle m=0}$: i.e. ${\displaystyle ACK(0,n)=n+1}$ and hence defined.
• ${\displaystyle m\neq 0}$ and ${\displaystyle n=0}$: We know that ${\displaystyle (m-1,1)\ll (m,0)}$ and ${\displaystyle (m-1,1)\neq (m,0)}$. From the induction hypothesis we know that ${\displaystyle ACK(m-1,1)}$ is defined, and hence ${\displaystyle ACK(m,0)=ACK(m-1,1)}$ as well.
• ${\displaystyle m\neq 0}$ and ${\displaystyle n\neq 0}$: According to the definition of ${\displaystyle ACK}$ we have two cases to consider:
• ${\displaystyle (m,n-1)\ll (m,n)}$ and ${\displaystyle (m,n-1)\neq (m,n)}$: From the induction hypothesis we conclude immediately that ${\displaystyle ACK(m,n-1)}$ is defined.
• ${\displaystyle (m-1,y)\ll (m,z)}$ and ${\displaystyle (m-1,y)\neq (m,z)}$: Independent from the values of ${\displaystyle x}$ and ${\displaystyle y}$. If we assume
${\displaystyle y'ACK(m,n-1)}$ and ${\displaystyle z=n}$, we again can conclude from the hypothesis, that ${\displaystyle ACK(m-1,ACK(m,n-1))}$ is defined and hence ${\displaystyle ACK(m,n)}$ as well

Altogether we proved, that ${\displaystyle ACK(x,y)}$ is defined for all ${\displaystyle x,y\geq 0}$.

## Problems

#### Problem 1 (Induction)

Prove the following lemma: If ${\displaystyle (A,\leq )}$ is well founded also ${\displaystyle (A\times A,\ll )}$.

Note: The lexicographical Order ${\displaystyle (A\times A,\ll )}$ is defined as follows:

${\displaystyle (m,n)\ll (m',n')\iff {\big (}m

#### Problem 2 (Induction)

How many points of intersection could ${\displaystyle n}$ straight lines have at most? Find a recursive and explicit formula and show

#### Problem 3 (Induction)

Prove that a number ${\displaystyle x}$ is even if and only if ${\displaystyle x^{2}}$ is even.

#### Problem 4 (Induction)

Point by an indirect proof that there is not any greatest prime number!

#### Problem 5 (Induction)

Which prerequisite do you need that the following order

${\displaystyle (\{A,\,B,\,C,\,0,\,1,\,2\},\leq )}$ is

1. partial ordered
2. total ordered
3. well-founded?

#### Problem 6 (Induction)

An example of a well founded set is the power set ${\displaystyle P(M)}$ over a finite set ${\displaystyle M}$ which is comparable over the relation of the subset ${\displaystyle \subseteq }$. If ${\displaystyle M=\{1,\,2,\,3\}}$ then is e.g. ${\displaystyle {1}\subseteq \{1,\,2,\,3\}}$ but ${\displaystyle \{1,\,2\}}$ and ${\displaystyle \{2,\,3\}}$ are not comparable. Give a definition of a relation ${\displaystyle B}$ in this way that ${\displaystyle (P(M),\,B)}$ is total ordered and well founded.

#### Problem 7 (Induction)

Examine which of the following partial order are total and which are well founded!

1. ${\displaystyle (2^{\mathbb {N} },\subseteq )}$ with ${\displaystyle 2^{\mathbb {N} }}$ is the power set for natural numbers.
2. ${\displaystyle (\mathbb {N} ,|)}$ with ${\displaystyle |}$ marks the relation "`is factor of"'.
3. ${\displaystyle (\mathbb {N} \times \mathbb {N} ,\ll )}$ with ${\displaystyle (m,n)\ll (m',n')}$ iff ${\displaystyle m or (${\displaystyle m=m'}$ and ${\displaystyle n\leq n'}$).
4. ${\displaystyle (\mathbb {N} ^{*},\preceq )}$ with ${\displaystyle \preceq }$ is the lexicographical .
5. for ${\displaystyle \mathbb {N} ^{*}}$, i.e. ${\displaystyle 1\prec 1.1\prec 3\prec 3.3.8}$

#### Problem 8 (Induction)

Give for the natural numbers ${\displaystyle \mathbb {N} }$ an order relation, that is

1. both well-founded and total,
2. total but not well-founded,
3. well-founded but not total and
4. neither well-founded nor total.

#### Problem 9 (Induction)

Prove, that a partial order ${\displaystyle (A,\leq )}$ is well-founded iff every non-empty partial set of ${\displaystyle A}$ (at least) contains a minimum element.

#### Problem 10 (Induction)

A root tree consists (a) of a single node or (b) of a node - that's the root of the tree - and at least one, but only at most finite many (part)trees, this one is bandaged over an edge with the root. Point formally by means of induction, that in every tree the number of the nodes ${\displaystyle n}$ around ${\displaystyle 1}$ is taller than the number of the edges ${\displaystyle e}$, i.e. ${\displaystyle e=n-1}$.

#### Problem 11 (Induction)

Prove: If ε is a quality of the natural numbers ${\displaystyle \mathbb {N} }$ and it is valid

1. ε(0) and
2. ${\displaystyle \forall n\in \mathbb {N} }$ : [ε(n) ${\displaystyle \Rightarrow }$ ε(n+1)].

then ${\displaystyle \forall n\in \mathbb {N} }$ : ε(n) is valid.

Note: The proof can be done by the fact that the principle of the complete induction in ${\displaystyle \mathbb {N} }$ (which should be proved) can be reduced to the principle of the transfinite induction for well founded orders.