diff --git a/src/Algebras/Congruences.lagda b/src/Algebras/Congruences.lagda index c3bff08d..55308108 100644 --- a/src/Algebras/Congruences.lagda +++ b/src/Algebras/Congruences.lagda @@ -141,6 +141,6 @@ open IsCongruence ------------------------------------------------- [← Algebras.Products](Algebras.Products.html) -[Algebras.Func →](Algebras.Func.html) +[Algebras.Setoid →](Algebras.Setoid.html) {% include UALib.Links.md %} diff --git a/src/Algebras/Func.lagda b/src/Algebras/Setoid.lagda similarity index 57% rename from src/Algebras/Func.lagda rename to src/Algebras/Setoid.lagda index 0f5c2517..d8e10470 100644 --- a/src/Algebras/Func.lagda +++ b/src/Algebras/Setoid.lagda @@ -1,6 +1,6 @@ --- layout: default -title : "Algebras.Func module (Agda Universal Algebra Library)" +title : "Algebras.Setoid module (Agda Universal Algebra Library)" date : "2021-09-17" author: "agda-algebras development team" --- @@ -11,17 +11,17 @@ author: "agda-algebras development team" {-# OPTIONS --without-K --exact-split --safe #-} -module Algebras.Func where +module Algebras.Setoid where -open import Algebras.Func.Basic -open import Algebras.Func.Products -open import Algebras.Func.Congruences +open import Algebras.Setoid.Basic +open import Algebras.Setoid.Products +open import Algebras.Setoid.Congruences \end{code} -------------------------------- [← Algebras.Congruences](Algebras.Congruences.html) -[Algebras.Func.Basic →](Algebras.Func.Basic.html) +[Algebras.Setoid.Basic →](Algebras.Setoid.Basic.html) {% include UALib.Links.md %} diff --git a/src/Algebras/Func/Basic.lagda b/src/Algebras/Setoid/Basic.lagda similarity index 80% rename from src/Algebras/Func/Basic.lagda rename to src/Algebras/Setoid/Basic.lagda index 629d582e..7ecb1ca0 100644 --- a/src/Algebras/Func/Basic.lagda +++ b/src/Algebras/Setoid/Basic.lagda @@ -1,13 +1,13 @@ --- layout: default -title : "Algebras.Func.Basic module (Agda Universal Algebra Library)" +title : "Algebras.Setoid.Basic module (Agda Universal Algebra Library)" date : "2021-04-23" author: "agda-algebras development team" --- #### Basic definitions for algebras over setoids -This is the [Algebras.Func.Basic][] module of the [Agda Universal Algebra Library][]. +This is the [Algebras.Setoid.Basic][] module of the [Agda Universal Algebra Library][]. \begin{code} @@ -15,7 +15,7 @@ This is the [Algebras.Func.Basic][] module of the [Agda Universal Algebra Librar open import Algebras.Basic using (𝓞 ; 𝓥 ; Signature ) -module Algebras.Func.Basic {𝑆 : Signature 𝓞 𝓥} where +module Algebras.Setoid.Basic {𝑆 : Signature 𝓞 𝓥} where -- Imports from the Agda and the Agda Standard Library -------------------- open import Agda.Primitive using ( _⊔_ ; lsuc ) renaming ( Set to Type ) @@ -81,7 +81,7 @@ equality. \begin{code} -record SetoidAlgebra α ρ : Type (𝓞 ⊔ 𝓥 ⊔ lsuc (α ⊔ ρ)) where +record Algebra α ρ : Type (𝓞 ⊔ 𝓥 ⊔ lsuc (α ⊔ ρ)) where field Domain : Setoid α ρ Interp : Func (⟦ 𝑆 ⟧ Domain) Domain @@ -94,31 +94,31 @@ record SetoidAlgebra α ρ : Type (𝓞 ⊔ 𝓥 ⊔ lsuc (α ⊔ ρ)) where \end{code} -It should be clear that the two types `Algebroid` and `SetoidAlgebra` are equivalent. (We tend to use the latter throughout most of the [agda-algebras][] library.) +It should be clear that the two types `Algebroid` and `Algebra` are equivalent. (We tend to use the latter throughout most of the [agda-algebras][] library.) \begin{code} -open SetoidAlgebra +open Algebra -- Forgetful Functor -𝕌[_] : SetoidAlgebra α ρ → Type α +𝕌[_] : Algebra α ρ → Type α 𝕌[ 𝑨 ] = Carrier (Domain 𝑨) -𝔻[_] : SetoidAlgebra α ρ → Setoid α ρ +𝔻[_] : Algebra α ρ → Setoid α ρ 𝔻[ 𝑨 ] = Domain 𝑨 --- The universe level of a SetoidAlgebra +-- The universe level of a Algebra -Level-of-Alg : {α ρ 𝓞 𝓥 : Level}{𝑆 : Signature 𝓞 𝓥} → SetoidAlgebra α ρ → Level +Level-of-Alg : {α ρ 𝓞 𝓥 : Level}{𝑆 : Signature 𝓞 𝓥} → Algebra α ρ → Level Level-of-Alg {α = α}{ρ}{𝓞}{𝓥} _ = 𝓞 ⊔ 𝓥 ⊔ lsuc (α ⊔ ρ) -Level-of-Carrier : {α ρ 𝓞 𝓥 : Level}{𝑆 : Signature 𝓞 𝓥} → SetoidAlgebra α ρ → Level +Level-of-Carrier : {α ρ 𝓞 𝓥 : Level}{𝑆 : Signature 𝓞 𝓥} → Algebra α ρ → Level Level-of-Carrier {α = α} _ = α -open SetoidAlgebra +open Algebra -_̂_ : (f : ∣ 𝑆 ∣)(𝑨 : SetoidAlgebra α ρ) → (∥ 𝑆 ∥ f → 𝕌[ 𝑨 ]) → 𝕌[ 𝑨 ] +_̂_ : (f : ∣ 𝑆 ∣)(𝑨 : Algebra α ρ) → (∥ 𝑆 ∥ f → 𝕌[ 𝑨 ]) → 𝕌[ 𝑨 ] f ̂ 𝑨 = λ a → (Interp 𝑨) ⟨$⟩ (f , a) @@ -129,15 +129,15 @@ f ̂ 𝑨 = λ a → (Interp 𝑨) ⟨$⟩ (f , a) \begin{code} -module _ (𝑨 : SetoidAlgebra α ρ) where +module _ (𝑨 : Algebra α ρ) where - open SetoidAlgebra 𝑨 using ( Interp ) renaming ( Domain to A ) + open Algebra 𝑨 using ( Interp ) renaming ( Domain to A ) open Setoid A using (sym ; trans ) renaming ( Carrier to ∣A∣ ; _≈_ to _≈₁_ ; refl to refl₁ ) open Level - Lift-Algˡ : (ℓ : Level) → SetoidAlgebra (α ⊔ ℓ) ρ + Lift-Algˡ : (ℓ : Level) → Algebra (α ⊔ ℓ) ρ Domain (Lift-Algˡ ℓ) = record { Carrier = Lift ℓ ∣A∣ ; _≈_ = λ x y → lower x ≈₁ lower y @@ -151,7 +151,7 @@ module _ (𝑨 : SetoidAlgebra α ρ) where ≈cong (Interp (Lift-Algˡ ℓ)) (refl , la=lb) = ≈cong (Interp 𝑨) ((refl , la=lb)) - Lift-Algʳ : (ℓ : Level) → SetoidAlgebra α (ρ ⊔ ℓ) + Lift-Algʳ : (ℓ : Level) → Algebra α (ρ ⊔ ℓ) Domain (Lift-Algʳ ℓ) = record { Carrier = ∣A∣ @@ -164,7 +164,7 @@ module _ (𝑨 : SetoidAlgebra α ρ) where Interp (Lift-Algʳ ℓ ) ⟨$⟩ (f , la) = (f ̂ 𝑨) la ≈cong (Interp (Lift-Algʳ ℓ)) (refl , la≡lb) = lift (≈cong (Interp 𝑨) (≡.refl , λ i → lower (la≡lb i))) -Lift-Alg : (𝑨 : SetoidAlgebra α ρ)(ℓ₀ ℓ₁ : Level) → SetoidAlgebra (α ⊔ ℓ₀) (ρ ⊔ ℓ₁) +Lift-Alg : (𝑨 : Algebra α ρ)(ℓ₀ ℓ₁ : Level) → Algebra (α ⊔ ℓ₀) (ρ ⊔ ℓ₁) Lift-Alg 𝑨 ℓ₀ ℓ₁ = Lift-Algʳ (Lift-Algˡ 𝑨 ℓ₀) ℓ₁ \end{code} @@ -172,7 +172,7 @@ Lift-Alg 𝑨 ℓ₀ ℓ₁ = Lift-Algʳ (Lift-Algˡ 𝑨 ℓ₀) ℓ₁ -------------------------------- -[↑ Algebras.Func](Algebras.Func.html) -[Algebras.Func.Products →](Algebras.Func.Products.html) +[↑ Algebras.Setoid](Algebras.Setoid.html) +[Algebras.Setoid.Products →](Algebras.Setoid.Products.html) {% include UALib.Links.md %} diff --git a/src/Algebras/Func/Congruences.lagda b/src/Algebras/Setoid/Congruences.lagda similarity index 67% rename from src/Algebras/Func/Congruences.lagda rename to src/Algebras/Setoid/Congruences.lagda index b5b5acb4..c116dcd2 100644 --- a/src/Algebras/Func/Congruences.lagda +++ b/src/Algebras/Setoid/Congruences.lagda @@ -1,13 +1,13 @@ --- layout: default -title : "Algebras.Func.Congruences module (The Agda Universal Algebra Library)" +title : "Algebras.Setoid.Congruences module (The Agda Universal Algebra Library)" date : "2021-09-15" author: "agda-algebras development team" --- #### Congruences of Setoid Algebras -This is the [Algebras.Func.Congruences][] module of the [Agda Universal Algebra Library][]. +This is the [Algebras.Setoid.Congruences][] module of the [Agda Universal Algebra Library][]. \begin{code} @@ -15,23 +15,22 @@ This is the [Algebras.Func.Congruences][] module of the [Agda Universal Algebra open import Algebras.Basic using (𝓞 ; 𝓥 ; Signature) -module Algebras.Func.Congruences {𝑆 : Signature 𝓞 𝓥} where +module Algebras.Setoid.Congruences {𝑆 : Signature 𝓞 𝓥} where -- Imports from the Agda Standard Library --------------------------------------- -open import Function using ( id ) -open import Function.Bundles using ( Func ) -open import Agda.Primitive using ( _⊔_ ; Level ) renaming ( Set to Type ) -open import Data.Product using ( _,_ ; Σ-syntax ) -open import Relation.Binary using ( Setoid ; IsEquivalence ) renaming ( Rel to BinRel ) -open import Relation.Binary.PropositionalEquality - using ( refl ) +open import Function using ( id ) +open import Function.Bundles using ( Func ) +open import Agda.Primitive using ( _⊔_ ; Level ) renaming ( Set to Type ) +open import Data.Product using ( _,_ ; Σ-syntax ) +open import Relation.Binary using ( Setoid ; IsEquivalence ) renaming ( Rel to BinRel ) +open import Relation.Binary.PropositionalEquality using ( refl ) -- Imports from the Agda Universal Algebras Library ------------------------------ -open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) -open import Relations.Discrete using ( 0[_] ; _|:_ ) -open import Algebras.Func.Basic {𝑆 = 𝑆} using ( ov ; SetoidAlgebra ; 𝕌[_] ; _̂_ ) -open import Relations.Quotients using ( Equivalence ) -open import Relations.Func.Quotients using ( ⟪_⟫ ; _/_ ; ⟪_∼_⟫-elim ) +open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) +open import Relations.Discrete using ( 0[_] ; _|:_ ) +open import Algebras.Setoid.Basic {𝑆 = 𝑆} using ( ov ; Algebra ; 𝕌[_] ; _̂_ ) +open import Relations.Quotients using ( Equivalence ) +open import Relations.Setoid.Quotients using ( ⟪_⟫ ; _/_ ; ⟪_∼_⟫-elim ) private variable α ρ ℓ : Level @@ -41,8 +40,8 @@ We now define the function `compatible` so that, if `𝑨` denotes an algebra an \begin{code} --- SetoidAlgebra compatibility with binary relation -_∣≈_ : (𝑨 : SetoidAlgebra α ρ) → BinRel 𝕌[ 𝑨 ] ℓ → Type _ +-- Algebra compatibility with binary relation +_∣≈_ : (𝑨 : Algebra α ρ) → BinRel 𝕌[ 𝑨 ] ℓ → Type _ 𝑨 ∣≈ R = ∀ 𝑓 → (𝑓 ̂ 𝑨) |: R \end{code} @@ -54,9 +53,9 @@ Congruences should obviously contain the equality relation on the underlying set \begin{code} -module _ (𝑨 : SetoidAlgebra α ρ) where +module _ (𝑨 : Algebra α ρ) where - open SetoidAlgebra 𝑨 using () renaming (Domain to A ) + open Algebra 𝑨 using () renaming (Domain to A ) open Setoid A using ( _≈_ ) record IsCongruence (θ : BinRel 𝕌[ 𝑨 ] ℓ) : Type (𝓞 ⊔ 𝓥 ⊔ ρ ⊔ ℓ ⊔ α) where @@ -79,10 +78,10 @@ Each of these types captures what it means to be a congruence and they are equiv \begin{code} -IsCongruence→Con : {𝑨 : SetoidAlgebra α ρ}(θ : BinRel 𝕌[ 𝑨 ] ℓ) → IsCongruence 𝑨 θ → Con 𝑨 +IsCongruence→Con : {𝑨 : Algebra α ρ}(θ : BinRel 𝕌[ 𝑨 ] ℓ) → IsCongruence 𝑨 θ → Con 𝑨 IsCongruence→Con θ p = θ , p -Con→IsCongruence : {𝑨 : SetoidAlgebra α ρ}((θ , _) : Con 𝑨 {ℓ}) → IsCongruence 𝑨 θ +Con→IsCongruence : {𝑨 : Algebra α ρ}((θ , _) : Con 𝑨 {ℓ}) → IsCongruence 𝑨 θ Con→IsCongruence θ = ∥ θ ∥ \end{code} @@ -95,17 +94,17 @@ In many areas of abstract mathematics the *quotient* of an algebra `𝑨` with r \begin{code} -open SetoidAlgebra using ( Domain ; Interp ) +open Algebra using ( Domain ; Interp ) open Setoid using ( Carrier ) open Func using ( cong ) renaming ( f to _⟨$⟩_ ) -_╱_ : (𝑨 : SetoidAlgebra α ρ) → Con 𝑨 {ℓ} → SetoidAlgebra α ℓ +_╱_ : (𝑨 : Algebra α ρ) → Con 𝑨 {ℓ} → Algebra α ℓ Domain (𝑨 ╱ θ) = 𝕌[ 𝑨 ] / (Eqv ∥ θ ∥) (Interp (𝑨 ╱ θ)) ⟨$⟩ (f , a) = (f ̂ 𝑨) a cong (Interp (𝑨 ╱ θ)) {f , u} {.f , v} (refl , a) = is-compatible ∥ θ ∥ f a -module _ (𝑨 : SetoidAlgebra α ρ) where - open SetoidAlgebra 𝑨 using ( ) renaming (Domain to A ) +module _ (𝑨 : Algebra α ρ) where + open Algebra 𝑨 using ( ) renaming (Domain to A ) open Setoid A using ( _≈_ ) renaming (refl to refl₁) _/∙_ : 𝕌[ 𝑨 ] → (θ : Con 𝑨{ℓ}) → Carrier (Domain (𝑨 ╱ θ)) @@ -118,7 +117,7 @@ module _ (𝑨 : SetoidAlgebra α ρ) where -------------------------------------- -[← Algebras.Func.Products](Algebras.Func.Products.html) +[← Algebras.Setoid.Products](Algebras.Setoid.Products.html) [Homomorphisms →](Homomorphisms.html) {% include UALib.Links.md %} diff --git a/src/Algebras/Func/Products.lagda b/src/Algebras/Setoid/Products.lagda similarity index 57% rename from src/Algebras/Func/Products.lagda rename to src/Algebras/Setoid/Products.lagda index 11025b2c..af85d4f4 100644 --- a/src/Algebras/Func/Products.lagda +++ b/src/Algebras/Setoid/Products.lagda @@ -1,13 +1,13 @@ --- layout: default -title : "Algebras.Func.Products module (Agda Universal Algebra Library)" +title : "Algebras.Setoid.Products module (Agda Universal Algebra Library)" date : "2021-07-03" author: "agda-algebras development team" --- #### Products of Setoid Algebras -This is the [Algebras.Func.Products][] module of the [Agda Universal Algebra Library][]. +This is the [Algebras.Setoid.Products][] module of the [Agda Universal Algebra Library][]. \begin{code} @@ -16,33 +16,32 @@ This is the [Algebras.Func.Products][] module of the [Agda Universal Algebra Lib open import Algebras.Basic using (𝓞 ; 𝓥 ; Signature) -module Algebras.Func.Products {𝑆 : Signature 𝓞 𝓥} where +module Algebras.Setoid.Products {𝑆 : Signature 𝓞 𝓥} where -- Imports from Agda and the Agda Standard Library -------------------------------- -open import Agda.Primitive using ( lsuc ; _⊔_ ; Level ) renaming ( Set to Type ) -open import Data.Product using ( _,_ ; Σ-syntax ; _×_ ) -open import Function.Base using ( flip ) -open import Function.Bundles using ( Func ) -open import Relation.Binary using ( Setoid ; IsEquivalence ; Decidable ) -open import Relation.Binary.PropositionalEquality - using ( refl ; _≡_ ) -open import Relation.Unary using ( Pred ; _⊆_ ; _∈_ ) +open import Agda.Primitive using ( lsuc ; _⊔_ ; Level ) renaming ( Set to Type ) +open import Data.Product using ( _,_ ; Σ-syntax ; _×_ ) +open import Function.Base using ( flip ) +open import Function.Bundles using ( Func ) +open import Relation.Binary using ( Setoid ; IsEquivalence ; Decidable ) +open import Relation.Binary.PropositionalEquality using ( refl ; _≡_ ) +open import Relation.Unary using ( Pred ; _⊆_ ; _∈_ ) -open Func using ( cong ) renaming ( f to _<$>_ ) -open Setoid using ( Carrier ; _≈_ ) renaming ( isEquivalence to isEqv ) -open IsEquivalence using () renaming ( refl to reflE ; sym to symE ; trans to transE ) +open Func using ( cong ) renaming ( f to _<$>_ ) +open Setoid using ( Carrier ; _≈_ ) renaming ( isEquivalence to isEqv ) +open IsEquivalence using () renaming ( refl to reflE ; sym to symE ; trans to transE ) -- Imports from agda-algebras ----------------------------------------------------- -open import Overture.Preliminaries using ( ∣_∣; ∥_∥) -open import Overture.Surjective using ( proj ; projIsOnto ) renaming ( IsSurjective to onto ) -open import Algebras.Func.Basic {𝑆 = 𝑆} using ( ⟦_⟧ ; SetoidAlgebra ; _̂_ ; ov ; 𝕌[_]) +open import Overture.Preliminaries using ( ∣_∣; ∥_∥) +open import Overture.Surjective using ( proj ; projIsOnto ) renaming ( IsSurjective to onto ) +open import Algebras.Setoid.Basic {𝑆 = 𝑆} using ( ⟦_⟧ ; Algebra ; _̂_ ; ov ; 𝕌[_]) private variable α ρ ι : Level -open SetoidAlgebra +open Algebra -⨅ : {I : Type ι }(𝒜 : I → SetoidAlgebra α ρ) → SetoidAlgebra (α ⊔ ι) (ρ ⊔ ι) +⨅ : {I : Type ι }(𝒜 : I → Algebra α ρ) → Algebra (α ⊔ ι) (ρ ⊔ ι) Domain (⨅ {I} 𝒜) = @@ -62,20 +61,20 @@ cong (Interp (⨅ {I} 𝒜)) (refl , f=g ) = λ i → cong (Interp (𝒜 i)) (r \end{code} -#### Products of classes of SetoidAlgebras +#### Products of classes of Algebras \begin{code} -module _ {𝒦 : Pred (SetoidAlgebra α ρ) (ov α)} where +module _ {𝒦 : Pred (Algebra α ρ) (ov α)} where ℑ : Type (ov(α ⊔ ρ)) - ℑ = Σ[ 𝑨 ∈ (SetoidAlgebra α ρ) ] 𝑨 ∈ 𝒦 + ℑ = Σ[ 𝑨 ∈ (Algebra α ρ) ] 𝑨 ∈ 𝒦 - 𝔄 : ℑ → SetoidAlgebra α ρ + 𝔄 : ℑ → Algebra α ρ 𝔄 i = ∣ i ∣ - class-product : SetoidAlgebra (ov (α ⊔ ρ)) _ + class-product : Algebra (ov (α ⊔ ρ)) _ class-product = ⨅ 𝔄 \end{code} @@ -87,7 +86,7 @@ product `⨅ 𝔄` onto the `(𝑨 , p)`-th component. #### Proving the coordinate projections are surjective -Suppose `I` is an index type and `𝒜 : I → SetoidAlgebra α ρ` is an indexed collection of algebras. +Suppose `I` is an index type and `𝒜 : I → Algebra α ρ` is an indexed collection of algebras. Let `⨅ 𝒜` be the product algebra defined above. Given `i : I`, consider the projection of `⨅ 𝒜` onto the `i-th` coordinate. Of course this projection ought to be a surjective map from `⨅ 𝒜` onto `𝒜 i`. However, this is impossible if `I` is just an arbitrary type. Indeed, we must have an @@ -101,7 +100,7 @@ projection of a product of algebras over such an index type is surjective. module _ {I : Type ι} -- index type {_≟_ : Decidable{A = I} _≡_} -- with decidable equality - {𝒜 : I → SetoidAlgebra α ρ} -- indexed collection of algebras + {𝒜 : I → Algebra α ρ} -- indexed collection of algebras {𝒜I : ∀ i → 𝕌[ 𝒜 i ] } -- each of which is nonempty where @@ -112,7 +111,7 @@ module _ {I : Type ι} -- index type -------------------------------- -[← Algebras.Func.Basic](Algebras.Func.Basic.html) -[Algebras.Func.Congruences →](Algebras.Func.Congruences.html) +[← Algebras.Setoid.Basic](Algebras.Setoid.Basic.html) +[Algebras.Setoid.Congruences →](Algebras.Setoid.Congruences.html) {% include UALib.Links.md %} diff --git a/src/Complexity/CSP.lagda b/src/Complexity/CSP.lagda index 0bddca77..6e06de33 100644 --- a/src/Complexity/CSP.lagda +++ b/src/Complexity/CSP.lagda @@ -102,8 +102,8 @@ open import Function.Base using ( _∘_ ) open import Relation.Binary using ( Setoid ) -- Imports from the Agda Universal Algebra Library ------------------------------ -open import Relations.Continuous using ( ΠΡ ; ΠΡ-syntax ) -open import Algebras.Func.Basic {𝑆 = 𝑆} using ( SetoidAlgebra ) +open import Relations.Continuous using ( ΠΡ ; ΠΡ-syntax ) +open import Algebras.Setoid.Basic {𝑆 = 𝑆} using ( Algebra ) \end{code} @@ -138,17 +138,17 @@ where, \begin{code} -module _ -- levels for... - {ι : Level} -- ...arity (or argument index) types - {ν : Level} -- ...variable symbol types - {α ℓ : Level} -- ... domain types +module _ -- levels for... + {ι : Level} -- ...arity (or argument index) types + {ν : Level} -- ...variable symbol types + {α ℓ : Level} -- ... domain types where open Setoid record Constraint (var : Type ν) (dom : var → Setoid α ℓ) : Type (ν ⊔ α ⊔ lsuc ι) where field arity : Type ι -- The "number" of variables involved in the constraint. scope : arity → var -- Which variables are involved in the constraint. - rel : ΠΡ[ i ∈ arity ] (Carrier (dom (scope i))) -- The constraint relation. + rel : ΠΡ[ i ∈ arity ] (Carrier (dom (scope i))) -- The constraint relation. satisfies : (∀ v → Carrier (dom v)) → Type -- An assignment 𝑓 : var → dom of values to variables satisfies f = rel (f ∘ scope) -- *satisfies* the constraint 𝐶 = (σ , 𝑅) provided @@ -160,7 +160,7 @@ module _ -- levels for... A CSP "template" restricts the relations that may occur in instances of the problem. A convenient way to specify a template is to give an indexed family -𝒜 : var → SetoidAlgebra α ρ of algebras (one for each variable symbol in var) +𝒜 : var → Algebra α ρ of algebras (one for each variable symbol in var) and require that relations be subalgebras of the product ⨅ var 𝒜. To construct a CSP instance, then, we just have to give a family 𝒜 of algebras, specify @@ -175,9 +175,9 @@ An instance of a constraint satisfaction problem is a triple 𝑃 = (𝑉, 𝐷, \begin{code} - open SetoidAlgebra + open Algebra open Setoid - record CSPInstance (var : Type ν)(𝒜 : var → SetoidAlgebra α ℓ) : Type (ν ⊔ α ⊔ lsuc ι) where + record CSPInstance (var : Type ν)(𝒜 : var → Algebra α ℓ) : Type (ν ⊔ α ⊔ lsuc ι) where field ar : Type ι -- ar indexes the contraints in the instance cs : (i : ar) → Constraint var (λ v → Domain (𝒜 v)) diff --git a/src/Homomorphisms/Func.lagda b/src/Homomorphisms/Func.lagda deleted file mode 100644 index ac18f754..00000000 --- a/src/Homomorphisms/Func.lagda +++ /dev/null @@ -1,34 +0,0 @@ ---- -layout: default -title : "Homomorphisms.Func module (The Agda Universal Algebra Library)" -date : "2021-09-17" -author: "agda-algebras development team" ---- - -### Types for Homomorphism of Setoid Algebras - -This is the [Homomorphisms.Func][] module of the [Agda Universal Algebra Library][]. - -\begin{code} - -{-# OPTIONS --without-K --exact-split --safe #-} - -module Homomorphisms.Func where - -open import Homomorphisms.Func.Basic -open import Homomorphisms.Func.Properties -open import Homomorphisms.Func.Kernels -open import Homomorphisms.Func.Products -open import Homomorphisms.Func.Noether -open import Homomorphisms.Func.Factor -open import Homomorphisms.Func.Isomorphisms -open import Homomorphisms.Func.HomomorphicImages - -\end{code} - --------------------------------- - -[← Homomorphisms.HomomorphicImages](Homomorphisms.HomomorphicImages.html) -[Homomorphisms.Func.Basic →](Homomorphisms.Func.Basic.html) - -{% include UALib.Links.md %} diff --git a/src/Homomorphisms/HomomorphicImages.lagda b/src/Homomorphisms/HomomorphicImages.lagda index c545e7e2..780c09ff 100644 --- a/src/Homomorphisms/HomomorphicImages.lagda +++ b/src/Homomorphisms/HomomorphicImages.lagda @@ -125,6 +125,6 @@ module _ {α β : Level} where -------------------------------------- [← Homomorphisms.Isomorphisms](Homomorphisms.Isomorphisms.html) -[Homomorphisms.Func →](Homomorphisms.Func.html) +[Homomorphisms.Setoid →](Homomorphisms.Setoid.html) {% include UALib.Links.md %} diff --git a/src/Homomorphisms/Setoid.lagda b/src/Homomorphisms/Setoid.lagda new file mode 100644 index 00000000..0154066c --- /dev/null +++ b/src/Homomorphisms/Setoid.lagda @@ -0,0 +1,34 @@ +--- +layout: default +title : "Homomorphisms.Setoid module (The Agda Universal Algebra Library)" +date : "2021-09-17" +author: "agda-algebras development team" +--- + +### Types for Homomorphism of Setoid Algebras + +This is the [Homomorphisms.Setoid][] module of the [Agda Universal Algebra Library][]. + +\begin{code} + +{-# OPTIONS --without-K --exact-split --safe #-} + +module Homomorphisms.Setoid where + +open import Homomorphisms.Setoid.Basic +open import Homomorphisms.Setoid.Properties +open import Homomorphisms.Setoid.Kernels +open import Homomorphisms.Setoid.Products +open import Homomorphisms.Setoid.Noether +open import Homomorphisms.Setoid.Factor +open import Homomorphisms.Setoid.Isomorphisms +open import Homomorphisms.Setoid.HomomorphicImages + +\end{code} + +-------------------------------- + +[← Homomorphisms.HomomorphicImages](Homomorphisms.HomomorphicImages.html) +[Homomorphisms.Setoid.Basic →](Homomorphisms.Setoid.Basic.html) + +{% include UALib.Links.md %} diff --git a/src/Homomorphisms/Func/Basic.lagda b/src/Homomorphisms/Setoid/Basic.lagda similarity index 67% rename from src/Homomorphisms/Func/Basic.lagda rename to src/Homomorphisms/Setoid/Basic.lagda index d6cec8bb..d67a0b80 100644 --- a/src/Homomorphisms/Func/Basic.lagda +++ b/src/Homomorphisms/Setoid/Basic.lagda @@ -1,13 +1,13 @@ --- layout: default -title : "Homomorphisms.Func.Basic module (Agda Universal Algebra Library)" +title : "Homomorphisms.Setoid.Basic module (Agda Universal Algebra Library)" date : "2021-09-13" author: "agda-algebras development team" --- #### Homomorphisms of Algebras over Setoids -This is the [Homomorphisms.Func.Basic][] module of the [Agda Universal Algebra Library][]. +This is the [Homomorphisms.Setoid.Basic][] module of the [Agda Universal Algebra Library][]. \begin{code} @@ -15,28 +15,28 @@ This is the [Homomorphisms.Func.Basic][] module of the [Agda Universal Algebra L open import Algebras.Basic using (𝓞 ; 𝓥 ; Signature ) -module Homomorphisms.Func.Basic {𝑆 : Signature 𝓞 𝓥} where +module Homomorphisms.Setoid.Basic {𝑆 : Signature 𝓞 𝓥} where -- Imports from Agda and the Agda Standard Library ------------------------------ -open import Agda.Primitive using ( _⊔_ ; Level ) renaming ( Set to Type ) +open import Agda.Primitive using ( _⊔_ ; Level ) renaming ( Set to Type ) open import Data.Product using ( _,_ ; Σ ; Σ-syntax ) -open import Function.Bundles using () renaming ( Func to _⟶_ ) +open import Function.Bundles using () renaming ( Func to _⟶_ ) open import Relation.Binary using ( Setoid ) -- Imports from the Agda Universal Algebra Library --------------------------- -open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) -open import Overture.Func.Injective using ( IsInjective ) -open import Overture.Func.Surjective using ( IsSurjective ) -open import Algebras.Func.Basic {𝑆 = 𝑆} using ( SetoidAlgebra ; _̂_ ) +open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) +open import Overture.Setoid.Injective using ( IsInjective ) +open import Overture.Setoid.Surjective using ( IsSurjective ) +open import Algebras.Setoid.Basic {𝑆 = 𝑆} using ( Algebra ; _̂_ ) private variable α β ρᵃ ρᵇ : Level -module _ (𝑨 : SetoidAlgebra α ρᵃ)(𝑩 : SetoidAlgebra β ρᵇ) where - open SetoidAlgebra 𝑨 using () renaming (Domain to A ) - open SetoidAlgebra 𝑩 using () renaming (Domain to B ) - open Setoid A using () renaming ( _≈_ to _≈₁_ ) - open Setoid B using () renaming ( _≈_ to _≈₂_ ) +module _ (𝑨 : Algebra α ρᵃ)(𝑩 : Algebra β ρᵇ) where + open Algebra 𝑨 using () renaming (Domain to A ) + open Algebra 𝑩 using () renaming (Domain to B ) + open Setoid A using () renaming ( _≈_ to _≈₁_ ) + open Setoid B using () renaming ( _≈_ to _≈₂_ ) open _⟶_ {a = α}{ρᵃ}{β}{ρᵇ}{From = A}{To = B} renaming (f to _⟨$⟩_ ) compatible-map-op : (A ⟶ B) → ∣ 𝑆 ∣ → Type (𝓥 ⊔ α ⊔ ρᵇ) @@ -89,7 +89,7 @@ module _ (𝑨 : SetoidAlgebra α ρᵃ)(𝑩 : SetoidAlgebra β ρᵇ) where epi→hom : epi → hom epi→hom h = IsEpi.HomReduct ∥ h ∥ -module _ (𝑨 : SetoidAlgebra α ρᵃ)(𝑩 : SetoidAlgebra β ρᵇ) where +module _ (𝑨 : Algebra α ρᵃ)(𝑩 : Algebra β ρᵇ) where open IsEpi open IsMon @@ -103,8 +103,8 @@ module _ (𝑨 : SetoidAlgebra α ρᵃ)(𝑩 : SetoidAlgebra β ρᵇ) where -------------------------------- -[↑ Homomorphisms.Func](Homomorphisms.Func.html) -[Homomorphisms.Func.Properties →](Homomorphisms.Func.Properties.html) +[↑ Homomorphisms.Setoid](Homomorphisms.Setoid.html) +[Homomorphisms.Setoid.Properties →](Homomorphisms.Setoid.Properties.html) {% include UALib.Links.md %} diff --git a/src/Homomorphisms/Func/Factor.lagda b/src/Homomorphisms/Setoid/Factor.lagda similarity index 70% rename from src/Homomorphisms/Func/Factor.lagda rename to src/Homomorphisms/Setoid/Factor.lagda index 57721ab2..12dce22b 100644 --- a/src/Homomorphisms/Func/Factor.lagda +++ b/src/Homomorphisms/Setoid/Factor.lagda @@ -1,13 +1,13 @@ --- layout: default -title : "Homomorphisms.Func.Factor module (The Agda Universal Algebra Library)" +title : "Homomorphisms.Setoid.Factor module (The Agda Universal Algebra Library)" date : "2021-09-13" author: "agda-algebras development team" --- -#### Factoring Homomorphism of SetoidAlgebras +#### Factoring Homomorphism of Algebras -This is the [Homomorphisms.Func.Factor][] module of the [Agda Universal Algebra Library][]. +This is the [Homomorphisms.Setoid.Factor][] module of the [Agda Universal Algebra Library][]. \begin{code} @@ -15,24 +15,25 @@ This is the [Homomorphisms.Func.Factor][] module of the [Agda Universal Algebra open import Algebras.Basic using (𝓞 ; 𝓥 ; Signature ) -module Homomorphisms.Func.Factor {𝑆 : Signature 𝓞 𝓥} where +module Homomorphisms.Setoid.Factor {𝑆 : Signature 𝓞 𝓥} where -- Imports from Agda and the Agda Standard Library ------------------------------------------------- -open import Data.Product using ( _,_ ; Σ-syntax ) renaming ( proj₁ to fst ; proj₂ to snd ) -open import Function using ( _∘_ ) renaming ( Func to _⟶_ ) -open import Level using ( Level ) -open import Relation.Binary using ( Setoid ) -open import Relation.Unary using ( _⊆_ ) +open import Data.Product using ( _,_ ; Σ-syntax ) renaming ( proj₁ to fst ; proj₂ to snd ) +open import Function using ( _∘_ ) renaming ( Func to _⟶_ ) +open import Level using ( Level ) +open import Relation.Binary using ( Setoid ) +open import Relation.Unary using ( _⊆_ ) open import Relation.Binary.PropositionalEquality as ≡ using () import Relation.Binary.Reasoning.Setoid as SetoidReasoning -- Imports from the Agda Universal Algebra Library ------------------------------------------------ -open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) -open import Overture.Func.Inverses using ( Image_∋_ ) -open import Overture.Func.Surjective using ( IsSurjective ; SurjInv ; SurjInvIsInverseʳ ; epic-factor ) -open import Relations.Discrete using ( kernelRel ) -open import Algebras.Func.Basic {𝑆 = 𝑆} using ( SetoidAlgebra ; 𝕌[_] ; _̂_ ) -open import Homomorphisms.Func.Basic {𝑆 = 𝑆} using ( hom ; IsHom ; compatible-map ; epi ; IsEpi) +open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) +open import Overture.Setoid.Inverses using ( Image_∋_ ) +open import Overture.Setoid.Surjective using ( IsSurjective ; SurjInv ) + using ( SurjInvIsInverseʳ ; epic-factor ) +open import Relations.Discrete using ( kernelRel ) +open import Algebras.Setoid.Basic {𝑆 = 𝑆} using ( Algebra ; 𝕌[_] ; _̂_ ) +open import Homomorphisms.Setoid.Basic {𝑆 = 𝑆} using ( hom ; IsHom ; compatible-map ; epi ; IsEpi) private variable α ρᵃ β ρᵇ γ ρᶜ : Level @@ -56,13 +57,13 @@ We will prove this in case h is both surjective and injective. \begin{code} -module _ {𝑨 : SetoidAlgebra α ρᵃ} - (𝑩 : SetoidAlgebra β ρᵇ) - {𝑪 : SetoidAlgebra γ ρᶜ} +module _ {𝑨 : Algebra α ρᵃ} + (𝑩 : Algebra β ρᵇ) + {𝑪 : Algebra γ ρᶜ} (gh : hom 𝑨 𝑩)(hh : hom 𝑨 𝑪) where - open SetoidAlgebra 𝑩 using () renaming (Domain to B ) - open SetoidAlgebra 𝑪 using ( Interp ) renaming (Domain to C ) + open Algebra 𝑩 using () renaming (Domain to B ) + open Algebra 𝑪 using ( Interp ) renaming (Domain to C ) open Setoid B using () renaming ( _≈_ to _≈₂_ ; sym to sym₂ ) open Setoid C using ( trans ) renaming ( _≈_ to _≈₃_ ; sym to sym₃ ) open SetoidReasoning B @@ -155,8 +156,8 @@ If, in addition, `g` is surjective, then so will be the factor `φ`. -------------------------------- -[← Homomorphisms.Func.Noether](Homomorphisms.Func.Noether.html) -[Homomorphisms.Func.Isomorphisms →](Homomorphisms.Func.Isomorphisms.html) +[← Homomorphisms.Setoid.Noether](Homomorphisms.Setoid.Noether.html) +[Homomorphisms.Setoid.Isomorphisms →](Homomorphisms.Setoid.Isomorphisms.html) {% include UALib.Links.md %} diff --git a/src/Homomorphisms/Func/HomomorphicImages.lagda b/src/Homomorphisms/Setoid/HomomorphicImages.lagda similarity index 59% rename from src/Homomorphisms/Func/HomomorphicImages.lagda rename to src/Homomorphisms/Setoid/HomomorphicImages.lagda index fc1dac9f..6a6452b7 100644 --- a/src/Homomorphisms/Func/HomomorphicImages.lagda +++ b/src/Homomorphisms/Setoid/HomomorphicImages.lagda @@ -1,13 +1,13 @@ --- layout: default -title : "Homomorphisms.Func.HomomorphicImages module (The Agda Universal Algebra Library)" +title : "Homomorphisms.Setoid.HomomorphicImages module (The Agda Universal Algebra Library)" date : "2021-09-14" author: "agda-algebras development team" --- #### Homomorphic images of setoid algebras -This is the [Homomorphisms.Func.HomomorphicImages][] module of the [Agda Universal Algebra Library][]. +This is the [Homomorphisms.Setoid.HomomorphicImages][] module of the [Agda Universal Algebra Library][]. \begin{code} @@ -15,33 +15,32 @@ This is the [Homomorphisms.Func.HomomorphicImages][] module of the [Agda Univers open import Algebras.Basic using (𝓞 ; 𝓥 ; Signature ) -module Homomorphisms.Func.HomomorphicImages {𝑆 : Signature 𝓞 𝓥} where +module Homomorphisms.Setoid.HomomorphicImages {𝑆 : Signature 𝓞 𝓥} where -- Imports from Agda and the Agda Standard Library ------------------------------------------ -open import Agda.Primitive using ( _⊔_ ; lsuc ) renaming ( Set to Type ) -open import Data.Product using ( _,_ ; Σ-syntax ) renaming ( _×_ to _∧_ ; proj₁ to fst ; proj₂ to snd ) -open import Function using ( Func ; _on_ ; _∘_ ; id ) -open import Level using ( Level ) -open import Relation.Binary using ( Setoid ; _Preserves_⟶_ ) -open import Relation.Unary using ( Pred ; _∈_ ) +open import Agda.Primitive using ( _⊔_ ; lsuc ) renaming ( Set to Type ) +open import Data.Product using ( _,_ ; Σ-syntax ) renaming ( _×_ to _∧_ ; proj₁ to fst ; proj₂ to snd ) +open import Function using ( Func ; _on_ ; _∘_ ; id ) +open import Level using ( Level ) +open import Relation.Binary using ( Setoid ; _Preserves_⟶_ ) +open import Relation.Unary using ( Pred ; _∈_ ) open import Relation.Binary.PropositionalEquality as ≡ using () -- Imports from the Agda Universal Algebra Library --------------------------------------------- -open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ; transport ) -open import Overture.Func.Preliminaries using ( lift∼lower ) -open import Overture.Func.Inverses using ( Ran ; _range ; _preimage ; _image ; Inv - ; _preimage≈image ; InvIsInverseʳ ; Image_∋_ ) -open import Overture.Func.Surjective using ( IsSurjective ; ∘-IsSurjective ) -open import Algebras.Func.Basic {𝑆 = 𝑆} using ( SetoidAlgebra ; ov ; _̂_ ; ⟦_⟧ ; Lift-Algˡ - ; Lift-Alg ; 𝕌[_] ) -open import Homomorphisms.Func.Basic {𝑆 = 𝑆} using ( hom ; IsHom ) -open import Homomorphisms.Func.Isomorphisms {𝑆 = 𝑆} using ( _≅_ ; Lift-≅ ) -open import Homomorphisms.Func.Properties {𝑆 = 𝑆} using ( Lift-homˡ ; ToLiftˡ ; lift-hom-lemma ; 𝒾𝒹 ; ∘-hom ) - -private variable - α ρᵃ β ρᵇ : Level - -open SetoidAlgebra +open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ; transport ) +open import Overture.Setoid.Preliminaries using ( lift∼lower ) +open import Overture.Setoid.Inverses using ( Ran ; _range ; _preimage ; _image ; Inv ) + using ( _preimage≈image ; InvIsInverseʳ ; Image_∋_ ) +open import Overture.Setoid.Surjective using ( IsSurjective ; ∘-IsSurjective ) +open import Algebras.Setoid.Basic {𝑆 = 𝑆} using ( Algebra ; ov ; _̂_ ; ⟦_⟧ ; Lift-Algˡ ) + using ( Lift-Alg ; 𝕌[_] ) +open import Homomorphisms.Setoid.Basic {𝑆 = 𝑆} using ( hom ; IsHom ) +open import Homomorphisms.Setoid.Isomorphisms {𝑆 = 𝑆} using ( _≅_ ; Lift-≅ ) +open import Homomorphisms.Setoid.Properties {𝑆 = 𝑆} using ( Lift-homˡ ; ToLiftˡ ; lift-hom-lemma ) + using ( 𝒾𝒹 ; ∘-hom ) +private variable α ρᵃ β ρᵇ : Level + +open Algebra \end{code} @@ -51,38 +50,39 @@ We begin with what seems, for our purposes, the most useful way to represent the open IsHom -_IsHomImageOf_ : (𝑩 : SetoidAlgebra β ρᵇ)(𝑨 : SetoidAlgebra α ρᵃ) → Type (𝓞 ⊔ 𝓥 ⊔ α ⊔ β ⊔ ρᵃ ⊔ ρᵇ) +_IsHomImageOf_ : (𝑩 : Algebra β ρᵇ)(𝑨 : Algebra α ρᵃ) → Type (𝓞 ⊔ 𝓥 ⊔ α ⊔ β ⊔ ρᵃ ⊔ ρᵇ) 𝑩 IsHomImageOf 𝑨 = Σ[ φ ∈ hom 𝑨 𝑩 ] IsSurjective ∣ φ ∣ -HomImages : SetoidAlgebra α ρᵃ → Type (α ⊔ ρᵃ ⊔ ov (β ⊔ ρᵇ)) -HomImages {β = β}{ρᵇ = ρᵇ} 𝑨 = Σ[ 𝑩 ∈ SetoidAlgebra β ρᵇ ] 𝑩 IsHomImageOf 𝑨 +HomImages : Algebra α ρᵃ → Type (α ⊔ ρᵃ ⊔ ov (β ⊔ ρᵇ)) +HomImages {β = β}{ρᵇ = ρᵇ} 𝑨 = Σ[ 𝑩 ∈ Algebra β ρᵇ ] 𝑩 IsHomImageOf 𝑨 -IdHomImage : {𝑨 : SetoidAlgebra α ρᵃ} → 𝑨 IsHomImageOf 𝑨 +IdHomImage : {𝑨 : Algebra α ρᵃ} → 𝑨 IsHomImageOf 𝑨 IdHomImage {α = α}{𝑨 = 𝑨} = 𝒾𝒹 , λ {y} → Image_∋_.eq y refl where open Setoid (Domain 𝑨) using ( refl ) \end{code} -These types should be self-explanatory, but just to be sure, let's describe the Sigma type appearing in the second definition. Given an `𝑆`-algebra `𝑨 : SetoidAlgebra α ρ`, the type `HomImages 𝑨` denotes the class of algebras `𝑩 : SetoidAlgebra β ρ` with a map `φ : ∣ 𝑨 ∣ → ∣ 𝑩 ∣` such that `φ` is a surjective homomorphism. +These types should be self-explanatory, but just to be sure, let's describe the Sigma type appearing in the second definition. Given an `𝑆`-algebra `𝑨 : Algebra α ρ`, the type `HomImages 𝑨` denotes the class of algebras `𝑩 : Algebra β ρ` with a map `φ : ∣ 𝑨 ∣ → ∣ 𝑩 ∣` such that `φ` is a surjective homomorphism. #### The image algebra of a hom -Here we show how to construct a SetoidAlgebra (called `ImageAlgebra` below) that is the image of given hom. +Here we show how to construct a Algebra (called `ImageAlgebra` below) that is the image of given hom. \begin{code} -module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} where - open SetoidAlgebra 𝑨 using (Interp) renaming (Domain to A ) - open SetoidAlgebra 𝑩 using () renaming (Domain to B ; Interp to InterpB ) +module _ {𝑨 : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ} where + open Algebra 𝑨 using (Interp) renaming (Domain to A ) + open Algebra 𝑩 using () renaming (Domain to B ; Interp to InterpB ) - open Setoid A using ( ) renaming ( _≈_ to _≈₁_ ; Carrier to ∣A∣) - open Setoid B using ( reflexive ) renaming ( _≈_ to _≈₂_ ; refl to refl₂ ; sym to sym₂ ; trans to trans₂ ; Carrier to ∣B∣) + open Setoid A using ( ) renaming ( _≈_ to _≈₁_ ; Carrier to ∣A∣) + open Setoid B using ( reflexive ) renaming ( _≈_ to _≈₂_ ; refl to refl₂ ) + renaming ( sym to sym₂ ; trans to trans₂ ; Carrier to ∣B∣) open Func using ( cong ) renaming (f to _⟨$⟩_ ) open IsHom - HomImageOf[_] : hom 𝑨 𝑩 → SetoidAlgebra (α ⊔ β ⊔ ρᵇ) ρᵇ + HomImageOf[_] : hom 𝑨 𝑩 → Algebra (α ⊔ β ⊔ ρᵇ) ρᵇ HomImageOf[ h ] = record { Domain = Ran ∣ h ∣ ; Interp = record { f = f' ; cong = cong' } } where @@ -121,11 +121,11 @@ Given a class `𝒦` of `𝑆`-algebras, we need a type that expresses the asser \begin{code} -IsHomImageOfClass : {𝒦 : Pred (SetoidAlgebra α ρᵃ)(lsuc α)} → SetoidAlgebra α ρᵃ → Type (ov (α ⊔ ρᵃ)) -IsHomImageOfClass {𝒦 = 𝒦} 𝑩 = Σ[ 𝑨 ∈ SetoidAlgebra _ _ ] ((𝑨 ∈ 𝒦) ∧ (𝑩 IsHomImageOf 𝑨)) +IsHomImageOfClass : {𝒦 : Pred (Algebra α ρᵃ)(lsuc α)} → Algebra α ρᵃ → Type (ov (α ⊔ ρᵃ)) +IsHomImageOfClass {𝒦 = 𝒦} 𝑩 = Σ[ 𝑨 ∈ Algebra _ _ ] ((𝑨 ∈ 𝒦) ∧ (𝑩 IsHomImageOf 𝑨)) -HomImageOfClass : Pred (SetoidAlgebra α ρᵃ) (lsuc α) → Type (ov (α ⊔ ρᵃ)) -HomImageOfClass 𝒦 = Σ[ 𝑩 ∈ SetoidAlgebra _ _ ] IsHomImageOfClass {𝒦 = 𝒦} 𝑩 +HomImageOfClass : Pred (Algebra α ρᵃ) (lsuc α) → Type (ov (α ⊔ ρᵃ)) +HomImageOfClass 𝒦 = Σ[ 𝑩 ∈ Algebra _ _ ] IsHomImageOfClass {𝒦 = 𝒦} 𝑩 \end{code} @@ -136,10 +136,10 @@ Here are some tools that have been useful (e.g., in the road to the proof of Bir \begin{code} -module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} where +module _ {𝑨 : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ} where - open SetoidAlgebra 𝑨 using () renaming ( Domain to A ) - open SetoidAlgebra 𝑩 using () renaming ( Domain to B ) + open Algebra 𝑨 using () renaming ( Domain to A ) + open Algebra 𝑩 using () renaming ( Domain to B ) open Setoid B using ( sym ; trans ) renaming ( _≈_ to _≈₂_ ) open Func using ( cong ) renaming ( f to _⟨$⟩_ ) @@ -150,7 +150,7 @@ module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} where Lift-epi-is-epiˡ h ℓᵃ ℓᵇ hepi {b} = Goal where - open SetoidAlgebra (Lift-Algˡ 𝑩 ℓᵇ) using () renaming (Domain to lB ) + open Algebra (Lift-Algˡ 𝑩 ℓᵇ) using () renaming (Domain to lB ) open Setoid lB using () renaming ( _≈_ to _≈ₗ₂_ ) a : 𝕌[ 𝑨 ] @@ -188,18 +188,14 @@ module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} where Goal : (Lift-Algˡ 𝑩 ℓᵇ) IsHomImageOf (Lift-Algˡ 𝑨 ℓᵃ) Goal = lφ , lφepic -\end{code} - - -\begin{code} -module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} where +module _ {𝑨 : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ} where open _≅_ Lift-HomImage-lemma : ∀{γ} → (Lift-Alg 𝑨 γ γ) IsHomImageOf 𝑩 → 𝑨 IsHomImageOf 𝑩 Lift-HomImage-lemma {γ} φ = ∘-hom ∣ φ ∣ (from Lift-≅) , ∘-IsSurjective ∥ φ ∥ (fromIsSurjective (Lift-≅{𝑨 = 𝑨})) -module _ {𝑨 𝑨' : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} where +module _ {𝑨 𝑨' : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ} where open _≅_ HomImage-≅ : 𝑨 IsHomImageOf 𝑨' → 𝑨 ≅ 𝑩 → 𝑩 IsHomImageOf 𝑨' HomImage-≅ φ A≅B = ∘-hom ∣ φ ∣ (to A≅B) , ∘-IsSurjective ∥ φ ∥ (toIsSurjective A≅B) @@ -210,7 +206,7 @@ module _ {𝑨 𝑨' : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} wh \end{code} -------------------------------------- -[← Homomorphisms.Func.Isomorphisms](Homomorphisms.Func.Isomorphisms.html) +[← Homomorphisms.Setoid.Isomorphisms](Homomorphisms.Setoid.Isomorphisms.html) [Terms →](Terms.html) {% include UALib.Links.md %} diff --git a/src/Homomorphisms/Func/Isomorphisms.lagda b/src/Homomorphisms/Setoid/Isomorphisms.lagda similarity index 79% rename from src/Homomorphisms/Func/Isomorphisms.lagda rename to src/Homomorphisms/Setoid/Isomorphisms.lagda index 01bf525e..4217f71c 100644 --- a/src/Homomorphisms/Func/Isomorphisms.lagda +++ b/src/Homomorphisms/Setoid/Isomorphisms.lagda @@ -1,6 +1,6 @@ --- layout: default -title : "Homomorphisms.Func.Isomoprhisms module (The Agda Universal Algebra Library)" +title : "Homomorphisms.Setoid.Isomoprhisms module (The Agda Universal Algebra Library)" date : "2021-09-15" author: "agda-algebras development team" --- @@ -13,31 +13,32 @@ author: "agda-algebras development team" open import Algebras.Basic using ( 𝓞 ; 𝓥 ; Signature ) -module Homomorphisms.Func.Isomorphisms {𝑆 : Signature 𝓞 𝓥} where +module Homomorphisms.Setoid.Isomorphisms {𝑆 : Signature 𝓞 𝓥} where -- Imports from Agda (builtin/primitive) and the Agda Standard Library --------------------- -open import Agda.Primitive using ( _⊔_ ; lsuc ; Level ) renaming ( Set to Type ) +open import Agda.Primitive using ( _⊔_ ; lsuc ; Level ) renaming ( Set to Type ) open import Data.Product using ( _,_ ) -open import Data.Unit.Polymorphic.Base using () renaming ( ⊤ to 𝟙 ; tt to ∗ ) +open import Data.Unit.Polymorphic.Base using () renaming ( ⊤ to 𝟙 ; tt to ∗ ) open import Data.Unit.Base using ( ⊤ ; tt ) -open import Function using ( id ) renaming ( Func to _⟶_ ) +open import Function using ( id ) renaming ( Func to _⟶_ ) open import Level using ( Level ; Lift ; lift ; lower ) open import Relation.Binary using ( Setoid ) open import Relation.Binary.Definitions using ( Reflexive ; Sym ; Trans ) open import Relation.Binary.PropositionalEquality as ≡ using () -- Imports from the Agda Universal Algebra Library ----------------------------------------- -open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) -open import Overture.Func.Preliminaries using ( _∘_ ) -open import Overture.Func.Inverses using ( eq ) -open import Overture.Func.Injective using ( IsInjective ) -open import Overture.Func.Surjective using ( IsSurjective ) -open import Algebras.Func.Basic {𝑆 = 𝑆} using ( SetoidAlgebra ; Lift-Alg ; Lift-Algˡ ; Lift-Algʳ ; _̂_) -open import Algebras.Func.Products {𝑆 = 𝑆} using ( ⨅ ) -open import Homomorphisms.Func.Basic {𝑆 = 𝑆} using ( hom ; IsHom ) -open import Homomorphisms.Func.Properties {𝑆 = 𝑆} using ( 𝒾𝒹 ; ∘-hom ; ToLiftˡ ; FromLiftˡ - ; ToFromLiftˡ ; FromToLiftˡ ; ToLiftʳ - ; FromLiftʳ ; ToFromLiftʳ ; FromToLiftʳ ) +open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) +open import Overture.Setoid.Preliminaries using ( _∘_ ) +open import Overture.Setoid.Inverses using ( eq ) +open import Overture.Setoid.Injective using ( IsInjective ) +open import Overture.Setoid.Surjective using ( IsSurjective ) +open import Algebras.Setoid.Basic {𝑆 = 𝑆} using ( Algebra ; Lift-Alg ; _̂_) + using ( Lift-Algˡ ; Lift-Algʳ ) +open import Algebras.Setoid.Products {𝑆 = 𝑆} using ( ⨅ ) +open import Homomorphisms.Setoid.Basic {𝑆 = 𝑆} using ( hom ; IsHom ) +open import Homomorphisms.Setoid.Properties {𝑆 = 𝑆} using ( 𝒾𝒹 ; ∘-hom ; ToLiftˡ ; FromLiftˡ ) + using ( ToFromLiftˡ ; FromToLiftˡ ; ToLiftʳ ) + using ( FromLiftʳ ; ToFromLiftʳ ; FromToLiftʳ ) \end{code} @@ -46,7 +47,7 @@ Recall, `f ~ g` means f and g are *extensionally* (or pointwise) equal; i.e., ` We could define this using Sigma types, like this. ```agda -_≅_ : {α β : Level}(𝑨 : Algebra α 𝑆)(𝑩 : SetoidAlgebra β ρᵇ) → Type(𝓞 ⊔ 𝓥 ⊔ α ⊔ β) +_≅_ : {α β : Level}(𝑨 : Algebra α 𝑆)(𝑩 : Algebra β ρᵇ) → Type(𝓞 ⊔ 𝓥 ⊔ α ⊔ β) 𝑨 ≅ 𝑩 = Σ[ f ∈ (hom 𝑨 𝑩)] Σ[ g ∈ hom 𝑩 𝑨 ] ((∣ f ∣ ∘ ∣ g ∣ ≈ ∣ 𝒾𝒹 𝑩 ∣) × (∣ g ∣ ∘ ∣ f ∣ ≈ ∣ 𝒾𝒹 𝑨 ∣)) ``` @@ -59,9 +60,9 @@ private variable open _⟶_ using ( cong ) renaming ( f to _⟨$⟩_ ) -open SetoidAlgebra using ( Domain ) +open Algebra using ( Domain ) -module _ (𝑨 : SetoidAlgebra α ρᵃ) (𝑩 : SetoidAlgebra β ρᵇ) where +module _ (𝑨 : Algebra α ρᵃ) (𝑩 : Algebra β ρᵇ) where open Setoid (Domain 𝑨) using ( sym ; trans ) renaming ( _≈_ to _≈₁_ ) open Setoid (Domain 𝑩) using () renaming ( _≈_ to _≈₂_ ; sym to sym₂ ; trans to trans₂) @@ -135,7 +136,7 @@ open _≅_ -module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} where +module _ {𝑨 : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ} where open Setoid (Domain 𝑨) using ( _≈_ ; sym ; trans ) -- The "to" map of an isomorphism is injective. @@ -154,7 +155,7 @@ module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} where -- The "from" map of an isomorphism is injective. -≅fromInjective : {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} +≅fromInjective : {𝑨 : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ} (φ : 𝑨 ≅ 𝑩) → IsInjective ∣ from φ ∣ ≅fromInjective φ = ≅toInjective (≅-sym φ) @@ -165,18 +166,18 @@ Fortunately, the lift operation preserves isomorphism (i.e., it's an *algebraic \begin{code} -module _ {𝑨 : SetoidAlgebra α ρᵃ}{ℓ : Level} where +module _ {𝑨 : Algebra α ρᵃ}{ℓ : Level} where Lift-≅ˡ : 𝑨 ≅ (Lift-Algˡ 𝑨 ℓ) Lift-≅ˡ = mkiso ToLiftˡ FromLiftˡ (ToFromLiftˡ{𝑨 = 𝑨}) (FromToLiftˡ{𝑨 = 𝑨}{ℓ}) Lift-≅ʳ : 𝑨 ≅ (Lift-Algʳ 𝑨 ℓ) Lift-≅ʳ = mkiso ToLiftʳ FromLiftʳ (ToFromLiftʳ{𝑨 = 𝑨}) (FromToLiftʳ{𝑨 = 𝑨}{ℓ}) -Lift-≅ : {𝑨 : SetoidAlgebra α ρᵃ}{ℓ ρ : Level} → 𝑨 ≅ (Lift-Alg 𝑨 ℓ ρ) +Lift-≅ : {𝑨 : Algebra α ρᵃ}{ℓ ρ : Level} → 𝑨 ≅ (Lift-Alg 𝑨 ℓ ρ) Lift-≅ = ≅-trans Lift-≅ˡ Lift-≅ʳ -module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ}{ℓᵃ ℓᵇ : Level} where +module _ {𝑨 : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ}{ℓᵃ ℓᵇ : Level} where Lift-Alg-isoˡ : 𝑨 ≅ 𝑩 → Lift-Algˡ 𝑨 ℓᵃ ≅ Lift-Algˡ 𝑩 ℓᵇ Lift-Alg-isoˡ A≅B = ≅-trans (≅-trans (≅-sym Lift-≅ˡ ) A≅B) Lift-≅ˡ @@ -185,7 +186,7 @@ module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ}{ℓᵃ Lift-Alg-isoʳ A≅B = ≅-trans (≅-trans (≅-sym Lift-≅ʳ ) A≅B) Lift-≅ʳ -Lift-Alg-iso : {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ}{ℓᵃ rᵃ ℓᵇ rᵇ : Level} +Lift-Alg-iso : {𝑨 : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ}{ℓᵃ rᵃ ℓᵇ rᵇ : Level} → 𝑨 ≅ 𝑩 → Lift-Alg 𝑨 ℓᵃ rᵃ ≅ Lift-Alg 𝑩 ℓᵇ rᵇ Lift-Alg-iso {ℓᵇ = ℓᵇ} A≅B = ≅-trans (Lift-Alg-isoʳ{ℓᵇ = ℓᵇ}(≅-trans (Lift-Alg-isoˡ{ℓᵇ = ℓᵇ} A≅B) (≅-sym Lift-≅ˡ))) @@ -197,7 +198,7 @@ The lift is also associative, up to isomorphism at least. \begin{code} -module _ {𝑨 : SetoidAlgebra α ρᵃ}{ℓ₁ ℓ₂ : Level} where +module _ {𝑨 : Algebra α ρᵃ}{ℓ₁ ℓ₂ : Level} where Lift-assocˡ : Lift-Algˡ 𝑨 (ℓ₁ ⊔ ℓ₂) ≅ Lift-Algˡ (Lift-Algˡ 𝑨 ℓ₁) ℓ₂ Lift-assocˡ = ≅-trans (≅-trans (≅-sym Lift-≅ˡ) Lift-≅ˡ) Lift-≅ˡ @@ -206,11 +207,11 @@ module _ {𝑨 : SetoidAlgebra α ρᵃ}{ℓ₁ ℓ₂ : Level} where Lift-assocʳ = ≅-trans (≅-trans (≅-sym Lift-≅ʳ) Lift-≅ʳ) Lift-≅ʳ -Lift-assoc : {𝑨 : SetoidAlgebra α ρᵃ}{ℓ ρ : Level} +Lift-assoc : {𝑨 : Algebra α ρᵃ}{ℓ ρ : Level} → Lift-Alg 𝑨 ℓ ρ ≅ Lift-Algʳ (Lift-Algˡ 𝑨 ℓ) ρ Lift-assoc {𝑨 = 𝑨}{ℓ}{ρ} = ≅-trans (≅-sym Lift-≅) (≅-trans Lift-≅ˡ Lift-≅ʳ) -Lift-assoc' : {𝑨 : SetoidAlgebra α α}{β γ : Level} +Lift-assoc' : {𝑨 : Algebra α α}{β γ : Level} → Lift-Alg 𝑨 (β ⊔ γ) (β ⊔ γ) ≅ Lift-Alg (Lift-Alg 𝑨 β β) γ γ Lift-assoc'{𝑨 = 𝑨}{β}{γ} = ≅-trans (≅-sym Lift-≅) (≅-trans Lift-≅ Lift-≅) @@ -221,14 +222,14 @@ Products of isomorphic families of algebras are themselves isomorphic. The proof \begin{code} module _ {𝓘 : Level}{I : Type 𝓘} - {𝒜 : I → SetoidAlgebra α ρᵃ} - {ℬ : I → SetoidAlgebra β ρᵇ} where + {𝒜 : I → Algebra α ρᵃ} + {ℬ : I → Algebra β ρᵇ} where - open SetoidAlgebra (⨅ 𝒜) using () renaming (Domain to ⨅A ) + open Algebra (⨅ 𝒜) using () renaming (Domain to ⨅A ) open Setoid ⨅A using () renaming ( _≈_ to _≈₁_ ) - open SetoidAlgebra (⨅ ℬ) using () renaming (Domain to ⨅B ) + open Algebra (⨅ ℬ) using () renaming (Domain to ⨅B ) open Setoid ⨅B using () renaming ( _≈_ to _≈₂_ ) open IsHom @@ -264,13 +265,13 @@ A nearly identical proof goes through for isomorphisms of lifted products. \begin{code} module _ {𝓘 : Level}{I : Type 𝓘} - {𝒜 : I → SetoidAlgebra α ρᵃ} - {ℬ : (Lift γ I) → SetoidAlgebra β ρᵇ} where + {𝒜 : I → Algebra α ρᵃ} + {ℬ : (Lift γ I) → Algebra β ρᵇ} where - open SetoidAlgebra (⨅ 𝒜) using () renaming (Domain to ⨅A ) + open Algebra (⨅ 𝒜) using () renaming (Domain to ⨅A ) open Setoid ⨅A using () renaming ( _≈_ to _≈₁_ ) - open SetoidAlgebra (⨅ ℬ) using () renaming (Domain to ⨅B ) + open Algebra (⨅ ℬ) using () renaming (Domain to ⨅B ) open Setoid ⨅B using () renaming ( _≈_ to _≈₂_ ) open IsHom @@ -305,23 +306,23 @@ module _ {𝓘 : Level}{I : Type 𝓘} module _ {𝓘 : Level}{I : Type 𝓘} - {𝒜 : I → SetoidAlgebra α ρᵃ} + {𝒜 : I → Algebra α ρᵃ} where open IsHom - open SetoidAlgebra using (Domain) + open Algebra using (Domain) open Setoid using (_≈_ ) ⨅≅⨅ℓ : ∀ {ℓ} → ⨅ 𝒜 ≅ ⨅ (λ i → Lift-Alg (𝒜 (lower{ℓ = ℓ} i)) ℓ ℓ) ⨅≅⨅ℓ {ℓ} = mkiso (φ , φhom) (ψ , ψhom) φ∼ψ ψ∼φ where - open SetoidAlgebra (⨅ 𝒜) using () renaming (Domain to ⨅A ) + open Algebra (⨅ 𝒜) using () renaming (Domain to ⨅A ) open Setoid ⨅A using () renaming ( _≈_ to _≈₁_ ) - ⨅ℓ𝒜 : SetoidAlgebra _ _ + ⨅ℓ𝒜 : Algebra _ _ ⨅ℓ𝒜 = ⨅ (λ i → Lift-Alg (𝒜 (lower{ℓ = ℓ} i)) ℓ ℓ) - open SetoidAlgebra ⨅ℓ𝒜 using () renaming (Domain to ⨅ℓA) + open Algebra ⨅ℓ𝒜 using () renaming (Domain to ⨅ℓA) φ : ⨅A ⟶ ⨅ℓA (φ ⟨$⟩ x) i = lift (x (lower i)) @@ -347,19 +348,19 @@ module _ {𝓘 : Level}{I : Type 𝓘} where open Setoid (Domain (𝒜 i)) using ( reflexive ) module _ {ι : Level}{I : Type ι} - {𝒜 : I → SetoidAlgebra α ρᵃ} + {𝒜 : I → Algebra α ρᵃ} where open IsHom - open SetoidAlgebra using (Domain) + open Algebra using (Domain) open Setoid using (_≈_ ) ⨅≅⨅ℓρ : ∀ {ℓ ρ} → ⨅ 𝒜 ≅ ⨅ (λ i → Lift-Alg (𝒜 i) ℓ ρ) ⨅≅⨅ℓρ {ℓ}{ρ} = mkiso φ ψ φ∼ψ ψ∼φ where - open SetoidAlgebra (⨅ 𝒜) using () renaming ( Domain to ⨅A ) + open Algebra (⨅ 𝒜) using () renaming ( Domain to ⨅A ) open Setoid ⨅A using () renaming ( _≈_ to _≈⨅A≈_ ) - open SetoidAlgebra (⨅ (λ i → Lift-Alg (𝒜 i) ℓ ρ)) using () renaming ( Domain to ⨅lA ) + open Algebra (⨅ (λ i → Lift-Alg (𝒜 i) ℓ ρ)) using () renaming ( Domain to ⨅lA ) open Setoid ⨅lA using () renaming ( _≈_ to _≈⨅lA≈_ ) φfunc : ⨅A ⟶ ⨅lA @@ -394,19 +395,19 @@ module _ {ι : Level}{I : Type ι} module _ {ℓᵃ : Level}{I : Type ℓᵃ} - {𝒜 : I → SetoidAlgebra α ρᵃ} + {𝒜 : I → Algebra α ρᵃ} where open IsHom - open SetoidAlgebra using (Domain) + open Algebra using (Domain) open Setoid using (_≈_ ) ⨅≅⨅lowerℓρ : ∀ {ℓ ρ} → ⨅ 𝒜 ≅ ⨅ (λ i → Lift-Alg (𝒜 (lower{ℓ = α ⊔ ρᵃ} i)) ℓ ρ) ⨅≅⨅lowerℓρ {ℓ}{ρ} = mkiso φ ψ φ∼ψ ψ∼φ where - open SetoidAlgebra (⨅ 𝒜) using () renaming ( Domain to ⨅A ) + open Algebra (⨅ 𝒜) using () renaming ( Domain to ⨅A ) open Setoid ⨅A using () renaming ( _≈_ to _≈⨅A≈_ ) - open SetoidAlgebra (⨅ (λ i → Lift-Alg (𝒜 (lower i)) ℓ ρ)) using () renaming ( Domain to ⨅lA ) + open Algebra (⨅ (λ i → Lift-Alg (𝒜 (lower i)) ℓ ρ)) using () renaming ( Domain to ⨅lA ) open Setoid ⨅lA using () renaming ( _≈_ to _≈⨅lA≈_ ) φfunc : ⨅A ⟶ ⨅lA @@ -443,14 +444,14 @@ module _ {ℓᵃ : Level}{I : Type ℓᵃ} ℓ⨅≅⨅ℓ : ∀ {ℓ} → Lift-Alg (⨅ 𝒜) ℓ ℓ ≅ ⨅ (λ i → Lift-Alg (𝒜 (lower{ℓ = ℓ} i)) ℓ ℓ) ℓ⨅≅⨅ℓ {ℓ} = mkiso (φ , φhom) (ψ , ψhom) φ∼ψ ψ∼φ -- φ∼ψ ψ∼φ where - ℓ⨅𝒜 : SetoidAlgebra _ _ + ℓ⨅𝒜 : Algebra _ _ ℓ⨅𝒜 = Lift-Alg (⨅ 𝒜) ℓ ℓ - ⨅ℓ𝒜 : SetoidAlgebra _ _ + ⨅ℓ𝒜 : Algebra _ _ ⨅ℓ𝒜 = ⨅ (λ i → Lift-Alg (𝒜 (lower{ℓ = ℓ} i)) ℓ ℓ) - open SetoidAlgebra ℓ⨅𝒜 using () renaming (Domain to ℓ⨅A ) + open Algebra ℓ⨅𝒜 using () renaming (Domain to ℓ⨅A ) open Setoid ℓ⨅A using () renaming ( _≈_ to _≈₁_ ) - open SetoidAlgebra ⨅ℓ𝒜 using () renaming (Domain to ⨅ℓA) + open Algebra ⨅ℓ𝒜 using () renaming (Domain to ⨅ℓA) open Setoid ⨅ℓA using () renaming ( _≈_ to _≈₂_ ) φ : ℓ⨅A ⟶ ⨅ℓA @@ -479,10 +480,10 @@ module _ {ℓᵃ : Level}{I : Type ℓᵃ} -module _ {ι : Level}{𝑨 : SetoidAlgebra α ρᵃ} where +module _ {ι : Level}{𝑨 : Algebra α ρᵃ} where - open SetoidAlgebra 𝑨 using () renaming (Domain to A ) - open SetoidAlgebra (⨅ (λ (i : 𝟙{ι}) → 𝑨)) using () renaming (Domain to ⨅A) + open Algebra 𝑨 using () renaming (Domain to A ) + open Algebra (⨅ (λ (i : 𝟙{ι}) → 𝑨)) using () renaming (Domain to ⨅A) open Setoid A using ( refl ) open _≅_ @@ -509,10 +510,10 @@ module _ {ι : Level}{𝑨 : SetoidAlgebra α ρᵃ} where from∼to ≅⨅⁺-refl = λ _ → refl -module _ {𝑨 : SetoidAlgebra α ρᵃ} where +module _ {𝑨 : Algebra α ρᵃ} where - open SetoidAlgebra 𝑨 using () renaming (Domain to A ) - open SetoidAlgebra (⨅ (λ (i : ⊤) → 𝑨)) using () renaming (Domain to ⨅A) + open Algebra 𝑨 using () renaming (Domain to A ) + open Algebra (⨅ (λ (i : ⊤) → 𝑨)) using () renaming (Domain to ⨅A) open Setoid A using ( refl ) open _≅_ @@ -543,7 +544,7 @@ module _ {𝑨 : SetoidAlgebra α ρᵃ} where ------------------------------ -[← Homomorphisms.Func.Factor](Homomorphisms.Func.Factor.html) -[Homomorphisms.Func.HomomorphicImages →](Homomorphisms.Func.HomomorphicImages.html) +[← Homomorphisms.Setoid.Factor](Homomorphisms.Setoid.Factor.html) +[Homomorphisms.Setoid.HomomorphicImages →](Homomorphisms.Setoid.HomomorphicImages.html) {% include UALib.Links.md %} diff --git a/src/Homomorphisms/Func/Kernels.lagda b/src/Homomorphisms/Setoid/Kernels.lagda similarity index 64% rename from src/Homomorphisms/Func/Kernels.lagda rename to src/Homomorphisms/Setoid/Kernels.lagda index 2b95cdb5..aea98284 100644 --- a/src/Homomorphisms/Func/Kernels.lagda +++ b/src/Homomorphisms/Setoid/Kernels.lagda @@ -1,13 +1,13 @@ --- layout: default -title : "Homomorphisms.Func.Kernels module (Agda Universal Algebra Library)" +title : "Homomorphisms.Setoid.Kernels module (Agda Universal Algebra Library)" date : "2021-09-13" author: "agda-algebras development team" --- -#### Kernels of Homomorphisms of SetoidAlgebras +#### Kernels of Homomorphisms -This is the [Homomorphisms.Func.Kernels][] module of the [Agda Universal Algebra Library][]. +This is the [Homomorphisms.Setoid.Kernels][] module of the [Agda Universal Algebra Library][]. \begin{code} @@ -15,37 +15,37 @@ This is the [Homomorphisms.Func.Kernels][] module of the [Agda Universal Algebra open import Algebras.Basic using (𝓞 ; 𝓥 ; Signature ) -module Homomorphisms.Func.Kernels {𝑆 : Signature 𝓞 𝓥} where +module Homomorphisms.Setoid.Kernels {𝑆 : Signature 𝓞 𝓥} where -- Imports from Agda and the Agda Standard Library ------------------------------------------ -open import Agda.Primitive using ( _⊔_ ; lsuc ) -- ; Level ) renaming ( Set to Type ; lzero to ℓ₀ ) +open import Agda.Primitive using ( _⊔_ ; lsuc ) open import Data.Product using ( _,_ ) open import Function using ( _∘_ ; id ) -open import Function.Bundles using () renaming ( Func to _⟶_ ) +open import Function.Bundles using () renaming ( Func to _⟶_ ) open import Level using ( Level ) open import Relation.Binary using ( Setoid ) open import Relation.Binary.PropositionalEquality as ≡ using () -- Imports from the Agda Universal Algebra Library ------------------------------------------ -open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) -open import Overture.Func.Inverses using ( Image_∋_ ) -open import Relations.Discrete using ( kerRel ; kerRelOfEquiv ) -open import Algebras.Func.Basic {𝑆 = 𝑆} using ( SetoidAlgebra ; _̂_ ; ov ) -open import Algebras.Func.Congruences {𝑆 = 𝑆} using ( _∣≈_ ; Con ; mkcon ; _╱_ ; IsCongruence ) -open import Homomorphisms.Func.Basic {𝑆 = 𝑆} using ( hom ; IsHom ; epi ; IsEpi ; epi→hom ) -open import Homomorphisms.Func.Properties {𝑆 = 𝑆} using ( 𝒾𝒹 ) +open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) +open import Overture.Setoid.Inverses using ( Image_∋_ ) +open import Relations.Discrete using ( kerRel ; kerRelOfEquiv ) +open import Algebras.Setoid.Basic {𝑆 = 𝑆} using ( Algebra ; _̂_ ; ov ) +open import Algebras.Setoid.Congruences {𝑆 = 𝑆} using ( _∣≈_ ; Con ; mkcon ; _╱_ ; IsCongruence ) +open import Homomorphisms.Setoid.Basic {𝑆 = 𝑆} using ( hom ; IsHom ; epi ; IsEpi ; epi→hom ) +open import Homomorphisms.Setoid.Properties {𝑆 = 𝑆} using ( 𝒾𝒹 ) private variable α β ρᵃ ρᵇ ℓ : Level -open SetoidAlgebra using ( Domain ) -open _⟶_ using ( cong ) renaming (f to _⟨$⟩_ ) +open Algebra using ( Domain ) +open _⟶_ using ( cong ) renaming (f to _⟨$⟩_ ) -module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} (hh : hom 𝑨 𝑩) where +module _ {𝑨 : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ} (hh : hom 𝑨 𝑩) where - open Setoid (Domain 𝑨) using ( reflexive ) renaming ( _≈_ to _≈₁_ ) - open SetoidAlgebra 𝑩 using ( Interp ) renaming (Domain to B ) - open Setoid B using ( sym ; trans ; isEquivalence ) renaming ( _≈_ to _≈₂_ ) + open Setoid (Domain 𝑨) using ( reflexive ) renaming ( _≈_ to _≈₁_ ) + open Algebra 𝑩 using ( Interp ) renaming (Domain to B ) + open Setoid B using ( sym ; trans ; isEquivalence ) renaming ( _≈_ to _≈₂_ ) private h = _⟨$⟩_ ∣ hh ∣ @@ -85,11 +85,11 @@ Now that we have a congruence, we can construct the quotient relative to the ker \begin{code} - kerquo : SetoidAlgebra α ρᵇ + kerquo : Algebra α ρᵇ kerquo = 𝑨 ╱ kercon -ker[_⇒_]_ : (𝑨 : SetoidAlgebra α ρᵃ) (𝑩 : SetoidAlgebra β ρᵇ) - → hom 𝑨 𝑩 → SetoidAlgebra _ _ +ker[_⇒_]_ : (𝑨 : Algebra α ρᵃ) (𝑩 : Algebra β ρᵇ) + → hom 𝑨 𝑩 → Algebra _ _ ker[ 𝑨 ⇒ 𝑩 ] h = kerquo h \end{code} @@ -100,7 +100,7 @@ Given an algebra `𝑨` and a congruence `θ`, the *canonical projection* is a m \begin{code} -module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} (h : hom 𝑨 𝑩) where +module _ {𝑨 : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ} (h : hom 𝑨 𝑩) where open IsCongruence @@ -108,9 +108,9 @@ module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} (h : hom πepi θ = p , pepi where - open SetoidAlgebra (𝑨 ╱ θ) using () renaming ( Domain to A/θ ) - open Setoid A/θ using ( sym ; refl ) - open IsHom {𝑨 = (𝑨 ╱ θ)} using ( compatible ) + open Algebra (𝑨 ╱ θ) using () renaming ( Domain to A/θ ) + open Setoid A/θ using ( sym ; refl ) + open IsHom {𝑨 = (𝑨 ╱ θ)} using ( compatible ) p : (Domain 𝑨) ⟶ A/θ p = record { f = id ; cong = reflexive ∥ θ ∥ } @@ -155,7 +155,7 @@ The kernel of the canonical projection of `𝑨` onto `𝑨 / θ` is equal to ` -------------------------------- -[← Homomorphisms.Func.Properties](Homomorphisms.Func.Properties.html) -[Homomorphisms.Func.Noether →](Homomorphisms.Func.Noether.html) +[← Homomorphisms.Setoid.Properties](Homomorphisms.Setoid.Properties.html) +[Homomorphisms.Setoid.Products →](Homomorphisms.Setoid.Products.html) {% include UALib.Links.md %} diff --git a/src/Homomorphisms/Func/Noether.lagda b/src/Homomorphisms/Setoid/Noether.lagda similarity index 59% rename from src/Homomorphisms/Func/Noether.lagda rename to src/Homomorphisms/Setoid/Noether.lagda index f3038032..e896d258 100644 --- a/src/Homomorphisms/Func/Noether.lagda +++ b/src/Homomorphisms/Setoid/Noether.lagda @@ -1,13 +1,13 @@ --- layout: default -title : "Homomorphisms.Func.Noether module (The Agda Universal Algebra Library)" +title : "Homomorphisms.Setoid.Noether module (The Agda Universal Algebra Library)" date : "2021-09-15" author: "agda-algebras development team" --- ### Homomorphism Theorems for Setoid Algebras -This is the [Homomorphisms.Func.Noether][] module of the [Agda Universal Algebra Library][]. +This is the [Homomorphisms.Setoid.Noether][] module of the [Agda Universal Algebra Library][]. \begin{code} @@ -15,23 +15,23 @@ This is the [Homomorphisms.Func.Noether][] module of the [Agda Universal Algebra open import Algebras.Basic using ( 𝓞 ; 𝓥 ; Signature ) -module Homomorphisms.Func.Noether {𝑆 : Signature 𝓞 𝓥} where +module Homomorphisms.Setoid.Noether {𝑆 : Signature 𝓞 𝓥} where -- Imports from Agda and the Agda Standard Library --------------------------- -open import Agda.Primitive using ( Level ) -open import Data.Product using (Σ-syntax ; _,_ ) renaming ( _×_ to _∧_ ) -open import Function.Base using ( id ) -open import Function.Bundles using () renaming ( Func to _⟶_ ) -open import Relation.Binary using ( Setoid ) +open import Agda.Primitive using ( Level ) +open import Data.Product using (Σ-syntax ; _,_ ) renaming ( _×_ to _∧_ ) +open import Function.Base using ( id ) +open import Function.Bundles using () renaming ( Func to _⟶_ ) +open import Relation.Binary using ( Setoid ) open import Relation.Binary.PropositionalEquality as ≡ using ( _≡_ ) import Relation.Binary.Reasoning.Setoid as SetoidReasoning -- Imports from agda-algebras ------------------------------------------------ -open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) -open import Overture.Func.Injective using ( IsInjective ) -open import Algebras.Func.Basic using ( SetoidAlgebra ; _̂_) -open import Homomorphisms.Func.Basic {𝑆 = 𝑆} using ( hom ; IsHom ) -open import Homomorphisms.Func.Kernels {𝑆 = 𝑆} using ( kerquo ; πker ) +open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) +open import Overture.Setoid.Injective using ( IsInjective ) +open import Algebras.Setoid.Basic using ( Algebra ; _̂_) +open import Homomorphisms.Setoid.Basic {𝑆 = 𝑆} using ( hom ; IsHom ) +open import Homomorphisms.Setoid.Kernels {𝑆 = 𝑆} using ( kerquo ; πker ) private variable α ρᵃ β ρᵇ γ ρᶜ ι : Level @@ -43,12 +43,12 @@ private variable \begin{code} open _⟶_ using ( cong ) renaming ( f to _⟨$⟩_ ) -open SetoidAlgebra using ( Domain ) +open Algebra using ( Domain ) -module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ}(hh : hom 𝑨 𝑩) where - open SetoidAlgebra 𝑩 using ( Interp ) renaming ( Domain to B ) +module _ {𝑨 : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ}(hh : hom 𝑨 𝑩) where + open Algebra 𝑩 using ( Interp ) renaming ( Domain to B ) open Setoid B using ( _≈_ ; refl ; sym ; trans ) -- renaming ( _≈_ to _≈₂_ ) - open SetoidAlgebra (kerquo hh) using () renaming ( Domain to A/hKer ) + open Algebra (kerquo hh) using () renaming ( Domain to A/hKer ) open IsHom private @@ -88,7 +88,7 @@ Now we prove that the homomorphism whose existence is guaranteed by `FirstHomThe -------------------------------------- -[← Homomorphisms.Func.Kernels](Homomorphisms.Func.Kernels.html) -[Homomorphisms.Func.Factor →](Homomorphisms.Func.Factor.html) +[← Homomorphisms.Setoid.Products](Homomorphisms.Setoid.Products.html) +[Homomorphisms.Setoid.Factor →](Homomorphisms.Setoid.Factor.html) {% include UALib.Links.md %} diff --git a/src/Homomorphisms/Func/Products.lagda b/src/Homomorphisms/Setoid/Products.lagda similarity index 65% rename from src/Homomorphisms/Func/Products.lagda rename to src/Homomorphisms/Setoid/Products.lagda index 42dc98fe..b3cc90cb 100644 --- a/src/Homomorphisms/Func/Products.lagda +++ b/src/Homomorphisms/Setoid/Products.lagda @@ -1,13 +1,13 @@ --- layout: default -title : "Homomorphisms.Func.Products module (The Agda Universal Algebra Library)" +title : "Homomorphisms.Setoid.Products module (The Agda Universal Algebra Library)" date : "2021-09-21" author: "agda-algebras development team" --- -#### Products of Homomorphisms of SetoidAlgebras +#### Products of Homomorphisms of Algebras -This is the [Homomorphisms.Func.Products] module of the [Agda Universal Algebra Library][]. +This is the [Homomorphisms.Setoid.Products] module of the [Agda Universal Algebra Library][]. \begin{code} @@ -15,21 +15,21 @@ This is the [Homomorphisms.Func.Products] module of the [Agda Universal Algebra open import Algebras.Basic using ( 𝓞 ; 𝓥 ; Signature ) -module Homomorphisms.Func.Products {𝑆 : Signature 𝓞 𝓥} where +module Homomorphisms.Setoid.Products {𝑆 : Signature 𝓞 𝓥} where -- Imports from Agda and the Agda Standard Library -------------------------- -open import Agda.Primitive using ( _⊔_ ; lsuc ) renaming ( Set to Type ) -open import Function.Bundles using () renaming ( Func to _⟶_ ) -open import Data.Product using ( _,_ ) -open import Level using ( Level ) -open import Relation.Binary using ( Setoid ) +open import Agda.Primitive using ( _⊔_ ; lsuc ) renaming ( Set to Type ) +open import Function.Bundles using () renaming ( Func to _⟶_ ) +open import Data.Product using ( _,_ ) +open import Level using ( Level ) +open import Relation.Binary using ( Setoid ) open import Relation.Binary.PropositionalEquality as ≡ using ( _≡_ ) -- Imports from the Agda Universal Algebras Library ---------------------- -open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥) -open import Algebras.Func.Basic {𝑆 = 𝑆} using ( SetoidAlgebra ) -open import Algebras.Func.Products {𝑆 = 𝑆} using ( ⨅ ) -open import Homomorphisms.Func.Basic {𝑆 = 𝑆} using ( hom ; IsHom ; epi ) +open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥) +open import Algebras.Setoid.Basic {𝑆 = 𝑆} using ( Algebra ) +open import Algebras.Setoid.Products {𝑆 = 𝑆} using ( ⨅ ) +open import Homomorphisms.Setoid.Basic {𝑆 = 𝑆} using ( hom ; IsHom ; epi ) private variable α ρᵃ β ρᵇ 𝓘 : Level @@ -42,14 +42,15 @@ If in addition we have a family `𝒽 : (i : I) → hom 𝑨 (ℬ i)` of homomor \begin{code} -module _ {I : Type 𝓘}{𝑨 : SetoidAlgebra α ρᵃ}(ℬ : I → SetoidAlgebra β ρᵇ) where - open SetoidAlgebra 𝑨 using () renaming ( Domain to A ) - open Setoid A using ( ) renaming ( refl to refl₁ ) - open SetoidAlgebra (⨅ ℬ) using () renaming ( Domain to ⨅B ) - open _⟶_ using ( cong ) renaming ( f to _⟨$⟩_ ) - open SetoidAlgebra using ( Domain ) - open Setoid using ( refl ) +module _ {I : Type 𝓘}{𝑨 : Algebra α ρᵃ}(ℬ : I → Algebra β ρᵇ) where + open Algebra 𝑨 using () renaming ( Domain to A ) + open Setoid A using () renaming ( refl to refl₁ ) + open Algebra (⨅ ℬ) using () renaming ( Domain to ⨅B ) + open _⟶_ using ( cong ) renaming ( f to _⟨$⟩_ ) + open Algebra using ( Domain ) + open Setoid using ( refl ) open IsHom + ⨅-hom-co : (∀(i : I) → hom 𝑨 (ℬ i)) → hom 𝑨 (⨅ ℬ) ⨅-hom-co 𝒽 = h , hhom where @@ -71,7 +72,7 @@ The foregoing generalizes easily to the case in which the domain is also a produ \begin{code} - -- ⨅-hom : (𝒜 : I → SetoidAlgebra α ρᵃ) → (∀ (i : I) → hom (𝒜 i) (ℬ i)) → hom (⨅ 𝒜)(⨅ ℬ) + -- ⨅-hom : (𝒜 : I → Algebra α ρᵃ) → (∀ (i : I) → hom (𝒜 i) (ℬ i)) → hom (⨅ 𝒜)(⨅ ℬ) -- ⨅-hom 𝒜 𝒽 = {!!} -- (λ x i → ∣ 𝒽 i ∣ (x i)) , (λ 𝑓 𝒶 → λ i → ∥ 𝒽 i ∥ 𝑓 (λ x → 𝒶 x i)) \end{code} @@ -92,7 +93,7 @@ We could prove a more general result involving projections onto multiple factors --------------------------------- -[← Homomorphisms.Kernels](Homomorphisms.Kernels.html) -[Homomorphisms.Noether →](Homomorphisms.Noether.html) +[← Homomorphisms.Setoid.Kernels](Homomorphisms.Setoid.Kernels.html) +[Homomorphisms.Setoid.Noether →](Homomorphisms.Setoid.Noether.html) {% include UALib.Links.md %} diff --git a/src/Homomorphisms/Func/Properties.lagda b/src/Homomorphisms/Setoid/Properties.lagda similarity index 80% rename from src/Homomorphisms/Func/Properties.lagda rename to src/Homomorphisms/Setoid/Properties.lagda index c7b80b18..d8b8d480 100644 --- a/src/Homomorphisms/Func/Properties.lagda +++ b/src/Homomorphisms/Setoid/Properties.lagda @@ -1,13 +1,13 @@ --- layout: default -title : "Homomorphisms.Func.Properties module (Agda Universal Algebra Library)" +title : "Homomorphisms.Setoid.Properties module (Agda Universal Algebra Library)" date : "2021-09-13" author: "agda-algebras development team" --- -#### Properties of Homomorphisms of SetoidAlgebras +#### Properties of Homomorphisms of Algebras -This is the [Homomorphisms.Func.Properties][] module of the [Agda Universal Algebra Library][]. +This is the [Homomorphisms.Setoid.Properties][] module of the [Agda Universal Algebra Library][]. \begin{code} @@ -15,7 +15,7 @@ This is the [Homomorphisms.Func.Properties][] module of the [Agda Universal Alge open import Algebras.Basic using (𝓞 ; 𝓥 ; Signature ) -module Homomorphisms.Func.Properties {𝑆 : Signature 𝓞 𝓥} where +module Homomorphisms.Setoid.Properties {𝑆 : Signature 𝓞 𝓥} where -- Imports from Agda and the Agda Standard Library ------------------------------------------ open import Agda.Primitive using () renaming ( lzero to ℓ₀ ) @@ -28,12 +28,12 @@ open import Relation.Binary.PropositionalEquality as ≡ using ( _≡_ ) -- Imports from the Agda Universal Algebra Library ------------------------------------------ open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) -open import Overture.Func.Preliminaries using ( _∘_ ; 𝑖𝑑 ) -open import Overture.Func.Inverses using ( Image_∋_ ; eq ) -open import Overture.Func.Surjective using ( ∘-IsSurjective ) -open import Algebras.Func.Basic {𝑆 = 𝑆} using ( SetoidAlgebra ; _̂_ ; Lift-Algˡ +open import Overture.Setoid.Preliminaries using ( _∘_ ; 𝑖𝑑 ) +open import Overture.Setoid.Inverses using ( Image_∋_ ; eq ) +open import Overture.Setoid.Surjective using ( ∘-IsSurjective ) +open import Algebras.Setoid.Basic {𝑆 = 𝑆} using ( Algebra ; _̂_ ; Lift-Algˡ ; Lift-Algʳ ; Lift-Alg ; 𝕌[_] ) -open import Homomorphisms.Func.Basic {𝑆 = 𝑆} using ( hom ; IsHom ; epi ; IsEpi ; compatible-map ) +open import Homomorphisms.Setoid.Basic {𝑆 = 𝑆} using ( hom ; IsHom ; epi ; IsEpi ; compatible-map ) open _⟶_ using ( cong ) renaming (f to _⟨$⟩_ ) private variable @@ -45,13 +45,13 @@ private variable \begin{code} -module _ {𝑨 : SetoidAlgebra α ρᵃ} - {𝑩 : SetoidAlgebra β ρᵇ} - {𝑪 : SetoidAlgebra γ ρᶜ} where +module _ {𝑨 : Algebra α ρᵃ} + {𝑩 : Algebra β ρᵇ} + {𝑪 : Algebra γ ρᶜ} where - open SetoidAlgebra 𝑨 using () renaming (Domain to A ) - open SetoidAlgebra 𝑩 using () renaming (Domain to B ) - open SetoidAlgebra 𝑪 using () renaming (Domain to C ) + open Algebra 𝑨 using () renaming (Domain to A ) + open Algebra 𝑩 using () renaming (Domain to B ) + open Algebra 𝑪 using () renaming (Domain to C ) open Setoid A using () renaming ( _≈_ to _≈₁_ ) open Setoid B using () renaming ( _≈_ to _≈₂_ ) open Setoid C using ( trans ) renaming ( _≈_ to _≈₃_ ) @@ -99,19 +99,19 @@ First we define the identity homomorphism for setoid algebras and then we prove \begin{code} -module _ {𝑨 : SetoidAlgebra α ρᵃ} where - open SetoidAlgebra 𝑨 using () renaming (Domain to A ) +module _ {𝑨 : Algebra α ρᵃ} where + open Algebra 𝑨 using () renaming (Domain to A ) open Setoid A using ( reflexive ) renaming ( _≈_ to _≈₁_ ; refl to refl₁ ) 𝒾𝒹 : hom 𝑨 𝑨 𝒾𝒹 = 𝑖𝑑 , record { compatible = reflexive ≡.refl } -module _ {𝑨 : SetoidAlgebra α ρᵃ}{ℓ : Level} where - open SetoidAlgebra 𝑨 using () renaming (Domain to A ) +module _ {𝑨 : Algebra α ρᵃ}{ℓ : Level} where + open Algebra 𝑨 using () renaming (Domain to A ) open Setoid A using ( reflexive ) renaming ( _≈_ to _≈₁_ ; refl to refl₁ ) - open SetoidAlgebra using ( Domain ) + open Algebra using ( Domain ) open Setoid (Domain (Lift-Algˡ 𝑨 ℓ)) using () renaming ( _≈_ to _≈ˡ_ ; refl to reflˡ) open Setoid (Domain (Lift-Algʳ 𝑨 ℓ)) using () renaming ( _≈_ to _≈ʳ_ ; refl to reflʳ) @@ -146,9 +146,9 @@ module _ {𝑨 : SetoidAlgebra α ρᵃ}{ℓ : Level} where FromToLiftʳ a = refl₁ -module _ {𝑨 : SetoidAlgebra α ρᵃ}{ℓ r : Level} where +module _ {𝑨 : Algebra α ρᵃ}{ℓ r : Level} where open Level - open SetoidAlgebra using ( Domain ) + open Algebra using ( Domain ) open Setoid (Domain 𝑨) using (refl) open Setoid (Domain (Lift-Alg 𝑨 ℓ r)) using ( _≈_ ) @@ -174,9 +174,9 @@ Next we formalize the fact that a homomorphism from `𝑨` to `𝑩` can be lift \begin{code} -module _ {𝑨 : SetoidAlgebra α ρᵃ} {𝑩 : SetoidAlgebra β ρᵇ} where +module _ {𝑨 : Algebra α ρᵃ} {𝑩 : Algebra β ρᵇ} where - open SetoidAlgebra using ( Domain ) + open Algebra using ( Domain ) open Setoid (Domain 𝑨) using ( reflexive ) renaming ( _≈_ to _≈₁_ ) open Setoid (Domain 𝑩) using () renaming ( _≈_ to _≈₂_ ) open Level @@ -184,7 +184,7 @@ module _ {𝑨 : SetoidAlgebra α ρᵃ} {𝑩 : SetoidAlgebra β ρᵇ} where Lift-homˡ : hom 𝑨 𝑩 → (ℓᵃ ℓᵇ : Level) → hom (Lift-Algˡ 𝑨 ℓᵃ) (Lift-Algˡ 𝑩 ℓᵇ) Lift-homˡ (f , fhom) ℓᵃ ℓᵇ = ϕ , ∘-is-hom lABh (snd ToLiftˡ) where - lA lB : SetoidAlgebra _ _ + lA lB : Algebra _ _ lA = Lift-Algˡ 𝑨 ℓᵃ lB = Lift-Algˡ 𝑩 ℓᵇ @@ -202,7 +202,7 @@ module _ {𝑨 : SetoidAlgebra α ρᵃ} {𝑩 : SetoidAlgebra β ρᵇ} where Lift-homʳ : hom 𝑨 𝑩 → (rᵃ rᵇ : Level) → hom (Lift-Algʳ 𝑨 rᵃ) (Lift-Algʳ 𝑩 rᵇ) Lift-homʳ (f , fhom) rᵃ rᵇ = ϕ , Goal where - lA lB : SetoidAlgebra _ _ + lA lB : Algebra _ _ lA = Lift-Algʳ 𝑨 rᵃ lB = Lift-Algʳ 𝑩 rᵇ ψ : Domain lA ⟶ Domain 𝑩 @@ -227,7 +227,7 @@ module _ {𝑨 : SetoidAlgebra α ρᵃ} {𝑩 : SetoidAlgebra β ρᵇ} where lift-hom-lemma h a ℓᵃ ℓᵇ = Setoid.refl (Domain 𝑩) -module _ {𝑨 : SetoidAlgebra α ρᵃ} {𝑩 : SetoidAlgebra β ρᵇ} where +module _ {𝑨 : Algebra α ρᵃ} {𝑩 : Algebra β ρᵇ} where Lift-hom : hom 𝑨 𝑩 → (ℓᵃ rᵃ ℓᵇ rᵇ : Level) → hom (Lift-Alg 𝑨 ℓᵃ rᵃ) (Lift-Alg 𝑩 ℓᵇ rᵇ) Lift-hom φ ℓᵃ rᵃ ℓᵇ rᵇ = Lift-homʳ (Lift-homˡ φ ℓᵃ ℓᵇ) rᵃ rᵇ @@ -244,7 +244,7 @@ module _ {𝑨 : SetoidAlgebra α ρᵃ} {𝑩 : SetoidAlgebra β ρᵇ} where -------------------------------- -[← Homomorphisms.Func.Basic](Homomorphisms.Func.Basic.html) -[Homomorphisms.Func.Kernels →](Homomorphisms.Func.Kernels.html) +[← Homomorphisms.Setoid.Basic](Homomorphisms.Setoid.Basic.html) +[Homomorphisms.Setoid.Kernels →](Homomorphisms.Setoid.Kernels.html) {% include UALib.Links.md %} diff --git a/src/Overture/Func.lagda b/src/Overture/Func.lagda deleted file mode 100644 index c01273cd..00000000 --- a/src/Overture/Func.lagda +++ /dev/null @@ -1,31 +0,0 @@ ---- -layout: default -title : "Overture.Func module (Agda Universal Algebra Library)" -date : "2021-09-08" -author: "the agda-algebras development team" ---- - -## Overture for Setoids - -This is the [Overture.Func][] module of the [Agda Universal Algebra Library][]. - -\begin{code} - -{-# OPTIONS --without-K --exact-split --safe #-} - -module Overture.Func where - -open import Overture.Func.Preliminaries -open import Overture.Func.Inverses -open import Overture.Func.Injective -open import Overture.Func.Surjective -open import Overture.Func.Bijective - -\end{code} - --------------------------------------- - -[← Preface](Overture.Preface.html) -[Overture.Func.Preliminaries →](Overture.Func.Preliminaries.html) - -{% include UALib.Links.md %} diff --git a/src/Overture/Setoid.lagda b/src/Overture/Setoid.lagda new file mode 100644 index 00000000..3bfd4da0 --- /dev/null +++ b/src/Overture/Setoid.lagda @@ -0,0 +1,31 @@ +--- +layout: default +title : "Overture.Setoid module (Agda Universal Algebra Library)" +date : "2021-09-08" +author: "the agda-algebras development team" +--- + +## Overture for Setoids + +This is the [Overture.Setoid][] module of the [Agda Universal Algebra Library][]. + +\begin{code} + +{-# OPTIONS --without-K --exact-split --safe #-} + +module Overture.Setoid where + +open import Overture.Setoid.Preliminaries +open import Overture.Setoid.Inverses +open import Overture.Setoid.Injective +open import Overture.Setoid.Surjective +open import Overture.Setoid.Bijective + +\end{code} + +-------------------------------------- + +[← Preface](Overture.Preface.html) +[Overture.Setoid.Preliminaries →](Overture.Setoid.Preliminaries.html) + +{% include UALib.Links.md %} diff --git a/src/Overture/Func/Bijective.lagda b/src/Overture/Setoid/Bijective.lagda similarity index 61% rename from src/Overture/Func/Bijective.lagda rename to src/Overture/Setoid/Bijective.lagda index 0d18011d..9d86db00 100644 --- a/src/Overture/Func/Bijective.lagda +++ b/src/Overture/Setoid/Bijective.lagda @@ -1,15 +1,15 @@ --- layout: default -title : "Overture.Func.Bijective module" +title : "Overture.Setoid.Bijective module" date : "2021-09-13" author: "the agda-algebras development team" --- ### Bijective functions on setoids -This is the [Overture.Func.Bijective][] module of the [agda-algebras][] library. +This is the [Overture.Setoid.Bijective][] module of the [agda-algebras][] library. -A *bijective function* from a setoid `𝑨 = (A, ≈₀)` to a setoid `𝑩 = (B, ≈₁)` is a function `f : 𝑨 ⟶ 𝑩` that is both injective and surjective. (See the definitions in the modules [Overture.Func.Injective][] and [Overture.Func.Surjective][]. +A *bijective function* from a setoid `𝑨 = (A, ≈₀)` to a setoid `𝑩 = (B, ≈₁)` is a function `f : 𝑨 ⟶ 𝑩` that is both injective and surjective. (See the definitions in the modules [Overture.Setoid.Injective][] and [Overture.Setoid.Surjective][]. \begin{code} @@ -17,22 +17,22 @@ A *bijective function* from a setoid `𝑨 = (A, ≈₀)` to a setoid `𝑩 = (B open import Relation.Binary using ( Setoid ) -module Overture.Func.Bijective {α ρᵃ β ρᵇ }{𝑨 : Setoid α ρᵃ}{𝑩 : Setoid β ρᵇ} where +module Overture.Setoid.Bijective {α ρᵃ β ρᵇ }{𝑨 : Setoid α ρᵃ}{𝑩 : Setoid β ρᵇ} where -- Imports from Agda and the Agda Standard Library -------------------------- -open import Agda.Primitive using ( _⊔_ ; Level ) renaming ( Set to Type ) +open import Agda.Primitive using ( _⊔_ ; Level ) renaming ( Set to Type ) open import Data.Product using ( _,_ ; _×_ ) -open import Function.Bundles using () renaming ( Func to _⟶_ ) +open import Function.Bundles using () renaming ( Func to _⟶_ ) -- Imports from agda-algebras ----------------------------------------------- -open import Overture.Func.Inverses using ( Image_∋_ ; Inv ) -open import Overture.Func.Surjective using ( IsSurjective ) -open import Overture.Func.Injective using ( IsInjective ) +open import Overture.Setoid.Inverses using ( Image_∋_ ; Inv ) +open import Overture.Setoid.Surjective using ( IsSurjective ) +open import Overture.Setoid.Injective using ( IsInjective ) open Image_∋_ -open Setoid 𝑨 using () renaming (Carrier to A; _≈_ to _≈₁_) -open Setoid 𝑩 using ( sym ; trans ) renaming (Carrier to B; _≈_ to _≈₂_) +open Setoid 𝑨 using () renaming (Carrier to A; _≈_ to _≈₁_) +open Setoid 𝑩 using ( sym ; trans ) renaming (Carrier to B; _≈_ to _≈₂_) IsBijective : (𝑨 ⟶ 𝑩) → Type (α ⊔ β ⊔ ρᵃ ⊔ ρᵇ) IsBijective f = IsInjective f × IsSurjective f @@ -55,7 +55,7 @@ BijInv f (fM , fE) = record { f = finv ; cong = c } ------------------------------------ -[← Overture.Func.Surjective](Overture.Func.Surjective.html) +[← Overture.Setoid.Surjective](Overture.Setoid.Surjective.html) [Relations →](Relations.html) {% include UALib.Links.md %} diff --git a/src/Overture/Func/Injective.lagda b/src/Overture/Setoid/Injective.lagda similarity index 75% rename from src/Overture/Func/Injective.lagda rename to src/Overture/Setoid/Injective.lagda index 4a5d24cb..2e7485b8 100644 --- a/src/Overture/Func/Injective.lagda +++ b/src/Overture/Setoid/Injective.lagda @@ -1,13 +1,13 @@ --- layout: default -title : "Overture.Func.Injective module" +title : "Overture.Setoid.Injective module" date : "2021-09-13" author: "the agda-algebras development team" --- ### Injective functions on setoids -This is the [Overture.Func.Injective][] module of the [agda-algebras][] library. +This is the [Overture.Setoid.Injective][] module of the [agda-algebras][] library. We say that a function `f : A → B` from one setoid (A , ≈₀) to another (B , ≈₁) is *injective* (or *monic*) provided the following implications hold: ∀ a₀ a₁ if f ⟨$⟩ a₀ ≈₁ f ⟨$⟩ a₁, then a₀ ≈₀ a₁. @@ -17,20 +17,20 @@ We say that a function `f : A → B` from one setoid (A , ≈₀) to another (B open import Relation.Binary using ( Setoid ) -module Overture.Func.Injective where +module Overture.Setoid.Injective where -- Imports from Agda and the Agda Standard Library ------------- -open import Agda.Primitive using ( _⊔_ ; Level ) renaming ( Set to Type ) -open import Function.Bundles using ( Injection ) renaming ( Func to _⟶_ ) -open import Function.Base using ( _∘_ ; id ) -open import Relation.Binary.Core using ( _Preserves_⟶_ ) -open import Relation.Binary using ( Rel ) +open import Agda.Primitive using ( _⊔_ ; Level ) renaming ( Set to Type ) +open import Function.Bundles using ( Injection ) renaming ( Func to _⟶_ ) +open import Function.Base using ( _∘_ ; id ) +open import Relation.Binary.Core using ( _Preserves_⟶_ ) +open import Relation.Binary using ( Rel ) import Function.Definitions as FD -- Imports from agda-algebras ----------------------------------------------- -open import Overture.Func.Preliminaries using ( 𝑖𝑑 ) renaming ( _∘_ to _⟨∘⟩_ ) -open import Overture.Func.Inverses using ( Image_∋_ ; Inv ) +open import Overture.Setoid.Preliminaries using ( 𝑖𝑑 ) renaming ( _∘_ to _⟨∘⟩_ ) +open import Overture.Setoid.Inverses using ( Image_∋_ ; Inv ) private variable α β γ ρᵃ ρᵇ ρᶜ ℓ₁ ℓ₂ ℓ₃ : Level @@ -48,10 +48,11 @@ setoids (called `IsInjective`). module _ {𝑨 : Setoid α ρᵃ}{𝑩 : Setoid β ρᵇ} where - open Injection {From = 𝑨}{To = 𝑩} using ( function ; injective ) renaming (f to _⟨$⟩_) - open Setoid 𝑨 using () renaming (Carrier to A; _≈_ to _≈₁_) - open Setoid 𝑩 using ( trans ; sym ) renaming (Carrier to B; _≈_ to _≈₂_) - open _⟶_ {a = α}{ρᵃ}{β}{ρᵇ}{From = 𝑨}{To = 𝑩} renaming (f to _⟨$⟩_ ) + open Setoid 𝑨 using () renaming (Carrier to A; _≈_ to _≈₁_) + open Setoid 𝑩 using ( trans ; sym ) renaming (Carrier to B; _≈_ to _≈₂_) + + open Injection {From = 𝑨}{To = 𝑩} using ( function ; injective ) renaming (f to _⟨$⟩_) + open _⟶_ {a = α}{ρᵃ}{β}{ρᵇ}{From = 𝑨}{To = 𝑩} renaming (f to _⟨$⟩_ ) open FD _≈₁_ _≈₂_ IsInjective : (𝑨 ⟶ 𝑩) → Type (α ⊔ ρᵃ ⊔ ρᵇ) @@ -102,10 +103,10 @@ lines which give each instance of injectivity a different name. \begin{code} module _ {𝑨 : Setoid α ρᵃ}{𝑩 : Setoid β ρᵇ} {𝑪 : Setoid γ ρᶜ} where - open Injection using () renaming ( function to fun ) - open Setoid 𝑨 using () renaming ( Carrier to A ; _≈_ to _≈₁_ ) - open Setoid 𝑩 using () renaming ( Carrier to B ) - open Setoid 𝑪 using () renaming ( Carrier to C ; _≈_ to _≈₃_) + open Setoid 𝑨 using () renaming ( Carrier to A ; _≈_ to _≈₁_ ) + open Setoid 𝑩 using () renaming ( Carrier to B ) + open Setoid 𝑪 using () renaming ( Carrier to C ; _≈_ to _≈₃_) + open Injection using () renaming ( function to fun ) ∘-injective : (f : 𝑨 ⟶ 𝑩)(g : 𝑩 ⟶ 𝑪) → IsInjective f → IsInjective g → IsInjective (g ⟨∘⟩ f) @@ -133,8 +134,8 @@ id-is-injective = id -------------------------------------- -[← Overture.Func.Inverses](Overture.Func.Inverses.html) -[Overture.Func.Surjective →](Overture.Func.Surjective.html) +[← Overture.Setoid.Inverses](Overture.Setoid.Inverses.html) +[Overture.Setoid.Surjective →](Overture.Setoid.Surjective.html) {% include UALib.Links.md %} diff --git a/src/Overture/Func/Inverses.lagda b/src/Overture/Setoid/Inverses.lagda similarity index 94% rename from src/Overture/Func/Inverses.lagda rename to src/Overture/Setoid/Inverses.lagda index d71b762f..d8dd9d80 100644 --- a/src/Overture/Func/Inverses.lagda +++ b/src/Overture/Setoid/Inverses.lagda @@ -1,13 +1,13 @@ --- layout: default -title : "Overture.Func.Inverses module" +title : "Overture.Setoid.Inverses module" date : "2021-09-13" author: "the agda-algebras development team" --- ### Inverses for functions with structure -This is the [Overture.Func.Inverses][] module of the [agda-algebras][] library. +This is the [Overture.Setoid.Inverses][] module of the [agda-algebras][] library. \begin{code} @@ -15,7 +15,7 @@ This is the [Overture.Func.Inverses][] module of the [agda-algebras][] library. open import Relation.Binary using ( Setoid ) -module Overture.Func.Inverses where +module Overture.Setoid.Inverses where -- {α ρᵃ β ρᵇ}{𝑨 : Setoid α ρᵃ}{𝑩 : Setoid β ρᵇ} -- Imports from Agda and the Agda Standard Library -------------------- @@ -170,8 +170,8 @@ In a certain sense, `Inv f` is also a (range-restricted) *left-inverse*. -------------------------------------- -[← Overture.Func.Preliminaries](Overture.Func.Preliminaries.html) -[Overture.Func.Injective →](Overture.Func.Injective.html) +[← Overture.Setoid.Preliminaries](Overture.Setoid.Preliminaries.html) +[Overture.Setoid.Injective →](Overture.Setoid.Injective.html) {% include UALib.Links.md %} diff --git a/src/Overture/Func/Preliminaries.lagda b/src/Overture/Setoid/Preliminaries.lagda similarity index 71% rename from src/Overture/Func/Preliminaries.lagda rename to src/Overture/Setoid/Preliminaries.lagda index 45715ce3..70d67ce9 100644 --- a/src/Overture/Func/Preliminaries.lagda +++ b/src/Overture/Setoid/Preliminaries.lagda @@ -1,28 +1,29 @@ --- layout: default -title : "Overture.Func.Preliminaries module" +title : "Overture.Setoid.Preliminaries module" date : "2021-09-13" author: "the agda-algebras development team" --- ### Preliminaries for setoids -This is the [Overture.Func.Preliminaries][] module of the [agda-algebras][] library. +This is the [Overture.Setoid.Preliminaries][] module of the [agda-algebras][] library. \begin{code} {-# OPTIONS --without-K --exact-split --safe #-} -module Overture.Func.Preliminaries where +module Overture.Setoid.Preliminaries where -- Imports from Agda and the Agda Standard Library ----------------------- -open import Agda.Primitive using ( _⊔_ ) renaming ( Set to Type ) -open import Function using ( id ) -open import Function.Bundles using () renaming ( Func to _⟶_ ) -import Function.Base as Fun -open import Relation.Binary using ( Setoid ) +open import Agda.Primitive using ( _⊔_ ) renaming ( Set to Type ) +open import Function using ( id ) +open import Function.Bundles using () renaming ( Func to _⟶_ ) +open import Relation.Binary using ( Setoid ) open import Level + +import Function.Base as Fun private variable α ρᵃ β ρᵇ γ ρᶜ : Level @@ -63,17 +64,15 @@ module _ {𝑨 : Setoid α ρᵃ} where open Setoid 𝑩 using ( sym ) renaming (Carrier to B; _≈_ to _≈₂_) -- This is sometimes known as `cong` (see e.g. `Function.Equality` in the agda-stdlib) - preserves≈ : (A → B) → Type (α ⊔ ρᵃ ⊔ ρᵇ) - preserves≈ f = ∀ {x y} → x ≈ₐ y → (f x) ≈₂ (f y) + -- preserves≈ : (A → B) → Type (α ⊔ ρᵃ ⊔ ρᵇ) + -- preserves≈ f = ∀ {x y} → x ≈ₐ y → (f x) ≈₂ (f y) \end{code} - -------------------------------------- -[↑ Overture.Func](Overture.Func.html) -[Overture.Func.Inverses →](Overture.Func.Inverses.html) +[↑ Overture.Setoid](Overture.Setoid.html) +[Overture.Setoid.Inverses →](Overture.Setoid.Inverses.html) {% include UALib.Links.md %} - diff --git a/src/Overture/Func/Surjective.lagda b/src/Overture/Setoid/Surjective.lagda similarity index 72% rename from src/Overture/Func/Surjective.lagda rename to src/Overture/Setoid/Surjective.lagda index cb5e08cd..cb68b25f 100644 --- a/src/Overture/Func/Surjective.lagda +++ b/src/Overture/Setoid/Surjective.lagda @@ -1,13 +1,13 @@ --- layout: default -title : "Overture.Func.Surjective module" +title : "Overture.Setoid.Surjective module" date : "2021-09-13" author: "the agda-algebras development team" --- ### Surjective functions on setoids -This is the [Overture.Func.Surjective][] module of the [agda-algebras][] library. +This is the [Overture.Setoid.Surjective][] module of the [agda-algebras][] library. A *surjective function* from a setoid `𝑨 = (A, ≈₀)` to a setoid `𝑩 = (B, ≈₁)` is a function `f : 𝑨 ⟶ 𝑩` such that for all `b : B` there exists `a : A` such that `(f ⟨$⟩ a) ≈₁ b`. In other words, the range and codomain of `f` agree. @@ -15,23 +15,23 @@ A *surjective function* from a setoid `𝑨 = (A, ≈₀)` to a setoid `𝑩 = ( {-# OPTIONS --without-K --exact-split --safe #-} -module Overture.Func.Surjective where +module Overture.Setoid.Surjective where -- Imports from Agda and the Agda Standard Library -------------------------- -open import Agda.Primitive using ( _⊔_ ; Level ) renaming ( Set to Type ) -open import Data.Product using ( _,_ ; Σ-syntax ) -open import Function.Bundles using ( Surjection ) renaming ( Func to _⟶_ ) -open import Function using ( IsSurjection ) -open import Relation.Binary using ( Setoid ) +open import Agda.Primitive using ( _⊔_ ; Level ) renaming ( Set to Type ) +open import Data.Product using ( _,_ ; Σ-syntax ) +open import Function.Bundles using ( Surjection ) renaming ( Func to _⟶_ ) +open import Function using ( IsSurjection ) +open import Relation.Binary using ( Setoid ) -open import Function.Construct.Composition using () renaming ( isSurjection to isOnto ) +open import Function.Construct.Composition using () renaming ( isSurjection to isOnto ) import Function.Definitions as FD -- Imports from agda-algebras ----------------------------------------------- -open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ; ∃-syntax ; transport ) -open import Overture.Func.Preliminaries using ( _∘_ ) -open import Overture.Func.Inverses using ( Img_∋_ ; Image_∋_ ; Inv ; InvIsInverseʳ ) +open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ; ∃-syntax ; transport ) +open import Overture.Setoid.Preliminaries using ( _∘_ ) +open import Overture.Setoid.Inverses using ( Img_∋_ ; Image_∋_ ; Inv ; InvIsInverseʳ ) private variable @@ -41,10 +41,11 @@ open Image_∋_ module _ {𝑨 : Setoid α ρᵃ}{𝑩 : Setoid β ρᵇ} where - open Surjection {a = α}{ρᵃ}{β}{ρᵇ}{From = 𝑨}{To = 𝑩} renaming (f to _⟨$⟩_) - open Setoid 𝑨 using () renaming (Carrier to A; _≈_ to _≈₁_; isEquivalence to isEqA ) - open Setoid 𝑩 using ( trans ; sym ) renaming (Carrier to B; _≈_ to _≈₂_; isEquivalence to isEqB ) - open _⟶_ {a = α}{ρᵃ}{β}{ρᵇ}{From = 𝑨}{To = 𝑩} renaming (f to _⟨$⟩_ ) + open Setoid 𝑨 using () renaming (Carrier to A; _≈_ to _≈₁_; isEquivalence to isEqA ) + open Setoid 𝑩 using ( trans ; sym ) renaming (Carrier to B; _≈_ to _≈₂_; isEquivalence to isEqB ) + + open Surjection {a = α}{ρᵃ}{β}{ρᵇ}{From = 𝑨}{To = 𝑩} renaming (f to _⟨$⟩_) + open _⟶_ {a = α}{ρᵃ}{β}{ρᵇ}{From = 𝑨}{To = 𝑩} renaming (f to _⟨$⟩_ ) open FD _≈₁_ _≈₂_ isSurj : (A → B) → Type (α ⊔ β ⊔ ρᵇ) @@ -104,11 +105,12 @@ Next, we prove composition laws for epics. module _ {𝑨 : Setoid α ρᵃ}{𝑩 : Setoid β ρᵇ}{𝑪 : Setoid γ ρᶜ} where - open Surjection renaming (f to _⟨$⟩_) - open Setoid 𝑨 using () renaming (Carrier to A; _≈_ to _≈₁_) - open Setoid 𝑩 using ( trans ; sym ) renaming (Carrier to B; _≈_ to _≈₂_) - open Setoid 𝑪 using () renaming (Carrier to C; _≈_ to _≈₃_) - open _⟶_ renaming (f to _⟨$⟩_ ) + open Setoid 𝑨 using () renaming (Carrier to A; _≈_ to _≈₁_) + open Setoid 𝑩 using ( trans ; sym ) renaming (Carrier to B; _≈_ to _≈₂_) + open Setoid 𝑪 using () renaming (Carrier to C; _≈_ to _≈₃_) + + open Surjection renaming (f to _⟨$⟩_) + open _⟶_ renaming (f to _⟨$⟩_ ) open FD _≈₁_ _≈₂_ @@ -160,8 +162,8 @@ module _ {𝑨 : Setoid α ρᵃ}{𝑩 : Setoid β ρᵇ}{𝑪 : Setoid γ ρᶜ -------------------------------------- -[← Overture.Func.Injective](Overture.Func.Injective.html) -[Overture.Func.Bijective →](Overture.Func.Bijective.html) +[← Overture.Setoid.Injective](Overture.Setoid.Injective.html) +[Overture.Setoid.Bijective →](Overture.Setoid.Bijective.html) {% include UALib.Links.md %} diff --git a/src/Relations/Func.lagda b/src/Relations/Func.lagda deleted file mode 100644 index 1ae786d1..00000000 --- a/src/Relations/Func.lagda +++ /dev/null @@ -1,28 +0,0 @@ ---- -layout: default -title : "Relations.Func module (The Agda Universal Algebra Library)" -date : "2021-09-17" -author: "the agda-algebras development team" ---- - -## Relations on setoids - -This is the [Relations.Func][] module of the [Agda Universal Algebra Library][]. - -\begin{code} - -{-# OPTIONS --without-K --exact-split --safe #-} - -module Relations.Func where - -open import Relations.Func.Discrete public -open import Relations.Func.Quotients public - -\end{code} - -------------------------------------- - -[← Relations.Quotients](Relations.Quotients.html) -[Relations.Func.Discrete →](Relations.Func.Discrete.html) - -{% include UALib.Links.md %} diff --git a/src/Relations/Setoid.lagda b/src/Relations/Setoid.lagda new file mode 100644 index 00000000..1c2648dc --- /dev/null +++ b/src/Relations/Setoid.lagda @@ -0,0 +1,28 @@ +--- +layout: default +title : "Relations.Setoid module (The Agda Universal Algebra Library)" +date : "2021-09-17" +author: "the agda-algebras development team" +--- + +## Relations on setoids + +This is the [Relations.Setoid][] module of the [Agda Universal Algebra Library][]. + +\begin{code} + +{-# OPTIONS --without-K --exact-split --safe #-} + +module Relations.Setoid where + +open import Relations.Setoid.Discrete public +open import Relations.Setoid.Quotients public + +\end{code} + +------------------------------------- + +[← Relations.Quotients](Relations.Quotients.html) +[Relations.Setoid.Discrete →](Relations.Setoid.Discrete.html) + +{% include UALib.Links.md %} diff --git a/src/Relations/Func/Discrete.lagda b/src/Relations/Setoid/Discrete.lagda similarity index 88% rename from src/Relations/Func/Discrete.lagda rename to src/Relations/Setoid/Discrete.lagda index f62956fa..300cdca2 100644 --- a/src/Relations/Func/Discrete.lagda +++ b/src/Relations/Setoid/Discrete.lagda @@ -1,19 +1,19 @@ --- layout: default -title : "Relations.Func.Discrete module (The Agda Universal Algebra Library)" +title : "Relations.Setoid.Discrete module (The Agda Universal Algebra Library)" date : "2021-09-16" author: "the agda-algebras development team" --- ### Discrete Relations on Setoids -This is the [Relations.Func.Discrete][] module of the [Agda Universal Algebra Library][]. +This is the [Relations.Setoid.Discrete][] module of the [Agda Universal Algebra Library][]. \begin{code} {-# OPTIONS --without-K --exact-split --safe #-} -module Relations.Func.Discrete where +module Relations.Setoid.Discrete where -- Imports from Agda and the Agda Standard Library ---------------------------------------------- open import Agda.Primitive using ( _⊔_ ; lsuc ) renaming ( Set to Type ) @@ -87,7 +87,7 @@ informally by `{(x , y) ∈ A × A : f ⟨$⟩ x ≈₂ f ⟨$⟩ y}`. -------------------------------------- -[↑ Relations.Func](Relations.Func.html) -[Relations.Func.Quotients →](Relations.Func.Quotients.html) +[↑ Relations.Setoid](Relations.Setoid.html) +[Relations.Setoid.Quotients →](Relations.Setoid.Quotients.html) {% include UALib.Links.md %} diff --git a/src/Relations/Func/Quotients.lagda b/src/Relations/Setoid/Quotients.lagda similarity index 89% rename from src/Relations/Func/Quotients.lagda rename to src/Relations/Setoid/Quotients.lagda index 1c4fdadd..645511e7 100644 --- a/src/Relations/Func/Quotients.lagda +++ b/src/Relations/Setoid/Quotients.lagda @@ -1,19 +1,19 @@ --- layout: default -title : "Relations.Func.Quotients module (The Agda Universal Algebra Library)" +title : "Relations.Setoid.Quotients module (The Agda Universal Algebra Library)" date : "2021-09-16" author: "the agda-algebras development team" --- ### Quotients of setoids -This is the [Relations.Func.Quotients][] module of the [Agda Universal Algebra Library][]. +This is the [Relations.Setoid.Quotients][] module of the [Agda Universal Algebra Library][]. \begin{code} {-# OPTIONS --without-K --exact-split --safe #-} -module Relations.Func.Quotients where +module Relations.Setoid.Quotients where -- Imports from Agda and the Agda Standard Library ------------------------------- open import Agda.Primitive using ( _⊔_ ; Level ; lsuc ) renaming ( Set to Type ) @@ -27,7 +27,7 @@ open import Relation.Binary.PropositionalEquality as ≡ using ( _≡_ ) -- Imports from agda-algebras ----------------------------------------------------- open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) -open import Relations.Func.Discrete using ( fker ) +open import Relations.Setoid.Discrete using ( fker ) open import Relations.Quotients using ( [_] ; Equivalence ) private variable @@ -103,7 +103,7 @@ module _ {A : Type α}{R : Equivalence A{ℓ} } where ------------------------------------- -[← Relations.Func.Discrete](Relations.Func.Discrete.html) +[← Relations.Setoid.Discrete](Relations.Setoid.Discrete.html) [Equality →](Equality.html) {% include UALib.Links.md %} diff --git a/src/Subalgebras/Func.lagda b/src/Subalgebras/Func.lagda deleted file mode 100644 index 03fe41c0..00000000 --- a/src/Subalgebras/Func.lagda +++ /dev/null @@ -1,29 +0,0 @@ ---- -layout: default -title : "Subalgebras.Func module (The Agda Universal Algebra Library)" -date : "2021-07-26" -author: "agda-algebras development team" ---- - -### Subalgebras over setoids - -This is the [Subalgebras.Func][] module of the [Agda Universal Algebra Library][]. - -\begin{code} - -{-# OPTIONS --without-K --exact-split --safe #-} - -module Subalgebras.Func where - -open import Subalgebras.Func.Subuniverses -open import Subalgebras.Func.Subalgebras -open import Subalgebras.Func.Properties - -\end{code} - ---------------------------------- - -[← Subalgebras.Properties](Subalgebras.Properties.html) -[Subalgebras.Func.Subuniverses →](Subalgebras.Func.Subuniverses.html) - -{% include UALib.Links.md %} diff --git a/src/Subalgebras/Func/Subalgebras.lagda b/src/Subalgebras/Func/Subalgebras.lagda deleted file mode 100644 index fde2ed7f..00000000 --- a/src/Subalgebras/Func/Subalgebras.lagda +++ /dev/null @@ -1,134 +0,0 @@ ---- -layout: default -title : "Subalgebras.Func.Subalgebras module (The Agda Universal Algebra Library)" -date : "2021-07-17" -author: "agda-algebras development team" ---- - -#### Subalgebras of setoid algebras - -This is the [Subalgebras.Func.Subalgebras][] module of the [Agda Universal Algebra Library][]. - -\begin{code} - -{-# OPTIONS --without-K --exact-split --safe #-} - -open import Algebras.Basic using ( 𝓞 ; 𝓥 ; Signature ) - -module Subalgebras.Func.Subalgebras {𝑆 : Signature 𝓞 𝓥} where - --- imports from Agda and the Agda Standard Library ------------------------------------------ -open import Agda.Primitive using ( Level ; _⊔_ ) renaming ( Set to Type ) -open import Data.Product using ( _,_ ; Σ-syntax ) renaming ( _×_ to _∧_ ; proj₂ to snd ) -open import Relation.Binary using ( REL ) -open import Relation.Unary using ( Pred ; _∈_ ) - --- Imports from the Agda Universal Algebra Library ------------------------------------------ -open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) -open import Overture.Func.Injective using ( IsInjective ) -open import Algebras.Func.Basic {𝑆 = 𝑆} using ( SetoidAlgebra ; ov ) -open import Homomorphisms.Func.Basic {𝑆 = 𝑆} using ( hom ; mon ; mon→intohom ) -open import Homomorphisms.Func.Kernels {𝑆 = 𝑆} using ( kerquo ) -open import Homomorphisms.Func.Noether {𝑆 = 𝑆} using ( FirstHomTheorem ) -private variable - α ρᵃ β ρᵇ ℓ : Level - -_≥_ -- (alias for supalgebra (aka overalgebra)) - _IsSupalgebraOf_ : SetoidAlgebra α ρᵃ → SetoidAlgebra β ρᵇ → Type _ -𝑨 IsSupalgebraOf 𝑩 = Σ[ h ∈ hom 𝑩 𝑨 ] IsInjective ∣ h ∣ - -_≤_ -- (alias for subalgebra relation)) - _IsSubalgebraOf_ : SetoidAlgebra α ρᵃ → SetoidAlgebra β ρᵇ → Type (𝓞 ⊔ 𝓥 ⊔ α ⊔ ρᵃ ⊔ β ⊔ ρᵇ) -𝑨 IsSubalgebraOf 𝑩 = Σ[ h ∈ hom 𝑨 𝑩 ] IsInjective ∣ h ∣ - --- Syntactic sugar for sup/sub-algebra relations. -𝑨 ≥ 𝑩 = 𝑨 IsSupalgebraOf 𝑩 -𝑨 ≤ 𝑩 = 𝑨 IsSubalgebraOf 𝑩 - -mon→≤ : {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} → mon 𝑨 𝑩 → 𝑨 ≤ 𝑩 -mon→≤ {𝑨 = 𝑨}{𝑩} x = mon→intohom 𝑨 𝑩 x - -record SubalgebraOf : Type (ov (α ⊔ β ⊔ ρᵃ ⊔ ρᵇ)) where - field - algebra : SetoidAlgebra α ρᵃ - subalgebra : SetoidAlgebra β ρᵇ - issubalgebra : subalgebra ≤ algebra - - -Subalgebra : SetoidAlgebra α ρᵃ → {β ρᵇ : Level} → Type _ -Subalgebra 𝑨 {β}{ρᵇ} = Σ[ 𝑩 ∈ (SetoidAlgebra β ρᵇ) ] 𝑩 ≤ 𝑨 - -{- usage note: for 𝑨 : SetoidAlgebra α ρᵃ, inhabitant of `Subalgebra 𝑨` is a pair - `(𝑩 , p) : Subalgebra 𝑨` providing - - `𝑩 : SetoidAlgebra β ρᵇ` and - - `p : 𝑩 ≤ 𝑨`, a proof that 𝑩 is a subalgebra of 𝐴. -} - - -IsSubalgebraREL : {α ρᵃ β ρᵇ : Level} → REL (SetoidAlgebra α ρᵃ)(SetoidAlgebra β ρᵇ) ℓ → Type _ -IsSubalgebraREL {α}{ρᵃ}{β}{ρᵇ} R = ∀ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} → 𝑨 ≤ 𝑩 - -record SubalgebraREL(R : REL (SetoidAlgebra β ρᵇ)(SetoidAlgebra α ρᵃ) ℓ) : Type (ov (α ⊔ β ⊔ ρᵇ ⊔ ℓ)) - where - field isSubalgebraREL : IsSubalgebraREL R - - -\end{code} - -From now on we will use `𝑩 ≤ 𝑨` to express the assertion that `𝑩` is a subalgebra of `𝑨`. - - -#### Subalgebras of classes of setoid algebras - -Suppose `𝒦 : Pred (Algebra α 𝑆) γ` denotes a class of `𝑆`-algebras and `𝑩 : SetoidAlgebra β ρᵇ` denotes an arbitrary `𝑆`-algebra. Then we might wish to consider the assertion that `𝑩` is a subalgebra of an algebra in the class `𝒦`. The next type we define allows us to express this assertion as `𝑩 IsSubalgebraOfClass 𝒦`. - -\begin{code} - -_≤c_ - _IsSubalgebraOfClass_ : SetoidAlgebra β ρᵇ → Pred (SetoidAlgebra α ρᵃ) ℓ → Type _ -𝑩 IsSubalgebraOfClass 𝒦 = Σ[ 𝑨 ∈ SetoidAlgebra _ _ ] ((𝑨 ∈ 𝒦) ∧ (𝑩 ≤ 𝑨)) - -𝑩 ≤c 𝒦 = 𝑩 IsSubalgebraOfClass 𝒦 - -record SubalgebraOfClass : Type (ov (α ⊔ β ⊔ ρᵃ ⊔ ρᵇ ⊔ ℓ)) - where - field - class : Pred (SetoidAlgebra α ρᵃ) ℓ - subalgebra : SetoidAlgebra β ρᵇ - issubalgebraofclass : subalgebra ≤c class - - -record SubalgebraOfClass' : Type (ov (α ⊔ β ⊔ ρᵃ ⊔ ρᵇ ⊔ ℓ)) - where - field - class : Pred (SetoidAlgebra α ρᵃ) ℓ - classalgebra : SetoidAlgebra α ρᵃ - isclassalgebra : classalgebra ∈ class - subalgebra : SetoidAlgebra β ρᵇ - issubalgebra : subalgebra ≤ classalgebra - --- The collection of subalgebras of algebras in class 𝒦. -SubalgebrasOfClass : Pred (SetoidAlgebra α ρᵃ) ℓ → {β ρᵇ : Level} → Type _ -SubalgebrasOfClass 𝒦 {β}{ρᵇ} = Σ[ 𝑩 ∈ SetoidAlgebra β ρᵇ ] 𝑩 ≤c 𝒦 - -\end{code} - - - -#### Consequences of First Homomorphism Theorem - -As an example use-case of the `IsSubalgebraOf` type defined above, we prove the following easy but useful corollary of the First Homomorphism Theorem (proved in the [Homomorphisms.Func.Noether][] module): If `𝑨` and `𝑩` are `𝑆`-algebras and `h : hom 𝑨 𝑩` a homomorphism from `𝑨` to `𝑩`, then the quotient `𝑨 ╱ ker h` is (isomorphic to) a subalgebra of `𝑩`. - -\begin{code} - -FirstHomCorollary : {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} - (hh : hom 𝑨 𝑩) → (kerquo hh) IsSubalgebraOf 𝑩 -FirstHomCorollary hh = ∣ FirstHomTheorem hh ∣ , snd ∥ FirstHomTheorem hh ∥ - -\end{code} - ---------------------------------- - -[← Subalgebras.Func.Subuniverses](Subalgebras.Func.Subuniverses.html) -[Subalgebras.Func.Properties →](Subalgebras.Func.Properties.html) - -{% include UALib.Links.md %} diff --git a/src/Subalgebras/Properties.lagda b/src/Subalgebras/Properties.lagda index 74455a87..0da47612 100644 --- a/src/Subalgebras/Properties.lagda +++ b/src/Subalgebras/Properties.lagda @@ -175,6 +175,6 @@ Lift-≤-Lift ℓᵃ {𝑩} ℓᵇ a[← Subalgebras.Subalgebras](Subalgebras.Subalgebras.html) -[Subalgebras.Func →](Subalgebras.Func.html) +[Subalgebras.Setoid →](Subalgebras.Setoid.html) {% include UALib.Links.md %} diff --git a/src/Subalgebras/Setoid.lagda b/src/Subalgebras/Setoid.lagda new file mode 100644 index 00000000..075ddacf --- /dev/null +++ b/src/Subalgebras/Setoid.lagda @@ -0,0 +1,29 @@ +--- +layout: default +title : "Subalgebras.Setoid module (The Agda Universal Algebra Library)" +date : "2021-07-26" +author: "agda-algebras development team" +--- + +### Subalgebras over setoids + +This is the [Subalgebras.Setoid][] module of the [Agda Universal Algebra Library][]. + +\begin{code} + +{-# OPTIONS --without-K --exact-split --safe #-} + +module Subalgebras.Setoid where + +open import Subalgebras.Setoid.Subuniverses +open import Subalgebras.Setoid.Subalgebras +open import Subalgebras.Setoid.Properties + +\end{code} + +--------------------------------- + +[← Subalgebras.Properties](Subalgebras.Properties.html) +[Subalgebras.Setoid.Subuniverses →](Subalgebras.Setoid.Subuniverses.html) + +{% include UALib.Links.md %} diff --git a/src/Subalgebras/Func/Properties.lagda b/src/Subalgebras/Setoid/Properties.lagda similarity index 68% rename from src/Subalgebras/Func/Properties.lagda rename to src/Subalgebras/Setoid/Properties.lagda index 8b9bfd54..f76a880b 100644 --- a/src/Subalgebras/Func/Properties.lagda +++ b/src/Subalgebras/Setoid/Properties.lagda @@ -1,13 +1,13 @@ --- layout: default -title : "Subalgebras.Func.Properties module (The Agda Universal Algebra Library)" +title : "Subalgebras.Setoid.Properties module (The Agda Universal Algebra Library)" date : "2021-07-18" author: "agda-algebras development team" --- #### Properties of the subalgebra relation for setoid algebras -This is the [Subalgebras.Func.Properties][] module of the [Agda Universal Algebra Library][]. +This is the [Subalgebras.Setoid.Properties][] module of the [Agda Universal Algebra Library][]. \begin{code} @@ -16,7 +16,7 @@ This is the [Subalgebras.Func.Properties][] module of the [Agda Universal Algebr open import Algebras.Basic using ( 𝓞 ; 𝓥 ; Signature ) -module Subalgebras.Func.Properties {𝑆 : Signature 𝓞 𝓥} where +module Subalgebras.Setoid.Properties {𝑆 : Signature 𝓞 𝓥} where -- Imports from Agda and the Agda Standard Library ------------------------------------ open import Agda.Primitive using ( _⊔_ ; lsuc ; Level ) renaming ( Set to Type ) @@ -27,15 +27,18 @@ open import Relation.Unary using ( Pred ; _⊆_ ) import Relation.Binary.Reasoning.Setoid as SetoidReasoning -- Imports from the Agda Universal Algebra Library --------------------------------------------------- -open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) -open import Overture.Func.Injective using ( id-is-injective ; module compose ; IsInjective ; ∘-injective ) -open import Algebras.Func.Basic {𝑆 = 𝑆} using ( SetoidAlgebra ; Lift-Algˡ ; Lift-Algʳ ; Lift-Alg ; ov ) -open import Algebras.Func.Products {𝑆 = 𝑆} using ( ⨅ ) -open import Homomorphisms.Func.Basic {𝑆 = 𝑆} using ( hom ; IsHom ) -open import Homomorphisms.Func.Properties {𝑆 = 𝑆} using ( 𝒾𝒹 ; ∘-hom ) -open import Homomorphisms.Func.Isomorphisms {𝑆 = 𝑆} using ( _≅_ ; ≅toInjective ; ≅fromInjective ; mkiso - ; ≅-sym ; ≅-refl ; ≅-trans ; Lift-≅ˡ ; Lift-≅ ; Lift-≅ʳ) -open import Subalgebras.Func.Subalgebras {𝑆 = 𝑆} using ( _≤_ ; _≥_ ; _IsSubalgebraOfClass_ ; _≤c_ ) +open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) +open import Overture.Setoid.Injective using ( id-is-injective ; module compose ) + using ( IsInjective ; ∘-injective ) +open import Algebras.Setoid.Basic {𝑆 = 𝑆} using ( Algebra ; Lift-Algˡ ) + using ( Lift-Algʳ ; Lift-Alg ; ov ) +open import Algebras.Setoid.Products {𝑆 = 𝑆} using ( ⨅ ) +open import Homomorphisms.Setoid.Basic {𝑆 = 𝑆} using ( hom ; IsHom ) +open import Homomorphisms.Setoid.Properties {𝑆 = 𝑆} using ( 𝒾𝒹 ; ∘-hom ) +open import Homomorphisms.Setoid.Isomorphisms {𝑆 = 𝑆} using ( _≅_ ; ≅toInjective ; ≅fromInjective ) + using ( mkiso ; ≅-sym ; ≅-refl ; ≅-trans ) + using ( Lift-≅ˡ ; Lift-≅ ; Lift-≅ʳ) +open import Subalgebras.Setoid.Subalgebras {𝑆 = 𝑆} using ( _≤_ ; _≥_ ; _IsSubalgebraOfClass_ ; _≤c_ ) private variable α ρᵃ β ρᵇ γ ρᶜ ι : Level @@ -48,23 +51,23 @@ The subalgebra relation is a *preorder*, i.e., a reflexive, transitive binary re open _≅_ -≅→≤ : {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} → 𝑨 ≅ 𝑩 → 𝑨 ≤ 𝑩 +≅→≤ : {𝑨 : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ} → 𝑨 ≅ 𝑩 → 𝑨 ≤ 𝑩 ≅→≤ φ = (to φ) , ≅toInjective φ -≅→≥ : {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} → 𝑨 ≅ 𝑩 → 𝑨 ≥ 𝑩 +≅→≥ : {𝑨 : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ} → 𝑨 ≅ 𝑩 → 𝑨 ≥ 𝑩 ≅→≥ φ = (from φ) , ≅fromInjective φ -≤-refl : {𝑨 𝑩 : SetoidAlgebra α ρᵃ} → 𝑨 ≅ 𝑩 → 𝑨 ≤ 𝑩 +≤-refl : {𝑨 𝑩 : Algebra α ρᵃ} → 𝑨 ≅ 𝑩 → 𝑨 ≤ 𝑩 ≤-refl {𝑨 = 𝑨}{𝑩} A≅B = ≅→≤ A≅B -≥-refl : {𝑨 𝑩 : SetoidAlgebra α ρᵃ} → 𝑨 ≅ 𝑩 → 𝑨 ≥ 𝑩 +≥-refl : {𝑨 𝑩 : Algebra α ρᵃ} → 𝑨 ≅ 𝑩 → 𝑨 ≥ 𝑩 ≥-refl {𝑨 = 𝑨}{𝑩} A≅B = ≅→≤ (≅-sym A≅B) -≤-reflexive : {𝑨 : SetoidAlgebra α ρᵃ} → 𝑨 ≤ 𝑨 -≤-reflexive {𝑨 = 𝑨} = 𝒾𝒹 , id-is-injective{𝑨 = SetoidAlgebra.Domain 𝑨} +≤-reflexive : {𝑨 : Algebra α ρᵃ} → 𝑨 ≤ 𝑨 +≤-reflexive {𝑨 = 𝑨} = 𝒾𝒹 , id-is-injective{𝑨 = Algebra.Domain 𝑨} -module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ}{𝑪 : SetoidAlgebra γ ρᶜ} where - open SetoidAlgebra using ( Domain ) +module _ {𝑨 : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ}{𝑪 : Algebra γ ρᶜ} where + open Algebra using ( Domain ) open Setoid (Domain 𝑨) using () renaming ( _≈_ to _≈₁_ ; Carrier to ∣A∣ ) open Setoid (Domain 𝑩) using () renaming ( _≈_ to _≈₂_ ; Carrier to ∣B∣ ) open Setoid (Domain 𝑪) using () renaming ( _≈_ to _≈₃_ ; Carrier to ∣C∣ ) @@ -79,11 +82,11 @@ module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ}{𝑪 : S ≅-trans-≤ : 𝑨 ≅ 𝑩 → 𝑩 ≤ 𝑪 → 𝑨 ≤ 𝑪 ≅-trans-≤ A≅B (h , hinj) = (∘-hom (to A≅B) h) , (∘-injective ∣ to A≅B ∣ ∣ h ∣ (≅toInjective A≅B) hinj) -module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ}{𝑪 : SetoidAlgebra γ ρᶜ} where +module _ {𝑨 : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ}{𝑪 : Algebra γ ρᶜ} where ≥-trans : 𝑨 ≥ 𝑩 → 𝑩 ≥ 𝑪 → 𝑨 ≥ 𝑪 ≥-trans A≥B B≥C = ≤-trans B≥C A≥B -≤→≤c→≤c : {𝑨 : SetoidAlgebra α α}{𝑩 : SetoidAlgebra α α}{𝒦 : Pred(SetoidAlgebra α α) (ov α)} +≤→≤c→≤c : {𝑨 : Algebra α α}{𝑩 : Algebra α α}{𝒦 : Pred(Algebra α α) (ov α)} → 𝑨 ≤ 𝑩 → 𝑩 ≤c 𝒦 → 𝑨 ≤c 𝒦 ≤→≤c→≤c {𝑨 = 𝑨} A≤B sB = ∣ sB ∣ , (fst ∥ sB ∥ , ≤-trans A≤B (snd ∥ sB ∥)) @@ -102,7 +105,7 @@ module _ {α ρᵃ ρ : Level} where open _≅_ -module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ}{𝑪 : SetoidAlgebra γ ρᶜ} where +module _ {𝑨 : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ}{𝑪 : Algebra γ ρᶜ} where A≥B×B≅C→A≥C : 𝑨 ≥ 𝑩 → 𝑩 ≅ 𝑪 → 𝑨 ≥ 𝑪 A≥B×B≅C→A≥C A≥B B≅C = ≥-trans A≥B (≅→≥ B≅C) @@ -118,9 +121,9 @@ module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ}{𝑪 : S A≅B×B≤C→A≤C A≅B B≤C = ≤-trans (≅→≤ A≅B) B≤C open _⟶_ using ( cong ) renaming ( f to _⟨$⟩_ ) -module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} where - open SetoidAlgebra 𝑨 using () renaming (Domain to A) - open SetoidAlgebra 𝑩 using () renaming (Domain to B) +module _ {𝑨 : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ} where + open Algebra 𝑨 using () renaming (Domain to A) + open Algebra 𝑩 using () renaming (Domain to B) open Setoid A using ( sym ) -- open ≡-Reasoning open SetoidReasoning A @@ -134,7 +137,7 @@ module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} where y ∎ -≤-mono : (𝑩 : SetoidAlgebra β ρᵇ){𝒦 𝒦' : Pred (SetoidAlgebra α ρᵃ) γ} +≤-mono : (𝑩 : Algebra β ρᵇ){𝒦 𝒦' : Pred (Algebra α ρᵃ) γ} → 𝒦 ⊆ 𝒦' → 𝑩 ≤c 𝒦 → 𝑩 ≤c 𝒦' ≤-mono 𝑩 KK' (𝑨 , (KA , B≤A)) = 𝑨 , ((KK' KA) , B≤A) @@ -145,12 +148,12 @@ module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} where \begin{code} -module _ {𝒦 : Pred (SetoidAlgebra α ρᵃ)(ov α)}{𝑩 : SetoidAlgebra β ρᵇ}{ℓ : Level} where +module _ {𝒦 : Pred (Algebra α ρᵃ)(ov α)}{𝑩 : Algebra β ρᵇ}{ℓ : Level} where Lift-is-sub : 𝑩 ≤c 𝒦 → (Lift-Algˡ 𝑩 ℓ) ≤c 𝒦 Lift-is-sub (𝑨 , (KA , B≤A)) = 𝑨 , (KA , A≥B×B≅C→A≥C {𝑨 = 𝑨}{𝑩} B≤A Lift-≅ˡ) -module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} where +module _ {𝑨 : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ} where ≤-Liftˡ : {ℓ : Level} → 𝑨 ≤ 𝑩 → 𝑨 ≤ Lift-Algˡ 𝑩 ℓ ≤-Liftˡ A≤B = A≤B×B≅C→A≤C A≤B Lift-≅ˡ @@ -170,7 +173,7 @@ module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} where ≥-Lift : {ℓ ρ : Level} → 𝑨 ≥ 𝑩 → 𝑨 ≥ Lift-Alg 𝑩 ℓ ρ ≥-Lift A≥B = A≥B×B≅C→A≥C A≥B Lift-≅ -module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} where +module _ {𝑨 : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ} where Lift-≤-Liftˡ : {ℓᵃ ℓᵇ : Level} → 𝑨 ≤ 𝑩 → Lift-Algˡ 𝑨 ℓᵃ ≤ Lift-Algˡ 𝑩 ℓᵇ Lift-≤-Liftˡ A≤B = ≥-Liftˡ (≤-Liftˡ A≤B) @@ -189,10 +192,10 @@ module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} where \begin{code} -module _ {I : Type ι}{𝒜 : I → SetoidAlgebra α ρᵃ}{ℬ : I → SetoidAlgebra β ρᵇ} where +module _ {I : Type ι}{𝒜 : I → Algebra α ρᵃ}{ℬ : I → Algebra β ρᵇ} where - open SetoidAlgebra (⨅ 𝒜) using () renaming ( Domain to ⨅A ) - open SetoidAlgebra (⨅ ℬ) using () renaming ( Domain to ⨅B ) + open Algebra (⨅ 𝒜) using () renaming ( Domain to ⨅A ) + open Algebra (⨅ ℬ) using () renaming ( Domain to ⨅B ) open Setoid ⨅A using ( refl ) open IsHom ⨅-≤ : (∀ i → ℬ i ≤ 𝒜 i) → ⨅ ℬ ≤ ⨅ 𝒜 @@ -218,7 +221,7 @@ module _ {I : Type ι}{𝒜 : I → SetoidAlgebra α ρᵃ}{ℬ : I → SetoidAl --------------------------------- -[← Subalgebras.Func.Subalgebras](Subalgebras.Func.Subalgebras.html) +[← Subalgebras.Setoid.Subalgebras](Subalgebras.Setoid.Subalgebras.html) [Varieties →](Varieties.html) {% include UALib.Links.md %} diff --git a/src/Subalgebras/Setoid/Subalgebras.lagda b/src/Subalgebras/Setoid/Subalgebras.lagda new file mode 100644 index 00000000..6bf4a6d4 --- /dev/null +++ b/src/Subalgebras/Setoid/Subalgebras.lagda @@ -0,0 +1,134 @@ +--- +layout: default +title : "Subalgebras.Setoid.Subalgebras module (The Agda Universal Algebra Library)" +date : "2021-07-17" +author: "agda-algebras development team" +--- + +#### Subalgebras of setoid algebras + +This is the [Subalgebras.Setoid.Subalgebras][] module of the [Agda Universal Algebra Library][]. + +\begin{code} + +{-# OPTIONS --without-K --exact-split --safe #-} + +open import Algebras.Basic using ( 𝓞 ; 𝓥 ; Signature ) + +module Subalgebras.Setoid.Subalgebras {𝑆 : Signature 𝓞 𝓥} where + +-- imports from Agda and the Agda Standard Library ------------------------------------------ +open import Agda.Primitive using ( Level ; _⊔_ ) renaming ( Set to Type ) +open import Data.Product using ( _,_ ; Σ-syntax ) renaming ( _×_ to _∧_ ; proj₂ to snd ) +open import Relation.Binary using ( REL ) +open import Relation.Unary using ( Pred ; _∈_ ) + +-- Imports from the Agda Universal Algebra Library ------------------------------------------ +open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) +open import Overture.Setoid.Injective using ( IsInjective ) +open import Algebras.Setoid.Basic {𝑆 = 𝑆} using ( Algebra ; ov ) +open import Homomorphisms.Setoid.Basic {𝑆 = 𝑆} using ( hom ; mon ; mon→intohom ) +open import Homomorphisms.Setoid.Kernels {𝑆 = 𝑆} using ( kerquo ) +open import Homomorphisms.Setoid.Noether {𝑆 = 𝑆} using ( FirstHomTheorem ) +private variable + α ρᵃ β ρᵇ ℓ : Level + +_≥_ -- (alias for supalgebra (aka overalgebra)) + _IsSupalgebraOf_ : Algebra α ρᵃ → Algebra β ρᵇ → Type _ +𝑨 IsSupalgebraOf 𝑩 = Σ[ h ∈ hom 𝑩 𝑨 ] IsInjective ∣ h ∣ + +_≤_ -- (alias for subalgebra relation)) + _IsSubalgebraOf_ : Algebra α ρᵃ → Algebra β ρᵇ → Type (𝓞 ⊔ 𝓥 ⊔ α ⊔ ρᵃ ⊔ β ⊔ ρᵇ) +𝑨 IsSubalgebraOf 𝑩 = Σ[ h ∈ hom 𝑨 𝑩 ] IsInjective ∣ h ∣ + +-- Syntactic sugar for sup/sub-algebra relations. +𝑨 ≥ 𝑩 = 𝑨 IsSupalgebraOf 𝑩 +𝑨 ≤ 𝑩 = 𝑨 IsSubalgebraOf 𝑩 + +mon→≤ : {𝑨 : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ} → mon 𝑨 𝑩 → 𝑨 ≤ 𝑩 +mon→≤ {𝑨 = 𝑨}{𝑩} x = mon→intohom 𝑨 𝑩 x + +record SubalgebraOf : Type (ov (α ⊔ β ⊔ ρᵃ ⊔ ρᵇ)) where + field + algebra : Algebra α ρᵃ + subalgebra : Algebra β ρᵇ + issubalgebra : subalgebra ≤ algebra + + +Subalgebra : Algebra α ρᵃ → {β ρᵇ : Level} → Type _ +Subalgebra 𝑨 {β}{ρᵇ} = Σ[ 𝑩 ∈ (Algebra β ρᵇ) ] 𝑩 ≤ 𝑨 + +{- usage note: for 𝑨 : Algebra α ρᵃ, inhabitant of `Subalgebra 𝑨` is a pair + `(𝑩 , p) : Subalgebra 𝑨` providing + - `𝑩 : Algebra β ρᵇ` and + - `p : 𝑩 ≤ 𝑨`, a proof that 𝑩 is a subalgebra of 𝐴. -} + + +IsSubalgebraREL : {α ρᵃ β ρᵇ : Level} → REL (Algebra α ρᵃ)(Algebra β ρᵇ) ℓ → Type _ +IsSubalgebraREL {α}{ρᵃ}{β}{ρᵇ} R = ∀ {𝑨 : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ} → 𝑨 ≤ 𝑩 + +record SubalgebraREL(R : REL (Algebra β ρᵇ)(Algebra α ρᵃ) ℓ) : Type (ov (α ⊔ β ⊔ ρᵇ ⊔ ℓ)) + where + field isSubalgebraREL : IsSubalgebraREL R + + +\end{code} + +From now on we will use `𝑩 ≤ 𝑨` to express the assertion that `𝑩` is a subalgebra of `𝑨`. + + +#### Subalgebras of classes of setoid algebras + +Suppose `𝒦 : Pred (Algebra α 𝑆) γ` denotes a class of `𝑆`-algebras and `𝑩 : Algebra β ρᵇ` denotes an arbitrary `𝑆`-algebra. Then we might wish to consider the assertion that `𝑩` is a subalgebra of an algebra in the class `𝒦`. The next type we define allows us to express this assertion as `𝑩 IsSubalgebraOfClass 𝒦`. + +\begin{code} + +_≤c_ + _IsSubalgebraOfClass_ : Algebra β ρᵇ → Pred (Algebra α ρᵃ) ℓ → Type _ +𝑩 IsSubalgebraOfClass 𝒦 = Σ[ 𝑨 ∈ Algebra _ _ ] ((𝑨 ∈ 𝒦) ∧ (𝑩 ≤ 𝑨)) + +𝑩 ≤c 𝒦 = 𝑩 IsSubalgebraOfClass 𝒦 + +record SubalgebraOfClass : Type (ov (α ⊔ β ⊔ ρᵃ ⊔ ρᵇ ⊔ ℓ)) + where + field + class : Pred (Algebra α ρᵃ) ℓ + subalgebra : Algebra β ρᵇ + issubalgebraofclass : subalgebra ≤c class + + +record SubalgebraOfClass' : Type (ov (α ⊔ β ⊔ ρᵃ ⊔ ρᵇ ⊔ ℓ)) + where + field + class : Pred (Algebra α ρᵃ) ℓ + classalgebra : Algebra α ρᵃ + isclassalgebra : classalgebra ∈ class + subalgebra : Algebra β ρᵇ + issubalgebra : subalgebra ≤ classalgebra + +-- The collection of subalgebras of algebras in class 𝒦. +SubalgebrasOfClass : Pred (Algebra α ρᵃ) ℓ → {β ρᵇ : Level} → Type _ +SubalgebrasOfClass 𝒦 {β}{ρᵇ} = Σ[ 𝑩 ∈ Algebra β ρᵇ ] 𝑩 ≤c 𝒦 + +\end{code} + + + +#### Consequences of First Homomorphism Theorem + +As an example use-case of the `IsSubalgebraOf` type defined above, we prove the following easy but useful corollary of the First Homomorphism Theorem (proved in the [Homomorphisms.Setoid.Noether][] module): If `𝑨` and `𝑩` are `𝑆`-algebras and `h : hom 𝑨 𝑩` a homomorphism from `𝑨` to `𝑩`, then the quotient `𝑨 ╱ ker h` is (isomorphic to) a subalgebra of `𝑩`. + +\begin{code} + +FirstHomCorollary : {𝑨 : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ} + (hh : hom 𝑨 𝑩) → (kerquo hh) IsSubalgebraOf 𝑩 +FirstHomCorollary hh = ∣ FirstHomTheorem hh ∣ , snd ∥ FirstHomTheorem hh ∥ + +\end{code} + +--------------------------------- + +[← Subalgebras.Setoid.Subuniverses](Subalgebras.Setoid.Subuniverses.html) +[Subalgebras.Setoid.Properties →](Subalgebras.Setoid.Properties.html) + +{% include UALib.Links.md %} diff --git a/src/Subalgebras/Func/Subuniverses.lagda b/src/Subalgebras/Setoid/Subuniverses.lagda similarity index 87% rename from src/Subalgebras/Func/Subuniverses.lagda rename to src/Subalgebras/Setoid/Subuniverses.lagda index 0d2f25bf..b813448d 100644 --- a/src/Subalgebras/Func/Subuniverses.lagda +++ b/src/Subalgebras/Setoid/Subuniverses.lagda @@ -1,13 +1,13 @@ --- layout: default -title : "Subalgebras.Func.Subuniverses module (The Agda Universal Algebra Library)" +title : "Subalgebras.Setoid.Subuniverses module (The Agda Universal Algebra Library)" date : "2021-07-11" author: "agda-algebras development team" --- #### Subuniverses of setoid algebras -This is the [Subalgebras.Func.Subuniverses][] module of the [Agda Universal Algebra Library][]. +This is the [Subalgebras.Setoid.Subuniverses][] module of the [Agda Universal Algebra Library][]. \begin{code} @@ -15,7 +15,7 @@ This is the [Subalgebras.Func.Subuniverses][] module of the [Agda Universal Alge open import Algebras.Basic using ( 𝓞 ; 𝓥 ; Signature ) -module Subalgebras.Func.Subuniverses {𝑆 : Signature 𝓞 𝓥} where +module Subalgebras.Setoid.Subuniverses {𝑆 : Signature 𝓞 𝓥} where -- Imports from Agda and the Agda Standard Library ---------------------------------- open import Agda.Primitive using ( _⊔_ ; Level ) renaming ( Set to Type ) @@ -30,10 +30,10 @@ open import Relation.Binary.PropositionalEquality using ( refl ) -- Imports from the Agda Universal Algebra Library ---------------------------------- open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) open import Relations.Discrete using ( Im_⊆_ ) -open import Algebras.Func.Basic {𝑆 = 𝑆} using ( SetoidAlgebra ; 𝕌[_] ; _̂_ ; ov ) +open import Algebras.Setoid.Basic {𝑆 = 𝑆} using ( Algebra ; 𝕌[_] ; _̂_ ; ov ) open import Terms.Basic {𝑆 = 𝑆} using ( Term ; ℊ ; node ) -open import Terms.Func.Basic {𝑆 = 𝑆} using ( module Environment ) -open import Homomorphisms.Func.Basic {𝑆 = 𝑆} using ( hom ; IsHom ) +open import Terms.Setoid.Basic {𝑆 = 𝑆} using ( module Environment ) +open import Homomorphisms.Setoid.Basic {𝑆 = 𝑆} using ( hom ; IsHom ) private variable α β γ ρᵃ ρᵇ ρᶜ ℓ χ : Level @@ -45,7 +45,7 @@ We first show how to represent in [Agda][] the collection of subuniverses of an \begin{code} -module _ (𝑨 : SetoidAlgebra α ρᵃ) where +module _ (𝑨 : Algebra α ρᵃ) where private A = 𝕌[ 𝑨 ] -- (𝕌 = forgetful functor) @@ -101,7 +101,7 @@ When the element of `Sg G` is constructed as `app f a SgGa`, we may assume (the \begin{code} -module _ {𝑨 : SetoidAlgebra α ρᵃ} where +module _ {𝑨 : Algebra α ρᵃ} where private A = 𝕌[ 𝑨 ] @@ -116,19 +116,19 @@ In the proof above, we assume the following typing judgments: ``` ν : Im a ⊆ ⋂ I 𝒜 -a : ∥ 𝑆 ∥ f → Subalgebras.Func.A 𝑨 +a : ∥ 𝑆 ∥ f → Subalgebras.Setoid.A 𝑨 f : ∣ 𝑆 ∣ σ : (i : I) → 𝒜 i ∈ Subuniverses 𝑨 ``` and we must prove `(f ̂ 𝑨) a ∈ ⋂ I 𝒜`. When we did this with the old Algebra type, Agda could fill in the proof term `λ i → σ i f a (λ x → ν x i)` -automatically using `C-c C-a`, but this doesn't work for SetoidAlgebra +automatically using `C-c C-a`, but this doesn't work for Algebra as we've implemented it. We get the error "Agsy does not support copatterns yet." We should fix the implementation to resolve this. \begin{code} -module _ {𝑨 : SetoidAlgebra α ρᵃ} +module _ {𝑨 : Algebra α ρᵃ} where private A = 𝕌[ 𝑨 ] @@ -160,7 +160,7 @@ f : ∣ 𝑆 ∣ σ : B ∈ Subuniverses 𝑨 B : Pred A ρ ρ : Level -𝑨 : SetoidAlgebra α ρᵃ +𝑨 : Algebra α ρᵃ ``` and the given proof term establishes the goal `⟦ node f t ⟧ ⟨$⟩ b ∈ B`. @@ -192,8 +192,8 @@ we call `hom-unique`. \begin{code} - module _ {𝑩 : SetoidAlgebra β ρᵇ} (gh hh : hom 𝑨 𝑩) where - open SetoidAlgebra 𝑩 using ( Interp ) renaming (Domain to B ) + module _ {𝑩 : Algebra β ρᵇ} (gh hh : hom 𝑨 𝑩) where + open Algebra 𝑩 using ( Interp ) renaming (Domain to B ) open Setoid B using ( _≈_ ; sym ) open SetoidReasoning B open Func using ( cong ) renaming (f to _⟨$⟩_ ) @@ -238,7 +238,7 @@ and, under these assumptions, we proved `g ((f ̂ 𝑨) a) ≈ h ((f ̂ 𝑨) a) --------------------------------- -[↑ Subalgebras.Func](Subalgebras.Func.html) -[Subalgebras.Func.Subalgebras →](Subalgebras.Func.Subalgebras.html) +[↑ Subalgebras.Setoid](Subalgebras.Setoid.html) +[Subalgebras.Setoid.Subalgebras →](Subalgebras.Setoid.Subalgebras.html) {% include UALib.Links.md %} diff --git a/src/Terms/Operations.lagda b/src/Terms/Operations.lagda index 4ee86644..c017dfc5 100644 --- a/src/Terms/Operations.lagda +++ b/src/Terms/Operations.lagda @@ -248,6 +248,6 @@ subst-theorem wd p q σ 𝑨 Apq η = (𝑨 ⟦ p [ σ ] ⟧) η ≡⟨ subst-le ---------------------------------- [← Terms.Properties](Terms.Properties.html) -[Terms.Func →](Terms.Func.html) +[Terms.Setoid →](Terms.Setoid.html) {% include UALib.Links.md %} diff --git a/src/Terms/Func.lagda b/src/Terms/Setoid.lagda similarity index 52% rename from src/Terms/Func.lagda rename to src/Terms/Setoid.lagda index 09da1ba2..41b41883 100644 --- a/src/Terms/Func.lagda +++ b/src/Terms/Setoid.lagda @@ -1,29 +1,29 @@ --- layout: default -title : "Terms.Func module (The Agda Universal Algebra Library)" +title : "Terms.Setoid module (The Agda Universal Algebra Library)" date : "2021-09-18" author: "agda-algebras development team" --- ### Terms on setoids -This is the [Terms.Func][] module of the [Agda Universal Algebra Library][]. +This is the [Terms.Setoid][] module of the [Agda Universal Algebra Library][]. \begin{code} {-# OPTIONS --without-K --exact-split --safe #-} -module Terms.Func where +module Terms.Setoid where -open import Terms.Func.Basic -open import Terms.Func.Properties -open import Terms.Func.Operations +open import Terms.Setoid.Basic +open import Terms.Setoid.Properties +open import Terms.Setoid.Operations \end{code} -------------------------------- [← Terms.Operations](Terms.Operations.html) -[Terms.Func.Basic →](Terms.Func.Basic.html) +[Terms.Setoid.Basic →](Terms.Setoid.Basic.html) {% include UALib.Links.md %} diff --git a/src/Terms/Func/Basic.lagda b/src/Terms/Setoid/Basic.lagda similarity index 87% rename from src/Terms/Func/Basic.lagda rename to src/Terms/Setoid/Basic.lagda index 0de64acd..194511c5 100644 --- a/src/Terms/Func/Basic.lagda +++ b/src/Terms/Setoid/Basic.lagda @@ -1,13 +1,13 @@ --- layout: default -title : "Terms.Func.Basic module (The Agda Universal Algebra Library)" +title : "Terms.Setoid.Basic module (The Agda Universal Algebra Library)" date : "2021-09-18" author: "agda-algebras development team" --- #### Basic definitions -This is the [Terms.Func.Basic][] module of the [Agda Universal Algebra Library][]. +This is the [Terms.Setoid.Basic][] module of the [Agda Universal Algebra Library][]. \begin{code} @@ -15,7 +15,7 @@ This is the [Terms.Func.Basic][] module of the [Agda Universal Algebra Library][ open import Algebras.Basic using ( 𝓞 ; 𝓥 ; Signature ) -module Terms.Func.Basic {𝑆 : Signature 𝓞 𝓥} where +module Terms.Setoid.Basic {𝑆 : Signature 𝓞 𝓥} where -- imports from Agda and the Agda Standard Library ------------------------------------- open import Agda.Primitive using ( _⊔_ ; lsuc ) renaming ( Set to Type ) @@ -30,7 +30,7 @@ open import Relation.Binary.PropositionalEquality as ≡ using ( _≡_ ) -- Imports from the Agda Universal Algebra Library ------------------------------------ open import Overture.Preliminaries using ( ∥_∥ ) -open import Algebras.Func.Basic {𝑆 = 𝑆} using ( SetoidAlgebra ; ov ; _̂_) +open import Algebras.Setoid.Basic {𝑆 = 𝑆} using ( Algebra ; ov ; _̂_) open import Terms.Basic {𝑆 = 𝑆} using ( Term ; ℊ ; node ) open Func renaming ( f to _⟨$⟩_ ) @@ -47,7 +47,7 @@ We take a different approach here, using Setoids instead of quotient types. That is, we will define the collection of terms in a signature as a setoid with a particular equality-of-terms relation, which we must define. Ultimately we will use this to define the (absolutely free) term algebra -as a SetoidAlgebra whose carrier is the setoid of terms. +as a Algebra whose carrier is the setoid of terms. \begin{code} @@ -80,10 +80,10 @@ TermSetoid X = record { Carrier = Term X ; _≈_ = _≐_ ; isEquivalence = ≐-i module _ where - open SetoidAlgebra + open Algebra - -- The Term SetoidAlgebra - 𝑻 : (X : Type χ) → SetoidAlgebra (ov χ) (ov χ) + -- The Term Algebra + 𝑻 : (X : Type χ) → Algebra (ov χ) (ov χ) Domain (𝑻 X) = TermSetoid X Interp (𝑻 X) ⟨$⟩ (f , ts) = node f ts cong (Interp (𝑻 X)) (≡.refl , ss≐ts) = gnl ss≐ts @@ -115,8 +115,8 @@ An environment for `Γ` maps each variable `x : Γ` to an element of `A`, and eq \begin{code} -module Environment (𝑨 : SetoidAlgebra α ℓ) where - open SetoidAlgebra 𝑨 using ( Interp ) renaming ( Domain to A ) +module Environment (𝑨 : Algebra α ℓ) where + open Algebra 𝑨 using ( Interp ) renaming ( Domain to A ) open Setoid A using ( refl ; sym ; trans ) renaming ( _≈_ to _≈ₐ_ ; Carrier to ∣A∣ ) Env : Type χ → Setoid _ _ @@ -129,9 +129,9 @@ module Environment (𝑨 : SetoidAlgebra α ℓ) where } } - open SetoidAlgebra using ( Domain ) renaming ( Interp to interpretation ) + open Algebra using ( Domain ) renaming ( Interp to interpretation ) - EnvAlgebra : Type χ → SetoidAlgebra (α ⊔ χ) (ℓ ⊔ χ) + EnvAlgebra : Type χ → Algebra (α ⊔ χ) (ℓ ⊔ χ) Domain (EnvAlgebra X) = Env X (interpretation (EnvAlgebra X) ⟨$⟩ (f , aϕ)) x = (f ̂ 𝑨) (λ i → aϕ i x) cong (interpretation (EnvAlgebra X)) {f , a} {.f , b} (≡.refl , aibi) x = cong Interp (≡.refl , (λ i → aibi i x)) @@ -181,7 +181,7 @@ Interpretation of terms is iteration on the W-type. The standard library offers -------------------------------- -[↑ Terms.Func](Terms.Func.html) -[Terms.Func.Properties →](Terms.Func.Properties.html) +[↑ Terms.Setoid](Terms.Setoid.html) +[Terms.Setoid.Properties →](Terms.Setoid.Properties.html) {% include UALib.Links.md %} diff --git a/src/Terms/Func/Operations.lagda b/src/Terms/Setoid/Operations.lagda similarity index 74% rename from src/Terms/Func/Operations.lagda rename to src/Terms/Setoid/Operations.lagda index 2838a4dd..18e1e5e6 100644 --- a/src/Terms/Func/Operations.lagda +++ b/src/Terms/Setoid/Operations.lagda @@ -1,13 +1,13 @@ --- layout: default -title : "Terms.Operations module (The Agda Universal Algebra Library)" +title : "Terms.Setoid.Operations module (The Agda Universal Algebra Library)" date : "2021-09-25" author: "agda-algebras development team" --- #### Term Operations for Setoid Algebras -This section presents the [Terms.Func.Operations][] module of the [Agda Universal Algebra Library][]. +This section presents the [Terms.Setoid.Operations][] module of the [Agda Universal Algebra Library][]. Here we define *term operations* which are simply terms interpreted in a particular algebra, and we prove some compatibility properties of term operations. @@ -17,25 +17,25 @@ Here we define *term operations* which are simply terms interpreted in a particu open import Algebras.Basic using ( 𝓞 ; 𝓥 ; Signature ) -module Terms.Func.Operations {𝑆 : Signature 𝓞 𝓥} where +module Terms.Setoid.Operations {𝑆 : Signature 𝓞 𝓥} where -- Imports from Agda and the Agda Standard Library --------------------- -open import Agda.Primitive using ( Level ) renaming ( Set to Type ) -open import Data.Product using ( _,_ ) -open import Function.Base using ( _∘_ ) -open import Function.Bundles using ( Func ) -open import Relation.Binary using ( Setoid ) +open import Agda.Primitive using ( Level ) renaming ( Set to Type ) +open import Data.Product using ( _,_ ) +open import Function.Base using ( _∘_ ) +open import Function.Bundles using ( Func ) +open import Relation.Binary using ( Setoid ) import Relation.Binary.Reasoning.Setoid as SetoidReasoning open import Relation.Binary.PropositionalEquality as ≡ using ( _≡_ ) -- Imports from Agda Universal Algebra Library ---------------------------------------------- -open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) -open import Algebras.Func.Basic {𝑆 = 𝑆} using ( SetoidAlgebra ; _̂_ ; ov ) -open import Algebras.Func.Products {𝑆 = 𝑆} using ( ⨅ ) -open import Homomorphisms.Func.Basic {𝑆 = 𝑆} using ( hom ; IsHom ) -open import Terms.Basic {𝑆 = 𝑆} using ( Term ) -open import Terms.Func.Basic {𝑆 = 𝑆} using ( module Environment ; 𝑻 ; _≐_ ; ≐-isRefl ) -open import Terms.Func.Properties {𝑆 = 𝑆} using ( free-lift ) +open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) +open import Algebras.Setoid.Basic {𝑆 = 𝑆} using ( Algebra ; _̂_ ; ov ) +open import Algebras.Setoid.Products {𝑆 = 𝑆} using ( ⨅ ) +open import Homomorphisms.Setoid.Basic {𝑆 = 𝑆} using ( hom ; IsHom ) +open import Terms.Basic {𝑆 = 𝑆} using ( Term ) +open import Terms.Setoid.Basic {𝑆 = 𝑆} using ( module Environment ; 𝑻 ; _≐_ ; ≐-isRefl ) +open import Terms.Setoid.Properties {𝑆 = 𝑆} using ( free-lift ) open Term open Func using ( cong ) renaming ( f to _⟨$⟩_ ) @@ -50,8 +50,8 @@ It turns out that the intepretation of a term is the same as the `free-lift` (mo \begin{code} -module _ {𝑨 : SetoidAlgebra α ρᵃ} where - open SetoidAlgebra 𝑨 using ( Interp ) renaming (Domain to A ) +module _ {𝑨 : Algebra α ρᵃ} where + open Algebra 𝑨 using ( Interp ) renaming (Domain to A ) open Setoid A using ( _≈_ ; refl ) renaming ( Carrier to ∣A∣ ) open Environment 𝑨 using ( ⟦_⟧ ) @@ -62,7 +62,7 @@ module _ {𝑨 : SetoidAlgebra α ρᵃ} where free-lift-interp η (node f t) = cong Interp (≡.refl , (free-lift-interp η) ∘ t) module _ {X : Type χ} where - open SetoidAlgebra (𝑻 X) using ( Interp ) renaming (Domain to TX ) + open Algebra (𝑻 X) using ( Interp ) renaming (Domain to TX ) open Setoid TX using ( _≈_ ; refl ) renaming ( Carrier to ∣TX∣ ) open Environment (𝑻 X) using ( ⟦_⟧ ; ≐→Equal ) open SetoidReasoning TX @@ -84,8 +84,8 @@ module _ {X : Type χ} where \begin{code} module _ {X : Type χ }{I : Type ι} - (𝒜 : I → SetoidAlgebra α ρᵃ) where - open SetoidAlgebra (⨅ 𝒜) using (Interp) renaming ( Domain to ⨅A ) + (𝒜 : I → Algebra α ρᵃ) where + open Algebra (⨅ 𝒜) using (Interp) renaming ( Domain to ⨅A ) open Setoid ⨅A using ( _≈_ ; refl ) open Environment (⨅ 𝒜) using () renaming ( ⟦_⟧ to ⟦_⟧₁ ) open Environment using ( ⟦_⟧ ; ≐→Equal ) @@ -104,11 +104,11 @@ We now prove two important facts about term operations. The first of these, whi \begin{code} -module _ {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ}(hh : hom 𝑨 𝑩) where - open SetoidAlgebra 𝑨 using () renaming (Domain to A ; Interp to Interp₁ ) +module _ {𝑨 : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ}(hh : hom 𝑨 𝑩) where + open Algebra 𝑨 using () renaming (Domain to A ; Interp to Interp₁ ) open Setoid A using () renaming ( _≈_ to _≈₁_ ; Carrier to ∣A∣ ) - open SetoidAlgebra 𝑩 using () renaming (Domain to B ; Interp to Interp₂ ) + open Algebra 𝑩 using () renaming (Domain to B ; Interp to Interp₂ ) open Setoid B using ( _≈_ ; sym ; refl ) open SetoidReasoning B @@ -168,7 +168,7 @@ _[_]t : {X Y : Type χ } → Term Y → Substerm X Y → Term X ---------------------------------- -[← Terms.Properties](Terms.Properties.html) -[Terms.Func →](Terms.Func.html) +[← Terms.Setoid.Properties](Terms.Setoid.Properties.html) +[Subalgebras →](Subalgebras.html) {% include UALib.Links.md %} diff --git a/src/Terms/Func/Properties.lagda b/src/Terms/Setoid/Properties.lagda similarity index 80% rename from src/Terms/Func/Properties.lagda rename to src/Terms/Setoid/Properties.lagda index eca8bbac..f69221e6 100644 --- a/src/Terms/Func/Properties.lagda +++ b/src/Terms/Setoid/Properties.lagda @@ -1,13 +1,13 @@ --- layout: default -title : "Terms.Func.Properties module (The Agda Universal Algebra Library)" +title : "Terms.Setoid.Properties module (The Agda Universal Algebra Library)" date : "2021-09-18" author: "agda-algebras development team" --- #### Basic properties of terms on setoids -This is the [Terms.Func.Properties][] module of the [Agda Universal Algebra Library][]. +This is the [Terms.Setoid.Properties][] module of the [Agda Universal Algebra Library][]. \begin{code} @@ -15,7 +15,7 @@ This is the [Terms.Func.Properties][] module of the [Agda Universal Algebra Libr open import Algebras.Basic using ( 𝓞 ; 𝓥 ; Signature ) -module Terms.Func.Properties {𝑆 : Signature 𝓞 𝓥} where +module Terms.Setoid.Properties {𝑆 : Signature 𝓞 𝓥} where -- Imports from Agda and the Agda Standard Library --------------------- open import Agda.Primitive using ( Level ) renaming ( Set to Type ) @@ -28,12 +28,12 @@ import Relation.Binary.Reasoning.Setoid as SetoidReasoning -- Imports from the Agda Universal Algebra Library ------------------------------------------------ open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) -open import Overture.Func.Inverses using ( Img_∋_ ; eq ) -open import Overture.Func.Surjective using ( isSurj ; IsSurjective ; isSurj→IsSurjective ) -open import Algebras.Func.Basic {𝑆 = 𝑆} using ( SetoidAlgebra ; 𝕌[_] ; _̂_ ) -open import Homomorphisms.Func.Basic {𝑆 = 𝑆} using ( hom ; compatible-map ; IsHom ) +open import Overture.Setoid.Inverses using ( Img_∋_ ; eq ) +open import Overture.Setoid.Surjective using ( isSurj ; IsSurjective ; isSurj→IsSurjective ) +open import Algebras.Setoid.Basic {𝑆 = 𝑆} using ( Algebra ; 𝕌[_] ; _̂_ ) +open import Homomorphisms.Setoid.Basic {𝑆 = 𝑆} using ( hom ; compatible-map ; IsHom ) open import Terms.Basic {𝑆 = 𝑆} using ( Term ) -open import Terms.Func.Basic {𝑆 = 𝑆} using ( 𝑻 ; _≐_ ; ≐-isRefl ) +open import Terms.Setoid.Basic {𝑆 = 𝑆} using ( 𝑻 ; _≐_ ; ≐-isRefl ) open Term open _⟶_ using ( cong ) renaming ( f to _⟨$⟩_ ) @@ -52,10 +52,10 @@ We now prove this in [Agda][], starting with the fact that every map from `X` to \begin{code} -module _ {𝑨 : SetoidAlgebra α ρ}(h : X → 𝕌[ 𝑨 ]) where - open SetoidAlgebra 𝑨 using ( Interp ) renaming ( Domain to A ) +module _ {𝑨 : Algebra α ρ}(h : X → 𝕌[ 𝑨 ]) where + open Algebra 𝑨 using ( Interp ) renaming ( Domain to A ) open Setoid A using ( _≈_ ; reflexive ; trans ) renaming ( Carrier to ∣A∣ ) - open SetoidAlgebra (𝑻 X) using () renaming ( Domain to TX ) + open Algebra (𝑻 X) using () renaming ( Domain to TX ) open Setoid TX using () renaming ( Carrier to ∣TX∣ ) free-lift : 𝕌[ 𝑻 X ] → 𝕌[ 𝑨 ] @@ -118,11 +118,11 @@ Finally, we prove that the homomorphism is unique. Recall, when we proved this \begin{code} -module _ {𝑨 : SetoidAlgebra α ρ}{gh hh : hom (𝑻 X) 𝑨} where +module _ {𝑨 : Algebra α ρ}{gh hh : hom (𝑻 X) 𝑨} where - open SetoidAlgebra 𝑨 using ( Interp ) renaming ( Domain to A ) + open Algebra 𝑨 using ( Interp ) renaming ( Domain to A ) open Setoid A using ( _≈_ ; trans ; sym ) - open SetoidAlgebra (𝑻 X) using () renaming ( Domain to TX ) + open Algebra (𝑻 X) using () renaming ( Domain to TX ) open _≐_ open IsHom @@ -154,8 +154,8 @@ module _ {𝑨 : SetoidAlgebra α ρ}{gh hh : hom (𝑻 X) 𝑨} where ------------------------------ -[← Terms.Func.Basic](Terms.Func.Basic.html) -[Subalgebras →](Subalgebras.html) +[← Terms.Setoid.Basic](Terms.Setoid.Basic.html) +[Terms.Setoid.Operations →](Terms.Setoid.Operations.html) {% include UALib.Links.md %} diff --git a/src/Varieties/FreeAlgebras.lagda b/src/Varieties/FreeAlgebras.lagda index 5f48789c..2ccd8d40 100644 --- a/src/Varieties/FreeAlgebras.lagda +++ b/src/Varieties/FreeAlgebras.lagda @@ -450,6 +450,6 @@ proof of Birkhoff's theorem is complete. -------------------------------- [← Varieties.Preservation](Varieties.Preservation.html) -[Varieties.Func →](Varieties.Func.html) +[Varieties.Setoid →](Varieties.Setoid.html) {% include UALib.Links.md %} diff --git a/src/Varieties/Func.lagda b/src/Varieties/Func.lagda deleted file mode 100644 index 6eb79beb..00000000 --- a/src/Varieties/Func.lagda +++ /dev/null @@ -1,33 +0,0 @@ ---- -layout: default -title : "Varieties.Func module (Agda Universal Algebra Library)" -date : "2021-07-26" -author: "agda-algebras development team" ---- - -### Equations and Varieties for Setoids - -This is the [Varieties.Func][] module of the [Agda Universal Algebra Library][]. - -\begin{code} - -{-# OPTIONS --without-K --exact-split --safe #-} - -module Varieties.Func where - -open import Varieties.Func.EquationalLogic -open import Varieties.Func.SoundAndComplete -open import Varieties.Func.Closure -open import Varieties.Func.Properties -open import Varieties.Func.Preservation -open import Varieties.Func.FreeAlgebras -open import Varieties.Func.HSP - -\end{code} - --------------------------------- - -[← Varieties.FreeAlgebras](Varieties.FreeAlgebras.html) -[Varieties.Func.EquationalLogic →](Varieties.Func.EquationalLogic.html) - -{% include UALib.Links.md %} diff --git a/src/Varieties/Setoid.lagda b/src/Varieties/Setoid.lagda new file mode 100644 index 00000000..cc44f797 --- /dev/null +++ b/src/Varieties/Setoid.lagda @@ -0,0 +1,33 @@ +--- +layout: default +title : "Varieties.Setoid module (Agda Universal Algebra Library)" +date : "2021-07-26" +author: "agda-algebras development team" +--- + +### Equations and Varieties for Setoids + +This is the [Varieties.Setoid][] module of the [Agda Universal Algebra Library][]. + +\begin{code} + +{-# OPTIONS --without-K --exact-split --safe #-} + +module Varieties.Setoid where + +open import Varieties.Setoid.EquationalLogic +open import Varieties.Setoid.SoundAndComplete +open import Varieties.Setoid.Closure +open import Varieties.Setoid.Properties +open import Varieties.Setoid.Preservation +open import Varieties.Setoid.FreeAlgebras +open import Varieties.Setoid.HSP + +\end{code} + +-------------------------------- + +[← Varieties.FreeAlgebras](Varieties.FreeAlgebras.html) +[Varieties.Setoid.EquationalLogic →](Varieties.Setoid.EquationalLogic.html) + +{% include UALib.Links.md %} diff --git a/src/Varieties/Func/Closure.lagda b/src/Varieties/Setoid/Closure.lagda similarity index 58% rename from src/Varieties/Func/Closure.lagda rename to src/Varieties/Setoid/Closure.lagda index 6978908c..57792ad4 100644 --- a/src/Varieties/Func/Closure.lagda +++ b/src/Varieties/Setoid/Closure.lagda @@ -1,6 +1,6 @@ --- layout: default -title : "Varieties.Func.Closure module (The Agda Universal Algebra Library)" +title : "Varieties.Setoid.Closure module (The Agda Universal Algebra Library)" date : "2021-01-14" author: "agda-algebras development team" --- @@ -19,28 +19,28 @@ Fix a signature 𝑆, let 𝒦 be a class of 𝑆-algebras, and define open import Algebras.Basic using ( 𝓞 ; 𝓥 ; Signature ) -module Varieties.Func.Closure {𝑆 : Signature 𝓞 𝓥} where +module Varieties.Setoid.Closure {𝑆 : Signature 𝓞 𝓥} where -- imports from Agda and the Agda Standard Library ------------------------------------------- -open import Agda.Primitive using ( _⊔_ ; lsuc ) renaming ( Set to Type ; lzero to ℓ₀) -open import Data.Product using ( _,_ ; Σ-syntax ) renaming ( _×_ to _∧_ ) -open import Data.Unit.Polymorphic using ( ⊤ ; tt ) -open import Function.Bundles using ( Func ) -open import Function.Base using ( id ) -open import Level using ( Level ; Lift ; lift ; lower ) -open import Relation.Binary using ( Setoid ) -open import Relation.Unary using ( Pred ; _∈_ ; _⊆_ ) +open import Agda.Primitive using ( _⊔_ ; lsuc ) renaming ( Set to Type ; lzero to ℓ₀) +open import Data.Product using ( _,_ ; Σ-syntax ) renaming ( _×_ to _∧_ ) +open import Data.Unit.Polymorphic using ( ⊤ ; tt ) +open import Function.Bundles using ( Func ) +open import Function.Base using ( id ) +open import Level using ( Level ; Lift ; lift ; lower ) +open import Relation.Binary using ( Setoid ) +open import Relation.Unary using ( Pred ; _∈_ ; _⊆_ ) -- Imports from the Agda Universal Algebra Library --------------------------------------------- -open import Algebras.Func.Basic {𝑆 = 𝑆} using ( SetoidAlgebra ; ov ; Lift-Alg ) -open import Algebras.Func.Products {𝑆 = 𝑆} using ( ⨅ ) -open import Homomorphisms.Func.Basic {𝑆 = 𝑆} using ( IsHom ) -open import Homomorphisms.Func.Isomorphisms {𝑆 = 𝑆} using ( _≅_ ; ≅-trans ; ≅-sym ; Lift-≅ ; ⨅≅⨅ℓρ ) -open import Homomorphisms.Func.HomomorphicImages {𝑆 = 𝑆} using ( _IsHomImageOf_ ; IdHomImage ; HomImage-≅ - ; HomImage-≅' ; Lift-HomImage-lemma ) -open import Subalgebras.Func.Subalgebras {𝑆 = 𝑆} using ( _≤_ ; _≤c_ ) -open import Subalgebras.Func.Properties {𝑆 = 𝑆} using ( ≤-reflexive ; ≤-trans ; ≅-trans-≤ ; ≤-trans-≅ - ; Lift-≤-Lift ; ≤-Lift ) +open import Algebras.Setoid.Basic {𝑆 = 𝑆} using ( Algebra ; ov ; Lift-Alg ) +open import Algebras.Setoid.Products {𝑆 = 𝑆} using ( ⨅ ) +open import Homomorphisms.Setoid.Basic {𝑆 = 𝑆} using ( IsHom ) +open import Homomorphisms.Setoid.Isomorphisms {𝑆 = 𝑆} using ( _≅_ ; ≅-trans ; ≅-sym ; Lift-≅ ; ⨅≅⨅ℓρ ) +open import Homomorphisms.Setoid.HomomorphicImages {𝑆 = 𝑆} using ( _IsHomImageOf_ ; IdHomImage ; HomImage-≅ ) + using ( HomImage-≅' ; Lift-HomImage-lemma ) +open import Subalgebras.Setoid.Subalgebras {𝑆 = 𝑆} using ( _≤_ ; _≤c_ ) +open import Subalgebras.Setoid.Properties {𝑆 = 𝑆} using ( ≤-reflexive ; ≤-trans ; ≅-trans-≤ ) + using ( ≤-trans-≅ ; Lift-≤-Lift ; ≤-Lift ) open Func renaming ( f to _⟨$⟩_ ) @@ -48,12 +48,12 @@ module _ {α ρᵃ β ρᵇ : Level} where private a = α ⊔ ρᵃ ; b = β ⊔ ρᵇ - Level-closure : ∀ ℓ → Pred(SetoidAlgebra α ρᵃ) (a ⊔ ov ℓ) → Pred(SetoidAlgebra β ρᵇ) (b ⊔ ov(a ⊔ ℓ)) - Level-closure ℓ 𝒦 𝑩 = Σ[ 𝑨 ∈ SetoidAlgebra α ρᵃ ] (𝑨 ∈ 𝒦) ∧ 𝑨 ≅ 𝑩 + Level-closure : ∀ ℓ → Pred(Algebra α ρᵃ) (a ⊔ ov ℓ) → Pred(Algebra β ρᵇ) (b ⊔ ov(a ⊔ ℓ)) + Level-closure ℓ 𝒦 𝑩 = Σ[ 𝑨 ∈ Algebra α ρᵃ ] (𝑨 ∈ 𝒦) ∧ 𝑨 ≅ 𝑩 module _ {α ρᵃ β ρᵇ : Level} where - Lift-closed : ∀ ℓ → {𝒦 : Pred(SetoidAlgebra α ρᵃ) _}{𝑨 : SetoidAlgebra α ρᵃ} → 𝑨 ∈ 𝒦 + Lift-closed : ∀ ℓ → {𝒦 : Pred(Algebra α ρᵃ) _}{𝑨 : Algebra α ρᵃ} → 𝑨 ∈ 𝒦 → Lift-Alg 𝑨 β ρᵇ ∈ (Level-closure ℓ 𝒦) Lift-closed _ {𝑨 = 𝑨} kA = 𝑨 , (kA , Lift-≅) @@ -61,27 +61,27 @@ module _ {α ρᵃ β ρᵇ : Level} where private a = α ⊔ ρᵃ ; b = β ⊔ ρᵇ - H : ∀ ℓ → Pred(SetoidAlgebra α ρᵃ) (a ⊔ ov ℓ) → Pred(SetoidAlgebra β ρᵇ) (b ⊔ ov(a ⊔ ℓ)) - H _ 𝒦 𝑩 = Σ[ 𝑨 ∈ SetoidAlgebra α ρᵃ ] 𝑨 ∈ 𝒦 ∧ 𝑩 IsHomImageOf 𝑨 + H : ∀ ℓ → Pred(Algebra α ρᵃ) (a ⊔ ov ℓ) → Pred(Algebra β ρᵇ) (b ⊔ ov(a ⊔ ℓ)) + H _ 𝒦 𝑩 = Σ[ 𝑨 ∈ Algebra α ρᵃ ] 𝑨 ∈ 𝒦 ∧ 𝑩 IsHomImageOf 𝑨 - S : ∀ ℓ → Pred(SetoidAlgebra α ρᵃ) (a ⊔ ov ℓ) → Pred(SetoidAlgebra β ρᵇ) (b ⊔ ov(a ⊔ ℓ)) - S _ 𝒦 𝑩 = Σ[ 𝑨 ∈ SetoidAlgebra α ρᵃ ] 𝑨 ∈ 𝒦 ∧ 𝑩 ≤ 𝑨 + S : ∀ ℓ → Pred(Algebra α ρᵃ) (a ⊔ ov ℓ) → Pred(Algebra β ρᵇ) (b ⊔ ov(a ⊔ ℓ)) + S _ 𝒦 𝑩 = Σ[ 𝑨 ∈ Algebra α ρᵃ ] 𝑨 ∈ 𝒦 ∧ 𝑩 ≤ 𝑨 - P : ∀ ℓ ι → Pred(SetoidAlgebra α ρᵃ) (a ⊔ ov ℓ) → Pred(SetoidAlgebra β ρᵇ) (b ⊔ ov(a ⊔ ℓ ⊔ ι)) - P ℓ ι 𝒦 𝑩 = Σ[ I ∈ Type ι ] (Σ[ 𝒜 ∈ (I → SetoidAlgebra α ρᵃ) ] (∀ i → 𝒜 i ∈ 𝒦) ∧ (𝑩 ≅ ⨅ 𝒜)) + P : ∀ ℓ ι → Pred(Algebra α ρᵃ) (a ⊔ ov ℓ) → Pred(Algebra β ρᵇ) (b ⊔ ov(a ⊔ ℓ ⊔ ι)) + P ℓ ι 𝒦 𝑩 = Σ[ I ∈ Type ι ] (Σ[ 𝒜 ∈ (I → Algebra α ρᵃ) ] (∀ i → 𝒜 i ∈ 𝒦) ∧ (𝑩 ≅ ⨅ 𝒜)) module _ {α ρᵃ β ρᵇ : Level} where private a = α ⊔ ρᵃ ; b = β ⊔ ρᵇ - SP : ∀ ℓ ι → Pred(SetoidAlgebra α ρᵃ) (a ⊔ ov ℓ) → Pred(SetoidAlgebra β ρᵇ) (b ⊔ ov(a ⊔ ℓ ⊔ ι)) + SP : ∀ ℓ ι → Pred(Algebra α ρᵃ) (a ⊔ ov ℓ) → Pred(Algebra β ρᵇ) (b ⊔ ov(a ⊔ ℓ ⊔ ι)) SP ℓ ι 𝒦 = S{α}{ρᵃ} (a ⊔ ℓ ⊔ ι) (P ℓ ι 𝒦) module _ {α ρᵃ β ρᵇ γ ρᶜ δ ρᵈ : Level} where private a = α ⊔ ρᵃ ; b = β ⊔ ρᵇ ; c = γ ⊔ ρᶜ ; d = δ ⊔ ρᵈ - V : ∀ ℓ ι → Pred(SetoidAlgebra α ρᵃ) (a ⊔ ov ℓ) → Pred(SetoidAlgebra δ ρᵈ) (d ⊔ ov(a ⊔ b ⊔ c ⊔ ℓ ⊔ ι)) + V : ∀ ℓ ι → Pred(Algebra α ρᵃ) (a ⊔ ov ℓ) → Pred(Algebra δ ρᵈ) (d ⊔ ov(a ⊔ b ⊔ c ⊔ ℓ ⊔ ι)) V ℓ ι 𝒦 = H{γ}{ρᶜ}{δ}{ρᵈ} (a ⊔ b ⊔ ℓ ⊔ ι) (S{β}{ρᵇ} (a ⊔ ℓ ⊔ ι) (P ℓ ι 𝒦)) \end{code} @@ -96,11 +96,11 @@ With the closure operator V representing closure under HSP, we represent formall module _ {α ρᵃ ℓ ι : Level} where - is-variety : (𝒱 : Pred (SetoidAlgebra α ρᵃ)(α ⊔ ρᵃ ⊔ ov ℓ)) → Type (ov (α ⊔ ρᵃ ⊔ ℓ ⊔ ι)) + is-variety : (𝒱 : Pred (Algebra α ρᵃ)(α ⊔ ρᵃ ⊔ ov ℓ)) → Type (ov (α ⊔ ρᵃ ⊔ ℓ ⊔ ι)) is-variety 𝒱 = V{β = α}{ρᵇ = ρᵃ}{γ = α}{ρᶜ = ρᵃ} ℓ ι 𝒱 ⊆ 𝒱 variety : Type (ov (α ⊔ ρᵃ ⊔ ov ℓ ⊔ ι)) - variety = Σ[ 𝒱 ∈ (Pred (SetoidAlgebra α ρᵃ) (α ⊔ ρᵃ ⊔ ov ℓ)) ] is-variety 𝒱 + variety = Σ[ 𝒱 ∈ (Pred (Algebra α ρᵃ) (α ⊔ ρᵃ ⊔ ov ℓ)) ] is-variety 𝒱 \end{code} @@ -113,7 +113,7 @@ module _ {α ρᵃ : Level} where private a = α ⊔ ρᵃ - S-mono : ∀{ℓ} → {𝒦 𝒦' : Pred (SetoidAlgebra α ρᵃ)(a ⊔ ov ℓ)} + S-mono : ∀{ℓ} → {𝒦 𝒦' : Pred (Algebra α ρᵃ)(a ⊔ ov ℓ)} → 𝒦 ⊆ 𝒦' → S{β = α}{ρᵃ} ℓ 𝒦 ⊆ S ℓ 𝒦' S-mono kk {𝑩} (𝑨 , (kA , B≤A)) = 𝑨 , ((kk kA) , B≤A) @@ -125,7 +125,7 @@ Of course, this is proved by establishing two inclusions, but one of them is tri \begin{code} - S-idem : ∀{β ρᵇ γ ρᶜ ℓ} → {𝒦 : Pred (SetoidAlgebra α ρᵃ)(a ⊔ ov ℓ)} + S-idem : ∀{β ρᵇ γ ρᶜ ℓ} → {𝒦 : Pred (Algebra α ρᵃ)(a ⊔ ov ℓ)} → S{β = γ}{ρᶜ} (a ⊔ ℓ) (S{β = β}{ρᵇ} ℓ 𝒦) ⊆ S{β = γ}{ρᶜ} ℓ 𝒦 S-idem (𝑨 , (𝑩 , sB , A≤B) , x≤A) = 𝑩 , (sB , ≤-trans x≤A A≤B) @@ -139,13 +139,13 @@ Of course, this is proved by establishing two inclusions, but one of them is tri \begin{code} - H-expa : ∀{ℓ} → {𝒦 : Pred (SetoidAlgebra α ρᵃ)(a ⊔ ov ℓ)} → 𝒦 ⊆ H ℓ 𝒦 + H-expa : ∀{ℓ} → {𝒦 : Pred (Algebra α ρᵃ)(a ⊔ ov ℓ)} → 𝒦 ⊆ H ℓ 𝒦 H-expa {ℓ} {𝒦}{𝑨} kA = 𝑨 , kA , IdHomImage - S-expa : ∀{ℓ} → {𝒦 : Pred (SetoidAlgebra α ρᵃ)(a ⊔ ov ℓ)} → 𝒦 ⊆ S ℓ 𝒦 + S-expa : ∀{ℓ} → {𝒦 : Pred (Algebra α ρᵃ)(a ⊔ ov ℓ)} → 𝒦 ⊆ S ℓ 𝒦 S-expa {ℓ}{𝒦}{𝑨} kA = 𝑨 , (kA , ≤-reflexive) - P-mono : ∀{ℓ ι} → {𝒦 𝒦' : Pred (SetoidAlgebra α ρᵃ)(a ⊔ ov ℓ)} + P-mono : ∀{ℓ ι} → {𝒦 𝒦' : Pred (Algebra α ρᵃ)(a ⊔ ov ℓ)} → 𝒦 ⊆ 𝒦' → P{β = α}{ρᵃ} ℓ ι 𝒦 ⊆ P ℓ ι 𝒦' P-mono {ℓ}{ι}{𝒦}{𝒦'} kk {𝑩} (I , 𝒜 , (kA , B≅⨅A)) = I , (𝒜 , ((λ i → kk (kA i)) , B≅⨅A)) @@ -154,11 +154,11 @@ Of course, this is proved by establishing two inclusions, but one of them is tri open IsHom - P-expa : ∀{ℓ ι} → {𝒦 : Pred (SetoidAlgebra α ρᵃ)(a ⊔ ov ℓ)} → 𝒦 ⊆ P ℓ ι 𝒦 + P-expa : ∀{ℓ ι} → {𝒦 : Pred (Algebra α ρᵃ)(a ⊔ ov ℓ)} → 𝒦 ⊆ P ℓ ι 𝒦 P-expa {ℓ}{ι}{𝒦}{𝑨} kA = ⊤ , (λ x → 𝑨) , ((λ i → kA) , Goal) where - open SetoidAlgebra 𝑨 using () renaming (Domain to A) - open SetoidAlgebra (⨅ (λ _ → 𝑨)) using () renaming (Domain to ⨅A) + open Algebra 𝑨 using () renaming (Domain to A) + open Algebra (⨅ (λ _ → 𝑨)) using () renaming (Domain to ⨅A) open Setoid A using ( refl ) open Setoid ⨅A using () renaming ( refl to refl⨅ ) @@ -181,7 +181,7 @@ Of course, this is proved by establishing two inclusions, but one of them is tri from∼to Goal = λ _ → refl - V-expa : ∀ ℓ ι → {𝒦 : Pred (SetoidAlgebra α ρᵃ)(a ⊔ ov ℓ)} → 𝒦 ⊆ V ℓ ι 𝒦 + V-expa : ∀ ℓ ι → {𝒦 : Pred (Algebra α ρᵃ)(a ⊔ ov ℓ)} → 𝒦 ⊆ V ℓ ι 𝒦 V-expa ℓ ι {𝒦} {𝑨} x = H-expa {a ⊔ ℓ ⊔ ι} (S-expa {a ⊔ ℓ ⊔ ι} (P-expa {ℓ}{ι} x) ) \end{code} @@ -190,13 +190,13 @@ We sometimes want to go back and forth between our two representations of subalg \begin{code} -module _ {α ρᵃ β ρᵇ ℓ ι : Level}{𝒦 : Pred (SetoidAlgebra α ρᵃ)(α ⊔ ρᵃ ⊔ ov ℓ)} - {𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ} where +module _ {α ρᵃ β ρᵇ ℓ ι : Level}{𝒦 : Pred (Algebra α ρᵃ)(α ⊔ ρᵃ ⊔ ov ℓ)} + {𝑨 : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ} where S-≅ : 𝑨 ∈ S ℓ 𝒦 → 𝑨 ≅ 𝑩 → 𝑩 ∈ S{α ⊔ β}{ρᵃ ⊔ ρᵇ}(α ⊔ ρᵃ ⊔ ℓ) (Level-closure ℓ 𝒦) S-≅ (𝑨' , kA' , A≤A') A≅B = lA' , (lklA' , B≤lA') where - lA' : SetoidAlgebra (α ⊔ β) (ρᵃ ⊔ ρᵇ) + lA' : Algebra (α ⊔ β) (ρᵃ ⊔ ρᵇ) lA' = Lift-Alg 𝑨' β ρᵇ lklA' : lA' ∈ Level-closure ℓ 𝒦 lklA' = Lift-closed ℓ kA' @@ -211,8 +211,8 @@ module _ {α ρᵃ β ρᵇ ℓ ι : Level}{𝒦 : Pred (SetoidAlgebra α ρᵃ) module _ {α ρᵃ ℓ : Level} - (𝒦 : Pred(SetoidAlgebra α ρᵃ) (α ⊔ ρᵃ ⊔ ov ℓ)) - (𝑨 : SetoidAlgebra (α ⊔ ρᵃ ⊔ ℓ) (α ⊔ ρᵃ ⊔ ℓ)) where + (𝒦 : Pred(Algebra α ρᵃ) (α ⊔ ρᵃ ⊔ ov ℓ)) + (𝑨 : Algebra (α ⊔ ρᵃ ⊔ ℓ) (α ⊔ ρᵃ ⊔ ℓ)) where private ι = ov(α ⊔ ρᵃ ⊔ ℓ) @@ -230,31 +230,31 @@ The remaining theorems in this file are as yet unused, but may be useful later a \begin{code} -module _ {α ρᵃ ℓ ι : Level}{𝒦 : Pred (SetoidAlgebra α ρᵃ)(α ⊔ ρᵃ ⊔ ov ℓ)} where +module _ {α ρᵃ ℓ ι : Level}{𝒦 : Pred (Algebra α ρᵃ)(α ⊔ ρᵃ ⊔ ov ℓ)} where -- For reference, some useful type levels: - classP : Pred (SetoidAlgebra α ρᵃ) (ov(α ⊔ ρᵃ ⊔ ℓ ⊔ ι)) + classP : Pred (Algebra α ρᵃ) (ov(α ⊔ ρᵃ ⊔ ℓ ⊔ ι)) classP = P{β = α}{ρᵃ} ℓ ι 𝒦 - classSP : Pred (SetoidAlgebra α ρᵃ) (ov(α ⊔ ρᵃ ⊔ ℓ ⊔ ι)) + classSP : Pred (Algebra α ρᵃ) (ov(α ⊔ ρᵃ ⊔ ℓ ⊔ ι)) classSP = S{β = α}{ρᵃ} (α ⊔ ρᵃ ⊔ ℓ ⊔ ι) (P{β = α}{ρᵃ} ℓ ι 𝒦) - classHSP : Pred (SetoidAlgebra α ρᵃ) (ov(α ⊔ ρᵃ ⊔ ℓ ⊔ ι)) + classHSP : Pred (Algebra α ρᵃ) (ov(α ⊔ ρᵃ ⊔ ℓ ⊔ ι)) classHSP = H{β = α}{ρᵃ}(α ⊔ ρᵃ ⊔ ℓ ⊔ ι) (S{β = α}{ρᵃ}(α ⊔ ρᵃ ⊔ ℓ ⊔ ι) (P{β = α}{ρᵃ}ℓ ι 𝒦)) - classS : ∀{β ρᵇ} → Pred (SetoidAlgebra β ρᵇ) (β ⊔ ρᵇ ⊔ ov(α ⊔ ρᵃ ⊔ ℓ)) + classS : ∀{β ρᵇ} → Pred (Algebra β ρᵇ) (β ⊔ ρᵇ ⊔ ov(α ⊔ ρᵃ ⊔ ℓ)) classS = S ℓ 𝒦 - classK : ∀{β ρᵇ} → Pred (SetoidAlgebra β ρᵇ) (β ⊔ ρᵇ ⊔ ov(α ⊔ ρᵃ ⊔ ℓ)) + classK : ∀{β ρᵇ} → Pred (Algebra β ρᵇ) (β ⊔ ρᵇ ⊔ ov(α ⊔ ρᵃ ⊔ ℓ)) classK = Level-closure{α}{ρᵃ} ℓ 𝒦 -module _ {α ρᵃ β ρᵇ γ ρᶜ ℓ : Level}{𝒦 : Pred (SetoidAlgebra α ρᵃ)(α ⊔ ρᵃ ⊔ ov ℓ)} where +module _ {α ρᵃ β ρᵇ γ ρᶜ ℓ : Level}{𝒦 : Pred (Algebra α ρᵃ)(α ⊔ ρᵃ ⊔ ov ℓ)} where private a = α ⊔ ρᵃ ; b = β ⊔ ρᵇ ; c = γ ⊔ ρᶜ - LevelClosure-S : Pred (SetoidAlgebra (α ⊔ γ) (ρᵃ ⊔ ρᶜ)) (c ⊔ ov(a ⊔ b ⊔ ℓ)) + LevelClosure-S : Pred (Algebra (α ⊔ γ) (ρᵃ ⊔ ρᶜ)) (c ⊔ ov(a ⊔ b ⊔ ℓ)) LevelClosure-S = Level-closure{β}{ρᵇ} (a ⊔ ℓ) (S ℓ 𝒦) - S-LevelClosure : Pred (SetoidAlgebra (α ⊔ γ) (ρᵃ ⊔ ρᶜ)) (ov(a ⊔ c ⊔ ℓ)) + S-LevelClosure : Pred (Algebra (α ⊔ γ) (ρᵃ ⊔ ρᶜ)) (ov(a ⊔ c ⊔ ℓ)) S-LevelClosure = S{α ⊔ γ}{ρᵃ ⊔ ρᶜ}(a ⊔ ℓ) (Level-closure ℓ 𝒦) S-Lift-lemma : LevelClosure-S ⊆ S-LevelClosure @@ -271,7 +271,7 @@ module _ {α ρᵃ β ρᵇ γ ρᶜ ℓ : Level}{𝒦 : Pred (SetoidAlgebra α module _ {α ρᵃ : Level} where - P-Lift-closed : ∀ ℓ ι → {𝒦 : Pred (SetoidAlgebra α ρᵃ)(α ⊔ ρᵃ ⊔ ov ℓ)}{𝑨 : SetoidAlgebra α ρᵃ} + P-Lift-closed : ∀ ℓ ι → {𝒦 : Pred (Algebra α ρᵃ)(α ⊔ ρᵃ ⊔ ov ℓ)}{𝑨 : Algebra α ρᵃ} → 𝑨 ∈ P{β = α}{ρᵃ} ℓ ι 𝒦 → {γ ρᶜ : Level} → Lift-Alg 𝑨 γ ρᶜ ∈ P (α ⊔ ρᵃ ⊔ ℓ) ι (Level-closure ℓ 𝒦) P-Lift-closed ℓ ι {𝒦}{𝑨} (I , 𝒜 , kA , A≅⨅𝒜) {γ}{ρᶜ} = I @@ -289,8 +289,8 @@ module _ {α ρᵃ : Level} where -------------------------------- -[← Varieties.Func.SoundAndComplete](Varieties.Func.SoundAndComplete.html) -[Varieties.Func.Properties →](Varieties.Func.Properties.html) +[← Varieties.Setoid.SoundAndComplete](Varieties.Setoid.SoundAndComplete.html) +[Varieties.Setoid.Properties →](Varieties.Setoid.Properties.html) {% include UALib.Links.md %} diff --git a/src/Varieties/Func/EquationalLogic.lagda b/src/Varieties/Setoid/EquationalLogic.lagda similarity index 71% rename from src/Varieties/Func/EquationalLogic.lagda rename to src/Varieties/Setoid/EquationalLogic.lagda index c63e5660..b2cba622 100644 --- a/src/Varieties/Func/EquationalLogic.lagda +++ b/src/Varieties/Setoid/EquationalLogic.lagda @@ -1,13 +1,13 @@ --- layout: default -title : "Varieties.Func.EquationalLogic module (The Agda Universal Algebra Library)" +title : "Varieties.Setoid.EquationalLogic module (The Agda Universal Algebra Library)" date : "2021-09-24" author: "agda-algebras development team" --- ### Equational Logic and varieties of setoid algebras -This is the [Varieties.Func.EquationalLogic][] module of the [Agda Universal Algebra Library][] where the binary "models" relation ⊧, relating algebras (or classes of algebras) to the identities that they satisfy, is defined. +This is the [Varieties.Setoid.EquationalLogic][] module of the [Agda Universal Algebra Library][] where the binary "models" relation ⊧, relating algebras (or classes of algebras) to the identities that they satisfy, is defined. Let 𝑆 be a signature. By an *identity* or *equation* in 𝑆 we mean an ordered pair of terms, written 𝑝 ≈ 𝑞, from the term algebra 𝑻 X. If 𝑨 is an 𝑆-algebra we say that 𝑨 *satisfies* 𝑝 ≈ 𝑞 provided 𝑝 ̇ 𝑨 ≡ 𝑞 ̇ 𝑨 holds. In this situation, we write 𝑨 ⊧ 𝑝 ≈ 𝑞 and say that 𝑨 *models* the identity 𝑝 ≈ q. If 𝒦 is a class of algebras, all of the same signature, we write 𝒦 ⊧ p ≈ q if, for every 𝑨 ∈ 𝒦, 𝑨 ⊧ 𝑝 ≈ 𝑞. @@ -19,7 +19,7 @@ Because a class of structures has a different type than a single structure, we m open import Algebras.Basic using ( 𝓞 ; 𝓥 ; Signature ) -module Varieties.Func.EquationalLogic {𝑆 : Signature 𝓞 𝓥} where +module Varieties.Setoid.EquationalLogic {𝑆 : Signature 𝓞 𝓥} where -- Imports from Agda and the Agda Standard Library ---------------- open import Agda.Primitive using ( _⊔_ ; lsuc ; Level ) @@ -31,9 +31,9 @@ open import Relation.Binary using ( Setoid ) open import Relation.Unary using ( Pred ; _∈_ ) -- Imports from the Agda Universal Algebra Library ---------------- -open import Algebras.Func.Basic {𝑆 = 𝑆} using ( SetoidAlgebra ; ov ) +open import Algebras.Setoid.Basic {𝑆 = 𝑆} using ( Algebra ; ov ) open import Terms.Basic {𝑆 = 𝑆} using ( Term ) -open import Terms.Func.Basic {𝑆 = 𝑆} using ( 𝑻 ; module Environment ) +open import Terms.Setoid.Basic {𝑆 = 𝑆} using ( 𝑻 ; module Environment ) private variable χ α ρᵃ ℓ ι : Level @@ -55,16 +55,16 @@ open Func using ( cong ) renaming ( f to _⟨$⟩_ ) module _ {X : Type χ} where open Setoid using () renaming (Carrier to ∣_∣ ) - open SetoidAlgebra using ( Domain ) + open Algebra using ( Domain ) - _⊧_≈_ : SetoidAlgebra α ρᵃ → Term X → Term X → Type _ + _⊧_≈_ : Algebra α ρᵃ → Term X → Term X → Type _ 𝑨 ⊧ p ≈ q = ∀ (ρ : ∣ Env X ∣) → ⟦ p ⟧ ⟨$⟩ ρ ≈ ⟦ q ⟧ ⟨$⟩ ρ where open Setoid ( Domain 𝑨 ) using ( _≈_ ) open Environment 𝑨 using ( Env ; ⟦_⟧ ) - _⊫_≈_ : Pred(SetoidAlgebra α ρᵃ) ℓ → Term X → Term X → Type (χ ⊔ ℓ ⊔ ov(α ⊔ ρᵃ)) - 𝒦 ⊫ p ≈ q = {𝑨 : SetoidAlgebra _ _} → 𝒦 𝑨 → 𝑨 ⊧ p ≈ q + _⊫_≈_ : Pred(Algebra α ρᵃ) ℓ → Term X → Term X → Type (χ ⊔ ℓ ⊔ ov(α ⊔ ρᵃ)) + 𝒦 ⊫ p ≈ q = {𝑨 : Algebra _ _} → 𝒦 𝑨 → 𝑨 ⊧ p ≈ q \end{code} @@ -83,10 +83,10 @@ modeled by the members of 𝒦. \begin{code} - Th : Pred (SetoidAlgebra α ρᵃ) ℓ → Pred(Term X × Term X) (χ ⊔ ℓ ⊔ ov(α ⊔ ρᵃ)) + Th : Pred (Algebra α ρᵃ) ℓ → Pred(Term X × Term X) (χ ⊔ ℓ ⊔ ov(α ⊔ ρᵃ)) Th 𝒦 = λ (p , q) → 𝒦 ⊫ p ≈ q -Th' : {χ α : Level}{X : Type χ} → Pred (SetoidAlgebra α α) (ov α) +Th' : {χ α : Level}{X : Type χ} → Pred (Algebra α α) (ov α) → Pred(Term X × Term X) (χ ⊔ ov α) Th' 𝒦 = λ (p , q) → 𝒦 ⊫ p ≈ q @@ -97,7 +97,7 @@ essentially by taking `Th 𝒦` itself to be the index set, as shown below. \begin{code} -module _ {X : Type χ}{𝒦 : Pred (SetoidAlgebra α ρᵃ) (ov α)} where +module _ {X : Type χ}{𝒦 : Pred (Algebra α ρᵃ) (ov α)} where ℐ : Type (ov(α ⊔ ρᵃ ⊔ χ)) ℐ = Σ[ (p , q) ∈ (Term X × Term X) ] 𝒦 ⊫ p ≈ q @@ -112,7 +112,7 @@ satisfying the identities in `ℰ`. \begin{code} - Mod : Pred(Term X × Term X) (ov α) → Pred(SetoidAlgebra α ρᵃ) (ρᵃ ⊔ ov(α ⊔ χ)) + Mod : Pred(Term X × Term X) (ov α) → Pred(Algebra α ρᵃ) (ρᵃ ⊔ ov(α ⊔ χ)) Mod ℰ = λ 𝑨 → ∀ p q → (p , q) ∈ ℰ → 𝑨 ⊧ p ≈ q \end{code} @@ -121,7 +121,7 @@ It is sometimes more convenient to have a "tupled" version of the previous defin \begin{code} - Modᵗ : {I : Type ι} → (I → Term X × Term X) → {α : Level} → Pred(SetoidAlgebra α ρᵃ) (χ ⊔ ρᵃ ⊔ ι ⊔ α) + Modᵗ : {I : Type ι} → (I → Term X × Term X) → {α : Level} → Pred(Algebra α ρᵃ) (χ ⊔ ρᵃ ⊔ ι ⊔ α) Modᵗ ℰ = λ 𝑨 → ∀ i → 𝑨 ⊧ fst (ℰ i) ≈ snd (ℰ i) \end{code} @@ -129,18 +129,7 @@ It is sometimes more convenient to have a "tupled" version of the previous defin ------------------------------------- -[↑ Varieties.Func](Varieties.Func.html) -[Varieties.Func.Closure →](Varieties.Func.Closure.html) +[↑ Varieties.Setoid](Varieties.Setoid.html) +[Varieties.Setoid.SoundAndComplete →](Varieties.Setoid.SoundAndComplete.html) {% include UALib.Links.md %} - - - diff --git a/src/Varieties/Func/FreeAlgebras.lagda b/src/Varieties/Setoid/FreeAlgebras.lagda similarity index 69% rename from src/Varieties/Func/FreeAlgebras.lagda rename to src/Varieties/Setoid/FreeAlgebras.lagda index c87da239..04f8720e 100644 --- a/src/Varieties/Func/FreeAlgebras.lagda +++ b/src/Varieties/Setoid/FreeAlgebras.lagda @@ -1,6 +1,6 @@ --- layout: default -title : "Varieties.Func.FreeAlgebras module (Agda Universal Algebra Library)" +title : "Varieties.Setoid.FreeAlgebras module (Agda Universal Algebra Library)" date : "2021-06-29" author: "agda-algebras development team" --- @@ -13,38 +13,37 @@ author: "agda-algebras development team" open import Algebras.Basic using ( 𝓞 ; 𝓥 ; Signature ) -module Varieties.Func.FreeAlgebras {𝑆 : Signature 𝓞 𝓥} where +module Varieties.Setoid.FreeAlgebras {𝑆 : Signature 𝓞 𝓥} 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 ; proj₂ to snd ) -open import Function using ( _∘_ ; id ) renaming ( Func to _⟶_ ) +open import Agda.Primitive using () renaming ( Set to Type ) +open import Data.Product using ( Σ-syntax ; _,_ ) renaming ( proj₁ to fst ; proj₂ to snd ) +open import Function using ( _∘_ ; id ) renaming ( Func to _⟶_ ) open import Level open import Relation.Binary using ( Setoid ) open import Relation.Unary using ( Pred ; _∈_ ; _⊆_ ) open import Relation.Binary.PropositionalEquality as ≡ using (_≡_) -- Imports from the Agda Universal Algebra Library --------------------------------------------------- -open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) -open import Overture.Func.Inverses using ( eq ) -open import Overture.Func.Surjective using ( IsSurjective ) -open import Relations.Func.Discrete using ( fkerPred ) -open import Algebras.Func.Basic {𝑆 = 𝑆} using ( SetoidAlgebra ; ov ; Lift-Alg ) -open import Homomorphisms.Func.Basic {𝑆 = 𝑆} using ( epi ; IsEpi ; IsHom ; hom ; epi→hom ) -open import Homomorphisms.Func.Properties {𝑆 = 𝑆} using ( ∘-epi ; ToLift-epi ) -open import Terms.Basic {𝑆 = 𝑆} using ( ℊ ) -open import Terms.Func.Basic {𝑆 = 𝑆} using ( 𝑻 ; _≐_ ; module Environment ) -open import Terms.Func.Properties {𝑆 = 𝑆} using ( free-lift ) -open import Terms.Func.Operations {𝑆 = 𝑆} using ( free-lift-interp ) -open import Varieties.Func.SoundAndComplete {𝑆 = 𝑆} using ( Eq ; _⊫_ ; _≈̇_ ; _⊢_▹_≈_ - ; module Soundness - ; module FreeAlgebra - ; Th ; Mod ) -open import Varieties.Func.Closure {𝑆 = 𝑆} using ( V ; S ) -open import Varieties.Func.Preservation {𝑆 = 𝑆} using ( classIds-⊆-VIds ; S-id1 ) - -open _⟶_ using ( cong ) renaming ( f to _⟨$⟩_ ) -open SetoidAlgebra using ( Domain ) +open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) +open import Overture.Setoid.Inverses using ( eq ) +open import Overture.Setoid.Surjective using ( IsSurjective ) +open import Relations.Setoid.Discrete using ( fkerPred ) +open import Algebras.Setoid.Basic {𝑆 = 𝑆} using ( Algebra ; ov ; Lift-Alg ) +open import Homomorphisms.Setoid.Basic {𝑆 = 𝑆} using ( epi ; IsEpi ; IsHom ; hom ; epi→hom ) +open import Homomorphisms.Setoid.Properties {𝑆 = 𝑆} using ( ∘-epi ; ToLift-epi ) +open import Terms.Basic {𝑆 = 𝑆} using ( ℊ ) +open import Terms.Setoid.Basic {𝑆 = 𝑆} using ( 𝑻 ; _≐_ ; module Environment ) +open import Terms.Setoid.Properties {𝑆 = 𝑆} using ( free-lift ) +open import Terms.Setoid.Operations {𝑆 = 𝑆} using ( free-lift-interp ) +open import Varieties.Setoid.SoundAndComplete {𝑆 = 𝑆} using ( Eq ; _⊫_ ; _≈̇_ ; _⊢_▹_≈_ ) + using ( module Soundness ; module FreeAlgebra ) + using ( Th ; Mod ) +open import Varieties.Setoid.Closure {𝑆 = 𝑆} using ( V ; S ) +open import Varieties.Setoid.Preservation {𝑆 = 𝑆} using ( classIds-⊆-VIds ; S-id1 ) + +open _⟶_ using ( cong ) renaming ( f to _⟨$⟩_ ) +open Algebra using ( Domain ) \end{code} @@ -58,7 +57,7 @@ Alternatively, we could let `X` be the product of all algebras in the class ` \begin{code} module FreeHom (χ : Level){α ρᵃ ℓ : Level} - {𝒦 : Pred(SetoidAlgebra α ρᵃ) (α ⊔ ρᵃ ⊔ ov ℓ)} where + {𝒦 : Pred(Algebra α ρᵃ) (α ⊔ ρᵃ ⊔ ov ℓ)} where private ι = ov(χ ⊔ α ⊔ ρᵃ ⊔ ℓ) @@ -94,10 +93,10 @@ Next we define an epimorphism from `𝑻 X` onto the relatively free algebra ` epi𝔽[_] : (X : Type χ) → epi (𝑻 X) 𝔽[ X ] epi𝔽[ X ] = h , hepi where - open SetoidAlgebra 𝔽[ X ] using () renaming ( Domain to F ; Interp to InterpF ) + open Algebra 𝔽[ X ] using () renaming ( Domain to F ; Interp to InterpF ) open Setoid F using () renaming ( _≈_ to _≈F≈_ ; refl to reflF ) - open SetoidAlgebra (𝑻 X) using () renaming (Domain to TX) + open Algebra (𝑻 X) using () renaming (Domain to TX) open Setoid TX using () renaming ( _≈_ to _≈T≈_ ; refl to reflT ) @@ -130,7 +129,7 @@ Next we define an epimorphism from `𝑻 X` onto the relatively free algebra ` (class-models-kernel pKq) vkA x - module _ {X : Type χ} {𝑨 : SetoidAlgebra α ρᵃ}{sA : 𝑨 ∈ S {β = α}{ρᵃ} ℓ 𝒦} where + module _ {X : Type χ} {𝑨 : Algebra α ρᵃ}{sA : 𝑨 ∈ S {β = α}{ρᵃ} ℓ 𝒦} where open Environment 𝑨 using ( Equal ) ker𝔽⊆Equal : ∀{p q} → (p , q) ∈ fkerPred ∣ hom𝔽[ X ] ∣ → Equal p q ker𝔽⊆Equal{p = p}{q} x = S-id1{ℓ = ℓ}{p = p}{q} (ℰ⊢[ X ]▹Th𝒦 x) 𝑨 sA @@ -143,16 +142,16 @@ Next we define an epimorphism from `𝑻 X` onto the relatively free algebra ` ------------------------------------------------------------------------------ module _ {α ρᵃ ℓ : Level} - {𝒦 : Pred(SetoidAlgebra α ρᵃ) (α ⊔ ρᵃ ⊔ ov ℓ)} where + {𝒦 : Pred(Algebra α ρᵃ) (α ⊔ ρᵃ ⊔ ov ℓ)} where private ι = ov(α ⊔ ρᵃ ⊔ ℓ) open IsEpi ; open IsHom - module lower-universe-version {𝑨 : SetoidAlgebra α ρᵃ} where + module lower-universe-version {𝑨 : Algebra α ρᵃ} where open FreeHom α {α}{ρᵃ}{ℓ}{𝒦} open FreeAlgebra {ι = ι}{I = ℐ} ℰ using ( 𝔽[_] ) - open SetoidAlgebra 𝑨 using( Interp ) renaming (Domain to A) + open Algebra 𝑨 using( Interp ) renaming (Domain to A) open Setoid A using ( trans ; sym ; refl ) renaming ( Carrier to ∣A∣ ) 𝔽-ModTh-epi : 𝑨 ∈ Mod (Th (V ℓ ι 𝒦)) → epi 𝔽[ ∣A∣ ] 𝑨 @@ -178,12 +177,12 @@ module _ {α ρᵃ ℓ : Level} module _ -- higher-universe-version -- (HSP theorem needs 𝑨 in higher universe level) - {𝑨 : SetoidAlgebra (α ⊔ ρᵃ ⊔ ℓ) (α ⊔ ρᵃ ⊔ ℓ)} where + {𝑨 : Algebra (α ⊔ ρᵃ ⊔ ℓ) (α ⊔ ρᵃ ⊔ ℓ)} where open FreeHom (α ⊔ ρᵃ ⊔ ℓ) {α}{ρᵃ}{ℓ}{𝒦} open FreeAlgebra {ι = ι}{I = ℐ} ℰ using ( 𝔽[_] ) - open SetoidAlgebra 𝑨 using( Interp ) renaming (Domain to A) + open Algebra 𝑨 using( Interp ) renaming (Domain to A) open Setoid A using ( trans ; sym ; refl ) renaming ( Carrier to ∣A∣ ) 𝔽-ModTh-epi : 𝑨 ∈ Mod (Th (V ℓ ι 𝒦)) @@ -208,8 +207,8 @@ module _ {α ρᵃ ℓ : Level} -------------------------------- -[← Varieties.Func.Closure](Varieties.Func.Closure.html) -[Varieties.Func.HSP](Varieties.Func.HSP.html) +[← Varieties.Setoid.Closure](Varieties.Setoid.Closure.html) +[Varieties.Setoid.HSP](Varieties.Setoid.HSP.html) {% include UALib.Links.md %} diff --git a/src/Varieties/Func/HSP.lagda b/src/Varieties/Setoid/HSP.lagda similarity index 71% rename from src/Varieties/Func/HSP.lagda rename to src/Varieties/Setoid/HSP.lagda index f05686fc..6e84baa0 100644 --- a/src/Varieties/Func/HSP.lagda +++ b/src/Varieties/Setoid/HSP.lagda @@ -1,6 +1,6 @@ --- layout: default -title : "Varieties.Func.HSP module (Agda Universal Algebra Library)" +title : "Varieties.Setoid.HSP module (Agda Universal Algebra Library)" date : "2021-10-16" author: "agda-algebras development team" --- @@ -13,44 +13,44 @@ author: "agda-algebras development team" open import Algebras.Basic using ( 𝓞 ; 𝓥 ; Signature ) -module Varieties.Func.HSP {𝑆 : Signature 𝓞 𝓥} where +module Varieties.Setoid.HSP {𝑆 : Signature 𝓞 𝓥} where -- Imports from Agda and the Agda Standard Library ------------------------------------------------ -open import Agda.Primitive using ( lsuc ) renaming ( Set to Type ) -open import Data.Product using ( _,_ ; Σ-syntax ) - renaming ( proj₁ to fst ; proj₂ to snd ; _×_ to _∧_ ) -open import Function.Bundles using ( Func ) +open import Agda.Primitive using ( lsuc ) renaming ( Set to Type ) +open import Data.Product using ( _,_ ; Σ-syntax ) renaming ( proj₁ to fst ; proj₂ to snd ; _×_ to _∧_ ) +open import Function.Bundles using ( Func ) open import Level -open import Relation.Binary using ( Setoid ) -open import Relation.Unary using ( Pred ; _∈_ ; _⊆_ ) +open import Relation.Binary using ( Setoid ) +open import Relation.Unary using ( Pred ; _∈_ ; _⊆_ ) -- -- Imports from the Agda Universal Algebra Library --------------------------------------------------- -open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) -open import Relations.Func.Discrete using ( fkerPred ) -open import Algebras.Func.Basic {𝑆 = 𝑆} using ( SetoidAlgebra ; ov ; Lift-Alg ) -open import Algebras.Func.Products {𝑆 = 𝑆} using ( ⨅ ) -open import Homomorphisms.Func.Basic {𝑆 = 𝑆} using ( hom ; mon ; IsMon ; IsHom ; epi ; epi→ontohom ) -open import Homomorphisms.Func.Products {𝑆 = 𝑆} using ( ⨅-hom-co ) -open import Homomorphisms.Func.Factor {𝑆 = 𝑆} using ( HomFactor ) -open import Homomorphisms.Func.Isomorphisms {𝑆 = 𝑆} using ( ≅-refl ) -open import Homomorphisms.Func.HomomorphicImages {𝑆 = 𝑆} using ( _IsHomImageOf_ ) -open import Subalgebras.Func.Subalgebras {𝑆 = 𝑆} using ( _≤_ ; mon→≤ ) -open import Terms.Func.Basic {𝑆 = 𝑆} using ( module Environment ; 𝑻 ) -open import Terms.Func.Properties {𝑆 = 𝑆} using ( lift-hom ; free-lift ) -open import Terms.Func.Operations {𝑆 = 𝑆} using ( free-lift-interp ) -open import Varieties.Func.SoundAndComplete {𝑆 = 𝑆} using ( module FreeAlgebra ; _⊫_ ; _≈̇_ - ; _⊢_▹_≈_ ; Mod ; Th ) -open import Varieties.Func.Closure {𝑆 = 𝑆} using ( S ; V ; P ; S-idem ; V-≅-lc ) -open import Varieties.Func.Preservation {𝑆 = 𝑆} using ( S-id2 ; PS⊆SP ) -open import Varieties.Func.FreeAlgebras {𝑆 = 𝑆} using ( module FreeHom ; 𝔽-ModTh-epi-lift ) +open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) +open import Relations.Setoid.Discrete using ( fkerPred ) +open import Algebras.Setoid.Basic {𝑆 = 𝑆} using ( Algebra ; ov ; Lift-Alg ) +open import Algebras.Setoid.Products {𝑆 = 𝑆} using ( ⨅ ) +open import Homomorphisms.Setoid.Basic {𝑆 = 𝑆} using ( hom ; mon ; IsMon ; IsHom ) + using ( epi ; epi→ontohom ) +open import Homomorphisms.Setoid.Products {𝑆 = 𝑆} using ( ⨅-hom-co ) +open import Homomorphisms.Setoid.Factor {𝑆 = 𝑆} using ( HomFactor ) +open import Homomorphisms.Setoid.Isomorphisms {𝑆 = 𝑆} using ( ≅-refl ) +open import Homomorphisms.Setoid.HomomorphicImages {𝑆 = 𝑆} using ( _IsHomImageOf_ ) +open import Subalgebras.Setoid.Subalgebras {𝑆 = 𝑆} using ( _≤_ ; mon→≤ ) +open import Terms.Setoid.Basic {𝑆 = 𝑆} using ( module Environment ; 𝑻 ) +open import Terms.Setoid.Properties {𝑆 = 𝑆} using ( lift-hom ; free-lift ) +open import Terms.Setoid.Operations {𝑆 = 𝑆} using ( free-lift-interp ) +open import Varieties.Setoid.SoundAndComplete {𝑆 = 𝑆} using ( module FreeAlgebra ; _⊫_ ; _≈̇_ ) + using ( _⊢_▹_≈_ ; Mod ; Th ) +open import Varieties.Setoid.Closure {𝑆 = 𝑆} using ( S ; V ; P ; S-idem ; V-≅-lc ) +open import Varieties.Setoid.Preservation {𝑆 = 𝑆} using ( S-id2 ; PS⊆SP ) +open import Varieties.Setoid.FreeAlgebras {𝑆 = 𝑆} using ( module FreeHom ; 𝔽-ModTh-epi-lift ) open Func using ( cong ) renaming ( f to _⟨$⟩_ ) open Setoid using ( Carrier ) -open SetoidAlgebra using ( Domain ) +open Algebra using ( Domain ) open Environment using ( Env ) module _ {α ρᵃ ℓ : Level} - (𝒦 : Pred(SetoidAlgebra α ρᵃ) (α ⊔ ρᵃ ⊔ ov ℓ)) + (𝒦 : Pred(Algebra α ρᵃ) (α ⊔ ρᵃ ⊔ ov ℓ)) {X : Type (α ⊔ ρᵃ ⊔ ℓ)} where private ι = ov(α ⊔ ρᵃ ⊔ ℓ) @@ -67,12 +67,12 @@ assignments of values in the domain `∣ 𝑨 ∣` to variables in `X`. \begin{code} ℑ⁺ : Type ι - ℑ⁺ = Σ[ 𝑨 ∈ (SetoidAlgebra α ρᵃ) ] (𝑨 ∈ S ℓ 𝒦) ∧ (Carrier (Env 𝑨 X)) + ℑ⁺ = Σ[ 𝑨 ∈ (Algebra α ρᵃ) ] (𝑨 ∈ S ℓ 𝒦) ∧ (Carrier (Env 𝑨 X)) - 𝔄⁺ : ℑ⁺ → SetoidAlgebra α ρᵃ + 𝔄⁺ : ℑ⁺ → Algebra α ρᵃ 𝔄⁺ i = ∣ i ∣ - ℭ : SetoidAlgebra ι ι + ℭ : Algebra ι ι ℭ = ⨅ 𝔄⁺ \end{code} @@ -98,7 +98,7 @@ so belongs to `S (P 𝒦)`. → (∀ i → skEqual i {p}{q}) → (p , q) ∈ fkerPred ∣ hom𝔽[ X ] ∣ AllEqual⊆ker𝔽 {p} {q} x = Goal where - open SetoidAlgebra 𝔽[ X ] using () renaming ( Domain to F ; Interp to InterpF ) + open Algebra 𝔽[ X ] using () renaming ( Domain to F ; Interp to InterpF ) open Setoid F using () renaming ( _≈_ to _≈F≈_ ; refl to reflF ) S𝒦⊫pq : S{β = α}{ρᵃ} ℓ 𝒦 ⊫ (p ≈̇ q) S𝒦⊫pq 𝑨 sA ρ = x (𝑨 , sA , ρ) @@ -111,7 +111,7 @@ so belongs to `S (P 𝒦)`. h : ∀ i → hom (𝑻 X) (𝔄⁺ i) h i = lift-hom (snd ∥ i ∥) - open SetoidAlgebra 𝔽[ X ] using () renaming ( Domain to F ; Interp to InterpF ) + open Algebra 𝔽[ X ] using () renaming ( Domain to F ; Interp to InterpF ) open Setoid F using () renaming (refl to reflF ; _≈_ to _≈F≈_ ; Carrier to ∣F∣) @@ -189,7 +189,7 @@ Finally, we are in a position to prove Birkhoff's celebrated variety theorem. \begin{code} module _ {α ρᵃ ℓ : Level} - {𝒦 : Pred(SetoidAlgebra α ρᵃ) (α ⊔ ρᵃ ⊔ ov ℓ)} where + {𝒦 : Pred(Algebra α ρᵃ) (α ⊔ ρᵃ ⊔ ov ℓ)} where private ι = ov(α ⊔ ρᵃ ⊔ ℓ) @@ -220,7 +220,7 @@ that we formalize this inclusion as well, however trivial the proof. \begin{code} - module _ {𝑨 : SetoidAlgebra α ρᵃ} where + module _ {𝑨 : Algebra α ρᵃ} where open Setoid (Domain 𝑨) using () renaming ( Carrier to ∣A∣ ) Birkhoff-converse : 𝑨 ∈ V{α}{ρᵃ}{α}{ρᵃ}{α}{ρᵃ} ℓ ι 𝒦 → 𝑨 ∈ Mod{X = ∣A∣} (Th (V ℓ ι 𝒦)) @@ -232,14 +232,14 @@ We have thus proved that every variety is an equational class. Readers familiar with the classical formulation of the Birkhoff HSP theorem as an "if and only if" assertion might worry that the proof is still incomplete. However, -recall that in the [Varieties.Func.Preservation][] module we proved the following +recall that in the [Varieties.Setoid.Preservation][] module we proved the following identity preservation lemma: `V-id1 : 𝒦 ⊫ p ≈̇ q → V 𝒦 ⊫ p ≈̇ q` Thus, if `𝒦` is an equational class---that is, if 𝒦 is the class of algebras satisfying all identities in some set---then `V 𝒦` ⊆ 𝒦`. On the other hand, we -proved that `V` is expansive in the [Varieties.Func.Closure][] module: +proved that `V` is expansive in the [Varieties.Setoid.Closure][] module: `V-expa : 𝒦 ⊆ V 𝒦` @@ -252,7 +252,7 @@ This completes the formal proof of Birkhoff's variety theorem. -------------------------------- -[← Varieties.Func.FreeAlgebras](Varieties.Func.FreeAlgebras.html) +[← Varieties.Setoid.FreeAlgebras](Varieties.Setoid.FreeAlgebras.html) [Structures →](Structures.html) {% include UALib.Links.md %} diff --git a/src/Varieties/Func/Preservation.lagda b/src/Varieties/Setoid/Preservation.lagda similarity index 78% rename from src/Varieties/Func/Preservation.lagda rename to src/Varieties/Setoid/Preservation.lagda index b6f22a0a..172f17c8 100644 --- a/src/Varieties/Func/Preservation.lagda +++ b/src/Varieties/Setoid/Preservation.lagda @@ -1,13 +1,13 @@ --- layout: default -title : "Varieties.Func.Preservation (The Agda Universal Algebra Library)" +title : "Varieties.Setoid.Preservation (The Agda Universal Algebra Library)" date : "2021-09-24" author: "agda-algebras development team" --- ### Equation preservation for setoid algebras -This is the [Varieties.Func.Preservation][] module of the [Agda Universal Algebra Library][] where we show +This is the [Varieties.Setoid.Preservation][] module of the [Agda Universal Algebra Library][] where we show that the classes \af H \ab{𝒦}, \af S \ab{𝒦}, \af P \ab{𝒦}, and \af V \ab{𝒦} all satisfy the same identities. @@ -17,7 +17,7 @@ same identities. open import Algebras.Basic using ( 𝓞 ; 𝓥 ; Signature ) -module Varieties.Func.Preservation {𝑆 : Signature 𝓞 𝓥} where +module Varieties.Setoid.Preservation {𝑆 : Signature 𝓞 𝓥} where -- Imports from Agda and the Agda Standard Library ----------------------------------------------- open import Agda.Primitive using ( Level ; _⊔_ ; lsuc ) renaming ( Set to Type ) @@ -31,24 +31,24 @@ import Relation.Binary.Reasoning.Setoid as SetoidReasoning -- Imports from the Agda Universal Algebra Library --------------------------------------------- open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) -open import Overture.Func.Surjective using ( IsSurjective ; SurjInv ; SurjInvIsInverseʳ ) -open import Algebras.Func.Basic {𝑆 = 𝑆} using ( SetoidAlgebra ; ov ; 𝕌[_] ; Lift-Alg ) -open import Algebras.Func.Products {𝑆 = 𝑆} using ( ⨅ ) -open import Homomorphisms.Func.Basic {𝑆 = 𝑆} using ( hom ) -open import Homomorphisms.Func.Isomorphisms {𝑆 = 𝑆} using ( ≅⨅⁺-refl ; ≅-refl ; ≅-sym ; _≅_ ; ≅-trans ; Lift-≅ ) -open import Homomorphisms.Func.HomomorphicImages {𝑆 = 𝑆} using ( IdHomImage ) +open import Overture.Setoid.Surjective using ( IsSurjective ; SurjInv ; SurjInvIsInverseʳ ) +open import Algebras.Setoid.Basic {𝑆 = 𝑆} using ( Algebra ; ov ; 𝕌[_] ; Lift-Alg ) +open import Algebras.Setoid.Products {𝑆 = 𝑆} using ( ⨅ ) +open import Homomorphisms.Setoid.Basic {𝑆 = 𝑆} using ( hom ) +open import Homomorphisms.Setoid.Isomorphisms {𝑆 = 𝑆} using ( ≅⨅⁺-refl ; ≅-refl ; ≅-sym ; _≅_ ; ≅-trans ; Lift-≅ ) +open import Homomorphisms.Setoid.HomomorphicImages {𝑆 = 𝑆} using ( IdHomImage ) open import Terms.Basic {𝑆 = 𝑆} using ( Term ) -open import Terms.Func.Basic {𝑆 = 𝑆} using ( module Environment) -open import Terms.Func.Operations {𝑆 = 𝑆} using ( comm-hom-term ) -open import Subalgebras.Func.Subalgebras {𝑆 = 𝑆} using ( _≤_ ; _≤c_ ) -open import Subalgebras.Func.Properties {𝑆 = 𝑆} using ( ⨅-≤ ; ≅-trans-≤ ; ≤-reflexive ) -open import Varieties.Func.Closure {𝑆 = 𝑆} using ( H ; S ; P ; V ; S-expa ; H-expa ; P-expa +open import Terms.Setoid.Basic {𝑆 = 𝑆} using ( module Environment) +open import Terms.Setoid.Operations {𝑆 = 𝑆} using ( comm-hom-term ) +open import Subalgebras.Setoid.Subalgebras {𝑆 = 𝑆} using ( _≤_ ; _≤c_ ) +open import Subalgebras.Setoid.Properties {𝑆 = 𝑆} using ( ⨅-≤ ; ≅-trans-≤ ; ≤-reflexive ) +open import Varieties.Setoid.Closure {𝑆 = 𝑆} using ( H ; S ; P ; V ; S-expa ; H-expa ; P-expa ; V-expa ; Level-closure ) -open import Varieties.Func.Properties {𝑆 = 𝑆} using ( ⊧-H-invar ; ⊧-S-invar ; ⊧-P-invar ; ⊧-I-invar ) -open import Varieties.Func.SoundAndComplete {𝑆 = 𝑆} using ( _⊧_ ; _⊨_ ; _⊫_ ; Eq ; _≈̇_ ; lhs ; rhs ; _⊢_▹_≈_ ; Th) +open import Varieties.Setoid.Properties {𝑆 = 𝑆} using ( ⊧-H-invar ; ⊧-S-invar ; ⊧-P-invar ; ⊧-I-invar ) +open import Varieties.Setoid.SoundAndComplete {𝑆 = 𝑆} using ( _⊧_ ; _⊨_ ; _⊫_ ; Eq ; _≈̇_ ; lhs ; rhs ; _⊢_▹_≈_ ; Th) open Func using ( cong ) renaming ( f to _⟨$⟩_ ) -open SetoidAlgebra using ( Domain ) +open Algebra using ( Domain ) \end{code} @@ -62,7 +62,7 @@ The next lemma would be too obvious to care about were it not for the fact that \begin{code} -module _ {α ρᵃ ℓ : Level}{𝒦 : Pred(SetoidAlgebra α ρᵃ) (α ⊔ ρᵃ ⊔ ov ℓ)} where +module _ {α ρᵃ ℓ : Level}{𝒦 : Pred(Algebra α ρᵃ) (α ⊔ ρᵃ ⊔ ov ℓ)} where private a = α ⊔ ρᵃ @@ -110,7 +110,7 @@ Finally, we are in a position to prove that a product of subalgebras of algebras PS⊆SP {𝑩} (I , ( 𝒜 , sA , B≅⨅A )) = Goal where - ℬ : I → SetoidAlgebra α ρᵃ + ℬ : I → Algebra α ρᵃ ℬ i = ∣ sA i ∣ kB : (i : I) → ℬ i ∈ 𝒦 kB i = fst ∥ sA i ∥ @@ -128,7 +128,7 @@ First we prove that the closure operator H is compatible with identities that ho \begin{code} module _ {α ρᵃ ℓ χ : Level} - {𝒦 : Pred(SetoidAlgebra α ρᵃ) (α ⊔ ρᵃ ⊔ ov ℓ)} + {𝒦 : Pred(Algebra α ρᵃ) (α ⊔ ρᵃ ⊔ ov ℓ)} {X : Type χ} {p q : Term X} where @@ -188,7 +188,7 @@ Finally, we prove the analogous preservation lemmas for the closure operator `V` \begin{code} module _ {α ρᵃ ℓ ι χ : Level} - {𝒦 : Pred(SetoidAlgebra α ρᵃ) (α ⊔ ρᵃ ⊔ ov ℓ)} + {𝒦 : Pred(Algebra α ρᵃ) (α ⊔ ρᵃ ⊔ ov ℓ)} {X : Type χ} {p q : Term X} where @@ -235,8 +235,8 @@ From `V-id1` it follows that if 𝒦 is a class of structures, then the set of i ---------------------------- -[← Varieties.Func.Properties](Varieties.Func.Properties.html) -[Varieties.Func.FreeAlgebras →](Varieties.Func.FreeAlgebras.html) +[← Varieties.Setoid.Properties](Varieties.Setoid.Properties.html) +[Varieties.Setoid.FreeAlgebras →](Varieties.Setoid.FreeAlgebras.html) {% include UALib.Links.md %} diff --git a/src/Varieties/Func/Properties.lagda b/src/Varieties/Setoid/Properties.lagda similarity index 76% rename from src/Varieties/Func/Properties.lagda rename to src/Varieties/Setoid/Properties.lagda index 4ac675f0..15e7462a 100644 --- a/src/Varieties/Func/Properties.lagda +++ b/src/Varieties/Setoid/Properties.lagda @@ -1,6 +1,6 @@ --- layout: default -title : "Varieties.Func.Properties module (The Agda Universal Algebra Library)" +title : "Varieties.Setoid.Properties module (The Agda Universal Algebra Library)" date : "2021-09-24" author: "agda-algebras development team" --- @@ -22,37 +22,39 @@ We prove some closure and invariance properties of the relation `⊧`. In parti open import Algebras.Basic using ( 𝓞 ; 𝓥 ; Signature ) -module Varieties.Func.Properties {𝑆 : Signature 𝓞 𝓥} where +module Varieties.Setoid.Properties {𝑆 : Signature 𝓞 𝓥} where -- Imports from Agda and the Agda Standard Library ------------------------------------------- -open import Agda.Primitive using ( Level ; _⊔_ ) renaming ( Set to Type ) -open import Data.Product using ( _,_ ) -open import Function.Base using ( _∘_ ) -open import Function.Bundles using ( Func ) -open import Relation.Binary using ( Setoid ) -open import Relation.Unary using ( Pred ; _∈_ ) +open import Agda.Primitive using ( Level ; _⊔_ ) renaming ( Set to Type ) +open import Data.Product using ( _,_ ) +open import Function.Base using ( _∘_ ) +open import Function.Bundles using ( Func ) +open import Relation.Binary using ( Setoid ) +open import Relation.Unary using ( Pred ; _∈_ ) import Relation.Binary.Reasoning.Setoid as SetoidReasoning -- Imports from the Agda Universal Algebra Library --------------------------------------------- -open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) -open import Overture.Func.Inverses using ( InvIsInverseʳ ) -open import Overture.Func.Surjective using ( SurjInv ) -open import Algebras.Func.Basic {𝑆 = 𝑆} using ( SetoidAlgebra ; Lift-Algˡ ; ov ; 𝕌[_] ; 𝔻[_] ) -open import Algebras.Func.Products {𝑆 = 𝑆} using ( ⨅ ) -open import Homomorphisms.Func.Basic {𝑆 = 𝑆} using ( hom ) -open import Homomorphisms.Func.Isomorphisms {𝑆 = 𝑆} using ( _≅_ ; mkiso ; Lift-≅ˡ ; ≅-sym ) -open import Homomorphisms.Func.HomomorphicImages {𝑆 = 𝑆} using ( _IsHomImageOf_ ) -open import Terms.Basic {𝑆 = 𝑆} using ( Term ; ℊ ) -open import Terms.Func.Basic {𝑆 = 𝑆} using ( 𝑻 ; module Environment ) -open import Terms.Func.Operations {𝑆 = 𝑆} using ( comm-hom-term ; interp-prod ; term-agreement ) -open import Subalgebras.Func.Subalgebras {𝑆 = 𝑆} using ( _≤_ ; SubalgebrasOfClass ) -open import Varieties.Func.SoundAndComplete {𝑆 = 𝑆} using ( _⊧_ ; _⊨_ ; _⊫_ ; Eq ; _≈̇_ ; lhs ; rhs ; _⊢_▹_≈_ ) +open import Overture.Preliminaries using ( ∣_∣ ; ∥_∥ ) +open import Overture.Setoid.Inverses using ( InvIsInverseʳ ) +open import Overture.Setoid.Surjective using ( SurjInv ) +open import Algebras.Setoid.Basic {𝑆 = 𝑆} using ( Algebra ; Lift-Algˡ ; ov ; 𝕌[_] ; 𝔻[_] ) +open import Algebras.Setoid.Products {𝑆 = 𝑆} using ( ⨅ ) +open import Homomorphisms.Setoid.Basic {𝑆 = 𝑆} using ( hom ) +open import Homomorphisms.Setoid.Isomorphisms {𝑆 = 𝑆} using ( _≅_ ; mkiso ; Lift-≅ˡ ; ≅-sym ) +open import Homomorphisms.Setoid.HomomorphicImages {𝑆 = 𝑆} using ( _IsHomImageOf_ ) +open import Terms.Basic {𝑆 = 𝑆} using ( Term ; ℊ ) +open import Terms.Setoid.Basic {𝑆 = 𝑆} using ( 𝑻 ; module Environment ) +open import Terms.Setoid.Operations {𝑆 = 𝑆} using ( comm-hom-term ; interp-prod ) + using ( term-agreement ) +open import Subalgebras.Setoid.Subalgebras {𝑆 = 𝑆} using ( _≤_ ; SubalgebrasOfClass ) +open import Varieties.Setoid.SoundAndComplete {𝑆 = 𝑆} using ( _⊧_ ; _⊨_ ; _⊫_ ; Eq ; _≈̇_ ) + using ( lhs ; rhs ; _⊢_▹_≈_ ) private variable α ρᵃ β ρᵇ χ ℓ : Level open Func using ( cong ) renaming (f to _⟨$⟩_ ) -open SetoidAlgebra using ( Domain ) +open Algebra using ( Domain ) \end{code} @@ -64,8 +66,8 @@ The binary relation ⊧ would be practically useless if it were not an *algebrai \begin{code} -module _ {X : Type χ}{𝑨 : SetoidAlgebra α ρᵃ} - (𝑩 : SetoidAlgebra β ρᵇ)(p q : Term X) where +module _ {X : Type χ}{𝑨 : Algebra α ρᵃ} + (𝑩 : Algebra β ρᵇ)(p q : Term X) where open Environment 𝑨 using () renaming ( ⟦_⟧ to ⟦_⟧₁ ) open Environment 𝑩 using () renaming ( ⟦_⟧ to ⟦_⟧₂ ) open Setoid (Domain 𝑨) using () renaming ( _≈_ to _≈₁_ ) @@ -93,8 +95,8 @@ The ⊧ relation is also invariant under the algebraic lift and lower operations \begin{code} --- module _ (wd : SwellDef){α β χ : Level}{X : Type χ}{𝑨 : SetoidAlgebra α ρᵃ} where -module _ {X : Type χ}{𝑨 : SetoidAlgebra α ρᵃ} where +-- module _ (wd : SwellDef){α β χ : Level}{X : Type χ}{𝑨 : Algebra α ρᵃ} where +module _ {X : Type χ}{𝑨 : Algebra α ρᵃ} where ⊧-Lift-invar : (p q : Term X) → 𝑨 ⊧ (p ≈̇ q) → Lift-Algˡ 𝑨 β ⊧ (p ≈̇ q) ⊧-Lift-invar p q Apq = ⊧-I-invar (Lift-Algˡ 𝑨 _) p q Apq Lift-≅ˡ @@ -111,7 +113,7 @@ Identities modeled by an algebra `𝑨` are also modeled by every homomorphic im \begin{code} -module _ {X : Type χ}{𝑨 : SetoidAlgebra α ρᵃ}{𝑩 : SetoidAlgebra β ρᵇ}{p q : Term X} where +module _ {X : Type χ}{𝑨 : Algebra α ρᵃ}{𝑩 : Algebra β ρᵇ}{p q : Term X} where ⊧-H-invar : 𝑨 ⊧ (p ≈̇ q) → 𝑩 IsHomImageOf 𝑨 → 𝑩 ⊧ (p ≈̇ q) ⊧-H-invar Apq (φh , φE) ρ = @@ -137,8 +139,8 @@ Identities modeled by an algebra `𝑨` are also modeled by every subalgebra of \begin{code} -module _ {X : Type χ}{p q : Term X}{𝑨 : SetoidAlgebra α ρᵃ} - {𝑩 : SetoidAlgebra β ρᵇ} where +module _ {X : Type χ}{p q : Term X}{𝑨 : Algebra α ρᵃ} + {𝑩 : Algebra β ρᵇ} where open Environment 𝑨 using () renaming ( ⟦_⟧ to ⟦_⟧₁ ) open Environment 𝑩 using () renaming ( ⟦_⟧ to ⟦_⟧₂ ) open Setoid (Domain 𝑨) using ( _≈_ ) @@ -169,7 +171,7 @@ Next, identities modeled by a class of algebras is also modeled by all subalgebr \begin{code} module _ {X : Type χ}{p q : Term X} where - ⊧-S-class-invar : {𝒦 : Pred (SetoidAlgebra α ρᵃ) ℓ} + ⊧-S-class-invar : {𝒦 : Pred (Algebra α ρᵃ) ℓ} → (𝒦 ⊫ (p ≈̇ q)) → ((𝑩 , _) : SubalgebrasOfClass 𝒦 {β}{ρᵇ}) → 𝑩 ⊧ (p ≈̇ q) ⊧-S-class-invar Kpq (𝑩 , 𝑨 , kA , B≤A) = ⊧-S-invar{p = p}{q} (Kpq 𝑨 kA) B≤A @@ -184,12 +186,12 @@ An identity satisfied by all algebras in an indexed collection is also satisfied \begin{code} -module _ {X : Type χ}{p q : Term X}{I : Type ℓ}(𝒜 : I → SetoidAlgebra α ρᵃ) where +module _ {X : Type χ}{p q : Term X}{I : Type ℓ}(𝒜 : I → Algebra α ρᵃ) where ⊧-P-invar : (∀ i → 𝒜 i ⊧ (p ≈̇ q)) → ⨅ 𝒜 ⊧ (p ≈̇ q) ⊧-P-invar 𝒜pq a = goal where - open SetoidAlgebra (⨅ 𝒜) using () renaming ( Domain to ⨅A ) + open Algebra (⨅ 𝒜) using () renaming ( Domain to ⨅A ) open Environment (⨅ 𝒜) using () renaming ( ⟦_⟧ to ⟦_⟧₁ ) open Environment using ( ⟦_⟧ ) open Setoid ⨅A using ( _≈_ ) @@ -210,7 +212,7 @@ An identity satisfied by all algebras in a class is also satisfied by the produc \begin{code} - ⊧-P-class-invar : (𝒦 : Pred (SetoidAlgebra α ρᵃ)(ov α)) + ⊧-P-class-invar : (𝒦 : Pred (Algebra α ρᵃ)(ov α)) → 𝒦 ⊫ (p ≈̇ q) → (∀ i → 𝒜 i ∈ 𝒦) → ⨅ 𝒜 ⊧ (p ≈̇ q) ⊧-P-class-invar 𝒦 σ K𝒜 = ⊧-P-invar (λ i ρ → σ (𝒜 i) (K𝒜 i) ρ) @@ -237,7 +239,7 @@ If an algebra 𝑨 models an identity (p ≈̇ q), then the pair (p , q) belongs \begin{code} -module _ {X : Type χ}{p q : Term X}{𝑨 : SetoidAlgebra α ρᵃ}(φh : hom (𝑻 X) 𝑨) where +module _ {X : Type χ}{p q : Term X}{𝑨 : Algebra α ρᵃ}(φh : hom (𝑻 X) 𝑨) where open Setoid (Domain 𝑨) using ( _≈_ ) private φ = _⟨$⟩_ ∣ φh ∣ @@ -260,7 +262,7 @@ module _ {X : Type χ}{p q : Term X}{𝑨 : SetoidAlgebra α ρᵃ}(φh : hom ( --------------------------------- -[← Varieties.Func.Closure](Varieties.Func.Closure.html) -[Varieties.Func.Preservation →](Varieties.Func.Preservation.html) +[← Varieties.Setoid.Closure](Varieties.Setoid.Closure.html) +[Varieties.Setoid.Preservation →](Varieties.Setoid.Preservation.html) {% include UALib.Links.md %} diff --git a/src/Varieties/Func/SoundAndComplete.lagda b/src/Varieties/Setoid/SoundAndComplete.lagda similarity index 85% rename from src/Varieties/Func/SoundAndComplete.lagda rename to src/Varieties/Setoid/SoundAndComplete.lagda index b209b822..9eabaad8 100644 --- a/src/Varieties/Func/SoundAndComplete.lagda +++ b/src/Varieties/Setoid/SoundAndComplete.lagda @@ -1,13 +1,13 @@ --- layout: default -title : "Varieties.Func.SoundAndComplete module (The Agda Universal Algebra Library)" +title : "Varieties.Setoid.SoundAndComplete module (The Agda Universal Algebra Library)" date : "2021-01-14" author: "agda-algebras development team" --- #### Entailment, derivation rules, soundness and completeness -This is the [Varieties.Func.SoundAndComplete][] module of the [Agda Universal Algebra Library][]. +This is the [Varieties.Setoid.SoundAndComplete][] module of the [Agda Universal Algebra Library][]. This module is based on [Andreas Abel's Agda formalization of Birkhoff's completeness theorem](http://www.cse.chalmers.se/~abela/agda/MultiSortedAlgebra.pdf). @@ -17,7 +17,7 @@ This module is based on [Andreas Abel's Agda formalization of Birkhoff's complet open import Algebras.Basic using ( 𝓞 ; 𝓥 ; Signature ) -module Varieties.Func.SoundAndComplete {𝑆 : Signature 𝓞 𝓥} where +module Varieties.Setoid.SoundAndComplete {𝑆 : Signature 𝓞 𝓥} where -- imports from Agda and the Agda Standard Library ------------------------------------------- open import Agda.Primitive using ( _⊔_ ; lsuc ; Level ) renaming ( Set to Type ) @@ -31,9 +31,9 @@ import Relation.Binary.Reasoning.Setoid as SetoidReasoning -- Imports from the Agda Universal Algebra Library --------------------------------------------- open import Overture.Preliminaries using ( ∣_∣ ) -open import Algebras.Func.Basic {𝑆 = 𝑆} using ( SetoidAlgebra ; ov ) renaming ( ⟦_⟧ to ⟦_⟧s ) +open import Algebras.Setoid.Basic {𝑆 = 𝑆} using ( Algebra ; ov ) renaming ( ⟦_⟧ to ⟦_⟧s ) open import Terms.Basic {𝑆 = 𝑆} using ( Term ) -open import Terms.Func.Basic {𝑆 = 𝑆} using ( module Environment ; Sub ; _[_] ) +open import Terms.Setoid.Basic {𝑆 = 𝑆} using ( module Environment ; Sub ; _[_] ) open Setoid using ( Carrier ; _≈_ ; isEquivalence ) open Func renaming ( f to _⟨$⟩_ ) @@ -57,10 +57,10 @@ record Eq : Type (ov χ) where open Eq public -- Equation p ≈̇ q holding in algebra M. (type \~~\^. to get ≈̇; type \models to get ⊧) -_⊧_ : (𝑨 : SetoidAlgebra α ρᵃ)(term-identity : Eq{χ}) → Type _ +_⊧_ : (𝑨 : Algebra α ρᵃ)(term-identity : Eq{χ}) → Type _ 𝑨 ⊧ (p ≈̇ q) = Equal p q where open Environment 𝑨 -_⊫_ : Pred (SetoidAlgebra α ρᵃ) ℓ → Eq{χ} → Type (ℓ ⊔ χ ⊔ ov(α ⊔ ρᵃ)) +_⊫_ : Pred (Algebra α ρᵃ) ℓ → Eq{χ} → Type (ℓ ⊔ χ ⊔ ov(α ⊔ ρᵃ)) 𝒦 ⊫ eq = ∀ 𝑨 → 𝒦 𝑨 → 𝑨 ⊧ eq -- (type \||= to get ⊫) -- An I-indexed set of equations inhabits the type I → Eq. @@ -68,23 +68,23 @@ _⊫_ : Pred (SetoidAlgebra α ρᵃ) ℓ → Eq{χ} → Type (ℓ ⊔ χ ⊔ ov -- For such `ℰ : I → Eq`... -- ...`𝑨 ⊨ ℰ` is the assertion that the algebra 𝑨 models every equation in ℰ. -_⊨_ : (𝑨 : SetoidAlgebra α ρᵃ) → (I → Eq{χ}) → Type _ +_⊨_ : (𝑨 : Algebra α ρᵃ) → (I → Eq{χ}) → Type _ 𝑨 ⊨ ℰ = ∀ i → Equal (lhs (ℰ i))(rhs (ℰ i)) where open Environment 𝑨 -- (type \|= to get ⊨) -- ...`𝒦 ∥≈ ℰ` is the assertion that every algebra in 𝒦 models every equation in ℰ. -_∥≈_ : Pred (SetoidAlgebra α ρᵃ) ℓ → (I → Eq{χ}) → Type _ +_∥≈_ : Pred (Algebra α ρᵃ) ℓ → (I → Eq{χ}) → Type _ 𝒦 ∥≈ ℰ = ∀ i → 𝒦 ⊫ ℰ i -- ...`Mod ℰ` is the class of algebras that model every equation in ℰ. -ModTuple : (I → Eq{χ}) → Pred(SetoidAlgebra α ρᵃ) _ +ModTuple : (I → Eq{χ}) → Pred(Algebra α ρᵃ) _ ModTuple ℰ = _⊨ ℰ module _ {α ρᵃ ℓ : Level} where - Mod : Pred(Term X × Term X) ℓ → Pred (SetoidAlgebra α ρᵃ) _ -- (𝓞 ⊔ 𝓥 ⊔ lsuc χ ⊔ ℓ ⊔ α ⊔ ρᵃ) + Mod : Pred(Term X × Term X) ℓ → Pred (Algebra α ρᵃ) _ -- (𝓞 ⊔ 𝓥 ⊔ lsuc χ ⊔ ℓ ⊔ α ⊔ ρᵃ) Mod ℰ 𝑨 = ∀ {p q} → (p , q) ∈ ℰ → Equal p q where open Environment 𝑨 - Th : Pred (SetoidAlgebra α ρᵃ) ℓ → Pred(Term X × Term X) _ -- (ℓ ⊔ χ ⊔ ov (α ⊔ ρᵃ)) + Th : Pred (Algebra α ρᵃ) ℓ → Pred(Term X × Term X) _ -- (ℓ ⊔ χ ⊔ ov (α ⊔ ρᵃ)) Th 𝒦 = λ (p , q) → 𝒦 ⊫ (p ≈̇ q) ℑTh : Pred(Term X × Term X) (ℓ ⊔ χ ⊔ ov (α ⊔ ρᵃ)) → Type _ -- (ℓ ⊔ ov (α ⊔ ρᵃ ⊔ χ)) @@ -92,13 +92,13 @@ module _ {α ρᵃ ℓ : Level} where module _ {χ : Level}{X : Type χ} where - ThTuple : (𝒦 : Pred (SetoidAlgebra α ρᵃ) ℓ) → ℑTh{χ = χ} (Th{X = X} 𝒦) → Eq{χ} + ThTuple : (𝒦 : Pred (Algebra α ρᵃ) ℓ) → ℑTh{χ = χ} (Th{X = X} 𝒦) → Eq{χ} ThTuple 𝒦 = λ i → fst ∣ i ∣ ≈̇ snd ∣ i ∣ module _ {α}{ρᵃ}{ι}{I : Type ι} where -- An entailment E ⊃ eq holds iff it holds in all models of E. _⊃_ : (E : I → Eq{χ}) (eq : Eq{χ}) → Type _ - E ⊃ eq = (M : SetoidAlgebra α ρᵃ) → M ⊨ E → M ⊧ eq + E ⊃ eq = (M : Algebra α ρᵃ) → M ⊨ E → M ⊧ eq \end{code} @@ -134,10 +134,10 @@ module _ {χ ι : Level} where \begin{code} module Soundness {χ α ι : Level}{I : Type ι} (E : I → Eq{χ}) - (𝑨 : SetoidAlgebra α ρᵃ) -- We assume an algebra M + (𝑨 : Algebra α ρᵃ) -- We assume an algebra M (V : 𝑨 ⊨ E) -- that models all equations in E. where - open SetoidAlgebra 𝑨 using ( Interp ) renaming (Domain to A) + open Algebra 𝑨 using ( Interp ) renaming (Domain to A) -- In any model M that satisfies the equations E, derived equality is actual equality. open SetoidReasoning A @@ -185,7 +185,7 @@ We denote by `𝔽[ X ]` the *relatively free algebra* over `X` (relative to `E` \begin{code} module FreeAlgebra {χ : Level}{ι : Level}{I : Type ι}(E : I → Eq) where - open SetoidAlgebra + open Algebra -- Domain of the relatively free algebra. FreeDomain : Type χ → Setoid _ _ @@ -202,7 +202,7 @@ module FreeAlgebra {χ : Level}{ι : Level}{I : Type ι}(E : I → Eq) where -- The relatively free algebra - 𝔽[_] : Type χ → SetoidAlgebra (ov χ) (ι ⊔ ov χ) + 𝔽[_] : Type χ → Algebra (ov χ) (ι ⊔ ov χ) Domain 𝔽[ X ] = FreeDomain X Interp 𝔽[ X ] = FreeInterp @@ -271,7 +271,7 @@ We are finally ready to formally state and prove Birkhoff's Completeness Theorem -------------------------------- -[↑ Varieties.Func](Varieties.Func.html) -[Varieties.Func.Closure →](Varieties.Func.Closure.html) +[↑ Varieties.Setoid](Varieties.Setoid.html) +[Varieties.Setoid.Closure →](Varieties.Setoid.Closure.html) {% include UALib.Links.md %} diff --git a/src/agda-algebras-everything.lagda b/src/agda-algebras-everything.lagda index 4aea687a..570c7085 100644 --- a/src/agda-algebras-everything.lagda +++ b/src/agda-algebras-everything.lagda @@ -10,164 +10,161 @@ All definitions and theorems in agda-algebras as of 20 Sep 2021. \begin{code} -- OVERTURE ----------------------------------------------------------------------------------------- -open import Overture.Preliminaries using ( ℓ₁ ; ∣_∣ ; ∥_∥ ; _⁻¹ ; _∙_ ; 𝑖𝑑 ; Π ; Π-syntax ; ∃-syntax - ; lift∼lower ; lower∼lift ; _≈_ ; ≡-by-parts ; transport ) +open import Overture.Preliminaries using ( ℓ₁ ; ∣_∣ ; ∥_∥ ; _⁻¹ ; _∙_ ; 𝑖𝑑 ; Π ; Π-syntax ; ∃-syntax ) + using ( lift∼lower ; lower∼lift ; _≈_ ; ≡-by-parts ; transport ) -open import Overture.Inverses using ( Image_∋_ ; Range ; range ; Image⊆Range ; Range⊆Image - ; Imagef∋f ; f∈range ; Inv ; [_]⁻¹ ; InvIsInverseʳ - ; ⁻¹IsInverseʳ ; InvIsInverseˡ ; ⁻¹IsInverseˡ ) +open import Overture.Inverses using ( Image_∋_ ; Range ; range ; Image⊆Range ; Range⊆Image ) + using ( Imagef∋f ; f∈range ; Inv ; [_]⁻¹ ; InvIsInverseʳ ) + using ( ⁻¹IsInverseʳ ; InvIsInverseˡ ; ⁻¹IsInverseˡ ) open import Overture.Injective using ( id-is-injective ; IsInjective ; ∘-injective ) -open import Overture.Surjective using ( IsSurjective ; onto ; IsSurjective→Surjective - ; Surjective→IsSurjective ; SurjInv ; SurjInvIsInverseʳ - ; epic-factor ; epic-factor-intensional ; proj ; update - ; update-id ; proj-is-onto ; projIsOnto ) +open import Overture.Surjective using ( IsSurjective ; onto ; IsSurjective→Surjective ) + using ( Surjective→IsSurjective ; SurjInv ; SurjInvIsInverseʳ ) + using ( epic-factor ; epic-factor-intensional ; proj ; update ) + using ( update-id ; proj-is-onto ; projIsOnto ) -open import Overture.Transformers using ( Bijection ; ∣_∣=∣_∣ ; PointwiseBijection - ; ∣_∣≈∣_∣ ; uncurry₀ ; Curry ; Uncurry ; A×A→B≅A→A→B - ; A→A→Fin2A ; A→A→Fin2A' ; A→A→Fin2A-ptws-agree - ; A×A→Fin2A ; Fin2A→A×A ; Fin2A~A×A ; A×A~Fin2A-ptws - ; A→A~Fin2A-ptws ; Fin2A ; Fin2A≡ ; CurryFin2 - ; UncurryFin2 ; CurryFin2~UncurryFin2 ; CurryFin3 - ; UncurryFin3 ; Fin2A→B-to-A×A→B ; A×A→B-to-Fin2A→B - ; Fin2A→B~A×A→B ) +open import Overture.Transformers using ( Bijection ; ∣_∣=∣_∣ ; PointwiseBijection ; ∣_∣≈∣_∣ ) + using ( Curry ; Uncurry ; A×A→B≅A→A→B ; A→A→Fin2A ; A→A→Fin2A' ) + using ( A→A→Fin2A-ptws-agree ; A×A→Fin2A ; Fin2A→A×A ; uncurry₀ ) + using ( Fin2A~A×A ; A×A~Fin2A-ptws ; A→A~Fin2A-ptws ; CurryFin2 ) + using ( UncurryFin2 ; Fin2A ; Fin2A≡ ; CurryFin2~UncurryFin2 ) + using ( CurryFin3 ; UncurryFin3 ; Fin2A→B-to-A×A→B ) + using ( A×A→B-to-Fin2A→B ; Fin2A→B~A×A→B ) -open import Overture.Func.Preliminaries using ( _∘_ ; 𝑙𝑖𝑓𝑡 ; lift∼lower ; lower∼lift - ; liftFunc ; preserves≈ ) +open import Overture.Setoid.Preliminaries using ( _∘_ ; 𝑙𝑖𝑓𝑡 ; lift∼lower ; lower∼lift ; liftFunc ) -open import Overture.Func.Inverses using ( Img_∋_ ; Image_∋_ ; IsInRange ; Image⊆Range - ; IsInRange→IsInImage ; Imagef∋f ; _range ; _image - ; _preimage ; f∈range ; ⌜_⌝ ; Ran ; RRan - ; _preimage≈image ; Dom ; inv ; Inv ; Inv' ; [_]⁻¹ - ; ⟦_⟧⁻¹ ; invIsInvʳ ; InvIsInverseʳ ; ⁻¹IsInverseʳ - ; InvIsInverseˡ ; ⁻¹IsInverseˡ ) +open import Overture.Setoid.Inverses using ( Img_∋_ ; Image_∋_ ; IsInRange ; Image⊆Range ) + using ( IsInRange→IsInImage ; Imagef∋f ; _range ; _image ) + using ( _preimage ; f∈range ; ⌜_⌝ ; Ran ; RRan ) + using ( _preimage≈image ; Dom ; inv ; Inv ; Inv' ; [_]⁻¹ ) + using ( ⟦_⟧⁻¹ ; invIsInvʳ ; InvIsInverseʳ ; ⁻¹IsInverseʳ ) + using ( InvIsInverseˡ ; ⁻¹IsInverseˡ ) -open import Overture.Func.Injective using ( IsInjective ; LeftInvPreserves≈ ; module compose - ; ∘-injection ; id-is-injective ) -open compose using ( ∘-injective-func ) +open import Overture.Setoid.Injective using ( IsInjective ; LeftInvPreserves≈ ; module compose ) + using ( ∘-injection ; id-is-injective ) +open compose using ( ∘-injective-bare ) -open import Overture.Func.Surjective using ( IsSurjective ; SurjectionIsSurjective ; SurjInv - ; SurjInvIsInverseʳ ; ∘-IsSurjective ; ∘-epic - ; epic-factor ) +open import Overture.Setoid.Surjective using ( IsSurjective ; SurjectionIsSurjective ; SurjInv ) + using ( SurjInvIsInverseʳ ; ∘-IsSurjective ; ∘-epic ) + using ( epic-factor ) -open import Overture.Func.Bijective using ( IsBijective ; BijInv ) +open import Overture.Setoid.Bijective using ( IsBijective ; BijInv ) -- RELATIONS ----------------------------------------------------------------------------------------- -open import Relations.Discrete using (Im_⊆_ ; ker ; kerlift ; ker' ; kernel ; 0[_] - ; _⊑_ ; ⊑-refl ; ⊑-trans ; Op ; π ; eval-rel - ; _preserves_ ; _|:_ ; compatibility-agreement - ; compatibility-agreement' ; arity[_] ) +open import Relations.Discrete using ( Im_⊆_ ; ker ; kerlift ; ker' ; kernel ; 0[_] ) + using ( _⊑_ ; ⊑-refl ; ⊑-trans ; Op ; π ; eval-rel ) + using ( _preserves_ ; _|:_ ; compatibility-agreement ) + using ( compatibility-agreement' ; arity[_] ) -open import Relations.Continuous using ( ar ; Rel ; Rel-syntax ; ΠΡ ; ΠΡ-syntax ; eval-Rel - ; compatible-Rel ; eval-ΠΡ ; compatible-ΠΡ ) +open import Relations.Continuous using ( ar ; Rel ; Rel-syntax ; ΠΡ ; ΠΡ-syntax ; eval-Rel ) + using ( compatible-Rel ; eval-ΠΡ ; compatible-ΠΡ ) -open import Relations.Quotients using ( Equivalence ; ker-IsEquivalence ; kerlift-IsEquivalence - ; [_] ; [_/_] ; Block ; IsBlock ; Quotient ; _/_ ; ⟪_⟫ - ; ⌞_⌟ ; []-⊆ ; []-⊇ ; ⊆-[] ; ⊇-[] ; 0[_]IsEquivalence - ; 0[_]Equivalence ; ⟪_∼_⟫-elim ; ≡→⊆ ) +open import Relations.Quotients using ( Equivalence ; ker-IsEquivalence ; kerlift-IsEquivalence ) + using ( [_] ; [_/_] ; Block ; IsBlock ; Quotient ; _/_ ; ⟪_⟫ ) + using ( ⌞_⌟ ; []-⊆ ; []-⊇ ; ⊆-[] ; ⊇-[] ; 0[_]IsEquivalence ) + using ( 0[_]Equivalence ; ⟪_∼_⟫-elim ; ≡→⊆ ) -- EQUALITY ----------------------------------------------------------------------------------------- -open import Equality.Welldefined using ( welldef ; swelldef ; funext→swelldef ; SwellDef - ; swelldef' ; funext' ; funext'→swelldef' - ; swelldef'→funext' ; A×A-wd ; Fin2-wd - ; Fin3-wd ; ListA→B ; CurryListA ; CurryListA' ) +open import Equality.Welldefined using ( welldef ; swelldef ; funext→swelldef ; SwellDef ) + using ( swelldef' ; funext' ; funext'→swelldef' ) + using ( swelldef'→funext' ; A×A-wd ; Fin2-wd ) + using ( Fin3-wd ; ListA→B ; CurryListA ; CurryListA' ) -open import Equality.Truncation using ( is-center ; is-singleton ; is-prop ; is-prop-valued ; fiber - ; singleton-is-prop ; is-equiv ; hfunext ; is-set ; to-Σ-≡ - ; is-embedding ; singleton-type ; invertible ; blk-uip - ; equiv-is-embedding ; monic-is-embedding|Set ; IsRelProp - ; RelProp ; RelPropExt ; IsΠΡProp ; ΠΡProp ; ΠΡPropExt ) +open import Equality.Truncation using ( is-center ; is-singleton ; is-prop ; is-prop-valued ; fiber ) + using ( singleton-is-prop ; is-equiv ; hfunext ; is-set ; to-Σ-≡ ) + using ( is-embedding ; singleton-type ; invertible ; blk-uip ) + using ( equiv-is-embedding ; monic-is-embedding|Set ; IsRelProp ) + using ( RelProp ; RelPropExt ; IsΠΡProp ; ΠΡProp ; ΠΡPropExt ) open import Equality.Extensionality using ( DFunExt ; _≐_ ; pred-ext ; block-ext ; block-ext|uip ) -- ADJUNCTION ------------------------------------------------------------------------------- -open import Adjunction.Closure using ( Extensive ; IntersectClosed ; ClosureSystem ; ClOp - ; clop→law⇒ ; clop→law⇐ ; clop←law ) +open import Adjunction.Closure using ( Extensive ; IntersectClosed ; ClosureSystem ; ClOp ) + using ( clop→law⇒ ; clop→law⇐ ; clop←law ) -open import Adjunction.Galois using ( Galois ; _⃗_ ; _⃖_ ; ←→≥id ; →←≥id ; →←→⊆→ ; ←→←⊆← - ; ←→Closed ; →←Closed ; _≐_ ; ≐-iseqv ; PosetOfSubsets - ; 𝒫𝒜 ; 𝒫ℬ ; Rel→Gal ) +open import Adjunction.Galois using ( Galois ; _⃗_ ; _⃖_ ; ←→≥id ; →←≥id ; →←→⊆→ ; ←→←⊆← ) + using ( ←→Closed ; →←Closed ; _≐_ ; ≐-iseqv ; PosetOfSubsets ) + using ( 𝒫𝒜 ; 𝒫ℬ ; Rel→Gal ) open import Adjunction.Residuation using ( Residuation ; weak-inverse ; weak-inverse' ) -- ALGEBRAS ------------------------------------------------------------------------------------------ -open import Algebras.Basic using ( Signature ; compatible ; Algebra ; Level-of-Alg - ; Level-of-Carrier ; algebra ; algebra→Algebra - ; Algebra→algebra ; _̂_ ; Lift-alg-op ; Lift-algebra - ; Lift-Alg ; compatible-Rel-alg ; compatible-ΠΡ-alg ) +open import Algebras.Basic using ( Signature ; compatible ; Algebra ; Level-of-Alg ) + using ( Level-of-Carrier ; algebra ; algebra→Algebra ) + using ( Algebra→algebra ; _̂_ ; Lift-alg-op ; Lift-algebra ) + using ( Lift-Alg ; compatible-Rel-alg ; compatible-ΠΡ-alg ) open import Algebras.Products using ( ⨅ ; ⨅' ; ov ; ℑ ; 𝔄 ; class-product ) -open import Algebras.Congruences using ( IsCongruence ; Con ; IsCongruence→Con - ; Con→IsCongruence ; 0[_]Compatible ; 0Con[_] - ; _╱_ ; 𝟘[_╱_] ; 𝟎[_╱_] ; /-≡ ) +open import Algebras.Congruences using ( IsCongruence ; Con ; IsCongruence→Con ) + using ( Con→IsCongruence ; 0[_]Compatible ; 0Con[_] ) + using ( _╱_ ; 𝟘[_╱_] ; 𝟎[_╱_] ; /-≡ ) -open import Algebras.Func.Basic using ( ov ; EqArgs ; ⟦_⟧ ; SetoidAlgebra ; 𝕌[_] ; 𝔻[_] - ; Level-of-Alg ; Level-of-Carrier ; _̂_ ; Lift-Algˡ - ; Lift-Algʳ ; Lift-Alg ) +open import Algebras.Setoid.Basic using ( ov ; EqArgs ; ⟦_⟧ ; Algebra ; 𝕌[_] ; 𝔻[_] ) + using ( Level-of-Alg ; Level-of-Carrier ; _̂_ ; Lift-Algˡ ) + using ( Lift-Algʳ ; Lift-Alg ) -open import Algebras.Func.Products using ( ⨅ ; ℑ ; 𝔄 ; class-product ; ProjAlgIsOnto ) +open import Algebras.Setoid.Products using ( ⨅ ; ℑ ; 𝔄 ; class-product ; ProjAlgIsOnto ) -open import Algebras.Func.Congruences using ( _∣≈_ ; IsCongruence ; Con ; IsCongruence→Con - ; Con→IsCongruence ; _╱_ ) +open import Algebras.Setoid.Congruences using ( _∣≈_ ; IsCongruence ; Con ; IsCongruence→Con ) + using ( Con→IsCongruence ; _╱_ ) -- HOMOMORPHISMS ------------------------------------------------------------------------------------------ -open import Homomorphisms.Basic using ( compatible-op-map ; is-homomorphism ; hom ; 𝒾𝒹 - ; 𝓁𝒾𝒻𝓉 ; 𝓁ℴ𝓌ℯ𝓇 ; is-monomorphism ; mon - ; is-epimorphism ; epi ; mon→hom ; epi→hom ) +open import Homomorphisms.Basic using ( compatible-op-map ; is-homomorphism ; hom ; 𝒾𝒹 ) + using ( 𝓁𝒾𝒻𝓉 ; 𝓁ℴ𝓌ℯ𝓇 ; is-monomorphism ; mon ) + using ( is-epimorphism ; epi ; mon→hom ; epi→hom ) open import Homomorphisms.Properties using ( ∘-hom ; ∘-is-hom ; Lift-hom ) -open import Homomorphisms.Kernels using ( homker-comp ; kercon ; kerquo ; ker[_⇒_]_↾_ - ; πepi ; πhom ; πker ; ker-in-con ) +open import Homomorphisms.Kernels using ( homker-comp ; kercon ; kerquo ; ker[_⇒_]_↾_ ) + using ( πepi ; πhom ; πker ; ker-in-con ) open import Homomorphisms.Products using ( ⨅-hom-co ; ⨅-hom ; ⨅-projection-hom ) -open import Homomorphisms.Noether using ( FirstHomTheorem|Set ; FirstIsoTheorem|Set - ; FirstHomUnique ; FirstIsoUnique ) +open import Homomorphisms.Noether using ( FirstHomTheorem|Set ; FirstIsoTheorem|Set ) + using ( FirstHomUnique ; FirstIsoUnique ) open import Homomorphisms.Factor using ( HomFactor ; HomFactorEpi ) -open import Homomorphisms.Isomorphisms using ( _≅_ ; ≅-refl ; ≅-sym ; ≅-trans ; Lift-≅ - ; Lift-Alg-iso ; Lift-Alg-assoc - ; Lift-Alg-⨅≅ ; ⨅≅ ) +open import Homomorphisms.Isomorphisms using ( _≅_ ; ≅-refl ; ≅-sym ; ≅-trans ; Lift-≅ ; ⨅≅ ) + using ( Lift-Alg-iso ; Lift-Alg-assoc ; Lift-Alg-⨅≅ ) -open import Homomorphisms.HomomorphicImages using ( _IsHomImageOf_ ; HomImages ; IsHomImageOfClass - ; HomImageOfClass ; Lift-epi-is-epi - ; Lift-Alg-hom-image ) +open import Homomorphisms.HomomorphicImages using ( _IsHomImageOf_ ; HomImages ; IsHomImageOfClass ) + using ( HomImageOfClass ; Lift-epi-is-epi ) + using ( Lift-Alg-hom-image ) -open import Homomorphisms.Func.Basic using ( compatible-map-op ; compatible-map - ; IsHom ; hom ; IsMon ; mon ; mon→hom ; IsEpi - ; epi ; epi→hom ; mon→intohom ; epi→ontohom ) +open import Homomorphisms.Setoid.Basic using ( compatible-map-op ; compatible-map ) + using ( IsHom ; hom ; IsMon ; mon ; mon→hom ; epi→hom ) + using ( mon→intohom ; epi→ontohom ; IsEpi ; epi ) -open import Homomorphisms.Func.Properties using ( 𝒾𝒹 ; ToLiftˡ ; FromLiftˡ ; ToFromLiftˡ ; FromToLiftˡ - ; ToLiftʳ ; FromLiftʳ ; ToFromLiftʳ ; FromToLiftʳ - ; ∘-is-hom ; ∘-hom ; Lift-homˡ ; Lift-homʳ - ; lift-hom-lemma ; Lift-hom ) +open import Homomorphisms.Setoid.Properties using ( ToLiftˡ ; FromLiftˡ ; ToFromLiftˡ ; FromToLiftˡ ) + using ( ToLiftʳ ; FromLiftʳ ; ToFromLiftʳ ; FromToLiftʳ ) + using ( ∘-is-hom ; ∘-hom ; Lift-homˡ ; Lift-homʳ ) + using ( lift-hom-lemma ; Lift-hom ; 𝒾𝒹 ) -open import Homomorphisms.Func.Kernels using ( HomKerComp ; kercon ; kerquo ; ker[_⇒_]_ ; πepi - ; πhom ; πker ; ker-in-con ) +open import Homomorphisms.Setoid.Kernels using ( HomKerComp ; kercon ; kerquo ; ker[_⇒_]_ ) + using ( πhom ; πker ; ker-in-con ; πepi ) -open import Homomorphisms.Func.Products using ( ⨅-hom-co ) +open import Homomorphisms.Setoid.Products using ( ⨅-hom-co ) -open import Homomorphisms.Func.Noether using ( FirstHomTheorem ; FirstHomUnique ) +open import Homomorphisms.Setoid.Noether using ( FirstHomTheorem ; FirstHomUnique ) -open import Homomorphisms.Func.Factor using ( HomFactor ; HomFactorEpi ) +open import Homomorphisms.Setoid.Factor using ( HomFactor ; HomFactorEpi ) -open import Homomorphisms.Func.Isomorphisms using ( _≅_ ; ≅-refl ; ≅-sym ; ≅-trans ; ≅toInjective - ; ≅fromInjective ; Lift-≅ˡ ; Lift-≅ʳ ; Lift-≅ - ; Lift-Alg-isoˡ ; Lift-Alg-isoʳ ; Lift-Alg-iso - ; Lift-assocˡ ; Lift-assocʳ ; Lift-assoc - ; ⨅≅ ; Lift-Alg-⨅≅ˡ ) +open import Homomorphisms.Setoid.Isomorphisms using ( _≅_ ; ≅-refl ; ≅-sym ; ≅-trans ; ≅toInjective ) + using ( ≅fromInjective ; Lift-≅ˡ ; Lift-≅ʳ ; Lift-≅ ) + using ( Lift-Alg-isoˡ ; Lift-Alg-isoʳ ; Lift-Alg-iso ) + using ( Lift-assocˡ ; Lift-assocʳ ; Lift-assoc ) + using ( ⨅≅ ; Lift-Alg-⨅≅ˡ ) -open import Homomorphisms.Func.HomomorphicImages using ( _IsHomImageOf_ ; HomImages ; HomImageOf[_] - ; IsHomImageOfClass ; HomImageOfClass - ; Lift-epi-is-epiˡ ; Lift-Alg-hom-imageˡ ) +open import Homomorphisms.Setoid.HomomorphicImages using ( _IsHomImageOf_ ; HomImages ; HomImageOf[_] ) + using ( IsHomImageOfClass ; HomImageOfClass ) + using ( Lift-epi-is-epiˡ ; Lift-Alg-hom-imageˡ ) @@ -176,201 +173,198 @@ open import Terms.Basic using (Term ; 𝑻 ) open import Terms.Properties using (free-lift ; lift-hom ; free-unique ; lift-of-epi-is-epi ) -open import Terms.Operations using ( _⟦_⟧ ; free-lift-interp ; term-interp - ; term-gen ; term-gen-agreement ; term-agreement - ; interp-prod ; interp-prod2 ; comm-hom-term - ; _∣:_ ; _[_] ; Substerm ; _[_]t ; subst-lemma - ; subst-theorem ) +open import Terms.Operations using ( _⟦_⟧ ; free-lift-interp ; term-interp ) + using ( term-gen ; term-gen-agreement ; term-agreement ) + using ( interp-prod ; interp-prod2 ; comm-hom-term ) + using ( _∣:_ ; _[_] ; Substerm ; _[_]t ; subst-lemma ) + using ( subst-theorem ) -open import Terms.Func.Basic using ( _≐_ ; ≐-isRefl ; ≐-isSym ; ≐-isTrans ; ≐-isEquiv - ; TermSetoid ; 𝑻 ; Sub ; _[_] ; module Environment ) +open import Terms.Setoid.Basic using ( _≐_ ; ≐-isRefl ; ≐-isSym ; ≐-isTrans ; ≐-isEquiv ) + using ( TermSetoid ; 𝑻 ; Sub ; _[_] ; module Environment ) open Environment using ( Env ; ⟦_⟧ ; Equal ; isEquiv ; ⟦_⟧s ; substitution ) -open import Terms.Func.Properties using ( free-lift ; free-lift-of-surj-isSurj ; free-lift-func - ; lift-hom ; lift-of-epi-is-epi ; free-unique ) +open import Terms.Setoid.Properties using ( free-lift ; free-lift-of-surj-isSurj ; free-lift-func ) + using ( lift-hom ; lift-of-epi-is-epi ; free-unique ) -open import Terms.Func.Operations using ( free-lift-interp ; term-interp ; term-agreement - ; interp-prod ; comm-hom-term ; _[_] ; Substerm ; _[_]t ) +open import Terms.Setoid.Operations using ( free-lift-interp ; term-interp ; term-agreement ) + using ( interp-prod ; comm-hom-term ; _[_] ; Substerm ; _[_]t ) -- SUBALGEBRAS ------------------------------------------------------------------------------------------ -open import Subalgebras.Subuniverses using ( Subuniverses ; Subuniverse ; Sg ; sgIsSub - ; sgIsSmallest ; ⋂s ; sub-term-closed - ; TermImage ; TermImageIsSub ; Y-onlyif-TermImageY - ; SgY-onlyif-TermImageY ; hom-unique ) - -open import Subalgebras.Subalgebras using ( _≥_ ; _IsSupalgebraOf_ ; _≤_ ; _IsSubalgebraOf_ - ; SubalgebraOf ; Subalgebra ; FirstHomCorollary|Set - ; free-quot-subalg ; _IsSubalgebraOfClass_ - ; SubalgebraOfClass ) - - -open import Subalgebras.Properties using ( ≤-refl ; ≥-refl ; ≤-reflexive ; ≤-trans ; ≥-trans - ; ≤-preorder ; ≥-preorder ; ≤-resp-≅ ; ≅-resp-≥ - ; ≥-resp-≅ ; ≅-resp-≤ ; ≤-RESP-≅ ; ≥-RESP-≅ ; ≅-RESP-≤ - ; ≅-RESP-≥ ; iso→injective ; ≤-mono ; Lift-is-sub - ; ≤-Lift ; ≥-Lift ; Lift-≤-Lift ) - - -open import Subalgebras.Func.Subuniverses using( Subuniverses ; Subuniverse ; Sg ; sgIsSub - ; sgIsSmallest ; ⋂s ; sub-term-closed - ; TermImage ; TermImageIsSub ; B-onlyif-TermImageB - ; SgB-onlyif-TermImageB ; hom-unique ) - -open import Subalgebras.Func.Subalgebras using ( _≥_ ; _IsSupalgebraOf_ ; _≤_ ; _IsSubalgebraOf_ - ; SubalgebraOf ; Subalgebra ; mon→≤ - ; IsSubalgebraREL ; SubalgebraREL ; _≤c_ - ; _IsSubalgebraOfClass_ ; SubalgebraOfClass - ; SubalgebraOfClass' ; SubalgebrasOfClass ) - -open import Subalgebras.Func.Properties using ( ≅→≤ ; ≅→≥ ; ≤-refl ; ≥-refl ; ≤-reflexive - ; ≤-trans ; ≤-trans-≅ ; ≥-trans ; ≤-preorder - ; A≥B×B≅C→A≥C ; A≤B×B≅C→A≤C ; A≅B×B≥C→A≥C - ; A≅B×B≤C→A≤C ; ≤-mono ; Lift-is-sub ; ≤-Lift - ; ≥-Lift ; Lift-≤-Lift ) +open import Subalgebras.Subuniverses using ( Subuniverses ; Subuniverse ; Sg ; sgIsSub ; ⋂s ) + using ( sgIsSmallest ; sub-term-closed ; TermImage ) + using ( TermImageIsSub ; Y-onlyif-TermImageY ) + using ( SgY-onlyif-TermImageY ; hom-unique ) + +open import Subalgebras.Subalgebras using ( _≥_ ; _IsSupalgebraOf_ ; _≤_ ; _IsSubalgebraOf_ ) + using ( SubalgebraOf ; Subalgebra ; FirstHomCorollary|Set ) + using ( free-quot-subalg ; _IsSubalgebraOfClass_ ) + using ( SubalgebraOfClass ) + +open import Subalgebras.Properties using ( ≤-refl ; ≥-refl ; ≤-reflexive ; ≤-trans ; ≥-trans ) + using ( ≤-preorder ; ≥-preorder ; ≤-resp-≅ ; ≅-resp-≥ ) + using ( ≥-resp-≅ ; ≅-resp-≤ ; ≤-RESP-≅ ; ≥-RESP-≅ ; ≅-RESP-≤ ) + using ( ≅-RESP-≥ ; iso→injective ; ≤-mono ; Lift-is-sub ) + using ( ≤-Lift ; ≥-Lift ; Lift-≤-Lift ) + +open import Subalgebras.Setoid.Subuniverses using ( Subuniverses ; Subuniverse ; Sg ; sgIsSub ; ⋂s ) + using ( sgIsSmallest ; sub-term-closed ; TermImage ) + using ( TermImageIsSub ; B-onlyif-TermImageB ; hom-unique ) + using ( SgB-onlyif-TermImageB ) + +open import Subalgebras.Setoid.Subalgebras using ( _≥_ ; _IsSupalgebraOf_ ; _≤_ ; _IsSubalgebraOf_ ) + using ( SubalgebraOf ; Subalgebra ; IsSubalgebraREL ) + using ( SubalgebraREL ; _IsSubalgebraOfClass_ ; _≤c_ ) + using ( SubalgebraOfClass ; SubalgebraOfClass' ; mon→≤ ) + using ( SubalgebrasOfClass ) + +open import Subalgebras.Setoid.Properties using ( ≅→≤ ; ≅→≥ ; ≤-refl ; ≥-refl ; ≤-reflexive ; ≥-Lift ) + using ( ≤-trans ; ≤-trans-≅ ; ≥-trans ; ≤-preorder ; ≤-mono ) + using ( A≥B×B≅C→A≥C ; A≤B×B≅C→A≤C ; A≅B×B≥C→A≥C ) + using ( A≅B×B≤C→A≤C ; Lift-is-sub ; ≤-Lift ; Lift-≤-Lift ) -- VARIETIES ------------------------------------------------------------------------------------------ open import Varieties.EquationalLogic using ( _⊧_≈_ ; _⊫_≈_ ; Th ; Mod ) -open import Varieties.Closure using ( H ; S ; P ; V ; is-variety ; variety - ; S-mono ; subalgebra→S ; S→subalgebra - ; P-mono ; P-expa ; P-idemp ; Lift-Alg-subP - ; Lift-Alg-subP' ; module Vlift ) - -open import Varieties.Properties using ( ⊧-I-invar ; ⊧-Lift-invar ; ⊧-lower-invar - ; ⊧-S-invar ; ⊧-S-class-invar ; ⊧-P-invar - ; ⊧-P-class-invar ; ⊧-P-lift-invar ; ⊧-H-invar - ; ⊧-H-class-invar ; ⊧-H-class-coinvar ) - -open import Varieties.Preservation using (S⊆SP ; lemPS⊆SP ; PS⊆SP ; P⊆V ; SP⊆V ; SP⊆V' - ; module class-products-with-maps ; H-id1 ; H-id2 - ; S-id1 ; S-id2 ; P-id1 ; P-id2 ; V-id1 - ; module Vid' ; V-id1' ; ovu ; lovu ; 𝕍 ; 𝒱 - ; class-ids-⇒ ; class-ids ; class-ids-⇐ ; V-id2 ) - -open import Varieties.FreeAlgebras using ( 𝓕 ; 𝓕⁺ ; ψ ; ψRel ; ψcompatible ; ψIsEquivalence - ; ψCon ; ℭ ; homℭ ; 𝔽 ; epi𝔽 ; hom𝔽 ; hom𝔽-is-epic - ; ψlemma0 ; ψlemma0-ap ; 𝔽-lift-hom ; X↪𝔽 ; 𝔑 - ; hom𝔽-is-lift-hom ; ψlemma1 ; ψlemma2 ; ψlemma3 - ; class-models-kernel ; 𝕍𝒦 ; kernel-in-theory - ; 𝔽-ModTh-epi ; 𝔽≤ℭ ; 𝔽∈SP ; 𝔽∈𝕍 ; Birkhoff - ; Birkhoff-converse ; _↠_ ) - - -open import Varieties.Func.EquationalLogic using ( _⊧_≈_ ; _⊫_≈_ ; Th ; Th' ; ℐ ; ℰ ; Mod ; Modᵗ ) - -open import Varieties.Func.SoundAndComplete using ( Eq ; _⊨_ ; _⊧_ ; Mod ; _⊫_ ; _⊃_ ; _⊢_▹_≈_ - ; module Soundness ; module FreeAlgebra ) -open Soundness using ( sound ) -open FreeAlgebra using ( FreeDomain ; FreeInterp ; 𝔽[_] ; σ₀ ; identity ; evaluation ; satisfies ; completeness ) - -open import Varieties.Func.Closure using ( Level-closure ; Lift-closed ; H ; S ; P ; SP - ; V ; is-variety ; variety ; S-mono ; S-idem - ; H-expa ; S-expa ; P-mono ; P-expa ; V-expa - ; S-≅ ; V-≅ ; V-≅-lc ; classP ; classSP - ; classHSP ; classS ; classK ; LevelClosure-S - ; S-LevelClosure ; S-Lift-lemma ; P-Lift-closed ) - -open import Varieties.Func.Properties using ( ⊧-I-invar ; ⊧-Lift-invar ; ⊧-lower-invar - ; ⊧-S-invar ; ⊧-S-class-invar ; ⊧-P-invar - ; ⊧-P-class-invar ; ⊧-P-lift-invar ; ⊧-H-invar ) - -open import Varieties.Func.Preservation using ( S⊆SP ; P⊆SP ; P⊆HSP ; P⊆V ; SP⊆V ; PS⊆SP - ; H-id1 ; H-id2 ; S-id1 ; S-id2 ; P-id1 ; P-id2 - ; V-id1 ; V-id2 ; Lift-id1 ; classIds-⊆-VIds - ; VIds-⊆-classIds ) - -open import Varieties.Func.FreeAlgebras using ( module FreeHom ; 𝔽-ModTh-epi ; 𝔽-ModTh-epi-lift ) -open FreeHom using (ℐ ; ℰ ; ℰ⊢[_]▹Th𝒦 ; epi𝔽[_] ; hom𝔽[_] ; hom𝔽[_]-is-epic ; class-models-kernel ; kernel-in-theory ; 𝒦⊫→ℰ⊢ ) - -open import Varieties.Func.HSP using ( ℑ⁺ ; 𝔄⁺ ; ℭ ; skEqual ; AllEqual⊆ker𝔽 ; homℭ - ; ker𝔽⊆kerℭ ; hom𝔽ℭ ; kerℭ⊆ker𝔽 ; mon𝔽ℭ ; 𝔽≤ℭ - ; SP𝔽 ; Birkhoff ; Birkhoff-converse ) +open import Varieties.Closure using ( H ; S ; P ; V ; is-variety ; variety ; S-mono ) + using ( subalgebra→S ; S→subalgebra ; P-mono ; P-expa ) + using ( P-idemp ; Lift-Alg-subP ; Lift-Alg-subP' ; module Vlift ) + +open import Varieties.Properties using ( ⊧-I-invar ; ⊧-Lift-invar ; ⊧-lower-invar ; ⊧-S-invar ) + using ( ⊧-S-class-invar ; ⊧-P-class-invar ; ⊧-P-lift-invar ) + using ( ⊧-P-invar ; ⊧-H-invar ; ⊧-H-class-invar ; ⊧-H-class-coinvar ) + +open import Varieties.Preservation using ( S⊆SP ; lemPS⊆SP ; PS⊆SP ; P⊆V ; SP⊆V ; SP⊆V' ) + using ( module class-products-with-maps ; H-id1 ; H-id2 ) + using ( S-id1 ; S-id2 ; P-id1 ; P-id2 ; V-id1 ) + using ( module Vid' ; V-id1' ; ovu ; lovu ; 𝕍 ; 𝒱 ) + using ( class-ids-⇒ ; class-ids ; class-ids-⇐ ; V-id2 ) + +open import Varieties.FreeAlgebras using ( 𝓕 ; 𝓕⁺ ; ψ ; ψRel ; ψcompatible ; ψIsEquivalence ) + using ( ψCon ; ℭ ; homℭ ; 𝔽 ; epi𝔽 ; hom𝔽 ; hom𝔽-is-epic ) + using ( ψlemma0 ; ψlemma0-ap ; 𝔽-lift-hom ; X↪𝔽 ; 𝔑 ) + using ( hom𝔽-is-lift-hom ; ψlemma1 ; ψlemma2 ; ψlemma3 ) + using ( class-models-kernel ; 𝕍𝒦 ; kernel-in-theory ) + using ( 𝔽-ModTh-epi ; 𝔽≤ℭ ; 𝔽∈SP ; 𝔽∈𝕍 ; Birkhoff ) + using ( Birkhoff-converse ; _↠_ ) + + +open import Varieties.Setoid.EquationalLogic using ( _⊧_≈_ ; _⊫_≈_ ; Th ; Th' ; ℐ ; ℰ ; Mod ; Modᵗ ) + +open import Varieties.Setoid.SoundAndComplete using ( Eq ; _⊨_ ; _⊧_ ; Mod ; _⊫_ ; _⊃_ ; _⊢_▹_≈_ ) + using ( module Soundness ; module FreeAlgebra ) +open Soundness using ( sound ) +open FreeAlgebra using ( FreeDomain ; FreeInterp ; 𝔽[_] ; σ₀ ; identity ; evaluation ; satisfies ) + using ( completeness ) + +open import Varieties.Setoid.Closure using ( Level-closure ; Lift-closed ; H ; S ; P ; SP ) + using ( V ; is-variety ; variety ; S-mono ; S-idem ) + using ( H-expa ; S-expa ; P-mono ; P-expa ; V-expa ) + using ( S-≅ ; V-≅ ; V-≅-lc ; classP ; classSP ) + using ( classHSP ; classS ; classK ; LevelClosure-S ) + using ( S-LevelClosure ; S-Lift-lemma ; P-Lift-closed ) + +open import Varieties.Setoid.Properties using ( ⊧-I-invar ; ⊧-Lift-invar ; ⊧-lower-invar ) + using ( ⊧-S-invar ; ⊧-S-class-invar ; ⊧-P-invar ) + using ( ⊧-P-class-invar ; ⊧-P-lift-invar ; ⊧-H-invar ) + +open import Varieties.Setoid.Preservation using ( S⊆SP ; P⊆SP ; P⊆HSP ; P⊆V ; SP⊆V ; PS⊆SP ) + using ( H-id1 ; H-id2 ; S-id1 ; S-id2 ; P-id1 ; P-id2 ) + using ( V-id1 ; V-id2 ; Lift-id1 ; classIds-⊆-VIds ) + using ( VIds-⊆-classIds ) + +open import Varieties.Setoid.FreeAlgebras using ( module FreeHom ; 𝔽-ModTh-epi ; 𝔽-ModTh-epi-lift ) +open FreeHom using ( ℐ ; ℰ ; ℰ⊢[_]▹Th𝒦 ; epi𝔽[_] ; hom𝔽[_] ) + using ( hom𝔽[_]-is-epic ; class-models-kernel ) + using ( kernel-in-theory ; 𝒦⊫→ℰ⊢ ) + +open import Varieties.Setoid.HSP using ( ℑ⁺ ; 𝔄⁺ ; ℭ ; skEqual ; AllEqual⊆ker𝔽 ; homℭ ) + using ( ker𝔽⊆kerℭ ; hom𝔽ℭ ; kerℭ⊆ker𝔽 ; mon𝔽ℭ ; 𝔽≤ℭ ) + using ( SP𝔽 ; Birkhoff ; Birkhoff-converse ) -- GENERAL STRUCTURES --------------------------------------------------------------------------------- -open import Structures.Basic using ( signature ; structure ; _ʳ_ ; _ᵒ_ ; compatible - ; Lift-op ; Lift-rel ; Lift-Strucˡ ; Lift-Strucʳ - ; Lift-Struc ; siglˡ ; siglʳ ; sigl ) +open import Structures.Basic using ( signature ; structure ; _ʳ_ ; _ᵒ_ ; compatible ) + using ( Lift-op ; Lift-rel ; Lift-Strucˡ ; Lift-Strucʳ ) + using ( Lift-Struc ; siglˡ ; siglʳ ; sigl ) -open import Structures.Graphs using ( Gr-sig ; Gr ; hom→Grhom ; Grhom→hom ) +open import Structures.Graphs using ( Gr-sig ; Gr ; hom→Grhom ; Grhom→hom ) -open import Structures.Graphs0 using ( Gr-sig ; Gr ; hom→Grhom ; Grhom→hom ; _⇛_⇚_ ) +open import Structures.Graphs0 using ( Gr-sig ; Gr ; hom→Grhom ; Grhom→hom ; _⇛_⇚_ ) -open import Structures.Products using ( ⨅ ; ℓp ; ℑ ; 𝔄 ; class-product ) +open import Structures.Products using ( ⨅ ; ℓp ; ℑ ; 𝔄 ; class-product ) -open import Structures.Congruences using ( con ; 0[_]compatible ; 0con[_] ; quotient - ; _╱_ ; /≡-elim ; 𝟎[_╱_] ) +open import Structures.Congruences using ( con ; 0[_]compatible ; 0con[_] ; quotient ) + using ( _╱_ ; /≡-elim ; 𝟎[_╱_] ) -open import Structures.Homs using ( preserves ; is-hom-rel ; comm-op ; is-hom-op - ; is-hom ; hom ; hom-alg ; ∘-is-hom-rel - ; ∘-is-hom-op ; ∘-is-hom ; ∘-hom ; 𝒾𝒹 ; is-mon - ; mon ; mon→hom ; is-epi ; epi ; epi→hom ; 𝓁𝒾𝒻𝓉 - ; 𝓁ℴ𝓌ℯ𝓇 ; 𝓁𝒾𝒻𝓉ˡ ; 𝓁𝒾𝒻𝓉ʳ ; 𝓁ℴ𝓌ℯ𝓇ˡ ; 𝓁ℴ𝓌ℯ𝓇ʳ - ; homker-comp ; kerlift-comp ; kercon ; kerquo - ; ker[_⇒_] ; πepi ; πhom ; πker ; ⨅-hom-co - ; ⨅-hom ; ⨅-projection-hom ) +open import Structures.Homs using ( preserves ; is-hom-rel ; comm-op ; is-hom-op ) + using ( is-hom ; hom ; hom-alg ; ∘-is-hom-rel ) + using ( ∘-is-hom-op ; ∘-is-hom ; ∘-hom ; 𝒾𝒹 ; is-mon ) + using ( mon ; mon→hom ; is-epi ; epi ; epi→hom ; 𝓁𝒾𝒻𝓉 ) + using ( 𝓁ℴ𝓌ℯ𝓇 ; 𝓁𝒾𝒻𝓉ˡ ; 𝓁𝒾𝒻𝓉ʳ ; 𝓁ℴ𝓌ℯ𝓇ˡ ; 𝓁ℴ𝓌ℯ𝓇ʳ ) + using ( homker-comp ; kerlift-comp ; kercon ; kerquo ) + using ( ker[_⇒_] ; πepi ; πhom ; πker ; ⨅-hom-co ) + using ( ⨅-hom ; ⨅-projection-hom ) -open import Structures.Isos using ( _≅_ ; ≅-refl ; ≅-sym ; ≅-trans ; Lift-≅ˡ - ; Lift-≅ʳ ; Lift-≅ ; Lift-Strucˡ-iso - ; Lift-Struc-iso ; Lift-Struc-assocˡ - ; Lift-Struc-assocʳ ; Lift-Struc-assoc ; ⨅≅ - ; Lift-Struc-⨅≅ ) +open import Structures.Isos using ( _≅_ ; ≅-refl ; ≅-sym ; ≅-trans ; Lift-≅ˡ ) + using ( Lift-≅ʳ ; Lift-≅ ; Lift-Strucˡ-iso ) + using ( Lift-Struc-iso ; Lift-Struc-assocˡ ) + using ( Lift-Struc-assocʳ ; Lift-Struc-assoc ; ⨅≅ ) + using ( Lift-Struc-⨅≅ ) -open import Structures.Terms using ( _⟦_⟧ ) +open import Structures.Terms using ( _⟦_⟧ ) -open import Structures.EquationalLogic using ( _⊧_≈_ ; _⊧_≋_ ; Th ; Mod ; fMod ) +open import Structures.EquationalLogic using ( _⊧_≈_ ; _⊧_≋_ ; Th ; Mod ; fMod ) -open import Structures.Substructures using ( Subuniverses ; Subuniverse ; Sg ; sgIsSub - ; sgIsSmallest ; ⋂s ; sub-term-closed ; TermImage - ; TermImageIsSub ; B-onlyif-TermImageB - ; SgB-onlyif-TermImageB ; hom-unique ; _≥_ - ; _IsSupstructureOf_ ; _≤_ ; _IsSubstructureOf_ - ; SubstructureOf ; Substructure ; IsSubstructureREL - ; _≤c_ ; _IsSubstructureOfClass_ ; SubstructureOfClass - ; SubstructureOfClass' ; SubstructuresOfClass ) +open import Structures.Substructures using ( Subuniverses ; Subuniverse ; Sg ; sgIsSub ) + using ( sgIsSmallest ; ⋂s ; sub-term-closed ; TermImage ) + using ( TermImageIsSub ; B-onlyif-TermImageB ) + using ( SgB-onlyif-TermImageB ; hom-unique ; _≥_ ) + using ( _IsSupstructureOf_ ; _≤_ ; _IsSubstructureOf_ ) + using ( SubstructureOf ; Substructure ; IsSubstructureREL ) + using ( _≤c_ ; _IsSubstructureOfClass_ ; SubstructureOfClass ) + using ( SubstructureOfClass' ; SubstructuresOfClass ) -- GENERAL STRUCTURES represented as Sigma types (instead of record types) ------------------------- -open import Structures.Sigma.Basic using ( Signature ; Structure ; RStructure ; AStructure - ; Structure→RStructure ; Structure→AStructure - ; _⟦_⟧ᵣ ; _⟦_⟧ₒ ; _ʳ_ ; _ᵒ_ ; Compatible - ; Compatible' ; Lift-op ; Lift-rel - ; Lift-Strucˡ ; Lift-Strucʳ ; Lift-Struc ) +open import Structures.Sigma.Basic using ( Signature ; Structure ; RStructure ; AStructure ) + using ( Structure→RStructure ; Structure→AStructure ; _⟦_⟧ᵣ ) + using ( _⟦_⟧ₒ ; _ʳ_ ; _ᵒ_ ; Compatible ; Compatible' ; Lift-op ) + using ( Lift-rel ; Lift-Strucˡ ; Lift-Strucʳ ; Lift-Struc ) -open import Structures.Sigma.Products using ( ⨅ ; ℓp ; ℑ ; 𝔖 ; class-prod ) +open import Structures.Sigma.Products using ( ⨅ ; ℓp ; ℑ ; 𝔖 ; class-prod ) -open import Structures.Sigma.Congruences using ( Con ; 0[_]Compatible ; 0Con[_] ; _╱_ ; /≡-elim - ; 𝟘[_╱_] ; 𝟎[_╱_] ) +open import Structures.Sigma.Congruences using ( Con ; 0[_]Compatible ; 0Con[_] ; _╱_ ; /≡-elim ) + using ( 𝟘[_╱_] ; 𝟎[_╱_] ) -open import Structures.Sigma.Homs using ( preserves ; is-hom-rel ; comp-op ; is-hom-op - ; is-hom ; hom ; ∘-is-hom-rel ; ∘-is-hom-op - ; ∘-is-hom ; ∘-hom ; 𝒾𝒹 ; is-mon ; mon ; is-epi - ; epi ; mon→hom ; epi→hom ; 𝓁𝒾𝒻𝓉 ; 𝓁ℴ𝓌ℯ𝓇 - ; Lift-Hom ; Homker-comp ) +open import Structures.Sigma.Homs using ( preserves ; is-hom-rel ; comp-op ; is-hom-op ; is-hom ) + using ( hom ; ∘-is-hom-rel ; ∘-is-hom-op ; ∘-is-hom ; ∘-hom ) + using ( 𝒾𝒹 ; is-mon ; mon ; is-epi ; epi ; mon→hom ; epi→hom ) + using ( 𝓁𝒾𝒻𝓉 ; 𝓁ℴ𝓌ℯ𝓇 ; Lift-Hom ; Homker-comp ) -open import Structures.Sigma.Isos using ( _≅_ ; ≅-refl ; ≅-sym ; ≅-trans ; Lift-≅ - ; Lift-Struc-iso ; ⨅≅ ) +open import Structures.Sigma.Isos using ( _≅_ ; ≅-refl ; ≅-sym ; ≅-trans ; Lift-≅ ) + using ( Lift-Struc-iso ; ⨅≅ ) -- CATS --------------------------------------------------------------------------------------- -open import Categories.Functors using ( Functor₀ ; [_]₀ ; Functor ; [_]_ ; μ_ ; list - ; L ; List ; Option ; _[_] ; _⟦_⟧ ) +open import Categories.Functors using ( Functor₀ ; [_]₀ ; Functor ; [_]_ ; μ_ ; list ) + using ( L ; List ; Option ; _[_] ; _⟦_⟧ ) -- COMPLEXITY --------------------------------------------------------------------------------------- -open import Complexity.Basic using () -open import Complexity.CSP using (Constraint ; CSPInstance ) +open import Complexity.Basic using () +open import Complexity.CSP using ( Constraint ; CSPInstance ) -- EXAMPLES ----------------------------------------------------------------------------------------- -open import Examples.Structures.Signatures using ( S∅ ; S1 ; S01 ; S001 ; S0001 ; S021 ; S101 ; S111 ) -open import Examples.Structures.Basic using (SL ; NAE3SAT ; nae3sat ) -open import Examples.Categories.Functors using ( L₀ ; l₀ ; L₁ ; l₁ ; L₃ ; l₃ ; L₀≡none - ; l₀≡none ; L₁[0]≡some3 ; L₁[n>0]≡none - ; l₁⟦n>0⟧≡none ; L₃[0]≡some1 ; l₃⟦0⟧≡some1 - ; L₃[0]≢some2 ; l₃[0]≢some2 ; ℓ₁ ) +open import Examples.Structures.Signatures using ( S∅ ; S1 ; S01 ; S001 ; S0001 ; S021 ; S101 ; S111 ) + +open import Examples.Structures.Basic using (SL ; NAE3SAT ; nae3sat ) + +open import Examples.Categories.Functors using ( L₀ ; l₀ ; L₁ ; l₁ ; L₃ ; l₃ ; L₀≡none ; l₀≡none ) + using ( L₁[0]≡some3 ; L₁[n>0]≡none ; l₁⟦n>0⟧≡none ; ℓ₁ ) + using ( L₃[0]≡some1 ; l₃⟦0⟧≡some1 ; L₃[0]≢some2 ; l₃[0]≢some2 ) -- EXERCISES ----------------------------------------------------------------------------------------- -open import Exercises.Complexity.FiniteCSP using ( module solution-2-1 ; module solution-2-2 ) +open import Exercises.Complexity.FiniteCSP using ( module solution-2-1 ; module solution-2-2 ) \end{code}