bsc-leon-vatthauer/agda/src/Monad/PreElgot.lagda.md

71 lines
2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!--
```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
```