Mercurial > hg > Members > kono > Proof > category
annotate universal-mapping.agda @ 804:2716d2945730
fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 25 Apr 2019 12:22:03 +0900 |
parents | 06a7831cf6ce |
children |
rev | line source |
---|---|
31 | 1 module universal-mapping where |
2 | |
56 | 3 -- Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
4 | |
31 | 5 open import Category -- https://github.com/konn/category-agda |
6 open import Level | |
56 | 7 open import HomReasoning |
159 | 8 open import cat-utility |
9 open import Category.Cat | |
31 | 10 |
11 open Functor | |
32 | 12 open NTrans |
13 | |
43 | 14 -- |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
15 -- Adjunction yields solution of universal mapping |
43 | 16 -- |
17 -- | |
18 | |
56 | 19 Adj2UM : {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ') |
690
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
20 → (adj : Adjunction A B ) → UniversalMapping A B (Adjunction.U adj) |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
21 Adj2UM A B adj = record { |
690
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
22 F = FObj (Adjunction.F adj) ; |
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
23 η = TMap (Adjunction.η adj) ; |
43 | 24 _* = solution ; |
36 | 25 isUniversalMapping = record { |
43 | 26 universalMapping = universalMapping; |
172 | 27 uniquness = uniqueness |
36 | 28 } |
29 } where | |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
30 U : Functor B A |
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
31 U = Adjunction.U adj |
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
32 F : Functor A B |
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
33 F = Adjunction.F adj |
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
34 η : NTrans A A identityFunctor ( U ○ F ) |
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
35 η = Adjunction.η adj |
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
36 ε : NTrans B B ( F ○ U ) identityFunctor |
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
37 ε = Adjunction.ε adj |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
38 solution : { a : Obj A} { b : Obj B} → ( f : Hom A a (FObj U b) ) → Hom B (FObj F a ) b |
43 | 39 solution {_} {b} f = B [ TMap ε b o FMap F f ] |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
40 universalMapping : {a' : Obj A} { b' : Obj B } → { f : Hom A a' (FObj U b') } → |
43 | 41 A [ A [ FMap U ( solution f) o TMap η a' ] ≈ f ] |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
42 universalMapping {a} {b} {f} = |
38 | 43 let open ≈-Reasoning (A) in |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
44 begin |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
45 FMap U ( solution f) o TMap η a |
39 | 46 ≈⟨⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
47 FMap U ( B [ TMap ε b o FMap F f ] ) o TMap η a |
66 | 48 ≈⟨ car (distr U ) ⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
49 ( (FMap U (TMap ε b)) o (FMap U ( FMap F f )) ) o TMap η a |
40
c34b1cfe9fdc
Adjunction to Universal Mapping end
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
39
diff
changeset
|
50 ≈⟨ sym assoc ⟩ |
c34b1cfe9fdc
Adjunction to Universal Mapping end
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
39
diff
changeset
|
51 (FMap U (TMap ε b)) o ((FMap U ( FMap F f )) o TMap η a ) |
66 | 52 ≈⟨ cdr (nat η) ⟩ |
40
c34b1cfe9fdc
Adjunction to Universal Mapping end
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
39
diff
changeset
|
53 (FMap U (TMap ε b)) o ((TMap η (FObj U b )) o f ) |
c34b1cfe9fdc
Adjunction to Universal Mapping end
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
39
diff
changeset
|
54 ≈⟨ assoc ⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
55 ((FMap U (TMap ε b)) o (TMap η (FObj U b))) o f |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
56 ≈⟨ car ( IsAdjunction.adjoint1 ( Adjunction.isAdjunction adj)) ⟩ |
40
c34b1cfe9fdc
Adjunction to Universal Mapping end
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
39
diff
changeset
|
57 id (FObj U b) o f |
c34b1cfe9fdc
Adjunction to Universal Mapping end
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
39
diff
changeset
|
58 ≈⟨ idL ⟩ |
38 | 59 f |
60 ∎ | |
56 | 61 lemma1 : (a : Obj A) ( b : Obj B ) ( f : Hom A a (FObj U b) ) → ( g : Hom B (FObj F a) b) → |
62 A [ A [ FMap U g o TMap η a ] ≈ f ] → | |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
63 B [ (FMap F (A [ FMap U g o TMap η a ] )) ≈ FMap F f ] |
44 | 64 lemma1 a b f g k = IsFunctor.≈-cong (isFunctor F) k |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
65 uniqueness : {a' : Obj A} { b' : Obj B } → { f : Hom A a' (FObj U b') } → { g : Hom B (FObj F a') b'} → |
56 | 66 A [ A [ FMap U g o TMap η a' ] ≈ f ] → B [ solution f ≈ g ] |
172 | 67 uniqueness {a} {b} {f} {g} k = let open ≈-Reasoning (B) in |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
68 begin |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
69 solution f |
44 | 70 ≈⟨⟩ |
71 TMap ε b o FMap F f | |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
72 ≈⟨ cdr (sym ( lemma1 a b f g k )) ⟩ |
44 | 73 TMap ε b o FMap F ( A [ FMap U g o TMap η a ] ) |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
74 ≈⟨ cdr (distr F ) ⟩ |
45
659b8a21caf7
uniq-univeralMapping from Adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
44
diff
changeset
|
75 TMap ε b o ( FMap F ( FMap U g) o FMap F ( TMap η a ) ) |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
76 ≈⟨ assoc ⟩ |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
77 ( TMap ε b o FMap F ( FMap U g) ) o FMap F ( TMap η a ) |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
78 ≈⟨ sym ( car ( nat ε )) ⟩ |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
79 ( g o TMap ε ( FObj F a) ) o FMap F ( TMap η a ) |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
80 ≈⟨ sym assoc ⟩ |
45
659b8a21caf7
uniq-univeralMapping from Adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
44
diff
changeset
|
81 g o ( TMap ε ( FObj F a) o FMap F ( TMap η a ) ) |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
82 ≈⟨ cdr ( IsAdjunction.adjoint2 ( Adjunction.isAdjunction adj )) ⟩ |
45
659b8a21caf7
uniq-univeralMapping from Adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
44
diff
changeset
|
83 g o id (FObj F a) |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
84 ≈⟨ idR ⟩ |
44 | 85 g |
86 ∎ | |
87 | |
43 | 88 -- |
89 -- | |
90 -- Universal mapping yields Adjunction | |
91 -- | |
92 -- | |
93 | |
94 | |
95 -- | |
96 -- F is an functor | |
97 -- | |
98 | |
54 | 99 FunctorF : {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ') |
690
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
100 { U : Functor B A } |
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
101 → UniversalMapping A B U → Functor A B |
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
102 FunctorF A B {U} um = record { |
41 | 103 FObj = F; |
42 | 104 FMap = myFMap ; |
105 isFunctor = myIsFunctor | |
41 | 106 } where |
690
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
107 F : Obj A → Obj B |
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
108 F = UniversalMapping.F um |
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
109 η : (a : Obj A) → Hom A a ( FObj U (F a) ) |
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
110 η = UniversalMapping.η um |
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
111 _* : (UniversalMapping A B U ) → { a : Obj A} { b : Obj B} → ( Hom A a (FObj U b) ) → Hom B (F a ) b |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
112 _* _ = UniversalMapping._* um |
56 | 113 myFMap : {a b : Obj A} → Hom A a b → Hom B (F a) (F b) |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
114 myFMap f = (_* um) (A [ η (Category.cod A f ) o f ]) |
56 | 115 lemma-id1 : {a : Obj A} → A [ A [ FMap U (id1 B (F a)) o η a ] ≈ (A [ (η a) o (id1 A a) ]) ] |
46 | 116 lemma-id1 {a} = let open ≈-Reasoning (A) in |
42 | 117 begin |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
118 FMap U (id1 B (F a)) o η a |
42 | 119 ≈⟨ ( car ( IsFunctor.identity ( isFunctor U ))) ⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
120 id (FObj U ( F a )) o η a |
42 | 121 ≈⟨ idL ⟩ |
122 η a | |
123 ≈⟨ sym idR ⟩ | |
46 | 124 η a o id a |
42 | 125 ∎ |
46 | 126 lemma-id : {a : Obj A} → B [ ( (_* um) (A [ (η a) o (id1 A a)] )) ≈ (id1 B (F a)) ] |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
127 lemma-id {a} = ( IsUniversalMapping.uniquness ( UniversalMapping.isUniversalMapping um ) ) lemma-id1 |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
128 lemma-cong2 : (a b : Obj A) (f g : Hom A a b) → A [ f ≈ g ] → |
46 | 129 A [ A [ FMap U ((_* um) (A [ η b o g ]) ) o η a ] ≈ A [ η b o f ] ] |
130 lemma-cong2 a b f g eq = let open ≈-Reasoning (A) in | |
131 begin | |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
132 ( FMap U ((_* um) (A [ η b o g ]) )) o η a |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
133 ≈⟨ ( IsUniversalMapping.universalMapping ( UniversalMapping.isUniversalMapping um )) ⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
134 η b o g |
46 | 135 ≈⟨ ( IsCategory.o-resp-≈ ( Category.isCategory A ) (sym eq) (refl-hom) ) ⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
136 η b o f |
46 | 137 ∎ |
138 lemma-cong1 : (a b : Obj A) (f g : Hom A a b) → A [ f ≈ g ] → B [ (_* um) (A [ η b o f ] ) ≈ (_* um) (A [ η b o g ]) ] | |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
139 lemma-cong1 a b f g eq = ( IsUniversalMapping.uniquness ( UniversalMapping.isUniversalMapping um ) ) ( lemma-cong2 a b f g eq ) |
46 | 140 lemma-cong : {a b : Obj A} {f g : Hom A a b} → A [ f ≈ g ] → B [ myFMap f ≈ myFMap g ] |
141 lemma-cong {a} {b} {f} {g} eq = lemma-cong1 a b f g eq | |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
142 lemma-distr2 : (a b c : Obj A) (f : Hom A a b) (g : Hom A b c) → |
47 | 143 A [ A [ FMap U (B [(_* um) (A [ η c o g ]) o (_* um)( A [ η b o f ]) ]) o η a ] ≈ (A [ η c o A [ g o f ] ]) ] |
144 lemma-distr2 a b c f g = let open ≈-Reasoning (A) in | |
145 begin | |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
146 ( FMap U (B [(_* um) (A [ η c o g ]) o (_* um)( A [ η b o f ]) ] ) ) o η a |
66 | 147 ≈⟨ car (distr U ) ⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
148 (( FMap U ((_* um) (A [ η c o g ])) o ( FMap U ((_* um)( A [ η b o f ])))) ) o η a |
47 | 149 ≈⟨ sym assoc ⟩ |
150 ( FMap U ((_* um) (A [ η c o g ])) o (( FMap U ((_* um)( A [ η b o f ])))) o η a ) | |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
151 ≈⟨ cdr ( IsUniversalMapping.universalMapping ( UniversalMapping.isUniversalMapping um )) ⟩ |
47 | 152 ( FMap U ((_* um) (A [ η c o g ])) o ( η b o f) ) |
153 ≈⟨ assoc ⟩ | |
154 ( FMap U ((_* um) (A [ η c o g ])) o η b) o f | |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
155 ≈⟨ car ( IsUniversalMapping.universalMapping ( UniversalMapping.isUniversalMapping um )) ⟩ |
47 | 156 ( η c o g ) o f |
157 ≈⟨ sym assoc ⟩ | |
158 η c o ( g o f ) | |
159 ∎ | |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
160 lemma-distr1 : (a b c : Obj A) (f : Hom A a b) (g : Hom A b c) → |
47 | 161 B [ (_* um) (A [ η c o A [ g o f ] ]) ≈ (B [(_* um) (A [ η c o g ]) o (_* um)( A [ η b o f ]) ] )] |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
162 lemma-distr1 a b c f g = ( IsUniversalMapping.uniquness ( UniversalMapping.isUniversalMapping um )) (lemma-distr2 a b c f g ) |
47 | 163 lemma-distr : {a b c : Obj A} {f : Hom A a b} {g : Hom A b c} → B [ myFMap (A [ g o f ]) ≈ (B [ myFMap g o myFMap f ] )] |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
164 lemma-distr {a} {b} {c} {f} {g} = lemma-distr1 a b c f g |
42 | 165 myIsFunctor : IsFunctor A B F myFMap |
166 myIsFunctor = | |
46 | 167 record { ≈-cong = lemma-cong |
42 | 168 ; identity = lemma-id |
47 | 169 ; distr = lemma-distr |
42 | 170 } |
41 | 171 |
48 | 172 -- |
173 -- naturality of η | |
174 -- | |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
175 nat-η : {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ') |
689 | 176 { U : Functor B A } |
690
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
177 → (um : UniversalMapping A B U ) → |
689 | 178 NTrans A A identityFunctor ( U ○ FunctorF A B um ) |
690
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
179 nat-η A B {U} um = record { |
48 | 180 TMap = η ; isNTrans = myIsNTrans |
181 } where | |
690
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
182 F : Obj A → Obj B |
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
183 F = UniversalMapping.F um |
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
184 η : (a : Obj A) → Hom A a ( FObj U (F a) ) |
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
185 η = UniversalMapping.η um |
48 | 186 F' : Functor A B |
54 | 187 F' = FunctorF A B um |
690
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
188 _* : (UniversalMapping A B U ) → { a : Obj A} { b : Obj B} → ( Hom A a (FObj U b) ) → Hom B (F a ) b |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
189 _* _ = UniversalMapping._* um |
130 | 190 commute : {a b : Obj A} {f : Hom A a b} |
48 | 191 → A [ A [ (FMap U (FMap F' f)) o ( η a ) ] ≈ A [ (η b ) o f ] ] |
130 | 192 commute {a} {b} {f} = let open ≈-Reasoning (A) in |
49 | 193 begin |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
194 (FMap U (FMap F' f)) o ( η a ) |
49 | 195 ≈⟨⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
196 (FMap U ((_* um) (A [ η b o f ]))) o ( η a ) |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
197 ≈⟨ (IsUniversalMapping.universalMapping ( UniversalMapping.isUniversalMapping um )) ⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
198 (η b ) o f |
49 | 199 ∎ |
48 | 200 myIsNTrans : IsNTrans A A identityFunctor ( U ○ F' ) η |
130 | 201 myIsNTrans = record { commute = commute } |
49 | 202 |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
203 nat-ε : {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ') |
689 | 204 { U : Functor B A } |
690
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
205 → (um : UniversalMapping A B U ) → |
689 | 206 NTrans B B ( FunctorF A B um ○ U ) identityFunctor |
690
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
207 nat-ε A B {U} um = record { |
49 | 208 TMap = ε ; isNTrans = myIsNTrans |
209 } where | |
690
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
210 F : Obj A → Obj B |
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
211 F = UniversalMapping.F um |
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
212 η : (a : Obj A) → Hom A a ( FObj U (F a) ) |
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
213 η = UniversalMapping.η um |
49 | 214 F' : Functor A B |
54 | 215 F' = FunctorF A B um |
690
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
216 _* : (UniversalMapping A B U ) → { a : Obj A} { b : Obj B} → ( Hom A a (FObj U b) ) → Hom B (F a ) b |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
217 _* _ = UniversalMapping._* um |
56 | 218 ε : ( b : Obj B ) → Hom B ( FObj F' ( FObj U b) ) b |
49 | 219 ε b = (_* um) ( id1 A (FObj U b)) |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
220 lemma-nat1 : (a b : Obj B) (f : Hom B a b ) → |
51 | 221 A [ A [ FMap U ( B [ (um *) (id1 A (FObj U b)) o ((um *) (A [ η (FObj U b) o FMap U f ])) ] ) o η (FObj U a) ] |
222 ≈ A [ FMap U f o id1 A (FObj U a) ] ] | |
223 lemma-nat1 a b f = let open ≈-Reasoning (A) in | |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
224 begin |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
225 FMap U ( B [ (um *) (id1 A (FObj U b)) o ((um *) ( η (FObj U b) o FMap U f )) ] ) o η (FObj U a) |
66 | 226 ≈⟨ car ( distr U ) ⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
227 ( FMap U ((um *) (id1 A (FObj U b))) o FMap U ((um *) ( η (FObj U b) o FMap U f )) ) o η (FObj U a) |
51 | 228 ≈⟨ sym assoc ⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
229 FMap U ((um *) (id1 A (FObj U b))) o ( FMap U ((um *) ( η (FObj U b) o FMap U f ))) o η (FObj U a) |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
230 ≈⟨ cdr ((IsUniversalMapping.universalMapping ( UniversalMapping.isUniversalMapping um )) ) ⟩ |
51 | 231 FMap U ((um *) (id1 A (FObj U b))) o ( η (FObj U b) o FMap U f ) |
232 ≈⟨ assoc ⟩ | |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
233 (FMap U ((um *) (id1 A (FObj U b))) o η (FObj U b)) o FMap U f |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
234 ≈⟨ car ((IsUniversalMapping.universalMapping ( UniversalMapping.isUniversalMapping um )) ) ⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
235 id1 A (FObj U b) o FMap U f |
51 | 236 ≈⟨ idL ⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
237 FMap U f |
51 | 238 ≈⟨ sym idR ⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
239 FMap U f o id (FObj U a) |
51 | 240 ∎ |
56 | 241 lemma-nat2 : (a b : Obj B) (f : Hom B a b ) → A [ A [ FMap U ( B [ f o ((um *) (id1 A (FObj U a ))) ] ) o η (FObj U a) ] |
52 | 242 ≈ A [ FMap U f o id1 A (FObj U a) ] ] |
243 lemma-nat2 a b f = let open ≈-Reasoning (A) in | |
244 begin | |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
245 FMap U ( B [ f o ((um *) (id1 A (FObj U a ))) ]) o η (FObj U a) |
66 | 246 ≈⟨ car ( distr U ) ⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
247 (FMap U f o FMap U ((um *) (id1 A (FObj U a )))) o η (FObj U a) |
52 | 248 ≈⟨ sym assoc ⟩ |
249 FMap U f o ( FMap U ((um *) (id1 A (FObj U a ))) o η (FObj U a) ) | |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
250 ≈⟨ cdr ( IsUniversalMapping.universalMapping ( UniversalMapping.isUniversalMapping um)) ⟩ |
52 | 251 FMap U f o id (FObj U a ) |
252 ∎ | |
130 | 253 commute : {a b : Obj B} {f : Hom B a b } |
49 | 254 → B [ B [ f o (ε a) ] ≈ B [(ε b) o (FMap F' (FMap U f)) ] ] |
130 | 255 commute {a} {b} {f} = let open ≈-Reasoning (B) in |
49 | 256 sym ( begin |
257 ε b o (FMap F' (FMap U f)) | |
258 ≈⟨⟩ | |
50 | 259 ε b o ((_* um) (A [ η (FObj U b) o (FMap U f) ])) |
260 ≈⟨⟩ | |
261 ((_* um) ( id1 A (FObj U b))) o ((_* um) (A [ η (FObj U b) o (FMap U f) ])) | |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
262 ≈⟨ sym ( ( IsUniversalMapping.uniquness ( UniversalMapping.isUniversalMapping um ) (lemma-nat1 a b f))) ⟩ |
51 | 263 (_* um) ( A [ FMap U f o id1 A (FObj U a) ] ) |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
264 ≈⟨ (IsUniversalMapping.uniquness ( UniversalMapping.isUniversalMapping um ) (lemma-nat2 a b f)) ⟩ |
50 | 265 f o ((_* um) ( id1 A (FObj U a))) |
266 ≈⟨⟩ | |
49 | 267 f o (ε a) |
268 ∎ ) | |
269 myIsNTrans : IsNTrans B B ( F' ○ U ) identityFunctor ε | |
130 | 270 myIsNTrans = record { commute = commute } |
53 | 271 |
272 ------ | |
273 -- | |
274 -- Adjunction Construction from Universal Mapping | |
275 -- | |
276 ----- | |
277 | |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
278 UMAdjunction : {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ') → |
690
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
279 ( U : Functor B A ) → |
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
280 (um : UniversalMapping A B U ) → |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
281 Adjunction A B |
690
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
282 UMAdjunction A B U um = record { |
689 | 283 U = U ; |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
284 F = FunctorF A B um ; |
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
285 η = nat-η A B um ; |
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
286 ε = nat-ε A B um ; |
53 | 287 isAdjunction = record { |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
288 adjoint1 = adjoint1 ; |
53 | 289 adjoint2 = adjoint2 |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
290 } |
53 | 291 } where |
690
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
292 F' : Obj A → Obj B |
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
293 F' = UniversalMapping.F um |
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
294 η' : (a : Obj A) → Hom A a ( FObj U (F' a) ) |
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
295 η' = UniversalMapping.η um |
53 | 296 F : Functor A B |
54 | 297 F = FunctorF A B um |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
298 η : NTrans A A identityFunctor ( U ○ F ) |
54 | 299 η = nat-η A B um |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
300 ε : NTrans B B ( F ○ U ) identityFunctor |
54 | 301 ε = nat-ε A B um |
690
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
302 _* : UniversalMapping A B U → { a : Obj A}{ b : Obj B} → ( Hom A a (FObj U b) ) → Hom B (FObj F a ) b |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
303 _* _ = UniversalMapping._* um |
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
304 isUniversalMapping = UniversalMapping.isUniversalMapping |
56 | 305 adjoint1 : { b : Obj B } → |
53 | 306 A [ A [ ( FMap U ( TMap ε b )) o ( TMap η ( FObj U b )) ] ≈ id1 A (FObj U b) ] |
55
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
307 adjoint1 {b} = let open ≈-Reasoning (A) in |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
308 begin |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
309 FMap U ( TMap ε b ) o TMap η ( FObj U b ) |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
310 ≈⟨⟩ |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
311 FMap U ((_* um) ( id1 A (FObj U b))) o η' ( FObj U b ) |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
312 ≈⟨ IsUniversalMapping.universalMapping ( isUniversalMapping um ) ⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
313 id (FObj U b) |
55
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
314 ∎ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
315 lemma-adj1 : (a : Obj A) → |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
316 A [ A [ FMap U ((B [((_* um) ( id1 A (FObj U ( FObj F a )))) o (_* um) (A [ η' (FObj U ( FObj F a )) o ( η' a ) ]) ])) o η' a ] |
55
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
317 ≈ (η' a) ] |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
318 lemma-adj1 a = let open ≈-Reasoning (A) in |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
319 begin |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
320 FMap U ((B [((_* um) ( id1 A (FObj U ( FObj F a )))) o (_* um) (A [ η' (FObj U ( FObj F a )) o ( η' a ) ]) ])) o η' a |
66 | 321 ≈⟨ car (distr U) ⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
322 (FMap U ((_* um) ( id1 A (FObj U ( FObj F a)))) o FMap U ((_* um) (A [ η' (FObj U ( FObj F a )) o ( η' a ) ]))) o η' a |
55
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
323 ≈⟨ sym assoc ⟩ |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
324 FMap U ((_* um) ( id1 A (FObj U ( FObj F a)))) o ( FMap U ((_* um) (A [ η' (FObj U ( FObj F a )) o ( η' a ) ])) o η' a ) |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
325 ≈⟨ cdr (IsUniversalMapping.universalMapping ( isUniversalMapping um)) ⟩ |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
326 FMap U ((_* um) ( id1 A (FObj U ( FObj F a)))) o ( η' (FObj U ( FObj F a )) o ( η' a ) ) |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
327 ≈⟨ assoc ⟩ |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
328 (FMap U ((_* um) ( id1 A (FObj U ( FObj F a)))) o ( η' (FObj U ( FObj F a )))) o ( η' a ) |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
329 ≈⟨ car (IsUniversalMapping.universalMapping ( isUniversalMapping um)) ⟩ |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
330 id (FObj U ( FObj F a)) o ( η' a ) |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
331 ≈⟨ idL ⟩ |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
332 η' a |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
333 ∎ |
56 | 334 lemma-adj2 : (a : Obj A) → A [ A [ FMap U (id1 B (FObj F a)) o η' a ] ≈ η' a ] |
55
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
335 lemma-adj2 a = let open ≈-Reasoning (A) in |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
336 begin |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
337 FMap U (id1 B (FObj F a)) o η' a |
55
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
338 ≈⟨ car ( IsFunctor.identity ( isFunctor U)) ⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
339 id (FObj U (FObj F a)) o η' a |
55
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
340 ≈⟨ idL ⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
341 η' a |
55
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
342 ∎ |
56 | 343 adjoint2 : {a : Obj A} → |
53 | 344 B [ B [ ( TMap ε ( FObj F a )) o ( FMap F ( TMap η a )) ] ≈ id1 B (FObj F a) ] |
55
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
345 adjoint2 {a} = let open ≈-Reasoning (B) in |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
346 begin |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
347 TMap ε ( FObj F a ) o FMap F ( TMap η a ) |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
348 ≈⟨⟩ |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
349 ((_* um) ( id1 A (FObj U ( FObj F a )))) o (_* um) (A [ η' (FObj U ( FObj F a )) o ( η' a ) ]) |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
350 ≈⟨ sym ( ( IsUniversalMapping.uniquness ( isUniversalMapping um ) (lemma-adj1 a))) ⟩ |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
351 (_* um)( η' a ) |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
352 ≈⟨ IsUniversalMapping.uniquness ( isUniversalMapping um ) (lemma-adj2 a) ⟩ |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
353 id1 B (FObj F a) |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
354 ∎ |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
355 |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
356 |
171 | 357 ------ |
358 -- | |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
359 -- Hom Set Adjunction |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
360 -- |
171 | 361 -- Hom(F(-),-) = Hom(-,U(-)) |
362 -- Unity of opposite | |
363 ----- | |
364 | |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
365 -- Assuming |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
366 -- naturality of left (Φ) |
177 | 367 -- k = Hom A b b' ; f' = k o f h Hom A a' a ; f' = f o h |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
368 -- left left |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
369 -- f : Hom A F(a) b ←------- f* : Hom B a U(b) f' : Hom A F(a')b ←------ f'* : Hom B a' U(b) |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
370 -- | -------→ | | | |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
371 -- |k right |U(k) |F(h) |h |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
372 -- ↓ ↓ ↓ ↓ |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
373 -- f': Hom A F(a) b'←------ f'* : Hom B a U(b') f: Hom A F(a) b ←-------- f* : Hom B a U(b) |
177 | 374 -- left left |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
375 |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
376 record UnityOfOppsite {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ') |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
377 ( U : Functor B A ) |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
378 ( F : Functor A B ) |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
379 : Set (suc (c₁ ⊔ c₂ ⊔ ℓ ⊔ c₁' ⊔ c₂' ⊔ ℓ' )) where |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
380 field |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
381 left : {a : Obj A} { b : Obj B } → Hom A a ( FObj U b ) → Hom B (FObj F a) b |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
382 right : {a : Obj A} { b : Obj B } → Hom B (FObj F a) b → Hom A a ( FObj U b ) |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
383 left-injective : {a : Obj A} { b : Obj B } → {f : Hom A a (FObj U b) } → A [ right ( left f ) ≈ f ] |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
384 right-injective : {a : Obj A} { b : Obj B } → {f : Hom B (FObj F a) b } → B [ left ( right f ) ≈ f ] |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
385 --- naturality of Φ |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
386 right-commute1 : {a : Obj A} {b b' : Obj B } → |
300 | 387 { f : Hom B (FObj F a) b } → { k : Hom B b b' } → |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
388 A [ right ( B [ k o f ] ) ≈ A [ FMap U k o right f ] ] |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
389 right-commute2 : {a a' : Obj A} {b : Obj B } → |
300 | 390 { f : Hom B (FObj F a) b } → { h : Hom A a' a } → |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
391 A [ right ( B [ f o FMap F h ] ) ≈ A [ right f o h ] ] |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
392 r-cong : {a : Obj A} { b : Obj B } → { f g : Hom A a ( FObj U b ) } → A [ f ≈ g ] → B [ left f ≈ left g ] |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
393 l-cong : {a : Obj A} { b : Obj B } → { f g : Hom B (FObj F a) b } → B [ f ≈ g ] → A [ right f ≈ right g ] |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
394 -- naturality of left (Φ-1) |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
395 left-commute1 : {a : Obj A} {b b' : Obj B } → |
300 | 396 { g : Hom A a (FObj U b)} → { k : Hom B b b' } → |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
397 B [ B [ k o left g ] ≈ left ( A [ FMap U k o g ] ) ] |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
398 left-commute1 {a} {b} {b'} {g} {k} = let open ≈-Reasoning (B) in |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
399 begin |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
400 k o left g |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
401 ≈⟨ sym right-injective ⟩ |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
402 left ( right ( k o left g ) ) |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
403 ≈⟨ r-cong right-commute1 ⟩ |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
404 left ( A [ FMap U k o right ( left g ) ] ) |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
405 ≈⟨ r-cong (lemma-1 g k) ⟩ |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
406 left ( A [ FMap U k o g ] ) |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
407 ∎ where |
300 | 408 lemma-1 : {a : Obj A} {b b' : Obj B } → |
409 ( g : Hom A a (FObj U b)) → ( k : Hom B b b' ) → | |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
410 A [ A [ FMap U k o right ( left g ) ] ≈ A [ FMap U k o g ] ] |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
411 lemma-1 g k = let open ≈-Reasoning (A) in |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
412 begin |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
413 FMap U k o right ( left g ) |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
414 ≈⟨ cdr ( left-injective) ⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
415 FMap U k o g |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
416 ∎ |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
417 left-commute2 : {a a' : Obj A} {b : Obj B } → |
300 | 418 { g : Hom A a (FObj U b) } → { h : Hom A a' a } → |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
419 B [ B [ left g o FMap F h ] ≈ left ( A [ g o h ] ) ] |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
420 left-commute2 {a} {a'} {b} {g} {h} = let open ≈-Reasoning (B) in |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
421 begin |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
422 left g o FMap F h |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
423 ≈⟨ sym right-injective ⟩ |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
424 left ( right ( left g o FMap F h )) |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
425 ≈⟨ r-cong right-commute2 ⟩ |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
426 left ( A [ right ( left g ) o h ] ) |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
427 ≈⟨ r-cong ( lemma-2 g h ) ⟩ |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
428 left ( A [ g o h ] ) |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
429 ∎ where |
300 | 430 lemma-2 : {a a' : Obj A} {b : Obj B } → |
431 ( g : Hom A a (FObj U b)) → ( h : Hom A a' a ) → | |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
432 A [ A [ right ( left g ) o h ] ≈ A [ g o h ] ] |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
433 lemma-2 g h = let open ≈-Reasoning (A) in car ( left-injective ) |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
434 |
171 | 435 Adj2UO : {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ') |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
436 ( adj : Adjunction A B ) → UnityOfOppsite A B (Adjunction.U adj) (Adjunction.F adj) |
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
437 Adj2UO A B adj = record { |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
438 left = left ; |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
439 right = right ; |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
440 left-injective = left-injective ; |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
441 right-injective = right-injective ; |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
442 right-commute1 = right-commute1 ; |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
443 right-commute2 = right-commute2 ; |
175
795be747d7a9
hom-set to universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
174
diff
changeset
|
444 r-cong = r-cong ; |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
445 l-cong = l-cong |
171 | 446 } where |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
447 U : Functor B A |
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
448 U = Adjunction.U adj |
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
449 F : Functor A B |
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
450 F = Adjunction.F adj |
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
451 η : NTrans A A identityFunctor ( U ○ F ) |
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
452 η = Adjunction.η adj |
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
453 ε : NTrans B B ( F ○ U ) identityFunctor |
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
454 ε = Adjunction.ε adj |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
455 left : {a : Obj A} { b : Obj B } → Hom A a ( FObj U b ) → Hom B (FObj F a) b |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
456 left {a} {b} f = B [ TMap ε b o FMap F f ] |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
457 right : {a : Obj A} { b : Obj B } → Hom B (FObj F a) b → Hom A a ( FObj U b ) |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
458 right {a} {b} f = A [ FMap U f o (TMap η a) ] |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
459 left-injective : {a : Obj A} { b : Obj B } → {f : Hom A a (FObj U b) } → A [ right ( left f ) ≈ f ] |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
460 left-injective {a} {b} {f} = let open ≈-Reasoning (A) in |
171 | 461 begin |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
462 FMap U (B [ TMap ε b o FMap F f ]) o (TMap η a) |
171 | 463 ≈⟨ car ( distr U ) ⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
464 ( FMap U (TMap ε b) o FMap U (FMap F f )) o (TMap η a) |
171 | 465 ≈↑⟨ assoc ⟩ |
466 FMap U (TMap ε b) o ( FMap U (FMap F f ) o (TMap η a) ) | |
467 ≈⟨ cdr ( nat η) ⟩ | |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
468 FMap U (TMap ε b) o ((TMap η (FObj U b)) o f ) |
171 | 469 ≈⟨ assoc ⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
470 (FMap U (TMap ε b) o (TMap η (FObj U b))) o f |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
471 ≈⟨ car ( IsAdjunction.adjoint1 ( Adjunction.isAdjunction adj )) ⟩ |
171 | 472 id1 A (FObj U b) o f |
473 ≈⟨ idL ⟩ | |
474 f | |
475 ∎ | |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
476 right-injective : {a : Obj A} { b : Obj B } → {f : Hom B (FObj F a) b } → B [ left ( right f ) ≈ f ] |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
477 right-injective {a} {b} {f} = let open ≈-Reasoning (B) in |
171 | 478 begin |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
479 TMap ε b o FMap F ( A [ FMap U f o (TMap η a) ]) |
171 | 480 ≈⟨ cdr ( distr F ) ⟩ |
481 TMap ε b o ( FMap F (FMap U f) o FMap F (TMap η a)) | |
482 ≈⟨ assoc ⟩ | |
483 ( TMap ε b o FMap F (FMap U f)) o FMap F (TMap η a) | |
484 ≈↑⟨ car (nat ε) ⟩ | |
485 ( f o TMap ε ( FObj F a )) o ( FMap F ( TMap η a )) | |
486 ≈↑⟨ assoc ⟩ | |
487 f o ( TMap ε ( FObj F a ) o ( FMap F ( TMap η a ))) | |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
488 ≈⟨ cdr ( IsAdjunction.adjoint2 ( Adjunction.isAdjunction adj )) ⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
489 f o id1 B (FObj F a) |
171 | 490 ≈⟨ idR ⟩ |
491 f | |
492 ∎ | |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
493 right-commute1 : {a : Obj A} {b b' : Obj B } → |
300 | 494 { f : Hom B (FObj F a) b } → { k : Hom B b b' } → |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
495 A [ right ( B [ k o f ] ) ≈ A [ FMap U k o right f ] ] |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
496 right-commute1 {a} {b} {b'} {f} {k} = let open ≈-Reasoning (A) in |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
497 begin |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
498 right ( B [ k o f ] ) |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
499 ≈⟨⟩ |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
500 FMap U ( B [ k o f ] ) o (TMap η a) |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
501 ≈⟨ car (distr U) ⟩ |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
502 ( FMap U k o FMap U f ) o (TMap η a) |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
503 ≈↑⟨ assoc ⟩ |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
504 FMap U k o ( FMap U f o (TMap η a) ) |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
505 ≈⟨⟩ |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
506 FMap U k o right f |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
507 ∎ |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
508 right-commute2 : {a a' : Obj A} {b : Obj B } → |
300 | 509 { f : Hom B (FObj F a) b } → { h : Hom A a' a} → |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
510 A [ right ( B [ f o FMap F h ] ) ≈ A [ right f o h ] ] |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
511 right-commute2 {a'} {a} {b} {f} {h} = let open ≈-Reasoning (A) in |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
512 begin |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
513 right ( B [ f o FMap F h ] ) |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
514 ≈⟨⟩ |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
515 FMap U ( B [ f o FMap F h ] ) o TMap η a |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
516 ≈⟨ car (distr U ) ⟩ |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
517 (FMap U f o FMap U (FMap F h )) o TMap η a |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
518 ≈↑⟨ assoc ⟩ |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
519 FMap U f o ( FMap U (FMap F h ) o TMap η a ) |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
520 ≈⟨ cdr ( nat η) ⟩ |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
521 FMap U f o (TMap η a' o h ) |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
522 ≈⟨ assoc ⟩ |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
523 ( FMap U f o TMap η a') o h |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
524 ≈⟨⟩ |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
525 right f o h |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
526 ∎ |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
527 |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
528 r-cong : {a : Obj A} { b : Obj B } → { f g : Hom A a ( FObj U b ) } → A [ f ≈ g ] → B [ left f ≈ left g ] |
175
795be747d7a9
hom-set to universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
174
diff
changeset
|
529 r-cong eq = let open ≈-Reasoning (B) in ( cdr ( fcong F eq ) ) |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
530 l-cong : {a : Obj A} { b : Obj B } → { f g : Hom B (FObj F a) b } → B [ f ≈ g ] → A [ right f ≈ right g ] |
175
795be747d7a9
hom-set to universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
174
diff
changeset
|
531 l-cong eq = let open ≈-Reasoning (A) in ( car ( fcong U eq ) ) |
795be747d7a9
hom-set to universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
174
diff
changeset
|
532 |
171 | 533 |
534 open UnityOfOppsite | |
535 | |
300 | 536 -- f : a ----------→ U(b) |
537 -- 1_F(a) :F(a) --------→ F(a) | |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
538 -- ε(b) = left uo (1_F(a)) :UF(b)--------→ a |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
539 -- η(a) = right uo (1_U(a)) : a ----------→ FU(a) |
172 | 540 |
541 | |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
542 uo-η-map : {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ') |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
543 ( U : Functor B A ) |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
544 ( F : Functor A B ) → |
174
1c4788483d46
add more axiom on unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
173
diff
changeset
|
545 ( uo : UnityOfOppsite A B U F) → (a : Obj A ) → Hom A a (FObj U ( FObj F a )) |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
546 uo-η-map A B U F uo a = right uo ( id1 B (FObj F a) ) |
174
1c4788483d46
add more axiom on unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
173
diff
changeset
|
547 |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
548 uo-ε-map : {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ') |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
549 ( U : Functor B A ) |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
550 ( F : Functor A B ) → |
174
1c4788483d46
add more axiom on unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
173
diff
changeset
|
551 ( uo : UnityOfOppsite A B U F) → (b : Obj B ) → Hom B (FObj F ( FObj U ( b ) )) b |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
552 uo-ε-map A B U F uo b = left uo ( id1 A (FObj U b) ) |
172 | 553 |
554 uo-solution : {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ') | |
555 ( U : Functor B A ) | |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
556 ( F : Functor A B ) → |
300 | 557 ( uo : UnityOfOppsite A B U F) → {a : Obj A} {b : Obj B } → |
558 ( f : Hom A a (FObj U b )) → Hom B (FObj F a) b | |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
559 uo-solution A B U F uo {a} {b} f = -- B [ left uo (id1 A (FObj U b)) o FMap F f ] |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
560 left uo f |
172 | 561 |
173 | 562 -- F(ε(b)) o η(F(b)) |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
563 -- F( left uo (id1 A (FObj U b)) ) o right uo (id1 B (FObj F a)) ] == 1 |
172 | 564 |
565 UO2UM : {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ') | |
566 ( U : Functor B A ) | |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
567 ( F : Functor A B ) → |
690
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
568 ( uo : UnityOfOppsite A B U F) → UniversalMapping A B U |
172 | 569 UO2UM A B U F uo = record { |
690
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
570 F = FObj F ; |
3d41a8edbf63
fix universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
689
diff
changeset
|
571 η = uo-η-map A B U F uo ; |
172 | 572 _* = uo-solution A B U F uo ; |
573 isUniversalMapping = record { | |
574 universalMapping = universalMapping; | |
575 uniquness = uniqueness | |
576 } | |
577 } where | |
578 universalMapping : {a' : Obj A} { b' : Obj B } → { f : Hom A a' (FObj U b') } → | |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
579 A [ A [ FMap U ( uo-solution A B U F uo f) o ( uo-η-map A B U F uo ) a' ] ≈ f ] |
172 | 580 universalMapping {a} {b} {f} = let open ≈-Reasoning (A) in |
171 | 581 begin |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
582 FMap U ( uo-solution A B U F uo f) o ( uo-η-map A B U F uo ) a |
174
1c4788483d46
add more axiom on unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
173
diff
changeset
|
583 ≈⟨⟩ |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
584 FMap U ( left uo f) o right uo ( id1 B (FObj F a) ) |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
585 ≈↑⟨ right-commute1 uo ⟩ |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
586 right uo ( B [ left uo f o id1 B (FObj F a) ] ) |
175
795be747d7a9
hom-set to universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
174
diff
changeset
|
587 ≈⟨ l-cong uo lemma-1 ⟩ |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
588 right uo ( left uo f ) |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
589 ≈⟨ left-injective uo ⟩ |
172 | 590 f |
175
795be747d7a9
hom-set to universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
174
diff
changeset
|
591 ∎ where |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
592 lemma-1 : B [ B [ left uo f o id1 B (FObj F a) ] ≈ left uo f ] |
175
795be747d7a9
hom-set to universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
174
diff
changeset
|
593 lemma-1 = let open ≈-Reasoning (B) in idR |
172 | 594 uniqueness : {a' : Obj A} { b' : Obj B } → { f : Hom A a' (FObj U b') } → { g : Hom B (FObj F a') b'} → |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
595 A [ A [ FMap U g o ( uo-η-map A B U F uo ) a' ] ≈ f ] → B [ uo-solution A B U F uo f ≈ g ] |
172 | 596 uniqueness {a} {b} {f} {g} eq = let open ≈-Reasoning (B) in |
597 begin | |
598 uo-solution A B U F uo f | |
175
795be747d7a9
hom-set to universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
174
diff
changeset
|
599 ≈⟨⟩ |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
600 left uo f |
175
795be747d7a9
hom-set to universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
174
diff
changeset
|
601 ≈↑⟨ r-cong uo eq ⟩ |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
602 left uo ( A [ FMap U g o right uo ( id1 B (FObj F a) ) ] ) |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
603 ≈↑⟨ r-cong uo ( right-commute1 uo ) ⟩ |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
604 left uo ( right uo ( g o ( id1 B (FObj F a) ) ) ) |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
605 ≈⟨ right-injective uo ⟩ |
175
795be747d7a9
hom-set to universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
174
diff
changeset
|
606 g o ( id1 B (FObj F a) ) |
795be747d7a9
hom-set to universal mapping done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
174
diff
changeset
|
607 ≈⟨ idR ⟩ |
172 | 608 g |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
609 ∎ |
171 | 610 |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
611 uo-η : {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ') |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
612 ( U : Functor B A ) |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
613 ( F : Functor A B ) → |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
614 ( uo : UnityOfOppsite A B U F) → NTrans A A identityFunctor ( U ○ F ) |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
615 uo-η A B U F uo = record { |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
616 TMap = uo-η-map A B U F uo ; isNTrans = myIsNTrans |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
617 } where |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
618 η = uo-η-map A B U F uo |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
619 commute : {a b : Obj A} {f : Hom A a b} |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
620 → A [ A [ (FMap U (FMap F f)) o ( η a ) ] ≈ A [ (η b ) o f ] ] |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
621 commute {a} {b} {f} = let open ≈-Reasoning (A) in |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
622 begin |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
623 (FMap U (FMap F f)) o (right uo ( id1 B (FObj F a) ) ) |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
624 ≈↑⟨ right-commute1 uo ⟩ |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
625 right uo ( B [ (FMap F f) o ( id1 B (FObj F a) ) ] ) |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
626 ≈⟨ l-cong uo (IsCategory.identityR (Category.isCategory B)) ⟩ |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
627 right uo ( FMap F f ) |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
628 ≈↑⟨ l-cong uo (IsCategory.identityL (Category.isCategory B)) ⟩ |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
629 right uo ( B [ ( id1 B (FObj F b )) o FMap F f ] ) |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
630 ≈⟨ right-commute2 uo ⟩ |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
631 (right uo ( id1 B (FObj F b) ) ) o f |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
632 ≈⟨⟩ |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
633 (η b ) o f |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
634 ∎ where |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
635 lemma-1 : B [ B [ (FMap F f) o ( id1 B (FObj F a) ) ] ≈ FMap F f ] |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
636 lemma-1 = IsCategory.identityR (Category.isCategory B) |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
637 myIsNTrans : IsNTrans A A identityFunctor ( U ○ F ) η |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
638 myIsNTrans = record { commute = commute } |
171 | 639 |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
640 uo-ε : {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ') |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
641 ( U : Functor B A ) |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
642 ( F : Functor A B )→ |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
643 ( uo : UnityOfOppsite A B U F) → NTrans B B ( F ○ U ) identityFunctor |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
644 uo-ε A B U F uo = record { |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
645 TMap = ε ; isNTrans = myIsNTrans |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
646 } where |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
647 ε = uo-ε-map A B U F uo |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
648 commute : {a b : Obj B} {f : Hom B a b } |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
649 → B [ B [ f o (ε a) ] ≈ B [(ε b) o (FMap F (FMap U f)) ] ] |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
650 commute {a} {b} {f} = let open ≈-Reasoning (B) in |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
651 sym ( begin |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
652 ε b o (FMap F (FMap U f)) |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
653 ≈⟨⟩ |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
654 left uo ( id1 A (FObj U b) ) o (FMap F (FMap U f)) |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
655 ≈⟨ left-commute2 uo ⟩ |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
656 left uo ( A [ id1 A (FObj U b) o FMap U f ] ) |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
657 ≈⟨ r-cong uo (IsCategory.identityL (Category.isCategory A)) ⟩ |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
658 left uo ( FMap U f ) |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
659 ≈↑⟨ r-cong uo (IsCategory.identityR (Category.isCategory A)) ⟩ |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
660 left uo ( A [ FMap U f o id1 A (FObj U a) ] ) |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
661 ≈↑⟨ left-commute1 uo ⟩ |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
662 f o left uo ( id1 A (FObj U a) ) |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
663 ≈⟨⟩ |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
664 f o (ε a) |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
665 ∎ ) |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
666 myIsNTrans : IsNTrans B B ( F ○ U ) identityFunctor ε |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
667 myIsNTrans = record { commute = commute } |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
668 |
172 | 669 |
171 | 670 UO2Adj : {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ') |
671 { U : Functor B A } | |
672 { F : Functor A B } | |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
673 ( uo : UnityOfOppsite A B U F) |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
674 → Adjunction A B |
171 | 675 UO2Adj A B {U} {F} uo = record { |
688
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
676 U = U ; |
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
677 F = F ; |
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
678 η = uo-η A B U F uo ; |
a5f2ca67e7c5
fix monad/adjunction definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
300
diff
changeset
|
679 ε = uo-ε A B U F uo ; |
171 | 680 isAdjunction = record { |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
681 adjoint1 = adjoint1 ; |
171 | 682 adjoint2 = adjoint2 |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
683 } |
171 | 684 } where |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
685 um = UO2UM A B U F uo |
171 | 686 adjoint1 : { b : Obj B } → |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
687 A [ A [ ( FMap U ( TMap (uo-ε A B U F uo) b )) o ( TMap (uo-η A B U F uo) ( FObj U b )) ] ≈ id1 A (FObj U b) ] |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
688 adjoint1 {b} = let open ≈-Reasoning (A) in |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
689 begin |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
690 ( FMap U ( TMap (uo-ε A B U F uo) b )) o ( TMap (uo-η A B U F uo) ( FObj U b )) |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
691 ≈⟨⟩ |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
692 FMap U (left uo (id1 A (FObj U b))) o (right uo (id1 B (FObj F (FObj U b)))) |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
693 ≈↑⟨ right-commute1 uo ⟩ |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
694 right uo ( B [ left uo (id1 A (FObj U b)) o id1 B (FObj F (FObj U b)) ] ) |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
695 ≈⟨ l-cong uo ((IsCategory.identityR (Category.isCategory B))) ⟩ |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
696 right uo ( left uo (id1 A (FObj U b)) ) |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
697 ≈⟨ left-injective uo ⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
698 id1 A (FObj U b) |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
699 ∎ |
171 | 700 adjoint2 : {a : Obj A} → |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
701 B [ B [ ( TMap (uo-ε A B U F uo) ( FObj F a )) o ( FMap F ( TMap (uo-η A B U F uo) a )) ] ≈ id1 B (FObj F a) ] |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
702 adjoint2 {a} = let open ≈-Reasoning (B) in |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
703 begin |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
704 ( TMap (uo-ε A B U F uo) ( FObj F a )) o ( FMap F ( TMap (uo-η A B U F uo) a )) |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
705 ≈⟨⟩ |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
706 left uo (Category.Category.Id A) o FMap F (right uo (id1 B (FObj F a))) |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
707 ≈⟨ left-commute2 uo ⟩ |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
708 left uo ( A [ (Category.Category.Id A) o (right uo (id1 B (FObj F a))) ] ) |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
709 ≈⟨ r-cong uo ((IsCategory.identityL (Category.isCategory A))) ⟩ |
775
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
710 left uo ( right uo (id1 B (FObj F a))) |
06a7831cf6ce
exchange left and right
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
690
diff
changeset
|
711 ≈⟨ right-injective uo ⟩ |
176
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
712 id1 B (FObj F a) |
ae1a4f7e5203
hom set adjunction done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
175
diff
changeset
|
713 ∎ |
171 | 714 |
715 | |
55
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
716 -- done! |
1716403c92c2
Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
717 |