Mercurial > hg > Members > kono > Proof > category
comparison limit-to.agda @ 417:1e76e611d454
with inv-f, distribution law passed.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 24 Mar 2016 01:48:13 +0900 |
parents | e4a2544d468c |
children | 7091104a8cb4 |
comparison
equal
deleted
inserted
replaced
416:e4a2544d468c | 417:1e76e611d454 |
---|---|
5 | 5 |
6 open import cat-utility | 6 open import cat-utility |
7 open import HomReasoning | 7 open import HomReasoning |
8 open import Relation.Binary.Core | 8 open import Relation.Binary.Core |
9 open import Data.Maybe | 9 open import Data.Maybe |
10 open import maybeCat | |
11 open Functor | 10 open Functor |
12 | 11 |
13 | 12 |
14 | 13 |
15 | 14 |
26 | 25 |
27 data TwoObject {c₁ : Level} : Set c₁ where | 26 data TwoObject {c₁ : Level} : Set c₁ where |
28 t0 : TwoObject | 27 t0 : TwoObject |
29 t1 : TwoObject | 28 t1 : TwoObject |
30 | 29 |
31 | 30 data Arrow {c₁ c₂ : Level } ( t00 t11 : TwoObject {c₁} ) : TwoObject {c₁} -> TwoObject {c₁} -> Set c₂ where |
32 record TwoCat {ℓ c₁ c₂ : Level } (A : Category c₁ c₂ ℓ) ( a b : Obj A ) ( f g : Hom A a b ): Set (c₂ ⊔ c₁ ⊔ ℓ) where | 31 id-t0 : Arrow t00 t11 t00 t00 |
33 field | 32 id-t1 : Arrow t00 t11 t11 t11 |
34 obj→ : Obj A -> TwoObject { c₁} | 33 arrow-f : Arrow t00 t11 t00 t11 |
35 hom→ : {a b : Obj A} -> Hom A a b -> TwoObject { c₁} | 34 arrow-g : Arrow t00 t11 t00 t11 |
36 inv : {a b : Obj A} -> Hom A a b -> Hom A b a | 35 inv-f : Arrow t00 t11 t11 t00 |
37 iso→ : {a b : Obj A} -> ( h : Hom A a b ) -> A [ A [ inv h o h ] ≈ id1 A a ] | 36 |
38 iso← : {a b : Obj A} -> ( h : Hom A a b ) -> A [ A [ h o inv h ] ≈ id1 A b ] | 37 record TwoHom {c₁ c₂ : Level} (a b : TwoObject {c₁} ) : Set c₂ where |
39 obj← : TwoObject {c₁} -> Obj A | 38 field |
40 obj← t0 = a | 39 RawHom : Maybe ( Arrow {c₁} {c₂} t0 t1 a b ) |
41 obj← t1 = b | 40 |
42 hom← : TwoObject {c₁} -> Hom A a b | 41 open TwoHom |
43 hom← t0 = f | 42 |
44 hom← t1 = g | 43 hom : ∀{ c₁ c₂ } { a b : TwoObject {c₁} } -> |
45 | 44 ∀ (f : TwoHom {c₁} {c₂ } a b ) → Maybe ( Arrow {c₁} {c₂} t0 t1 a b ) |
46 open TwoCat | 45 hom {_} {_} {a} {b} f with RawHom f |
47 | 46 hom {_} {_} {t0} {t0} _ | just id-t0 = just id-t0 |
48 | 47 hom {_} {_} {t1} {t1} _ | just id-t1 = just id-t1 |
49 open MaybeHom | 48 hom {_} {_} {t0} {t1} _ | just arrow-f = just arrow-f |
50 | 49 hom {_} {_} {t0} {t1} _ | just arrow-g = just arrow-g |
51 | 50 hom {_} {_} {t1} {t0} _ | just inv-f = just inv-f |
52 indexFunctor : {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) ( a b : Obj A) ( f g : Hom A a b ) -> | 51 hom {_} {_} {_ } {_ } _ | _ = nothing |
53 TwoCat A a b f g -> | 52 |
54 Functor A (MaybeCat A ) | 53 |
55 indexFunctor {c₁} {c₂} {ℓ} A a b f g two = record { | 54 open TwoHom |
55 | |
56 -- arrow composition | |
57 | |
58 | |
59 _×_ : ∀ {c₁ c₂} -> {a b c : TwoObject {c₁}} → ( TwoHom {c₁} {c₂} b c ) → ( TwoHom {c₁} {c₂} a b ) → ( TwoHom {c₁} {c₂} a c ) | |
60 _×_ {c₁} {c₂} {a} {b} {c} f g with hom f | hom g | |
61 _×_ {_} {_} {_} {_} {_} f g | nothing | _ = record { RawHom = nothing } | |
62 _×_ {_} {_} {_} {_} {_} f g | just _ | nothing = record { RawHom = nothing } | |
63 _×_ {_} {_} {t0} {t1} {t1} f g | just id-t1 | just arrow-f = record { RawHom = just arrow-f } | |
64 _×_ {_} {_} {t0} {t1} {t1} f g | just id-t1 | just arrow-g = record { RawHom = just arrow-g } | |
65 _×_ {_} {_} {t1} {t1} {t1} f g | just id-t1 | just id-t1 = record { RawHom = just id-t1 } | |
66 _×_ {_} {_} {t1} {t1} {t0} f g | just inv-f | just id-t1 = record { RawHom = just inv-f } | |
67 _×_ {_} {_} {t0} {t0} {t1} f g | just arrow-f | just id-t0 = record { RawHom = just arrow-f } | |
68 _×_ {_} {_} {t0} {t0} {t1} f g | just arrow-g | just id-t0 = record { RawHom = just arrow-g } | |
69 _×_ {_} {_} {t0} {t0} {t0} f g | just id-t0 | just id-t0 = record { RawHom = just id-t0 } | |
70 _×_ {_} {_} {t1} {t0} {t0} f g | just id-t0 | just inv-f = record { RawHom = just inv-f } | |
71 _×_ {_} {_} {_} {_} {_} f g | just _ | just _ = record { RawHom = nothing } | |
72 | |
73 | |
74 _==_ : ∀{ c₁ c₂ a b } -> Rel (Maybe (Arrow {c₁} {c₂} t0 t1 a b )) (c₂) | |
75 _==_ = Eq _≡_ | |
76 | |
77 map2hom : ∀{ c₁ c₂ } -> {a b : TwoObject {c₁}} → Maybe ( Arrow {c₁} {c₂} t0 t1 a b ) -> TwoHom {c₁} {c₂ } a b | |
78 map2hom {_} {_} {t1} {t1} (just id-t1) = record { RawHom = just id-t1 } | |
79 map2hom {_} {_} {t0} {t1} (just arrow-f) = record { RawHom = just arrow-f } | |
80 map2hom {_} {_} {t0} {t1} (just arrow-g) = record { RawHom = just arrow-g } | |
81 map2hom {_} {_} {t0} {t0} (just id-t0) = record { RawHom = just id-t0 } | |
82 map2hom {_} {_} {_} {_} _ = record { RawHom = nothing } | |
83 | |
84 record TwoHom1 {c₁ c₂ : Level} (a : TwoObject {c₁} ) (b : TwoObject {c₁} ) : Set c₂ where | |
85 field | |
86 Map : TwoHom {c₁} {c₂ } a b | |
87 iso-Map : Map ≡ map2hom ( hom Map ) | |
88 | |
89 ==refl : ∀{ c₁ c₂ a b } -> ∀ {x : Maybe (Arrow {c₁} {c₂} t0 t1 a b )} → x == x | |
90 ==refl {_} {_} {_} {_} {just x} = just refl | |
91 ==refl {_} {_} {_} {_} {nothing} = nothing | |
92 | |
93 ==sym : ∀{ c₁ c₂ a b } -> ∀ {x y : Maybe (Arrow {c₁} {c₂} t0 t1 a b )} → _==_ x y → _==_ y x | |
94 ==sym (just x≈y) = just (≡-sym x≈y) | |
95 ==sym nothing = nothing | |
96 | |
97 ==trans : ∀{ c₁ c₂ a b } -> ∀ {x y z : Maybe (Arrow {c₁} {c₂} t0 t1 a b ) } → | |
98 x == y → y == z → x == z | |
99 ==trans (just x≈y) (just y≈z) = just (≡-trans x≈y y≈z) | |
100 ==trans nothing nothing = nothing | |
101 | |
102 | |
103 module ==-Reasoning {c₁ c₂ : Level} where | |
104 | |
105 infixr 2 _∎ | |
106 infixr 2 _==⟨_⟩_ _==⟨⟩_ | |
107 infix 1 begin_ | |
108 | |
109 | |
110 data _IsRelatedTo_ {c₁ c₂ : Level} {a b : TwoObject {c₁} } (x y : (Maybe (Arrow {c₁} {c₂} t0 t1 a b ))) : | |
111 Set c₂ where | |
112 relTo : (x≈y : x == y ) → x IsRelatedTo y | |
113 | |
114 begin_ : { a b : TwoObject {c₁} } {x : Maybe (Arrow {c₁} {c₂} t0 t1 a b ) } {y : Maybe (Arrow {c₁} {c₂} t0 t1 a b )} → | |
115 x IsRelatedTo y → x == y | |
116 begin relTo x≈y = x≈y | |
117 | |
118 _==⟨_⟩_ : { a b : TwoObject {c₁} } (x : Maybe (Arrow {c₁} {c₂} t0 t1 a b )) {y z : Maybe (Arrow {c₁} {c₂} t0 t1 a b ) } → | |
119 x == y → y IsRelatedTo z → x IsRelatedTo z | |
120 _ ==⟨ x≈y ⟩ relTo y≈z = relTo (==trans x≈y y≈z) | |
121 | |
122 _==⟨⟩_ : { a b : TwoObject {c₁} }(x : Maybe (Arrow {c₁} {c₂} t0 t1 a b )) {y : Maybe (Arrow {c₁} {c₂} t0 t1 a b )} | |
123 → x IsRelatedTo y → x IsRelatedTo y | |
124 _ ==⟨⟩ x≈y = x≈y | |
125 | |
126 _∎ : { a b : TwoObject {c₁} }(x : Maybe (Arrow {c₁} {c₂} t0 t1 a b )) → x IsRelatedTo x | |
127 _∎ _ = relTo ==refl | |
128 | |
129 | |
130 | |
131 -- f g h | |
132 -- d <- c <- b <- a | |
133 | |
134 assoc-× : {c₁ c₂ : Level } {a b c d : TwoObject {c₁} } | |
135 {f : (TwoHom {c₁} {c₂ } c d )} → | |
136 {g : (TwoHom {c₁} {c₂ } b c )} → | |
137 {h : (TwoHom {c₁} {c₂ } a b )} → | |
138 hom ( f × (g × h)) == hom ((f × g) × h ) | |
139 assoc-× {c₁} {c₂} {a} {b} {c} {d} {f} {g} {h} with hom f | hom g | hom h | |
140 assoc-× {c₁} {c₂} {t0} {t0} {t0} {t0} {f} {g} {h} | nothing | _ | _ = nothing | |
141 assoc-× {c₁} {c₂} {t0} {t0} {t0} {t1} {f} {g} {h} | nothing | _ | _ = nothing | |
142 assoc-× {c₁} {c₂} {t0} {t0} {t1} {t0} {f} {g} {h} | nothing | _ | _ = nothing | |
143 assoc-× {c₁} {c₂} {t0} {t0} {t1} {t1} {f} {g} {h} | nothing | _ | _ = nothing | |
144 assoc-× {c₁} {c₂} {t0} {t1} {t0} {t0} {f} {g} {h} | nothing | _ | _ = nothing | |
145 assoc-× {c₁} {c₂} {t0} {t1} {t0} {t1} {f} {g} {h} | nothing | _ | _ = nothing | |
146 assoc-× {c₁} {c₂} {t0} {t1} {t1} {t0} {f} {g} {h} | nothing | _ | _ = nothing | |
147 assoc-× {c₁} {c₂} {t0} {t1} {t1} {t1} {f} {g} {h} | nothing | _ | _ = nothing | |
148 assoc-× {c₁} {c₂} {t1} {t0} {t0} {t0} {f} {g} {h} | nothing | _ | _ = nothing | |
149 assoc-× {c₁} {c₂} {t1} {t0} {t0} {t1} {f} {g} {h} | nothing | _ | _ = nothing | |
150 assoc-× {c₁} {c₂} {t1} {t0} {t1} {t0} {f} {g} {h} | nothing | _ | _ = nothing | |
151 assoc-× {c₁} {c₂} {t1} {t0} {t1} {t1} {f} {g} {h} | nothing | _ | _ = nothing | |
152 assoc-× {c₁} {c₂} {t1} {t1} {t0} {t0} {f} {g} {h} | nothing | _ | _ = nothing | |
153 assoc-× {c₁} {c₂} {t1} {t1} {t0} {t1} {f} {g} {h} | nothing | _ | _ = nothing | |
154 assoc-× {c₁} {c₂} {t1} {t1} {t1} {t0} {f} {g} {h} | nothing | _ | _ = nothing | |
155 assoc-× {c₁} {c₂} {t1} {t1} {t1} {t1} {f} {g} {h} | nothing | _ | _ = nothing | |
156 assoc-× {c₁} {c₂} {t0} {t0} {t0} {t0} {f} {g} {h} | just _ | nothing | _ = nothing | |
157 assoc-× {c₁} {c₂} {t0} {t0} {t0} {t1} {f} {g} {h} | just _ | nothing | _ = nothing | |
158 assoc-× {c₁} {c₂} {t0} {t0} {t1} {t0} {f} {g} {h} | just _ | nothing | _ = nothing | |
159 assoc-× {c₁} {c₂} {t0} {t0} {t1} {t1} {f} {g} {h} | just _ | nothing | _ = nothing | |
160 assoc-× {c₁} {c₂} {t0} {t1} {t0} {t0} {f} {g} {h} | just _ | nothing | _ = nothing | |
161 assoc-× {c₁} {c₂} {t0} {t1} {t0} {t1} {f} {g} {h} | just _ | nothing | _ = nothing | |
162 assoc-× {c₁} {c₂} {t0} {t1} {t1} {t0} {f} {g} {h} | just _ | nothing | _ = nothing | |
163 assoc-× {c₁} {c₂} {t0} {t1} {t1} {t1} {f} {g} {h} | just _ | nothing | _ = nothing | |
164 assoc-× {c₁} {c₂} {t1} {t0} {t0} {t0} {f} {g} {h} | just _ | nothing | _ = nothing | |
165 assoc-× {c₁} {c₂} {t1} {t0} {t0} {t1} {f} {g} {h} | just _ | nothing | _ = nothing | |
166 assoc-× {c₁} {c₂} {t1} {t0} {t1} {t0} {f} {g} {h} | just _ | nothing | _ = nothing | |
167 assoc-× {c₁} {c₂} {t1} {t0} {t1} {t1} {f} {g} {h} | just _ | nothing | _ = nothing | |
168 assoc-× {c₁} {c₂} {t1} {t1} {t0} {t0} {f} {g} {h} | just _ | nothing | _ = nothing | |
169 assoc-× {c₁} {c₂} {t1} {t1} {t0} {t1} {f} {g} {h} | just _ | nothing | _ = nothing | |
170 assoc-× {c₁} {c₂} {t1} {t1} {t1} {t0} {f} {g} {h} | just _ | nothing | _ = nothing | |
171 assoc-× {c₁} {c₂} {t1} {t1} {t1} {t1} {f} {g} {h} | just _ | nothing | _ = nothing | |
172 assoc-× {c₁} {c₂} {t0} {t0} {t0} {t0} {f} {g} {h} | just id-t0 | just id-t0 | just id-t0 = ==refl | |
173 assoc-× {c₁} {c₂} {t0} {t0} {t0} {t1} {f} {g} {h} | just arrow-f | just id-t0 | just id-t0 = ==refl | |
174 assoc-× {c₁} {c₂} {t0} {t0} {t0} {t1} {f} {g} {h} | just arrow-g | just id-t0 | just id-t0 = ==refl | |
175 assoc-× {c₁} {c₂} {t0} {t0} {t1} {t1} {f} {g} {h} | just id-t1 | just arrow-f | just id-t0 = ==refl | |
176 assoc-× {c₁} {c₂} {t0} {t0} {t1} {t1} {f} {g} {h} | just id-t1 | just arrow-g | just id-t0 = ==refl | |
177 assoc-× {c₁} {c₂} {t0} {t1} {t1} {t1} {f} {g} {h} | just id-t1 | just id-t1 | just arrow-f = ==refl | |
178 assoc-× {c₁} {c₂} {t0} {t1} {t1} {t1} {f} {g} {h} | just id-t1 | just id-t1 | just arrow-g = ==refl | |
179 assoc-× {c₁} {c₂} {t1} {t1} {t1} {t1} {f} {g} {h} | just id-t1 | just id-t1 | just id-t1 = ==refl | |
180 -- remaining all failure case | |
181 assoc-× {c₁} {c₂} {a} {b} {c} {d} {f} {g} {h} | just _ | just _ | nothing = {!!} | |
182 assoc-× {c₁} {c₂} {t1} {t0} {_} {_} {f} {g} {h} | just _ | just _ | just _ = let open ==-Reasoning {c₁} {c₂} in | |
183 begin | |
184 {!!} | |
185 ==⟨ {!!} ⟩ | |
186 {!!} | |
187 ∎ | |
188 ... | just _ | just _ | just _ = let open ==-Reasoning {c₁} {c₂} in | |
189 begin | |
190 {!!} | |
191 ==⟨ {!!} ⟩ | |
192 {!!} | |
193 ∎ | |
194 | |
195 | |
196 TwoId : {c₁ c₂ : Level } (a : TwoObject {c₁} ) -> (TwoHom {c₁} {c₂ } a a ) | |
197 TwoId {_} {_} t0 = record { RawHom = just id-t0 } | |
198 TwoId {_} {_} t1 = record { RawHom = just id-t1 } | |
199 | |
200 open import maybeCat | |
201 | |
202 -- identityL {c₁} {c₂} {_} {b} {nothing} = let open ==-Reasoning {c₁} {c₂} in | |
203 -- begin | |
204 -- (TwoId b × nothing) | |
205 -- ==⟨ {!!} ⟩ | |
206 -- nothing | |
207 -- ∎ | |
208 | |
209 open import Relation.Binary | |
210 TwoCat : {c₁ c₂ ℓ : Level } -> Category c₁ c₂ c₂ | |
211 TwoCat {c₁} {c₂} {ℓ} = record { | |
212 Obj = TwoObject {c₁} ; | |
213 Hom = λ a b → ( TwoHom {c₁} {c₂ } a b ) ; | |
214 _o_ = \{a} {b} {c} x y -> _×_ {c₁ } { c₂} {a} {b} {c} x y ; | |
215 _≈_ = \x y -> hom x == hom y ; | |
216 Id = \{a} -> TwoId {c₁ } { c₂} a ; | |
217 isCategory = record { | |
218 isEquivalence = record {refl = ==refl ; trans = ==trans ; sym = ==sym } ; | |
219 identityL = \{a b f} -> identityL {c₁} {c₂ } {a} {b} {f} ; | |
220 identityR = \{a b f} -> identityR {c₁} {c₂ } {a} {b} {f} ; | |
221 o-resp-≈ = \{a b c f g h i} -> o-resp-≈ {c₁} {c₂ } {a} {b} {c} {f} {g} {h} {i} ; | |
222 associative = \{a b c d f g h } -> assoc-× {c₁} {c₂} {a} {b} {c} {d} {f} {g} {h} | |
223 } | |
224 } where | |
225 identityL : {c₁ c₂ : Level } {A B : TwoObject {c₁}} {f : ( TwoHom {c₁} {c₂ } A B) } → hom ((TwoId B) × f) == hom f | |
226 identityL {c₁} {c₂} {_} {_} {f} with hom f | |
227 identityL {c₁} {c₂} {t0} {t0} {_} | nothing = nothing | |
228 identityL {c₁} {c₂} {t0} {t1} {_} | nothing = nothing | |
229 identityL {c₁} {c₂} {t1} {t0} {_} | nothing = nothing | |
230 identityL {c₁} {c₂} {t1} {t1} {_} | nothing = nothing | |
231 identityL {c₁} {c₂} {t1} {t0} {_} | just inv-f = ==refl | |
232 identityL {c₁} {c₂} {t1} {t1} {_} | just id-t1 = ==refl | |
233 identityL {c₁} {c₂} {t0} {t0} {_} | just id-t0 = ==refl | |
234 identityL {c₁} {c₂} {t0} {t1} {_} | just arrow-f = ==refl | |
235 identityL {c₁} {c₂} {t0} {t1} {_} | just arrow-g = ==refl | |
236 identityR : {c₁ c₂ : Level } {A B : TwoObject {c₁}} {f : ( TwoHom {c₁} {c₂ } A B) } → hom ( f × TwoId A ) == hom f | |
237 identityR {c₁} {c₂} {_} {_} {f} with hom f | |
238 identityR {c₁} {c₂} {t0} {t0} {_} | nothing = nothing | |
239 identityR {c₁} {c₂} {t0} {t1} {_} | nothing = nothing | |
240 identityR {c₁} {c₂} {t1} {t0} {_} | nothing = nothing | |
241 identityR {c₁} {c₂} {t1} {t1} {_} | nothing = nothing | |
242 identityR {c₁} {c₂} {t1} {t0} {_} | just inv-f = ==refl | |
243 identityR {c₁} {c₂} {t1} {t1} {_} | just id-t1 = ==refl | |
244 identityR {c₁} {c₂} {t0} {t0} {_} | just id-t0 = ==refl | |
245 identityR {c₁} {c₂} {t0} {t1} {_} | just arrow-f = ==refl | |
246 identityR {c₁} {c₂} {t0} {t1} {_} | just arrow-g = ==refl | |
247 o-resp-≈ : {c₁ c₂ : Level } {A B C : TwoObject {c₁} } {f g : ( TwoHom {c₁} {c₂ } A B)} {h i : ( TwoHom B C)} → | |
248 hom f == hom g → hom h == hom i → hom ( h × f ) == hom ( i × g ) | |
249 o-resp-≈ {_} {_} {a} {b} {c} {f} {g} {h} {i} f≡g h≡i = {!!} | |
250 | |
251 | |
252 indexFunctor : {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) ( a b : Obj (MaybeCat A )) ( f g : Hom A a b ) -> Functor (TwoCat {c₁} {c₂} {c₂} ) (MaybeCat A ) | |
253 indexFunctor {c₁} {c₂} {ℓ} A a b f g = record { | |
56 FObj = λ a → fobj a | 254 FObj = λ a → fobj a |
57 ; FMap = λ {a} {b} f → fmap {a} {b} f | 255 ; FMap = λ {a} {b} f → fmap {a} {b} f |
58 ; isFunctor = record { | 256 ; isFunctor = record { |
59 identity = \{x} -> identity {x} | 257 identity = \{x} -> identity {x} |
60 ; distr = \ {a} {b} {c} {f} {g} -> distr1 {a} {b} {c} {f} {g} | 258 ; distr = \ {a} {b} {c} {f} {g} -> distr1 {a} {b} {c} {f} {g} |
61 ; ≈-cong = \ {a} {b} {c} {f} -> ≈-cong {a} {b} {c} {f} | 259 ; ≈-cong = \ {a} {b} {c} {f} -> ≈-cong {a} {b} {c} {f} |
62 } | 260 } |
63 } where | 261 } where |
262 I = TwoCat {c₁} {c₂} {ℓ} | |
64 MA = MaybeCat A | 263 MA = MaybeCat A |
65 open ≈-Reasoning (MA) | 264 open ≈-Reasoning (MA) |
66 fobj : Obj A -> Obj A | 265 fobj : Obj I -> Obj A |
67 fobj x with obj→ two x | 266 fobj t0 = a |
68 fobj _ | t0 = a | 267 fobj t1 = b |
69 fobj _ | t1 = b | 268 fmap : {x y : Obj I } -> (TwoHom {c₁} {c₂} x y ) -> Hom MA (fobj x) (fobj y) |
70 fmap : {x y : Obj A } -> (Hom A x y ) -> Hom MA (fobj x) (fobj y) | 269 fmap {x} {y} h with hom h |
71 fmap {x} {y} h with obj→ two x | obj→ two y | hom→ two f | 270 fmap {t0} {t0} h | just id-t0 = id1 MA a |
72 fmap {_} {_} h | t0 | t1 | t0 = record { hom = just f } | 271 fmap {t1} {t1} h | just id-t1 = id1 MA b |
73 fmap {_} {_} h | t0 | t1 | t1 = record { hom = just g } | 272 fmap {t0} {t1} h | just arrow-f = record { hom = just f } |
74 fmap {_} {_} h | t1 | t0 | t0 = record { hom = just (inv two f) } | 273 fmap {t0} {t1} h | just arrow-g = record { hom = just g } |
75 fmap {_} {_} h | t1 | t0 | t1 = record { hom = just (inv two g) } | 274 fmap {_} {_} h | _ = record { hom = nothing } |
76 fmap {x} {_} h | t0 | t0 | _ = id1 MA ( obj← two t0 ) | 275 identity : {x : Obj I} → MA [ fmap ( id1 I x ) ≈ id1 MA (fobj x) ] |
77 fmap {x} {_} h | t1 | t1 | _ = id1 MA ( obj← two t1 ) | 276 identity {t0} = refl-hom |
78 identity : {x : Obj A} → MA [ fmap ( id1 A x ) ≈ id1 MA ( fobj x ) ] | 277 identity {t1} = refl-hom |
79 identity {x} with obj→ two x | 278 distr1 : {a₁ : Obj I} {b₁ : Obj I} {c : Obj I} {f₁ : Hom I a₁ b₁} {g₁ : Hom I b₁ c} → |
80 identity | t0 = refl-hom | 279 MA [ fmap (I [ g₁ o f₁ ]) ≈ MA [ fmap g₁ o fmap f₁ ] ] |
81 identity | t1 = refl-hom | 280 distr1 {a1} {b1} {c1} {f1} {g1} with hom g1 | hom f1 |
82 distr1 : {a₁ : Obj A} {b₁ : Obj A} {c : Obj A} {f₁ : Hom A a₁ b₁} {g₁ : Hom A b₁ c} → | 281 distr1 {t0} {t0} {t0} {f1} {g1} | nothing | nothing = nothing |
83 MA [ fmap (A [ g₁ o f₁ ]) ≈ MA [ fmap g₁ o fmap f₁ ] ] | 282 distr1 {t0} {t0} {t1} {f1} {g1} | nothing | nothing = nothing |
84 distr1 {a1} {b1} {c} {f1} {g1} with obj→ two a1 | obj→ two b1 | obj→ two c | hom→ two f | hom→ two g | 283 distr1 {t0} {t1} {t0} {f1} {g1} | nothing | nothing = nothing |
85 distr1 {a1} {b1} {c} {f1} {g1} | t0 | t0 | t0 | _ | _ = {!!} | 284 distr1 {t0} {t1} {t1} {f1} {g1} | nothing | nothing = nothing |
86 distr1 {a1} {b1} {c} {f1} {g1} | t0 | t0 | t1 | _ | _ = {!!} | 285 distr1 {t1} {t0} {t0} {f1} {g1} | nothing | nothing = nothing |
87 distr1 {a1} {b1} {c} {f1} {g1} | t0 | t1 | t1 | _ | _ = {!!} | 286 distr1 {t1} {t0} {t1} {f1} {g1} | nothing | nothing = nothing |
88 distr1 {a1} {b1} {c} {f1} {g1} | t1 | t1 | t1 | _ | _ = {!!} | 287 distr1 {t1} {t1} {t0} {f1} {g1} | nothing | nothing = nothing |
89 distr1 {a1} {b1} {c} {f1} {g1} | t1 | t0 | t0 | _ | _ = {!!} | 288 distr1 {t1} {t1} {t1} {f1} {g1} | nothing | nothing = nothing |
90 distr1 {a1} {b1} {c} {f1} {g1} | t1 | t1 | t0 | _ | _ = {!!} | 289 distr1 {t0} {t0} {t0} {f1} {g1} | nothing | just id-t0 = nothing |
91 -- next two cases require the inverse of f and g | 290 distr1 {t0} {t0} {t1} {f1} {g1} | nothing | just id-t0 = nothing |
92 -- if we add invserse, there no nothing part, it generates extra commutaivitiy in nat, which is no good | 291 distr1 {t1} {t1} {t0} {f1} {g1} | nothing | just id-t1 = nothing |
93 -- so A [ g o f ] should be nothing in codomain Category | 292 distr1 {t1} {t1} {t1} {f1} {g1} | nothing | just id-t1 = nothing |
94 distr1 {a1} {b1} {c} {f1} {g1} | t1 | t0 | t1 | _ | _ = {!!} | 293 distr1 {t0} {t1} {t1} {f1} {g1} | nothing | just arrow-f = nothing |
95 distr1 {a1} {b1} {c} {f1} {g1} | t0 | t1 | t0 | _ | _ = {!!} | 294 distr1 {t0} {t1} {t0} {f1} {g1} | nothing | just arrow-f = nothing |
96 ≈-cong : {a : Obj A} {b : Obj A} {f g : Hom A a b} → _[_≈_] A f g → {!!} | 295 distr1 {t0} {t1} {t1} {f1} {g1} | nothing | just arrow-g = nothing |
296 distr1 {t0} {t1} {t0} {f1} {g1} | nothing | just arrow-g = nothing | |
297 distr1 {t1} {t0} {t0} {f1} {g1} | nothing | just inv-f = nothing | |
298 distr1 {t1} {t0} {t1} {f1} {g1} | nothing | just inv-f = nothing | |
299 distr1 {t0} {t0} {t0} {f1} {g1} | just id-t0 | nothing = nothing | |
300 distr1 {t1} {t0} {t0} {f1} {g1} | just id-t0 | nothing = nothing | |
301 distr1 {t0} {t1} {t1} {f1} {g1} | just id-t1 | nothing = nothing | |
302 distr1 {t1} {t1} {t1} {f1} {g1} | just id-t1 | nothing = nothing | |
303 distr1 {t0} {t0} {t1} {f1} {g1} | just arrow-f | nothing = nothing | |
304 distr1 {t1} {t0} {t1} {f1} {g1} | just arrow-f | nothing = nothing | |
305 distr1 {t0} {t0} {t1} {f1} {g1} | just arrow-g | nothing = nothing | |
306 distr1 {t1} {t0} {t1} {f1} {g1} | just arrow-g | nothing = nothing | |
307 distr1 {t0} {t1} {t0} {f1} {g1} | just inv-f | nothing = nothing | |
308 distr1 {t1} {t1} {t0} {f1} {g1} | just inv-f | nothing = nothing | |
309 distr1 {t0} {t0} {t0} {f1} {g1} | just id-t0 | just id-t0 = sym idL | |
310 distr1 {t1} {t0} {t0} {f1} {g1} | just id-t0 | just inv-f = sym idL | |
311 distr1 {t0} {t0} {t1} {f1} {g1} | just arrow-f | just id-t0 = sym idR | |
312 distr1 {t0} {t0} {t1} {f1} {g1} | just arrow-g | just id-t0 = sym idR | |
313 distr1 {t1} {t1} {t1} {f1} {g1} | just id-t1 | just id-t1 = sym idL | |
314 distr1 {t0} {t1} {t1} {f1} {g1} | just id-t1 | just arrow-f = sym idL | |
315 distr1 {t0} {t1} {t1} {f1} {g1} | just id-t1 | just arrow-g = sym idL | |
316 distr1 {t1} {t1} {t0} {f1} {g1} | just inv-f | just id-t1 = sym idL | |
317 distr1 {t0} {t1} {t0} {_} {_} | (just inv-f) | (just _) = nothing | |
318 distr1 {t1} {t0} {t1} {_} {_} | (just arrow-f) | (just _) = nothing | |
319 distr1 {t1} {t0} {t1} {_} {_} | (just arrow-g) | (just _) = nothing | |
320 | |
321 ≈-cong : {a : Obj I} {b : Obj I} {f g : Hom I a b} → _[_≈_] I f g → {!!} | |
97 ≈-cong {_} {_} {f1} {g1} f≈g = {!!} | 322 ≈-cong {_} {_} {f1} {g1} f≈g = {!!} |
98 | 323 |
99 | 324 |
100 --- Equalizer | 325 --- Equalizer |
101 --- f | 326 --- f |
117 → (e : Hom A c a ) → (fe=ge : A [ A [ f o e ] ≈ A [ g o e ] ] ) → Equalizer A e f g | 342 → (e : Hom A c a ) → (fe=ge : A [ A [ f o e ] ≈ A [ g o e ] ] ) → Equalizer A e f g |
118 lim-to-equ {c₁} {c₂} {ℓ } A lim {a} {b} {c} f g e fe=ge = record { | 343 lim-to-equ {c₁} {c₂} {ℓ } A lim {a} {b} {c} f g e fe=ge = record { |
119 fe=ge = fe=ge | 344 fe=ge = fe=ge |
120 ; k = λ {d} h fh=gh → k {d} h fh=gh | 345 ; k = λ {d} h fh=gh → k {d} h fh=gh |
121 ; ek=h = λ {d} {h} {fh=gh} → ek=h d h fh=gh | 346 ; ek=h = λ {d} {h} {fh=gh} → ek=h d h fh=gh |
122 ; uniqueness = λ {d} {h} {fh=gh} {k'} → uniquness d h fh=gh k' } where | 347 ; uniqueness = λ {d} {h} {fh=gh} {k'} → uniquness d h fh=gh k' |
123 I = A | 348 } where |
124 MA = MaybeCat A | 349 I = TwoCat {c₁} {c₂} {ℓ } |
125 Γ = {!!} | 350 Γ = {!!} |
126 nmap : (x : Obj I) ( d : Obj A ) (h : Hom A d a ) -> Hom A (FObj (K A I d) x) (FObj Γ x) | 351 nmap : (x : Obj I) ( d : Obj A ) (h : Hom A d a ) -> Hom A (FObj (K A I d) x) (FObj Γ x) |
127 nmap x d h = {!!} | 352 nmap x d h = {!!} |
128 commute1 : {x y : Obj I} {f' : Hom I x y} (d : Obj A) (h : Hom A d a ) -> A [ A [ f o h ] ≈ A [ g o h ] ] | 353 commute1 : {x y : Obj I} {f' : Hom I x y} (d : Obj A) (h : Hom A d a ) -> A [ A [ f o h ] ≈ A [ g o h ] ] |
129 → A [ A [ FMap Γ f' o nmap x d h ] ≈ A [ nmap y d h o FMap (K A I d) f' ] ] | 354 → A [ A [ FMap Γ f' o nmap x d h ] ≈ A [ nmap y d h o FMap (K A I d) f' ] ] |