natural deduction metalanguage, practical foundations
type theory (dependent, intensional, observational type theory, homotopy type theory)
computational trinitarianism =
propositions as types +programs as proofs +relation type theory/category theory
basic constructions:
strong axioms
further
In mathematics and specifically in formal logic, by a “list” one means the fairly evident formalization of the colloquial notion of a “list of elements”:
If a set $E$ of admissible elements is given — also called an “alphabet”, in this context — then a list of $E$-elements is a tuple $(e_1, e_2, \cdots, e_\ell)$ of elements $e_i \,\in\, E$, of any length $\ell \,\in\, \mathbb{N}$ — also called a word in the given alphabet.
Typically one will write “$List(E)$” or similar for the set of all lists with entries in $E$.
For instance, for $E$ the (underlying set of) a field, the component-expressions of vectors in the vector space $k^n$ may be thought of as lists of length $n$ with elements in $k$. However, doing so means to disregard the vector space-structure on the collection of all such lists.
Instead, the notion of list is a concept with an attitude: While lists are just tuples of any length, calling them lists indicates that one intends to consider the operation of concatenation of lists to larger lists, in particular the operations of appending an element to a list.
It is evident that the operation of concatenation makes $List(E)$ a monoid (the neutral element under concatenation is the empty list, i.e. the unique list of length zero). In fact, a moment of reflection shows that, as such, $\big(List(E), conc\big)$ is the free monoid on $E$.
Therefore, in much of the mathematical literature, lists are understood as free monoids.
Specifically in computer science one commonly deals with the corresponding notion of the data type of lists (with entries in a prescribed data type), which serve as a basic and common kind of data structure?. In programming languages supporting something like a calculus of constructions, this data type, essentially with the free monoid-structure as above, may be defined as an inductive type in an evident way (made explicit below).
On the other hand, in dependent type theories which have a homotopy type theory-interpretation — in that they do not verify uniqueness of identity proofs (or “axiom K”) — one may want to distinguish between lists and free monoids:
Because, in such theories it may happen that the given alphabet type $E$ is not actually a set but a higher homotopy type, in that it is not 0-truncated. In this case it still makes good sense to speak of lists of elements (terms) of $E$, only that now the corresponding type $List(E)$ is itself not 0-truncated. But since the term “monoid” carries with it a connotation of being 0-truncated, one may no longer want to call this the free monoid on $E$. It is, of course, still a free monoid in the proper higher algebraic sense (cf. monoid in a monoidal $\infty$-category).
The type of lists on a type $A$ is defined as the dependent sum type
where $\mathrm{Fin}(n)$ is the finite set with $n$ elements. This shows that lists are just tuples.
Assuming that identification types, function types and dependent product types exist in the type theory, the type of lists on a type $A$ of generators is the inductive type $\mathrm{List}(A)$ generated by an element $\mathrm{nil}:\mathrm{List}(A)$ and a function $\mathrm{cons}:A \to \mathrm{List}(A) \to \mathrm{List}(A)$:
Formation rules for the type of lists:
Introduction rules for the type of lists:
Elimination rules for the type of lists:
Computation rules for the type of lists:
Uniqueness rules for the type of lists:
The elimination, typal computation, and typal uniqueness rules for the type of lists type state that the type of lists satisfy the dependent universal property of the type of lists. If the dependent type theory also has dependent sum types and product types, allowing one to define the uniqueness quantifier, the dependent universal property of the type of lists could be simplified to the following rule:
natural numbers type (the list on the unit type $\mathrm{List}(\mathbb{1})$)
underlying type of free infinity-group (the invertible version of the type of lists)
Types of lists are defined in section 5.1 in:
Last revised on January 25, 2023 at 04:24:46. See the history of this page for a list of all contributions to it.