|
@ -505,67 +505,65 @@ Iso A B = (f : A -> B) * isIso f |
|
|
-- https://github.com/mortberg/cubicaltt/blob/master/experiments/isoToEquiv.ctt#L7-L55 |
|
|
-- https://github.com/mortberg/cubicaltt/blob/master/experiments/isoToEquiv.ctt#L7-L55 |
|
|
|
|
|
|
|
|
IsoToEquiv : {A : Type} {B : Type} -> Iso A B -> Equiv A B |
|
|
IsoToEquiv : {A : Type} {B : Type} -> Iso A B -> Equiv A B |
|
|
IsoToEquiv {A} {B} iso = |
|
|
|
|
|
let |
|
|
|
|
|
f = iso.1 |
|
|
|
|
|
g = iso.2.1 |
|
|
|
|
|
s = iso.2.2.1 |
|
|
|
|
|
t = iso.2.2.2 |
|
|
|
|
|
|
|
|
|
|
|
lemIso : (y : B) (x0 : A) (x1 : A) (p0 : Path (f x0) y) (p1 : Path (f x1) y) |
|
|
|
|
|
-> PathP (\i -> fiber f y) (x0, p0) (x1, p1) |
|
|
|
|
|
lemIso y x0 x1 p0 p1 = |
|
|
|
|
|
let |
|
|
|
|
|
rem0 : Path x0 (g y) |
|
|
|
|
|
rem0 i = comp (\i -> A) (\k [ (i = i0) -> t x0 k, (i = i1) -> g y ]) (inS (g (p0 i))) |
|
|
|
|
|
|
|
|
|
|
|
rem1 : Path x1 (g y) |
|
|
|
|
|
rem1 i = comp (\i -> A) (\k [ (i = i0) -> t x1 k, (i = i1) -> g y ]) (inS (g (p1 i))) |
|
|
|
|
|
|
|
|
|
|
|
p : Path x0 x1 |
|
|
|
|
|
p i = comp (\i -> A) (\k [ (i = i0) -> rem0 (inot k), (i = i1) -> rem1 (inot k) ]) (inS (g y)) |
|
|
|
|
|
|
|
|
|
|
|
fill0 : I -> I -> A |
|
|
|
|
|
fill0 i j = comp (\i -> A) (\k [ (i = i0) -> t x0 (iand j k) |
|
|
|
|
|
, (i = i1) -> g y |
|
|
|
|
|
, (j = i0) -> g (p0 i) |
|
|
|
|
|
]) |
|
|
|
|
|
(inS (g (p0 i))) |
|
|
|
|
|
|
|
|
|
|
|
fill1 : I -> I -> A |
|
|
|
|
|
fill1 i j = comp (\i -> A) (\k [ (i = i0) -> t x1 (iand j k) |
|
|
|
|
|
, (i = i1) -> g y |
|
|
|
|
|
, (j = i0) -> g (p1 i) ]) |
|
|
|
|
|
(inS (g (p1 i))) |
|
|
|
|
|
|
|
|
|
|
|
fill2 : I -> I -> A |
|
|
|
|
|
fill2 i j = comp (\i -> A) (\k [ (i = i0) -> rem0 (ior j (inot k)) |
|
|
|
|
|
, (i = i1) -> rem1 (ior j (inot k)) |
|
|
|
|
|
, (j = i1) -> g y ]) |
|
|
|
|
|
(inS (g y)) |
|
|
|
|
|
|
|
|
|
|
|
sq : I -> I -> A |
|
|
|
|
|
sq i j = comp (\i -> A) (\k [ (i = i0) -> fill0 j (inot k) |
|
|
|
|
|
, (i = i1) -> fill1 j (inot k) |
|
|
|
|
|
, (j = i1) -> g y |
|
|
|
|
|
, (j = i0) -> t (p i) (inot k) ]) |
|
|
|
|
|
(inS (fill2 i j)) |
|
|
|
|
|
|
|
|
|
|
|
sq1 : I -> I -> B |
|
|
|
|
|
sq1 i j = comp (\i -> B) (\k [ (i = i0) -> s (p0 j) k |
|
|
|
|
|
, (i = i1) -> s (p1 j) k |
|
|
|
|
|
, (j = i0) -> s (f (p i)) k |
|
|
|
|
|
, (j = i1) -> s y k |
|
|
|
|
|
]) |
|
|
|
|
|
(inS (f (sq i j))) |
|
|
|
|
|
in \i -> (p i, \j -> sq1 i j) |
|
|
|
|
|
|
|
|
|
|
|
fCenter : (y : B) -> fiber f y |
|
|
|
|
|
fCenter y = (g y, s y) |
|
|
|
|
|
|
|
|
|
|
|
fIsCenter : (y : B) (w : fiber f y) -> Path (fCenter y) w |
|
|
|
|
|
fIsCenter y w = lemIso y (fCenter y).1 w.1 (fCenter y).2 w.2 |
|
|
|
|
|
in (f, \y -> (fCenter y, fIsCenter y)) |
|
|
|
|
|
|
|
|
IsoToEquiv {A} {B} iso = (f, \y -> (fCenter y, fIsCenter y)) where |
|
|
|
|
|
f = iso.1 |
|
|
|
|
|
g = iso.2.1 |
|
|
|
|
|
s = iso.2.2.1 |
|
|
|
|
|
t = iso.2.2.2 |
|
|
|
|
|
|
|
|
|
|
|
lemIso : (y : B) (x0 : A) (x1 : A) (p0 : Path (f x0) y) (p1 : Path (f x1) y) |
|
|
|
|
|
-> PathP (\i -> fiber f y) (x0, p0) (x1, p1) |
|
|
|
|
|
lemIso y x0 x1 p0 p1 = |
|
|
|
|
|
let |
|
|
|
|
|
rem0 : Path x0 (g y) |
|
|
|
|
|
rem0 i = comp (\i -> A) (\k [ (i = i0) -> t x0 k, (i = i1) -> g y ]) (inS (g (p0 i))) |
|
|
|
|
|
|
|
|
|
|
|
rem1 : Path x1 (g y) |
|
|
|
|
|
rem1 i = comp (\i -> A) (\k [ (i = i0) -> t x1 k, (i = i1) -> g y ]) (inS (g (p1 i))) |
|
|
|
|
|
|
|
|
|
|
|
p : Path x0 x1 |
|
|
|
|
|
p i = comp (\i -> A) (\k [ (i = i0) -> rem0 (inot k), (i = i1) -> rem1 (inot k) ]) (inS (g y)) |
|
|
|
|
|
|
|
|
|
|
|
fill0 : I -> I -> A |
|
|
|
|
|
fill0 i j = comp (\i -> A) (\k [ (i = i0) -> t x0 (iand j k) |
|
|
|
|
|
, (i = i1) -> g y |
|
|
|
|
|
, (j = i0) -> g (p0 i) |
|
|
|
|
|
]) |
|
|
|
|
|
(inS (g (p0 i))) |
|
|
|
|
|
|
|
|
|
|
|
fill1 : I -> I -> A |
|
|
|
|
|
fill1 i j = comp (\i -> A) (\k [ (i = i0) -> t x1 (iand j k) |
|
|
|
|
|
, (i = i1) -> g y |
|
|
|
|
|
, (j = i0) -> g (p1 i) ]) |
|
|
|
|
|
(inS (g (p1 i))) |
|
|
|
|
|
|
|
|
|
|
|
fill2 : I -> I -> A |
|
|
|
|
|
fill2 i j = comp (\i -> A) (\k [ (i = i0) -> rem0 (ior j (inot k)) |
|
|
|
|
|
, (i = i1) -> rem1 (ior j (inot k)) |
|
|
|
|
|
, (j = i1) -> g y ]) |
|
|
|
|
|
(inS (g y)) |
|
|
|
|
|
|
|
|
|
|
|
sq : I -> I -> A |
|
|
|
|
|
sq i j = comp (\i -> A) (\k [ (i = i0) -> fill0 j (inot k) |
|
|
|
|
|
, (i = i1) -> fill1 j (inot k) |
|
|
|
|
|
, (j = i1) -> g y |
|
|
|
|
|
, (j = i0) -> t (p i) (inot k) ]) |
|
|
|
|
|
(inS (fill2 i j)) |
|
|
|
|
|
|
|
|
|
|
|
sq1 : I -> I -> B |
|
|
|
|
|
sq1 i j = comp (\i -> B) (\k [ (i = i0) -> s (p0 j) k |
|
|
|
|
|
, (i = i1) -> s (p1 j) k |
|
|
|
|
|
, (j = i0) -> s (f (p i)) k |
|
|
|
|
|
, (j = i1) -> s y k |
|
|
|
|
|
]) |
|
|
|
|
|
(inS (f (sq i j))) |
|
|
|
|
|
in \i -> (p i, \j -> sq1 i j) |
|
|
|
|
|
|
|
|
|
|
|
fCenter : (y : B) -> fiber f y |
|
|
|
|
|
fCenter y = (g y, s y) |
|
|
|
|
|
|
|
|
|
|
|
fIsCenter : (y : B) (w : fiber f y) -> Path (fCenter y) w |
|
|
|
|
|
fIsCenter y w = lemIso y (fCenter y).1 w.1 (fCenter y).2 w.2 |
|
|
|
|
|
|
|
|
-- We can prove that any involutive function is an isomorphism, since |
|
|
-- We can prove that any involutive function is an isomorphism, since |
|
|
-- such a function is its own inverse. |
|
|
-- such a function is its own inverse. |
|
|