Skip to content

Legacy.Base.Structures.Sigma.Congruences

Congruences of general structures

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

module Legacy.Base.Structures.Sigma.Congruences where

open import Agda.Primitive using () renaming ( Set to Type )

-- Imports from the Agda Standard Library ------------------------------------------------
open import Data.Product     using ( _,_ ; _Γ—_ ; Ξ£-syntax ) renaming ( proj₁ to fst )
open import Function         using ( _∘_ )
open import Level            using (  _βŠ”_ ; suc ; Level ; Lift ; lift ; lower ) renaming ( 0β„“ to β„“β‚€ )
open import Relation.Unary   using ( Pred ; _∈_ )
open import Relation.Binary  using ( IsEquivalence ) renaming ( Rel to BinRel )
open import Relation.Binary.PropositionalEquality using ( _≑_ )

-- Imports from the Agda Universal Algebra Library ---------------------------------------
open import Overture        using ( ∣_∣ )
open import Legacy.Base.Equality   using ( swelldef )
open import Legacy.Base.Relations  using ( _|:_ ; 0[_] ; Equivalence ; βŸͺ_⟫ ; ⌞_⌟ )
                            using ( 0[_]Equivalence ; _/_ ; βŸͺ_∼_⟫-elim ; Quotient )
open import Legacy.Base.Structures.Sigma.Basic
                            using ( Signature ; Structure ; _α΅’_ ; Compatible ; _Κ³_ )

private variable 𝑅 𝐹 : Signature

module _ {α ρ : Level} where

 Con : (𝑨 : Structure 𝑅 𝐹 {Ξ±}{ρ}) β†’ Type (suc (Ξ± βŠ” ρ))
 Con 𝑨 = Ξ£[ ΞΈ ∈ Equivalence ∣ 𝑨 ∣{Ξ± βŠ” ρ} ] (Compatible 𝑨 ∣ ΞΈ ∣)

 -- The zero congruence of a structure.
 0[_]Compatible :  (𝑨 : Structure 𝑅 𝐹 {Ξ±}{ρ}) β†’ swelldef β„“β‚€ Ξ±
  β†’                (𝑓 : ∣ 𝐹 ∣) β†’ (𝑓 α΅’ 𝑨) |: (0[ ∣ 𝑨 ∣ ]{ρ})

 0[ 𝑨 ]Compatible wd 𝑓 {i}{j} ptws0  = lift Ξ³
  where
  Ξ³ : (𝑓 α΅’ 𝑨) i ≑ (𝑓 α΅’ 𝑨) j
  Ξ³ = wd (𝑓 α΅’ 𝑨) i j (lower ∘ ptws0)

 0Con[_] : (𝑨 : Structure 𝑅 𝐹 {Ξ±}{ρ}) β†’ swelldef β„“β‚€ Ξ± β†’ Con 𝑨
 0Con[ 𝑨 ] wd = 0[ ∣ 𝑨 ∣ ]Equivalence , 0[ 𝑨 ]Compatible wd

Quotients of structures of sigma type

 _β•±_ : (𝑨 : Structure 𝑅 𝐹 {Ξ±}{ρ}) β†’ Con 𝑨 β†’ Structure 𝑅 𝐹 {suc (Ξ± βŠ” ρ)}{ρ}

 𝑨 β•± ΞΈ =  ( Quotient (∣ 𝑨 ∣) {Ξ± βŠ” ρ} ∣ ΞΈ ∣)       -- domain of quotient structure
          , (Ξ» r x β†’ (r Κ³ 𝑨) Ξ» i β†’ ⌞ x i ⌟)       -- interpretation of relations
          , Ξ» f b β†’ βŸͺ (f α΅’ 𝑨) (Ξ» i β†’ ⌞ b i ⌟)  ⟫  -- interp of operations

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

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

The zero congruence of an arbitrary structure

 𝟘[_β•±_] :  (𝑨 : Structure 𝑅 𝐹 {Ξ±}{ρ})(ΞΈ : Con 𝑨)
  β†’        BinRel (∣ 𝑨 ∣ / (fst ∣ ΞΈ ∣)) (suc (Ξ± βŠ” ρ))

 𝟘[ 𝑨 β•± ΞΈ ] = Ξ» u v β†’ u ≑ v

𝟎[_β•±_] :  {Ξ± ρ : Level}(𝑨 : Structure 𝑅 𝐹 {Ξ±}{ρ})(ΞΈ : Con 𝑨)
 β†’        swelldef β„“β‚€ (suc (Ξ± βŠ” ρ)) β†’ Con (𝑨 β•± ΞΈ)

𝟎[ 𝑨 β•± ΞΈ ] wd = 0[ ∣ 𝑨 β•± ΞΈ ∣ ]Equivalence , 0[ 𝑨 β•± ΞΈ ]Compatible wd