Setoid.Homomorphisms.Products¶
Products of Homomorphisms of Algebras¶
This is the Setoid.Homomorphisms.Products module of the Agda Universal Algebra Library.
This module defines some of the homomorphisms associated with a product.
β¨ -hom-cois the induced map into a product: a family of homomorphisms out of a single algebraπ¨, one for each index, assembles into a single homomorphism fromπ¨to the product;β¨ -homtakes a family of homomorphismsπ i β β¬ ito their product,β¨ π β β¨ β¬;β¨ -projis the coordinate projectionβ¨ π β π i.
All three are defined coordinatewise, and their compatibility proofs are inherited
coordinatewise from the factors, because that is how β¨
of
Setoid.Algebras.Products interprets the operations in the first place.1
Suppose we have an algebra π¨, a type I : Type π, and a family
β¬ : I β Algebra Ξ² π of algebras. We sometimes refer to the inhabitants of I
as indices, and call β¬ an indexed family of algebras.
If in addition we have a family π½ : (i : I) β hom π¨ (β¬ i) of homomorphisms, then
we can construct a homomorphism from π¨ to the product β¨
β¬ in the natural way.
module _ {π : Signature π π₯} {π¨ : Algebra {π = π} Ξ± Ο } {I : Type π} (β¬ : I β Algebra Ξ² Οα΅) where β¨ -hom-co : (β(i : I) β hom π¨ (β¬ i)) β hom π¨ (β¨ β¬) β¨ -hom-co π½ = h , hhom where h : π»[ π¨ ] βΆ π»[ β¨ β¬ ] h β¨$β© a = Ξ» i β π½ i .projβ β¨$β© a h .cong xy = Ξ» i β π½ i .projβ .cong xy hhom : IsHom π¨ (β¨ β¬) h hhom .compatible = Ξ» i β π½ i .projβ .compatible
If we are given π : I β Algebra Ξ± π and β¬ : I β Algebra Ξ² π
(two families of π-algebras), then a family π½ of homomorphisms inhabits the
dependent type β (i : I) β hom (π i) (β¬ i), from which we construct a homomorphism
from β¨
π to β¨
β¬ in the following natural way.
module _ {π : Signature π π₯} {I : Type π} (π : I β Algebra {π = π} Ξ± Ο) where β¨ -hom : (β¬ : I β Algebra Ξ² Οα΅) β (β (i : I) β hom (π i) (β¬ i)) β hom (β¨ π)(β¨ β¬) β¨ -hom β¬ π½ = F , isHom where F : π»[ β¨ π ] βΆ π»[ β¨ β¬ ] F β¨$β© x = Ξ» i β π½ i .projβ β¨$β© x i F .cong xy = Ξ» i β π½ i .projβ .cong (xy i) isHom : IsHom (β¨ π) (β¨ β¬) F isHom .compatible = Ξ» i β π½ i .projβ .compatible
Projection out of products¶
The projection of a product algebra onto its i-th factor is a homomorphism.
β¨ -proj : (i : I) β hom (β¨ π) (π i) β¨ -proj i = F , isHom where F : π»[ β¨ π ] βΆ π»[ π i ] F β¨$β© x = x i F .cong xy = xy i isHom : IsHom (β¨ π) (π i) F isHom .compatible = Setoid.refl π»[ π i ]
We could prove a more general result involving projections onto multiple factors, but so far the single-factor result has sufficed.
-
β¨ -hom-codoes real work later: the proof of Birkhoff's theorem in Setoid.Varieties.HSP uses it to build the homomorphismhomβfrom the term algebra into the productβthat the whole argument turns on. ↩