-
Notifications
You must be signed in to change notification settings - Fork 1
/
Endomorphism.agda
70 lines (55 loc) · 2.69 KB
/
Endomorphism.agda
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
-- vim: nowrap
module Mugen.Algebra.Displacement.Instances.Endomorphism where
open import Algebra.Magma
open import Algebra.Monoid
open import Algebra.Semigroup
open import Cat.Diagram.Monad
import Cat.Reasoning as Cat
open import Mugen.Prelude
open import Mugen.Algebra.Displacement
open import Mugen.Cat.Monad
open import Mugen.Cat.Instances.StrictOrders
open import Mugen.Order.StrictOrder
open import Mugen.Order.Instances.Endomorphism
renaming (Endomorphism to Endomorphism-poset)
import Mugen.Order.Reasoning as Reasoning
private variable
o r : Level
--------------------------------------------------------------------------------
-- Endomorphism Displacements
-- Section 3.4
--
-- Given a Monad 'H' on the category of strict orders, we can construct a displacement
-- algebra whose carrier set is the set of endomorphisms 'Free H Δ → Free H Δ' between
-- free H-algebras in the Eilenberg-Moore category.
open Algebra-hom
module _ (H : Monad (Strict-orders o r)) (Δ : Poset o r) where
private
module H = Monad H
module EM = Cat (Eilenberg-Moore (Strict-orders o r) H)
module Endo = Reasoning (Endomorphism-poset H Δ)
Fᴴ⟨Δ⟩ : Algebra (Strict-orders o r) H
Fᴴ⟨Δ⟩ = Functor.F₀ (Free (Strict-orders o r) H) Δ
Endomorphism-type : Type (lsuc o ⊔ lsuc r)
Endomorphism-type = EM.Hom Fᴴ⟨Δ⟩ Fᴴ⟨Δ⟩
--------------------------------------------------------------------------------
-- Left Invariance
∘-left-strict-invariant : ∀ (σ δ τ : Endomorphism-type)
→ δ Endo.≤ τ → σ EM.∘ δ Endo.≤[ δ ≡ τ ] σ EM.∘ τ
∘-left-strict-invariant σ δ τ δ≤τ =
(λ α → Strictly-monotone.pres-≤ (σ .morphism) (δ≤τ α)) ,
λ p → free-algebra-hom-path H $ ext λ α →
Strictly-monotone.injective-on-related (σ .morphism) (δ≤τ α) (p #ₚ (H.unit.η Δ # α))
--------------------------------------------------------------------------------
-- Bundles
--
-- We do this with copatterns for performance reasons.
open Displacement-on
Endomorphism : Displacement-on (Endomorphism-poset H Δ)
Endomorphism .ε = EM.id
Endomorphism ._⊗_ = EM._∘_
Endomorphism .has-is-displacement .is-displacement.has-is-monoid .has-is-semigroup .has-is-magma .has-is-set = Endo.Ob-is-set
Endomorphism .has-is-displacement .is-displacement.has-is-monoid .has-is-semigroup .associative = EM.assoc _ _ _
Endomorphism .has-is-displacement .is-displacement.has-is-monoid .idl = EM.idl _
Endomorphism .has-is-displacement .is-displacement.has-is-monoid .idr = EM.idr _
Endomorphism .has-is-displacement .is-displacement.left-strict-invariant {σ} {δ} {τ} = ∘-left-strict-invariant σ δ τ