open import Cat.Diagram.Limit.Base open import Cat.Instances.Discrete open import Cat.Diagram.Terminal open import Cat.Prelude module Cat.Diagram.Product.Indexed {o β} (C : Precategory o β) where
Indexed productsπ
If a category admits a terminal object and binary products, then it admits products of any finite cardinality: iterate the binary product, and use the terminal object when there arenβt any objects. However, these two classes of limit do not let us speak of products of arbitrary cardinality, or, in the univalent context, indexed by types which are not sets.
Thatβs where -indexed products come in: Rather than having a functor giving the objects to take the limit over, we have an arbitrary map from to the space of objects of . An indexed product for this βdiagramβ is then an object admitting an universal family of maps .
record is-indexed-product (F : Idx β C.Ob) (Ο : β i β C.Hom P (F i)) : Type (o β β β level-of Idx) where no-eta-equality field tuple : β {Y} β (β i β C.Hom Y (F i)) β C.Hom Y P commute : β {i} {Y} {f : β i β C.Hom Y (F i)} β Ο i C.β tuple f β‘ f i unique : β {Y} {h : C.Hom Y P} (f : β i β C.Hom Y (F i)) β (β i β Ο i C.β h β‘ f i) β h β‘ tuple f eta : β {Y} (h : C.Hom Y P) β h β‘ tuple Ξ» i β Ο i C.β h eta h = unique _ Ξ» _ β refl hom-iso : β {Y} β C.Hom Y P β (β i β C.Hom Y (F i)) hom-iso = (Ξ» f i β Ο i C.β f) , is-isoβis-equiv Ξ» where .is-iso.inv β tuple .is-iso.rinv x β funext Ξ» i β commute .is-iso.linv x β sym (unique _ Ξ» _ β refl)
A category admits indexed products (of level ) if, for any type and family , there is an indexed product of .
record Indexed-product (F : Idx β C.Ob) : Type (o β β β level-of Idx) where no-eta-equality field {Ξ F} : C.Ob Ο : β i β C.Hom Ξ F (F i) has-is-ip : is-indexed-product F Ο open is-indexed-product has-is-ip public has-indexed-products : β β β Type _ has-indexed-products β = β {I : Type β} (F : I β C.Ob) β Indexed-product F
As limitsπ
In the particular case where is a groupoid, e.g.Β because it arises as the space of objects of a univalent category, an indexed product for is the same thing as a limit over , considered as a functor . We can not lift this restriction: If is not a groupoid, then its path spaces are not necessarily sets, and so the Disc construction does not apply to it.
module _ {I : Type β'} (i-is-grpd : is-groupoid I) (F : I β C.Ob) where open Cone-hom open Terminal open Cone IPβLimit : Indexed-product F β Limit {C = C} (Disc-adjunct {iss = i-is-grpd} F) IPβLimit IP = lim where module IP = Indexed-product IP thelim : Cone _ thelim .apex = IP.Ξ F thelim .Ο = IP.Ο thelim .commutes {x} = J (Ξ» y p β subst (C.Hom (F x) β F) p C.id C.β (IP.Ο x) β‘ IP.Ο y) (C.eliml (transport-refl _)) lim : Limit _ lim .top = thelim lim .hasβ€ x .centre .hom = IP.tuple (x .Ο) lim .hasβ€ x .centre .commutes o = IP.commute lim .hasβ€ x .paths h = Cone-hom-path _ (sym (IP.unique _ Ξ» i β h .commutes _)) module _ {I : Type β'} (isg : is-groupoid I) (F : Functor (Disc I isg) C) where private module F = Functor F open is-indexed-product open Indexed-product open Cone-hom open Terminal open Cone ProjβCone : β {Y} β (β i β C.Hom Y (F.β i)) β Cone F ProjβCone f .apex = _ ProjβCone f .Ο = f ProjβCone f .commutes {x} = J (Ξ» y p β F.β p C.β f x β‘ f y) (C.eliml F.F-id) LimitβIP : Limit {C = C} F β Indexed-product F.β LimitβIP lim = the-ip where module lim = Cone (lim .top) the-ip : Indexed-product _ the-ip .Ξ F = lim.apex the-ip .Ο = lim.Ο the-ip .has-is-ip .tuple f = lim .hasβ€ (ProjβCone f) .centre .hom the-ip .has-is-ip .commute = lim .hasβ€ (ProjβCone _) .centre .commutes _ the-ip .has-is-ip .unique {h = h} f p i = lim .hasβ€ (ProjβCone f) .paths other (~ i) .hom where other : Cone-hom _ _ _ other .hom = h other .commutes i = p i
Uniquenessπ
As is traditional with universal constructions, βhaving an indexed product for a diagramβ is property of a category, not structure: Put another way, for any particular diagram, in a univalent category, there is (at most) a contractible space of indexed products of that diagram. And again as is traditional with universal constructions, the proof is surprisingly straightforward!
Indexed-product-unique : β {ββ²} {I : Type ββ²} (F : I β C.Ob) β is-category C β is-prop (Indexed-product F) Indexed-product-unique {I = I} F c-cat x y = p where module x = Indexed-product x module y = Indexed-product y
All we have to do β βallβ β is exhibit an isomorphism between the apices which commutes with the projection function in one direction, and with the product with morphisms in the other. Thatβs it! The isomorphism is induced by the universal properties, and is readily seen to commute with both projections:
apices : x.Ξ F C.β y.Ξ F apices = C.make-iso (y.tuple x.Ο) (x.tuple y.Ο) ( y.unique y.Ο (Ξ» i β C.pulll y.commute β x.commute) β sym (y.unique y.Ο Ξ» i β C.idr _) ) ( x.unique x.Ο (Ξ» i β C.pulll x.commute β y.commute) β sym (x.unique x.Ο Ξ» i β C.idr _))
By the characterisation of paths-over in Hom-sets, we get paths-over between the projection maps and the product maps:
module apices = C._β _ apices abstract pres : β j β PathP (Ξ» i β C.Hom (c-cat .to-path apices i) (F j)) (x.Ο j) (y.Ο j) pres j = Univalent.Hom-pathp-refll-iso c-cat x.commute presβ² : β {Y} (f : β j β C.Hom Y (F j)) β PathP (Ξ» i β C.Hom Y (c-cat .to-path apices i)) (x.tuple f) (y.tuple f) presβ² f = Univalent.Hom-pathp-reflr-iso c-cat (y.unique f Ξ» j β C.pulll y.commute β x.commute)
And after some munging (dealing with the axioms), thatβs exactly what we need to prove that indexed products are unique.
open Indexed-product open is-indexed-product p : x β‘ y p i .Ξ F = c-cat .to-path apices i p i .Ο j = pres j i p i .has-is-ip .tuple f = presβ² f i p i .has-is-ip .commute {i = j} {f = f} = is-propβpathp (Ξ» i β C.Hom-set _ (F j) (pres j i C.β presβ² f i) _) (x .has-is-ip .commute) (y .has-is-ip .commute) i p i .has-is-ip .unique {h = h} f = is-propβpathp (Ξ» i β Ξ -is-hlevel {A = C.Hom _ (c-cat .to-path apices i)} 1 Ξ» h β Ξ -is-hlevel {A = β j β pres j i C.β h β‘ f j} 1 Ξ» p β C.Hom-set _ (c-cat .to-path apices i) h (presβ² f i)) (Ξ» h β x.unique {h = h} f) (Ξ» h β y.unique {h = h} f) i h