-
Notifications
You must be signed in to change notification settings - Fork 1
/
Equivalences.v
68 lines (62 loc) · 2.31 KB
/
Equivalences.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Require Import MLTT2F.Overture MLTT2F.Path_eq.
Record IsEquiv {A B} {FibA: Fibrant A} {FibB: Fibrant B} (f: A -> B) :=
{ equiv_inv : B -> A ;
eisretr : f o equiv_inv == idmap;
eissect : equiv_inv o f == idmap;
eisadj : ∀ x : A, eisretr (f x) = ap f (eissect x) }.
Arguments equiv_inv {_ _ _ _ _} _ _.
Arguments eisretr {_ _ _ _ _} _ _.
Arguments eissect {_ _ _ _ _} _ _.
Arguments eisadj {_ _ _ _ _} _ _.
Definition isequiv_adjointify {A B} {FibA: Fibrant A} {FibB: Fibrant B} {f: A -> B}
(g: B -> A) : f o g == idmap -> g o f == idmap -> IsEquiv f.
Proof.
intros isretr issect. use Build_IsEquiv.
exact g. exact isretr.
exact (λ x, ap g (ap f (issect x)^) @ ap g (isretr (f x)) @ issect x).
intro a; cbn.
apply moveR_M1.
repeat (rew ap_pp; rew concat_p_pp); rew (ap_compose _ _ _)^.
rew (concat_pA1 (fun b => (isretr b)^) (ap f (issect a)^)).
repeat rew concat_pp_p; rew ap_V; apply moveL_Vp; rew concat_p1.
rew concat_p_pp; rew (ap_compose _ _ _)^.
rew (concat_pA1 (fun b => (isretr b)^) (isretr (f a))).
rew concat_pV; rew concat_1p.
exact 1.
Defined.
(* Qed. *)
Definition isequiv_compose {A B C} {FibA: Fibrant A} {FibB: Fibrant B} {FibC: Fibrant C}
{f: A -> B} (Hf: IsEquiv f) {g: B -> C} (Hg: IsEquiv g)
: IsEquiv (compose g f).
Proof.
use isequiv_adjointify.
exact ((equiv_inv Hf) o (equiv_inv Hg)).
exact (fun c => ap g (eisretr _ (equiv_inv Hg c)) @ eisretr _ c).
exact (fun a => ap _ (eissect _ (f a)) @ eissect _ a).
Defined.
Definition cancelR_isequiv {A B C} {FibA: Fibrant A} {FibB: Fibrant B} {FibC: Fibrant C}
(f : A -> B) {g : B -> C}
{Hf: IsEquiv f} {Hgf: IsEquiv (g o f)}
: IsEquiv g.
Proof.
use isequiv_adjointify.
exact (f o (equiv_inv Hgf)).
intro x; cbn. exact (eisretr Hgf x).
intro x; cbn.
ref (ap (λ x, f (equiv_inv Hgf (g x))) (eisretr Hf x)^ @ _).
ref (ap f (eissect Hgf _) @ _).
apply eisretr.
Defined.
Definition cancelL_isequiv {A B C} {FibA: Fibrant A} {FibB: Fibrant B} {FibC: Fibrant C}
(g : B -> C) {f : A -> B}
{Hg: IsEquiv g} {Hgf: IsEquiv (g o f)}
: IsEquiv f.
Proof.
use isequiv_adjointify.
exact ((equiv_inv Hgf) o g).
intro x; cbn.
ref ((eissect Hg _)^ @ _).
ref (ap (equiv_inv Hg) (eisretr Hgf _) @ _).
apply eissect.
intro x; cbn. exact (eissect Hgf x).
Defined.