Mercurial > hg > Members > kono > Proof > category
annotate pullback.agda @ 289:7dc163c026b7
move to iProduct axiom
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 25 Sep 2013 13:25:14 +0900 |
parents | 04f598e500de |
children | 1f897357ec6c |
rev | line source |
---|---|
260 | 1 -- Pullback from product and equalizer |
2 -- | |
3 -- | |
4 -- Shinji KONO <kono@ie.u-ryukyu.ac.jp> | |
5 ---- | |
6 | |
7 open import Category -- https://github.com/konn/category-agda | |
8 open import Level | |
266 | 9 module pullback { c₁ c₂ ℓ : Level} ( A : Category c₁ c₂ ℓ ) { c₁' c₂' ℓ' : Level} ( I : Category c₁' c₂' ℓ') ( Γ : Functor I A ) where |
260 | 10 |
11 open import HomReasoning | |
12 open import cat-utility | |
13 | |
282 | 14 -- |
264 | 15 -- Pullback from equalizer and product |
260 | 16 -- f |
17 -- a -------> c | |
282 | 18 -- ^ ^ |
260 | 19 -- π1 | |g |
20 -- | | | |
21 -- ab -------> b | |
22 -- ^ π2 | |
23 -- | | |
282 | 24 -- | e = equalizer (f π1) (g π1) |
264 | 25 -- | |
26 -- d <------------------ d' | |
27 -- k (π1' × π2' ) | |
260 | 28 |
261 | 29 open Equalizer |
30 open Product | |
31 open Pullback | |
32 | |
282 | 33 pullback-from : (a b c ab d : Obj A) |
260 | 34 ( f : Hom A a c ) ( g : Hom A b c ) |
261 | 35 ( π1 : Hom A ab a ) ( π2 : Hom A ab b ) ( e : Hom A d ab ) |
282 | 36 ( eqa : {a b c : Obj A} → (f g : Hom A a b) → {e : Hom A c a } → Equalizer A e f g ) |
37 ( prod : Product A a b ab π1 π2 ) → Pullback A a b c d f g | |
261 | 38 ( A [ π1 o equalizer ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ){e} ) ] ) |
282 | 39 ( A [ π2 o equalizer ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ){e} ) ] ) |
261 | 40 pullback-from a b c ab d f g π1 π2 e eqa prod = record { |
260 | 41 commute = commute1 ; |
282 | 42 p = p1 ; |
43 π1p=π1 = λ {d} {π1'} {π2'} {eq} → π1p=π11 {d} {π1'} {π2'} {eq} ; | |
44 π2p=π2 = λ {d} {π1'} {π2'} {eq} → π2p=π21 {d} {π1'} {π2'} {eq} ; | |
260 | 45 uniqueness = uniqueness1 |
282 | 46 } where |
261 | 47 commute1 : A [ A [ f o A [ π1 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) ] ] ≈ A [ g o A [ π2 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) ] ] ] |
262 | 48 commute1 = let open ≈-Reasoning (A) in |
49 begin | |
282 | 50 f o ( π1 o equalizer (eqa ( f o π1 ) ( g o π2 )) ) |
262 | 51 ≈⟨ assoc ⟩ |
282 | 52 ( f o π1 ) o equalizer (eqa ( f o π1 ) ( g o π2 )) |
262 | 53 ≈⟨ fe=ge (eqa (A [ f o π1 ]) (A [ g o π2 ])) ⟩ |
282 | 54 ( g o π2 ) o equalizer (eqa ( f o π1 ) ( g o π2 )) |
262 | 55 ≈↑⟨ assoc ⟩ |
282 | 56 g o ( π2 o equalizer (eqa ( f o π1 ) ( g o π2 )) ) |
262 | 57 ∎ |
282 | 58 lemma1 : {d' : Obj A} {π1' : Hom A d' a} {π2' : Hom A d' b} → A [ A [ f o π1' ] ≈ A [ g o π2' ] ] → |
262 | 59 A [ A [ A [ f o π1 ] o (prod × π1') π2' ] ≈ A [ A [ g o π2 ] o (prod × π1') π2' ] ] |
282 | 60 lemma1 {d'} { π1' } { π2' } eq = let open ≈-Reasoning (A) in |
262 | 61 begin |
62 ( f o π1 ) o (prod × π1') π2' | |
63 ≈↑⟨ assoc ⟩ | |
64 f o ( π1 o (prod × π1') π2' ) | |
65 ≈⟨ cdr (π1fxg=f prod) ⟩ | |
66 f o π1' | |
67 ≈⟨ eq ⟩ | |
68 g o π2' | |
69 ≈↑⟨ cdr (π2fxg=g prod) ⟩ | |
70 g o ( π2 o (prod × π1') π2' ) | |
71 ≈⟨ assoc ⟩ | |
72 ( g o π2 ) o (prod × π1') π2' | |
73 ∎ | |
261 | 74 p1 : {d' : Obj A} {π1' : Hom A d' a} {π2' : Hom A d' b} → A [ A [ f o π1' ] ≈ A [ g o π2' ] ] → Hom A d' d |
282 | 75 p1 {d'} { π1' } { π2' } eq = |
262 | 76 let open ≈-Reasoning (A) in k ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ) {e} ) (_×_ prod π1' π2' ) ( lemma1 eq ) |
282 | 77 π1p=π11 : {d₁ : Obj A} {π1' : Hom A d₁ a} {π2' : Hom A d₁ b} {eq : A [ A [ f o π1' ] ≈ A [ g o π2' ] ]} → |
262 | 78 A [ A [ A [ π1 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ]) {e} ) ] o p1 eq ] ≈ π1' ] |
79 π1p=π11 {d'} {π1'} {π2'} {eq} = let open ≈-Reasoning (A) in | |
80 begin | |
81 ( π1 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ]) {e} ) ) o p1 eq | |
82 ≈⟨⟩ | |
83 ( π1 o e) o k ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ) {e} ) (_×_ prod π1' π2' ) (lemma1 eq) | |
84 ≈↑⟨ assoc ⟩ | |
85 π1 o ( e o k ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ) {e} ) (_×_ prod π1' π2' ) (lemma1 eq) ) | |
86 ≈⟨ cdr ( ek=h ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ) {e} )) ⟩ | |
282 | 87 π1 o (_×_ prod π1' π2' ) |
262 | 88 ≈⟨ π1fxg=f prod ⟩ |
89 π1' | |
90 ∎ | |
282 | 91 π2p=π21 : {d₁ : Obj A} {π1' : Hom A d₁ a} {π2' : Hom A d₁ b} {eq : A [ A [ f o π1' ] ≈ A [ g o π2' ] ]} → |
263 | 92 A [ A [ A [ π2 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ]) {e} ) ] o p1 eq ] ≈ π2' ] |
262 | 93 π2p=π21 {d'} {π1'} {π2'} {eq} = let open ≈-Reasoning (A) in |
94 begin | |
95 ( π2 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ]) {e} ) ) o p1 eq | |
96 ≈⟨⟩ | |
97 ( π2 o e) o k ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ) {e} ) (_×_ prod π1' π2' ) (lemma1 eq) | |
98 ≈↑⟨ assoc ⟩ | |
99 π2 o ( e o k ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ) {e} ) (_×_ prod π1' π2' ) (lemma1 eq) ) | |
100 ≈⟨ cdr ( ek=h ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ) {e} )) ⟩ | |
282 | 101 π2 o (_×_ prod π1' π2' ) |
262 | 102 ≈⟨ π2fxg=g prod ⟩ |
103 π2' | |
104 ∎ | |
261 | 105 uniqueness1 : {d₁ : Obj A} (p' : Hom A d₁ d) {π1' : Hom A d₁ a} {π2' : Hom A d₁ b} {eq : A [ A [ f o π1' ] ≈ A [ g o π2' ] ]} → |
106 {eq1 : A [ A [ A [ π1 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) ] o p' ] ≈ π1' ]} → | |
107 {eq2 : A [ A [ A [ π2 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) ] o p' ] ≈ π2' ]} → | |
108 A [ p1 eq ≈ p' ] | |
264 | 109 uniqueness1 {d'} p' {π1'} {π2'} {eq} {eq1} {eq2} = let open ≈-Reasoning (A) in |
263 | 110 begin |
111 p1 eq | |
112 ≈⟨⟩ | |
113 k ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ) {e} ) (_×_ prod π1' π2' ) (lemma1 eq) | |
264 | 114 ≈⟨ Equalizer.uniqueness (eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ) {e}) ( begin |
115 e o p' | |
116 ≈⟨⟩ | |
117 equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) o p' | |
118 ≈↑⟨ Product.uniqueness prod ⟩ | |
119 (prod × ( π1 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) o p') ) ( π2 o (equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) o p')) | |
120 ≈⟨ ×-cong prod (assoc) (assoc) ⟩ | |
121 (prod × (A [ A [ π1 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) ] o p' ])) | |
282 | 122 (A [ A [ π2 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) ] o p' ]) |
264 | 123 ≈⟨ ×-cong prod eq1 eq2 ⟩ |
124 ((prod × π1') π2') | |
125 ∎ ) ⟩ | |
263 | 126 p' |
127 ∎ | |
128 | |
266 | 129 ------ |
130 -- | |
131 -- Limit | |
132 -- | |
133 ----- | |
134 | |
135 -- Constancy Functor | |
136 | |
137 K : { c₁' c₂' ℓ' : Level} ( I : Category c₁' c₂' ℓ' ) → ( a : Obj A ) → Functor I A | |
138 K I a = record { | |
265 | 139 FObj = λ i → a ; |
140 FMap = λ f → id1 A a ; | |
141 isFunctor = let open ≈-Reasoning (A) in record { | |
142 ≈-cong = λ f=g → refl-hom | |
143 ; identity = refl-hom | |
144 ; distr = sym idL | |
145 } | |
146 } | |
147 | |
148 open NTrans | |
149 | |
282 | 150 record Limit { c₁' c₂' ℓ' : Level} ( I : Category c₁' c₂' ℓ' ) ( Γ : Functor I A ) |
266 | 151 ( a0 : Obj A ) ( t0 : NTrans I A ( K I a0 ) Γ ) : Set (suc (c₁' ⊔ c₂' ⊔ ℓ' ⊔ c₁ ⊔ c₂ ⊔ ℓ )) where |
265 | 152 field |
266 | 153 limit : ( a : Obj A ) → ( t : NTrans I A ( K I a ) Γ ) → Hom A a a0 |
154 t0f=t : { a : Obj A } → { t : NTrans I A ( K I a ) Γ } → ∀ { i : Obj I } → | |
265 | 155 A [ A [ TMap t0 i o limit a t ] ≈ TMap t i ] |
271 | 156 limit-uniqueness : { a : Obj A } → { t : NTrans I A ( K I a ) Γ } → { f : Hom A a a0 } → ( ∀ { i : Obj I } → |
157 A [ A [ TMap t0 i o f ] ≈ TMap t i ] ) → A [ limit a t ≈ f ] | |
270
8ba03259a177
one yellow remain on ∀{x} → B [ TMap f x ≈ TMap g x ]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
269
diff
changeset
|
158 A0 : Obj A |
8ba03259a177
one yellow remain on ∀{x} → B [ TMap f x ≈ TMap g x ]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
269
diff
changeset
|
159 A0 = a0 |
282 | 160 T0 : NTrans I A ( K I a0 ) Γ |
270
8ba03259a177
one yellow remain on ∀{x} → B [ TMap f x ≈ TMap g x ]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
269
diff
changeset
|
161 T0 = t0 |
265 | 162 |
266 | 163 -------------------------------- |
164 -- | |
165 -- If we have two limits on c and c', there are isomorphic pair h, h' | |
166 | |
167 open Limit | |
168 | |
169 iso-l : { c₁' c₂' ℓ' : Level} ( I : Category c₁' c₂' ℓ' ) ( Γ : Functor I A ) | |
170 ( a0 a0' : Obj A ) ( t0 : NTrans I A ( K I a0 ) Γ ) ( t0' : NTrans I A ( K I a0' ) Γ ) | |
282 | 171 ( lim : Limit I Γ a0 t0 ) → ( lim' : Limit I Γ a0' t0' ) |
266 | 172 → Hom A a0 a0' |
173 iso-l I Γ a0 a0' t0 t0' lim lim' = limit lim' a0 t0 | |
174 | |
175 iso-r : { c₁' c₂' ℓ' : Level} ( I : Category c₁' c₂' ℓ' ) ( Γ : Functor I A ) | |
176 ( a0 a0' : Obj A ) ( t0 : NTrans I A ( K I a0 ) Γ ) ( t0' : NTrans I A ( K I a0' ) Γ ) | |
282 | 177 ( lim : Limit I Γ a0 t0 ) → ( lim' : Limit I Γ a0' t0' ) |
266 | 178 → Hom A a0' a0 |
179 iso-r I Γ a0 a0' t0 t0' lim lim' = limit lim a0' t0' | |
180 | |
181 | |
182 iso-lr : { c₁' c₂' ℓ' : Level} ( I : Category c₁' c₂' ℓ' ) ( Γ : Functor I A ) | |
183 ( a0 a0' : Obj A ) ( t0 : NTrans I A ( K I a0 ) Γ ) ( t0' : NTrans I A ( K I a0' ) Γ ) | |
184 ( lim : Limit I Γ a0 t0 ) → ( lim' : Limit I Γ a0' t0' ) → ∀{ i : Obj I } → | |
185 A [ A [ iso-l I Γ a0 a0' t0 t0' lim lim' o iso-r I Γ a0 a0' t0 t0' lim lim' ] ≈ id1 A a0' ] | |
186 iso-lr I Γ a0 a0' t0 t0' lim lim' {i} = let open ≈-Reasoning (A) in begin | |
187 limit lim' a0 t0 o limit lim a0' t0' | |
271 | 188 ≈↑⟨ limit-uniqueness lim' ( λ {i} → ( begin |
266 | 189 TMap t0' i o ( limit lim' a0 t0 o limit lim a0' t0' ) |
190 ≈⟨ assoc ⟩ | |
282 | 191 ( TMap t0' i o limit lim' a0 t0 ) o limit lim a0' t0' |
266 | 192 ≈⟨ car ( t0f=t lim' ) ⟩ |
282 | 193 TMap t0 i o limit lim a0' t0' |
266 | 194 ≈⟨ t0f=t lim ⟩ |
282 | 195 TMap t0' i |
271 | 196 ∎) ) ⟩ |
266 | 197 limit lim' a0' t0' |
271 | 198 ≈⟨ limit-uniqueness lim' idR ⟩ |
266 | 199 id a0' |
200 ∎ | |
201 | |
202 | |
282 | 203 open import CatExponetial |
267 | 204 |
205 open Functor | |
206 | |
207 -------------------------------- | |
208 -- | |
209 -- Contancy Functor | |
266 | 210 |
268 | 211 KI : { c₁' c₂' ℓ' : Level} ( I : Category c₁' c₂' ℓ' ) → Functor A ( A ^ I ) |
212 KI { c₁'} {c₂'} {ℓ'} I = record { | |
267 | 213 FObj = λ a → K I a ; |
214 FMap = λ f → record { -- NTrans I A (K I a) (K I b) | |
215 TMap = λ a → f ; | |
282 | 216 isNTrans = record { |
267 | 217 commute = λ {a b f₁} → commute1 {a} {b} {f₁} f |
218 } | |
282 | 219 } ; |
266 | 220 isFunctor = let open ≈-Reasoning (A) in record { |
267 | 221 ≈-cong = λ f=g {x} → f=g |
266 | 222 ; identity = refl-hom |
267 | 223 ; distr = refl-hom |
266 | 224 } |
267 | 225 } where |
226 commute1 : {a b : Obj I} {f₁ : Hom I a b} → {a' b' : Obj A} → (f : Hom A a' b' ) → | |
227 A [ A [ FMap (K I b') f₁ o f ] ≈ A [ f o FMap (K I a') f₁ ] ] | |
282 | 228 commute1 {a} {b} {f₁} {a'} {b'} f = let open ≈-Reasoning (A) in begin |
229 FMap (K I b') f₁ o f | |
267 | 230 ≈⟨ idL ⟩ |
231 f | |
232 ≈↑⟨ idR ⟩ | |
282 | 233 f o FMap (K I a') f₁ |
267 | 234 ∎ |
235 | |
236 | |
272 | 237 --------- |
238 -- | |
239 -- limit gives co universal mapping ( i.e. adjunction ) | |
240 -- | |
241 -- F = KI I : Functor A (A ^ I) | |
282 | 242 -- U = λ b → A0 (lim b {a0 b} {t0 b} |
243 -- ε = λ b → T0 ( lim b {a0 b} {t0 b} ) | |
272 | 244 |
282 | 245 limit2couniv : |
270
8ba03259a177
one yellow remain on ∀{x} → B [ TMap f x ≈ TMap g x ]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
269
diff
changeset
|
246 ( lim : ( Γ : Functor I A ) → { a0 : Obj A } { t0 : NTrans I A ( K I a0 ) Γ } → Limit I Γ a0 t0 ) |
8ba03259a177
one yellow remain on ∀{x} → B [ TMap f x ≈ TMap g x ]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
269
diff
changeset
|
247 → ( a0 : ( b : Functor I A ) → Obj A ) ( t0 : ( b : Functor I A ) → NTrans I A ( K I (a0 b) ) b ) |
8ba03259a177
one yellow remain on ∀{x} → B [ TMap f x ≈ TMap g x ]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
269
diff
changeset
|
248 → coUniversalMapping A ( A ^ I ) (KI I) (λ b → A0 (lim b {a0 b} {t0 b} ) ) ( λ b → T0 ( lim b {a0 b} {t0 b} ) ) |
277 | 249 limit2couniv lim a0 t0 = record { -- F U ε |
274
1b651faa2391
adjoint2limit problems are written
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
273
diff
changeset
|
250 _*' = λ {b} {a} k → limit (lim b {a0 b} {t0 b} ) a k ; -- η |
270
8ba03259a177
one yellow remain on ∀{x} → B [ TMap f x ≈ TMap g x ]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
269
diff
changeset
|
251 iscoUniversalMapping = record { |
282 | 252 couniversalMapping = λ{ b a f} → couniversalMapping1 {b} {a} {f} ; |
271 | 253 couniquness = couniquness2 |
270
8ba03259a177
one yellow remain on ∀{x} → B [ TMap f x ≈ TMap g x ]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
269
diff
changeset
|
254 } |
8ba03259a177
one yellow remain on ∀{x} → B [ TMap f x ≈ TMap g x ]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
269
diff
changeset
|
255 } where |
8ba03259a177
one yellow remain on ∀{x} → B [ TMap f x ≈ TMap g x ]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
269
diff
changeset
|
256 couniversalMapping1 : {b : Obj (A ^ I)} {a : Obj A} {f : Hom (A ^ I) (FObj (KI I) a) b} → |
8ba03259a177
one yellow remain on ∀{x} → B [ TMap f x ≈ TMap g x ]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
269
diff
changeset
|
257 A ^ I [ A ^ I [ T0 (lim b {a0 b} {t0 b}) o FMap (KI I) (limit (lim b {a0 b} {t0 b}) a f) ] ≈ f ] |
8ba03259a177
one yellow remain on ∀{x} → B [ TMap f x ≈ TMap g x ]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
269
diff
changeset
|
258 couniversalMapping1 {b} {a} {f} {i} = let open ≈-Reasoning (A) in begin |
282 | 259 TMap (T0 (lim b {a0 b} {t0 b})) i o TMap ( FMap (KI I) (limit (lim b {a0 b} {t0 b}) a f) ) i |
270
8ba03259a177
one yellow remain on ∀{x} → B [ TMap f x ≈ TMap g x ]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
269
diff
changeset
|
260 ≈⟨⟩ |
8ba03259a177
one yellow remain on ∀{x} → B [ TMap f x ≈ TMap g x ]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
269
diff
changeset
|
261 TMap (t0 b) i o (limit (lim b) a f) |
8ba03259a177
one yellow remain on ∀{x} → B [ TMap f x ≈ TMap g x ]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
269
diff
changeset
|
262 ≈⟨ t0f=t (lim b) ⟩ |
8ba03259a177
one yellow remain on ∀{x} → B [ TMap f x ≈ TMap g x ]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
269
diff
changeset
|
263 TMap f i -- i comes from ∀{i} → B [ TMap f i ≈ TMap g i ] |
8ba03259a177
one yellow remain on ∀{x} → B [ TMap f x ≈ TMap g x ]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
269
diff
changeset
|
264 ∎ |
271 | 265 couniquness2 : {b : Obj (A ^ I)} {a : Obj A} {f : Hom (A ^ I) (FObj (KI I) a) b} {g : Hom A a (A0 (lim b {a0 b} {t0 b} ))} → |
282 | 266 ( ∀ { i : Obj I } → A [ A [ TMap (T0 (lim b {a0 b} {t0 b} )) i o TMap ( FMap (KI I) g) i ] ≈ TMap f i ] ) |
272 | 267 → A [ limit (lim b {a0 b} {t0 b} ) a f ≈ g ] |
271 | 268 couniquness2 {b} {a} {f} {g} lim-g=f = let open ≈-Reasoning (A) in begin |
270
8ba03259a177
one yellow remain on ∀{x} → B [ TMap f x ≈ TMap g x ]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
269
diff
changeset
|
269 limit (lim b {a0 b} {t0 b} ) a f |
271 | 270 ≈⟨ limit-uniqueness ( lim b {a0 b} {t0 b} ) lim-g=f ⟩ |
270
8ba03259a177
one yellow remain on ∀{x} → B [ TMap f x ≈ TMap g x ]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
269
diff
changeset
|
271 g |
8ba03259a177
one yellow remain on ∀{x} → B [ TMap f x ≈ TMap g x ]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
269
diff
changeset
|
272 ∎ |
268 | 273 |
272 | 274 open import Category.Cat |
275 | 275 |
276 | |
278 | 277 open coUniversalMapping |
282 | 278 |
279 univ2limit : | |
280 ( U : Obj (A ^ I ) → Obj A ) | |
279
8df8e74e6316
limit and prod/equalizer
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
278
diff
changeset
|
281 ( ε : ( b : Obj (A ^ I ) ) → NTrans I A (K I (U b)) b ) |
8df8e74e6316
limit and prod/equalizer
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
278
diff
changeset
|
282 ( univ : coUniversalMapping A (A ^ I) (KI I) U (ε) ) → |
8df8e74e6316
limit and prod/equalizer
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
278
diff
changeset
|
283 ( Γ : Functor I A ) → Limit I Γ (U Γ) (ε Γ) |
278 | 284 univ2limit U ε univ Γ = record { |
272 | 285 limit = λ a t → limit1 a t ; |
282 | 286 t0f=t = λ {a t i } → t0f=t1 {a} {t} {i} ; |
287 limit-uniqueness = λ {a} {t} {f} t=f → limit-uniqueness1 {a} {t} {f} t=f | |
272 | 288 } where |
279
8df8e74e6316
limit and prod/equalizer
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
278
diff
changeset
|
289 limit1 : (a : Obj A) → NTrans I A (K I a) Γ → Hom A a (U Γ) |
282 | 290 limit1 a t = _*' univ {_} {a} t |
279
8df8e74e6316
limit and prod/equalizer
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
278
diff
changeset
|
291 t0f=t1 : {a : Obj A} {t : NTrans I A (K I a) Γ} {i : Obj I} → |
8df8e74e6316
limit and prod/equalizer
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
278
diff
changeset
|
292 A [ A [ TMap (ε Γ) i o limit1 a t ] ≈ TMap t i ] |
274
1b651faa2391
adjoint2limit problems are written
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
273
diff
changeset
|
293 t0f=t1 {a} {t} {i} = let open ≈-Reasoning (A) in begin |
279
8df8e74e6316
limit and prod/equalizer
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
278
diff
changeset
|
294 TMap (ε Γ) i o limit1 a t |
274
1b651faa2391
adjoint2limit problems are written
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
273
diff
changeset
|
295 ≈⟨⟩ |
280 | 296 TMap (ε Γ) i o _*' univ {Γ} {a} t |
297 ≈⟨ coIsUniversalMapping.couniversalMapping ( iscoUniversalMapping univ) {Γ} {a} {t} ⟩ | |
274
1b651faa2391
adjoint2limit problems are written
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
273
diff
changeset
|
298 TMap t i |
1b651faa2391
adjoint2limit problems are written
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
273
diff
changeset
|
299 ∎ |
282 | 300 limit-uniqueness1 : { a : Obj A } → { t : NTrans I A ( K I a ) Γ } → { f : Hom A a (U Γ)} |
279
8df8e74e6316
limit and prod/equalizer
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
278
diff
changeset
|
301 → ( ∀ { i : Obj I } → A [ A [ TMap (ε Γ) i o f ] ≈ TMap t i ] ) → A [ limit1 a t ≈ f ] |
274
1b651faa2391
adjoint2limit problems are written
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
273
diff
changeset
|
302 limit-uniqueness1 {a} {t} {f} εf=t = let open ≈-Reasoning (A) in begin |
278 | 303 _*' univ t |
304 ≈⟨ ( coIsUniversalMapping.couniquness ( iscoUniversalMapping univ) ) εf=t ⟩ | |
274
1b651faa2391
adjoint2limit problems are written
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
273
diff
changeset
|
305 f |
1b651faa2391
adjoint2limit problems are written
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
273
diff
changeset
|
306 ∎ |
1b651faa2391
adjoint2limit problems are written
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
273
diff
changeset
|
307 |
281
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
308 ----- |
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
309 -- |
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
310 -- product on arbitrary index |
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
311 -- |
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
312 |
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
313 record IProduct { c c₁ c₂ ℓ : Level} ( A : Category c₁ c₂ ℓ ) ( I : Set c) |
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
314 ( p : Obj A ) -- product |
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
315 ( ai : I → Obj A ) -- families |
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
316 ( pi : (i : I ) → Hom A p ( ai i ) ) -- projections |
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
317 : Set (c ⊔ ℓ ⊔ (c₁ ⊔ c₂)) where |
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
318 field |
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
319 product : {q : Obj A} → ( qi : (i : I) → Hom A q (ai i) ) → Hom A q p |
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
320 pif=q : {q : Obj A} → ( qi : (i : I) → Hom A q (ai i) ) → ∀ { i : I } → A [ A [ ( pi i ) o ( product qi ) ] ≈ (qi i) ] |
289
7dc163c026b7
move to iProduct axiom
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
288
diff
changeset
|
321 -- special case of product ( qi = pi ) |
7dc163c026b7
move to iProduct axiom
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
288
diff
changeset
|
322 pif=q1 : { i : I } → { qi : Hom A p (ai i) } → A [ pi i ≈ qi ] |
281
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
323 ip-uniqueness : {q : Obj A} { h : Hom A q p } → A [ product ( λ (i : I) → A [ (pi i) o h ] ) ≈ h ] |
283 | 324 ip-cong : {q : Obj A} → { qi : (i : I) → Hom A q (ai i) } → { qi' : (i : I) → Hom A q (ai i) } |
282 | 325 → ( ∀ (i : I ) → A [ qi i ≈ qi' i ] ) → A [ product qi ≈ product qi' ] |
326 | |
327 open IProduct | |
283 | 328 open Equalizer |
281
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
329 |
282 | 330 -- |
331 -- limit from equalizer and product | |
332 -- | |
333 -- | |
283 | 334 -- ai |
335 -- ^ K f = id lim | |
336 -- | pi lim = K i ------------> K j = lim | |
337 -- | | | | |
338 -- p | | | |
339 -- ^ ε i | | ε j | |
340 -- | | | | |
285
46d4ad55b948
commutativity continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
284
diff
changeset
|
341 -- | e = equalizer (id p) (id p) | | |
283 | 342 -- | v v |
343 -- lim <------------------ d' a i = Γ i ------------> Γ j = a j | |
344 -- k ( product pi ) Γ f | |
345 -- Γ f o ε i = ε j | |
346 -- | |
347 -- | |
281
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
348 |
283 | 349 limit-ε : |
281
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
350 ( prod : (p : Obj A) ( ai : Obj I → Obj A ) ( pi : (i : Obj I) → Hom A p ( ai i ) ) |
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
351 → IProduct {c₁'} A (Obj I) p ai pi ) |
282 | 352 ( eqa : {a b c : Obj A} → (e : Hom A c a ) → (f g : Hom A a b) → Equalizer A e f g ) |
353 ( Γ : Functor I A ) → | |
354 ( lim p : Obj A ) ( e : Hom A lim p ) | |
355 ( proj : (i : Obj I ) → Hom A p (FObj Γ i) ) → | |
281
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
356 NTrans I A (K I lim) Γ |
289
7dc163c026b7
move to iProduct axiom
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
288
diff
changeset
|
357 limit-ε prod eqa Γ lim p e proj = record { |
282 | 358 TMap = tmap ; |
281
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
359 isNTrans = record { |
282 | 360 commute = commute1 |
281
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
361 } |
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
362 } where |
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
363 tmap : (i : Obj I) → Hom A (FObj (K I lim) i) (FObj Γ i) |
285
46d4ad55b948
commutativity continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
284
diff
changeset
|
364 tmap i = A [ proj i o e ] |
283 | 365 commute1 : {i j : Obj I} {f : Hom I i j} → |
366 A [ A [ FMap Γ f o tmap i ] ≈ A [ tmap j o FMap (K I lim) f ] ] | |
285
46d4ad55b948
commutativity continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
284
diff
changeset
|
367 commute1 {i} {j} {f} = let open ≈-Reasoning (A) in begin |
46d4ad55b948
commutativity continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
284
diff
changeset
|
368 FMap Γ f o tmap i |
46d4ad55b948
commutativity continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
284
diff
changeset
|
369 ≈⟨⟩ |
46d4ad55b948
commutativity continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
284
diff
changeset
|
370 FMap Γ f o ( proj i o e ) |
46d4ad55b948
commutativity continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
284
diff
changeset
|
371 ≈⟨ assoc ⟩ |
46d4ad55b948
commutativity continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
284
diff
changeset
|
372 ( FMap Γ f o proj i ) o e |
289
7dc163c026b7
move to iProduct axiom
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
288
diff
changeset
|
373 ≈↑⟨ car ( pif=q1 ( prod p (FObj Γ) proj ) {j} ) ⟩ |
285
46d4ad55b948
commutativity continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
284
diff
changeset
|
374 proj j o e |
46d4ad55b948
commutativity continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
284
diff
changeset
|
375 ≈↑⟨ idR ⟩ |
46d4ad55b948
commutativity continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
284
diff
changeset
|
376 (proj j o e ) o id1 A lim |
46d4ad55b948
commutativity continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
284
diff
changeset
|
377 ≈⟨⟩ |
46d4ad55b948
commutativity continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
284
diff
changeset
|
378 tmap j o FMap (K I lim) f |
288 | 379 ∎ |
281
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
380 |
282 | 381 limit-from : |
285
46d4ad55b948
commutativity continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
284
diff
changeset
|
382 ( prod : (p : Obj A) ( ai : Obj I → Obj A ) ( pi : (i : Obj I) → Hom A p ( ai i ) ) |
281
dbd2044add2a
limit from product and equalizer continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
280
diff
changeset
|
383 → IProduct {c₁'} A (Obj I) p ai pi ) |
285
46d4ad55b948
commutativity continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
284
diff
changeset
|
384 ( eqa : {a b c : Obj A} → (e : Hom A c a ) → (f g : Hom A a b) → Equalizer A e f g ) |
46d4ad55b948
commutativity continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
284
diff
changeset
|
385 ( Γ : Functor I A ) → ( lim p : Obj A ) -- limit to be made |
46d4ad55b948
commutativity continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
284
diff
changeset
|
386 ( e : Hom A lim p ) -- existing of equalizer |
46d4ad55b948
commutativity continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
284
diff
changeset
|
387 ( proj : (i : Obj I ) → Hom A p (FObj Γ i) ) -- existing of product ( projection actually ) |
289
7dc163c026b7
move to iProduct axiom
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
288
diff
changeset
|
388 → Limit I Γ lim ( limit-ε prod eqa Γ lim p e proj ) |
7dc163c026b7
move to iProduct axiom
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
288
diff
changeset
|
389 limit-from prod eqa Γ lim p e proj = record { |
282 | 390 limit = λ a t → limit1 a t ; |
391 t0f=t = λ {a t i } → t0f=t1 {a} {t} {i} ; | |
392 limit-uniqueness = λ {a} {t} {f} t=f → limit-uniqueness1 {a} {t} {f} t=f | |
393 } where | |
394 limit1 : (a : Obj A) → NTrans I A (K I a) Γ → Hom A a lim | |
283 | 395 limit1 a t = let open ≈-Reasoning (A) in k (eqa e (id1 A p) (id1 A p )) (product ( prod p (FObj Γ) proj ) (TMap t) ) refl-hom |
282 | 396 t0f=t1 : {a : Obj A} {t : NTrans I A (K I a) Γ} {i : Obj I} → |
289
7dc163c026b7
move to iProduct axiom
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
288
diff
changeset
|
397 A [ A [ TMap (limit-ε prod eqa Γ lim p e proj ) i o limit1 a t ] ≈ TMap t i ] |
283 | 398 t0f=t1 {a} {t} {i} = let open ≈-Reasoning (A) in begin |
289
7dc163c026b7
move to iProduct axiom
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
288
diff
changeset
|
399 TMap (limit-ε prod eqa Γ lim p e proj ) i o limit1 a t |
283 | 400 ≈⟨⟩ |
401 ( ( proj i ) o e ) o k (eqa e (id1 A p) (id1 A p )) (product ( prod p (FObj Γ) proj ) (TMap t) ) refl-hom | |
402 ≈↑⟨ assoc ⟩ | |
403 proj i o ( e o k (eqa e (id1 A p) (id1 A p )) (product ( prod p (FObj Γ) proj ) (TMap t) ) refl-hom ) | |
404 ≈⟨ cdr ( ek=h ( eqa e (id1 A p) (id1 A p ) ) ) ⟩ | |
405 proj i o product (prod p (FObj Γ) proj) (TMap t) | |
406 ≈⟨ pif=q (prod p (FObj Γ) proj) (TMap t) ⟩ | |
407 TMap t i | |
408 ∎ | |
409 limit-uniqueness1 : {a : Obj A} {t : NTrans I A (K I a) Γ} {f : Hom A a lim} | |
289
7dc163c026b7
move to iProduct axiom
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
288
diff
changeset
|
410 → ({i : Obj I} → A [ A [ TMap (limit-ε prod eqa Γ lim p e proj ) i o f ] ≈ TMap t i ]) → |
282 | 411 A [ limit1 a t ≈ f ] |
283 | 412 limit-uniqueness1 {a} {t} {f} lim=t = let open ≈-Reasoning (A) in begin |
413 limit1 a t | |
414 ≈⟨⟩ | |
415 k (eqa e (id1 A p) (id1 A p )) (product ( prod p (FObj Γ) proj ) (TMap t) ) refl-hom | |
416 ≈⟨ Equalizer.uniqueness (eqa e (id1 A p) (id1 A p )) ( begin | |
417 e o f | |
418 ≈↑⟨ ip-uniqueness (prod p (FObj Γ) proj) ⟩ | |
419 product (prod p (FObj Γ) proj) (λ i → ( proj i o ( e o f ) ) ) | |
284 | 420 ≈⟨ ip-cong (prod p (FObj Γ) proj) ( λ i → begin |
285
46d4ad55b948
commutativity continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
284
diff
changeset
|
421 proj i o ( e o f ) |
284 | 422 ≈⟨ assoc ⟩ |
285
46d4ad55b948
commutativity continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
284
diff
changeset
|
423 ( proj i o e ) o f |
46d4ad55b948
commutativity continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
284
diff
changeset
|
424 ≈⟨ lim=t {i} ⟩ |
46d4ad55b948
commutativity continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
284
diff
changeset
|
425 TMap t i |
284 | 426 ∎ ) ⟩ |
283 | 427 product (prod p (FObj Γ) proj) (TMap t) |
428 ∎ ) ⟩ | |
429 f | |
430 ∎ | |
431 |