Setoid.Homomorphisms.HomomorphicImages¶
n--- layout: default title : "Setoid.Homomorphisms.HomomorphicImages module (The Agda Universal Algebra Library)" date : "2021-09-14" author: "agda-algebras development team"
Homomorphic images of setoid algebras¶
This is the Setoid.Homomorphisms.HomomorphicImages module of the Agda Universal Algebra Library.
We begin with what seems, for our purposes, the most useful way to represent the class of homomorphic images of an algebra in dependent type theory.
open IsHom _IsHomImageOf_ : (π© : Algebra {π = π} Ξ² Οα΅)(π¨ : Algebra {π = π} Ξ± Οα΅) β Type _ π© IsHomImageOf π¨ = Ξ£[ (Ο , _ ) β hom π¨ π© ] IsSurjective Ο HomImages : Algebra {π = π} Ξ± Οα΅ β Type (Ξ± β Οα΅ β ov {π = π} (Ξ² β Οα΅)) HomImages {Ξ² = Ξ²}{Οα΅} π¨ = Ξ£[ π© β Algebra Ξ² Οα΅ ] π© IsHomImageOf π¨ IdHomImage : {π¨ : Algebra {π = π} Ξ± Οα΅} β π¨ IsHomImageOf π¨ IdHomImage {π¨ = π¨} = πΎπΉ , Ξ» {y} β Image_β_.eq y (Setoid.refl π»[ π¨ ])
These types should be self-explanatory, but just to be sure, let's describe the
Sigma type appearing in the second definition. Given an π-algebra
π¨ : Algebra Ξ± Ο, the type HomImages π¨ denotes the class π¦ of algebras such
that π© β π¦ provided there is a surjective homomorphism from π¨ to π©.
The image algebra of a hom¶
Here we show how to construct a Algebra (called ImageAlgebra below) that is
the image of given hom.
module _ {π¨ : Algebra {π = π} Ξ± Οα΅}{π© : Algebra {π = π} Ξ² Οα΅} where open Algebra π© using () renaming (Domain to B ; Interp to InterpB ) open Setoid B using () renaming ( _β_ to _ββ_ ; trans to transβ ) open Func using ( cong ) renaming ( to to _β¨$β©_ ) HomImageOf[_] : hom π¨ π© β Algebra {π = π} (Ξ± β Ξ² β Οα΅) Οα΅ HomImageOf[ (h , hh) ] = record { Domain = Ran h ; Interp = record { to = f' ; cong = cong' } } where open Setoid(β¨ π β© (Ran h)) using() renaming (Carrier to SRanh ; _β_ to _ββ_ ) hhom : β {π}(x : ArityOf π π β range h) β h β¨$β© (π ^ π¨) (preimage h β x) ββ (π ^ π©) (image h β x) hhom {π} x = transβ (hh .compatible) (cong InterpB (refl , preimageβimage h β x)) f' : SRanh β range h f' (π , x) = (π ^ π©)(image h β x) -- b : the image in β£Bβ£ , (π ^ π¨)(preimage h β x) -- a : the preimage in β£Aβ£ , hhom x -- p : proof that h β¨$β© a ββ b cong' : β {x y} β x ββ y β (image h) (f' x) ββ (image h) (f' y) cong' {(π , u)} {(.π , v)} (refl , EqA) = Goal where -- Alternative formulation of the goal: goal : (π ^ π©)(Ξ» i β (image h)(u i)) ββ (π ^ π©)(Ξ» i β (image h) (v i)) goal = cong InterpB (refl , EqA ) Goal : (image h) (f' (π , u)) ββ (image h) (f' (π , v)) Goal = goal -- Note: `EqA : β i β (image h) (u i) ββ (image h) (v i)`
Homomorphic images of classes of setoid algebras¶
Given a class π¦ of π-algebras, we need a type that expresses the assertion that a given algebra is a homomorphic image of some algebra in the class, as well as a type that represents all such homomorphic images.
IsHomImageOfClass : {π¦ : Pred (Algebra {π = π} Ξ± Οα΅)(suc Ξ±)} β Algebra {π = π} Ξ± Οα΅ β Type (ov {π = π} (Ξ± β Οα΅)) IsHomImageOfClass {π¦ = π¦} π© = Ξ£[ π¨ β Algebra _ _ ] ((π¨ β π¦) β§ (π© IsHomImageOf π¨)) HomImageOfClass : Pred (Algebra {π = π} Ξ± Οα΅) (suc Ξ±) β Type (ov {π = π} (Ξ± β Οα΅)) HomImageOfClass π¦ = Ξ£[ π© β Algebra _ _ ] IsHomImageOfClass {π¦ = π¦} π©
Lifting tools¶
Here are some tools that have been useful (e.g., in the road to the proof of Birkhoff's HSP theorem). The first states and proves the simple fact that the lift of an epimorphism is an epimorphism.
module _ {π¨ : Algebra {π = π} Ξ± Οα΅}{π© : Algebra {π = π} Ξ² Οα΅} where open Setoid π»[ π© ] using ( sym ; trans ) renaming ( _β_ to _ββ_ ) open Func using ( cong ) renaming ( to to _β¨$β©_ ) open Level using ( lift ; lower ) Lift-epi-is-epiΛ‘ : (h : hom π¨ π©)(βα΅ βα΅ : Level) β IsSurjective (projβ h) β IsSurjective (projβ (Lift-homΛ‘ {π¨ = π¨}{π©} h βα΅ βα΅)) Lift-epi-is-epiΛ‘ h βα΅ βα΅ hepi {b} = Goal where open Setoid π»[ Lift-AlgΛ‘ π© βα΅ ] using ( _β_ ) a : π[ π¨ ] a = Inv (h .projβ) hepi lem1 : b β lift (lower b) lem1 = liftβΌlower {π¨ = π»[ π© ]} b lem2' : lower b ββ h .projβ β¨$β© a lem2' = sym (InvIsInverseΚ³ hepi) lem2 : lift (lower b) β lift (h .projβ β¨$β© a) lem2 = cong{From = π»[ π© ]} (ToLiftΛ‘{π¨ = π©}{βα΅} .projβ) lem2' lem3 : lift (h .projβ β¨$β© a) β (Lift-homΛ‘ h βα΅ βα΅) .projβ β¨$β© lift a lem3 = lift-hom-lemma h a βα΅ βα΅ Ξ· : b β (Lift-homΛ‘ h βα΅ βα΅) .projβ β¨$β© lift a Ξ· = trans lem1 (trans lem2 lem3) Goal : Image (Lift-homΛ‘ h βα΅ βα΅) .projβ β b Goal = Image_β_.eq (lift a) Ξ· Lift-Alg-hom-imageΛ‘ : (βα΅ βα΅ : Level) β π© IsHomImageOf π¨ β (Lift-AlgΛ‘ π© βα΅) IsHomImageOf (Lift-AlgΛ‘ π¨ βα΅) Lift-Alg-hom-imageΛ‘ βα΅ βα΅ ((Ο , Οhom) , Οepic) = Goal where lΟ : hom (Lift-AlgΛ‘ π¨ βα΅) (Lift-AlgΛ‘ π© βα΅) lΟ = Lift-homΛ‘ {π¨ = π¨}{π©} (Ο , Οhom) βα΅ βα΅ lΟepic : IsSurjective (lΟ .projβ) lΟepic = Lift-epi-is-epiΛ‘ (Ο , Οhom) βα΅ βα΅ Οepic Goal : (Lift-AlgΛ‘ π© βα΅) IsHomImageOf (Lift-AlgΛ‘ π¨ βα΅) Goal = lΟ , lΟepic module _ {π¨ : Algebra {π = π} Ξ± Οα΅}{π© : Algebra {π = π} Ξ² Οα΅} where open _β _ Lift-HomImage-lemma : β{Ξ³} β (Lift-Alg π¨ Ξ³ Ξ³) IsHomImageOf π© β π¨ IsHomImageOf π© Lift-HomImage-lemma {Ξ³} Ο = β-hom (Ο .projβ) (from Lift-β ) , β-IsSurjective (Ο .projβ) (fromIsSurjective (Lift-β {π¨ = π¨})) module _ {π¨ π¨' : Algebra {π = π} Ξ± Οα΅}{π© : Algebra {π = π} Ξ² Οα΅} where open _β _ HomImage-β : π¨ IsHomImageOf π¨' β π¨ β π© β π© IsHomImageOf π¨' HomImage-β Ο Aβ B = β-hom (Ο .projβ) (to Aβ B) , β-IsSurjective (Ο .projβ) (toIsSurjective Aβ B) HomImage-β ' : π¨ IsHomImageOf π¨' β π¨' β π© β π¨ IsHomImageOf π© HomImage-β ' Ο A'β B = (β-hom (from A'β B) (projβ Ο)) , β-IsSurjective (fromIsSurjective A'β B) (Ο .projβ)