Prototype, extremely bad code implementation of CCHM Cubical Type Theory
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

52 lines
1.7 KiB

{- let
sym : (A : Type) (x y : A) -> Path (\x -> A) x y -> Path (\x -> A) y x
= λ A x y p i -> p (~ i)
in let
funext : (A : Type) (B : A -> Type) (f g : (x : A) -> B x) -> ((x : A) -> Path (\i -> B x) (f x) (g x)) -> Path (\i -> (x : A) -> B x) f g
= λ A B f g h i x -> h x i
in let
i0IsI1 : Path (\x -> I) i0 i1
= λ i -> i
in let
singContr : (A : Type) (a b : A) (p : Path (\j -> A) a b) -> Path (\i -> (x : A) * (Path (\j -> A) a x)) (a, \i -> a) (b, p)
= λ A a b p i -> (p i, λ j -> p (i && j))
in -} let
transport : (A : I -> Type) (a : A i0) -> A i1
= \A a -> comp A i0 (\i -> []) a
in {- let
Jay : (A : Type) (x : A)
(P : (y : A) -> Path (\i -> A) x y -> Type)
(d : P x (\i -> x))
(y : A) (p : Path (\i -> A) x y)
-> P y p
= \A x P d y p -> transport (\i -> P (p i) (\j -> p (i && j))) d
in -}
let
fill : (i : I) (A : I -> Type)
(phi : I) (u : (i : I) -> Partial phi (A i))
-> Sub (A i0) phi (u i0) -> A i
= \i A phi u a0 ->
comp (\j -> A (i && j)) (phi || ~i) (\j -> [ phi -> u (i && j), ~i -> a0 ]) a0
in let
trans : (A : Type) (a b c : A)
-> Path (\i -> A) a b
-> Path (\i -> A) b c
-> Path (\i -> A) a c
= \A a b c p q i ->
comp (\j -> A) (i || ~i)
(\j -> [ ~i -> a, i -> q j ])
(p i)
in let
elimI : (P : I -> Type)
(a : P i0)
(b : P i1)
-> Path P a b
-> (i : I) -> P i
= \P a b p i -> p i
in let
contrI : (i : I) -> Path (\i -> I) i0 i
= \i -> elimI (\x -> Path (\i -> I) i0 x) (\i -> i0) (\i -> i) (\i j -> i && j) i
in let
IisContr : (i : I) * ((j : I) -> Path (\i -> I) i j)
= (i0, contrI)
in IisContr