Files
eth-summaries/semester4/fmfp/parts/01_induction-proofs/04_other-induction.tex
T

10 lines
512 B
TeX

\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]$