module Cat.Diagram.Duals where
Dualities of diagramsš
Following Hu and Carette, weāve opted to have different concrete definitions for diagrams and their opposites. In particular, we have the following pairs of āredundantā definitions:
- Products and coproducts
- Pullbacks and pushouts
- Equalisers and coequalisers
- Terminal objects and initial objects
For all four of the above pairs, we have that one in is the other in We prove these correspondences here:
Co/productsš
is-co-productāis-coproduct : ā {A B P} {i1 : C.Hom A P} {i2 : C.Hom B P} ā is-product (C ^op) i1 i2 ā is-coproduct C i1 i2 is-co-productāis-coproduct isp = record { [_,_] = isp.āØ_,_ā© ; []āĪ¹ā = isp.ĻāāāØā© ; []āĪ¹ā = isp.ĻāāāØā© ; unique = isp.unique } where module isp = is-product isp is-coproductāis-co-product : ā {A B P} {i1 : C.Hom A P} {i2 : C.Hom B P} ā is-coproduct C i1 i2 ā is-product (C ^op) i1 i2 is-coproductāis-co-product iscop = record { āØ_,_ā© = iscop.[_,_] ; ĻāāāØā© = iscop.[]āĪ¹ā ; ĻāāāØā© = iscop.[]āĪ¹ā ; unique = iscop.unique } where module iscop = is-coproduct iscop
Co/equalisersš
is-co-equaliserāis-coequaliser : ā {A B E} {f g : C.Hom A B} {coeq : C.Hom B E} ā is-equaliser (C ^op) f g coeq ā is-coequaliser C f g coeq is-co-equaliserāis-coequaliser eq = record { coequal = eq.equal ; universal = eq.universal ; factors = eq.factors ; unique = eq.unique } where module eq = is-equaliser eq is-coequaliserāis-co-equaliser : ā {A B E} {f g : C.Hom A B} {coeq : C.Hom B E} ā is-coequaliser C f g coeq ā is-equaliser (C ^op) f g coeq is-coequaliserāis-co-equaliser coeq = record { equal = coeq.coequal ; universal = coeq.universal ; factors = coeq.factors ; unique = coeq.unique } where module coeq = is-coequaliser coeq
Initial/terminalš
open Terminal open Initial is-coterminalāis-initial : ā {A} ā is-terminal (C ^op) A ā is-initial C A is-coterminalāis-initial x = x is-initialāis-coterminal : ā {A} ā is-initial C A ā is-terminal (C ^op) A is-initialāis-coterminal x = x CoterminalāInitial : Terminal (C ^op) ā Initial C CoterminalāInitial term .bot = term .top CoterminalāInitial term .hasā„ = is-coterminalāis-initial (term .hasā¤) InitialāCoterminal : Initial C ā Terminal (C ^op) InitialāCoterminal init .top = init .bot InitialāCoterminal init .hasā¤ = is-initialāis-coterminal (init .hasā„)
Pullback/pushoutš
is-co-pullbackāis-pushout : ā {P X Y Z} {p1 : C.Hom X P} {f : C.Hom Z X} {p2 : C.Hom Y P} {g : C.Hom Z Y} ā is-pullback (C ^op) p1 f p2 g ā is-pushout C f p1 g p2 is-co-pullbackāis-pushout pb = record { square = pb.square ; universal = pb.universal ; universalāiā = pb.pāāuniversal ; universalāiā = pb.pāāuniversal ; unique = pb.unique } where module pb = is-pullback pb is-pushoutāis-co-pullback : ā {P X Y Z} {p1 : C.Hom X P} {f : C.Hom Z X} {p2 : C.Hom Y P} {g : C.Hom Z Y} ā is-pushout C f p1 g p2 ā is-pullback (C ^op) p1 f p2 g is-pushoutāis-co-pullback po = record { square = po.square ; universal = po.universal ; pāāuniversal = po.universalāiā ; pāāuniversal = po.universalāiā ; unique = po.unique } where module po = is-pushout po
Co/conesš
module _ {o ā} {J : Precategory o ā} {F : Functor J C} where open Functor F renaming (op to F^op) open Cocone-hom open Cone-hom open Cocone open Cone Co-coneāCocone : Cone F^op ā Cocone F Co-coneāCocone cone .coapex = cone .apex Co-coneāCocone cone .Ļ = cone .Ļ Co-coneāCocone cone .commutes = cone .commutes CoconeāCo-cone : Cocone F ā Cone F^op CoconeāCo-cone cone .apex = cone .coapex CoconeāCo-cone cone .Ļ = cone .Ļ CoconeāCo-cone cone .commutes = cone .commutes CoconeāCo-coneāCocone : ā K ā Co-coneāCocone (CoconeāCo-cone K) ā” K CoconeāCo-coneāCocone K i .coapex = K .coapex CoconeāCo-coneāCocone K i .Ļ = K .Ļ CoconeāCo-coneāCocone K i .commutes = K .commutes Co-coneāCoconeāCo-cone : ā K ā CoconeāCo-cone (Co-coneāCocone K) ā” K Co-coneāCoconeāCo-cone K i .apex = K .apex Co-coneāCoconeāCo-cone K i .Ļ = K .Ļ Co-coneāCoconeāCo-cone K i .commutes = K .commutes Co-cone-homāCocone-hom : ā {x y} ā Cone-hom F^op y x ā Cocone-hom F (Co-coneāCocone x) (Co-coneāCocone y) Co-cone-homāCocone-hom ch .hom = ch .hom Co-cone-homāCocone-hom ch .commutes o = ch .commutes o Cocone-homāCo-cone-hom : ā {x y} ā Cocone-hom F x y ā Cone-hom F^op (CoconeāCo-cone y) (CoconeāCo-cone x) Cocone-homāCo-cone-hom ch .hom = ch .hom Cocone-homāCo-cone-hom ch .commutes = ch .commutes
Co/limitsš
Limits and colimits are defined via Kan extensions, so itās reasonable
to expect that duality of Kan
extensions would apply to (co)limits. Unfortunately, proof
assistants: (co)limits are extensions of !F
, but duality of Kan extensions inserts
an extra Functor.op
. We could work around this, but itās
easier to just do the proofs by hand.
ColimitāCo-limit : Colimit F ā Limit F^op ColimitāCo-limit colim = to-limit (to-is-limit ml) where module colim = Colimit colim open make-is-limit ml : make-is-limit F^op colim.coapex ml .Ļ = colim.Ļ ml .commutes = colim.commutes ml .universal eps p = colim.universal eps p ml .factors eps p = colim.factors eps p ml .unique eps p other q = colim.unique eps p other q Co-limitāColimit : Limit F^op ā Colimit F Co-limitāColimit lim = to-colimit (to-is-colimit mc) where module lim = Limit lim open make-is-colimit mc : make-is-colimit F lim.apex mc .Ļ = lim.Ļ mc .commutes = lim.commutes mc .universal eta p = lim.universal eta p mc .factors eta p = lim.factors eta p mc .unique eta p other q = lim.unique eta p other q