mirror of
https://git8.cs.fau.de/theses/bsc-leon-vatthauer.git
synced 2024-05-31 07:28:34 +02:00
71 lines
2 KiB
Markdown
71 lines
2 KiB
Markdown
<!--
|
||
```agda
|
||
open import Level
|
||
open import Category.Ambient using (Ambient)
|
||
open import Categories.Monad.Construction.Kleisli
|
||
open import Categories.Monad
|
||
open import Categories.Monad.Strong
|
||
open import Categories.Monad.Relative renaming (Monad to RMonad)
|
||
open import Categories.Functor
|
||
open import Data.Product using (_,_)
|
||
```
|
||
-->
|
||
|
||
```agda
|
||
module Monad.PreElgot {o ℓ e} (ambient : Ambient o ℓ e) where
|
||
open Ambient ambient
|
||
open HomReasoning
|
||
open MR C
|
||
open Equiv
|
||
open import Algebra.Elgot ambient
|
||
```
|
||
|
||
# (strong) pre-Elgot monads
|
||
|
||
```agda
|
||
record IsPreElgot (T : Monad C) : Set (o ⊔ ℓ ⊔ e) where
|
||
open Monad T
|
||
open RMonad (Monad⇒Kleisli C T) using (extend)
|
||
open Functor F renaming (F₀ to T₀; F₁ to T₁)
|
||
|
||
-- every TX needs to be equipped with an elgot algebra structure
|
||
field
|
||
elgotalgebras : ∀ {X} → Elgot-Algebra-on (T₀ X)
|
||
|
||
module elgotalgebras {X} = Elgot-Algebra-on (elgotalgebras {X})
|
||
|
||
-- where kleisli lifting preserves iteration
|
||
field
|
||
extend-preserves : ∀ {X Y Z} (f : Z ⇒ T₀ X + Z) (h : X ⇒ T₀ Y)
|
||
→ elgotalgebras._# ((extend h +₁ idC) ∘ f) ≈ extend h ∘ elgotalgebras._# {X} f
|
||
|
||
record PreElgotMonad : Set (o ⊔ ℓ ⊔ e) where
|
||
field
|
||
T : Monad C
|
||
isPreElgot : IsPreElgot T
|
||
|
||
open IsPreElgot isPreElgot public
|
||
|
||
record IsStrongPreElgot (SM : StrongMonad monoidal) : Set (o ⊔ ℓ ⊔ e) where
|
||
open StrongMonad SM using (M; strengthen)
|
||
open Monad M using (F)
|
||
|
||
-- M is pre-Elgot
|
||
field
|
||
preElgot : IsPreElgot M
|
||
|
||
open IsPreElgot preElgot public
|
||
|
||
-- and strength is iteration preserving
|
||
field
|
||
strengthen-preserves : ∀ {X Y Z} (f : Z ⇒ F.₀ Y + Z)
|
||
→ strengthen.η (X , Y) ∘ (idC ⁂ elgotalgebras._# f) ≈ elgotalgebras._# ((strengthen.η (X , Y) +₁ idC) ∘ distributeˡ⁻¹ ∘ (idC ⁂ f))
|
||
|
||
record StrongPreElgotMonad : Set (o ⊔ ℓ ⊔ e) where
|
||
field
|
||
SM : StrongMonad monoidal
|
||
isStrongPreElgot : IsStrongPreElgot SM
|
||
|
||
open IsStrongPreElgot isStrongPreElgot public
|
||
```
|
||
|