Definition
The path type (or identity type) represents the concept of equality between two terms of the same type. For a type and terms , the path type is denoted (or ). In Homotopy Type Theory, elements of are interpreted as paths from to in the space , rather than mere witnesses of a property.
Rules (Martin-Löf)
We define the type inductively.
Formation
Given and , we have a type .
Introduction
For every , there is a canonical element representing the constant path:
Elimination (Path Induction)
To prove a indexed family for all paths, it suffices to prove it for reflexivity, provided that one endpoint is free 1. Let . Given a proof for reflexivity: We construct a term:
Computation
The eliminator applied to the canonical constructor reduces to the given proof term:
Cubical Type Theory
In Cubical Type Theory, the path type is not defined inductively but as a map from an abstract interval type . Here, is the constant map . Path induction is derived from transport and the structure of the interval, rather than being axiomatic. Functional extensionality and univalence become provable theorems (or definitions) rather than axioms.
Properties
- Symmetry: for .
- Transitivity: for .
- Transport: Given and , we have .
- Groupoid Structure: Types form -groupoids where paths correspond to morphisms.
Agda
In Agda --cubical, the path type is a primitive.
open import Agda.Primitive
-- The path type is distinct from the inductive _≡_
_≡_ : {ℓ : Level} {A : Set ℓ} → A → A → Set ℓ
x ≡ y = PathP (λ _ → A) x y
refl : {ℓ : Level} {A : Set ℓ} {x : A} → x ≡ x
refl {x = x} = λ i → xFootnotes
Footnotes
-
This is needed in HoTT because we are constructing a singleton, which needs to be a contraction for the construction to give a single path output. Without that we can’t say that the path can be reached from refl. Consider . ↩