Setoid.Categories.Algebra¶
The category of π-algebras¶
This is the Setoid.Categories.Algebra module of the Agda Universal Algebra Library.
Alg π Ξ± Ο assembles the π-algebras at levels (Ξ± , Ο) into a
Category: objects are Algebra Ξ± Ο, homs are the
setoid homomorphisms hom of Setoid.Homomorphisms, identity and composition are
πΎπΉ and β-hom, and the hom-equality _β_ is pointwise β two homomorphisms are
equal when their underlying maps agree on every element, in the codomain's setoid
equality. This pointwise hom-setoid is exactly what _β‘_ cannot provide under
--safe, and is why the Category record carries _β_ as a field.
The assoc and identity laws hold by the codomain's refl (the underlying maps are
definitionally equal β β-hom is function composition, πΎπΉ the identity map);
β-resp-β is the one law with content, combining the codomain's trans with a hom's
cong.
Pointwise equality of homomorphisms¶
_β_ : {π¨ π© : Algebra Ξ± Ο} β hom π¨ π© β hom π¨ π© β Type (Ξ± β Ο) _β_ {π¨ = π¨} {π©} f g = β (x : π[ π¨ ]) β Setoid._β_ π»[ π© ] (projβ f β¨$β© x) (projβ g β¨$β© x) β-equiv : {π¨ π© : Algebra Ξ± Ο} β IsEquivalence (_β_ {π¨ = π¨} {π©}) β-equiv {π© = π©} = record { refl = Ξ» _ β Setoid.refl π»[ π© ] ; sym = Ξ» fβg x β Setoid.sym π»[ π© ] (fβg x) ; trans = Ξ» fβg gβh x β Setoid.trans π»[ π© ] (fβg x) (gβh x) }
The category¶
Alg : (Ξ± Ο : Level) β Category (π β π₯ β lsuc (Ξ± β Ο)) (π β π₯ β Ξ± β Ο) (Ξ± β Ο) Alg Ξ± Ο = record { Obj = Algebra Ξ± Ο ; Hom = hom ; _β_ = _β_ ; id = πΎπΉ ; _β_ = Ξ» g f β β-hom f g ; β-equiv = β-equiv ; assoc = Ξ» {_} {_} {_} {π«} _ β Setoid.refl π»[ π« ] ; identityΛ‘ = Ξ» {_} {π©} _ β Setoid.refl π»[ π© ] ; identityΚ³ = Ξ» {_} {π©} _ β Setoid.refl π»[ π© ] ; β-resp-β = Ξ» {_} {_} {πͺ} {_} {g} {h} fβg hβi x β Setoid.trans π»[ πͺ ] (fβg (projβ h β¨$β© x)) (cong (projβ g) (hβi x)) }