nLab extensional type theory

Redirected from "extensional type theories".
Contents

Context

Type theory

natural deduction metalanguage, practical foundations

  1. type formation rule
  2. term introduction rule
  3. term elimination rule
  4. computation rule

type theory (dependent, intensional, observational type theory, homotopy type theory)

syntax object language

computational trinitarianism =
propositions as types +programs as proofs +relation type theory/category theory

logicset theory (internal logic of)category theorytype theory
propositionsetobjecttype
predicatefamily of setsdisplay morphismdependent type
proofelementgeneralized elementterm/program
cut rulecomposition of classifying morphisms / pullback of display mapssubstitution
introduction rule for implicationcounit for hom-tensor adjunctionlambda
elimination rule for implicationunit for hom-tensor adjunctionapplication
cut elimination for implicationone of the zigzag identities for hom-tensor adjunctionbeta reduction
identity elimination for implicationthe other zigzag identity for hom-tensor adjunctioneta conversion
truesingletonterminal object/(-2)-truncated objecth-level 0-type/unit type
falseempty setinitial objectempty type
proposition, truth valuesubsingletonsubterminal object/(-1)-truncated objecth-proposition, mere proposition
logical conjunctioncartesian productproductproduct type
disjunctiondisjoint union (support of)coproduct ((-1)-truncation of)sum type (bracket type of)
implicationfunction set (into subsingleton)internal hom (into subterminal object)function type (into h-proposition)
negationfunction set into empty setinternal hom into initial objectfunction type into empty type
universal quantificationindexed cartesian product (of family of subsingletons)dependent product (of family of subterminal objects)dependent product type (of family of h-propositions)
existential quantificationindexed disjoint union (support of)dependent sum ((-1)-truncation of)dependent sum type (bracket type of)
logical equivalencebijection setobject of isomorphismsequivalence type
support setsupport object/(-1)-truncationpropositional truncation/bracket type
n-image of morphism into terminal object/n-truncationn-truncation modality
equalitydiagonal function/diagonal subset/diagonal relationpath space objectidentity type/path type
completely presented setsetdiscrete object/0-truncated objecth-level 2-type/set/h-set
setset with equivalence relationinternal 0-groupoidBishop set/setoid with its pseudo-equivalence relation an actual equivalence relation
equivalence class/quotient setquotientquotient type
inductioncolimitinductive type, W-type, M-type
higher inductionhigher colimithigher inductive type
-0-truncated higher colimitquotient inductive type
coinductionlimitcoinductive type
presettype without identity types
set of truth valuessubobject classifiertype of propositions
domain of discourseuniverseobject classifiertype universe
modalityclosure operator, (idempotent) monadmodal type theory, monad (in computer science)
linear logic(symmetric, closed) monoidal categorylinear type theory/quantum computation
proof netstring diagramquantum circuit
(absence of) contraction rule(absence of) diagonalno-cloning theorem
synthetic mathematicsdomain specific embedded programming language

homotopy levels

semantics

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.

Remark

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.

Remark

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”.

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)xy \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 xyx\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 prefl(x)p\equiv refl(x).

Remark

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.

Properties

Decidability

Extensional Martin-Löf type theory does not have decidable type checking. See intensional type theory for more on this.

Examples

References

Last revised on July 7, 2023 at 23:09:13. See the history of this page for a list of all contributions to it.