annotate cat-utility.agda @ 87:4690953794c4

MEsolution
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 28 Jul 2013 08:04:01 +0900
parents be4e3b073e0d
children 419923b149ca
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 module cat-utility where
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 -- Shinji KONO <kono@ie.u-ryukyu.ac.jp>
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
5 open import Category -- https://github.com/konn/category-agda
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
6 open import Level
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
7 --open import Category.HomReasoning
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
8 open import HomReasoning
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
10 open Functor
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
12 id1 : ∀{c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) (a : Obj A ) → Hom A a a
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
13 id1 A a = (Id {_} {_} {_} {A} a)
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
15 record IsUniversalMapping {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ')
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
16 ( U : Functor B A )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
17 ( F : Obj A → Obj B )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
18 ( η : (a : Obj A) → Hom A a ( FObj U (F a) ) )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
19 ( _* : { a : Obj A}{ b : Obj B} → ( Hom A a (FObj U b) ) → Hom B (F a ) b )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
20 : Set (suc (c₁ ⊔ c₂ ⊔ ℓ ⊔ c₁' ⊔ c₂' ⊔ ℓ' )) where
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
21 field
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
22 universalMapping : {a' : Obj A} { b' : Obj B } → { f : Hom A a' (FObj U b') } →
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
23 A [ A [ FMap U ( f * ) o η a' ] ≈ f ]
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
24 uniquness : {a' : Obj A} { b' : Obj B } → { f : Hom A a' (FObj U b') } → { g : Hom B (F a') b' } →
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
25 A [ A [ FMap U g o η a' ] ≈ f ] → B [ f * ≈ g ]
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
27 record UniversalMapping {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ')
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
28 ( U : Functor B A )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
29 ( F : Obj A → Obj B )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
30 ( η : (a : Obj A) → Hom A a ( FObj U (F a) ) )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
31 : Set (suc (c₁ ⊔ c₂ ⊔ ℓ ⊔ c₁' ⊔ c₂' ⊔ ℓ' )) where
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
32 infixr 11 _*
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
33 field
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
34 _* : { a : Obj A}{ b : Obj B} → ( Hom A a (FObj U b) ) → Hom B (F a ) b
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
35 isUniversalMapping : IsUniversalMapping A B U F η _*
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
37 open NTrans
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
38 open import Category.Cat
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
39 record IsAdjunction {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ')
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
40 ( U : Functor B A )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
41 ( F : Functor A B )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
42 ( η : NTrans A A identityFunctor ( U ○ F ) )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
43 ( ε : NTrans B B ( F ○ U ) identityFunctor )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
44 : Set (suc (c₁ ⊔ c₂ ⊔ ℓ ⊔ c₁' ⊔ c₂' ⊔ ℓ' )) where
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
45 field
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
46 adjoint1 : { b : Obj B } →
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
47 A [ A [ ( FMap U ( TMap ε b )) o ( TMap η ( FObj U b )) ] ≈ id1 A (FObj U b) ]
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
48 adjoint2 : {a : Obj A} →
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
49 B [ B [ ( TMap ε ( FObj F a )) o ( FMap F ( TMap η a )) ] ≈ id1 B (FObj F a) ]
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
50
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
51 record Adjunction {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ')
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
52 ( U : Functor B A )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
53 ( F : Functor A B )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
54 ( η : NTrans A A identityFunctor ( U ○ F ) )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
55 ( ε : NTrans B B ( F ○ U ) identityFunctor )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
56 : Set (suc (c₁ ⊔ c₂ ⊔ ℓ ⊔ c₁' ⊔ c₂' ⊔ ℓ' )) where
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
57 field
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
58 isAdjunction : IsAdjunction A B U F η ε
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
59
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
60
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
61 record IsMonad {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ)
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
62 ( T : Functor A A )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
63 ( η : NTrans A A identityFunctor T )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
64 ( μ : NTrans A A (T ○ T) T)
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
65 : Set (suc (c₁ ⊔ c₂ ⊔ ℓ )) where
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
66 field
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
67 assoc : {a : Obj A} → A [ A [ TMap μ a o TMap μ ( FObj T a ) ] ≈ A [ TMap μ a o FMap T (TMap μ a) ] ]
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
68 unity1 : {a : Obj A} → A [ A [ TMap μ a o TMap η ( FObj T a ) ] ≈ Id {_} {_} {_} {A} (FObj T a) ]
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
69 unity2 : {a : Obj A} → A [ A [ TMap μ a o (FMap T (TMap η a ))] ≈ Id {_} {_} {_} {A} (FObj T a) ]
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
70
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
71 record Monad {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) (T : Functor A A) (η : NTrans A A identityFunctor T) (μ : NTrans A A (T ○ T) T)
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
72 : Set (suc (c₁ ⊔ c₂ ⊔ ℓ )) where
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
73 eta : NTrans A A identityFunctor T
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
74 eta = η
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
75 mu : NTrans A A (T ○ T) T
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
76 mu = μ
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
77 field
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
78 isMonad : IsMonad A T η μ
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
79
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
80 Functor*Nat : {c₁ c₂ ℓ c₁' c₂' ℓ' c₁'' c₂'' ℓ'' : Level} (A : Category c₁ c₂ ℓ) {B : Category c₁' c₂' ℓ'} (C : Category c₁'' c₂'' ℓ'')
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
81 (F : Functor B C) -> { G H : Functor A B } -> ( n : NTrans A B G H ) -> NTrans A C (F ○ G) (F ○ H)
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
82 Functor*Nat A {B} C F {G} {H} n = record {
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
83 TMap = \a -> FMap F (TMap n a)
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
84 ; isNTrans = record {
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
85 naturality = naturality
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
86 }
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
87 } where
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
88 naturality : {a b : Obj A} {f : Hom A a b}
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
89 → C [ C [ (FMap F ( FMap H f )) o ( FMap F (TMap n a)) ] ≈ C [ (FMap F (TMap n b )) o (FMap F (FMap G f)) ] ]
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
90 naturality {a} {b} {f} = let open ≈-Reasoning (C) in
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
91 begin
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
92 (FMap F ( FMap H f )) o ( FMap F (TMap n a))
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
93 ≈⟨ sym (distr F) ⟩
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
94 FMap F ( B [ (FMap H f) o TMap n a ])
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
95 ≈⟨ IsFunctor.≈-cong (isFunctor F) ( nat n ) ⟩
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
96 FMap F ( B [ (TMap n b ) o FMap G f ] )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
97 ≈⟨ distr F ⟩
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
98 (FMap F (TMap n b )) o (FMap F (FMap G f))
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
99
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
100
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
101 Nat*Functor : {c₁ c₂ ℓ c₁' c₂' ℓ' c₁'' c₂'' ℓ'' : Level} (A : Category c₁ c₂ ℓ) {B : Category c₁' c₂' ℓ'} (C : Category c₁'' c₂'' ℓ'')
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
102 { G H : Functor B C } -> ( n : NTrans B C G H ) -> (F : Functor A B) -> NTrans A C (G ○ F) (H ○ F)
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
103 Nat*Functor A {B} C {G} {H} n F = record {
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
104 TMap = \a -> TMap n (FObj F a)
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
105 ; isNTrans = record {
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
106 naturality = naturality
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
107 }
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
108 } where
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
109 naturality : {a b : Obj A} {f : Hom A a b}
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
110 → C [ C [ ( FMap H (FMap F f )) o ( TMap n (FObj F a)) ] ≈ C [ (TMap n (FObj F b )) o (FMap G (FMap F f)) ] ]
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
111 naturality {a} {b} {f} = IsNTrans.naturality ( isNTrans n)
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
112
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
113 record Kleisli { c₁ c₂ ℓ : Level} ( A : Category c₁ c₂ ℓ )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
114 ( T : Functor A A )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
115 ( η : NTrans A A identityFunctor T )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
116 ( μ : NTrans A A (T ○ T) T )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
117 ( M : Monad A T η μ ) : Set (suc (c₁ ⊔ c₂ ⊔ ℓ )) where
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
118 monad : Monad A T η μ
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
119 monad = M
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
120 -- g ○ f = μ(c) T(g) f
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
121 join : { a b : Obj A } → { c : Obj A } →
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
122 ( Hom A b ( FObj T c )) → ( Hom A a ( FObj T b)) → Hom A a ( FObj T c )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
123 join {_} {_} {c} g f = A [ TMap μ c o A [ FMap T g o f ] ]
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
124
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
125 -- T ≃ (U_R ○ F_R)
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
126 -- μ = U_R ε F_R
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
127 -- nat-ε
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
128 -- nat-η -- same as η but has different types
84
ee25f96ee8cc record Resolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 80
diff changeset
129
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
130 record MResolution {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) ( B : Category c₁' c₂' ℓ' )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
131 ( T : Functor A A )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
132 { η : NTrans A A identityFunctor T }
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
133 { μ : NTrans A A (T ○ T) T }
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
134 ( M : Monad A T η μ )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
135 ( UR : Functor B A ) ( FR : Functor A B )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
136 { ηR : NTrans A A identityFunctor ( UR ○ FR ) }
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
137 { εR : NTrans B B ( FR ○ UR ) identityFunctor }
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
138 { μR : NTrans A A ( (UR ○ FR) ○ ( UR ○ FR )) ( UR ○ FR ) }
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
139 ( Adj : Adjunction A B UR FR ηR εR )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
140 : Set (suc (c₁ ⊔ c₂ ⊔ ℓ ⊔ c₁' ⊔ c₂' ⊔ ℓ' )) where
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
141 field
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
142 T=UF : T ≃ (UR ○ FR)
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
143 μ=UεF : {x : Obj A } -> A [ TMap μR x ≈ FMap UR ( TMap εR ( FObj FR x ) ) ]
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
144 -- ηR=η : {x : Obj A } -> A [ TMap ηR x ≈ TMap η x ]
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
145 -- μR=μ : {x : Obj A } -> A [ TMap μR x ≈ TMap μ x ]
86
be4e3b073e0d resosultion
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 84
diff changeset
146