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
equality (definitional, propositional, computational, judgemental, extensional, intensional, decidable)
identity type, equivalence of types, definitional isomorphism
isomorphism, weak equivalence, homotopy equivalence, weak homotopy equivalence, equivalence in an (∞,1)-category
Examples.
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.
The word “extensional” in type theory (even when applied to identity types) sometimes refers instead to the axiom of function extensionality. In general this property is orthogonal to the one considered here: function extensionality can hold or fail in both extensional and intensional type theory.
In particular, homotopy type theory is intensional in that identity types are crucially not demanded to be propositions, but function extensionality is often assumed (in terms of these intensional identity types, of course) — in particular, it follows from the univalence axiom. Indeed, univalence itself is arguably an extensionality principle for the universe (Hofmann and Streicher originally introduced it under the name “universe extensionality”), but it is inconsistent with “extensional type theory” in the sense considered here.
The origin of the names “extensional” and “intensional” is somewhat confusing. In fact they refer to the behavior of the definitional equality. The idea is that the identity type is always an “extensional” notion of equality (although it can be more or less extensional, depending on whether further extensionality principles like function extensionality and univalence hold). Thus, if the definitional equality coincides with the identity type, as it does under the reflection rule, the former is also extensional, and so we call the type theory “extensional” — while if the two equalities do not coincide, then the definitional equality has room to be more intensional than the identity type, and so we call the type theory “intensional”.
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 induces a definitional equality between and . In other words, we have an “equality reflection rule” of the form
At first, this may appear to be only a “skeletality” assumption, since it does not assert explicitly that is reflexivity rather than a nontrivial loop. However, we can derive this with the induction rule for identity types. Consider the dependent type
This is well-typed because the reflection rule applied to yields a judgmental equality , so that we have . Moreover, substituting for and for yields the type , which is inhabited by .
Thus, by induction on identity, we have a term in the above type, witnessing a typal equality between and . Finally, applying the equality reflection rule again, we get a definitional equality .
On the other hand, if in addition to the equality reflection rule we postulate that all equality proofs are definitionally equal to reflexivity, then we can derive the induction rule for identity types. Extensional type theory is often presented in this form.
A different, also equivalent, way of presenting extensional type theory is with a definitional eta-conversion rule for the identity types; see here.
If the dependent type theory has an interval type with judgmental computation rules for the point constructors, it suffices for the two point constructors and to be definitionally equal:
By the recursion principle of the interval type, for elements , , and , we have a function such that and . If we have , then by the congruence rules of definitional equality we have
which is precisely equality reflection.
Alternatively, one can add inference rules for definitional -localization:
The usual notion of -localization, provable in any dependent type theory with an interval type, implies definitional -localization in extensional type theory by equality reflection. On the other hand, one can prove equality reflection from definitional -localization.
Definitional -localization implies equality reflection.
Given , , and , by the recursion principle of the interval type, we have a function . By definitional -localization and the recursion principle of the interval type, we have an element
such that
hence, we can derive by the inference rules for judgmental equality that , which is precisely equality reflection.
In the presence of the large recursion principle of the interval type, definitional isomorphism types imply equality reflection.
In the presence of definitional isomorphism types and the inductively defined identity types, transport can be defined as definitional isomorphism via the J-rule, since the identity function or identity equivalence is a definitional isomorphism and thus one can apply the J-rule to reflexivity to get the identity as a definitional isomorphism:
By large recursion of the interval, given two types and and an equivalence of types , one can construct an interval-indexed type family such that , , and . With definitional isomorphism types, the equivalences can be strictified to definitional isomorphisms by
This implies that for all types , the equivalence
in -localization can be turned into the definitional isomorphism
which is definitional -localization, and definitional -localization implies equality reflection as proven in the definitional -localization and extensional type theory articles.
In extensional type theory, there are ways of defining certain dependent sum types of identity type as a negative type, which all result in equality reflection.
The idea is that using the inference rules for dependent sum types, the standard J-rule states that the dependent sum type is a positive copy of with respect to the diagonal function
However, there is also a negative version of copy types, whose elimination, computation, and uniqueness rules state that the diagonal function is a definitional isomorphism:
The uniqueness rules yield equality reflection. By the properties of judgmental equality and dependent sum types, from
one can derive and and thus .
Similarly, the Paulin-Mohring J-rule states that given , the dependent sum type is a positive unit type of with specified element
However, there are also negative unit types, which states that is a definitional singleton with judgmental center of contraction
Similarly to the case for the standard Martin-Lof identity types, the uniqueness rule yields equality reflection, because by the properties of judgmental equality and dependent sum types, one can derive from .
Extensional Martin-Löf type theory does not have decidable type checking. See intensional type theory for more on this.
In addition, extensional type theory does not have decidable judgmental equality.
Already, the equality reflection rule for the natural numbers type implies undecidability of judgmental equality in the dependent type theory.
In order to show that, in an arbitrary context , in , we need to determine whether the empty type is a pointed type in , which is undecidable in general.
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).
Extensional type theory is discussed in chapter 2 of:
Last revised on July 5, 2025 at 17:56:48. See the history of this page for a list of all contributions to it.