nLab
extensional type theory

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

logiccategory theorytype theory
trueterminal object/(-2)-truncated objecth-level 0-type/unit type
falseinitial objectempty type
proposition(-1)-truncated objecth-proposition, mere proposition
proofgeneralized elementprogram
cut rulecomposition of classifying morphisms / pullback of display mapssubstitution
cut elimination for implicationcounit for hom-tensor adjunctionbeta reduction
introduction rule for implicationunit for hom-tensor adjunctioneta conversion
conjunctionproductproduct type
disjunctioncoproduct ((-1)-truncation of)sum type (bracket type of)
implicationinternal homfunction type
negationinternal hom into initial objectfunction type into empty type
universal quantificationdependent productdependent product type
existential quantificationdependent sum ((-1)-truncation of)dependent sum type (bracket type of)
equivalencepath space objectidentity type
equivalence classquotientquotient type
inductioncolimitinductive type, W-type, M-type
higher inductionhigher colimithigher inductive type
completely presented setdiscrete object/0-truncated objecth-level 2-type/preset/h-set
setinternal 0-groupoidBishop set/setoid
universeobject classifiertype of types
modalityclosure operator, (idemponent) 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 are demanded to be propositions / of h-level 1. In other words, they are determined by their extensions — the collection of pairs of points which are equal. 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.

Definition

The basic definition of identity types as an inductive type family makes them intensional. There are two sorts of ways to make them extensional: definitionally or propositionally.

Definitional extensionality

In a definitionally extensional type theory, 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 definitional 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 propositional equality between pp and refl(x)refl(x). Finally, applying the equality reflection rule again, we get a definitional 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. Definitionally extensional type theory is often presented in this form.

A different, also equivalent, way of presenting definitionally extensional type theory is with a definitional eta-conversion rule for the identity types; see here.

Propositional extensionality

In a propositionally extensional type theory, we still distinguish definitional and propositional equality, but no two terms can be propositionally equal in more than one way (up to propositional equality). In the language of homotopy type theory, this means that all types are h-sets. There are a number of equivalent ways to force this to be true by adding axioms to type theory.

  1. We can add as an axiom the “uniqueness of identity proofs” (axiom UIP) property that any two inhabitants of the same identity type Id A(x,y)Id_A(x,y) are themselves equal (in the corresponding higher identity type).

  2. We can add Streicher’s axiom K which says that any inhabitant of a self-equality type Id A(x,x)Id_A(x,x) is (propositionally) equal to the identity/reflexivity equality 1 x1_x. (Axiom K is so named because KK comes after JJ, and JJ usually denotes the eliminator for identity types.)

  3. In the presence of dependent sum types, we can add an axiom saying that if (a,b 1)(a,b_1) and (a,b 2)(a,b_2) are pairs in a dependent sum x:AB(x)\sum_{x\colon A} B(x) with the same first component, and the identity type Id x:AB(x)((a,b 1),(a,b 2))Id_{\sum_{x\colon A} B(x)}((a,b_1), (a,b_2)) is inhabited, then so is Id a(b 1,b 2)Id_a(b_1,b_2).

  4. We can allow definition of functions by a strong form of pattern matching, as in unmodified Agda. The relevant “extra strength” is to allow output types of a pattern match which are only well-defined after the pattern has been matched.

Propositionally extensional type theory has some of the attributes of intensional type theory, and many type theorists use “extensional type theory” to refer only to the definitional version.

Properties

Decidability

Only the intensional, but not the extensional, Martin-Löf type theory is decidable. See intensional type theory for more on this.

Examples

References

Among the most thorough recent treatments of extensional type theory are

  • 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)

Revised on May 12, 2014 01:58:30 by Urs Schreiber (31.55.60.16)