---
layout: default
title : "Legacy.Base.Homomorphisms.Properties module (The Agda Universal Algebra Library)"
date : "2021-09-08"
author: "agda-algebras development team"
---

### <a id="properties-of-homomorphisms">Properties of Homomorphisms</a>

This is the [Legacy.Base.Homomorphisms.Properties][] module of the [Agda Universal Algebra Library][].


```agda


{-# OPTIONS --cubical-compatible --exact-split --safe #-}

open import Overture using (Signature ; ๐“ž ; ๐“ฅ )

module Legacy.Base.Homomorphisms.Properties {๐‘† : Signature ๐“ž ๐“ฅ} where

-- Imports from Agda and the Agda Standard Library --------------------------------
open import Data.Product  using ( _,_ )
open import Function      using ( _โˆ˜_ )
open import Level         using ( Level )

open  import Relation.Binary.PropositionalEquality as โ‰ก
      using ( _โ‰ก_ ; module โ‰ก-Reasoning )

-- Imports from the Agda Universal Algebras Library --------------------------------
open import Overture                           using ( โˆฃ_โˆฃ ; โˆฅ_โˆฅ )
open import Legacy.Base.Algebras             {๐‘† = ๐‘†}  using ( Algebra ; _ฬ‚_ ; Lift-Alg )
open import Legacy.Base.Homomorphisms.Basic  {๐‘† = ๐‘†}  using ( hom ; is-homomorphism )

private variable ฮฑ ฮฒ ฮณ ฯ : Level
```



#### <a id="homomorphism-composition">Homomorphism composition</a>

The composition of homomorphisms is again a homomorphism.  We formalize this in a
number of alternative ways.


```agda


open โ‰ก-Reasoning

module _ (๐‘จ : Algebra ฮฑ){๐‘ฉ : Algebra ฮฒ}(๐‘ช : Algebra ฮณ) where

  โˆ˜-hom : hom ๐‘จ ๐‘ฉ  โ†’  hom ๐‘ฉ ๐‘ช  โ†’  hom ๐‘จ ๐‘ช
  โˆ˜-hom (g , ghom) (h , hhom) = h โˆ˜ g , Goal where

   Goal : โˆ€ ๐‘“ a โ†’ (h โˆ˜ g)((๐‘“ ฬ‚ ๐‘จ) a) โ‰ก (๐‘“ ฬ‚ ๐‘ช)(h โˆ˜ g โˆ˜ a)
   Goal ๐‘“ a =  (h โˆ˜ g)((๐‘“ ฬ‚ ๐‘จ) a)  โ‰กโŸจ โ‰ก.cong h ( ghom ๐‘“ a )  โŸฉ
               h ((๐‘“ ฬ‚ ๐‘ฉ)(g โˆ˜ a))  โ‰กโŸจ hhom ๐‘“ ( g โˆ˜ a )       โŸฉ
               (๐‘“ ฬ‚ ๐‘ช)(h โˆ˜ g โˆ˜ a)  โˆŽ

  โˆ˜-is-hom :  {f : โˆฃ ๐‘จ โˆฃ โ†’ โˆฃ ๐‘ฉ โˆฃ}{g : โˆฃ ๐‘ฉ โˆฃ โ†’ โˆฃ ๐‘ช โˆฃ}
   โ†’          is-homomorphism ๐‘จ ๐‘ฉ f โ†’ is-homomorphism ๐‘ฉ ๐‘ช g
   โ†’          is-homomorphism ๐‘จ ๐‘ช (g โˆ˜ f)

  โˆ˜-is-hom {f} {g} fhom ghom = โˆฅ โˆ˜-hom (f , fhom) (g , ghom) โˆฅ
```


A homomorphism from `๐‘จ` to `๐‘ฉ` can be lifted to a homomorphism from
`Lift-Alg ๐‘จ โ„“แตƒ` to `Lift-Alg ๐‘ฉ โ„“แต‡`.


```agda


open Level

Lift-hom :  {๐‘จ : Algebra ฮฑ}(โ„“แตƒ : Level){๐‘ฉ : Algebra ฮฒ} (โ„“แต‡ : Level)
 โ†’          hom ๐‘จ ๐‘ฉ  โ†’  hom (Lift-Alg ๐‘จ โ„“แตƒ) (Lift-Alg ๐‘ฉ โ„“แต‡)

Lift-hom {๐‘จ = ๐‘จ} โ„“แตƒ {๐‘ฉ} โ„“แต‡ (f , fhom) = lift โˆ˜ f โˆ˜ lower , Goal
 where
 lABh : is-homomorphism (Lift-Alg ๐‘จ โ„“แตƒ) ๐‘ฉ (f โˆ˜ lower)
 lABh = โˆ˜-is-hom (Lift-Alg ๐‘จ โ„“แตƒ) ๐‘ฉ {lower}{f} (ฮป _ _ โ†’ โ‰ก.refl) fhom

 Goal : is-homomorphism(Lift-Alg ๐‘จ โ„“แตƒ)(Lift-Alg ๐‘ฉ โ„“แต‡) (lift โˆ˜ (f โˆ˜ lower))
 Goal = โˆ˜-is-hom  (Lift-Alg ๐‘จ โ„“แตƒ) (Lift-Alg ๐‘ฉ โ„“แต‡)
                  {f โˆ˜ lower}{lift} lABh ฮป _ _ โ†’ โ‰ก.refl
```


We should probably point out that while the lifting and lowering homomorphisms
are important for our formal treatment of algebras in type theory, they never
arise---in fact, they are not even definable---in classical universal algebra
based on set theory.