From 75e61fcc3392cfb808f5ea49c379f6176cc14956 Mon Sep 17 00:00:00 2001 From: Leon Vatthauer Date: Fri, 2 Feb 2024 12:45:17 +0100 Subject: [PATCH] minor --- agda/src/Algebra/Elgot/Free.lagda.md | 3 +- agda/src/Algebra/Elgot/Properties.lagda.md | 57 +++++++++++++++++++ agda/src/Algebra/Elgot/Stable.lagda.md | 17 +++++- .../Construction/ElgotAlgebras.lagda.md | 6 +- 4 files changed, 79 insertions(+), 4 deletions(-) create mode 100644 agda/src/Algebra/Elgot/Properties.lagda.md diff --git a/agda/src/Algebra/Elgot/Free.lagda.md b/agda/src/Algebra/Elgot/Free.lagda.md index 8f14393..9bd4d2e 100644 --- a/agda/src/Algebra/Elgot/Free.lagda.md +++ b/agda/src/Algebra/Elgot/Free.lagda.md @@ -22,7 +22,8 @@ import Categories.Morphism.Reasoning as MR ```agda module Algebra.Elgot.Free {o ℓ e} {C : Category o ℓ e} (cocartesian : Cocartesian C) where open import Algebra.Elgot cocartesian - open import Category.Construction.ElgotAlgebras cocartesian + open import Category.Construction.ElgotAlgebras {C = C} + open Cat cocartesian open import Categories.Morphism.Properties C open Category C diff --git a/agda/src/Algebra/Elgot/Properties.lagda.md b/agda/src/Algebra/Elgot/Properties.lagda.md new file mode 100644 index 0000000..55df6a9 --- /dev/null +++ b/agda/src/Algebra/Elgot/Properties.lagda.md @@ -0,0 +1,57 @@ +```agda +open import Level +open import Categories.FreeObjects.Free +open import Categories.Functor.Core +open import Categories.Functor.Algebra +open import Categories.Functor.Coalgebra +open import Categories.Object.Terminal +open import Categories.Object.Exponential +open import Categories.Category.Core using (Category) +open import Categories.Category.Distributive using (Distributive) +open import Categories.Category.CartesianClosed using (CartesianClosed) +open import Categories.Category.Cocartesian using (Cocartesian) +open import Categories.Category.Cartesian using (Cartesian) +open import Categories.Category.BinaryProducts using (BinaryProducts) +open import Categories.Category.Construction.EilenbergMoore +open import Categories.Monad.Relative renaming (Monad to RMonad) + +import Categories.Morphism as M +import Categories.Morphism.Reasoning as MR +``` +In a CCC free elgot algebras are automatically stable. + + +```agda +module Algebra.Elgot.Properties {o ℓ e} {C : Category o ℓ e} (distributive : Distributive C) (expos : ∀ {A B} → Exponential C A B) where + open Category C + open HomReasoning + open Equiv + open Distributive distributive + open import Categories.Category.Distributive.Properties distributive + open Cartesian cartesian + open BinaryProducts products + open Cocartesian cocartesian + ccc : CartesianClosed C + ccc = record { cartesian = cartesian ; exp = expos } + + open CartesianClosed ccc hiding (exp; cartesian) + + open import Category.Construction.ElgotAlgebras {C = C} + open Cat cocartesian + open Exponentials distributive expos + open import Algebra.Elgot.Free cocartesian + open import Algebra.Elgot.Stable distributive + + open CartesianClosed Elgot-CCC using () renaming (λg to λg#; _^_ to _^#_) + + stable : ∀ {Y} (fe : FreeElgotAlgebra Y) → IsStableFreeElgotAlgebraˡ fe + IsStableFreeElgotAlgebraˡ.[_,_]♯ˡ (stable {Y} fe) {X} A f = (eval′ ∘ (Elgot-Algebra-Morphism.h ((fe FreeObject.*) {A = B^A-Helper {A} {X}} (λg f)) ⁂ id)) + IsStableFreeElgotAlgebraˡ.♯ˡ-law (stable {Y} fe) {X} {A} f = sym (begin + {! [ stable fe , A ]♯ˡ f ∘ (η fe ⁂ id) !} ≈⟨ {! !} ⟩ + {! !} ≈⟨ {! !} ⟩ + {! !} ≈⟨ {! !} ⟩ + {! !} ≈⟨ {! !} ⟩ + f ∎) + IsStableFreeElgotAlgebraˡ.♯ˡ-preserving (stable {Y} fe) {X} {B} f {Z} h = {! !} + IsStableFreeElgotAlgebraˡ.♯ˡ-unique (stable {Y} fe) {X} {B} f g eq₁ eq₂ = {! !} +``` \ No newline at end of file diff --git a/agda/src/Algebra/Elgot/Stable.lagda.md b/agda/src/Algebra/Elgot/Stable.lagda.md index c49f7cb..efcb583 100644 --- a/agda/src/Algebra/Elgot/Stable.lagda.md +++ b/agda/src/Algebra/Elgot/Stable.lagda.md @@ -1,7 +1,6 @@