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 (denoted ) describing the grammar of these functors, an interpretation function mapping codes to functors, and a fixed point constructor.

Agda syntax

Suppose we have the the following data declaration is providided where are telescopes that may refer to in a strictly positive position only.

Strict positivity

Strict positivity of telescopes Suppose that we remove the requirement of strict positivity. Then an initial algebra semantics can produce inconsistent terms.

Semantics

Semantically, we interpret an inductive type as the Algebra on an Endofunctor of an endofunctor.

Let be the ambient category (e.g., a locally cartesian closed category for 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.

Initiality

The inductive type is the carrier of the initial -algebra 1 . 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

  1. See Algebra on an Endofunctor.