2015-02-26 18:19:54 +00:00
|
|
|
/-
|
2015-04-25 04:20:59 +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.
|
2015-04-25 04:20:59 +00:00
|
|
|
Authors: Floris van Doorn, Jakob von Raumer
|
|
|
|
|
|
|
|
Category of hsets
|
2015-02-26 18:19:54 +00:00
|
|
|
-/
|
|
|
|
|
2015-04-25 04:20:59 +00:00
|
|
|
import ..category types.equiv
|
2015-02-26 18:19:54 +00:00
|
|
|
|
2015-04-25 04:20:59 +00:00
|
|
|
--open eq is_trunc sigma equiv iso is_equiv
|
|
|
|
open eq category equiv iso is_equiv is_trunc function sigma
|
2015-02-26 18:19:54 +00:00
|
|
|
|
|
|
|
namespace category
|
|
|
|
|
2015-04-25 04:20:59 +00:00
|
|
|
definition precategory_hset [reducible] : precategory hset :=
|
|
|
|
precategory.mk (λx y : hset, x → y)
|
|
|
|
(λx y z g f a, g (f a))
|
|
|
|
(λx a, a)
|
|
|
|
(λx y z w h g f, eq_of_homotopy (λa, idp))
|
|
|
|
(λx y f, eq_of_homotopy (λa, idp))
|
|
|
|
(λx y f, eq_of_homotopy (λa, idp))
|
|
|
|
|
|
|
|
definition Precategory_hset [reducible] : Precategory :=
|
|
|
|
Precategory.mk hset precategory_hset
|
|
|
|
|
2015-02-28 06:16:20 +00:00
|
|
|
namespace set
|
2015-03-03 21:38:18 +00:00
|
|
|
local attribute is_equiv_subtype_eq [instance]
|
|
|
|
definition iso_of_equiv {A B : Precategory_hset} (f : A ≃ B) : A ≅ B :=
|
|
|
|
iso.MK (to_fun f)
|
|
|
|
(equiv.to_inv f)
|
2015-04-27 19:39:36 +00:00
|
|
|
(eq_of_homotopy (left_inv (to_fun f)))
|
|
|
|
(eq_of_homotopy (right_inv (to_fun f)))
|
2015-03-03 21:38:18 +00:00
|
|
|
|
|
|
|
definition equiv_of_iso {A B : Precategory_hset} (f : A ≅ B) : A ≃ B :=
|
|
|
|
equiv.MK (to_hom f)
|
|
|
|
(iso.to_inv f)
|
|
|
|
(ap10 (right_inverse (to_hom f)))
|
|
|
|
(ap10 (left_inverse (to_hom f)))
|
|
|
|
|
|
|
|
definition is_equiv_iso_of_equiv (A B : Precategory_hset) : is_equiv (@iso_of_equiv A B) :=
|
|
|
|
adjointify _ (λf, equiv_of_iso f)
|
2015-05-30 23:44:26 +00:00
|
|
|
(λf, proof iso_eq idp qed)
|
2015-04-27 21:29:56 +00:00
|
|
|
(λf, equiv_eq idp)
|
2015-05-30 23:44:26 +00:00
|
|
|
|
2015-03-03 21:38:18 +00:00
|
|
|
local attribute is_equiv_iso_of_equiv [instance]
|
|
|
|
|
|
|
|
open sigma.ops
|
|
|
|
definition subtype_eq_inv {A : Type} {B : A → Type} [H : Πa, is_hprop (B a)] (u v : Σa, B a)
|
|
|
|
: u = v → u.1 = v.1 :=
|
2015-05-14 02:01:48 +00:00
|
|
|
(subtype_eq u v)⁻¹ᶠ
|
2015-03-03 21:38:18 +00:00
|
|
|
local attribute subtype_eq_inv [reducible]
|
|
|
|
definition is_equiv_subtype_eq_inv {A : Type} {B : A → Type} [H : Πa, is_hprop (B a)] (u v : Σa, B a)
|
|
|
|
: is_equiv (subtype_eq_inv u v) :=
|
|
|
|
_
|
|
|
|
|
|
|
|
definition iso_of_eq_eq_compose (A B : hset) : @iso_of_eq _ _ A B =
|
|
|
|
@iso_of_equiv A B ∘ @equiv_of_eq A B ∘ subtype_eq_inv _ _ ∘
|
|
|
|
@ap _ _ (to_fun (trunctype.sigma_char 0)) A B :=
|
|
|
|
eq_of_homotopy (λp, eq.rec_on p idp)
|
|
|
|
|
2015-02-28 06:16:20 +00:00
|
|
|
definition equiv_equiv_iso (A B : Precategory_hset) : (A ≃ B) ≃ (A ≅ B) :=
|
2015-03-03 21:38:18 +00:00
|
|
|
equiv.MK (λf, iso_of_equiv f)
|
2015-02-28 06:16:20 +00:00
|
|
|
(λf, equiv.MK (to_hom f)
|
|
|
|
(iso.to_inv f)
|
|
|
|
(ap10 (right_inverse (to_hom f)))
|
|
|
|
(ap10 (left_inverse (to_hom f))))
|
2015-04-27 21:29:56 +00:00
|
|
|
(λf, iso_eq idp)
|
|
|
|
(λf, equiv_eq idp)
|
2015-02-28 06:16:20 +00:00
|
|
|
|
|
|
|
definition equiv_eq_iso (A B : Precategory_hset) : (A ≃ B) = (A ≅ B) :=
|
|
|
|
ua !equiv_equiv_iso
|
|
|
|
|
2015-05-14 02:01:48 +00:00
|
|
|
definition is_univalent_hset (A B : Precategory_hset) : is_equiv (iso_of_eq : A = B → A ≅ B) :=
|
2015-03-03 21:38:18 +00:00
|
|
|
have H : is_equiv (@iso_of_equiv A B ∘ @equiv_of_eq A B ∘ subtype_eq_inv _ _ ∘
|
|
|
|
@ap _ _ (to_fun (trunctype.sigma_char 0)) A B), from
|
|
|
|
@is_equiv_compose _ _ _ _ _
|
|
|
|
(@is_equiv_compose _ _ _ _ _
|
|
|
|
(@is_equiv_compose _ _ _ _ _
|
|
|
|
_
|
|
|
|
(@is_equiv_subtype_eq_inv _ _ _ _ _))
|
|
|
|
!univalence)
|
|
|
|
!is_equiv_iso_of_equiv,
|
2015-05-01 03:23:12 +00:00
|
|
|
(iso_of_eq_eq_compose A B)⁻¹ ▸ H
|
2015-03-03 21:38:18 +00:00
|
|
|
end set
|
2015-02-26 18:19:54 +00:00
|
|
|
|
2015-05-14 02:01:48 +00:00
|
|
|
definition category_hset [instance] : category hset :=
|
2015-04-25 04:20:59 +00:00
|
|
|
category.mk precategory_hset set.is_univalent_hset
|
2015-02-26 18:19:54 +00:00
|
|
|
|
|
|
|
definition Category_hset [reducible] : Category :=
|
|
|
|
Category.mk hset category_hset
|
|
|
|
|
2015-04-25 04:20:59 +00:00
|
|
|
abbreviation set := Category_hset
|
2015-02-26 18:19:54 +00:00
|
|
|
end category
|