-- -- for gamma in es'', (i1) gamma is in es, so wsi1 gamma
-- -- is in the domain of isoGamma
-- uls'' = mapWithKey (\gamma eGamma ->
--- gradLemmaU (bi1 `face` gamma) eGamma
+-- isoToEquivU (bi1 `face` gamma) eGamma
-- ((usi1' `face` gamma) `unionSystem` (wsi1 `face` gamma))
-- (vi1' `face` gamma))
-- es''
-- else fst (uls'' ! gamma))
-- esI1
--- Grad Lemma, takes a line eq in U, a system us and a value v, s.t. f us =
+-- IsoToEquiv, takes a line eq in U, a system us and a value v, s.t. f us =
-- border v. Outputs (u,p) s.t. border u = us and a path p between v
-- and f u, where f is transNegLine eq
--- gradLemmaU :: Val -> Val -> System Val -> Val -> (Val, Val)
--- gradLemmaU b eq us v = (u, VPLam i theta)
+-- isoToEquivU :: Val -> Val -> System Val -> Val -> (Val, Val)
+-- isoToEquivU b eq us v = (u, VPLam i theta)
-- where i:j:_ = freshs (b,eq,us,v)
-- ej = eq @@ j
-- a = eq @@ One
-- theta = compNeg j ej u xs
-- Old version:
--- gradLemmaU :: Val -> Val -> System Val -> Val -> (Val, Val)
--- gradLemmaU b eq us v = (u, VPLam i theta'')
+-- isoToEquivU :: Val -> Val -> System Val -> Val -> (Val, Val)
+-- isoToEquivU b eq us v = (u, VPLam i theta'')
-- where i:j:_ = freshs (b,eq,us,v)
-- a = eq @@ One
-- g = transLine
-- negBool is hence and equivalence:
negBoolEquiv : equiv bool bool =
- (negBool,gradLemma bool bool negBool negBool negBoolK negBoolK)
+ (negBool,isoToEquiv bool bool negBool negBool negBoolK negBoolK)
-- This defines a non-trivial equality between bool and bool:
negBoolEq : Path U bool bool =
-- A small test of univalence using boolean negation
isEquivNegBool : isEquiv bool bool negBool =
- gradLemma bool bool negBool negBool negBoolK negBoolK
+ isoToEquiv bool bool negBool negBool negBoolK negBoolK
eqBool : Path U bool bool =
trans (equiv bool bool) (Path U bool bool)
opaque isContrProp
equivProp (A B : U) (AProp : prop A) (BProp : prop B) (F : A -> B) (G : B -> A) : equiv A B =
- (F, gradLemma A B F G (\(y : B) -> BProp (F (G y)) y) (\(x : A) -> AProp (G (F x)) x))
+ (F, isoToEquiv A B F G (\(y : B) -> BProp (F (G y)) y) (\(x : A) -> AProp (G (F x)) x))
opaque equivProp
idProp (A B : U) (AProp : prop A) (BProp : prop B) (F : A -> B) (G : B -> A) : Path U A B
idIso (C : precategory) (A : cA C) : iso C A A = (cPath C A, cPath C A, cPathL C A A (cPath C A), cPathL C A A (cPath C A))
invIsoEquiv (C : precategory) (A B : cA C) : isEquiv (iso C A B) (iso C B A) (invIso C A B)
- = gradLemma (iso C A B) (iso C B A) (invIso C A B) (invIso C B A) (\(x : iso C B A) -> <_> x) (\(x : iso C A B) -> <_> x)
+ = isoToEquiv (iso C A B) (iso C B A) (invIso C A B) (invIso C B A) (\(x : iso C B A) -> <_> x) (\(x : iso C A B) -> <_> x)
invIsoEq (C : precategory) (A B : cA C) : Path U (iso C A B) (iso C B A)
= equivPath (iso C A B) (iso C B A) (invIso C A B) (invIsoEquiv C A B)
(e:equiv A A')
(f:(x:A)->equiv (B x) (B' (e.1 x)))
: equiv (Sigma A B) (Sigma A' B')
- = (F, gradLemma (Sigma A B) (Sigma A' B') F G FG GF)
+ = (F, isoToEquiv (Sigma A B) (Sigma A' B') F G FG GF)
where
F (x:Sigma A B):Sigma A' B' = (e.1 x.1, (f x.1).1 x.2)
G (x:Sigma A' B'):Sigma A B = ((e.2 x.1).1.1, ((f (e.2 x.1).1.1).2 (transport (<i> B' ((e.2 x.1).1.2 @ i)) x.2)).1.1)
(sigEquivLem (catIso311 A B e1) (catIso321 A B e1)
(\(e2 : catIso311 A B e1) -> (_ : catIso312 A B e1 e2) * ( catIso313 A B e1 e2))
(\(e2 : catIso321 A B e1) -> (_ : catIso322 A B e1 e2) * ( catIso323 A B e1 e2))
- (F, gradLemma (catIso311 A B e1) (catIso321 A B e1)
+ (F, isoToEquiv (catIso311 A B e1) (catIso321 A B e1)
F (\(e2:catIso321 A B e1)-><i>\(x y:cA A)->(e2 x y)@i)
(\(e2:catIso321 A B e1)-><_>e2) (\(e2:catIso311 A B e1)-><_>e2))
(\(e2:catIso311 A B e1)->
(\(_ : catIso312 A B e1 e2) -> (catIso313 A B e1 e2))
(\(_ : catIso322 A B e1 (F e2)) -> (catIso323 A B e1 (F e2)))
(let F2(e:catIso312 A B e1 e2):catIso322 A B e1 (F e2)=\(x:cA A)-><i>(e@i)x in
- (F2, gradLemma (catIso312 A B e1 e2) (catIso322 A B e1 (F e2))
+ (F2, isoToEquiv (catIso312 A B e1 e2) (catIso322 A B e1 (F e2))
F2 (\(e:catIso322 A B e1 (F e2))-><i>\(x:cA A)->(e x)@i)
(\(e:catIso322 A B e1 (F e2))-><_>e) (\(e:catIso312 A B e1 e2)-><_>e)))
(\(_:catIso312 A B e1 e2)->
(let F3(e:catIso313 A B e1 e2):catIso323 A B e1 (F e2)=\(x y z:cA A)(f:cH A x y)(g:cH A y z)-><i>(e@i)x y z f g in
- (F3, gradLemma (catIso313 A B e1 e2) (catIso323 A B e1 (F e2))
+ (F3, isoToEquiv (catIso313 A B e1 e2) (catIso323 A B e1 (F e2))
F3 (\(e:catIso323 A B e1 (F e2))-><i>\(x y z:cA A)(f:cH A x y)(g:cH A y z)->(e x y z f g)@i)
(\(e:catIso323 A B e1 (F e2))-><_>e) (\(e:catIso313 A B e1 e2)-><_>e))
)))))) @ i
eCatIso (A B : precategory) : Path U (catIso A B) (catIso2 A B)
= transEquivToPath (catIso A B) (catIso2 A B)
- (F, gradLemma (catIso A B) (catIso2 A B) F G (\(e:catIso2 A B)-><_>e) (\(e:catIso A B)-><_>e))
+ (F, isoToEquiv (catIso A B) (catIso2 A B) F G (\(e:catIso2 A B)-><_>e) (\(e:catIso A B)-><_>e))
where
F(e:catIso A B):catIso2 A B=((e.1.1, e.2.2),\(x y:cA A)->(e.1.2.1 x y, e.2.1 x y),e.1.2.2.1,e.1.2.2.2)
G(e:catIso2 A B):catIso A B=((e.1.1,\(x y:cA A)->(e.2.1 x y).1,e.2.2.1,e.2.2.2),\(x y:cA A)->(e.2.1 x y).2,e.1.2)
(cC B (transport e1 x) (transport e1 y) (transport e1 z) ((e2 x y).1 f) ((e2 y z).1 g))
equivPi (A:U) (B0 B1:A->U) (e:(a:A)->equiv (B0 a) (B1 a)) : equiv ((a:A)->B0 a) ((a:A)->B1 a)
- = (F, gradLemma ((a:A)->B0 a) ((a:A)->B1 a)
+ = (F, isoToEquiv ((a:A)->B0 a) ((a:A)->B1 a)
F (\(g:(a:A)->B1 a)(a:A)->((e a).2 (g a)).1.1)
(\(g:(a:A)->B1 a)-><i>\(a:A)->retEq (B0 a) (B1 a) (e a) (g a)@i)
(\(f:(a:A)->B0 a)-><i>\(a:A)->secEq (B0 a) (B1 a) (e a) (f a)@i)
= (e.1,\(b:cA B)->((e.2 b).1.1, eqToIso B (F.1 (e.2 b).1.1) b (<i>(e.2 b).1.2@-i)))
invEquiv (A:U) (a b:A) : Path U (Path A a b) (Path A b a)
- = equivPath (Path A a b) (Path A b a) (inv A a b) (gradLemma (Path A a b) (Path A b a) (inv A a b) (inv A b a) (\(x:Path A b a) -> <_> x) (\(x:Path A a b) -> <_> x))
+ = equivPath (Path A a b) (Path A b a) (inv A a b) (isoToEquiv (Path A a b) (Path A b a) (inv A a b) (inv A b a) (\(x:Path A b a) -> <_> x) (\(x:Path A a b) -> <_> x))
catEquivIsIso (A B : precategory) (isCA : isCategory A) (isCB : isCategory B) (F : functor A B) (e : catIsEquiv A B F)
: catIsIso A B F
(transport (<i> isContr ((a:cA A)*lemIsCategory3 B isCB (F.1 a) b@-i)) p))
equivProp (A B : U) (AProp : prop A) (BProp : prop B) (F : A -> B) (G : B -> A) : equiv A B =
- (F, gradLemma A B F G (\(y : B) -> BProp (F (G y)) y) (\(x : A) -> AProp (G (F x)) x))
+ (F, isoToEquiv A B F G (\(y : B) -> BProp (F (G y)) y) (\(x : A) -> AProp (G (F x)) x))
catIsEquivEqIso (A B : precategory) (isCA : isCategory A) (isCB : isCategory B) (F : functor A B)
: equiv (catIsEquiv A B F) (catIsIso A B F)
-- This file contains the definition of equivalences and various
--- results on these, including the "graduate lemma".
+-- results on these
module equiv where
import prelude
(<i>transPathFun A B w@-i)
--- The grad lemma
+-- The iso to equiv
lemIso (A B : U) (f : A -> B) (g : B -> A)
(s : (y : B) -> Path B (f (g y)) y)
, (j = 1) -> s (f (p @ i))
, (j = 0) -> s y ]
-gradLemma (A B : U) (f : A -> B) (g : B -> A)
+isoToEquiv (A B : U) (f : A -> B) (g : B -> A)
(s : (y : B) -> Path B (f (g y)) y)
(t : (x : A) -> Path A (g (f x)) x) : isEquiv A B f =
\(y:B) -> ((g y,<i>s y@-i),\ (z:fiber A B f y) ->
isoPath (A B : U) (f : A -> B) (g : B -> A)
(s : (y : B) -> Path B (f (g y)) y)
(t : (x : A) -> Path A (g (f x)) x) : Path U A B =
- <i> Glue B [ (i = 0) -> (A,f,gradLemma A B f g s t)
+ <i> Glue B [ (i = 0) -> (A,f,isoToEquiv A B f g s t)
, (i = 1) -> (B,idfun B,idIsEquiv B) ]
-idIsEquivGrad (A : U) : isEquiv A A (idfun A) =
- gradLemma A A (idfun A) (idfun A) (\(a : A) -> <i> a) (\(a : A) -> <i> a)
+idIsEquivIsoToEquiv (A : U) : isEquiv A A (idfun A) =
+ isoToEquiv A A (idfun A) (idfun A) (\(a : A) -> <i> a) (\(a : A) -> <i> a)
PathIdPath (A B : U) : Path U (Id U A B) (Path U A B) =
equivPath (Id U A B) (Path U A B) (idToPath U A B) rem
where rem : isEquiv (Id U A B) (Path U A B) (idToPath U A B) =
- gradLemma (Id U A B) (Path U A B) (idToPath U A B) (pathToId U A B)
+ isoToEquiv (Id U A B) (Path U A B) (idToPath U A B) (pathToId U A B)
(\(p : Path U A B) -> <i> pathToIdToPath U A B p @ - i)
(\(p : Id U A B) -> <i> idToPathToId U A B p @ - i)
P (X : U) (h: X -> B) : U
= (p : Path U X B) * (PathP (<i> p @ i -> A) (\ (x : X) -> f' (g (h x))) f)
q : P B' g'
- = elimEquiv B P (<i> B, <i> f) B' (g', gradLemma B' B g' g s t)
+ = elimEquiv B P (<i> B, <i> f) B' (g', isoToEquiv B' B g' g s t)
idB : Path U B' B
= q.1
-- Show that sB can be identified with sB'
\r
isEquivComp (A B C : U) (F : A -> B) (G : B -> C) (ef : isEquiv A B F) (eg : isEquiv B C G)\r
: isEquiv A C (\(x : A) -> G (F x))\r
- = gradLemma A C (\(x : A) -> G (F x)) (\(x : C) -> (ef (eg x).1.1).1.1)\r
+ = isoToEquiv A C (\(x : A) -> G (F x)) (\(x : C) -> (ef (eg x).1.1).1.1)\r
(\(x : C) -> compPath C (G (F (ef (eg x).1.1).1.1)) (G (eg x).1.1) x\r
(<i> G (retEq A B (F, ef) (eg x).1.1 @ i)) (retEq B C (G, eg) x))\r
(\(x : A) -> compPath A ((ef (eg (G (F x))).1.1).1.1) (ef (F x)).1.1 x\r
\r
isEquivComp' (A B C : U) (F : A -> B) (G : C -> B) (ef : isEquiv A B F) (eg : isEquiv C B G)\r
: isEquiv A C (\(x : A) -> (eg (F x)).1.1)\r
- = gradLemma A C (\(x : A) -> (eg (F x)).1.1) (\(x : C) -> (ef (G x)).1.1)\r
+ = isoToEquiv A C (\(x : A) -> (eg (F x)).1.1) (\(x : C) -> (ef (G x)).1.1)\r
(\(x : C) -> compPath C (eg (F (ef (G x)).1.1)).1.1 (eg (G x)).1.1 x\r
(<i> (eg (retEq A B (F, ef) (G x) @ i)).1.1) (secEq C B (G, eg) x))\r
(\(x : A) -> compPath A ((ef (G (eg (F x)).1.1)).1.1) (ef (F x)).1.1 x\r
(lemPathPSet A B ASet p1)\r
\r
\r
-isEquivPath (A : U) : isEquiv A A (\(x : A) -> x) = gradLemma A A (\(x : A) -> x) (\(x : A) -> x) (\(x : A) -> <_> x) (\(x : A) -> <_> x)\r
+isEquivPath (A : U) : isEquiv A A (\(x : A) -> x) = isoToEquiv A A (\(x : A) -> x) (\(x : A) -> x) (\(x : A) -> <_> x) (\(x : A) -> <_> x)\r
\r
lem10 (A B : U) (e : equiv A B) (x y : B) (p : Path A (e.2 x).1.1 (e.2 y).1.1) : Path B x y\r
= transport\r
isoPath A B F G (\(y : B) -> BProp (F (G y)) y) (\(x : A) -> AProp (G (F x)) x)\r
\r
equivProp (A B : U) (AProp : prop A) (BProp : prop B) (F : A -> B) (G : B -> A) : equiv A B =\r
- (F, gradLemma A B F G (\(y : B) -> BProp (F (G y)) y) (\(x : A) -> AProp (G (F x)) x))\r
+ (F, isoToEquiv A B F G (\(y : B) -> BProp (F (G y)) y) (\(x : A) -> AProp (G (F x)) x))\r
\r
isContrProp (A : U) (p : isContr A) (x y : A) : Path A x y = compPath A x p.1 y (<i> p.2 x @ -i) (p.2 y)\r
\r
hole : isContr ((y : A) * Path B (F x) (F y)) = transport (<i> isContr (hole4@i)) (lem2 A x)\r
\r
contrEquiv (A B : U) (aC : isContr A) (bC : isContr B) : equiv A B\r
- = (\(_ : A) -> bC.1, gradLemma A B (\(_ : A) -> bC.1) (\(_ : B) -> aC.1) (\(x : B) -> bC.2 x) (\(x : A) -> aC.2 x))\r
+ = (\(_ : A) -> bC.1, isoToEquiv A B (\(_ : A) -> bC.1) (\(_ : B) -> aC.1) (\(x : B) -> bC.2 x) (\(x : A) -> aC.2 x))\r
\r
F21 (A B : U) (F : A -> B) (p2 : P2 A B F) (x y : A) : isEquiv (Path A x y) (Path B (F x) (F y)) (mapOnPath A B F x y) = hole3 y\r
where\r
AEquiv BEquiv (<i> BZEquiv (q2@i)) (<i> BZEquiv (q@i))\r
hole : Path (Path BZ BA BB) q2 q = <j i> (p@i, (pNE@j@i, (pShift@j@i, pEquiv@j@i)))\r
hole : equiv ((p : Path U (BZSet BA) (BZSet BB)) * PathP (<i> p@i -> p@i) (BZS BA) (BZS BB)) (Path BZ BA BB)\r
- = (F, gradLemma ((p : Path U (BZSet BA) (BZSet BB)) * PathP (<i> p@i -> p@i) (BZS BA) (BZS BB)) (Path BZ BA BB) F G FG GF)\r
+ = (F, isoToEquiv ((p : Path U (BZSet BA) (BZSet BB)) * PathP (<i> p@i -> p@i) (BZS BA) (BZS BB)) (Path BZ BA BB) F G FG GF)\r
\r
lem2 (A : U) (shift : equiv A A) (a : A) : (x : Z) -> Path A (shift.1 (action A shift a x)) (action A shift a (sucZ x)) = split\r
inl n -> lem2Aux n\r
\r
ZBZ : BZ = (Z, (hinhpr Z zeroZ, (ZShift, ZEquiv)))\r
where\r
- ZShift : equiv Z Z = (sucZ, gradLemma Z Z sucZ predZ sucpredZ predsucZ)\r
+ ZShift : equiv Z Z = (sucZ, isoToEquiv Z Z sucZ predZ sucpredZ predsucZ)\r
plus : Z -> Z -> Z = action Z ZShift\r
plusCommZero : (y : Z) -> Path Z (plus zeroZ y) (plus y zeroZ) = split\r
inl u -> hole u\r
where\r
SHIFT : isEquiv A.1.1 A.1.1 A.1.2\r
= A.2 (isEquiv A.1.1 A.1.1 A.1.2, propIsEquiv A.1.1 A.1.1 A.1.2)\r
- (\(a : Path AA A.1 (Z, sucZ)) -> transport (<i> isEquiv (a@-i).1 (a@-i).1 (a@-i).2) (gradLemma Z Z sucZ predZ sucpredZ predsucZ))\r
- ZEquiv : (x : Z) -> isEquiv Z Z (action Z (sucZ, gradLemma Z Z sucZ predZ sucpredZ predsucZ) x) = BZEquiv ZBZ\r
+ (\(a : Path AA A.1 (Z, sucZ)) -> transport (<i> isEquiv (a@-i).1 (a@-i).1 (a@-i).2) (isoToEquiv Z Z sucZ predZ sucpredZ predsucZ))\r
+ ZEquiv : (x : Z) -> isEquiv Z Z (action Z (sucZ, isoToEquiv Z Z sucZ predZ sucpredZ predsucZ) x) = BZEquiv ZBZ\r
hole (a : Path AA A.1 (Z, sucZ))\r
- : PathP (<i> isEquiv (a@-i).1 (a@-i).1 (a@-i).2) (gradLemma Z Z sucZ predZ sucpredZ predsucZ) SHIFT\r
+ : PathP (<i> isEquiv (a@-i).1 (a@-i).1 (a@-i).2) (isoToEquiv Z Z sucZ predZ sucpredZ predsucZ) SHIFT\r
= lemPathPProp (isEquiv Z Z sucZ) (isEquiv A.1.1 A.1.1 A.1.2) (propIsEquiv Z Z sucZ)\r
- (<i> isEquiv (a@-i).1 (a@-i).1 (a@-i).2) (gradLemma Z Z sucZ predZ sucpredZ predsucZ) SHIFT\r
+ (<i> isEquiv (a@-i).1 (a@-i).1 (a@-i).2) (isoToEquiv Z Z sucZ predZ sucpredZ predsucZ) SHIFT\r
ZEquivEq (a : Path AA A.1 (Z, sucZ))\r
- : Path U ((x : Z) -> isEquiv Z Z (action Z (sucZ, gradLemma Z Z sucZ predZ sucpredZ predsucZ) x))\r
+ : Path U ((x : Z) -> isEquiv Z Z (action Z (sucZ, isoToEquiv Z Z sucZ predZ sucpredZ predsucZ) x))\r
((x : A.1.1) -> isEquiv Z A.1.1 (action A.1.1 (A.1.2, SHIFT) x))\r
= <i> (x : (a@-i).1) -> isEquiv Z (a@-i).1 (action (a@-i).1 ((a@-i).2, hole a @ i) x)\r
EQUIV : (x : A.1.1) -> isEquiv Z A.1.1 (action A.1.1 (A.1.2, SHIFT) x)\r
opaque FG\r
GF (A B : BZ) (x : (Path BZ A B)) : Path (Path BZ A B) (G A B (F A B x)) x = lemCompInv BZ A B B x (loopA B)\r
opaque GF\r
- TShift (A B : BZ) : equiv (Path BZ A B) (Path BZ A B) = (F A B, gradLemma (Path BZ A B) (Path BZ A B) (F A B) (G A B) (FG A B) (GF A B))\r
+ TShift (A B : BZ) : equiv (Path BZ A B) (Path BZ A B) = (F A B, isoToEquiv (Path BZ A B) (Path BZ A B) (F A B) (G A B) (FG A B) (GF A B))\r
hole : (y : Z) -> Path (Path BZ ZBZ ZBZ) (action (Path BZ ZBZ ZBZ) (TShift ZBZ ZBZ) (<_> ZBZ) y) (decodeZ ZBZ y) = split\r
inl u -> hole0 u\r
where hole0 : (n : nat) -> Path (Path BZ ZBZ ZBZ) (action (Path BZ ZBZ ZBZ) (TShift ZBZ ZBZ) (<_> ZBZ) (inl n)) (decodeZ ZBZ (inl n)) = split\r
(decodeLoop (inr n))\r
transparent decodeZ\r
TEquiv''' : isEquiv Z (Path BZ ZBZ ZBZ) (action (Path BZ ZBZ ZBZ) (TShift ZBZ ZBZ) (<_> ZBZ))\r
- = transport (<i> isEquiv Z loopBZ (\(y : Z) -> hole y @ -i)) (gradLemma Z loopBZ (decodeZ ZBZ) (encodeZ ZBZ) (decodeEncodeZ ZBZ) (encodeDecodeZ ZBZ))\r
+ = transport (<i> isEquiv Z loopBZ (\(y : Z) -> hole y @ -i)) (isoToEquiv Z loopBZ (decodeZ ZBZ) (encodeZ ZBZ) (decodeEncodeZ ZBZ) (encodeDecodeZ ZBZ))\r
TEquiv'' (b : BZSet B) (x : Path BZ ZBZ B) : isEquiv Z (Path BZ ZBZ B) (action (Path BZ ZBZ B) (TShift ZBZ B) x)\r
= J BZ ZBZ (\(B : BZ) -> \(x : Path BZ ZBZ B) -> isEquiv Z (Path BZ ZBZ B) (action (Path BZ ZBZ B) (TShift ZBZ B) x))\r
TEquiv''' B x\r
-- transEquiv is an equiv
transEquivIsEquiv (A B : U)
: isEquiv (Path U A B) (equiv A B) (transEquiv A B)
- = gradLemma (Path U A B) (equiv A B) (transEquiv A B)
+ = isoToEquiv (Path U A B) (equiv A B) (transEquiv A B)
(transEquivToPath A B) (idToPath A B) (eqToEq A B)
-- Univalence proved using transEquiv.
substInv (B -> B) (Q B (idfun B)) g (idfun B) (<i> \(b : B) -> (sg b) @ i) h1
rem1 (A : U) (f : A -> B) : P A f = \(g : B -> A) (sg : section A B f g) (rg : retract A B f g) ->
- elimEquiv B P rem A (f,gradLemma A B f g sg rg) g sg rg
+ elimEquiv B P rem A (f,isoToEquiv A B f g sg rg) g sg rg
elimIsIso (A : U) (Q : (B : U) -> (A -> B) -> (B -> A) -> U)
(d : Q A (idfun A) (idfun A)) (B : U) (f : A -> B) (g : B -> A)
--- This file contains a proof of the graduate lemma using the old
--- version of equivalence
-module gradLemma where
+-- This file contains a proof of the isoToId using the old version of
+-- equivalence
+module isoToEquiv where
import equiv
--- Gradlemma:
-
lemIso (A B : U) (f : A -> B) (g : B -> A)
(s : (y : B) -> Id B (f (g y)) y)
(t : (x : A) -> Id A (g (f x)) x)
, (j = 0) -> s (f (p @ i))
, (j = 1) -> s y ]
-gradLemma (A B : U) (f : A -> B) (g : B -> A)
+isoToEquiv (A B : U) (f : A -> B) (g : B -> A)
(s : (y : B) -> Id B (f (g y)) y)
(t : (x : A) -> Id A (g (f x)) x) : isEquiv A B f = (fCenter,fIsCenter)
where
module testall where
-import gradLemma
import interval
import uafunext2
import prop
-- The old version of univalence using the old definition of equivalences
module univalence where
-import gradLemma
+import isoToEquiv
transEquivToId (A B : U) (w : equiv A B) : Id U A B =
<i> glue B [ (i = 1) -> (B,eB)
transEquivIsEquiv (A B : U)
: isEquiv (Id U A B) (equiv A B) (transEquiv A B)
- = gradLemma (Id U A B) (equiv A B) (transEquiv A B)
+ = isoToEquiv (Id U A B) (equiv A B) (transEquiv A B)
(transEquivToId A B) (idToId A B) (eqToEq A B)
univalence (A B : U) : equiv (Id U A B) (equiv A B) =
(isEquiv (Id U A B) (equiv A B))
(canIdToEquiv A B) (transEquiv A B)
(canIdToEquivIsTransEquiv A B)
- (transEquivIsEquiv A B)
\ No newline at end of file
+ (transEquivIsEquiv A B)
\(u0 u1 : isEquiv A B f) ->
<i> \(y : B) -> isPropIsContr (fiber A B f y) (u0 y) (u1 y) @ i
--- The "grad lemma": any isomorphism is an equivalence
-gradLemma (A B : U) (f : A -> B) (g : B -> A)
+-- The "isoToEquiv": any isomorphism is an equivalence
+isoToEquiv (A B : U) (f : A -> B) (g : B -> A)
(s : (y : B) -> Path B (f (g y)) y)
(t : (x : A) -> Path A (g (f x)) x) : isEquiv A B f =
\(y:B) -> ((g y,<i>s y@-i),\ (z:fiber A B f y) ->
-- recall: notK : (b : bool) -> Path bool (not (not b)) b = ...
notEquiv : equiv bool bool =
- (not,gradLemma bool bool not not notK notK)
+ (not,isoToEquiv bool bool not not notK notK)
-- Construct an equality in the universe using Glue
notEq : Path U bool bool =
inr v -> <i> inr v
sucPathZ : Path U Z Z =
- <i> Glue Z [ (i = 0) -> (Z,sucZ,gradLemma Z Z sucZ predZ sucpredZ predsucZ)
+ <i> Glue Z [ (i = 0) -> (Z,sucZ,isoToEquiv Z Z sucZ predZ sucpredZ predsucZ)
, (i = 1) -> (Z,idEquiv Z) ]
-- We can transport along the proof forward and backwards: