module bool where
import hedberg
+import univalence
data bool = false | true
-
-- Proof that bool is a set using hedberg:
-
-
caseBool (A : U) (f t : A) : bool -> A = split
false -> f
true -> t
setbool' : set bool = hedberg bool boolDec
-
-- Direct proof that bool is a set:
-
lem1 : (y:bool) (p:Id bool true y) -> Id bool true y = split
false -> \ (p : Id bool true false) -> p
true -> \ (p : Id bool true true) -> <i>true
lem4 : (y:bool) (p:Id bool false y) -> Id bool false y = split
false -> \ (p : Id bool false false) -> <i>false
- true -> \ (p : Id bool false true) -> p
+ true -> \ (p : Id bool false true) -> p
lem5 : (x y :bool) (p:Id bool false x) (q:Id bool false y) -> Id bool x y = split
false -> \ (y:bool) (p:Id bool false false) (q:Id bool false y) -> lem4 y q
boolEqF2 : Id U bool F2 =
isoId bool F2 boolToF2 f2ToBool f2ToBoolK boolToF2K
-
+
negF2 : F2 -> F2 = subst U (\(X : U) -> (X -> X)) bool F2 boolEqF2 negBool
-- lemTest (A : U) : (B : U) (p : Id U A B) (a : A) -> IdP p a (transport p a) =
boolEqF2 (refl U bool) boolEqF2 =
<i j> boolEqF2 @ i /\ j
-test5 : IdP boolEqF2 true oneF2 =
+test5 : IdP boolEqF2 true oneF2 =
<i> comp (<j> boolEqF2 @ i /\ j) true []
test6 : Id bool true true =
comp (<i> Id U (boolEqF2 @ i) (boolEqF2 @ i)) (refl U bool) []
p : Id U F2 bool = <i> comp (<_> U) bool [ (i = 0) -> boolEqF2, (i = 1) -> <_> bool]
-q : Id U F2 F2 = <i> p @ (i /\ - i)
\ No newline at end of file
+q : Id U F2 F2 = <i> p @ (i /\ - i)
+
+
+-- A small test of univalence using boolean negation
+isEquivNegBool : isEquiv bool bool negBool =
+ gradLemma bool bool negBool negBool negBoolK negBoolK
+
+eqBool : Id U bool bool =
+ trans (equiv bool bool) (Id U bool bool)
+ (<i> corrUniv bool bool @ -i) (negBool,isEquivNegBool)
+
+testf : bool = trans bool bool eqBool true
+testt : bool = trans bool bool eqBool false
module univalence where
import equiv
--- import bool
------------------------------------------------------------------------------
-- Proof of univalence using unglue:
-- ((x : ((x : bool) * IdP (<j> bool) y (comp (<j> bool) (comp (<i> bool) x []) [ (i = 0) -> <j> comp (<k> bool) x [ (j = 1) -> <k> x ] ]))) * (y0 : ((x0 : bool) * IdP (<j> bool) y (comp (<j> bool) (comp (<i> bool) x0 []) [ (i = 0) -> <j> comp (<k> bool) x0 [ (j = 1) -> <k> x0 ] ]))) -> IdP (<j> ((x0 : bool) * IdP (<k> bool) y (comp (<j> bool) (comp (<i> bool) x0 []) [ (i = 0) -> <j> comp (<k> bool) x0 [ (j = 1) -> <k> x0 ] ]))) x y0)) (\(a : bool) -> ((a,<i> a),\(z : ((x : bool) * IdP (<i> bool) a x)) -> <i> (z.2 @ i,<j> z.2 @ (i /\ j)))) [])) ] ], (i = 1) -> <j> bool ]) [ (i = 0) -> <j> bool, (i = 1) -> <j> bool ]) true []
--- -- A small test of univalence using boolean negation
--- isEquivNegBool : isEquiv bool bool negBool =
--- gradLemma bool bool negBool negBool negBoolK negBoolK
-
--- eqBool : Id U bool bool =
--- trans (equiv bool bool) (Id U bool bool)
--- (<i> corrUniv bool bool @ -i) (negBool,isEquivNegBool)
-
--- test1 : bool = trans bool bool eqBool true
--- test2 : bool = trans bool bool eqBool false
-
-
-
-
-- ------------------------------------------------------------------------------
-- -- The direct proof of univalence using transEquiv which is too slow
-- -- to normalize: