Path: blob/main/course-contents/notes-formal-03.md
908 views
------\newcommand{\type}{\ \text{type}} \newcommand{\id}{\operatorname{id}} \newcommand{\prd}[1]{\Pi_{(#1)}} \newcommand{\comp}{\operatorname{comp}} \newcommand{\List}{\operatorname{List}} \newcommand{\nnil}{\operatorname{nil}} \newcommand{\cons}{\operatorname{cons}}
Inductive Types
Here I mostly want to "explain a little via some examples", referring you to the text [@rijkeIntroductionHomotopyType] for more details and full definitions.
The main point to emphasize is that inductive types share some of the features of the -types -- i.e. types of (dependent or ordinary) functions.
Inductive types are specified by:
constructors AKA introduction rules
an induction principle AKA elimination rules
computation rules
Natural numbers
formation rule
introduction rules (constructors)
\quad \quad \quad ParseError: KaTeX parse error: No such environment: prooftree at position 7: \begin{̲p̲r̲o̲o̲f̲t̲r̲e̲e̲}̲ \AxiomC{} \U…
induction principle
List A
Let's describe the inductive type of Lists. More precisely, for a type , let's describe the type whose elements are lists of elements of .
formation rule
introduction rules; ie. the constructors.
There are two introduction rules for lists. The first one forms the empty list:
ParseError: KaTeX parse error: No such environment: prooftree at position 7: \begin{̲p̲r̲o̲o̲f̲t̲r̲e̲e̲}̲ \AxiomC{$\G…The second one constructs ("
ParseError: KaTeX parse error: No such environment: prooftree at position 7: \begin{̲p̲r̲o̲o̲f̲t̲r̲e̲e̲}̲ \AxiomC{$\G…cons") a list from a term of type and an existing ParseError: KaTeX parse error: Undefined control sequence: \List at position 1: \̲L̲i̲s̲t̲ ̲A.the induction principle or elimination rule
We must stipulate what is needed to construct a section of a type family over the inductive type -- i.e. a dependent function.
The idea is this: for our inductive type , in order to define a dependent function ParseError: KaTeX parse error: Undefined control sequence: \prd at position 3: f:\̲p̲r̲d̲{x:A}B(x) one must specify the behavior of at the constructors of .
Here is our induction principle for ParseError: KaTeX parse error: Undefined control sequence: \List at position 1: \̲L̲i̲s̲t̲ ̲A:
(iii) The computation rules assert that the inductively defined section agrees on the constructors with the data that was used to define the section. Thus, there is a computation rule for every constructor
Bibliography
::: {.refs} :::