2015-03-03 21:35:51 +00:00
|
|
|
/-
|
|
|
|
Copyright (c) 2014 Floris van Doorn. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
Author: Floris van Doorn
|
|
|
|
|
2015-05-22 08:35:44 +00:00
|
|
|
Partially ported from Coq HoTT
|
2015-03-03 21:35:51 +00:00
|
|
|
Theorems about path types (identity types)
|
|
|
|
-/
|
|
|
|
|
2015-05-22 08:35:44 +00:00
|
|
|
open eq sigma sigma.ops equiv is_equiv equiv.ops
|
2015-03-03 21:35:51 +00:00
|
|
|
|
2015-05-27 01:17:26 +00:00
|
|
|
-- TODO: Rename transport_eq_... and pathover_eq_... to eq_transport_... and eq_pathover_...
|
|
|
|
|
2015-03-03 21:35:51 +00:00
|
|
|
namespace eq
|
|
|
|
/- Path spaces -/
|
|
|
|
|
2015-03-04 05:10:48 +00:00
|
|
|
variables {A B : Type} {a a1 a2 a3 a4 : A} {b b1 b2 : B} {f g : A → B} {h : B → A}
|
2015-06-17 23:31:05 +00:00
|
|
|
{p p' p'' : a1 = a2}
|
2015-03-04 05:10:48 +00:00
|
|
|
|
2015-03-03 21:35:51 +00:00
|
|
|
/- The path spaces of a path space are not, of course, determined; they are just the
|
|
|
|
higher-dimensional structure of the original space. -/
|
|
|
|
|
2015-06-04 01:41:21 +00:00
|
|
|
/- some lemmas about whiskering or other higher paths -/
|
2015-03-04 05:10:48 +00:00
|
|
|
|
2015-06-17 23:31:05 +00:00
|
|
|
theorem whisker_left_con_right (p : a1 = a2) {q q' q'' : a2 = a3} (r : q = q') (s : q' = q'')
|
2015-03-04 05:10:48 +00:00
|
|
|
: whisker_left p (r ⬝ s) = whisker_left p r ⬝ whisker_left p s :=
|
|
|
|
begin
|
2015-06-23 16:47:52 +00:00
|
|
|
induction p, induction r, induction s, reflexivity
|
2015-03-04 05:10:48 +00:00
|
|
|
end
|
|
|
|
|
2015-06-17 23:31:05 +00:00
|
|
|
theorem whisker_right_con_right (q : a2 = a3) (r : p = p') (s : p' = p'')
|
2015-03-04 05:10:48 +00:00
|
|
|
: whisker_right (r ⬝ s) q = whisker_right r q ⬝ whisker_right s q :=
|
|
|
|
begin
|
2015-06-23 16:47:52 +00:00
|
|
|
induction q, induction r, induction s, reflexivity
|
2015-03-04 05:10:48 +00:00
|
|
|
end
|
|
|
|
|
2015-06-17 23:31:05 +00:00
|
|
|
theorem whisker_left_con_left (p : a1 = a2) (p' : a2 = a3) {q q' : a3 = a4} (r : q = q')
|
2015-03-04 05:10:48 +00:00
|
|
|
: whisker_left (p ⬝ p') r = !con.assoc ⬝ whisker_left p (whisker_left p' r) ⬝ !con.assoc' :=
|
|
|
|
begin
|
2015-06-23 16:47:52 +00:00
|
|
|
induction p', induction p, induction r, induction q, reflexivity
|
2015-03-04 05:10:48 +00:00
|
|
|
end
|
|
|
|
|
2015-06-17 23:31:05 +00:00
|
|
|
theorem whisker_right_con_left {p p' : a1 = a2} (q : a2 = a3) (q' : a3 = a4) (r : p = p')
|
2015-03-04 05:10:48 +00:00
|
|
|
: whisker_right r (q ⬝ q') = !con.assoc' ⬝ whisker_right (whisker_right r q) q' ⬝ !con.assoc :=
|
|
|
|
begin
|
2015-06-23 16:47:52 +00:00
|
|
|
induction q', induction q, induction r, induction p, reflexivity
|
2015-03-04 05:10:48 +00:00
|
|
|
end
|
|
|
|
|
2015-06-17 23:31:05 +00:00
|
|
|
theorem whisker_left_inv_left (p : a2 = a1) {q q' : a2 = a3} (r : q = q')
|
2015-03-04 05:10:48 +00:00
|
|
|
: !con_inv_cancel_left⁻¹ ⬝ whisker_left p (whisker_left p⁻¹ r) ⬝ !con_inv_cancel_left = r :=
|
|
|
|
begin
|
2015-06-23 16:47:52 +00:00
|
|
|
induction p, induction r, induction q, reflexivity
|
2015-03-04 05:10:48 +00:00
|
|
|
end
|
|
|
|
|
2015-06-23 16:47:52 +00:00
|
|
|
theorem whisker_left_inv (p : a1 = a2) {q q' : a2 = a3} (r : q = q')
|
|
|
|
: whisker_left p r⁻¹ = (whisker_left p r)⁻¹ :=
|
|
|
|
by induction r; reflexivity
|
|
|
|
|
|
|
|
theorem whisker_right_inv {p p' : a1 = a2} (q : a2 = a3) (r : p = p')
|
|
|
|
: whisker_right r⁻¹ q = (whisker_right r q)⁻¹ :=
|
|
|
|
by induction r; reflexivity
|
|
|
|
|
2015-06-17 23:31:05 +00:00
|
|
|
theorem ap_eq_ap10 {f g : A → B} (p : f = g) (a : A) : ap (λh, h a) p = ap10 p a :=
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p;reflexivity
|
2015-06-04 01:41:21 +00:00
|
|
|
|
2015-06-17 23:31:05 +00:00
|
|
|
theorem inverse2_right_inv (r : p = p') : r ◾ inverse2 r ⬝ con.right_inv p' = con.right_inv p :=
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction r;induction p;reflexivity
|
2015-06-04 01:41:21 +00:00
|
|
|
|
2015-06-17 23:31:05 +00:00
|
|
|
theorem inverse2_left_inv (r : p = p') : inverse2 r ◾ r ⬝ con.left_inv p' = con.left_inv p :=
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction r;induction p;reflexivity
|
2015-06-17 23:31:05 +00:00
|
|
|
|
|
|
|
theorem ap_con_right_inv (f : A → B) (p : a1 = a2)
|
|
|
|
: ap_con f p p⁻¹ ⬝ whisker_left _ (ap_inv f p) ⬝ con.right_inv (ap f p)
|
|
|
|
= ap (ap f) (con.right_inv p) :=
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p;reflexivity
|
2015-06-17 23:31:05 +00:00
|
|
|
|
|
|
|
theorem ap_con_left_inv (f : A → B) (p : a1 = a2)
|
|
|
|
: ap_con f p⁻¹ p ⬝ whisker_right (ap_inv f p) _ ⬝ con.left_inv (ap f p)
|
|
|
|
= ap (ap f) (con.left_inv p) :=
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p;reflexivity
|
|
|
|
|
|
|
|
theorem idp_con_whisker_left {q q' : a2 = a3} (r : q = q') :
|
|
|
|
!idp_con⁻¹ ⬝ whisker_left idp r = r ⬝ !idp_con⁻¹ :=
|
|
|
|
by induction r;induction q;reflexivity
|
|
|
|
|
|
|
|
theorem whisker_left_idp_con {q q' : a2 = a3} (r : q = q') :
|
|
|
|
whisker_left idp r ⬝ !idp_con = !idp_con ⬝ r :=
|
|
|
|
by induction r;induction q;reflexivity
|
2015-06-17 23:31:05 +00:00
|
|
|
|
|
|
|
theorem idp_con_idp {p : a = a} (q : p = idp) : idp_con p ⬝ q = ap (λp, idp ⬝ p) q :=
|
|
|
|
by cases q;reflexivity
|
2015-06-04 01:41:21 +00:00
|
|
|
|
2015-03-03 21:35:51 +00:00
|
|
|
/- Transporting in path spaces.
|
|
|
|
|
|
|
|
There are potentially a lot of these lemmas, so we adopt a uniform naming scheme:
|
|
|
|
|
|
|
|
- `l` means the left endpoint varies
|
|
|
|
- `r` means the right endpoint varies
|
|
|
|
- `F` means application of a function to that (varying) endpoint.
|
|
|
|
-/
|
|
|
|
|
2015-03-04 05:10:48 +00:00
|
|
|
definition transport_eq_l (p : a1 = a2) (q : a1 = a3)
|
2015-03-03 21:35:51 +00:00
|
|
|
: transport (λx, x = a3) p q = p⁻¹ ⬝ q :=
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; induction q; reflexivity
|
2015-03-03 21:35:51 +00:00
|
|
|
|
2015-03-04 05:10:48 +00:00
|
|
|
definition transport_eq_r (p : a2 = a3) (q : a1 = a2)
|
2015-03-03 21:35:51 +00:00
|
|
|
: transport (λx, a1 = x) p q = q ⬝ p :=
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; induction q; reflexivity
|
2015-03-03 21:35:51 +00:00
|
|
|
|
2015-03-04 05:10:48 +00:00
|
|
|
definition transport_eq_lr (p : a1 = a2) (q : a1 = a1)
|
2015-03-03 21:35:51 +00:00
|
|
|
: transport (λx, x = x) p q = p⁻¹ ⬝ q ⬝ p :=
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; rewrite [▸*,idp_con]
|
2015-03-03 21:35:51 +00:00
|
|
|
|
2015-03-04 05:10:48 +00:00
|
|
|
definition transport_eq_Fl (p : a1 = a2) (q : f a1 = b)
|
2015-03-03 21:35:51 +00:00
|
|
|
: transport (λx, f x = b) p q = (ap f p)⁻¹ ⬝ q :=
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; induction q; reflexivity
|
2015-03-03 21:35:51 +00:00
|
|
|
|
2015-03-04 05:10:48 +00:00
|
|
|
definition transport_eq_Fr (p : a1 = a2) (q : b = f a1)
|
2015-03-03 21:35:51 +00:00
|
|
|
: transport (λx, b = f x) p q = q ⬝ (ap f p) :=
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; reflexivity
|
2015-03-03 21:35:51 +00:00
|
|
|
|
2015-03-04 05:10:48 +00:00
|
|
|
definition transport_eq_FlFr (p : a1 = a2) (q : f a1 = g a1)
|
2015-03-03 21:35:51 +00:00
|
|
|
: transport (λx, f x = g x) p q = (ap f p)⁻¹ ⬝ q ⬝ (ap g p) :=
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; rewrite [▸*,idp_con]
|
2015-03-03 21:35:51 +00:00
|
|
|
|
2015-03-04 05:10:48 +00:00
|
|
|
definition transport_eq_FlFr_D {B : A → Type} {f g : Πa, B a}
|
2015-03-03 21:35:51 +00:00
|
|
|
(p : a1 = a2) (q : f a1 = g a1)
|
2015-04-24 21:00:32 +00:00
|
|
|
: transport (λx, f x = g x) p q = (apd f p)⁻¹ ⬝ ap (transport B p) q ⬝ (apd g p) :=
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; rewrite [▸*,idp_con,ap_id]
|
2015-03-03 21:35:51 +00:00
|
|
|
|
2015-03-04 05:10:48 +00:00
|
|
|
definition transport_eq_FFlr (p : a1 = a2) (q : h (f a1) = a1)
|
2015-03-03 21:35:51 +00:00
|
|
|
: transport (λx, h (f x) = x) p q = (ap h (ap f p))⁻¹ ⬝ q ⬝ p :=
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; rewrite [▸*,idp_con]
|
2015-03-03 21:35:51 +00:00
|
|
|
|
2015-03-04 05:10:48 +00:00
|
|
|
definition transport_eq_lFFr (p : a1 = a2) (q : a1 = h (f a1))
|
2015-03-03 21:35:51 +00:00
|
|
|
: transport (λx, x = h (f x)) p q = p⁻¹ ⬝ q ⬝ (ap h (ap f p)) :=
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; rewrite [▸*,idp_con]
|
2015-05-22 08:35:44 +00:00
|
|
|
|
|
|
|
/- Pathovers -/
|
|
|
|
|
|
|
|
-- In the comment we give the fibration of the pathover
|
2015-05-27 01:39:29 +00:00
|
|
|
|
2015-06-17 19:58:58 +00:00
|
|
|
-- we should probably try to do everything just with pathover_eq (defined in cubical.square),
|
|
|
|
-- the following definitions may be removed in future.
|
2015-06-04 01:41:21 +00:00
|
|
|
|
2015-05-22 08:35:44 +00:00
|
|
|
definition pathover_eq_l (p : a1 = a2) (q : a1 = a3) : q =[p] p⁻¹ ⬝ q := /-(λx, x = a3)-/
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; induction q; exact idpo
|
2015-05-22 08:35:44 +00:00
|
|
|
|
|
|
|
definition pathover_eq_r (p : a2 = a3) (q : a1 = a2) : q =[p] q ⬝ p := /-(λx, a1 = x)-/
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; induction q; exact idpo
|
2015-05-22 08:35:44 +00:00
|
|
|
|
|
|
|
definition pathover_eq_lr (p : a1 = a2) (q : a1 = a1) : q =[p] p⁻¹ ⬝ q ⬝ p := /-(λx, x = x)-/
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; rewrite [▸*,idp_con]; exact idpo
|
2015-05-22 08:35:44 +00:00
|
|
|
|
|
|
|
definition pathover_eq_Fl (p : a1 = a2) (q : f a1 = b) : q =[p] (ap f p)⁻¹ ⬝ q := /-(λx, f x = b)-/
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; induction q; exact idpo
|
2015-05-22 08:35:44 +00:00
|
|
|
|
|
|
|
definition pathover_eq_Fr (p : a1 = a2) (q : b = f a1) : q =[p] q ⬝ (ap f p) := /-(λx, b = f x)-/
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; exact idpo
|
2015-05-22 08:35:44 +00:00
|
|
|
|
|
|
|
definition pathover_eq_FlFr (p : a1 = a2) (q : f a1 = g a1) : q =[p] (ap f p)⁻¹ ⬝ q ⬝ (ap g p) :=
|
|
|
|
/-(λx, f x = g x)-/
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; rewrite [▸*,idp_con]; exact idpo
|
2015-05-22 08:35:44 +00:00
|
|
|
|
|
|
|
definition pathover_eq_FlFr_D {B : A → Type} {f g : Πa, B a} (p : a1 = a2) (q : f a1 = g a1)
|
|
|
|
: q =[p] (apd f p)⁻¹ ⬝ ap (transport B p) q ⬝ (apd g p) := /-(λx, f x = g x)-/
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; rewrite [▸*,idp_con,ap_id];exact idpo
|
2015-05-22 08:35:44 +00:00
|
|
|
|
|
|
|
definition pathover_eq_FFlr (p : a1 = a2) (q : h (f a1) = a1) : q =[p] (ap h (ap f p))⁻¹ ⬝ q ⬝ p :=
|
|
|
|
/-(λx, h (f x) = x)-/
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; rewrite [▸*,idp_con];exact idpo
|
2015-05-22 08:35:44 +00:00
|
|
|
|
|
|
|
definition pathover_eq_lFFr (p : a1 = a2) (q : a1 = h (f a1)) : q =[p] p⁻¹ ⬝ q ⬝ (ap h (ap f p)) :=
|
|
|
|
/-(λx, x = h (f x))-/
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; rewrite [▸*,idp_con];exact idpo
|
2015-03-03 21:35:51 +00:00
|
|
|
|
2015-05-27 01:17:26 +00:00
|
|
|
definition pathover_eq_r_idp (p : a1 = a2) : idp =[p] p := /-(λx, a1 = x)-/
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; exact idpo
|
2015-05-27 01:17:26 +00:00
|
|
|
|
|
|
|
definition pathover_eq_l_idp (p : a1 = a2) : idp =[p] p⁻¹ := /-(λx, x = a1)-/
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; exact idpo
|
2015-05-27 01:17:26 +00:00
|
|
|
|
|
|
|
definition pathover_eq_l_idp' (p : a1 = a2) : idp =[p⁻¹] p := /-(λx, x = a2)-/
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; exact idpo
|
2015-05-27 01:17:26 +00:00
|
|
|
|
2015-03-03 21:35:51 +00:00
|
|
|
-- The Functorial action of paths is [ap].
|
|
|
|
|
|
|
|
/- Equivalences between path spaces -/
|
|
|
|
|
|
|
|
/- [ap_closed] is in init.equiv -/
|
|
|
|
|
|
|
|
definition equiv_ap (f : A → B) [H : is_equiv f] (a1 a2 : A)
|
|
|
|
: (a1 = a2) ≃ (f a1 = f a2) :=
|
2015-05-18 22:45:23 +00:00
|
|
|
equiv.mk (ap f) _
|
2015-03-03 21:35:51 +00:00
|
|
|
|
|
|
|
/- Path operations are equivalences -/
|
|
|
|
|
2015-03-04 05:10:48 +00:00
|
|
|
definition is_equiv_eq_inverse (a1 a2 : A) : is_equiv (@inverse A a1 a2) :=
|
2015-04-24 22:51:16 +00:00
|
|
|
is_equiv.mk inverse inverse inv_inv inv_inv (λp, eq.rec_on p idp)
|
2015-03-04 05:10:48 +00:00
|
|
|
local attribute is_equiv_eq_inverse [instance]
|
2015-03-03 21:35:51 +00:00
|
|
|
|
2015-03-04 05:10:48 +00:00
|
|
|
definition eq_equiv_eq_symm (a1 a2 : A) : (a1 = a2) ≃ (a2 = a1) :=
|
2015-03-03 21:35:51 +00:00
|
|
|
equiv.mk inverse _
|
|
|
|
|
2015-06-04 01:41:21 +00:00
|
|
|
definition is_equiv_concat_left [constructor] [instance] (p : a1 = a2) (a3 : A)
|
2015-05-07 02:48:11 +00:00
|
|
|
: is_equiv (concat p : a2 = a3 → a1 = a3) :=
|
2015-04-24 22:51:16 +00:00
|
|
|
is_equiv.mk (concat p) (concat p⁻¹)
|
2015-03-03 21:35:51 +00:00
|
|
|
(con_inv_cancel_left p)
|
|
|
|
(inv_con_cancel_left p)
|
2015-06-23 16:47:52 +00:00
|
|
|
(λq, by induction p;induction q;reflexivity)
|
2015-03-04 05:10:48 +00:00
|
|
|
local attribute is_equiv_concat_left [instance]
|
2015-03-03 21:35:51 +00:00
|
|
|
|
2015-06-04 01:41:21 +00:00
|
|
|
definition equiv_eq_closed_left [constructor] (a3 : A) (p : a1 = a2) : (a1 = a3) ≃ (a2 = a3) :=
|
2015-03-03 21:35:51 +00:00
|
|
|
equiv.mk (concat p⁻¹) _
|
|
|
|
|
2015-06-04 01:41:21 +00:00
|
|
|
definition is_equiv_concat_right [constructor] [instance] (p : a2 = a3) (a1 : A)
|
2015-03-03 21:35:51 +00:00
|
|
|
: is_equiv (λq : a1 = a2, q ⬝ p) :=
|
2015-04-24 22:51:16 +00:00
|
|
|
is_equiv.mk (λq, q ⬝ p) (λq, q ⬝ p⁻¹)
|
2015-03-03 21:35:51 +00:00
|
|
|
(λq, inv_con_cancel_right q p)
|
|
|
|
(λq, con_inv_cancel_right q p)
|
2015-06-23 16:47:52 +00:00
|
|
|
(λq, by induction p;induction q;reflexivity)
|
2015-03-04 05:10:48 +00:00
|
|
|
local attribute is_equiv_concat_right [instance]
|
2015-03-03 21:35:51 +00:00
|
|
|
|
2015-06-04 01:41:21 +00:00
|
|
|
definition equiv_eq_closed_right [constructor] (a1 : A) (p : a2 = a3) : (a1 = a2) ≃ (a1 = a3) :=
|
2015-03-03 21:35:51 +00:00
|
|
|
equiv.mk (λq, q ⬝ p) _
|
|
|
|
|
2015-06-04 01:41:21 +00:00
|
|
|
definition eq_equiv_eq_closed [constructor] (p : a1 = a2) (q : a3 = a4) : (a1 = a3) ≃ (a2 = a4) :=
|
2015-05-22 08:35:44 +00:00
|
|
|
equiv.trans (equiv_eq_closed_left a3 p) (equiv_eq_closed_right a2 q)
|
2015-03-03 21:35:51 +00:00
|
|
|
|
2015-03-04 05:10:48 +00:00
|
|
|
definition is_equiv_whisker_left (p : a1 = a2) (q r : a2 = a3)
|
|
|
|
: is_equiv (@whisker_left A a1 a2 a3 p q r) :=
|
|
|
|
begin
|
|
|
|
fapply adjointify,
|
|
|
|
{intro s, apply (!cancel_left s)},
|
|
|
|
{intro s,
|
|
|
|
apply concat, {apply whisker_left_con_right},
|
|
|
|
apply concat, rotate_left 1, apply (whisker_left_inv_left p s),
|
|
|
|
apply concat2,
|
|
|
|
{apply concat, {apply whisker_left_con_right},
|
|
|
|
apply concat2,
|
2015-06-23 16:47:52 +00:00
|
|
|
{induction p, induction q, reflexivity},
|
2015-06-17 23:31:05 +00:00
|
|
|
{reflexivity}},
|
2015-06-23 16:47:52 +00:00
|
|
|
{induction p, induction r, reflexivity}},
|
|
|
|
{intro s, induction s, induction q, induction p, reflexivity}
|
2015-03-04 05:10:48 +00:00
|
|
|
end
|
2015-03-03 21:35:51 +00:00
|
|
|
|
2015-03-04 05:10:48 +00:00
|
|
|
definition eq_equiv_con_eq_con_left (p : a1 = a2) (q r : a2 = a3) : (q = r) ≃ (p ⬝ q = p ⬝ r) :=
|
|
|
|
equiv.mk _ !is_equiv_whisker_left
|
2015-03-03 21:35:51 +00:00
|
|
|
|
2015-03-04 05:10:48 +00:00
|
|
|
definition is_equiv_whisker_right {p q : a1 = a2} (r : a2 = a3)
|
|
|
|
: is_equiv (λs, @whisker_right A a1 a2 a3 p q s r) :=
|
|
|
|
begin
|
|
|
|
fapply adjointify,
|
|
|
|
{intro s, apply (!cancel_right s)},
|
2015-06-23 16:47:52 +00:00
|
|
|
{intro s, induction r, cases s, induction q, reflexivity},
|
|
|
|
{intro s, induction s, induction r, induction p, reflexivity}
|
2015-03-04 05:10:48 +00:00
|
|
|
end
|
2015-03-03 21:35:51 +00:00
|
|
|
|
2015-03-04 05:10:48 +00:00
|
|
|
definition eq_equiv_con_eq_con_right (p q : a1 = a2) (r : a2 = a3) : (p = q) ≃ (p ⬝ r = q ⬝ r) :=
|
|
|
|
equiv.mk _ !is_equiv_whisker_right
|
2015-03-03 21:35:51 +00:00
|
|
|
|
2015-06-17 19:58:58 +00:00
|
|
|
/-
|
|
|
|
The following proofs can be simplified a bit by concatenating previous equivalences.
|
|
|
|
However, these proofs have the advantage that the inverse is definitionally equal to
|
|
|
|
what we would expect
|
|
|
|
-/
|
2015-03-03 21:35:51 +00:00
|
|
|
definition is_equiv_con_eq_of_eq_inv_con (p : a1 = a3) (q : a2 = a3) (r : a2 = a1)
|
2015-04-24 21:00:32 +00:00
|
|
|
: is_equiv (con_eq_of_eq_inv_con : p = r⁻¹ ⬝ q → r ⬝ p = q) :=
|
2015-03-03 21:35:51 +00:00
|
|
|
begin
|
2015-06-17 19:58:58 +00:00
|
|
|
fapply adjointify,
|
|
|
|
{ apply eq_inv_con_of_con_eq},
|
2015-06-23 16:47:52 +00:00
|
|
|
{ intro s, induction r, rewrite [↑[con_eq_of_eq_inv_con,eq_inv_con_of_con_eq],
|
2015-06-17 19:58:58 +00:00
|
|
|
con.assoc,con.assoc,con.left_inv,▸*,-con.assoc,con.right_inv,▸* at *,idp_con s]},
|
2015-06-23 16:47:52 +00:00
|
|
|
{ intro s, induction r, rewrite [↑[con_eq_of_eq_inv_con,eq_inv_con_of_con_eq],
|
2015-06-17 19:58:58 +00:00
|
|
|
con.assoc,con.assoc,con.right_inv,▸*,-con.assoc,con.left_inv,▸* at *,idp_con s] },
|
2015-03-03 21:35:51 +00:00
|
|
|
end
|
|
|
|
|
2015-03-04 05:10:48 +00:00
|
|
|
definition eq_inv_con_equiv_con_eq (p : a1 = a3) (q : a2 = a3) (r : a2 = a1)
|
2015-03-03 21:35:51 +00:00
|
|
|
: (p = r⁻¹ ⬝ q) ≃ (r ⬝ p = q) :=
|
2015-03-04 05:10:48 +00:00
|
|
|
equiv.mk _ !is_equiv_con_eq_of_eq_inv_con
|
2015-03-03 21:35:51 +00:00
|
|
|
|
2015-03-04 05:10:48 +00:00
|
|
|
definition is_equiv_con_eq_of_eq_con_inv (p : a1 = a3) (q : a2 = a3) (r : a2 = a1)
|
2015-04-24 21:00:32 +00:00
|
|
|
: is_equiv (con_eq_of_eq_con_inv : r = q ⬝ p⁻¹ → r ⬝ p = q) :=
|
2015-03-04 05:10:48 +00:00
|
|
|
begin
|
2015-06-17 19:58:58 +00:00
|
|
|
fapply adjointify,
|
|
|
|
{ apply eq_con_inv_of_con_eq},
|
2015-06-23 16:47:52 +00:00
|
|
|
{ intro s, induction p, rewrite [↑[con_eq_of_eq_con_inv,eq_con_inv_of_con_eq]]},
|
|
|
|
{ intro s, induction p, rewrite [↑[con_eq_of_eq_con_inv,eq_con_inv_of_con_eq]] },
|
2015-03-04 05:10:48 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
definition eq_con_inv_equiv_con_eq (p : a1 = a3) (q : a2 = a3) (r : a2 = a1)
|
|
|
|
: (r = q ⬝ p⁻¹) ≃ (r ⬝ p = q) :=
|
|
|
|
equiv.mk _ !is_equiv_con_eq_of_eq_con_inv
|
2015-03-03 21:35:51 +00:00
|
|
|
|
2015-03-04 05:10:48 +00:00
|
|
|
definition is_equiv_inv_con_eq_of_eq_con (p : a1 = a3) (q : a2 = a3) (r : a1 = a2)
|
2015-04-24 21:00:32 +00:00
|
|
|
: is_equiv (inv_con_eq_of_eq_con : p = r ⬝ q → r⁻¹ ⬝ p = q) :=
|
2015-03-04 05:10:48 +00:00
|
|
|
begin
|
2015-06-17 19:58:58 +00:00
|
|
|
fapply adjointify,
|
|
|
|
{ apply eq_con_of_inv_con_eq},
|
2015-06-23 16:47:52 +00:00
|
|
|
{ intro s, induction r, rewrite [↑[inv_con_eq_of_eq_con,eq_con_of_inv_con_eq],
|
2015-06-17 19:58:58 +00:00
|
|
|
con.assoc,con.assoc,con.left_inv,▸*,-con.assoc,con.right_inv,▸* at *,idp_con s]},
|
2015-06-23 16:47:52 +00:00
|
|
|
{ intro s, induction r, rewrite [↑[inv_con_eq_of_eq_con,eq_con_of_inv_con_eq],
|
2015-06-17 19:58:58 +00:00
|
|
|
con.assoc,con.assoc,con.right_inv,▸*,-con.assoc,con.left_inv,▸* at *,idp_con s] },
|
2015-03-04 05:10:48 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
definition eq_con_equiv_inv_con_eq (p : a1 = a3) (q : a2 = a3) (r : a1 = a2)
|
|
|
|
: (p = r ⬝ q) ≃ (r⁻¹ ⬝ p = q) :=
|
|
|
|
equiv.mk _ !is_equiv_inv_con_eq_of_eq_con
|
|
|
|
|
|
|
|
definition is_equiv_con_inv_eq_of_eq_con (p : a3 = a1) (q : a2 = a3) (r : a2 = a1)
|
2015-04-24 21:00:32 +00:00
|
|
|
: is_equiv (con_inv_eq_of_eq_con : r = q ⬝ p → r ⬝ p⁻¹ = q) :=
|
2015-03-04 05:10:48 +00:00
|
|
|
begin
|
2015-06-17 19:58:58 +00:00
|
|
|
fapply adjointify,
|
|
|
|
{ apply eq_con_of_con_inv_eq},
|
2015-06-23 16:47:52 +00:00
|
|
|
{ intro s, induction p, rewrite [↑[con_inv_eq_of_eq_con,eq_con_of_con_inv_eq]]},
|
|
|
|
{ intro s, induction p, rewrite [↑[con_inv_eq_of_eq_con,eq_con_of_con_inv_eq]] },
|
2015-03-04 05:10:48 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
definition eq_con_equiv_con_inv_eq (p : a3 = a1) (q : a2 = a3) (r : a2 = a1)
|
|
|
|
: (r = q ⬝ p) ≃ (r ⬝ p⁻¹ = q) :=
|
|
|
|
equiv.mk _ !is_equiv_con_inv_eq_of_eq_con
|
|
|
|
|
2015-06-17 19:58:58 +00:00
|
|
|
local attribute is_equiv_inv_con_eq_of_eq_con
|
|
|
|
is_equiv_con_inv_eq_of_eq_con
|
|
|
|
is_equiv_con_eq_of_eq_con_inv
|
|
|
|
is_equiv_con_eq_of_eq_inv_con [instance]
|
|
|
|
|
2015-03-04 05:10:48 +00:00
|
|
|
definition is_equiv_eq_con_of_inv_con_eq (p : a1 = a3) (q : a2 = a3) (r : a2 = a1)
|
2015-04-24 21:00:32 +00:00
|
|
|
: is_equiv (eq_con_of_inv_con_eq : r⁻¹ ⬝ q = p → q = r ⬝ p) :=
|
2015-06-17 19:58:58 +00:00
|
|
|
is_equiv_inv inv_con_eq_of_eq_con
|
2015-03-04 05:10:48 +00:00
|
|
|
|
|
|
|
definition is_equiv_eq_con_of_con_inv_eq (p : a1 = a3) (q : a2 = a3) (r : a2 = a1)
|
2015-04-24 21:00:32 +00:00
|
|
|
: is_equiv (eq_con_of_con_inv_eq : q ⬝ p⁻¹ = r → q = r ⬝ p) :=
|
2015-06-17 19:58:58 +00:00
|
|
|
is_equiv_inv con_inv_eq_of_eq_con
|
|
|
|
|
|
|
|
definition is_equiv_eq_con_inv_of_con_eq (p : a1 = a3) (q : a2 = a3) (r : a2 = a1)
|
|
|
|
: is_equiv (eq_con_inv_of_con_eq : r ⬝ p = q → r = q ⬝ p⁻¹) :=
|
|
|
|
is_equiv_inv con_eq_of_eq_con_inv
|
2015-03-04 05:10:48 +00:00
|
|
|
|
2015-06-17 19:58:58 +00:00
|
|
|
definition is_equiv_eq_inv_con_of_con_eq (p : a1 = a3) (q : a2 = a3) (r : a2 = a1)
|
|
|
|
: is_equiv (eq_inv_con_of_con_eq : r ⬝ p = q → p = r⁻¹ ⬝ q) :=
|
|
|
|
is_equiv_inv con_eq_of_eq_inv_con
|
2015-03-04 05:10:48 +00:00
|
|
|
|
2015-05-22 08:35:44 +00:00
|
|
|
/- Pathover Equivalences -/
|
|
|
|
|
|
|
|
definition pathover_eq_equiv_l (p : a1 = a2) (q : a1 = a3) (r : a2 = a3) : q =[p] r ≃ q = p ⬝ r :=
|
|
|
|
/-(λx, x = a3)-/
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; exact !pathover_idp ⬝e !equiv_eq_closed_right !idp_con⁻¹
|
2015-05-22 08:35:44 +00:00
|
|
|
|
|
|
|
definition pathover_eq_equiv_r (p : a2 = a3) (q : a1 = a2) (r : a1 = a3) : q =[p] r ≃ q ⬝ p = r :=
|
|
|
|
/-(λx, a1 = x)-/
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; apply pathover_idp
|
2015-05-22 08:35:44 +00:00
|
|
|
|
|
|
|
definition pathover_eq_equiv_lr (p : a1 = a2) (q : a1 = a1) (r : a2 = a2)
|
|
|
|
: q =[p] r ≃ q ⬝ p = p ⬝ r := /-(λx, x = x)-/
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; exact !pathover_idp ⬝e !equiv_eq_closed_right !idp_con⁻¹
|
2015-05-22 08:35:44 +00:00
|
|
|
|
|
|
|
definition pathover_eq_equiv_Fl (p : a1 = a2) (q : f a1 = b) (r : f a2 = b)
|
|
|
|
: q =[p] r ≃ q = ap f p ⬝ r := /-(λx, f x = b)-/
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; exact !pathover_idp ⬝e !equiv_eq_closed_right !idp_con⁻¹
|
2015-05-22 08:35:44 +00:00
|
|
|
|
|
|
|
definition pathover_eq_equiv_Fr (p : a1 = a2) (q : b = f a1) (r : b = f a2)
|
|
|
|
: q =[p] r ≃ q ⬝ ap f p = r := /-(λx, b = f x)-/
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; apply pathover_idp
|
2015-05-22 08:35:44 +00:00
|
|
|
|
|
|
|
definition pathover_eq_equiv_FlFr (p : a1 = a2) (q : f a1 = g a1) (r : f a2 = g a2)
|
|
|
|
: q =[p] r ≃ q ⬝ ap g p = ap f p ⬝ r := /-(λx, f x = g x)-/
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; exact !pathover_idp ⬝e !equiv_eq_closed_right !idp_con⁻¹
|
2015-05-22 08:35:44 +00:00
|
|
|
|
|
|
|
definition pathover_eq_equiv_FFlr (p : a1 = a2) (q : h (f a1) = a1) (r : h (f a2) = a2)
|
|
|
|
: q =[p] r ≃ q ⬝ p = ap h (ap f p) ⬝ r :=
|
|
|
|
/-(λx, h (f x) = x)-/
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; exact !pathover_idp ⬝e !equiv_eq_closed_right !idp_con⁻¹
|
2015-05-22 08:35:44 +00:00
|
|
|
|
|
|
|
definition pathover_eq_equiv_lFFr (p : a1 = a2) (q : a1 = h (f a1)) (r : a2 = h (f a2))
|
|
|
|
: q =[p] r ≃ q ⬝ ap h (ap f p) = p ⬝ r :=
|
|
|
|
/-(λx, x = h (f x))-/
|
2015-06-23 16:47:52 +00:00
|
|
|
by induction p; exact !pathover_idp ⬝e !equiv_eq_closed_right !idp_con⁻¹
|
2015-05-22 08:35:44 +00:00
|
|
|
|
2015-03-04 05:10:48 +00:00
|
|
|
-- a lot of this library still needs to be ported from Coq HoTT
|
2015-03-03 21:35:51 +00:00
|
|
|
|
2015-05-22 08:35:44 +00:00
|
|
|
|
|
|
|
|
2015-03-03 21:35:51 +00:00
|
|
|
end eq
|