2015-09-24 02:44:36 +00:00
|
|
|
/-
|
|
|
|
Copyright (c) 2015 Floris van Doorn. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
Authors: Floris van Doorn
|
|
|
|
|
2015-10-27 22:02:00 +00:00
|
|
|
Cones of a diagram in a category
|
2015-09-24 02:44:36 +00:00
|
|
|
-/
|
|
|
|
|
2015-09-25 20:25:46 +00:00
|
|
|
import ..nat_trans ..category
|
2015-09-24 02:44:36 +00:00
|
|
|
|
2015-09-25 20:25:46 +00:00
|
|
|
open functor nat_trans eq equiv is_trunc is_equiv iso sigma sigma.ops pi
|
2015-09-24 02:44:36 +00:00
|
|
|
|
|
|
|
namespace category
|
|
|
|
|
|
|
|
structure cone_obj {I C : Precategory} (F : I ⇒ C) :=
|
|
|
|
(c : C)
|
|
|
|
(η : constant_functor I c ⟹ F)
|
|
|
|
|
2015-10-27 22:02:00 +00:00
|
|
|
variables {I C D : Precategory} {F : I ⇒ C} {x y z : cone_obj F} {i : I}
|
|
|
|
|
|
|
|
definition cone_to_obj [unfold 4] := @cone_obj.c
|
|
|
|
definition cone_to_nat [unfold 4] (c : cone_obj F) : constant_functor I (cone_to_obj c) ⟹ F :=
|
|
|
|
cone_obj.η c
|
|
|
|
|
|
|
|
local attribute cone_to_obj [coercion]
|
2015-09-24 02:44:36 +00:00
|
|
|
|
|
|
|
structure cone_hom (x y : cone_obj F) :=
|
|
|
|
(f : x ⟶ y)
|
2015-10-27 22:02:00 +00:00
|
|
|
(p : Πi, cone_to_nat y i ∘ f = cone_to_nat x i)
|
|
|
|
|
|
|
|
definition cone_to_hom [unfold 6] := @cone_hom.f
|
|
|
|
definition cone_to_eq [unfold 6] (f : cone_hom x y) (i : I)
|
|
|
|
: cone_to_nat y i ∘ (cone_to_hom f) = cone_to_nat x i :=
|
|
|
|
cone_hom.p f i
|
2015-09-24 02:44:36 +00:00
|
|
|
|
2015-10-27 22:02:00 +00:00
|
|
|
local attribute cone_to_hom [coercion]
|
2015-09-24 02:44:36 +00:00
|
|
|
|
|
|
|
definition cone_id [constructor] (x : cone_obj F) : cone_hom x x :=
|
|
|
|
cone_hom.mk id
|
|
|
|
(λi, !id_right)
|
|
|
|
|
|
|
|
definition cone_comp [constructor] (g : cone_hom y z) (f : cone_hom x y) : cone_hom x z :=
|
2015-10-27 22:02:00 +00:00
|
|
|
cone_hom.mk (cone_to_hom g ∘ cone_to_hom f)
|
|
|
|
abstract λi, by rewrite [assoc, +cone_to_eq] end
|
2015-09-24 02:44:36 +00:00
|
|
|
|
2015-10-27 22:02:00 +00:00
|
|
|
definition cone_obj_eq (p : cone_to_obj x = cone_to_obj y)
|
|
|
|
(q : Πi, cone_to_nat x i = cone_to_nat y i ∘ hom_of_eq p) : x = y :=
|
2015-09-25 20:25:46 +00:00
|
|
|
begin
|
|
|
|
induction x, induction y, esimp at *, induction p, apply ap (cone_obj.mk c),
|
|
|
|
apply nat_trans_eq, intro i, exact q i ⬝ !id_right
|
|
|
|
end
|
|
|
|
|
2015-10-27 22:02:00 +00:00
|
|
|
theorem c_cone_obj_eq (p : cone_to_obj x = cone_to_obj y)
|
|
|
|
(q : Πi, cone_to_nat x i = cone_to_nat y i ∘ hom_of_eq p) : ap cone_to_obj (cone_obj_eq p q) = p :=
|
2015-09-25 20:25:46 +00:00
|
|
|
begin
|
|
|
|
induction x, induction y, esimp at *, induction p,
|
|
|
|
esimp [cone_obj_eq], rewrite [-ap_compose,↑function.compose,ap_constant]
|
|
|
|
end
|
|
|
|
|
2015-10-27 22:02:00 +00:00
|
|
|
theorem cone_hom_eq {f f' : cone_hom x y} (q : cone_to_hom f = cone_to_hom f') : f = f' :=
|
2015-09-24 02:44:36 +00:00
|
|
|
begin
|
|
|
|
induction f, induction f', esimp at *, induction q, apply ap (cone_hom.mk f),
|
|
|
|
apply @is_hprop.elim, apply pi.is_trunc_pi, intro x, apply is_trunc_eq, -- type class fails
|
|
|
|
end
|
|
|
|
|
|
|
|
variable (F)
|
|
|
|
|
|
|
|
definition precategory_cone [instance] [constructor] : precategory (cone_obj F) :=
|
|
|
|
@precategory.mk _ cone_hom
|
|
|
|
abstract begin
|
|
|
|
intro x y,
|
2015-10-27 22:02:00 +00:00
|
|
|
assert H : cone_hom x y ≃ Σ(f : x ⟶ y), Πi, cone_to_nat y i ∘ f = cone_to_nat x i,
|
2015-09-24 02:44:36 +00:00
|
|
|
{ fapply equiv.MK,
|
|
|
|
{ intro f, induction f, constructor, assumption},
|
|
|
|
{ intro v, induction v, constructor, assumption},
|
|
|
|
{ intro v, induction v, reflexivity},
|
|
|
|
{ intro f, induction f, reflexivity}},
|
|
|
|
apply is_trunc.is_trunc_equiv_closed_rev, exact H,
|
|
|
|
fapply sigma.is_trunc_sigma, intros,
|
|
|
|
apply is_trunc_succ, apply pi.is_trunc_pi, intros, esimp,
|
|
|
|
/-exact _,-/ -- type class inference fails here
|
|
|
|
apply is_trunc_eq,
|
|
|
|
end end
|
|
|
|
(λx y z, cone_comp)
|
|
|
|
cone_id
|
|
|
|
abstract begin intros, apply cone_hom_eq, esimp, apply assoc end end
|
|
|
|
abstract begin intros, apply cone_hom_eq, esimp, apply id_left end end
|
|
|
|
abstract begin intros, apply cone_hom_eq, esimp, apply id_right end end
|
|
|
|
|
|
|
|
definition cone [constructor] : Precategory :=
|
|
|
|
precategory.Mk (precategory_cone F)
|
|
|
|
|
2015-09-25 20:25:46 +00:00
|
|
|
variable {F}
|
2015-10-27 22:02:00 +00:00
|
|
|
definition cone_iso_pr1 [constructor] (h : x ≅ y) : cone_to_obj x ≅ cone_to_obj y :=
|
2015-09-25 20:25:46 +00:00
|
|
|
iso.MK
|
2015-10-27 22:02:00 +00:00
|
|
|
(cone_to_hom (to_hom h))
|
|
|
|
(cone_to_hom (to_inv h))
|
|
|
|
(ap cone_to_hom (to_left_inverse h))
|
|
|
|
(ap cone_to_hom (to_right_inverse h))
|
2015-09-25 20:25:46 +00:00
|
|
|
|
|
|
|
|
2015-10-27 22:02:00 +00:00
|
|
|
definition cone_iso.mk [constructor] (f : cone_to_obj x ≅ cone_to_obj y)
|
|
|
|
(p : Πi, cone_to_nat y i ∘ to_hom f = cone_to_nat x i) : x ≅ y :=
|
2015-09-25 20:25:46 +00:00
|
|
|
begin
|
|
|
|
fapply iso.MK,
|
|
|
|
{ exact !cone_hom.mk p},
|
|
|
|
{ fapply cone_hom.mk,
|
|
|
|
{ exact to_inv f},
|
|
|
|
{ intro i, apply comp_inverse_eq_of_eq_comp, exact (p i)⁻¹}},
|
|
|
|
{ apply cone_hom_eq, esimp, apply left_inverse},
|
|
|
|
{ apply cone_hom_eq, esimp, apply right_inverse},
|
|
|
|
end
|
|
|
|
|
|
|
|
variables (x y)
|
2015-10-27 22:02:00 +00:00
|
|
|
definition cone_iso_equiv [constructor] : (x ≅ y) ≃ Σ(f : cone_to_obj x ≅ cone_to_obj y),
|
|
|
|
Πi, cone_to_nat y i ∘ to_hom f = cone_to_nat x i :=
|
2015-09-25 20:25:46 +00:00
|
|
|
begin
|
|
|
|
fapply equiv.MK,
|
2015-10-27 22:02:00 +00:00
|
|
|
{ intro h, exact ⟨cone_iso_pr1 h, cone_to_eq (to_hom h)⟩},
|
2015-09-25 20:25:46 +00:00
|
|
|
{ intro v, exact cone_iso.mk v.1 v.2},
|
|
|
|
{ intro v, induction v with f p, fapply sigma_eq: esimp,
|
|
|
|
{ apply iso_eq, reflexivity},
|
|
|
|
{ apply is_hprop.elimo, apply is_trunc_pi, intro i, apply is_hprop_hom_eq}},
|
|
|
|
{ intro h, esimp, apply iso_eq, apply cone_hom_eq, reflexivity},
|
|
|
|
end
|
|
|
|
|
2015-10-27 22:02:00 +00:00
|
|
|
definition cone_eq_equiv : (x = y) ≃ Σ(f : cone_to_obj x = cone_to_obj y),
|
|
|
|
Πi, cone_to_nat y i ∘ hom_of_eq f = cone_to_nat x i :=
|
2015-09-25 20:25:46 +00:00
|
|
|
begin
|
|
|
|
fapply equiv.MK,
|
2015-10-27 22:02:00 +00:00
|
|
|
{ intro r, fapply sigma.mk, exact ap cone_to_obj r, induction r, intro i, apply id_right},
|
2015-09-25 20:25:46 +00:00
|
|
|
{ intro v, induction v with p q, induction x with c η, induction y with c' η', esimp at *,
|
|
|
|
apply cone_obj_eq p, esimp, intro i, exact (q i)⁻¹},
|
|
|
|
{ intro v, induction v with p q, induction x with c η, induction y with c' η', esimp at *,
|
|
|
|
induction p, esimp, fapply sigma_eq: esimp,
|
|
|
|
{ apply c_cone_obj_eq},
|
|
|
|
{ apply is_hprop.elimo, apply is_trunc_pi, intro i, apply is_hprop_hom_eq}},
|
|
|
|
{ intro r, induction r, esimp, induction x, esimp, apply ap02, apply is_hprop.elim},
|
|
|
|
end
|
|
|
|
|
|
|
|
section is_univalent
|
|
|
|
|
|
|
|
definition is_univalent_cone {I : Precategory} {C : Category} (F : I ⇒ C)
|
|
|
|
: is_univalent (cone F) :=
|
|
|
|
begin
|
|
|
|
intro x y,
|
|
|
|
fapply is_equiv_of_equiv_of_homotopy,
|
|
|
|
{ exact calc
|
2015-10-27 22:02:00 +00:00
|
|
|
(x = y) ≃ (Σ(f : cone_to_obj x = cone_to_obj y), Πi, cone_to_nat y i ∘ hom_of_eq f = cone_to_nat x i)
|
2015-09-25 20:25:46 +00:00
|
|
|
: cone_eq_equiv
|
2015-10-27 22:02:00 +00:00
|
|
|
... ≃ (Σ(f : cone_to_obj x ≅ cone_to_obj y), Πi, cone_to_nat y i ∘ to_hom f = cone_to_nat x i)
|
2015-09-25 20:25:46 +00:00
|
|
|
: sigma_equiv_sigma !eq_equiv_iso (λa, !equiv.refl)
|
|
|
|
... ≃ (x ≅ y) : cone_iso_equiv },
|
|
|
|
{ intro p, induction p, esimp [equiv.trans,equiv.symm], esimp [sigma_functor],
|
|
|
|
apply iso_eq, reflexivity}
|
|
|
|
end
|
|
|
|
|
|
|
|
definition category_cone [instance] [constructor] {I : Precategory} {C : Category} (F : I ⇒ C)
|
|
|
|
: category (cone_obj F) :=
|
|
|
|
category.mk _ (is_univalent_cone F)
|
|
|
|
|
|
|
|
definition Category_cone [constructor] {I : Precategory} {C : Category} (F : I ⇒ C)
|
|
|
|
: Category :=
|
|
|
|
Category.mk _ (category_cone F)
|
|
|
|
|
|
|
|
end is_univalent
|
|
|
|
|
2015-10-27 22:02:00 +00:00
|
|
|
definition cone_obj_compose [constructor] (G : C ⇒ D) (x : cone_obj F) : cone_obj (G ∘f F) :=
|
|
|
|
begin
|
|
|
|
fapply cone_obj.mk,
|
|
|
|
{ exact G x},
|
|
|
|
{ fapply change_natural_map,
|
|
|
|
{ refine ((G ∘fn cone_to_nat x) ∘n _), apply nat_trans_of_eq, fapply functor_eq: esimp,
|
|
|
|
intro i j k, esimp, rewrite [id_leftright,respect_id]},
|
|
|
|
{ intro i, esimp, exact G (cone_to_nat x i)},
|
|
|
|
{ intro i, esimp, rewrite [ap010_functor_eq, ▸*, id_right]}}
|
|
|
|
end
|
2015-09-25 20:25:46 +00:00
|
|
|
|
2015-09-24 02:44:36 +00:00
|
|
|
end category
|