Lecture Notes: Structural Induction

Preliminaries

Course Content

Review 1

Question: Consider the function: \( f(x) = \frac{1}{\vert x \vert} \) for \( f: ? \rightarrow \mathbb{R} \)

Answer:

Review 2

Review Written Assignment 6.

Definition of Structural Induction

Return of the Thue Sequence

Defining Strings

Defining String Operations

\[\begin{aligned} 11 \cdot 00 &= \langle 1, \langle 1, \lambda \rangle \rangle \cdot \langle 0, \langle 0, \lambda \rangle \rangle \\ &= \langle 1, \langle 1, \lambda \rangle \cdot \langle 0, \langle 0, \lambda \rangle \rangle \rangle & \text{ (by SC2)} \\ &= \langle 1, \langle 1, \lambda \cdot \langle 0, \langle 0, \lambda \rangle \rangle \rangle \rangle & \text{ (by SC2)} \\ &= \langle 1, \langle 1, \langle 0, \langle 0, \lambda \rangle \rangle \rangle \rangle & \text{ (by SC1)} \\ &= 1100 \\ \end{aligned}\]

String Associativity by Structural Induction

\[\begin{aligned} (\lambda \cdot t) \cdot u &= (t) \cdot u & \text{ (by SC1)}\\ &= (t \cdot u) \\ &= \lambda \cdot (t \cdot u) & \text{ (by SC1)}\\ \end{aligned}\] \[\begin{aligned} (s' \cdot t) \cdot u &= (\langle a, s \rangle \cdot t) \cdot u & \text{ (substituting)}\\ &= \langle a, s \cdot t \rangle \cdot u & \text{ (by SC2)}\\ &= \langle a, (s \cdot t) \cdot u \rangle & \text{ (by SC2)}\\ &= \langle a, s \cdot (t \cdot u) \rangle & \text{ (by IH)}\\ &= \langle a, s \rangle \cdot (t \cdot u) & \text{ (by SC2)}\\ &= s' \cdot (t \cdot u) & \text{ (substituting)}\\ \end{aligned}\]

Structural Induction Schema

Balanced Strings of Parentheses (BSPs)

\[\begin{aligned} \text{Known BSPs} \\ \{ \lambda \} & \text{ by base case} \\ \{ \lambda, () \} & \text{ by applying C1} \\ \{ \lambda, (), ()() \} & \text{ by applying C2} \\ \{ \lambda, (), ()(), (()()) \} & \text{ by applying C1} \\ \end{aligned}\]

BSP Proof 1

BSP Proof 2