Updated structure

This commit is contained in:
Leon Vatthauer 2023-12-01 17:15:38 +01:00
parent b63d5455be
commit a0ba49ff2e
Signed by: leonv
SSH key fingerprint: SHA256:G4+ddwoZmhLPRB1agvXzZMXIzkVJ36dUYZXf5NxT+u8
21 changed files with 63 additions and 52 deletions

View file

@ -1,10 +1,9 @@
<!-- <!--
```agda ```agda
{-# OPTIONS --allow-unsolved-metas #-}
open import Level open import Level
open import Categories.Functor renaming (id to idF) open import Categories.Functor renaming (id to idF)
open import Categories.Functor.Algebra open import Categories.Functor.Algebra
open import Category.Instance.AmbientCategory using (Ambient) open import Category.Ambient using (Ambient)
``` ```
--> -->

View file

@ -1,8 +1,7 @@
<!-- <!--
```agda ```agda
{-# OPTIONS --allow-unsolved-metas #-}
open import Level open import Level
open import Category.Instance.AmbientCategory using (Ambient) open import Category.Ambient using (Ambient)
open import Categories.FreeObjects.Free open import Categories.FreeObjects.Free
open import Categories.Functor.Core open import Categories.Functor.Core
open import Categories.Functor.Algebra open import Categories.Functor.Algebra

View file

@ -36,14 +36,14 @@ We work in an ambient category that
- has exponentials `X^` - has exponentials `X^`
```agda ```agda
module Category.Instance.AmbientCategory where module Category.Ambient where
record Ambient (o e : Level) : Set (suc o ⊔ suc ⊔ suc e) where record Ambient (o e : Level) : Set (suc o ⊔ suc ⊔ suc e) where
field field
C : Category o e C : Category o e
extensive : Extensive C extensive : Extensive C
cartesian : Cartesian C cartesian : Cartesian C
: ParametrizedNNO (record { U = C ; cartesian = cartesian }) : ParametrizedNNO (record { U = C ; cartesian = cartesian })
_^ : ∀ X → Exponential C (ParametrizedNNO.N ) X -- _^ : ∀ X → Exponential C (ParametrizedNNO.N ) X
cartesianCategory : CartesianCategory o e cartesianCategory : CartesianCategory o e
cartesianCategory = record { U = C ; cartesian = cartesian } cartesianCategory = record { U = C ; cartesian = cartesian }

View file

@ -0,0 +1,3 @@
```agda
module Category.Ambient.Setoid where
```

View file

@ -1,6 +1,5 @@
<!-- <!--
```agda ```agda
{-# OPTIONS --allow-unsolved-metas #-}
open import Level open import Level
open import Categories.Category.Cocartesian using (Cocartesian) open import Categories.Category.Cocartesian using (Cocartesian)
open import Categories.Category.Cartesian using (Cartesian) open import Categories.Category.Cartesian using (Cartesian)
@ -14,7 +13,7 @@ open import Categories.Category
open import Categories.Category.Distributive open import Categories.Category.Distributive
open import Categories.Category.Extensive.Bundle open import Categories.Category.Extensive.Bundle
open import Categories.Category.Extensive open import Categories.Category.Extensive
open import Category.Instance.AmbientCategory using (Ambient) open import Category.Ambient using (Ambient)
``` ```
--> -->
@ -210,21 +209,21 @@ module Category.Construction.ElgotAlgebras {o e} (ambient : Ambient o e)
## Exponentials of Elgot Algebras TODO ## Exponentials of Elgot Algebras TODO
```agda ```agda
-- if the carriers of the algebra form a exponential, so do the algebras -- -- if the carriers of the algebra form a exponential, so do the algebras
B^A-Helper : ∀ {EA : Elgot-Algebra} {X : Obj} → Exponential C X (Elgot-Algebra.A EA) → Elgot-Algebra -- B^A-Helper : ∀ {EA : Elgot-Algebra} {X : Obj} → Exponential C X (Elgot-Algebra.A EA) → Elgot-Algebra
B^A-Helper {EA} {X} exp = record -- B^A-Helper {EA} {X} exp = record
{ A = A^X -- { A = A^X
; algebra = record -- ; algebra = record
{ _# = λ {Z} f → λg product (((((eval +₁ idC) ∘ (Categories.Object.Product.repack C product product' +₁ idC)) ∘ dstl) ∘ (f ⁂ idC)) #ᵃ) -- { _# = λ {Z} f → λg product (((((eval +₁ idC) ∘ (Categories.Object.Product.repack C product product' +₁ idC)) ∘ dstl) ∘ (f ⁂ idC)) #ᵃ)
; #-Fixpoint = {! !} -- ; #-Fixpoint = {! !}
; #-Uniformity = {! !} -- ; #-Uniformity = {! !}
; #-Folding = {! !} -- ; #-Folding = {! !}
; #-resp-≈ = {! !} -- ; #-resp-≈ = {! !}
} -- }
} -- }
where -- where
open Exponential exp renaming (B^A to A^X; product to product') -- open Exponential exp renaming (B^A to A^X; product to product')
open Elgot-Algebra EA using (A) renaming (_# to _#ᵃ; #-Fixpoint to #ᵃ-Fixpoint; #-Uniformity to #ᵃ-Uniformity; #-Folding to #ᵃ-Folding; #-resp-≈ to #ᵃ-resp-≈) -- open Elgot-Algebra EA using (A) renaming (_# to _#ᵃ; #-Fixpoint to #ᵃ-Fixpoint; #-Uniformity to #ᵃ-Uniformity; #-Folding to #ᵃ-Folding; #-resp-≈ to #ᵃ-resp-≈)
dstr = λ {X Y Z} → IsIso.inv (isIsoˡ {X} {Y} {Z}) -- dstr = λ {X Y Z} → IsIso.inv (isIsoˡ {X} {Y} {Z})
dstl = λ {X Y Z} → IsIso.inv (isIsoʳ {X} {Y} {Z}) -- dstl = λ {X Y Z} → IsIso.inv (isIsoʳ {X} {Y} {Z})
``` ```

View file

@ -1,7 +1,7 @@
<!-- <!--
```agda ```agda
open import Level open import Level
open import Category.Instance.AmbientCategory open import Category.Ambient using (Ambient)
open import Categories.NaturalTransformation open import Categories.NaturalTransformation
open import Categories.NaturalTransformation.Equivalence open import Categories.NaturalTransformation.Equivalence
open import Categories.Monad open import Categories.Monad

View file

@ -1,7 +1,7 @@
<!-- <!--
```agda ```agda
open import Level open import Level
open import Category.Instance.AmbientCategory open import Category.Ambient using (Ambient)
open import Categories.NaturalTransformation open import Categories.NaturalTransformation
open import Categories.NaturalTransformation.Equivalence open import Categories.NaturalTransformation.Equivalence
open import Categories.Monad open import Categories.Monad

View file

@ -12,7 +12,7 @@ open import Categories.Functor.Algebra
open import Categories.Monad.Construction.Kleisli open import Categories.Monad.Construction.Kleisli
open import Categories.Category.Construction.F-Coalgebras open import Categories.Category.Construction.F-Coalgebras
open import Categories.NaturalTransformation open import Categories.NaturalTransformation
open import Category.Instance.AmbientCategory using (Ambient) open import Category.Ambient using (Ambient)
open import Data.Product using (∃-syntax; _,_; Σ-syntax) open import Data.Product using (∃-syntax; _,_; Σ-syntax)
``` ```
--> -->

View file

@ -1,13 +1,12 @@
<!-- <!--
```agda ```agda
{-# OPTIONS --allow-unsolved-metas #-}
open import Level open import Level
open import Data.Product using (_,_; proj₁; proj₂) open import Data.Product using (_,_; proj₁; proj₂)
open import Categories.Category.Core open import Categories.Category.Core
open import Categories.Functor open import Categories.Functor
open import Categories.Functor.Coalgebra open import Categories.Functor.Coalgebra
open import Category.Instance.AmbientCategory open import Category.Ambient using (Ambient)
open import Monad.Commutative open import Monad.Commutative
open import Monad.Instance.Delay open import Monad.Instance.Delay
open import Categories.Monad open import Categories.Monad

View file

@ -4,7 +4,7 @@
open import Level open import Level
open import Categories.Functor open import Categories.Functor
open import Category.Instance.AmbientCategory using (Ambient) open import Category.Ambient using (Ambient)
open import Categories.Monad open import Categories.Monad
open import Categories.Monad.Construction.Kleisli open import Categories.Monad.Construction.Kleisli
open import Categories.Monad.Relative renaming (Monad to RMonad) open import Categories.Monad.Relative renaming (Monad to RMonad)

View file

@ -4,7 +4,7 @@ open import Level
open import Data.Product using (_,_; proj₁; proj₂) open import Data.Product using (_,_; proj₁; proj₂)
open import Categories.Category open import Categories.Category
open import Category.Instance.AmbientCategory open import Category.Ambient using (Ambient)
open import Categories.Functor open import Categories.Functor
open import Categories.Functor.Coalgebra open import Categories.Functor.Coalgebra
open import Monad.Instance.Delay open import Monad.Instance.Delay

View file

@ -7,7 +7,7 @@ open import Categories.Adjoint using (_⊣_)
open import Categories.Adjoint.Properties using (adjoint⇒monad) open import Categories.Adjoint.Properties using (adjoint⇒monad)
open import Categories.Monad using (Monad) open import Categories.Monad using (Monad)
open import Categories.Monad.Relative using () renaming (Monad to RMonad) open import Categories.Monad.Relative using () renaming (Monad to RMonad)
open import Category.Instance.AmbientCategory using (Ambient) open import Category.Ambient using (Ambient)
open import Categories.Monad.Construction.Kleisli open import Categories.Monad.Construction.Kleisli
``` ```
--> -->

View file

@ -1,8 +1,7 @@
<!-- <!--
```agda ```agda
{-# OPTIONS --allow-unsolved-metas #-}
open import Level open import Level
open import Category.Instance.AmbientCategory open import Category.Ambient using (Ambient)
open import Monad.Commutative open import Monad.Commutative
open import Categories.Monad.Strong open import Categories.Monad.Strong
open import Data.Product using (_,_) renaming (_×_ to _×f_) open import Data.Product using (_,_) renaming (_×_ to _×f_)

View file

@ -2,7 +2,7 @@
```agda ```agda
{-# OPTIONS --allow-unsolved-metas #-} {-# OPTIONS --allow-unsolved-metas #-}
open import Level open import Level
open import Category.Instance.AmbientCategory open import Category.Ambient using (Ambient)
open import Data.Product using (_,_) open import Data.Product using (_,_)
open import Categories.FreeObjects.Free open import Categories.FreeObjects.Free
open import Categories.Category.Construction.Kleisli open import Categories.Category.Construction.Kleisli

View file

@ -3,7 +3,7 @@
{-# OPTIONS --allow-unsolved-metas #-} {-# OPTIONS --allow-unsolved-metas #-}
open import Level open import Level
open import Category.Instance.AmbientCategory open import Category.Ambient using (Ambient)
open import Categories.Category open import Categories.Category
open import Categories.Category.Instance.Setoids open import Categories.Category.Instance.Setoids
open import Categories.Monad open import Categories.Monad
@ -25,15 +25,13 @@ open import Function.Base using (id)
--> -->
```agda ```agda
-- TODO arguments c here! module Monad.Instance.K.Instance.Maybe {c } where
module Monad.Instance.K.Instance.Maybe {o e} where
``` ```
# The Maybe Monad as instance of K # The Maybe Monad as instance of K
Assuming the axiom of choice, the maybe monad is an instance of K in the category of setoids. Assuming the axiom of choice, the maybe monad is an instance of K in the category of setoids.
```agda ```agda
module _ {c : Level} where
data Maybe (A : Set c) : Set c where data Maybe (A : Set c) : Set c where
nothing : Maybe A nothing : Maybe A
just : A → Maybe A just : A → Maybe A
@ -78,6 +76,8 @@ module _ {c : Level} where
_≋_ : ∀ {A B : Setoid c } → A ⟶ B → A ⟶ B → Set (c ⊔ ) _≋_ : ∀ {A B : Setoid c } → A ⟶ B → A ⟶ B → Set (c ⊔ )
_≋_ {A} {B} f g = Setoid._≈_ (A ⇨ B) f g _≋_ {A} {B} f g = Setoid._≈_ (A ⇨ B) f g
≋-sym : ∀ {A B : Setoid c } {f g : A ⟶ B} → f ≋ g → g ≋ f
≋-sym {A} {B} {f} {g} = IsEquivalence.sym (Setoid.isEquivalence (A ⇨ B)) {f} {g}
maybeFun-id : ∀ {A : Setoid c } → (maybeFun idₛ) ≋ idₛ {A = maybeSetoid A} maybeFun-id : ∀ {A : Setoid c } → (maybeFun idₛ) ≋ idₛ {A = maybeSetoid A}
maybeFun-id {A} {nothing} {nothing} i≈j = i≈j maybeFun-id {A} {nothing} {nothing} i≈j = i≈j
@ -111,6 +111,21 @@ module _ {c : Level} where
μ-natural {A} {B} f {nothing} {nothing} i≈j = i≈j μ-natural {A} {B} f {nothing} {nothing} i≈j = i≈j
μ-natural {A} {B} f {just i} {just j} i≈j = cong (maybeFun f) {i} {j} i≈j μ-natural {A} {B} f {just i} {just j} i≈j = cong (maybeFun f) {i} {j} i≈j
μ-assoc : ∀ {A : Setoid c } → (μ A ∘ maybeFun (μ A)) ≋ (μ A ∘ μ (maybeSetoid A))
μ-assoc {A} {nothing} {nothing} i≈j = i≈j
μ-assoc {A} {just i} {just j} i≈j = cong (μ A) {i} {j} i≈j
μ-sym-assoc : ∀ {A : Setoid c } → (μ A ∘ μ (maybeSetoid A)) ≋ (μ A ∘ maybeFun (μ A))
μ-sym-assoc {A} {nothing} {nothing} i≈j = i≈j
μ-sym-assoc {A} {just i} {just j} i≈j = cong (μ A) {i} {j} i≈j
identityˡ : ∀ {A : Setoid c } → (μ A ∘ maybeFun (η A)) ≋ idₛ
identityˡ {A} {nothing} {nothing} i≈j = i≈j
identityˡ {A} {just _} {just _} i≈j = i≈j
identityʳ : ∀ {A : Setoid c } → (μ A ∘ η (maybeSetoid A)) ≋ idₛ
identityʳ {A} {i} {j} i≈j = i≈j
maybeMonad : Monad (Setoids c ) maybeMonad : Monad (Setoids c )
maybeMonad = record maybeMonad = record
{ F = record { F = record
@ -128,10 +143,10 @@ module _ {c : Level} where
{ η = μ { η = μ
; commute = μ-natural ; commute = μ-natural
}) })
; assoc = {! !} ; assoc = λ {A} {i} {j} → μ-assoc {A} {i} {j}
; sym-assoc = {! !} ; sym-assoc = λ {A} {i} {j} → μ-sym-assoc {A} {i} {j}
; identityˡ = {! !} ; identityˡ = λ {A} {i} {j} → identityˡ {A} {i} {j}
; identityʳ = {! !} ; identityʳ = λ {A} {i} {j} → identityʳ {A} {i} {j}
} }

View file

@ -3,7 +3,7 @@
{-# OPTIONS --allow-unsolved-metas #-} {-# OPTIONS --allow-unsolved-metas #-}
open import Level open import Level
open import Data.Product using (_,_) open import Data.Product using (_,_)
open import Category.Instance.AmbientCategory open import Category.Ambient using (Ambient)
open import Categories.Object.Terminal open import Categories.Object.Terminal
open import Categories.Functor.Algebra open import Categories.Functor.Algebra
open import Categories.Object.Initial open import Categories.Object.Initial

View file

@ -1,7 +1,7 @@
<!-- <!--
```agda ```agda
open import Level open import Level
open import Category.Instance.AmbientCategory open import Category.Ambient using (Ambient)
open import Categories.FreeObjects.Free open import Categories.FreeObjects.Free
open import Categories.Object.Initial open import Categories.Object.Initial
open import Categories.NaturalTransformation open import Categories.NaturalTransformation

View file

@ -11,7 +11,7 @@ open import Categories.Adjoint.Properties
open import Categories.Monad open import Categories.Monad
open import Categories.Monad.Strong open import Categories.Monad.Strong
open import Categories.Monad.Relative renaming (Monad to RMonad) open import Categories.Monad.Relative renaming (Monad to RMonad)
open import Category.Instance.AmbientCategory using (Ambient) open import Category.Ambient using (Ambient)
open import Categories.NaturalTransformation open import Categories.NaturalTransformation
open import Categories.Object.Terminal open import Categories.Object.Terminal

View file

@ -1,7 +1,7 @@
<!-- <!--
```agda ```agda
open import Level open import Level
open import Category.Instance.AmbientCategory open import Category.Ambient using (Ambient)
open import Categories.FreeObjects.Free open import Categories.FreeObjects.Free
open import Categories.Object.Initial open import Categories.Object.Initial
open import Categories.NaturalTransformation open import Categories.NaturalTransformation

View file

@ -1,9 +1,7 @@
<!-- <!--
```agda ```agda
{-# OPTIONS --allow-unsolved-metas #-}
open import Level open import Level
open import Category.Instance.AmbientCategory using (Ambient) open import Category.Ambient using (Ambient)
open import Categories.Monad.Construction.Kleisli open import Categories.Monad.Construction.Kleisli
open import Categories.Monad open import Categories.Monad
open import Categories.Monad.Strong open import Categories.Monad.Strong

View file

@ -16,7 +16,7 @@ This is an implementation of this paper by Sergey Goncharov: [arxiv](https://arx
The work takes place in an ambient category that fits our needs: The work takes place in an ambient category that fits our needs:
```agda ```agda
open import Category.Instance.AmbientCategory open import Category.Ambient using (Ambient)
``` ```
### Delay Monad ### Delay Monad