annotate universal-mapping.agda @ 171:d25b0948e006

unity of oppsite
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 23 Aug 2013 10:11:58 +0900
parents 0be3e0a49cca
children c7fef385330f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
31
17b8bafebad7 add universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 module universal-mapping where
17b8bafebad7 add universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
3 -- Shinji KONO <kono@ie.u-ryukyu.ac.jp>
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
4
31
17b8bafebad7 add universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 open import Category -- https://github.com/konn/category-agda
17b8bafebad7 add universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 open import Level
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
7 open import HomReasoning
159
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 130
diff changeset
8 open import cat-utility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 130
diff changeset
9 open import Category.Cat
31
17b8bafebad7 add universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10
17b8bafebad7 add universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 open Functor
32
7862ad3b000f Adjoint
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 31
diff changeset
12 open NTrans
7862ad3b000f Adjoint
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 31
diff changeset
13
43
5506abc832c7 uniqness
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 42
diff changeset
14 --
5506abc832c7 uniqness
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 42
diff changeset
15 -- Adjunction yields solution of universal mapping
5506abc832c7 uniqness
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 42
diff changeset
16 --
5506abc832c7 uniqness
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 42
diff changeset
17 --
5506abc832c7 uniqness
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 42
diff changeset
18
34
306aa1873b2f trying...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 33
diff changeset
19 open Adjunction
306aa1873b2f trying...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 33
diff changeset
20 open UniversalMapping
35
4ac419251f86 f∗ = ε(b)F(f),
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 34
diff changeset
21
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
22 Adj2UM : {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ')
54
5d2a33bb1291 cleanup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 53
diff changeset
23 { U : Functor B A }
5d2a33bb1291 cleanup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 53
diff changeset
24 { F : Functor A B }
5d2a33bb1291 cleanup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 53
diff changeset
25 { η : NTrans A A identityFunctor ( U ○ F ) }
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
26 { ε : NTrans B B ( F ○ U ) identityFunctor } →
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
27 Adjunction A B U F η ε → UniversalMapping A B U (FObj F) (TMap η)
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
28 Adj2UM A B {U} {F} {η} {ε} adj = record {
43
5506abc832c7 uniqness
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 42
diff changeset
29 _* = solution ;
36
ad997bd9788b isUniversalMapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
30 isUniversalMapping = record {
43
5506abc832c7 uniqness
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 42
diff changeset
31 universalMapping = universalMapping;
51
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
32 uniquness = uniqness
36
ad997bd9788b isUniversalMapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
33 }
ad997bd9788b isUniversalMapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
34 } where
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
35 solution : { a : Obj A} { b : Obj B} → ( f : Hom A a (FObj U b) ) → Hom B (FObj F a ) b
43
5506abc832c7 uniqness
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 42
diff changeset
36 solution {_} {b} f = B [ TMap ε b o FMap F f ]
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
37 universalMapping : {a' : Obj A} { b' : Obj B } → { f : Hom A a' (FObj U b') } →
43
5506abc832c7 uniqness
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 42
diff changeset
38 A [ A [ FMap U ( solution f) o TMap η a' ] ≈ f ]
51
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
39 universalMapping {a} {b} {f} =
38
999e637d14c7 reasoning
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 37
diff changeset
40 let open ≈-Reasoning (A) in
999e637d14c7 reasoning
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 37
diff changeset
41 begin
43
5506abc832c7 uniqness
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 42
diff changeset
42 FMap U ( solution f) o TMap η a
39
77c3a5292a2f Reasoning
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 38
diff changeset
43 ≈⟨⟩
77c3a5292a2f Reasoning
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 38
diff changeset
44 FMap U ( B [ TMap ε b o FMap F f ] ) o TMap η a
66
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 56
diff changeset
45 ≈⟨ car (distr U ) ⟩
39
77c3a5292a2f Reasoning
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 38
diff changeset
46 ( (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
47 ≈⟨ sym assoc ⟩
c34b1cfe9fdc Adjunction to Universal Mapping end
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 39
diff changeset
48 (FMap U (TMap ε b)) o ((FMap U ( FMap F f )) o TMap η a )
66
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 56
diff changeset
49 ≈⟨ cdr (nat η) ⟩
40
c34b1cfe9fdc Adjunction to Universal Mapping end
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 39
diff changeset
50 (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
51 ≈⟨ assoc ⟩
c34b1cfe9fdc Adjunction to Universal Mapping end
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 39
diff changeset
52 ((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
53 ≈⟨ car ( IsAdjunction.adjoint1 ( isAdjunction adj)) ⟩
c34b1cfe9fdc Adjunction to Universal Mapping end
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 39
diff changeset
54 id (FObj U b) o f
c34b1cfe9fdc Adjunction to Universal Mapping end
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 39
diff changeset
55 ≈⟨ idL ⟩
38
999e637d14c7 reasoning
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 37
diff changeset
56 f
999e637d14c7 reasoning
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 37
diff changeset
57
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
58 lemma1 : (a : Obj A) ( b : Obj B ) ( f : Hom A a (FObj U b) ) → ( g : Hom B (FObj F a) b) →
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
59 A [ A [ FMap U g o TMap η a ] ≈ f ] →
44
a626fdd909c3 f replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 43
diff changeset
60 B [ (FMap F (A [ FMap U g o TMap η a ] )) ≈ FMap F f ]
a626fdd909c3 f replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 43
diff changeset
61 lemma1 a b f g k = IsFunctor.≈-cong (isFunctor F) k
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
62 uniqness : {a' : Obj A} { b' : Obj B } → { f : Hom A a' (FObj U b') } → { g : Hom B (FObj F a') b'} →
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
63 A [ A [ FMap U g o TMap η a' ] ≈ f ] → B [ solution f ≈ g ]
52
0fc0dbda7b55 nat-ε proved
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 51
diff changeset
64 uniqness {a} {b} {f} {g} k = let open ≈-Reasoning (B) in
44
a626fdd909c3 f replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 43
diff changeset
65 begin
a626fdd909c3 f replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 43
diff changeset
66 solution f
a626fdd909c3 f replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 43
diff changeset
67 ≈⟨⟩
a626fdd909c3 f replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 43
diff changeset
68 TMap ε b o FMap F f
45
659b8a21caf7 uniq-univeralMapping from Adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 44
diff changeset
69 ≈⟨ cdr (sym ( lemma1 a b f g k )) ⟩
44
a626fdd909c3 f replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 43
diff changeset
70 TMap ε b o FMap F ( A [ FMap U g o TMap η a ] )
66
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 56
diff changeset
71 ≈⟨ cdr (distr F ) ⟩
45
659b8a21caf7 uniq-univeralMapping from Adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 44
diff changeset
72 TMap ε b o ( FMap F ( FMap U g) o FMap F ( TMap η a ) )
659b8a21caf7 uniq-univeralMapping from Adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 44
diff changeset
73 ≈⟨ assoc ⟩
659b8a21caf7 uniq-univeralMapping from Adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 44
diff changeset
74 ( TMap ε b o FMap F ( FMap U g) ) o FMap F ( TMap η a )
66
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 56
diff changeset
75 ≈⟨ sym ( car ( nat ε )) ⟩
45
659b8a21caf7 uniq-univeralMapping from Adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 44
diff changeset
76 ( g o TMap ε ( FObj F a) ) o FMap F ( TMap η a )
659b8a21caf7 uniq-univeralMapping from Adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 44
diff changeset
77 ≈⟨ sym assoc ⟩
659b8a21caf7 uniq-univeralMapping from Adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 44
diff changeset
78 g o ( TMap ε ( FObj F a) o FMap F ( TMap η a ) )
659b8a21caf7 uniq-univeralMapping from Adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 44
diff changeset
79 ≈⟨ cdr ( IsAdjunction.adjoint2 ( isAdjunction adj )) ⟩
659b8a21caf7 uniq-univeralMapping from Adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 44
diff changeset
80 g o id (FObj F a)
659b8a21caf7 uniq-univeralMapping from Adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 44
diff changeset
81 ≈⟨ idR ⟩
44
a626fdd909c3 f replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 43
diff changeset
82 g
a626fdd909c3 f replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 43
diff changeset
83
a626fdd909c3 f replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 43
diff changeset
84
43
5506abc832c7 uniqness
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 42
diff changeset
85 --
5506abc832c7 uniqness
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 42
diff changeset
86 --
5506abc832c7 uniqness
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 42
diff changeset
87 -- Universal mapping yields Adjunction
5506abc832c7 uniqness
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 42
diff changeset
88 --
5506abc832c7 uniqness
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 42
diff changeset
89 --
5506abc832c7 uniqness
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 42
diff changeset
90
5506abc832c7 uniqness
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 42
diff changeset
91
5506abc832c7 uniqness
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 42
diff changeset
92 --
5506abc832c7 uniqness
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 42
diff changeset
93 -- F is an functor
5506abc832c7 uniqness
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 42
diff changeset
94 --
5506abc832c7 uniqness
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 42
diff changeset
95
54
5d2a33bb1291 cleanup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 53
diff changeset
96 FunctorF : {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ')
5d2a33bb1291 cleanup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 53
diff changeset
97 { U : Functor B A }
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
98 { F : Obj A → Obj B }
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
99 { η : (a : Obj A) → Hom A a ( FObj U (F a) ) } →
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
100 UniversalMapping A B U F η → Functor A B
54
5d2a33bb1291 cleanup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 53
diff changeset
101 FunctorF A B {U} {F} {η} um = record {
41
e9fa5c95eff7 isFunctor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 40
diff changeset
102 FObj = F;
42
9694f93977ca Functor Identity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 41
diff changeset
103 FMap = myFMap ;
9694f93977ca Functor Identity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 41
diff changeset
104 isFunctor = myIsFunctor
41
e9fa5c95eff7 isFunctor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 40
diff changeset
105 } where
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
106 myFMap : {a b : Obj A} → Hom A a b → Hom B (F a) (F b)
42
9694f93977ca Functor Identity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 41
diff changeset
107 myFMap f = (_* um) (A [ η (Category.cod A f ) o f ])
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
108 lemma-id1 : {a : Obj A} → A [ A [ FMap U (id1 B (F a)) o η a ] ≈ (A [ (η a) o (id1 A a) ]) ]
46
5d1b0fd2ad21 Functor cong done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 45
diff changeset
109 lemma-id1 {a} = let open ≈-Reasoning (A) in
42
9694f93977ca Functor Identity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 41
diff changeset
110 begin
46
5d1b0fd2ad21 Functor cong done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 45
diff changeset
111 FMap U (id1 B (F a)) o η a
42
9694f93977ca Functor Identity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 41
diff changeset
112 ≈⟨ ( car ( IsFunctor.identity ( isFunctor U ))) ⟩
46
5d1b0fd2ad21 Functor cong done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 45
diff changeset
113 id (FObj U ( F a )) o η a
42
9694f93977ca Functor Identity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 41
diff changeset
114 ≈⟨ idL ⟩
9694f93977ca Functor Identity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 41
diff changeset
115 η a
9694f93977ca Functor Identity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 41
diff changeset
116 ≈⟨ sym idR ⟩
46
5d1b0fd2ad21 Functor cong done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 45
diff changeset
117 η a o id a
42
9694f93977ca Functor Identity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 41
diff changeset
118
46
5d1b0fd2ad21 Functor cong done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 45
diff changeset
119 lemma-id : {a : Obj A} → B [ ( (_* um) (A [ (η a) o (id1 A a)] )) ≈ (id1 B (F a)) ]
52
0fc0dbda7b55 nat-ε proved
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 51
diff changeset
120 lemma-id {a} = ( IsUniversalMapping.uniquness ( isUniversalMapping um ) ) lemma-id1
46
5d1b0fd2ad21 Functor cong done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 45
diff changeset
121 lemma-cong2 : (a b : Obj A) (f g : Hom A a b) → A [ f ≈ g ] →
5d1b0fd2ad21 Functor cong done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 45
diff changeset
122 A [ A [ FMap U ((_* um) (A [ η b o g ]) ) o η a ] ≈ A [ η b o f ] ]
5d1b0fd2ad21 Functor cong done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 45
diff changeset
123 lemma-cong2 a b f g eq = let open ≈-Reasoning (A) in
5d1b0fd2ad21 Functor cong done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 45
diff changeset
124 begin
5d1b0fd2ad21 Functor cong done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 45
diff changeset
125 ( FMap U ((_* um) (A [ η b o g ]) )) o η a
51
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
126 ≈⟨ ( IsUniversalMapping.universalMapping ( isUniversalMapping um )) ⟩
46
5d1b0fd2ad21 Functor cong done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 45
diff changeset
127 η b o g
5d1b0fd2ad21 Functor cong done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 45
diff changeset
128 ≈⟨ ( IsCategory.o-resp-≈ ( Category.isCategory A ) (sym eq) (refl-hom) ) ⟩
5d1b0fd2ad21 Functor cong done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 45
diff changeset
129 η b o f
5d1b0fd2ad21 Functor cong done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 45
diff changeset
130
5d1b0fd2ad21 Functor cong done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 45
diff changeset
131 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 ]) ]
52
0fc0dbda7b55 nat-ε proved
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 51
diff changeset
132 lemma-cong1 a b f g eq = ( IsUniversalMapping.uniquness ( isUniversalMapping um ) ) ( lemma-cong2 a b f g eq )
46
5d1b0fd2ad21 Functor cong done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 45
diff changeset
133 lemma-cong : {a b : Obj A} {f g : Hom A a b} → A [ f ≈ g ] → B [ myFMap f ≈ myFMap g ]
5d1b0fd2ad21 Functor cong done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 45
diff changeset
134 lemma-cong {a} {b} {f} {g} eq = lemma-cong1 a b f g eq
47
0124e3c971e5 F is Functor proved.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 46
diff changeset
135 lemma-distr2 : (a b c : Obj A) (f : Hom A a b) (g : Hom A b c) →
0124e3c971e5 F is Functor proved.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 46
diff changeset
136 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 ] ]) ]
0124e3c971e5 F is Functor proved.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 46
diff changeset
137 lemma-distr2 a b c f g = let open ≈-Reasoning (A) in
0124e3c971e5 F is Functor proved.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 46
diff changeset
138 begin
0124e3c971e5 F is Functor proved.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 46
diff changeset
139 ( FMap U (B [(_* um) (A [ η c o g ]) o (_* um)( A [ η b o f ]) ] ) ) o η a
66
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 56
diff changeset
140 ≈⟨ car (distr U ) ⟩
47
0124e3c971e5 F is Functor proved.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 46
diff changeset
141 (( FMap U ((_* um) (A [ η c o g ])) o ( FMap U ((_* um)( A [ η b o f ])))) ) o η a
0124e3c971e5 F is Functor proved.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 46
diff changeset
142 ≈⟨ sym assoc ⟩
0124e3c971e5 F is Functor proved.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 46
diff changeset
143 ( FMap U ((_* um) (A [ η c o g ])) o (( FMap U ((_* um)( A [ η b o f ])))) o η a )
51
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
144 ≈⟨ cdr ( IsUniversalMapping.universalMapping ( isUniversalMapping um )) ⟩
47
0124e3c971e5 F is Functor proved.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 46
diff changeset
145 ( FMap U ((_* um) (A [ η c o g ])) o ( η b o f) )
0124e3c971e5 F is Functor proved.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 46
diff changeset
146 ≈⟨ assoc ⟩
0124e3c971e5 F is Functor proved.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 46
diff changeset
147 ( FMap U ((_* um) (A [ η c o g ])) o η b) o f
51
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
148 ≈⟨ car ( IsUniversalMapping.universalMapping ( isUniversalMapping um )) ⟩
47
0124e3c971e5 F is Functor proved.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 46
diff changeset
149 ( η c o g ) o f
0124e3c971e5 F is Functor proved.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 46
diff changeset
150 ≈⟨ sym assoc ⟩
0124e3c971e5 F is Functor proved.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 46
diff changeset
151 η c o ( g o f )
0124e3c971e5 F is Functor proved.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 46
diff changeset
152
0124e3c971e5 F is Functor proved.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 46
diff changeset
153 lemma-distr1 : (a b c : Obj A) (f : Hom A a b) (g : Hom A b c) →
0124e3c971e5 F is Functor proved.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 46
diff changeset
154 B [ (_* um) (A [ η c o A [ g o f ] ]) ≈ (B [(_* um) (A [ η c o g ]) o (_* um)( A [ η b o f ]) ] )]
52
0fc0dbda7b55 nat-ε proved
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 51
diff changeset
155 lemma-distr1 a b c f g = ( IsUniversalMapping.uniquness ( isUniversalMapping um )) (lemma-distr2 a b c f g )
47
0124e3c971e5 F is Functor proved.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 46
diff changeset
156 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 ] )]
0124e3c971e5 F is Functor proved.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 46
diff changeset
157 lemma-distr {a} {b} {c} {f} {g} = lemma-distr1 a b c f g
42
9694f93977ca Functor Identity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 41
diff changeset
158 myIsFunctor : IsFunctor A B F myFMap
9694f93977ca Functor Identity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 41
diff changeset
159 myIsFunctor =
46
5d1b0fd2ad21 Functor cong done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 45
diff changeset
160 record { ≈-cong = lemma-cong
42
9694f93977ca Functor Identity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 41
diff changeset
161 ; identity = lemma-id
47
0124e3c971e5 F is Functor proved.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 46
diff changeset
162 ; distr = lemma-distr
42
9694f93977ca Functor Identity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 41
diff changeset
163 }
41
e9fa5c95eff7 isFunctor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 40
diff changeset
164
48
d5a8edad2a83 naturarity of η
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 47
diff changeset
165 --
d5a8edad2a83 naturarity of η
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 47
diff changeset
166 -- naturality of η
d5a8edad2a83 naturarity of η
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 47
diff changeset
167 --
d5a8edad2a83 naturarity of η
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 47
diff changeset
168 nat-η : {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ')
54
5d2a33bb1291 cleanup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 53
diff changeset
169 { U : Functor B A }
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
170 { F : Obj A → Obj B }
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
171 { η : (a : Obj A) → Hom A a ( FObj U (F a) ) } →
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
172 (um : UniversalMapping A B U F η ) →
54
5d2a33bb1291 cleanup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 53
diff changeset
173 NTrans A A identityFunctor ( U ○ FunctorF A B um )
5d2a33bb1291 cleanup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 53
diff changeset
174 nat-η A B {U} {F} {η} um = record {
48
d5a8edad2a83 naturarity of η
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 47
diff changeset
175 TMap = η ; isNTrans = myIsNTrans
d5a8edad2a83 naturarity of η
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 47
diff changeset
176 } where
d5a8edad2a83 naturarity of η
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 47
diff changeset
177 F' : Functor A B
54
5d2a33bb1291 cleanup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 53
diff changeset
178 F' = FunctorF A B um
130
5f331dfc000b remove Kleisli record
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 66
diff changeset
179 commute : {a b : Obj A} {f : Hom A a b}
48
d5a8edad2a83 naturarity of η
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 47
diff changeset
180 → A [ A [ (FMap U (FMap F' f)) o ( η a ) ] ≈ A [ (η b ) o f ] ]
130
5f331dfc000b remove Kleisli record
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 66
diff changeset
181 commute {a} {b} {f} = let open ≈-Reasoning (A) in
49
d2b5be1143bf naturality of ε
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
182 begin
d2b5be1143bf naturality of ε
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
183 (FMap U (FMap F' f)) o ( η a )
d2b5be1143bf naturality of ε
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
184 ≈⟨⟩
d2b5be1143bf naturality of ε
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
185 (FMap U ((_* um) (A [ η b o f ]))) o ( η a )
51
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
186 ≈⟨ (IsUniversalMapping.universalMapping ( isUniversalMapping um )) ⟩
49
d2b5be1143bf naturality of ε
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
187 (η b ) o f
d2b5be1143bf naturality of ε
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
188
48
d5a8edad2a83 naturarity of η
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 47
diff changeset
189 myIsNTrans : IsNTrans A A identityFunctor ( U ○ F' ) η
130
5f331dfc000b remove Kleisli record
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 66
diff changeset
190 myIsNTrans = record { commute = commute }
49
d2b5be1143bf naturality of ε
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
191
d2b5be1143bf naturality of ε
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
192 nat-ε : {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ')
54
5d2a33bb1291 cleanup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 53
diff changeset
193 { U : Functor B A }
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
194 { F : Obj A → Obj B }
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
195 { η : (a : Obj A) → Hom A a ( FObj U (F a) ) } →
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
196 (um : UniversalMapping A B U F η ) →
54
5d2a33bb1291 cleanup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 53
diff changeset
197 NTrans B B ( FunctorF A B um ○ U) identityFunctor
5d2a33bb1291 cleanup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 53
diff changeset
198 nat-ε A B {U} {F} {η} um = record {
49
d2b5be1143bf naturality of ε
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
199 TMap = ε ; isNTrans = myIsNTrans
d2b5be1143bf naturality of ε
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
200 } where
d2b5be1143bf naturality of ε
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
201 F' : Functor A B
54
5d2a33bb1291 cleanup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 53
diff changeset
202 F' = FunctorF A B um
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
203 ε : ( b : Obj B ) → Hom B ( FObj F' ( FObj U b) ) b
49
d2b5be1143bf naturality of ε
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
204 ε b = (_* um) ( id1 A (FObj U b))
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
205 lemma-nat1 : (a b : Obj B) (f : Hom B a b ) →
51
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
206 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) ]
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
207 ≈ A [ FMap U f o id1 A (FObj U a) ] ]
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
208 lemma-nat1 a b f = let open ≈-Reasoning (A) in
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
209 begin
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
210 FMap U ( B [ (um *) (id1 A (FObj U b)) o ((um *) ( η (FObj U b) o FMap U f )) ] ) o η (FObj U a)
66
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 56
diff changeset
211 ≈⟨ car ( distr U ) ⟩
51
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
212 ( FMap U ((um *) (id1 A (FObj U b))) o FMap U ((um *) ( η (FObj U b) o FMap U f )) ) o η (FObj U a)
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
213 ≈⟨ sym assoc ⟩
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
214 FMap U ((um *) (id1 A (FObj U b))) o ( FMap U ((um *) ( η (FObj U b) o FMap U f ))) o η (FObj U a)
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
215 ≈⟨ cdr ((IsUniversalMapping.universalMapping ( isUniversalMapping um )) ) ⟩
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
216 FMap U ((um *) (id1 A (FObj U b))) o ( η (FObj U b) o FMap U f )
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
217 ≈⟨ assoc ⟩
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
218 (FMap U ((um *) (id1 A (FObj U b))) o η (FObj U b)) o FMap U f
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
219 ≈⟨ car ((IsUniversalMapping.universalMapping ( isUniversalMapping um )) ) ⟩
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
220 id1 A (FObj U b) o FMap U f
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
221 ≈⟨ idL ⟩
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
222 FMap U f
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
223 ≈⟨ sym idR ⟩
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
224 FMap U f o id (FObj U a)
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
225
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
226 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
0fc0dbda7b55 nat-ε proved
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 51
diff changeset
227 ≈ A [ FMap U f o id1 A (FObj U a) ] ]
0fc0dbda7b55 nat-ε proved
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 51
diff changeset
228 lemma-nat2 a b f = let open ≈-Reasoning (A) in
0fc0dbda7b55 nat-ε proved
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 51
diff changeset
229 begin
0fc0dbda7b55 nat-ε proved
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 51
diff changeset
230 FMap U ( B [ f o ((um *) (id1 A (FObj U a ))) ]) o η (FObj U a)
66
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 56
diff changeset
231 ≈⟨ car ( distr U ) ⟩
52
0fc0dbda7b55 nat-ε proved
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 51
diff changeset
232 (FMap U f o FMap U ((um *) (id1 A (FObj U a )))) o η (FObj U a)
0fc0dbda7b55 nat-ε proved
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 51
diff changeset
233 ≈⟨ sym assoc ⟩
0fc0dbda7b55 nat-ε proved
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 51
diff changeset
234 FMap U f o ( FMap U ((um *) (id1 A (FObj U a ))) o η (FObj U a) )
0fc0dbda7b55 nat-ε proved
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 51
diff changeset
235 ≈⟨ cdr ( IsUniversalMapping.universalMapping ( isUniversalMapping um)) ⟩
0fc0dbda7b55 nat-ε proved
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 51
diff changeset
236 FMap U f o id (FObj U a )
0fc0dbda7b55 nat-ε proved
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 51
diff changeset
237
130
5f331dfc000b remove Kleisli record
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 66
diff changeset
238 commute : {a b : Obj B} {f : Hom B a b }
49
d2b5be1143bf naturality of ε
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
239 → B [ B [ f o (ε a) ] ≈ B [(ε b) o (FMap F' (FMap U f)) ] ]
130
5f331dfc000b remove Kleisli record
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 66
diff changeset
240 commute {a} {b} {f} = let open ≈-Reasoning (B) in
49
d2b5be1143bf naturality of ε
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
241 sym ( begin
d2b5be1143bf naturality of ε
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
242 ε b o (FMap F' (FMap U f))
d2b5be1143bf naturality of ε
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
243 ≈⟨⟩
50
b518af3a9b07 on goging
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 49
diff changeset
244 ε b o ((_* um) (A [ η (FObj U b) o (FMap U f) ]))
b518af3a9b07 on goging
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 49
diff changeset
245 ≈⟨⟩
b518af3a9b07 on goging
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 49
diff changeset
246 ((_* um) ( id1 A (FObj U b))) o ((_* um) (A [ η (FObj U b) o (FMap U f) ]))
52
0fc0dbda7b55 nat-ε proved
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 51
diff changeset
247 ≈⟨ sym ( ( IsUniversalMapping.uniquness ( isUniversalMapping um ) (lemma-nat1 a b f))) ⟩
51
adc6bd3c9270 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 50
diff changeset
248 (_* um) ( A [ FMap U f o id1 A (FObj U a) ] )
52
0fc0dbda7b55 nat-ε proved
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 51
diff changeset
249 ≈⟨ (IsUniversalMapping.uniquness ( isUniversalMapping um ) (lemma-nat2 a b f)) ⟩
50
b518af3a9b07 on goging
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 49
diff changeset
250 f o ((_* um) ( id1 A (FObj U a)))
b518af3a9b07 on goging
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 49
diff changeset
251 ≈⟨⟩
49
d2b5be1143bf naturality of ε
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
252 f o (ε a)
d2b5be1143bf naturality of ε
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
253 ∎ )
d2b5be1143bf naturality of ε
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
254 myIsNTrans : IsNTrans B B ( F' ○ U ) identityFunctor ε
130
5f331dfc000b remove Kleisli record
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 66
diff changeset
255 myIsNTrans = record { commute = commute }
53
b4530a807918 start adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 52
diff changeset
256
b4530a807918 start adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 52
diff changeset
257 ------
b4530a807918 start adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 52
diff changeset
258 --
b4530a807918 start adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 52
diff changeset
259 -- Adjunction Construction from Universal Mapping
b4530a807918 start adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 52
diff changeset
260 --
b4530a807918 start adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 52
diff changeset
261 -----
b4530a807918 start adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 52
diff changeset
262
b4530a807918 start adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 52
diff changeset
263 UMAdjunction : {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ')
b4530a807918 start adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 52
diff changeset
264 ( U : Functor B A )
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
265 ( F' : Obj A → Obj B )
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
266 ( η' : (a : Obj A) → Hom A a ( FObj U (F' a) ) ) →
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
267 (um : UniversalMapping A B U F' η' ) →
54
5d2a33bb1291 cleanup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 53
diff changeset
268 Adjunction A B U (FunctorF A B um) (nat-η A B um) (nat-ε A B um)
53
b4530a807918 start adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 52
diff changeset
269 UMAdjunction A B U F' η' um = record {
b4530a807918 start adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 52
diff changeset
270 isAdjunction = record {
b4530a807918 start adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 52
diff changeset
271 adjoint1 = adjoint1 ;
b4530a807918 start adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 52
diff changeset
272 adjoint2 = adjoint2
b4530a807918 start adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 52
diff changeset
273 }
b4530a807918 start adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 52
diff changeset
274 } where
b4530a807918 start adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 52
diff changeset
275 F : Functor A B
54
5d2a33bb1291 cleanup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 53
diff changeset
276 F = FunctorF A B um
53
b4530a807918 start adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 52
diff changeset
277 η : NTrans A A identityFunctor ( U ○ F )
54
5d2a33bb1291 cleanup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 53
diff changeset
278 η = nat-η A B um
53
b4530a807918 start adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 52
diff changeset
279 ε : NTrans B B ( F ○ U ) identityFunctor
54
5d2a33bb1291 cleanup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 53
diff changeset
280 ε = nat-ε A B um
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
281 adjoint1 : { b : Obj B } →
53
b4530a807918 start adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 52
diff changeset
282 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
283 adjoint1 {b} = let open ≈-Reasoning (A) in
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
284 begin
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
285 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
286 ≈⟨⟩
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
287 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
288 ≈⟨ IsUniversalMapping.universalMapping ( isUniversalMapping um ) ⟩
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
289 id (FObj U b)
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
290
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
291 lemma-adj1 : (a : Obj A) →
55
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
292 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 ]
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
293 ≈ (η' a) ]
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
294 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
295 begin
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
296 FMap U ((B [((_* um) ( id1 A (FObj U ( FObj F a )))) o (_* um) (A [ η' (FObj U ( FObj F a )) o ( η' a ) ]) ])) o η' a
66
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 56
diff changeset
297 ≈⟨ car (distr U) ⟩
55
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
298 (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
299 ≈⟨ sym assoc ⟩
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
300 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
301 ≈⟨ cdr (IsUniversalMapping.universalMapping ( isUniversalMapping um)) ⟩
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
302 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
303 ≈⟨ assoc ⟩
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
304 (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
305 ≈⟨ car (IsUniversalMapping.universalMapping ( isUniversalMapping um)) ⟩
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
306 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
307 ≈⟨ idL ⟩
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
308 η' a
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
309
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
310 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
311 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
312 begin
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
313 FMap U (id1 B (FObj F a)) o η' a
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
314 ≈⟨ car ( IsFunctor.identity ( isFunctor U)) ⟩
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
315 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
316 ≈⟨ idL ⟩
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
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
319 adjoint2 : {a : Obj A} →
53
b4530a807918 start adjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 52
diff changeset
320 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
321 adjoint2 {a} = let open ≈-Reasoning (B) in
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
322 begin
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
323 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
324 ≈⟨⟩
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
325 ((_* 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
326 ≈⟨ 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
327 (_* um)( η' a )
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
328 ≈⟨ IsUniversalMapping.uniquness ( isUniversalMapping um ) (lemma-adj2 a) ⟩
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
329 id1 B (FObj F a)
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
330
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
331
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
332
171
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
333 ------
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
334 --
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
335 -- Hom(F(-),-) = Hom(-,U(-))
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
336 -- Unity of opposite
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
337 -----
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
338
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
339 Adj2UO : {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ')
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
340 { U : Functor B A }
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
341 { F : Functor A B }
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
342 { η : NTrans A A identityFunctor ( U ○ F ) }
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
343 { ε : NTrans B B ( F ○ U ) identityFunctor } →
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
344 ( adj : Adjunction A B U F η ε ) → UnityOfOppsite A B U F
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
345 Adj2UO A B {U} {F} {η} {ε} adj = record {
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
346 right = right ;
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
347 left = left ;
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
348 right-injective = right-injective ;
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
349 left-injective = left-injective
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
350 } where
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
351 right : {a : Obj A} { b : Obj B } → Hom A a ( FObj U b ) → Hom B (FObj F a) b
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
352 right {a} {b} f = B [ TMap ε b o FMap F f ]
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
353 left : {a : Obj A} { b : Obj B } → Hom B (FObj F a) b → Hom A a ( FObj U b )
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
354 left {a} {b} f = A [ FMap U f o (TMap η a) ]
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
355 right-injective : {a : Obj A} { b : Obj B } → {f : Hom A a (FObj U b) } → A [ left ( right f ) ≈ f ]
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
356 right-injective {a} {b} {f} = let open ≈-Reasoning (A) in
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
357 begin
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
358 FMap U (B [ TMap ε b o FMap F f ]) o (TMap η a)
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
359 ≈⟨ car ( distr U ) ⟩
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
360 ( FMap U (TMap ε b) o FMap U (FMap F f )) o (TMap η a)
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
361 ≈↑⟨ assoc ⟩
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
362 FMap U (TMap ε b) o ( FMap U (FMap F f ) o (TMap η a) )
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
363 ≈⟨ cdr ( nat η) ⟩
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
364 FMap U (TMap ε b) o ((TMap η (FObj U b)) o f )
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
365 ≈⟨ assoc ⟩
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
366 (FMap U (TMap ε b) o (TMap η (FObj U b))) o f
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
367 ≈⟨ car ( IsAdjunction.adjoint1 ( isAdjunction adj )) ⟩
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
368 id1 A (FObj U b) o f
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
369 ≈⟨ idL ⟩
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
370 f
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
371
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
372 left-injective : {a : Obj A} { b : Obj B } → {f : Hom B (FObj F a) b } → B [ right ( left f ) ≈ f ]
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
373 left-injective {a} {b} {f} = let open ≈-Reasoning (B) in
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
374 begin
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
375 TMap ε b o FMap F ( A [ FMap U f o (TMap η a) ])
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
376 ≈⟨ cdr ( distr F ) ⟩
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
377 TMap ε b o ( FMap F (FMap U f) o FMap F (TMap η a))
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
378 ≈⟨ assoc ⟩
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
379 ( TMap ε b o FMap F (FMap U f)) o FMap F (TMap η a)
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
380 ≈↑⟨ car (nat ε) ⟩
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
381 ( f o TMap ε ( FObj F a )) o ( FMap F ( TMap η a ))
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
382 ≈↑⟨ assoc ⟩
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
383 f o ( TMap ε ( FObj F a ) o ( FMap F ( TMap η a )))
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
384 ≈⟨ cdr ( IsAdjunction.adjoint2 ( isAdjunction adj )) ⟩
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
385 f o id1 B (FObj F a)
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
386 ≈⟨ idR ⟩
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
387 f
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
388
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
389
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
390 open UnityOfOppsite
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
391
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
392 uo-η : {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} {A : Category c₁ c₂ ℓ} {B : Category c₁' c₂' ℓ'}
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
393 { U : Functor B A }
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
394 { F : Functor A B } →
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
395 ( uo : UnityOfOppsite A B U F) → NTrans A A identityFunctor ( U ○ F )
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
396 uo-η {_} {_} {_} {_} {_} {_} {A} {B} {U} {F} uo = record {
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
397 TMap = η ; isNTrans = myIsNTrans
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
398 } where
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
399 η : (a : Obj A) → Hom A a ( FObj U (FObj F a) )
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
400 η a = left uo ( id1 B (FObj F a) )
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
401 commute : {a b : Obj A} {f : Hom A a b}
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
402 → A [ A [ (FMap U (FMap F f)) o ( η a ) ] ≈ A [ (η b ) o f ] ]
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
403 commute {a} {b} {f} = let open ≈-Reasoning (A) in
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
404 begin
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
405 (FMap U (FMap F f)) o ( η a )
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
406 ≈⟨⟩
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
407 (FMap U (FMap F f)) o left uo ( id1 B (FObj F a) )
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
408 ≈⟨ {!!} ⟩
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
409 left uo ( id1 B (FObj F b)) o f
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
410 ≈⟨⟩
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
411 (η b ) o f
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
412
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
413 myIsNTrans : IsNTrans A A identityFunctor ( U ○ F ) η
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
414 myIsNTrans = record { commute = commute }
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
415
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
416 UO2UM : {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} {A : Category c₁ c₂ ℓ} {B : Category c₁' c₂' ℓ'}
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
417 { U : Functor B A }
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
418 { F : Functor A B } →
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
419 ( uo : UnityOfOppsite A B U F) → UniversalMapping A B U (FObj F) (TMap (uo-η uo) )
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
420 UO2UM = {!!}
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
421
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
422 uo-ε : {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} {A : Category c₁ c₂ ℓ} {B : Category c₁' c₂' ℓ'}
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
423 { U : Functor B A }
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
424 { F : Functor A B }→
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
425 ( uo : UnityOfOppsite A B U F) → NTrans B B ( F ○ U ) identityFunctor
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
426 uo-ε = {!!}
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
427
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
428 UO2Adj : {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ')
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
429 { U : Functor B A }
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
430 { F : Functor A B }
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
431 ( uo : UnityOfOppsite A B U F) → Adjunction A B U F (uo-η uo ) (uo-ε uo )
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
432 UO2Adj A B {U} {F} uo = record {
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
433 isAdjunction = record {
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
434 adjoint1 = adjoint1 ;
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
435 adjoint2 = adjoint2
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
436 }
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
437 } where
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
438 adjoint1 : { b : Obj B } →
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
439 A [ A [ ( FMap U ( TMap (uo-ε uo) b )) o ( TMap (uo-η uo) ( FObj U b )) ] ≈ id1 A (FObj U b) ]
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
440 adjoint1 {b} = {!!}
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
441 adjoint2 : {a : Obj A} →
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
442 B [ B [ ( TMap (uo-ε uo) ( FObj F a )) o ( FMap F ( TMap (uo-η uo) a )) ] ≈ id1 B (FObj F a) ]
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
443 adjoint2 {a} = {!!}
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
444
d25b0948e006 unity of oppsite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
445
55
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
446 -- done!
1716403c92c2 Adjoint proved. All done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
447