Agda UALib ↑


Isomorphisms

This section describes the Homomorphisms.Isomorphisms module of the Agda Universal Algebra Library. Here we formalize the informal notion of isomorphism between algebraic structures.


{-# OPTIONS --without-K --exact-split --safe #-}

open import Algebras.Signatures using (Signature; π“ž; π“₯)

module Homomorphisms.Isomorphisms {𝑆 : Signature π“ž π“₯} where

open import Homomorphisms.Noether{𝑆 = 𝑆} public
open import MGS-Embeddings using (Nat; NatΞ ; NatΞ -is-embedding) public

Definition of isomorphism

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.


_β‰…_ : {𝓀 𝓦 : Universe}(𝑨 : Algebra 𝓀 𝑆)(𝑩 : Algebra 𝓦 𝑆) β†’ π“ž βŠ” π“₯ βŠ” 𝓀 βŠ” 𝓦 Μ‡
𝑨 β‰… 𝑩 =  Ξ£ f κž‰ (hom 𝑨 𝑩) , Ξ£ g κž‰ (hom 𝑩 𝑨) , (∣ f ∣ ∘ ∣ g ∣ ∼ ∣ 𝒾𝒹 𝑩 ∣)
                                           Γ— (∣ g ∣ ∘ ∣ f ∣ ∼ ∣ 𝒾𝒹 𝑨 ∣)

That is, two structures are isomorphic provided there are homomorphisms going back and forth between them which compose to the identity map.

Isomorphism is an equivalence relation


β‰…-refl : {𝓀 : Universe} {𝑨 : Algebra 𝓀 𝑆} β†’ 𝑨 β‰… 𝑨
β‰…-refl {𝓀}{𝑨} = 𝒾𝒹 𝑨 , 𝒾𝒹 𝑨 , (Ξ» a β†’ refl) , (Ξ» a β†’ refl)

β‰…-sym : {𝓀 𝓦 : Universe}{𝑨 : Algebra 𝓀 𝑆}{𝑩 : Algebra 𝓦 𝑆}
 β†’      𝑨 β‰… 𝑩 β†’ 𝑩 β‰… 𝑨
β‰…-sym h = fst βˆ₯ h βˆ₯ , fst h , βˆ₯ snd βˆ₯ h βˆ₯ βˆ₯ , ∣ snd βˆ₯ h βˆ₯ ∣

module _ {𝓧 𝓨 𝓩 : Universe} where

 β‰…-trans : {𝑨 : Algebra 𝓧 𝑆}{𝑩 : Algebra 𝓨 𝑆}{π‘ͺ : Algebra 𝓩 𝑆}
  β†’        𝑨 β‰… 𝑩 β†’ 𝑩 β‰… π‘ͺ β†’ 𝑨 β‰… π‘ͺ

 β‰…-trans {𝑨} {𝑩}{π‘ͺ} ab bc = f , g , Ξ± , Ξ²
  where
  f1 : hom 𝑨 𝑩
  f1 = ∣ ab ∣
  f2 : hom 𝑩 π‘ͺ
  f2 = ∣ bc ∣
  f : hom 𝑨 π‘ͺ
  f = ∘-hom 𝑨 π‘ͺ f1 f2

  g1 : hom π‘ͺ 𝑩
  g1 = fst βˆ₯ bc βˆ₯
  g2 : hom 𝑩 𝑨
  g2 = fst βˆ₯ ab βˆ₯
  g : hom π‘ͺ 𝑨
  g = ∘-hom π‘ͺ 𝑨 g1 g2

  Ξ± : ∣ f ∣ ∘ ∣ g ∣ ∼ ∣ 𝒾𝒹 π‘ͺ ∣
  Ξ± x = (ap ∣ f2 ∣(∣ snd βˆ₯ ab βˆ₯ ∣ (∣ g1 ∣ x)))βˆ™(∣ snd βˆ₯ bc βˆ₯ ∣) x

  Ξ² : ∣ g ∣ ∘ ∣ f ∣ ∼ ∣ 𝒾𝒹 𝑨 ∣
  Ξ² x = (ap ∣ g2 ∣(βˆ₯ snd βˆ₯ bc βˆ₯ βˆ₯ (∣ f1 ∣ x)))βˆ™(βˆ₯ snd βˆ₯ ab βˆ₯ βˆ₯) x

Lift is an algebraic invariant

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 the universe hierarchy discussed in Overture.Lifts.


open Lift

module _ {𝓀 𝓦 : Universe} where

 Lift-β‰… : {𝑨 : Algebra 𝓀 𝑆} β†’ 𝑨 β‰… (Lift-alg 𝑨 𝓦)
 Lift-β‰… {𝑨} = 𝓁𝒾𝒻𝓉 , (π“β„΄π“Œβ„―π“‡{𝓀}{𝓦}{𝑨}) , happly lift∼lower , happly (lower∼lift{𝓦})

 Lift-hom : (𝓧 : Universe)(𝓨 : Universe){𝑨 : Algebra 𝓀 𝑆}(𝑩 : Algebra 𝓦 𝑆)
  β†’             hom 𝑨 𝑩  β†’  hom (Lift-alg 𝑨 𝓧) (Lift-alg 𝑩 𝓨)

 Lift-hom 𝓧 𝓨 {𝑨} 𝑩 (f , fhom) = lift ∘ f ∘ lower , Ξ³
  where
  lABh : is-homomorphism (Lift-alg 𝑨 𝓧) 𝑩 (f ∘ lower)
  lABh = ∘-is-hom (Lift-alg 𝑨 𝓧) 𝑩 {lower}{f} (Ξ» _ _ β†’ refl) fhom

  Ξ³ : is-homomorphism(Lift-alg 𝑨 𝓧)(Lift-alg 𝑩 𝓨) (lift ∘ (f ∘ lower))
  Ξ³ = ∘-is-hom (Lift-alg 𝑨 𝓧) (Lift-alg 𝑩 𝓨){f ∘ lower}{lift} lABh Ξ» _ _ β†’ refl


module _ {𝓀 𝓦 : Universe} where

 Lift-alg-iso : {𝑨 : Algebra 𝓀 𝑆}{𝓧 : Universe}
                {𝑩 : Algebra 𝓦 𝑆}{𝓨 : Universe}
                -----------------------------------------
  β†’             𝑨 β‰… 𝑩 β†’ (Lift-alg 𝑨 𝓧) β‰… (Lift-alg 𝑩 𝓨)

 Lift-alg-iso A≅B = ≅-trans (≅-trans (≅-sym Lift-≅) A≅B) Lift-≅

Lift associativity

The lift is also associative, up to isomorphism at least.


module _ {π“˜ 𝓀 𝓦 : Universe} where

 Lift-alg-assoc : {𝑨 : Algebra 𝓀 𝑆} β†’ Lift-alg 𝑨 (𝓦 βŠ” π“˜) β‰… (Lift-alg (Lift-alg 𝑨 𝓦) π“˜)
 Lift-alg-assoc {𝑨} = β‰…-trans (β‰…-trans Ξ³ Lift-β‰…) Lift-β‰…
  where
  Ξ³ : Lift-alg 𝑨 (𝓦 βŠ” π“˜) β‰… 𝑨
  Ξ³ = β‰…-sym Lift-β‰…

 Lift-alg-associative : (𝑨 : Algebra 𝓀 𝑆) β†’ Lift-alg 𝑨 (𝓦 βŠ” π“˜) β‰… (Lift-alg (Lift-alg 𝑨 𝓦) π“˜)
 Lift-alg-associative 𝑨 = Lift-alg-assoc {𝑨}

Products preserve isomorphisms

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 _ {π“˜ 𝓀 𝓦 : Universe}{I : π“˜ Μ‡}{feπ“˜π“€ : dfunext π“˜ 𝓀}{feπ“˜π“¦ : dfunext π“˜ 𝓦} where

 β¨…β‰… : {π’œ : I β†’ Algebra 𝓀 𝑆}{ℬ : I β†’ Algebra 𝓦 𝑆} β†’ Ξ  i κž‰ I , π’œ i β‰… ℬ i β†’ β¨… π’œ β‰… β¨… ℬ

 β¨…β‰… {π’œ}{ℬ} AB = Ξ³
  where
  Ο• : ∣ β¨… π’œ ∣ β†’ ∣ β¨… ℬ ∣
  Ο• a i = ∣ fst (AB i) ∣ (a i)

  Ο•hom : is-homomorphism (β¨… π’œ) (β¨… ℬ) Ο•
  Ο•hom 𝑓 a = feπ“˜π“¦ (Ξ» i β†’ βˆ₯ fst (AB i) βˆ₯ 𝑓 (Ξ» x β†’ a x i))

  ψ : ∣ β¨… ℬ ∣ β†’ ∣ β¨… π’œ ∣
  ψ b i = ∣ fst βˆ₯ AB i βˆ₯ ∣ (b i)

  ψhom : is-homomorphism (β¨… ℬ) (β¨… π’œ) ψ
  ψhom 𝑓 𝒃 = feπ“˜π“€ (Ξ» i β†’ snd ∣ snd (AB i) ∣ 𝑓 (Ξ» x β†’ 𝒃 x i))

  Ο•~ψ : Ο• ∘ ψ ∼ ∣ 𝒾𝒹 (β¨… ℬ) ∣
  Ο•~ψ 𝒃 = feπ“˜π“¦ Ξ» i β†’ fst βˆ₯ snd (AB i) βˆ₯ (𝒃 i)

  ψ~Ο• : ψ ∘ Ο• ∼ ∣ 𝒾𝒹 (β¨… π’œ) ∣
  ψ~Ο• a = feπ“˜π“€ Ξ» i β†’ snd βˆ₯ snd (AB i) βˆ₯ (a i)

  Ξ³ : β¨… π’œ β‰… β¨… ℬ
  Ξ³ = (Ο• , Ο•hom) , ((ψ , ψhom) , Ο•~ψ , ψ~Ο•)

A nearly identical proof goes through for isomorphisms of lifted products (though, just for fun, we use the universal quantifier syntax here to express the dependent function type in the statement of the lemma, instead of the Pi notation we used in the statement of the previous lemma; that is, βˆ€ i β†’ π’œ i β‰… ℬ (lift i) instead of Ξ  i κž‰ I , π’œ i β‰… ℬ (lift i).)


module _ {π“˜ 𝓩 : Universe}{I : π“˜ Μ‡}{fizw : dfunext (π“˜ βŠ” 𝓩) 𝓦}{fiu : dfunext π“˜ 𝓀} where

 Lift-alg-β¨…β‰… : {π’œ : I β†’ Algebra 𝓀 𝑆}{ℬ : (Lift{𝓩} I) β†’ Algebra 𝓦 𝑆}
  β†’            (βˆ€ i β†’ π’œ i β‰… ℬ (lift i)) β†’ Lift-alg (β¨… π’œ) 𝓩 β‰… β¨… ℬ

 Lift-alg-β¨…β‰… {π’œ}{ℬ} AB = Ξ³
  where
  Ο• : ∣ β¨… π’œ ∣ β†’ ∣ β¨… ℬ ∣
  Ο• a i = ∣ fst (AB  (lower i)) ∣ (a (lower i))

  Ο•hom : is-homomorphism (β¨… π’œ) (β¨… ℬ) Ο•
  Ο•hom 𝑓 a = fizw (Ξ» i β†’ (βˆ₯ fst (AB (lower i)) βˆ₯) 𝑓 (Ξ» x β†’ a x (lower i)))

  ψ : ∣ β¨… ℬ ∣ β†’ ∣ β¨… π’œ ∣
  ψ b i = ∣ fst βˆ₯ AB i βˆ₯ ∣ (b (lift i))

  ψhom : is-homomorphism (β¨… ℬ) (β¨… π’œ) ψ
  ψhom 𝑓 𝒃 = fiu (Ξ» i β†’ (snd ∣ snd (AB i) ∣) 𝑓 (Ξ» x β†’ 𝒃 x (lift i)))

  Ο•~ψ : Ο• ∘ ψ ∼ ∣ 𝒾𝒹 (β¨… ℬ) ∣
  Ο•~ψ 𝒃 = fizw Ξ» i β†’ fst βˆ₯ snd (AB (lower i)) βˆ₯ (𝒃 i)

  ψ~Ο• : ψ ∘ Ο• ∼ ∣ 𝒾𝒹 (β¨… π’œ) ∣
  ψ~Ο• a = fiu Ξ» i β†’ snd βˆ₯ snd (AB i) βˆ₯ (a i)

  Aβ‰…B : β¨… π’œ β‰… β¨… ℬ
  Aβ‰…B = (Ο• , Ο•hom) , ((ψ , ψhom) , Ο•~ψ , ψ~Ο•)

  Ξ³ : Lift-alg (β¨… π’œ) 𝓩 β‰… β¨… ℬ
  γ = ≅-trans (≅-sym Lift-≅) A≅B

Embedding tools

Finally, we prove some useful facts about embeddings that occasionally come in handy.


module _ {π“˜ 𝓀 𝓦 : Universe} where

 embedding-lift-nat : hfunext π“˜ 𝓀 β†’ hfunext π“˜ 𝓦
  β†’                   {I : π“˜ Μ‡}{A : I β†’ 𝓀 Μ‡}{B : I β†’ 𝓦 Μ‡}
                      (h : Nat A B) β†’ (βˆ€ i β†’ is-embedding (h i))
                      ------------------------------------------
  β†’                   is-embedding(NatΞ  h)

 embedding-lift-nat hfiu hfiw h hem = NatΞ -is-embedding hfiu hfiw h hem


 embedding-lift-nat' : hfunext π“˜ 𝓀 β†’ hfunext π“˜ 𝓦
  β†’                    {I : π“˜ Μ‡}{π’œ : I β†’ Algebra 𝓀 𝑆}{ℬ : I β†’ Algebra 𝓦 𝑆}
                       (h : Nat(fst ∘ π’œ)(fst ∘ ℬ)) β†’ (βˆ€ i β†’ is-embedding (h i))
                       --------------------------------------------------------
  β†’                    is-embedding(NatΞ  h)

 embedding-lift-nat' hfiu hfiw h hem = NatΞ -is-embedding hfiu hfiw h hem


 embedding-lift : hfunext π“˜ 𝓀 β†’ hfunext π“˜ 𝓦
  β†’               {I : π“˜ Μ‡} β†’ {π’œ : I β†’ Algebra 𝓀 𝑆}{ℬ : I β†’ Algebra 𝓦 𝑆}
  β†’               (h : βˆ€ i β†’ ∣ π’œ i ∣ β†’ ∣ ℬ i ∣) β†’ (βˆ€ i β†’ is-embedding (h i))
                  ----------------------------------------------------------
  β†’               is-embedding(Ξ» (x : ∣ β¨… π’œ ∣) (i : I) β†’ (h i)(x i))

 embedding-lift hfiu hfiw {I}{π’œ}{ℬ} h hem = embedding-lift-nat' hfiu hfiw {I}{π’œ}{ℬ} h hem


isoβ†’embedding : {𝓀 𝓦 : Universe}{𝑨 : Algebra 𝓀 𝑆}{𝑩 : Algebra 𝓦 𝑆}
 β†’              (Ο• : 𝑨 β‰… 𝑩) β†’ is-embedding (fst ∣ Ο• ∣)

isoβ†’embedding Ο• = equivs-are-embeddings (fst ∣ Ο• ∣)
                   (invertibles-are-equivs (fst ∣ Ο• ∣) finv)
 where
 finv : invertible (fst ∣ Ο• ∣)
 finv = ∣ fst βˆ₯ Ο• βˆ₯ ∣ , (snd βˆ₯ snd Ο• βˆ₯ , fst βˆ₯ snd Ο• βˆ₯)



← Homomorphisms.Noether Homomorphisms.HomomorphicImages β†’