bsc-leon-vatthauer/src/Monad/Instance/K.lagda.md

61 lines
1.9 KiB
Markdown
Raw Normal View History

2023-08-19 12:15:34 +02:00
<!--
```agda
open import Level
open import Categories.FreeObjects.Free using (FreeObject; FO⇒Functor; FO⇒LAdj)
open import Categories.Functor.Core using (Functor)
open import Categories.Adjoint using (_⊣_)
open import Categories.Adjoint.Properties using (adjoint⇒monad)
open import Categories.Monad using (Monad)
open import Categories.Monad.Relative using () renaming (Monad to RMonad)
open import Category.Instance.AmbientCategory using (Ambient)
open import Categories.Monad.Construction.Kleisli
2023-08-19 12:15:34 +02:00
```
-->
# The monad K
2023-08-19 12:15:34 +02:00
```agda
module Monad.Instance.K {o e} (ambient : Ambient o e) where
open Ambient ambient
open import Category.Construction.UniformIterationAlgebras ambient using (Uniform-Iteration-Algebras)
open import Algebra.UniformIterationAlgebra ambient using (Uniform-Iteration-Algebra)
open import Algebra.Properties ambient using (FreeUniformIterationAlgebra; uniformForgetfulF; IsStableFreeUniformIterationAlgebra)
2023-08-19 12:15:34 +02:00
2023-10-05 16:22:05 +02:00
open Equiv
2023-10-25 18:18:30 +02:00
open MR C
open M C
open HomReasoning
2023-08-19 12:15:34 +02:00
```
## Definition
The monad is defined by existence of free uniform-iteration algebras.
Since free objects yield and adjunctions, this yields a monad.
2023-08-19 12:15:34 +02:00
```agda
record MonadK : Set (suc o ⊔ suc ⊔ suc e) where
field
2023-10-25 18:18:30 +02:00
freealgebras : ∀ X → FreeUniformIterationAlgebra X
stable : ∀ X → IsStableFreeUniformIterationAlgebra (freealgebras X)
-- helper for accessing ui-algebras
algebras : ∀ (X : Obj) → Uniform-Iteration-Algebra
algebras X = FreeObject.FX (freealgebras X)
2023-08-19 12:15:34 +02:00
freeF : Functor C Uniform-Iteration-Algebras
2023-10-25 18:18:30 +02:00
freeF = FO⇒Functor uniformForgetfulF freealgebras
2023-08-19 12:15:34 +02:00
2023-10-05 16:22:05 +02:00
adjoint : freeF ⊣ uniformForgetfulF
2023-10-25 18:18:30 +02:00
adjoint = FO⇒LAdj uniformForgetfulF freealgebras
2023-08-19 12:15:34 +02:00
monadK : Monad C
monadK = adjoint⇒monad adjoint
module monadK = Monad monadK
2023-10-25 18:18:30 +02:00
kleisliK : KleisliTriple C
kleisliK = Monad⇒Kleisli C monadK
module kleisliK = RMonad kleisliK
2023-10-25 18:18:30 +02:00
module K = Functor monadK.F
```