extensional type theory in nLab
Context
Type theory
Contents
Idea
Extensional type theory denotes the flavor of type theory in which identity types satisfy the reflection rule, saying that if two terms are typally equal then they are also judgmentally equal.
In particular, this implies that all identity types are propositions / of h-level 1, and thus equivalently that all types are required to be h-sets. Therefore, extensional type theory is a set-level type theory, and hence a form of set-level foundations. However, there are other set-level type theories, such as those obtained by adding UIP as an axiom.
Note: For a while, the nLab incorrectly used “extensional type theory” to refer to what we now call set-level type theory. If you encounter uses of this sort, please correct them.
Extensional type theory is poorly behaved metatheoretically, and very difficult to implement in a proof assistant. However, it is sometimes more convenient to work with informally, and there are conservativity theorems relating it to other set-level type theories that are better-behaved.
Type theory which is not extensional is called intensional type theory.
Definition
The Martin-Lof definition of identity types as an inductive type family makes them intensional. To make the type theory extensional, we add a rule that any inhabitant of an identity type p:Id A(x,y)p:Id_A(x,y) induces a definitional equality between xx and yy. In other words, we have an “equality reflection rule” of the form
p:Id A(x,y)x≡y \frac{p:Id_A(x,y)}{x\equiv y}
At first, this may appear to be only a “skeletality” assumption, since it does not assert explicitly that pp is reflexivity rather than a nontrivial loop. However, we can derive this with the induction rule for identity types. Consider the dependent type
(x:A),(y:A),(p:Id A(x,y))⊢Id Id A(x,y)(p,refl(x)). (x:A),(y:A),(p:Id_A(x,y)) \;\vdash\; Id_{Id_A(x,y)}(p,refl(x)).
This is well-typed because the reflection rule applied to pp yields a judgmental equality x≡yx\equiv y, so that we have refl(x):Id A(x,y)refl(x):Id_A(x,y). Moreover, substituting xx for yy and refl(x)refl(x) for pp yields the type Id Id A(x,x)(refl(x),refl(x))Id_{Id_A(x,x)}(refl(x),refl(x)), which is inhabited by refl(refl(x))refl(refl(x)).
Thus, by induction on identity, we have a term in the above type, witnessing a typal equality between pp and refl(x)refl(x). Finally, applying the equality reflection rule again, we get a judgmental equality p≡refl(x)p\equiv refl(x).
A different, also equivalent, way of presenting extensional type theory is with a definitional eta-conversion rule for the identity types; see here.
Properties
Decidability
Extensional Martin-Löf type theory does not have decidable type checking. See intensional type theory for more on this.
Examples
References
-
Martin Hofmann, Extensional concepts in intensional type theory, Ph.D. thesis, University of Edinburgh, (1995) (ECS-LFCS-95-327, pdf)
-
Ieke Moerdijk, E. Palmgren, Wellfounded trees in categories. Ann. Pure Appl. Logic, 104:189-218 (2000)
-
Ieke Moerdijk, E. Palmgren, Type theories, toposes and constructive set theory: predicative aspects of AST, Ann. Pure Appl. Logic, 114:155-201, (2002)
-
Jonathan Sterling, Carlo Angiuli, Daniel Gratzer, Cubical syntax for reflection-free extensional equality. In Herman Geuvers, editor, 4th International Conference on Formal Structures for Computation and Deduction (FSCD 2019), volume 131 of Leibniz International Proceedings in Informatics (LIPIcs), pages 31:1-31:25. (arXiv:1904.08562, doi:10.4230/LIPIcs.FSCD.2019.31)
-
Jonathan Sterling, Carlo Angiuli, Daniel Gratzer, A Cubical Language for Bishop Sets, Logical Methods in Computer Science, 18 (1), 2022. (arXiv:2003.01491).
Last revised on January 4, 2025 at 23:49:15. See the history of this page for a list of all contributions to it.