Table of Contents
Fetching ...

Constructing (Co)inductive Types via Large Sizes

Benno van den Berg, Bastiaan Laarakker, Daniël Otten

TL;DR

It is shown that inductive and coinductive types can be constructed in this theory, which improves on earlier work where this was only possible for the finitely-branching inductive types.

Abstract

To ensure decidability and consistency of its type theory, a proof assistant should only accept terminating recursive functions and productive corecursive functions. Most proof assistants enforce this through syntactic conditions, which can be restrictive and non-modular. Sized types are a type-based alternative where (co)inductive types are annotated with additional size information. Well-founded induction on sizes can then be used to prove termination and productivity. An implementation of sized types exists in Agda, but it is currently inconsistent due to the addition of a largest size. We investigate an alternative approach, where intensional type theory is extended with a large type of sizes and parametric quantifiers over sizes. We show that inductive and coinductive types can be constructed in this theory, which improves on earlier work where this was only possible for the finitely-branching inductive types. The consistency of the theory is justified by an impredicative realisability model, which interprets the type of sizes as an uncountable ordinal.

Constructing (Co)inductive Types via Large Sizes

TL;DR

It is shown that inductive and coinductive types can be constructed in this theory, which improves on earlier work where this was only possible for the finitely-branching inductive types.

Abstract

To ensure decidability and consistency of its type theory, a proof assistant should only accept terminating recursive functions and productive corecursive functions. Most proof assistants enforce this through syntactic conditions, which can be restrictive and non-modular. Sized types are a type-based alternative where (co)inductive types are annotated with additional size information. Well-founded induction on sizes can then be used to prove termination and productivity. An implementation of sized types exists in Agda, but it is currently inconsistent due to the addition of a largest size. We investigate an alternative approach, where intensional type theory is extended with a large type of sizes and parametric quantifiers over sizes. We show that inductive and coinductive types can be constructed in this theory, which improves on earlier work where this was only possible for the finitely-branching inductive types. The consistency of the theory is justified by an impredicative realisability model, which interprets the type of sizes as an uncountable ordinal.
Paper Structure (31 sections, 19 theorems, 74 equations, 13 figures)

This paper contains 31 sections, 19 theorems, 74 equations, 13 figures.

Key Result

Lemma 1

The following type is contractible for any term $f : \forall i.(\forall j< i. A(j)) \to A(i)$:

Figures (13)

  • Figure 1: Rules for context formation.
  • Figure 2: Rules for empty-, unit-, and boolean type (their elimination and computation principles are left implicit).
  • Figure 3: Rules for $\Pi$-types with $\beta$- and $\eta$-rules.
  • Figure 4: Rules for $\Sigma$-types with $\beta$- and $\eta$-rules ($\pi_1$ and $\pi_2$ are the derived projections).
  • Figure 5: Rules for propositional equality.
  • ...and 8 more figures

Theorems & Definitions (39)

  • Lemma 1: Uniqueness of fixpoints
  • Proposition 2
  • Proposition 3
  • Remark
  • Proposition 4
  • Proposition 5
  • Definition 6: Algebra
  • Lemma 7
  • Lemma 8
  • Definition 9
  • ...and 29 more