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
: β {Y} β (β i β C.Hom Y (F i)) β C.Hom Y P
tuple : β {i} {Y} {f : β i β C.Hom Y (F i)} β Ο i C.β tuple f β‘ f i
commute : β {Y} {h : C.Hom Y P} (f : β i β C.Hom Y (F i))
unique β (β i β Ο i C.β h β‘ f i)
β h β‘ tuple f
: β {Y} (h : C.Hom Y P) β h β‘ tuple Ξ» i β Ο i C.β h
eta = unique _ Ξ» _ β refl
eta h
: β {Y} {g h : C.Hom Y P} β (β i β Ο i C.β g β‘ Ο i C.β h) β g β‘ h
uniqueβ {g = g} {h} eq = eta g β ap tuple (funext eq) β sym (eta h)
uniqueβ
: β {Y} β C.Hom Y P β (β i β C.Hom Y (F i))
hom-iso = (Ξ» f i β Ο i C.β f) , is-isoβis-equiv Ξ» where
hom-iso .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)
Ο : is-indexed-product F Ο
has-is-ip open is-indexed-product has-is-ip public
: β {β} (I : Type β) β Type _
has-products-indexed-by = β (F : I β C.Ob) β Indexed-product F
has-products-indexed-by I
: β β β Type _
has-indexed-products = β {I : Type β} β has-products-indexed-by I has-indexed-products β
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)
{I = I} F c-cat x y = p where
Indexed-product-unique 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:
: x.Ξ F C.β
y.Ξ F
apices = C.make-iso (y.tuple x.Ο) (x.tuple y.Ο)
apices ( y.unique y.Ο (Ξ» i β C.pulll y.commute β x.commute)
(y.unique y.Ο Ξ» i β C.idr _) )
β sym ( x.unique x.Ο (Ξ» i β C.pulll x.commute β y.commute)
(x.unique x.Ο Ξ» i β C.idr _)) β sym
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
: β j β PathP (Ξ» i β C.Hom (c-cat .to-path apices i) (F j)) (x.Ο j) (y.Ο j)
pres = Univalent.Hom-pathp-refll-iso c-cat x.commute
pres j
: β {Y} (f : β j β C.Hom Y (F j))
pres' β PathP (Ξ» i β C.Hom Y (c-cat .to-path apices i)) (x.tuple f) (y.tuple f)
=
pres' f .Hom-pathp-reflr-iso c-cat (y.unique f Ξ» j β C.pulll y.commute β x.commute) Univalent
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
: x β‘ y
p .Ξ 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} =
p i (Ξ» i β C.Hom-set _ (F j) (pres j i C.β pres' f i) _)
is-propβpathp (x .has-is-ip .commute) (y .has-is-ip .commute) i
.has-is-ip .unique {h = h} f =
p i
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
We can also prove the converse direction: if indexed products in are unique, then is univalent. In fact, we only need limits of one-object diagrams to be unique.
unique-productsβis-category: ({x : C.Ob} β is-prop (Indexed-product {Idx = β€} (Ξ» _ β x)))
β is-category C
= cat where unique-productsβis-category prop
Given an isomorphism , we build two products for the one-object diagram : one with apex itself and identity as projection, and one with apex and the given isomorphism as projection.
module _ {a b : C.Ob} (is : a C.β
b) where
open Indexed-product
open is-indexed-product
: Indexed-product {Idx = β€} (Ξ» _ β a)
Pa .Ξ F = a
Pa .Ο _ = C.id
Pa .has-is-ip .tuple f = f _
Pa .has-is-ip .commute = C.idl _
Pa .has-is-ip .unique f p = sym (C.idl _) β p _
Pa
: Indexed-product {Idx = β€} (Ξ» _ β a)
Pb .Ξ F = b
Pb .Ο _ = is .C.from
Pb .has-is-ip .tuple f = is .C.to C.β f _
Pb .has-is-ip .commute = C.cancell (is .C.invr)
Pb .has-is-ip .unique f p = sym (C.lswizzle (sym (p _)) (is .C.invl)) Pb
By uniqueness, the two products are equal, which gives us an equality lying over our isomorphism.
: a β‘ b
path = ap Ξ F (prop Pa Pb)
path
: PathP (Ξ» i β a C.β
path i) C.id-iso is
path-over = C.β
-pathp-from _ _ (ap (Ξ» p β p .Ο _) (prop Pa Pb))
path-over
: is-category C
cat .to-path = path
cat .to-path-over = path-over cat