module Cat.Functor.WideSubcategory where
Wide subcategoriesπ
A wide subcategory is specified by a predicate on the morphisms of rather than one on the objects. Since is nontrivial, we must take care that the result actually form a category: must contain the identities and be closed under composition.
To start, we package up all the data required to define a wide subcategory up into a record.
record Wide-subcat (β' : Level) : Type (o β β β lsuc β') where no-eta-equality field P : β {x y} β C.Hom x y β Type β' P-prop : β {x y} (f : C.Hom x y) β is-prop (P f) P-id : β {x} β P (C.id {x}) P-β : β {x y z} {f : C.Hom y z} {g : C.Hom x y} β P f β P g β P (f C.β g) open Wide-subcat
Morphisms of wide subcategories are defined as morphisms in where holds.
instance Membership-wide-subcat : β {o β β'} {C : Precategory o β} {x y} β Membership (C .Precategory.Hom x y) (Wide-subcat C β') β' Membership-wide-subcat = record { _β_ = Ξ» f W β Wide-subcat.P W f } module _ {o h} {C : Precategory o h} where private module C = Cat.Reasoning C variable β : Level open Precategory open Wide-subcat
record Wide-hom {β'} (sub : Wide-subcat C β') (x y : C.Ob) : Type (h β β') where no-eta-equality constructor wide field hom : C.Hom x y witness : hom β sub
open Wide-hom public Wide-hom-path : {sub : Wide-subcat C β} β {x y : C.Ob} β {f g : Wide-hom sub x y} β f .hom β‘ g .hom β f β‘ g Wide-hom-path {f = f} {g = g} p i .hom = p i Wide-hom-path {sub = sub} {f = f} {g = g} p i .witness = is-propβpathp (Ξ» i β sub .P-prop (p i)) (f .witness) (g .witness) i instance Extensional-wide-hom : β {β βr} {sub : Wide-subcat C β} {x y : C.Ob} β β¦ sa : Extensional (C.Hom x y) βr β¦ β Extensional (Wide-hom sub x y) βr Extensional-wide-hom β¦ sa β¦ = injectionβextensional! Wide-hom-path sa H-Level-Wide-hom : β {sub : Wide-subcat C β} {x y : C.Ob} {n} β H-Level (Wide-hom sub x y) (2 + n) H-Level-Wide-hom {sub = sub} = basic-instance 2 $ Isoβis-hlevel 2 eqv $ Ξ£-is-hlevel 2 (C.Hom-set _ _) Ξ» f β is-hlevel-suc 1 (sub .P-prop f) where unquoteDecl eqv = declare-record-iso eqv (quote Wide-hom)
We can then use this data to construct a category.
Wide : Wide-subcat C β β Precategory o (h β β) Wide sub .Ob = C.Ob Wide sub .Hom = Wide-hom sub Wide sub .Hom-set _ _ = hlevel 2 Wide sub .id .hom = C.id Wide sub .id .witness = sub .P-id Wide sub ._β_ f g .hom = f .hom C.β g .hom Wide sub ._β_ f g .witness = sub .P-β (f .witness) (g .witness) Wide sub .idr _ = ext $ C.idr _ Wide sub .idl _ = ext $ C.idl _ Wide sub .assoc _ _ _ = ext $ C.assoc _ _ _
From split essentially surjective inclusionsπ
There is another way of representing wide subcategories: By giving a pseudomonic split essential surjection
module _ {o' h'} {D : Precategory o' h'} {F : Functor D C} (pseudomonic : is-pseudomonic F) (eso : is-split-eso F) where open Functor F private module D = Cat.Reasoning D module eso x = C._β _ (eso x .snd)
We construct the wide subcategory by restricting to the morphisms in that lie in the image of Since is a faithful functor, this is indeed a proposition.
Split-eso-inclusionβWide-subcat : Precategory _ _ Split-eso-inclusionβWide-subcat = Wide sub where sub : Wide-subcat C (h β h') sub .P {x = x} {y = y} f = Ξ£[ g β D.Hom (eso x .fst) (eso y .fst) ] (eso.to y C.β Fβ g C.β eso.from x β‘ f) sub .P-prop {x} {y} f (g , p) (g' , q) = Ξ£-prop-path! $ is-pseudomonic.faithful pseudomonic $ C.isoβepic (eso x .snd C.Isoβ»ΒΉ) _ _ $ C.isoβmonic (eso y .snd) _ _ (p β sym q) sub .P-id {x} = (D.id , apβ C._β_ refl (C.eliml F-id) β C.invl (eso x .snd)) sub .P-β {x} {y} {z} {f} {g} (f' , p) (g' , q) = f' D.β g' , ( eso.to z C.β Fβ (f' D.β g') C.β eso.from x β‘β¨ C.push-inner (F-β f' g') β©β‘ (eso.to z C.β Fβ f') C.β (Fβ g' C.β eso.from x) β‘β¨ C.insert-inner (eso.invr y) β©β‘ ((eso.to z C.β Fβ f') C.β eso.from y) C.β (eso.to y C.β Fβ g' C.β eso.from x) β‘β¨ apβ C._β_ (sym (C.assoc _ _ _) β p) q β©β‘ f C.β g β)
This canonical wide subcategory is equivalent to
Wide-subcatβSplit-eso-domain : Functor (Split-eso-inclusionβWide-subcat) D Wide-subcatβSplit-eso-domain .Functor.Fβ x = eso x .fst Wide-subcatβSplit-eso-domain .Functor.Fβ f = f .witness .fst Wide-subcatβSplit-eso-domain .Functor.F-id = refl Wide-subcatβSplit-eso-domain .Functor.F-β _ _ = refl is-fully-faithful-Wide-subcatβdomain : is-fully-faithful Wide-subcatβSplit-eso-domain is-fully-faithful-Wide-subcatβdomain = is-isoβis-equiv $ iso (Ξ» f β wide (eso.to _ C.β Fβ f C.β eso.from _) (f , refl)) (Ξ» _ β refl) (Ξ» f β ext (f .witness .snd)) is-eso-Wide-subcatβdomain : is-split-eso Wide-subcatβSplit-eso-domain is-eso-Wide-subcatβdomain x = Fβ x , pseudomonicβessentially-injective pseudomonic (eso (Fβ x) .snd)
We did cheat a bit earlier when defining wide subcategories: our predicate isnβt required to respect isomorphisms! This means that we could form a βsubcategoryβ that kills off all the isomorphisms, which allows us to distinguish between isomorphic objects. Therefore, wide subcategories are not invariant under equivalence of categories.
This in turn means that the forgetful functor from a wide subcategory is not pseudomonic! To ensure that it is, we need to require that the predicate holds on all isomorphisms. Arguably this is something that should be part of the definition of a wide subcategory, but it isnβt strictly required, so we opt to leave it as a side condition.
module _ {sub : Wide-subcat C β} where private module Wide = Cat.Reasoning (Wide sub) open Functor
Forget-wide-subcat : Functor (Wide sub) C Forget-wide-subcat .Fβ x = x Forget-wide-subcat .Fβ f = f .hom Forget-wide-subcat .F-id = refl Forget-wide-subcat .F-β _ _ = refl is-faithful-Forget-wide-subcat : is-faithful Forget-wide-subcat is-faithful-Forget-wide-subcat = Wide-hom-path is-pseudomonic-Forget-wide-subcat : (P-invert : β {x y} {f : C.Hom x y} β C.is-invertible f β f β sub) β is-pseudomonic Forget-wide-subcat is-pseudomonic-Forget-wide-subcat P-invert .is-pseudomonic.faithful = is-faithful-Forget-wide-subcat is-pseudomonic-Forget-wide-subcat P-invert .is-pseudomonic.isos-full f = pure $ Wide.make-iso (wide f.to (P-invert (C.isoβinvertible f))) (wide f.from (P-invert (C.isoβinvertible (f C.Isoβ»ΒΉ)))) (ext f.invl) (ext f.invr) , trivial! where module f = C._β _ f is-split-eso-Forget-wide-subcat : is-split-eso Forget-wide-subcat is-split-eso-Forget-wide-subcat y = y , C.id-iso