2015-02-26 18:19:54 +00:00
|
|
|
|
/-
|
2015-03-17 00:08:45 +00:00
|
|
|
|
Copyright (c) 2015 Floris van Doorn. All rights reserved.
|
2015-02-26 18:19:54 +00:00
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
Authors: Floris van Doorn, Jakob von Raumer
|
|
|
|
|
-/
|
2014-12-12 04:14:53 +00:00
|
|
|
|
|
2015-10-20 01:42:41 +00:00
|
|
|
|
import ..iso types.pi
|
2014-12-12 19:19:06 +00:00
|
|
|
|
|
2015-10-23 05:12:34 +00:00
|
|
|
|
open function category eq prod prod.ops equiv is_equiv sigma sigma.ops is_trunc funext iso pi
|
2014-12-12 04:14:53 +00:00
|
|
|
|
|
2014-12-18 02:49:37 +00:00
|
|
|
|
structure functor (C D : Precategory) : Type :=
|
2015-02-28 00:50:06 +00:00
|
|
|
|
(to_fun_ob : C → D)
|
2015-09-22 17:11:33 +00:00
|
|
|
|
(to_fun_hom : Π {a b : C}, hom a b → hom (to_fun_ob a) (to_fun_ob b))
|
2015-02-28 00:50:06 +00:00
|
|
|
|
(respect_id : Π (a : C), to_fun_hom (ID a) = ID (to_fun_ob a))
|
2014-12-18 02:49:37 +00:00
|
|
|
|
(respect_comp : Π {a b c : C} (g : hom b c) (f : hom a b),
|
2015-02-28 00:50:06 +00:00
|
|
|
|
to_fun_hom (g ∘ f) = to_fun_hom g ∘ to_fun_hom f)
|
2014-12-12 04:14:53 +00:00
|
|
|
|
|
|
|
|
|
namespace functor
|
2015-02-24 00:54:16 +00:00
|
|
|
|
|
2015-10-23 05:12:34 +00:00
|
|
|
|
infixl ` ⇒ `:55 := functor
|
2015-03-13 22:27:29 +00:00
|
|
|
|
variables {A B C D E : Precategory}
|
2014-12-12 04:14:53 +00:00
|
|
|
|
|
2015-02-28 00:50:06 +00:00
|
|
|
|
attribute to_fun_ob [coercion]
|
|
|
|
|
attribute to_fun_hom [coercion]
|
2014-12-12 04:14:53 +00:00
|
|
|
|
|
2015-02-24 00:54:16 +00:00
|
|
|
|
-- The following lemmas will later be used to prove that the type of
|
|
|
|
|
-- precategories forms a precategory itself
|
2015-08-31 16:23:34 +00:00
|
|
|
|
protected definition compose [reducible] [constructor] (G : functor D E) (F : functor C D)
|
|
|
|
|
: functor C E :=
|
2015-02-24 00:54:16 +00:00
|
|
|
|
functor.mk
|
|
|
|
|
(λ x, G (F x))
|
|
|
|
|
(λ a b f, G (F f))
|
2015-06-13 00:53:01 +00:00
|
|
|
|
(λ a, abstract calc
|
2015-03-13 03:52:00 +00:00
|
|
|
|
G (F (ID a)) = G (ID (F a)) : by rewrite respect_id
|
2015-06-13 00:53:01 +00:00
|
|
|
|
... = ID (G (F a)) : by rewrite respect_id end)
|
|
|
|
|
(λ a b c g f, abstract calc
|
2015-03-13 03:13:40 +00:00
|
|
|
|
G (F (g ∘ f)) = G (F g ∘ F f) : by rewrite respect_comp
|
2015-06-13 00:53:01 +00:00
|
|
|
|
... = G (F g) ∘ G (F f) : by rewrite respect_comp end)
|
2015-02-24 00:54:16 +00:00
|
|
|
|
|
2015-10-22 22:41:55 +00:00
|
|
|
|
infixr ` ∘f `:75 := functor.compose
|
2015-02-24 00:54:16 +00:00
|
|
|
|
|
2015-08-31 16:23:34 +00:00
|
|
|
|
protected definition id [reducible] [constructor] {C : Precategory} : functor C C :=
|
2015-02-27 05:45:21 +00:00
|
|
|
|
mk (λa, a) (λ a b f, f) (λ a, idp) (λ a b c f g, idp)
|
|
|
|
|
|
2015-08-31 16:23:34 +00:00
|
|
|
|
protected definition ID [reducible] [constructor] (C : Precategory) : functor C C := @functor.id C
|
|
|
|
|
notation 1 := functor.id
|
2015-02-27 05:45:21 +00:00
|
|
|
|
|
2015-09-24 02:44:36 +00:00
|
|
|
|
definition constant_functor [constructor] (C : Precategory) {D : Precategory} (d : D) : C ⇒ D :=
|
|
|
|
|
functor.mk (λc, d)
|
|
|
|
|
(λc c' f, id)
|
|
|
|
|
(λc, idp)
|
|
|
|
|
(λa b c g f, !id_id⁻¹)
|
|
|
|
|
|
2015-10-22 22:41:55 +00:00
|
|
|
|
/- introduction rule for equalities between functors -/
|
2015-03-13 22:27:29 +00:00
|
|
|
|
definition functor_mk_eq' {F₁ F₂ : C → D} {H₁ : Π(a b : C), hom a b → hom (F₁ a) (F₁ b)}
|
2015-02-24 00:54:16 +00:00
|
|
|
|
{H₂ : Π(a b : C), hom a b → hom (F₂ a) (F₂ b)} (id₁ id₂ comp₁ comp₂)
|
2015-05-01 03:23:12 +00:00
|
|
|
|
(pF : F₁ = F₂) (pH : pF ▸ H₁ = H₂)
|
2015-02-24 00:54:16 +00:00
|
|
|
|
: functor.mk F₁ H₁ id₁ comp₁ = functor.mk F₂ H₂ id₂ comp₂ :=
|
2016-02-15 20:18:07 +00:00
|
|
|
|
apd01111 functor.mk pF pH !is_prop.elim !is_prop.elim
|
2015-02-24 00:54:16 +00:00
|
|
|
|
|
2015-09-22 17:11:33 +00:00
|
|
|
|
definition functor_eq' {F₁ F₂ : C ⇒ D} : Π(p : to_fun_ob F₁ = to_fun_ob F₂),
|
|
|
|
|
(transport (λx, Πa b f, hom (x a) (x b)) p @(to_fun_hom F₁) = @(to_fun_hom F₂)) → F₁ = F₂ :=
|
2015-08-31 16:23:34 +00:00
|
|
|
|
by induction F₁; induction F₂; apply functor_mk_eq'
|
2015-03-13 22:27:29 +00:00
|
|
|
|
|
|
|
|
|
definition functor_mk_eq {F₁ F₂ : C → D} {H₁ : Π(a b : C), hom a b → hom (F₁ a) (F₁ b)}
|
2015-06-17 19:58:58 +00:00
|
|
|
|
{H₂ : Π(a b : C), hom a b → hom (F₂ a) (F₂ b)} (id₁ id₂ comp₁ comp₂) (pF : F₁ ~ F₂)
|
2015-03-13 14:32:48 +00:00
|
|
|
|
(pH : Π(a b : C) (f : hom a b), hom_of_eq (pF b) ∘ H₁ a b f ∘ inv_of_eq (pF a) = H₂ a b f)
|
2015-02-24 00:54:16 +00:00
|
|
|
|
: functor.mk F₁ H₁ id₁ comp₁ = functor.mk F₂ H₂ id₂ comp₂ :=
|
2015-05-16 00:24:35 +00:00
|
|
|
|
begin
|
|
|
|
|
fapply functor_mk_eq',
|
|
|
|
|
{ exact eq_of_homotopy pF},
|
|
|
|
|
{ refine eq_of_homotopy (λc, eq_of_homotopy (λc', eq_of_homotopy (λf, _))), intros,
|
|
|
|
|
rewrite [+pi_transport_constant,-pH,-transport_hom]}
|
|
|
|
|
end
|
2015-02-24 00:54:16 +00:00
|
|
|
|
|
2015-06-17 19:58:58 +00:00
|
|
|
|
definition functor_eq {F₁ F₂ : C ⇒ D} : Π(p : to_fun_ob F₁ ~ to_fun_ob F₂),
|
2015-03-13 22:27:29 +00:00
|
|
|
|
(Π(a b : C) (f : hom a b), hom_of_eq (p b) ∘ F₁ f ∘ inv_of_eq (p a) = F₂ f) → F₁ = F₂ :=
|
2015-08-31 16:23:34 +00:00
|
|
|
|
by induction F₁; induction F₂; apply functor_mk_eq
|
2015-03-13 22:27:29 +00:00
|
|
|
|
|
|
|
|
|
definition functor_mk_eq_constant {F : C → D} {H₁ : Π(a b : C), hom a b → hom (F a) (F b)}
|
2015-02-24 00:54:16 +00:00
|
|
|
|
{H₂ : Π(a b : C), hom a b → hom (F a) (F b)} (id₁ id₂ comp₁ comp₂)
|
|
|
|
|
(pH : Π(a b : C) (f : hom a b), H₁ a b f = H₂ a b f)
|
|
|
|
|
: functor.mk F H₁ id₁ comp₁ = functor.mk F H₂ id₂ comp₂ :=
|
2015-03-13 22:27:29 +00:00
|
|
|
|
functor_eq (λc, idp) (λa b f, !id_leftright ⬝ !pH)
|
2015-02-24 00:54:16 +00:00
|
|
|
|
|
2015-09-03 04:46:11 +00:00
|
|
|
|
definition preserve_is_iso [constructor] (F : C ⇒ D) {a b : C} (f : hom a b) [H : is_iso f]
|
|
|
|
|
: is_iso (F f) :=
|
2015-03-19 20:35:38 +00:00
|
|
|
|
begin
|
|
|
|
|
fapply @is_iso.mk, apply (F (f⁻¹)),
|
2015-05-03 05:22:31 +00:00
|
|
|
|
repeat (apply concat ; symmetry ; apply (respect_comp F) ;
|
2015-03-19 20:35:38 +00:00
|
|
|
|
apply concat ; apply (ap (λ x, to_fun_hom F x)) ;
|
2015-09-10 22:32:52 +00:00
|
|
|
|
(apply iso.left_inverse | apply iso.right_inverse);
|
2015-03-19 20:35:38 +00:00
|
|
|
|
apply (respect_id F) ),
|
|
|
|
|
end
|
|
|
|
|
|
2015-09-10 22:32:52 +00:00
|
|
|
|
theorem respect_inv (F : C ⇒ D) {a b : C} (f : hom a b) [H : is_iso f] [H' : is_iso (F f)] :
|
2015-03-19 20:35:38 +00:00
|
|
|
|
F (f⁻¹) = (F f)⁻¹ :=
|
|
|
|
|
begin
|
|
|
|
|
fapply @left_inverse_eq_right_inverse, apply (F f),
|
2015-05-03 05:22:31 +00:00
|
|
|
|
transitivity to_fun_hom F (f⁻¹ ∘ f),
|
|
|
|
|
{symmetry, apply (respect_comp F)},
|
|
|
|
|
{transitivity to_fun_hom F category.id,
|
2015-09-10 22:32:52 +00:00
|
|
|
|
{congruence, apply iso.left_inverse},
|
2015-05-03 05:22:31 +00:00
|
|
|
|
{apply respect_id}},
|
2015-09-10 22:32:52 +00:00
|
|
|
|
apply iso.right_inverse
|
2015-03-19 20:35:38 +00:00
|
|
|
|
end
|
|
|
|
|
|
2015-09-03 04:46:11 +00:00
|
|
|
|
attribute preserve_is_iso [instance] [priority 100]
|
|
|
|
|
|
2015-09-10 22:32:52 +00:00
|
|
|
|
definition to_fun_iso [constructor] (F : C ⇒ D) {a b : C} (f : a ≅ b) : F a ≅ F b :=
|
2015-10-23 05:12:34 +00:00
|
|
|
|
iso.mk (F f) _
|
2015-05-21 07:24:00 +00:00
|
|
|
|
|
2015-09-10 22:32:52 +00:00
|
|
|
|
theorem respect_inv' (F : C ⇒ D) {a b : C} (f : hom a b) {H : is_iso f} : F (f⁻¹) = (F f)⁻¹ :=
|
2015-05-21 07:24:00 +00:00
|
|
|
|
respect_inv F f
|
|
|
|
|
|
2015-09-10 22:32:52 +00:00
|
|
|
|
theorem respect_refl (F : C ⇒ D) (a : C) : to_fun_iso F (iso.refl a) = iso.refl (F a) :=
|
|
|
|
|
iso_eq !respect_id
|
|
|
|
|
|
|
|
|
|
theorem respect_symm (F : C ⇒ D) {a b : C} (f : a ≅ b)
|
|
|
|
|
: to_fun_iso F f⁻¹ⁱ = (to_fun_iso F f)⁻¹ⁱ :=
|
|
|
|
|
iso_eq !respect_inv
|
|
|
|
|
|
|
|
|
|
theorem respect_trans (F : C ⇒ D) {a b c : C} (f : a ≅ b) (g : b ≅ c)
|
|
|
|
|
: to_fun_iso F (f ⬝i g) = to_fun_iso F f ⬝i to_fun_iso F g :=
|
|
|
|
|
iso_eq !respect_comp
|
|
|
|
|
|
2015-10-16 19:15:44 +00:00
|
|
|
|
definition respect_iso_of_eq (F : C ⇒ D) {a b : C} (p : a = b) :
|
|
|
|
|
to_fun_iso F (iso_of_eq p) = iso_of_eq (ap F p) :=
|
|
|
|
|
by induction p; apply respect_refl
|
|
|
|
|
|
|
|
|
|
theorem respect_hom_of_eq (F : C ⇒ D) {a b : C} (p : a = b) :
|
|
|
|
|
F (hom_of_eq p) = hom_of_eq (ap F p) :=
|
|
|
|
|
by induction p; apply respect_id
|
|
|
|
|
|
|
|
|
|
definition respect_inv_of_eq (F : C ⇒ D) {a b : C} (p : a = b) :
|
|
|
|
|
F (inv_of_eq p) = inv_of_eq (ap F p) :=
|
|
|
|
|
by induction p; apply respect_id
|
|
|
|
|
|
2015-03-13 22:27:29 +00:00
|
|
|
|
protected definition assoc (H : C ⇒ D) (G : B ⇒ C) (F : A ⇒ B) :
|
2015-02-24 00:54:16 +00:00
|
|
|
|
H ∘f (G ∘f F) = (H ∘f G) ∘f F :=
|
2015-03-13 22:27:29 +00:00
|
|
|
|
!functor_mk_eq_constant (λa b f, idp)
|
2015-02-24 00:54:16 +00:00
|
|
|
|
|
2015-08-31 16:23:34 +00:00
|
|
|
|
protected definition id_left (F : C ⇒ D) : 1 ∘f F = F :=
|
2015-03-13 22:27:29 +00:00
|
|
|
|
functor.rec_on F (λF1 F2 F3 F4, !functor_mk_eq_constant (λa b f, idp))
|
2015-02-24 00:54:16 +00:00
|
|
|
|
|
2015-08-31 16:23:34 +00:00
|
|
|
|
protected definition id_right (F : C ⇒ D) : F ∘f 1 = F :=
|
2015-03-13 22:27:29 +00:00
|
|
|
|
functor.rec_on F (λF1 F2 F3 F4, !functor_mk_eq_constant (λa b f, idp))
|
|
|
|
|
|
2015-08-31 16:23:34 +00:00
|
|
|
|
protected definition comp_id_eq_id_comp (F : C ⇒ D) : F ∘f 1 = 1 ∘f F :=
|
2015-03-13 22:27:29 +00:00
|
|
|
|
!functor.id_right ⬝ !functor.id_left⁻¹
|
2015-02-24 00:54:16 +00:00
|
|
|
|
|
2015-10-22 22:41:55 +00:00
|
|
|
|
definition functor_of_eq [constructor] {C D : Precategory} (p : C = D :> Precategory) : C ⇒ D :=
|
|
|
|
|
functor.mk (transport carrier p)
|
|
|
|
|
(λa b f, by induction p; exact f)
|
|
|
|
|
(by intro c; induction p; reflexivity)
|
|
|
|
|
(by intros; induction p; reflexivity)
|
|
|
|
|
|
2014-12-18 02:49:37 +00:00
|
|
|
|
protected definition sigma_char :
|
2015-02-28 00:50:06 +00:00
|
|
|
|
(Σ (to_fun_ob : C → D)
|
|
|
|
|
(to_fun_hom : Π ⦃a b : C⦄, hom a b → hom (to_fun_ob a) (to_fun_ob b)),
|
|
|
|
|
(Π (a : C), to_fun_hom (ID a) = ID (to_fun_ob a)) ×
|
2014-12-18 02:49:37 +00:00
|
|
|
|
(Π {a b c : C} (g : hom b c) (f : hom a b),
|
2015-02-28 00:50:06 +00:00
|
|
|
|
to_fun_hom (g ∘ f) = to_fun_hom g ∘ to_fun_hom f)) ≃ (functor C D) :=
|
2014-12-18 02:49:37 +00:00
|
|
|
|
begin
|
2015-02-24 00:54:16 +00:00
|
|
|
|
fapply equiv.MK,
|
2015-09-22 17:11:33 +00:00
|
|
|
|
{intro S, induction S with d1 S2, induction S2 with d2 P1, induction P1 with P11 P12,
|
|
|
|
|
exact functor.mk d1 d2 P11 @P12},
|
|
|
|
|
{intro F, induction F with d1 d2 d3 d4, exact ⟨d1, @d2, (d3, @d4)⟩},
|
|
|
|
|
{intro F, induction F, reflexivity},
|
|
|
|
|
{intro S, induction S with d1 S2, induction S2 with d2 P1, induction P1, reflexivity},
|
2014-12-18 02:49:37 +00:00
|
|
|
|
end
|
2014-12-12 04:14:53 +00:00
|
|
|
|
|
2015-10-28 02:03:59 +00:00
|
|
|
|
definition change_fun [constructor] (F : C ⇒ D) (Fob : C → D)
|
|
|
|
|
(Fhom : Π⦃c c' : C⦄ (f : c ⟶ c'), Fob c ⟶ Fob c') (p : F = Fob) (q : F =[p] Fhom) : C ⇒ D :=
|
|
|
|
|
functor.mk
|
|
|
|
|
Fob
|
|
|
|
|
Fhom
|
|
|
|
|
proof abstract λa, transporto (λFo (Fh : Π⦃c c'⦄, _), Fh (ID a) = ID (Fo a))
|
|
|
|
|
q (respect_id F a) end qed
|
|
|
|
|
proof abstract λa b c g f, transporto (λFo (Fh : Π⦃c c'⦄, _), Fh (g ∘ f) = Fh g ∘ Fh f)
|
|
|
|
|
q (respect_comp F g f) end qed
|
|
|
|
|
|
2015-04-25 03:04:24 +00:00
|
|
|
|
section
|
2016-02-15 20:18:07 +00:00
|
|
|
|
local attribute precategory.is_set_hom [instance] [priority 1001]
|
2015-11-17 06:34:06 +00:00
|
|
|
|
local attribute trunctype.struct [instance] [priority 1] -- remove after #842 is closed
|
2016-02-15 20:18:07 +00:00
|
|
|
|
protected theorem is_set_functor [instance]
|
|
|
|
|
[HD : is_set D] : is_set (functor C D) :=
|
2015-04-25 04:20:59 +00:00
|
|
|
|
by apply is_trunc_equiv_closed; apply functor.sigma_char
|
2015-01-03 06:29:11 +00:00
|
|
|
|
end
|
|
|
|
|
|
2015-10-22 22:41:55 +00:00
|
|
|
|
/- higher equalities in the functor type -/
|
2015-03-13 22:27:29 +00:00
|
|
|
|
definition functor_mk_eq'_idp (F : C → D) (H : Π(a b : C), hom a b → hom (F a) (F b))
|
|
|
|
|
(id comp) : functor_mk_eq' id id comp comp (idpath F) (idpath H) = idp :=
|
2015-03-13 14:32:48 +00:00
|
|
|
|
begin
|
2015-10-22 22:41:55 +00:00
|
|
|
|
fapply apd011 (apd01111 functor.mk idp idp),
|
2016-02-15 20:18:07 +00:00
|
|
|
|
apply is_set.elim,
|
|
|
|
|
apply is_set.elim
|
2015-03-13 16:13:50 +00:00
|
|
|
|
end
|
|
|
|
|
|
2015-03-13 22:27:29 +00:00
|
|
|
|
definition functor_eq'_idp (F : C ⇒ D) : functor_eq' idp idp = (idpath F) :=
|
|
|
|
|
by (cases F; apply functor_mk_eq'_idp)
|
|
|
|
|
|
|
|
|
|
definition functor_eq_eta' {F₁ F₂ : C ⇒ D} (p : F₁ = F₂)
|
2016-03-19 14:38:05 +00:00
|
|
|
|
: functor_eq' (ap to_fun_ob p) (!tr_compose⁻¹ ⬝ apdt to_fun_hom p) = p :=
|
2015-03-13 16:13:50 +00:00
|
|
|
|
begin
|
2015-03-13 22:27:29 +00:00
|
|
|
|
cases p, cases F₁,
|
2015-10-22 22:41:55 +00:00
|
|
|
|
refine _ ⬝ !functor_eq'_idp,
|
2015-05-03 05:22:31 +00:00
|
|
|
|
esimp
|
2015-03-13 14:32:48 +00:00
|
|
|
|
end
|
|
|
|
|
|
2015-09-03 04:46:11 +00:00
|
|
|
|
theorem functor_eq2' {F₁ F₂ : C ⇒ D} {p₁ p₂ : to_fun_ob F₁ = to_fun_ob F₂} (q₁ q₂)
|
2015-03-13 22:27:29 +00:00
|
|
|
|
(r : p₁ = p₂) : functor_eq' p₁ q₁ = functor_eq' p₂ q₂ :=
|
2016-02-15 20:18:07 +00:00
|
|
|
|
by cases r; apply (ap (functor_eq' p₂)); apply is_prop.elim
|
2015-03-13 22:27:29 +00:00
|
|
|
|
|
2015-09-03 04:46:11 +00:00
|
|
|
|
theorem functor_eq2 {F₁ F₂ : C ⇒ D} (p q : F₁ = F₂) (r : ap010 to_fun_ob p ~ ap010 to_fun_ob q)
|
2015-03-13 14:32:48 +00:00
|
|
|
|
: p = q :=
|
|
|
|
|
begin
|
2015-04-30 18:00:39 +00:00
|
|
|
|
cases F₁ with ob₁ hom₁ id₁ comp₁,
|
|
|
|
|
cases F₂ with ob₂ hom₂ id₂ comp₂,
|
2015-03-13 22:27:29 +00:00
|
|
|
|
rewrite [-functor_eq_eta' p, -functor_eq_eta' q],
|
|
|
|
|
apply functor_eq2',
|
|
|
|
|
apply ap_eq_ap_of_homotopy,
|
|
|
|
|
exact r,
|
2015-03-13 14:32:48 +00:00
|
|
|
|
end
|
|
|
|
|
|
2015-09-03 04:46:11 +00:00
|
|
|
|
theorem ap010_apd01111_functor {F₁ F₂ : C → D} {H₁ : Π(a b : C), hom a b → hom (F₁ a) (F₁ b)}
|
2015-05-16 00:24:35 +00:00
|
|
|
|
{H₂ : Π(a b : C), hom a b → hom (F₂ a) (F₂ b)} {id₁ id₂ comp₁ comp₂}
|
|
|
|
|
(pF : F₁ = F₂) (pH : pF ▸ H₁ = H₂) (pid : cast (apd011 _ pF pH) id₁ = id₂)
|
|
|
|
|
(pcomp : cast (apd0111 _ pF pH pid) comp₁ = comp₂) (c : C)
|
|
|
|
|
: ap010 to_fun_ob (apd01111 functor.mk pF pH pid pcomp) c = ap10 pF c :=
|
2015-09-03 04:46:11 +00:00
|
|
|
|
by induction pF; induction pH; induction pid; induction pcomp; reflexivity
|
2015-03-13 14:32:48 +00:00
|
|
|
|
|
2015-06-17 19:58:58 +00:00
|
|
|
|
definition ap010_functor_eq {F₁ F₂ : C ⇒ D} (p : to_fun_ob F₁ ~ to_fun_ob F₂)
|
2015-09-22 17:11:33 +00:00
|
|
|
|
(q : (λ(a b : C) (f : hom a b), hom_of_eq (p b) ∘ F₁ f ∘ inv_of_eq (p a)) ~3 @(to_fun_hom F₂))
|
|
|
|
|
(c : C) : ap010 to_fun_ob (functor_eq p q) c = p c :=
|
2015-03-13 14:32:48 +00:00
|
|
|
|
begin
|
2015-05-16 00:24:35 +00:00
|
|
|
|
cases F₁ with F₁o F₁h F₁id F₁comp, cases F₂ with F₂o F₂h F₂id F₂comp,
|
|
|
|
|
esimp [functor_eq,functor_mk_eq,functor_mk_eq'],
|
|
|
|
|
rewrite [ap010_apd01111_functor,↑ap10,{apd10 (eq_of_homotopy p)}right_inv apd10]
|
2015-03-13 14:32:48 +00:00
|
|
|
|
end
|
2014-12-12 04:14:53 +00:00
|
|
|
|
|
2015-03-13 22:27:29 +00:00
|
|
|
|
definition ap010_functor_mk_eq_constant {F : C → D} {H₁ : Π(a b : C), hom a b → hom (F a) (F b)}
|
|
|
|
|
{H₂ : Π(a b : C), hom a b → hom (F a) (F b)} {id₁ id₂ comp₁ comp₂}
|
|
|
|
|
(pH : Π(a b : C) (f : hom a b), H₁ a b f = H₂ a b f) (c : C) :
|
|
|
|
|
ap010 to_fun_ob (functor_mk_eq_constant id₁ id₂ comp₁ comp₂ pH) c = idp :=
|
|
|
|
|
!ap010_functor_eq
|
|
|
|
|
|
2015-05-16 00:24:35 +00:00
|
|
|
|
definition ap010_assoc (H : C ⇒ D) (G : B ⇒ C) (F : A ⇒ B) (a : A) :
|
2015-05-19 05:35:18 +00:00
|
|
|
|
ap010 to_fun_ob (functor.assoc H G F) a = idp :=
|
2015-05-16 00:24:35 +00:00
|
|
|
|
by apply ap010_functor_mk_eq_constant
|
|
|
|
|
|
2015-03-13 22:27:29 +00:00
|
|
|
|
definition compose_pentagon (K : D ⇒ E) (H : C ⇒ D) (G : B ⇒ C) (F : A ⇒ B) :
|
|
|
|
|
(calc K ∘f H ∘f G ∘f F = (K ∘f H) ∘f G ∘f F : functor.assoc
|
|
|
|
|
... = ((K ∘f H) ∘f G) ∘f F : functor.assoc)
|
|
|
|
|
=
|
|
|
|
|
(calc K ∘f H ∘f G ∘f F = K ∘f (H ∘f G) ∘f F : ap (λx, K ∘f x) !functor.assoc
|
|
|
|
|
... = (K ∘f H ∘f G) ∘f F : functor.assoc
|
|
|
|
|
... = ((K ∘f H) ∘f G) ∘f F : ap (λx, x ∘f F) !functor.assoc) :=
|
2015-05-16 00:24:35 +00:00
|
|
|
|
begin
|
|
|
|
|
have lem1 : Π{F₁ F₂ : A ⇒ D} (p : F₁ = F₂) (a : A),
|
|
|
|
|
ap010 to_fun_ob (ap (λx, K ∘f x) p) a = ap (to_fun_ob K) (ap010 to_fun_ob p a),
|
|
|
|
|
by intros; cases p; esimp,
|
|
|
|
|
have lem2 : Π{F₁ F₂ : B ⇒ E} (p : F₁ = F₂) (a : A),
|
|
|
|
|
ap010 to_fun_ob (ap (λx, x ∘f F) p) a = ap010 to_fun_ob p (F a),
|
|
|
|
|
by intros; cases p; esimp,
|
|
|
|
|
apply functor_eq2,
|
|
|
|
|
intro a, esimp,
|
|
|
|
|
rewrite [+ap010_con,lem1,lem2,
|
|
|
|
|
ap010_assoc K H (G ∘f F) a,
|
|
|
|
|
ap010_assoc (K ∘f H) G F a,
|
|
|
|
|
ap010_assoc H G F a,
|
|
|
|
|
ap010_assoc K H G (F a),
|
|
|
|
|
ap010_assoc K (H ∘f G) F a],
|
|
|
|
|
end
|
2015-03-13 14:32:48 +00:00
|
|
|
|
|
|
|
|
|
end functor
|