Path induction

In homotopy type theory, path induction refers to the induction principle of identity types x≑Ay. Informally, path induction declares that, to prove that some proposition holds for x≑Ay, it suffices to consider the reflexivity case refl:x≑Ax.

Path induction is one of the most subtle aspects of HoTT, and is key to understanding the differences between HoTT's paths and inductively-defined identity types.Inductively-defined identity types are the usual equality types used in Idris and (non-cubical) Agda: a simple data type _≑_ : (x y : A) β†’ Type with a single constructor refl : x ≑ x. "A single constructor" is the most important detail here. Inductively-defined identity types are trivial singletons. One inhabitant. Zero complex structure. This is completely opposite to path types, which are not inductively-defined (they are taken as primitive) and possess rich structure relating the identified types. Two arbitrary identifications p,q:x≑y are not necessarily the same in HoTT (i.e. UIP does not hold). [cite:@hottbook]

Statement

Given a family D:∏a,aβ€²:Aa≑a′→𝒰 and a dependent function d:∏a:ADaarefl, path induction gives us a dependent function f:∏(a,aβ€²:A)∏(p:a≑aβ€²)Daaβ€²p defined by the equation faarefl≔da.

Path induction has an equivalent formation that is occasionally convenient, called based path induction.[cite:@hottbook] This is the variant used in Agda's cubical library:

Fix an element a:A, and suppose a family C:∏x:A(a≑Ax)→𝒰, and an element c:Carefla. We then obtain a function f:∏(x:a)∏(p:a≑x)Cxp defined by the equation farefla:=c.

Traditionally, (based) path induction is packaged up as a single function and called J.[cite:@hottbook]

Corollaries

Many important properties of paths follow from path induction, including invertibility and concatenation:Or, the language of relations, symmetry and transitivity.

  private variable
    β„“ β„“' β„“'' : Level

  module _ {A : Type β„“}
           (C : (a a' : A) β†’ a ≑ a' β†’ Type β„“')
           (c : βˆ€ a β†’ C a a refl)
           where

    ≑-ind : βˆ€ a a' p β†’ C a a' p
    ≑-ind a a' p = J (C a) (c a) p
    
    ≑-ind-refl : βˆ€ a β†’ ≑-ind a a refl ≑ c a
    ≑-ind-refl a = JRefl (Ξ» y z β†’ y) (c a)

  inv : {A : Type β„“} {x y : A} β†’ x ≑ y β†’ y ≑ x
  inv = ≑-ind D d _ _ where

    D : βˆ€ x y β†’ x ≑ y β†’ Type _
    D x y _ = y ≑ x

    d : βˆ€ x β†’ D x x refl
    d x = refl

  -- ≑-concatΛ‘ refl p ≑ p follows from ≑-ind-refl.
  ≑-concatΛ‘ : {x y z : A} β†’ x ≑ y β†’ y ≑ z β†’ x ≑ z
  ≑-concatΛ‘ {A = A} = Ξ» p q β†’ ≑-ind D d _ _ p _ q where

    D : (x y : A) β†’ x ≑ y β†’ Type _
    D x y _ = βˆ€ z β†’ y ≑ z β†’ x ≑ z

    d : βˆ€ x β†’ D x x refl
    -- βˆ€ x z β†’ x ≑ z β†’ x ≑ z
    d x z p = p

  -- ≑-concatΚ³ p refl ≑ p follows from ≑-ind-refl.
  ≑-concatΚ³ : {x y z : A} β†’ x ≑ y β†’ y ≑ z β†’ x ≑ z
  ≑-concatΚ³ {A = A} = Ξ» p q β†’ ≑-ind D d _ _ q _ p where

    D : (y z : A) β†’ y ≑ z β†’ Type _
    D y z _ = βˆ€ x β†’ x ≑ y β†’ x ≑ z

    d : βˆ€ y β†’ D y y refl
    -- βˆ€ y x β†’ x ≑ y β†’ x ≑ y
    d x z p = p

References