mirror of
https://git8.cs.fau.de/theses/bsc-leon-vatthauer.git
synced 2024-05-31 07:28:34 +02:00
🚧 prepare for meeting
This commit is contained in:
parent
b325ecc6c3
commit
b7cc991d11
4 changed files with 108 additions and 20 deletions
|
@ -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
20
src/Monad/Core.lagda.md
Normal 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
|
||||||
|
```
|
|
@ -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
|
||||||
|
|
53
src/Monad/Morphism.lagda.md
Normal file
53
src/Monad/Morphism.lagda.md
Normal 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
|
||||||
|
```
|
Loading…
Reference in a new issue