🚧 prepare for meeting

This commit is contained in:
Leon Vatthauer 2023-10-09 12:11:21 +02:00
parent b325ecc6c3
commit b7cc991d11
Signed by: leonv
SSH key fingerprint: SHA256:G4+ddwoZmhLPRB1agvXzZMXIzkVJ36dUYZXf5NxT+u8
4 changed files with 108 additions and 20 deletions

View file

@ -1,5 +1,6 @@
<!-- <!--
```agda ```agda
{-# OPTIONS --allow-unsolved-metas #-}
open import Level open import Level
open import Category.Instance.AmbientCategory using (Ambient) open import Category.Instance.AmbientCategory using (Ambient)
open import Categories.FreeObjects.Free open import Categories.FreeObjects.Free
@ -58,6 +59,25 @@ This file contains some typedefs and records concerning different algebras.
FreeElgotAlgebra X = FreeObject {C = C} {D = Elgot-Algebras} elgotForgetfulF X FreeElgotAlgebra X = FreeObject {C = C} {D = Elgot-Algebras} elgotForgetfulF X
``` ```
## Stable Free Elgot Algebras
**TODO** This can be defined, KY is the free elgot algebra and η is the morphism of the free object!
```agda
record StableFreeElgotAlgebra : Set (suc o ⊔ suc ⊔ suc e) where
field
Y : Obj
freeElgot : FreeElgotAlgebra Y
-- _♯ : ∀ {A : Elgot-Algebra}
open FreeObject freeElgot using (η) renaming (FX to FY)
open Elgot-Algebra FY using (_#)
field
-- TODO awkward notation...
[_,_]♯ : ∀ {X : Obj} (A : Elgot-Algebra) (f : X × Y ⇒ Elgot-Algebra.A A) → X × Elgot-Algebra.A FY ⇒ Elgot-Algebra.A A
♯-law : ∀ {X : Obj} {A : Elgot-Algebra} (f : X × Y ⇒ Elgot-Algebra.A A) → f ≈ [ A , f ]♯ ∘ (idC ⁂ η)
♯-preserving : ∀ {X : Obj} {B : Elgot-Algebra} (f : X × Elgot-Algebra.A FY ⇒ Elgot-Algebra.A B) {Z : Obj} (h : Z ⇒ Elgot-Algebra.A FY + Z) → f ∘ (idC ⁂ h #) ≈ Elgot-Algebra._# B ((f +₁ idC) ∘ distributeˡ⁻¹ ∘ (idC ⁂ h))
-- TODO ♯ is unique iteration preserving
```
## Free Elgot to Free Uniform Iteration ## Free Elgot to Free Uniform Iteration
```agda ```agda
@ -74,26 +94,22 @@ This file contains some typedefs and records concerning different algebras.
; homomorphism = refl ; homomorphism = refl
; F-resp-≈ = λ x → x ; F-resp-≈ = λ x → x
} }
```
{- FreeElgots⇒FreeUniformIterations : (∀ X → FreeElgotAlgebra X) → (∀ X → FreeUniformIterationAlgebra X)
TODO / NOTES: FreeElgots⇒FreeUniformIterations free-elgots X = record
- Theorem 35 talks about stable free elgot algebras, { FX = F₀ (FreeObject.FX (free-elgots X))
but it is supposed to show that Ď and K are equivalent (under assumptions). ; η = FreeObject.η (free-elgots X)
This would require us being able to get FreeUniformIterationAlgebras from FreeElgotAlgebras, but the free _* doesn't type check! ; _* = λ {FY} f → F₁ (FreeObject._* (free-elgots X) {A = record { A = Uniform-Iteration-Algebra.A FY ; algebra = record
It probably is possible to remedy it somehow, one naive way would be to do the proof of Theorem 35 twice, { _# = FY Uniform-Iteration-Algebra.#
once for the theorem and a second time to establish the connection between ĎX and KX. ; #-Fixpoint = Uniform-Iteration-Algebra.#-Fixpoint FY
- TODO talk to Sergey about this ; #-Uniformity = Uniform-Iteration-Algebra.#-Uniformity FY
-} ; #-Folding = {! !}
FreeElgot⇒FreeUniformIteration : ∀ {X} → FreeElgotAlgebra X → FreeUniformIterationAlgebra X ; #-resp-≈ = Uniform-Iteration-Algebra.#-resp-≈ FY
FreeElgot⇒FreeUniformIteration {X} free-elgot = record } }} f) -- FreeObject.FX (free-elgots (Uniform-Iteration-Algebra.A FY))
{ FX = F₀ elgot
; η = η'
; _* = λ {Y} f → F₁ (f *')
; *-lift = {! !} ; *-lift = {! !}
; *-uniq = {! !} ; *-uniq = {! !}
} }
where where
open FreeObject free-elgot renaming (FX to elgot; η to η'; _* to _*'; *-lift to *-lift'; *-uniq to *-uniq') open Functor elgot-to-uniformF
open Elgot-Algebra elgot open Functor (FO⇒Functor elgotForgetfulF free-elgots) using () renaming (F₀ to FO₀; F₁ to FO₁)
open Functor elgot-to-uniformF using (F₀; F₁)
```

20
src/Monad/Core.lagda.md Normal file
View file

@ -0,0 +1,20 @@
<!--
```agda
open import Level
open import Categories.Category.Core
open import Categories.Functor using (Endofunctor; Functor; _∘F_) renaming (id to idF)
open import Categories.Monad
open import Categories.NaturalTransformation
```
-->
# Monads
In this file we define some predicates like 'F extends to a monad'
```agda
module Monad.Core {o e} (C : Category o e) where
record ExtendsToMonad (F : Endofunctor C) : Set (o ⊔ ⊔ e) where
field
η : NaturalTransformation idF F
μ : NaturalTransformation (F ∘F F) F
```

View file

@ -135,7 +135,6 @@ We will now show that the following conditions are equivalent:
out⁻¹ ∘ i₂ ∘ out⁻¹ ∘ i₁ ∘ idC ≈⟨ (refl⟩∘⟨ refl⟩∘⟨ refl⟩∘⟨ identityʳ) ⟩ out⁻¹ ∘ i₂ ∘ out⁻¹ ∘ i₁ ∘ idC ≈⟨ (refl⟩∘⟨ refl⟩∘⟨ refl⟩∘⟨ identityʳ) ⟩
out⁻¹ ∘ i₂ ∘ out⁻¹ ∘ i₁ ≈⟨ ((refl⟩∘⟨ sym-assoc) ○ assoc²'') ⟩ out⁻¹ ∘ i₂ ∘ out⁻¹ ∘ i₁ ≈⟨ ((refl⟩∘⟨ sym-assoc) ○ assoc²'') ⟩
▷ ∘ now ∎ ▷ ∘ now ∎
-- ⁂ ○
Ď-Functor : Endofunctor C Ď-Functor : Endofunctor C
Ď-Functor = record Ď-Functor = record
@ -197,7 +196,7 @@ We will now show that the following conditions are equivalent:
cond-2 = ∀ X → Σ[ s-alg-on ∈ Search-Algebra-on D (Ď₀ X) ] is-F-Algebra-Morphism {F = D-Functor} (record { A = D₀ X ; α = μ.η X }) (record { A = Ď₀ X ; α = Search-Algebra-on.α s-alg-on }) (ρ {X}) cond-2 = ∀ X → Σ[ s-alg-on ∈ Search-Algebra-on D (Ď₀ X) ] is-F-Algebra-Morphism {F = D-Functor} (record { A = D₀ X ; α = μ.η X }) (record { A = Ď₀ X ; α = Search-Algebra-on.α s-alg-on }) (ρ {X})
cond-3 : Set (o ⊔ ⊔ e) cond-3 : Set (o ⊔ ⊔ e)
cond-3 = {! !} cond-3 = {! !}
cond-4 : Set (o ⊔ ⊔ e) cond-4 : Set (o ⊔ ⊔ e)
cond-4 = {! !} cond-4 = {! !}

View file

@ -0,0 +1,53 @@
<!--
```agda
open import Level
open import Categories.Category.Core
open import Categories.Category.Monoidal
open import Categories.Monad
open import Categories.Monad.Morphism using (Monad⇒-id)
open import Categories.Monad.Strong
open import Categories.NaturalTransformation using (NaturalTransformation)
open import Data.Product using (_,_; Σ; Σ-syntax)
```
-->
```agda
module Monad.Morphism {o e} (C : Category o e) where
open Category C
```
# Monad morphisms
This file contains the definition of morphisms between (strong) monads on the same category
## Morphisms between monads
A morphism between monads is a natural transformation that preserves η and μ,
this notion is already formalized in the categories library,
but since we are only interested in monads on the same category we rename their definitions.
```agda
Monad⇒ = Monad⇒-id
```
## Morphisms between strong monads
A morphism between strong monads is a morphism between the underlying monads that also preverses strength.
```agda
record IsStrongMonad⇒ {monoidal : Monoidal C} (M N : StrongMonad monoidal) (α : NaturalTransformation (StrongMonad.M.F M) (StrongMonad.M.F N)) : Set (o ⊔ ⊔ e) where
private
module M = StrongMonad M
module N = StrongMonad N
module α = NaturalTransformation α
open Monoidal monoidal
field
η-comm : ∀ {U} → α.η U ∘ M.M.η.η U ≈ N.M.η.η U
μ-comm : ∀ {U} → α.η U ∘ (M.M.μ.η U) ≈ N.M.μ.η U ∘ α.η (N.M.F.₀ U) ∘ M.M.F.₁ (α.η U)
τ-comm : ∀ {U V} → α.η (U ⊗₀ V) ∘ M.strengthen.η (U , V) ≈ N.strengthen.η (U , V) ∘ (id ⊗₁ α.η V)
record StrongMonad⇒ {monoidal : Monoidal C} {M N : StrongMonad monoidal} : Set (o ⊔ ⊔ e) where
field
α : NaturalTransformation (StrongMonad.M.F M) (StrongMonad.M.F N)
isStrongMonad⇒ : IsStrongMonad⇒ M N α
open IsStrongMonad⇒ isStrongMonad⇒ public
```