Idea
In type theory, the identity type is the type of proofs that two terms are equal. Unlike definitional equality, which is a judgement external to the theory, the identity type lives inside the theory: its terms are witnesses of equality, and the type may have rich structure.
In HoTT, terms of are interpreted as paths from to in the space . This view generalises the notion of a proof of equality to a path in an -groupoid, where multiple distinct paths may exist between the same two points.
Definition
For a type and terms , the identity type is denoted or . The subscript is often omitted when it is clear from context.
Rules
Formation
Introduction
The only constructor is reflexivity: every term is equal to itself. Note that other computation rules
Elimination (path induction)
To prove a property for all paths, it suffices to prove it for reflexivity, provided that one endpoint is free.1 Given a motive and a proof for the reflexive case:
the J eliminator constructs a term:
In inference rule form:
Computation
The eliminator reduces on reflexivity:
Properties
- Symmetry: for , there exists .
- Transitivity: for and , there exists .
- Transport: given and , there is a map .
- hLevel: is not necessarily a mere proposition; its complexity depends on the hLevel of .
- Groupoid structure: types form -groupoids where paths are morphisms, higher paths are 2-morphisms, and so on.
Cubical Type Theory
In Cubical Type Theory, the path type is not defined inductively. Instead, a path from to in is a function out of the abstract interval type satisfying face constraints:
Reflexivity is the constant map . Under this definition, path induction is derived from transport and the structure of rather than being axiomatic, and function extensionality and univalence become provable.
Agda
In Agda --cubical, the path type is a primitive distinct from the inductive propositional equality _≡_.
open import Agda.Primitive
_≡_ : {ℓ : Level} {A : Set ℓ} → A → A → Set ℓ
x ≡ y = PathP (λ _ → A) x y
refl : {ℓ : Level} {A : Set ℓ} {x : A} → x ≡ x
refl {x = x} = λ i → xRelated Concepts
References
Footnotes
-
One endpoint must be free because the construction corresponds to showing the singleton type is contractible. With both endpoints fixed, the path space is not generally contractible — consider loops on . ↩