open import Cat.Instances.Functor.Duality open import Cat.Instances.Functor open import Cat.Prelude import Cat.Reasoning module Cat.Diagram.Duals {o h} (C : Precategory o h) 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š
import Cat.Diagram.Product (C ^op) as Co-prod import Cat.Diagram.Coproduct C as Coprod is-co-productāis-coproduct : ā {A B P} {i1 : C.Hom A P} {i2 : C.Hom B P} ā Co-prod.is-product i1 i2 ā Coprod.is-coproduct i1 i2 is-co-productāis-coproduct isp = record { [_,_] = isp.āØ_,_ā© ; ināāfactor = isp.Ļāāfactor ; ināāfactor = isp.Ļāāfactor ; unique = isp.unique } where module isp = Co-prod.is-product isp is-coproductāis-co-product : ā {A B P} {i1 : C.Hom A P} {i2 : C.Hom B P} ā Coprod.is-coproduct i1 i2 ā Co-prod.is-product i1 i2 is-coproductāis-co-product iscop = record { āØ_,_ā© = iscop.[_,_] ; Ļāāfactor = iscop.ināāfactor ; Ļāāfactor = iscop.ināāfactor ; unique = iscop.unique } where module iscop = Coprod.is-coproduct iscop
Co/equalisersš
import Cat.Diagram.Equaliser (C ^op) as Co-equ import Cat.Diagram.Coequaliser C as Coequ is-co-equaliserāis-coequaliser : ā {A B E} {f g : C.Hom A B} {coeq : C.Hom B E} ā Co-equ.is-equaliser f g coeq ā Coequ.is-coequaliser f g coeq is-co-equaliserāis-coequaliser eq = record { coequal = eq.equal ; coequalise = eq.limiting ; universal = eq.universal ; unique = eq.unique } where module eq = Co-equ.is-equaliser eq is-coequaliserāis-co-equaliser : ā {A B E} {f g : C.Hom A B} {coeq : C.Hom B E} ā Coequ.is-coequaliser f g coeq ā Co-equ.is-equaliser f g coeq is-coequaliserāis-co-equaliser coeq = record { equal = coeq.coequal ; limiting = coeq.coequalise ; universal = coeq.universal ; unique = coeq.unique } where module coeq = Coequ.is-coequaliser coeq
Initial/terminalš
import Cat.Diagram.Terminal (C ^op) as Coterm import Cat.Diagram.Initial C as Init is-initialāis-coterminal : ā {A} ā Coterm.is-terminal A ā Init.is-initial A is-initialāis-coterminal x = x is-coterminalāis-initial : ā {A} ā Init.is-initial A ā Coterm.is-terminal A is-coterminalāis-initial x = x
Pullback/pushoutš
import Cat.Diagram.Pullback (C ^op) as Co-pull import Cat.Diagram.Pushout C as Push 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} ā Co-pull.is-pullback p1 f p2 g ā Push.is-pushout f p1 g p2 is-co-pullbackāis-pushout pb = record { square = pb.square ; colimiting = pb.limiting ; iāācolimiting = pb.pāālimiting ; iāācolimiting = pb.pāālimiting ; unique = pb.unique } where module pb = Co-pull.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} ā Push.is-pushout f p1 g p2 ā Co-pull.is-pullback p1 f p2 g is-pushoutāis-co-pullback po = record { square = po.square ; limiting = po.colimiting ; pāālimiting = po.iāācolimiting ; pāālimiting = po.iāācolimiting ; unique = po.unique } where module po = Push.is-pushout po
Co/conesš
open import Cat.Diagram.Colimit.Base open import Cat.Diagram.Limit.Base open import Cat.Diagram.Terminal open import Cat.Diagram.Initial 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 Terminal open Initial 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š
ColimitāCo-limit : Colimit F ā Limit F^op ColimitāCo-limit colim = lim where lim : Limit F^op lim .top = CoconeāCo-cone (colim .bot) lim .hasā¤ co-cone = retractāis-contr f g fg (colim .hasā„ (Co-coneāCocone co-cone)) where f : _ ā _ f x = subst (Ī» e ā Cone-hom F^op e _) (Co-coneāCoconeāCo-cone _) (Cocone-homāCo-cone-hom x) g : _ ā _ g x = subst (Ī» e ā Cocone-hom F e _) (CoconeāCo-coneāCocone _) (Co-cone-homāCocone-hom x) fg : is-left-inverse f g fg x = Cone-hom-path _ (transport-refl _ ā transport-refl _) Co-limitāColimit : Limit F^op ā Colimit F Co-limitāColimit lim = colim where colim : Colimit F colim .bot = Co-coneāCocone (lim .top) colim .hasā„ cocon = retractāis-contr f g fg (lim .hasā¤ (CoconeāCo-cone cocon)) where f : _ ā _ f x = subst (Ī» e ā Cocone-hom F _ e) (CoconeāCo-coneāCocone _) (Co-cone-homāCocone-hom x) g : _ ā _ g x = subst (Ī» e ā Cone-hom F^op _ e) (Co-coneāCoconeāCo-cone _) (Cocone-homāCo-cone-hom x) fg : is-left-inverse f g fg x = Cocone-hom-path _ (transport-refl _ ā transport-refl _) module _ {o ā} {J : Precategory o ā} {F Fā² : Functor J C} where private module JC = Cat.Reasoning Cat[ J , C ] Colimit-ap-iso : F JC.ā Fā² ā Colimit F ā Colimit Fā² Colimit-ap-iso f cl = Co-limitāColimit (Limit-ap-iso (op-natural-iso f) (ColimitāCo-limit cl))