[FMFP] Restructure summary

This commit is contained in:
2026-07-06 09:49:27 +02:00
parent 67500a14cb
commit 294363f3c8
66 changed files with 127 additions and 101 deletions
@@ -0,0 +1,6 @@
To prove recursive formulas, or more precisely formulated, a formula $P$ (with free variable $n$) for all $n \in \N$,
we have can use weak or strong induction.
Weak induction may be a \textit{slightly} misleading term, because it isn't necessarily weaker than strong induction.
This section has been moved to the very start of the theory part, even though many of the topics mentioned have not been covered in the summary yet,
such that all the induction proofs can be covered in the same place.
@@ -0,0 +1,24 @@
\subsection{Mathematical Induction}
{\small NOTE: These types of induction were (primarily) mentioned in the Formal Methods part of the course, but made most sense to be put here}
\subsubsection{Weak Mathematical Induction}
To prove $\forall n \in \N. P$ (with $n$ free in $P$), we do the following:
\shade{blue}{Base case} We show that $P[n \mapsto 0]$ is correct
\shade{green}{Step case} For an arbitrary $m$ not free in $P$, we show that $P[n \mapsto m + 1]$ is correct under the assumption that $P[n \mapsto m]$ is correct.
For \bi{well-founded} domains, we have to adjust the induction hypothesis slightly: We assume $\forall l \in \N. l < m \rightarrow P[n \mapsto l]$
and then prove $P[n \mapsto m]$ under our assumption.
The same, but expressed as a Natural Deduction rule:
\[
\begin{prooftree}
\hypo{\Gamma \vdash P(0)}
\hypo{\Gamma, P(n) \vdash P(n + 1)}
\infer2{\Gamma \vdash \forall n. P(n)}
\end{prooftree}
\]
\subsubsection{Strong Mathematical Induction}
@@ -0,0 +1,19 @@
\subsection{Structural Induction}
\subsubsection{Weak Structural Induction}
Induction is based on the structure of terms
\mint{haskell}+data T t = Leaf t | Node1 (T t) | Node2 t (T t) (T t)+
\shade{blue}{Base Case} $T_0 = \{ \texttt{Leaf}\ a \divider a \in t \}$
\shade{green}{Step Case} $T_i = T_{i - 1} \cup \{ \texttt{Node1}\ s \divider s \in T_{i - 1} \} \cup \{ \texttt{Node2}\ a\ l\ r \divider a \in t \text{ and } l, r \in T_{i - 1} \}$
A natural deduction rule structural induction is:
\[
\begin{prooftree}
\hypo{\Gamma \vdash P[x \mapsto \texttt{Leaf}\ a]}
\hypo{\Gamma, P[x \mapsto s] \vdash P[xs \mapsto \texttt{Node1}\ s]}
\hypo{\Gamma, P[x \mapsto l], P[x \mapsto r] \vdash P[ \mapsto \texttt{Node2}\ a\ l\ r]}
\infer3[$(*)$]{\Gamma \vdash \forall x \in \texttt{T}\ t. P}
\end{prooftree}
\]
(*) $a$, $l$, $r$, $s$ not free in $\Gamma, P$
@@ -0,0 +1,11 @@
\subsection{Other types of induction}
\subsubsection{Induction over Lists}
To prove $P$ for all $xs$ in \texttt{[T]}, we do the following:
\shade{blue}{Base case} We prove that $P[xs \mapsto []]$ is correct
\shade{green}{Step case} We prove that $\forall y :: T, ys :: [T]. P[xs \mapsto ys] \rightarrow P[xs \mapsto y : ys]$, or in other words:
We fix arbitrary $y :: T$ and $ys :: [T]$, which both are not free in $P$.
We then apply our induction hypothesis $P[xs \mapsto ys]$ to prove $P[xs \mapsto y : ys]$