Added UniformIterationAlgebras

This commit is contained in:
Leon Vatthauer 2023-08-17 18:07:14 +02:00
parent 2c8d4e07ab
commit 8af4faf80c
Signed by: leonv
SSH key fingerprint: SHA256:G4+ddwoZmhLPRB1agvXzZMXIzkVJ36dUYZXf5NxT+u8
3 changed files with 91 additions and 0 deletions

View file

@ -1,5 +1,7 @@
open import Level open import Level
module ElgotAlgebra where
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 Categories.Category open import Categories.Category

View file

@ -0,0 +1,29 @@
open import Level
open import Categories.Category.Core
open import Categories.Category.Extensive.Bundle
open import Categories.Category.Extensive
open import Categories.Category.Cocartesian
module UniformIterationAlgebra {o e} (D : ExtensiveDistributiveCategory o e) where
open ExtensiveDistributiveCategory D renaming (U to C; id to idC)
open Cocartesian (Extensive.cocartesian extensive)
record Uniform-Iteration-Algebra-on (A : Obj) : Set (o e) where
-- iteration operator
field
_# : {X} (X A + X) (X A)
-- _# properties
field
#-Fixpoint : {X} {f : X A + X }
f # [ idC , f # ] f
#-Uniformity : {X Y} {f : X A + X} {g : Y A + Y} {h : X Y}
(idC +₁ h) f g h
f # g # h
#-resp-≈ : {X} {f g : X A + X} f g (f #) (g #)
record Uniform-Iteration-Algebra : Set (o e) where
field
A : Obj
algebra : Uniform-Iteration-Algebra-on A
open Uniform-Iteration-Algebra-on algebra public

View file

@ -0,0 +1,60 @@
open import Level
open import Categories.Category.Core
open import Categories.Category.Extensive.Bundle
open import Categories.Category.Extensive
open import Categories.Category.Cocartesian
import Categories.Morphism.Reasoning as MR
open import UniformIterationAlgebra
module UniformIterationAlgebras {o e} (D : ExtensiveDistributiveCategory o e) where
open ExtensiveDistributiveCategory D renaming (U to C; id to idC)
open Cocartesian (Extensive.cocartesian extensive)
open HomReasoning
open MR C
open Equiv
-- iteration preversing morphism between two elgot-algebras
module _ (E E₂ : Uniform-Iteration-Algebra D) where
open Uniform-Iteration-Algebra E₁ renaming (_# to _#₁)
open Uniform-Iteration-Algebra E₂ renaming (_# to _#₂; A to B)
record Uniform-Iteration-Algebra-Morphism : Set (o e) where
field
h : A B
preserves : {X} {f : X A + X} h (f #₁) ((h +₁ idC) f)#₂
-- the category of uniform-iteration algebras for a given category
Uniform-Iteration-Algebras : Category (o e) (o e) e
Uniform-Iteration-Algebras = record
{ Obj = Uniform-Iteration-Algebra D
; _⇒_ = Uniform-Iteration-Algebra-Morphism
; _≈_ = λ f g Uniform-Iteration-Algebra-Morphism.h f Uniform-Iteration-Algebra-Morphism.h g
; id = λ {EB} let open Uniform-Iteration-Algebra EB in
record { h = idC; preserves = λ {X : Obj} {f : X A + X} begin
idC f # ≈⟨ identityˡ
f # ≈⟨ #-resp-≈ (introˡ (coproduct.unique id-comm-sym id-comm-sym))
((idC +₁ idC) f) # }
; _∘_ = λ {EA} {EB} {EC} f g let
open Uniform-Iteration-Algebra-Morphism f renaming (h to hᶠ; preserves to preservesᶠ)
open Uniform-Iteration-Algebra-Morphism g renaming (h to hᵍ; preserves to preservesᵍ)
open Uniform-Iteration-Algebra EA using (A) renaming (_# to _#ᵃ)
open Uniform-Iteration-Algebra EB using () renaming (_# to _#ᵇ; A to B)
open Uniform-Iteration-Algebra EC using () renaming (_# to _#ᶜ; A to C; #-resp-≈ to #ᶜ-resp-≈)
in record { h = hᶠ hᵍ; preserves = λ {X} {f : X A + X} begin
(hᶠ hᵍ) (f #ᵃ) ≈⟨ pullʳ preservesᵍ
(hᶠ (((hᵍ +₁ idC) f) #ᵇ)) ≈⟨ preservesᶠ
(((hᶠ +₁ idC) (hᵍ +₁ idC) f) #ᶜ) ≈⟨ #ᶜ-resp-≈ (pullˡ (trans +₁∘+₁ (+₁-cong₂ refl (identity²))))
((hᶠ hᵍ +₁ idC) f) #ᶜ }
; identityˡ = identityˡ
; identityʳ = identityʳ
; identity² = identity²
; assoc = assoc
; sym-assoc = sym-assoc
; equiv = record
{ refl = refl
; sym = sym
; trans = trans
}
; ∘-resp-≈ = ∘-resp-≈
}
where open Uniform-Iteration-Algebra-Morphism