refactor for exponential algebras

This commit is contained in:
Leon Vatthauer 2024-02-04 18:49:12 +01:00
parent 38c29332fc
commit 17c023c944
Signed by: leonv
SSH key fingerprint: SHA256:G4+ddwoZmhLPRB1agvXzZMXIzkVJ36dUYZXf5NxT+u8
12 changed files with 39 additions and 81 deletions

View file

@ -1,4 +1,5 @@
```agda
{-# OPTIONS --allow-unsolved-metas #-}
open import Level
open import Categories.FreeObjects.Free
open import Categories.Functor.Core

View file

@ -18,7 +18,7 @@ open import Categories.Category.Core
module Category.Construction.PreElgotMonads {o e} (ambient : Ambient o e) where
open Ambient ambient
open import Monad.PreElgot ambient
open import Algebra.Elgot ambient
open import Algebra.Elgot cocartesian
open HomReasoning
open Equiv
open M C

View file

@ -20,7 +20,7 @@ open import Data.Product using (_,_)
module Category.Construction.StrongPreElgotMonads {o e} (ambient : Ambient o e) where
open Ambient ambient
open import Monad.PreElgot ambient
open import Algebra.Elgot ambient
open import Algebra.Elgot cocartesian
open HomReasoning
open Equiv
open M C

View file

@ -1,56 +0,0 @@
<!--
```agda
open import Level
open import Categories.Category
open import Categories.Functor
```
-->
```agda
module FreeObject where
private
variable
o e o' ' e' : Level
```
# Free objects
The notion of free object has been formalized in agda-categories:
```agda
open import Categories.FreeObjects.Free
```
but we need a predicate expressing that an object 'is free':
```agda
record IsFreeObject {C : Category o e} {D : Category o' ' e'} (U : Functor D C) (X : Category.Obj C) (FX : Category.Obj D) : Set (suc (e ⊔ e' ⊔ o ⊔ ⊔ o' ⊔ ')) where
private
module C = Category C using (Obj; id; identityʳ; identityˡ; _⇒_; _∘_; equiv; module Equiv)
module D = Category D using (Obj; _⇒_; _∘_; equiv)
module U = Functor U using (₀; ₁)
field
η : C [ X , U.₀ FX ]
_* : ∀ {A : D.Obj} → C [ X , U.₀ A ] → D [ FX , A ]
*-lift : ∀ {A : D.Obj} (f : C [ X , U.₀ A ]) → C [ (U.₁ (f *) C.∘ η) ≈ f ]
*-uniq : ∀ {A : D.Obj} (f : C [ X , U.₀ A ]) (g : D [ FX , A ]) → C [ (U.₁ g) C.∘ η ≈ f ] → D [ g ≈ f * ]
```
and some way to convert between these notions:
```agda
IsFreeObject⇒FreeObject : ∀ {C : Category o e} {D : Category o' ' e'} (U : Functor D C) (X : Category.Obj C) (FX : Category.Obj D) → IsFreeObject U X FX → FreeObject U X
IsFreeObject⇒FreeObject U X FX isFO = record
{ FX = FX
; η = η
; _* = _*
; *-lift = *-lift
; *-uniq = *-uniq
}
where open IsFreeObject isFO
-- TODO FreeObject⇒IsFreeObject
```

View file

@ -17,9 +17,11 @@ open import Categories.Monad.Construction.Kleisli
```agda
module Monad.Instance.K {o e} (ambient : Ambient o e) where
open Ambient ambient
open import Category.Construction.ElgotAlgebras ambient using (Elgot-Algebras)
open import Algebra.Elgot ambient using (Elgot-Algebra)
open import Algebra.Elgot.Free ambient using (FreeElgotAlgebra; elgotForgetfulF; IsStableFreeElgotAlgebra)
open import Category.Construction.ElgotAlgebras {C = C}
open Cat cocartesian using (Elgot-Algebras)
open import Algebra.Elgot cocartesian using (Elgot-Algebra)
open import Algebra.Elgot.Free cocartesian using (FreeElgotAlgebra; elgotForgetfulF)
open import Algebra.Elgot.Stable distributive using (IsStableFreeElgotAlgebra)
open Equiv
open MR C

View file

@ -20,9 +20,11 @@ open MIK ambient
open MonadK MK
open import Monad.Instance.K.Strong ambient MK
open import Monad.Instance.K.EquationalLifting ambient MK
open import Category.Construction.ElgotAlgebras ambient
open import Algebra.Elgot ambient
open import Algebra.Elgot.Free ambient using (FreeElgotAlgebra; elgotForgetfulF; IsStableFreeElgotAlgebra)
open import Category.Construction.ElgotAlgebras {C = C}
open Cat cocartesian
open import Algebra.Elgot cocartesian
open import Algebra.Elgot.Free cocartesian using (FreeElgotAlgebra; elgotForgetfulF)
open import Algebra.Elgot.Stable distributive using (IsStableFreeElgotAlgebra)
open Equiv
open HomReasoning

View file

@ -18,9 +18,10 @@ open Ambient ambient
open MIK ambient
open MonadK MK
open import Monad.Instance.K.Strong ambient MK
open import Category.Construction.ElgotAlgebras ambient
open import Algebra.Elgot ambient
open import Algebra.Elgot.Free ambient using (IsStableFreeElgotAlgebra)
open import Category.Construction.ElgotAlgebras {C = C}
open Cat cocartesian
open import Algebra.Elgot cocartesian
open import Algebra.Elgot.Stable distributive using (IsStableFreeElgotAlgebra)
open HomReasoning
open Equiv

View file

@ -18,13 +18,14 @@ module Monad.Instance.K.PreElgot {o e} (ambient : Ambient o e) (MK : MIK
open Ambient ambient
open MIK ambient
open MonadK MK
open import Algebra.Elgot ambient
open import Algebra.Elgot cocartesian
open import Monad.PreElgot ambient
open import Monad.Instance.K ambient
open import Monad.Instance.K.Commutative ambient MK
open import Monad.Instance.K.Strong ambient MK
open import Category.Construction.PreElgotMonads ambient
open import Category.Construction.ElgotAlgebras ambient
open import Category.Construction.ElgotAlgebras {C = C}
open Cat cocartesian
open Equiv
open HomReasoning

View file

@ -22,9 +22,11 @@ import Monad.Instance.K as MIK
```agda
module Monad.Instance.K.Strong {o e} (ambient : Ambient o e) (MK : MIK.MonadK ambient) where
open Ambient ambient
open import Category.Construction.ElgotAlgebras ambient
open import Algebra.Elgot ambient
open import Algebra.Elgot.Free ambient using (FreeElgotAlgebra; elgotForgetfulF; IsStableFreeElgotAlgebra)
open import Category.Construction.ElgotAlgebras {C = C}
open Cat cocartesian
open import Algebra.Elgot cocartesian
open import Algebra.Elgot.Free cocartesian using (FreeElgotAlgebra; elgotForgetfulF)
open import Algebra.Elgot.Stable distributive using (IsStableFreeElgotAlgebra)
open MIK ambient
open MonadK MK

View file

@ -21,15 +21,17 @@ module Monad.Instance.K.StrongPreElgot {o e} (ambient : Ambient o e) (MK
open Ambient ambient
open MIK ambient
open MonadK MK
open import Algebra.Elgot ambient
open import Algebra.Elgot.Free ambient
open import Algebra.Elgot cocartesian
open import Algebra.Elgot.Free cocartesian
open import Algebra.Elgot.Stable distributive
open import Monad.PreElgot ambient
open import Monad.Instance.K ambient
open import Monad.Instance.K.Commutative ambient MK
open import Monad.Instance.K.Strong ambient MK
open import Monad.Instance.K.PreElgot ambient MK
open import Category.Construction.StrongPreElgotMonads ambient
open import Category.Construction.ElgotAlgebras ambient
open import Category.Construction.ElgotAlgebras {C = C}
open Cat cocartesian
open Equiv
open HomReasoning

View file

@ -12,13 +12,14 @@ open import Function.Construct.Setoid renaming (setoid to _⇨_; _∙_ to _∘_)
open import Function using (_∘_; id) renaming (_∘_ to _∘f_)
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_) renaming (sym to ≣-sym; refl to ≣-refl; trans to ≣-trans)
open import FreeObject
open import Categories.FreeObjects.Free
open import Data.Product.Relation.Binary.Pointwise.NonDependent using (_×ₛ_)
open import Data.Product.Function.NonDependent.Setoid using (proj₁ₛ)
open import Categories.Category.Instance.Properties.Setoids.Choice using ()
open import Data.Product.Relation.Binary.Pointwise.NonDependent
open import Data.Product
open import Category.Ambient using (Ambient)
open import Categories.Category.Instance.Setoids
```
-->
@ -27,12 +28,14 @@ open import Data.Product
```agda
module Monad.Instance.Setoids.K { : Level} where
open _⟶_ using (cong)
open import Monad.Instance.Setoids.Delay {} {}
open import Category.Ambient.Setoids
open Ambient (setoidAmbient {}) using (cocartesian; distributive)
open import Monad.Instance.Setoids.Delay {} {}
open import Monad.Instance.K (setoidAmbient {})
open import Algebra.Elgot (setoidAmbient {})
open import Algebra.Elgot.Free (setoidAmbient {})
open import Category.Construction.ElgotAlgebras (setoidAmbient {})
open import Algebra.Elgot cocartesian
open import Algebra.Elgot.Free cocartesian
open import Category.Construction.ElgotAlgebras {C = Setoids }
open Cat cocartesian
open import Monad.PreElgot (setoidAmbient {})
open Bisimilarity renaming (_≈_ to [_][_≈_]; _≈_ to [_][_≈_]; __ to [_][__]; __ to [_][__]; _↓_ to [_][_↓_])
open DelayMonad

View file

@ -17,7 +17,7 @@ module Monad.PreElgot {o e} (ambient : Ambient o e) where
open HomReasoning
open MR C
open Equiv
open import Algebra.Elgot ambient
open import Algebra.Elgot cocartesian
```
# (strong) pre-Elgot monads