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;Γ-projβ,Γ-projβ, andΓ-hom-coare the same constructions for the binary product_Γᴬ_: the two projections, and the pairing of two homomorphisms out ofπ¨.
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.
Homomorphisms of binary products¶
The two projections out of a binary product π© Γᴬ πͺ are
homomorphisms, Γ-projβ onto π© and Γ-projβ onto
πͺ; the setoid equality of the product is the conjunction of the two coordinate
equalities, so each projection respects it by taking one conjunct.
module _ {π : Signature π π₯} {π© : Algebra {π = π} Ξ² Οα΅} {πͺ : Algebra {π = π} Ξ³ ΟαΆ} where -- The first projection π© Γ πͺ β π©. Γ-projβ : hom (π© Γᴬ πͺ) π© Γ-projβ = F , isHom where F : π»[ π© Γᴬ πͺ ] βΆ π»[ π© ] F β¨$β© x = projβ x F .cong xy = projβ xy isHom : IsHom (π© Γᴬ πͺ) π© F isHom .compatible = Setoid.refl π»[ π© ] -- The second projection π© Γ πͺ β πͺ. Γ-projβ : hom (π© Γᴬ πͺ) πͺ Γ-projβ = F , isHom where F : π»[ π© Γᴬ πͺ ] βΆ π»[ πͺ ] F β¨$β© x = projβ x F .cong xy = projβ xy isHom : IsHom (π© Γᴬ πͺ) πͺ F isHom .compatible = Setoid.refl π»[ πͺ ]
Two homomorphisms g : π¨ β π© and h : π¨ β πͺ out of one algebra pair to the
homomorphism Γ-hom-co g h : π¨ β π© Γᴬ πͺ, a β¦ (g a , h a); it is
the binary case of β¨
-hom-co, and composing it with either
projection gives back g or h on the nose.
module _ {π : Signature π π₯} {π¨ : Algebra {π = π} Ξ± Ο} {π© : Algebra {π = π} Ξ² Οα΅} {πͺ : Algebra {π = π} Ξ³ ΟαΆ} where -- The pairing a β¦ (g a , h a) of two homomorphisms out of π¨. Γ-hom-co : hom π¨ π© β hom π¨ πͺ β hom π¨ (π© Γᴬ πͺ) Γ-hom-co g h = F , isHom where F : π»[ π¨ ] βΆ π»[ π© Γᴬ πͺ ] F β¨$β© a = g .projβ β¨$β© a , h .projβ β¨$β© a F .cong xy = g .projβ .cong xy , h .projβ .cong xy isHom : IsHom π¨ (π© Γᴬ πͺ) F isHom .compatible = g .projβ .compatible , h .projβ .compatible
-
β¨ -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. ↩