Idea
In type theory, an inductive type is a way of constructing a uniform tree structure that is well-founded: all paths from the root are finite.
Inductive types can be encoded using Tarski universe. We model inductive types as the least fixed points of strictly positive endofunctors. This approach relies on a universe of codes (often denoted ) describing the grammar of these functors, an interpretation function mapping codes to functors, and a fixed point constructor.
Syntax
We define the type of codes inductively. This universe typically supports constants, the identity functor (recursive positions), sums, and products. A common minimal presentation equivalent to W-types: 1
A code is finitary, when is only used with finite , otherwise it is infinitiary.
Interpretation
We interpret codes recursively as endofunctors :
Formation Rules
The generic inductive type is the least fixed point of the functor described by .
Introduction Rules
The type has a single constructor , which wraps an element of the functor applied to the fixed point itself.
Note: The familiar constructors of specific types (like and ) are derived by composing with the injection forms of the functor’s sum structure.
Elimination Rule
To eliminate into a motive , we require an algebra compatible with the functor’s action on dependent types.
We define the lifting of the functor to dependent types, denoted . If , then transforms data of type into data over the motive.
Computation Rule
Examples
Natural Numbers
We encode as a choice between a unit (zero) and a recursive position (successor). Using a binary sum operator (derived from over ):
Formation Rule
Introduction Rules
Elimination Rule
The elimination rule asserts that to define a dependent function , it suffices to define it for the constructors.
Computation Rules
Applying the eliminator to a constructor reduces to the corresponding case:
Semantics
Semantically, we interpret an inductive type as the initial algebra of an endofunctor.
Let be the ambient category (e.g., a locally cartesian closed category for dependent type theory). Let be a strictly positive endofunctor representing the type’s signature.
F-Algebra
An F-algebra is a pair , where is an object in and is a morphism (the constructor). See Algebra (Category Theory).
Initiality
The inductive type is the carrier of the initial -algebra 2 . For any other algebra , there exists a unique homomorphism making the diagram commute:
- Existence of provides the recursion principle.
- Uniqueness of implies the uniqueness of the recursive definition (related to -laws).
- Commutativity corresponds to the computation rule.
In extensional type theory, initiality corresponds exactly to the induction principle. In HoTT, we require the type to be a homotopy initial algebra. For general dependent theories, we often model these via W-types (well-founded trees), which represent the initial algebras for polynomial functors.
See also
References
Footnotes
-
from forsberg2013-inductive-inductive-thesis based on dybjer1999-inductive-recursive. ↩
-
See Initial Algebra. ↩