Legacy.Base.Structures.Sigma.Isos¶
Isomorphisms of general structures¶
{-# OPTIONS --cubical-compatible --exact-split --safe #-} module Legacy.Base.Structures.Sigma.Isos where -- Imports from the Agda Standard Library ------------------------------------------------------ open import Axiom.Extensionality.Propositional using () renaming (Extensionality to funext) open import Agda.Primitive using ( _β_ ; lsuc ) renaming ( Set to Type ) open import Data.Product using ( _,_ ; Ξ£-syntax ; _Γ_ ) renaming ( projβ to fst ; projβ to snd ) open import Function.Base using ( _β_ ) open import Level using ( Level ; Lift ; lift ; lower ) open import Relation.Binary.PropositionalEquality using ( _β‘_ ; refl ; cong ; cong-app ) -- Imports from the Agda Universal Algebra Library --------------------------------------------- open import Overture using ( β£_β£ ; _β_ ; β₯_β₯ ; _β_ ; lowerβΌlift ; liftβΌlower ) open import Legacy.Base.Structures.Sigma.Basic using ( Signature ; Structure ; Lift-Struc ) open import Legacy.Base.Structures.Sigma.Homs using ( hom ; πΎπΉ ; β-hom ; ππΎπ»π ; πβ΄πβ―π ; is-hom) open import Legacy.Base.Structures.Sigma.Products using ( β¨ ; βp ; β ; π ; class-prod ) private variable π πΉ : Signature
Recall, f β g means f and g are extensionally (or pointwise) equal; i.e.,
β x, f x β‘ g x. We use this notion of equality of functions in the following
definition of isomorphism.
module _ {Ξ± Οα΅ Ξ² Οα΅ : Level} where record _β _ (π¨ : Structure π πΉ {Ξ±}{Οα΅})(π© : Structure π πΉ {Ξ²}{Οα΅}) : Type (Ξ± β Οα΅ β Ξ² β Οα΅) where field to : hom π¨ π© from : hom π© π¨ toβΌfrom : β£ to β£ β β£ from β£ β β£ πΎπΉ π© β£ fromβΌto : β£ from β£ β β£ to β£ β β£ πΎπΉ π¨ β£ open _β _ public
That is, two structures are isomorphic provided there are homomorphisms going back and forth between them which compose to the identity map.
Properties of isomorphism of structures of sigma type¶
module _ {Ξ± Οα΅ : Level} where β -refl : {π¨ : Structure π πΉ {Ξ±}{Οα΅}} β π¨ β π¨ β -refl {π¨ = π¨} = record { to = πΎπΉ π¨ ; from = πΎπΉ π¨ ; toβΌfrom = Ξ» _ β refl ; fromβΌto = Ξ» _ β refl } module _ {Ξ± Οα΅ Ξ² Οα΅ : Level} where β -sym : {π¨ : Structure π πΉ {Ξ±}{Οα΅}}{π© : Structure π πΉ {Ξ²}{Οα΅}} β π¨ β π© β π© β π¨ β -sym Aβ B = record { to = from Aβ B ; from = to Aβ B ; toβΌfrom = fromβΌto Aβ B ; fromβΌto = toβΌfrom Aβ B } module _ {Ξ± Οα΅ Ξ² Οα΅ Ξ³ ΟαΆ : Level} (π¨ : Structure π πΉ {Ξ±}{Οα΅}){π© : Structure π πΉ {Ξ²}{Οα΅}} (πͺ : Structure π πΉ {Ξ³}{ΟαΆ}) where β -trans : π¨ β π© β π© β πͺ β π¨ β πͺ β -trans ab bc = record { to = f ; from = g ; toβΌfrom = Ο ; fromβΌto = Ξ½ } where f1 : hom π¨ π© f1 = to ab f2 : hom π© πͺ f2 = to bc f : hom π¨ πͺ f = β-hom π¨ πͺ f1 f2 g1 : hom πͺ π© g1 = from bc g2 : hom π© π¨ g2 = from ab g : hom πͺ π¨ g = β-hom πͺ π¨ g1 g2 Ο : β£ f β£ β β£ g β£ β β£ πΎπΉ πͺ β£ Ο x = (cong β£ f2 β£(toβΌfrom ab (β£ g1 β£ x)))β(toβΌfrom bc) x Ξ½ : β£ g β£ β β£ f β£ β β£ πΎπΉ π¨ β£ Ξ½ x = (cong β£ g2 β£(fromβΌto bc (β£ f1 β£ x)))β(fromβΌto ab) x
Fortunately, the lift operation preserves isomorphism (i.e., it's an algebraic invariant). As our focus is universal algebra, this is important and is what makes the lift operation a workable solution to the technical problems that arise from the noncumulativity of Agda's universe hierarchy.
open Level module _ {Ξ± Οα΅ : Level} where Lift-β : (β Ο : Level) β {π¨ : Structure π πΉ {Ξ±}{Οα΅}} β π¨ β (Lift-Struc β Ο π¨) Lift-β β Ο {π¨} = record { to = ππΎπ»π β Ο π¨ ; from = πβ΄πβ―π β Ο π¨ ; toβΌfrom = cong-app liftβΌlower ; fromβΌto = cong-app (lowerβΌlift{Ξ±}{Ο}) } module _ {Ξ± Οα΅ Ξ² Οα΅ : Level} {π¨ : Structure π πΉ {Ξ±}{Οα΅}}{π© : Structure π πΉ {Ξ²}{Οα΅}} where Lift-Struc-iso : (β Ο β' Ο' : Level) β π¨ β π© β Lift-Struc β Ο π¨ β Lift-Struc β' Ο' π© Lift-Struc-iso β Ο β' Ο' Aβ B = β -trans (Lift-Struc β Ο π¨) (Lift-Struc β' Ο' π©) ( β -trans (Lift-Struc β Ο π¨) π© (β -sym (Lift-β β Ο)) Aβ B ) (Lift-β β' Ο')
Products of isomorphic families of algebras are themselves isomorphic. The proof looks a bit technical, but it is as straightforward as it ought to be.
module _ {ΞΉ : Level}{I : Type ΞΉ} {Ξ± Οα΅ Ξ² Οα΅ : Level} {fe : funext Οα΅ Οα΅} {fiu : funext ΞΉ Ξ±} {fiw : funext ΞΉ Ξ²} where β¨ β : {π : I β Structure π πΉ {Ξ±}{Οα΅}}{β¬ : I β Structure π πΉ {Ξ²}{Οα΅}} β (β (i : I) β π i β β¬ i) β β¨ π β β¨ β¬ β¨ β {π = π}{β¬} AB = record { to = Ο , Οhom ; from = Ο , Οhom ; toβΌfrom = Ο~Ο ; fromβΌto = Ο~Ο } where Ο : β£ β¨ π β£ β β£ β¨ β¬ β£ Ο a i = β£ to (AB i) β£ (a i) Οhom : is-hom (β¨ π) (β¨ β¬) Ο Οhom = ( Ξ» r a x π¦ β fst β₯ to (AB π¦) β₯ r (Ξ» z β a z π¦) (x π¦)) , Ξ» f a β fiw (Ξ» i β snd β₯ to (AB i) β₯ f (Ξ» z β a z i) ) Ο : β£ β¨ β¬ β£ β β£ β¨ π β£ Ο b i = β£ from (AB i) β£ (b i) Οhom : is-hom (β¨ β¬) (β¨ π) Ο Οhom = ( Ξ» r a x π¦ β fst β₯ from (AB π¦) β₯ r (Ξ» z β a z π¦) (x π¦)) , Ξ» f a β fiu (Ξ» i β snd β₯ from (AB i) β₯ f (Ξ» z β a z i) ) Ο~Ο : Ο β Ο β β£ πΎπΉ (β¨ β¬) β£ Ο~Ο π = fiw Ξ» i β (toβΌfrom (AB i)) (π i) Ο~Ο : Ο β Ο β β£ πΎπΉ (β¨ π) β£ Ο~Ο a = fiu Ξ» i β (fromβΌto (AB i)) (a i)