module Prim.Kan where
Primitive: Kan operationsπ
Using the machinery from the other Prim
modules, we can
define the Kan operations: transport and composition.
private module X where primitive primTransp : β {β} (A : (i : I) β Type (β i)) (Ο : I) (a : A i0) β A i1 primHComp : β {β} {A : Type β} {Ο : I} (u : β i β Partial Ο A) (a : A) β A primComp : β {β} (A : (i : I) β Type (β i)) {Ο : I} (u : β i β Partial Ο (A i)) (a : A i0) β A i1 open X public renaming (primTransp to transp) hcomp : β {β} {A : Type β} (Ο : I) β (u : (i : I) β Partial (Ο β¨ ~ i) A) β A hcomp {A = A} Ο u = X.primHComp sys (u i0 1=1) module hcomp-sys where sys : β j β Partial Ο A sys j (Ο = i1) = u j 1=1 β : I β I β i = i β¨ ~ i comp : β {β : I β Level} (A : (i : I) β Type (β i)) (Ο : I) β (u : (i : I) β Partial (Ο β¨ ~ i) (A i)) β A i1 comp A Ο u = X.primHComp sys (transp (Ξ» i β A i) i0 (u i0 1=1)) module comp-sys where sys : β j β Partial Ο (A i1) sys i (Ο = i1) = transp (Ξ» j β A (i β¨ j)) i (u i 1=1)
We also define the type of dependent paths, and of non-dependent paths.
postulate PathP : β {β} (A : I β Type β) β A i0 β A i1 β Type β {-# BUILTIN PATHP PathP #-} infix 7 _β‘_ _β‘_ : β {β} {A : Type β} β A β A β Type β _β‘_ {A = A} = PathP (Ξ» i β A) {-# BUILTIN PATH _β‘_ #-}
{-# BUILTIN REWRITE _β‘_ #-} caseβ±_of_ : β {β β'} {A : Type β} {B : Type β'} (x : A) β ((y : A) β x β‘ y β B) β B caseβ± x of f = f x (Ξ» i β x) caseβ±_return_of_ : β {β β'} {A : Type β} (x : A) (P : A β Type β') β ((y : A) β x β‘ y β P y) β P x caseβ± x return P of f = f x (Ξ» i β x) {-# INLINE caseβ±_of_ #-} {-# INLINE caseβ±_return_of_ #-} {-# DISPLAY X.primHComp {β} {A} {Ο} (hcomp-sys.sys _ u) _ = hcomp {β} {A} Ο u #-} {-# DISPLAY X.primHComp {_} {_} {Ο} (comp-sys.sys A _ u) _ = comp A Ο u #-}