Skip to content

Legacy.Base.Structures.Congruences

Congruences of general structures

This is the Legacy.Base.Structures.Congruences module of the Agda Universal Algebra Library.


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

module Legacy.Base.Structures.Congruences where

-- Imports from Agda and the Agda Standard Library --------------------------------------
open import Agda.Primitive  using () renaming ( Set  to Type )
open import Data.Product    using ( _,_ ; _Γ—_ ; Ξ£-syntax )
                            renaming ( proj₁ to fst )
open import Function.Base   using ( _∘_ )
open import Level           using ( Level ; suc ; _βŠ”_ ; lower ; lift )

open import Relation.Binary.PropositionalEquality using ( _≑_ )

-- Imports from the Agda Universal Algebra Library --------------------------------------
open import Overture        using ( ∣_∣ )
open import Legacy.Base.Relations  using ( _|:_ ; 0[_] ; Equivalence ; Quotient ; βŸͺ_⟫ )
                            using ( 0[_]Equivalence ; ⌞_⌟ ; βŸͺ_∼_⟫-elim ; _/_ )
open import Legacy.Base.Equality   using ( swelldef )

open import Legacy.Base.Structures.Basic  using ( signature ; structure ; sigl )
                                   using ( siglΚ³ ; compatible )
private variable
 π“žβ‚€ π“₯β‚€ π“žβ‚ π“₯₁ : Level
 𝐹 : signature π“žβ‚€ π“₯β‚€
 𝑅 : signature π“žβ‚ π“₯₁
 α ρ : Level

open signature ; open structure

con : βˆ€ {Ξ± ρ} β†’ structure 𝐹 𝑅 {Ξ±}{ρ} β†’ Type (sigl 𝐹 βŠ” suc Ξ± βŠ” suc ρ)
con {Ξ± = Ξ±}{ρ} 𝑨 = Ξ£[ ΞΈ ∈ Equivalence (carrier 𝑨){Ξ± βŠ” ρ} ] (compatible 𝑨 ∣ ΞΈ ∣)

The zero congruence of a structure


0[_]compatible :  (𝑨 : structure 𝐹 𝑅 {Ξ±} {ρ}) β†’ swelldef (siglΚ³ 𝐹) Ξ±
 β†’                (𝑓 : symbol 𝐹) β†’ (op 𝑨) 𝑓 |: (0[ carrier 𝑨 ] {ρ})

0[ 𝑨 ]compatible wd 𝑓 {i}{j} ptws0  = lift Ξ³
 where
 Ξ³ : ((op 𝑨) 𝑓) i ≑ ((op 𝑨) 𝑓) j
 Ξ³ = wd ((op 𝑨) 𝑓) i j (lower ∘ ptws0)

0con[_] : (𝑨 : structure 𝐹 𝑅 {Ξ±} {ρ}) β†’ swelldef (siglΚ³ 𝐹) Ξ± β†’ con 𝑨
0con[ 𝑨 ] wd = 0[ carrier 𝑨 ]Equivalence , 0[ 𝑨 ]compatible wd

Quotient structures


_β•±_  -- alias  (useful on when signature and universe parameters can be inferred)
 quotient : (𝑨 : structure 𝐹 𝑅 {Ξ±}{ρ}) β†’ con 𝑨 β†’ structure 𝐹 𝑅
quotient 𝑨 ΞΈ =
 record  { carrier = Quotient (carrier 𝑨) ∣ ΞΈ ∣     -- domain of quotient structure
         ; op = Ξ» f b β†’ βŸͺ ((op 𝑨) f) (Ξ» i β†’ ⌞ b i ⌟) ⟫ {fst ∣ ΞΈ ∣} -- interp of operations
         ; rel = Ξ» r x β†’ ((rel 𝑨) r) (Ξ» i β†’ ⌞ x i ⌟)   -- interpretation of relations
         }

_β•±_ = quotient  -- (alias)

/≑-elim :  {𝑨 : structure 𝐹 𝑅 {Ξ±}{ρ}} ((ΞΈ , _ ) : con 𝑨){u v : carrier 𝑨}
 β†’         βŸͺ u ⟫ {∣ ΞΈ ∣} ≑ βŸͺ v ⟫ {∣ ΞΈ ∣} β†’ ∣ ΞΈ ∣ u v

/≑-elim ΞΈ {u}{v} x =  βŸͺ u ∼ v ⟫-elim{R = ∣ ΞΈ ∣} x

The zero congruence of a quotient structure


𝟎[_β•±_] :  (𝑨 : structure 𝐹 𝑅 {Ξ±}{ρ}) (ΞΈ : con 𝑨)
 β†’        swelldef (siglΚ³ 𝐹)(suc (Ξ± βŠ” ρ)) β†’ con (𝑨 β•± ΞΈ)

𝟎[ 𝑨 β•± ΞΈ ] wd = 0con[ 𝑨 β•± ΞΈ ] wd