basiclib/basic.ktt
Paths: reflexivity, symmetry, concatenation, transport, J, function extensionality.
1-- Basic path algebra
10 \i -> f (p i)
13 \i x -> h x i
16 \i -> hcomp j A [i = 0 -> a, i = 1 -> q j] (p i)
21 \i -> p
23-- contractibility of singletons
27 \i -> (p i, \j -> p (i /\ j))
29✓def J {A : U} {a : A} (C : (x : A) -> Path A a x -> U) (d : C a (refl a)) {x : A} (p : Path A a x) : C x p :=
30 transport (\i -> C (contrSingl p i).1 (contrSingl p i).2) d
39-- transport along refl is the identity, up to a path
41 \i -> comp j A [i = 1 -> x] x
47-- the right unit law for path composition
49 \j i -> hcomp k A [i = 0 -> a, i = 1 -> b, j = 0 -> p i] (p i)
52 \j i -> hcomp k A [i = 0 -> a, i = 1 -> p k, j = 0 -> p (i /\ k)] a
57-- paths in Σ-types
59 (p : Path A u.1 v.1) (q : PathP (\i -> B (p i)) u.2 v.2) : Path ((x : A) × B x) u v :=
60 \i -> (p i, q i)
62-- dependent function extensionality
63✓def funextDep {A : U} {B : A -> U} {f g : (x : A) -> B x} (h : (x : A) -> Path (B x) (f x) (g x))
64 : Path ((x : A) -> B x) f g :=
65 \i x -> h x i