@@ -4,11 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
4
4
Authors: Johan Commelin, Reid Barton, Bhavik Mehta
5
5
-/
6
6
import category_theory.over
7
- import category_theory.pempty
8
- import category_theory.limits.connected
9
- import category_theory.limits.creates
10
- import category_theory.limits.shapes.constructions.limits_of_products_and_equalizers
11
- import category_theory.limits.shapes.constructions.equalizers
7
+ import category_theory.limits.preserves
12
8
13
9
universes v u -- declare the `v`'s first; see `category_theory.category` for an explanation
14
10
@@ -93,214 +89,6 @@ instance forget_preserves_colimits [has_colimits C] {X : C} :
93
89
preserves_colimits (forget : over X ⥤ C) :=
94
90
{ preserves_colimits_of_shape := λ J 𝒥, by apply_instance }
95
91
96
- namespace construct_products
97
-
98
- /-- (Impl) Given a product shape in `C/B`, construct the corresponding wide pullback diagram in `C`. -/
99
- @[reducible]
100
- def wide_pullback_diagram_of_diagram_over (B : C) {J : Type v} (F : discrete J ⥤ over B) : wide_pullback_shape J ⥤ C :=
101
- wide_pullback_shape.wide_cospan B (λ j, (F.obj j).left) (λ j, (F.obj j).hom)
102
-
103
- /-- (Impl) A preliminary definition to avoid timeouts. -/
104
- @[simps]
105
- def cones_equiv_inverse_obj (B : C) {J : Type v} (F : discrete J ⥤ over B) (c : cone F) :
106
- cone (wide_pullback_diagram_of_diagram_over B F) :=
107
- { X := c.X.left,
108
- π :=
109
- { app := λ X, option.cases_on X c.X.hom (λ (j : J), (c.π.app j).left),
110
- -- `tidy` can do this using `case_bash`, but let's try to be a good `-T50000` citizen:
111
- naturality' := λ X Y f,
112
- begin
113
- dsimp, cases X; cases Y; cases f,
114
- { rw [category.id_comp, category.comp_id], },
115
- { rw [over.w, category.id_comp], },
116
- { rw [category.id_comp, category.comp_id], },
117
- end } }
118
-
119
- /-- (Impl) A preliminary definition to avoid timeouts. -/
120
- @[simps]
121
- def cones_equiv_inverse (B : C) {J : Type v} (F : discrete J ⥤ over B) :
122
- cone F ⥤ cone (wide_pullback_diagram_of_diagram_over B F) :=
123
- { obj := cones_equiv_inverse_obj B F,
124
- map := λ c₁ c₂ f,
125
- { hom := f.hom.left,
126
- w' := λ j,
127
- begin
128
- cases j,
129
- { simp },
130
- { dsimp,
131
- rw ← f.w j,
132
- refl }
133
- end } }
134
-
135
- /-- (Impl) A preliminary definition to avoid timeouts. -/
136
- @[simps]
137
- def cones_equiv_functor (B : C) {J : Type v} (F : discrete J ⥤ over B) :
138
- cone (wide_pullback_diagram_of_diagram_over B F) ⥤ cone F :=
139
- { obj := λ c,
140
- { X := over.mk (c.π.app none),
141
- π := { app := λ j, over.hom_mk (c.π.app (some j)) (by apply c.w (wide_pullback_shape.hom.term j)) } },
142
- map := λ c₁ c₂ f,
143
- { hom := over.hom_mk f.hom } }
144
-
145
- local attribute [tidy] tactic.case_bash
146
-
147
- /-- (Impl) A preliminary definition to avoid timeouts. -/
148
- @[simp]
149
- def cones_equiv_unit_iso (B : C) {J : Type v} (F : discrete J ⥤ over B) :
150
- 𝟭 (cone (wide_pullback_diagram_of_diagram_over B F)) ≅
151
- cones_equiv_functor B F ⋙ cones_equiv_inverse B F :=
152
- nat_iso.of_components (λ _, cones.ext {hom := 𝟙 _, inv := 𝟙 _} (by tidy)) (by tidy)
153
-
154
- /-- (Impl) A preliminary definition to avoid timeouts. -/
155
- @[simp]
156
- def cones_equiv_counit_iso (B : C) {J : Type v} (F : discrete J ⥤ over B) :
157
- cones_equiv_inverse B F ⋙ cones_equiv_functor B F ≅ 𝟭 (cone F) :=
158
- nat_iso.of_components
159
- (λ _, cones.ext {hom := over.hom_mk (𝟙 _), inv := over.hom_mk (𝟙 _)} (by tidy)) (by tidy)
160
-
161
- -- TODO: Can we add `. obviously` to the second arguments of `nat_iso.of_components` and `cones.ext`?
162
- /-- (Impl) Establish an equivalence between the category of cones for `F` and for the "grown" `F`. -/
163
- @[simps]
164
- def cones_equiv (B : C) {J : Type v} (F : discrete J ⥤ over B) :
165
- cone (wide_pullback_diagram_of_diagram_over B F) ≌ cone F :=
166
- { functor := cones_equiv_functor B F,
167
- inverse := cones_equiv_inverse B F,
168
- unit_iso := cones_equiv_unit_iso B F,
169
- counit_iso := cones_equiv_counit_iso B F, }
170
-
171
- /-- Use the above equivalence to prove we have a limit. -/
172
- def has_over_limit_discrete_of_wide_pullback_limit {B : C} {J : Type v} (F : discrete J ⥤ over B)
173
- [has_limit (wide_pullback_diagram_of_diagram_over B F)] :
174
- has_limit F :=
175
- { cone := _,
176
- is_limit := is_limit.of_cone_equiv
177
- (cones_equiv B F).functor (limit.is_limit (wide_pullback_diagram_of_diagram_over B F)) }
178
-
179
- /-- Given a wide pullback in `C`, construct a product in `C/B`. -/
180
- def over_product_of_wide_pullback {J : Type v} [has_limits_of_shape (wide_pullback_shape J) C] {B : C} :
181
- has_limits_of_shape (discrete J) (over B) :=
182
- { has_limit := λ F, has_over_limit_discrete_of_wide_pullback_limit F }
183
-
184
- /-- Given a pullback in `C`, construct a binary product in `C/B`. -/
185
- def over_binary_product_of_pullback [has_pullbacks C] {B : C} :
186
- has_binary_products (over B) :=
187
- { has_limits_of_shape := over_product_of_wide_pullback }
188
-
189
- /-- Given all wide pullbacks in `C`, construct products in `C/B`. -/
190
- def over_products_of_wide_pullbacks [has_wide_pullbacks C] {B : C} :
191
- has_products (over B) :=
192
- { has_limits_of_shape := λ J, over_product_of_wide_pullback }
193
-
194
- /-- Given all finite wide pullbacks in `C`, construct finite products in `C/B`. -/
195
- def over_finite_products_of_finite_wide_pullbacks [has_finite_wide_pullbacks C] {B : C} :
196
- has_finite_products (over B) :=
197
- { has_limits_of_shape := λ J 𝒥₁ 𝒥₂, by exactI over_product_of_wide_pullback }
198
-
199
- end construct_products
200
-
201
- /--
202
- Construct terminal object in the over category. This isn't an instance as it's not typically the
203
- way we want to define terminal objects.
204
- (For instance, this gives a terminal object which is different from the generic one given by
205
- `over_product_of_wide_pullback` above.)
206
- -/
207
- def over_has_terminal (B : C) : has_terminal (over B) :=
208
- { has_limits_of_shape :=
209
- { has_limit := λ F,
210
- { cone :=
211
- { X := over.mk (𝟙 _),
212
- π := { app := λ p, pempty.elim p } },
213
- is_limit :=
214
- { lift := λ s, over.hom_mk _,
215
- fac' := λ _ j, j.elim,
216
- uniq' := λ s m _,
217
- begin
218
- ext,
219
- rw over.hom_mk_left,
220
- have := m.w,
221
- dsimp at this ,
222
- rwa [category.comp_id, category.comp_id] at this
223
- end } } } }
224
-
225
- namespace creates_connected
226
-
227
- /--
228
- (Impl) Given a diagram in the over category, produce a natural transformation from the
229
- diagram legs to the specific object.
230
- -/
231
- def nat_trans_in_over {B : C} (F : J ⥤ over B) :
232
- F ⋙ forget ⟶ (category_theory.functor.const J).obj B :=
233
- { app := λ j, (F.obj j).hom }
234
-
235
- local attribute [tidy] tactic.case_bash
236
-
237
- /--
238
- (Impl) Given a cone in the base category, raise it to a cone in the over category. Note this is
239
- where the connected assumption is used.
240
- -/
241
- @[simps]
242
- def raise_cone [connected J] {B : C} {F : J ⥤ over B} (c : cone (F ⋙ forget)) :
243
- cone F :=
244
- { X := over.mk (c.π.app (default J) ≫ (F.obj (default J)).hom),
245
- π :=
246
- { app := λ j, over.hom_mk (c.π.app j) (nat_trans_from_connected (c.π ≫ nat_trans_in_over F) j) } }
247
-
248
- lemma raised_cone_lowers_to_original [connected J] {B : C} {F : J ⥤ over B}
249
- (c : cone (F ⋙ forget)) (t : is_limit c) :
250
- forget.map_cone (raise_cone c) = c :=
251
- by tidy
252
-
253
- /-- (Impl) Show that the raised cone is a limit. -/
254
- def raised_cone_is_limit [connected J] {B : C} {F : J ⥤ over B} {c : cone (F ⋙ forget)} (t : is_limit c) :
255
- is_limit (raise_cone c) :=
256
- { lift := λ s, over.hom_mk (t.lift (forget.map_cone s))
257
- (by { dsimp, simp }),
258
- uniq' := λ s m K, by { ext1, apply t.hom_ext, intro j, simp [← K j] } }
259
-
260
- end creates_connected
261
-
262
- /-- The forgetful functor from the over category creates any connected limit. -/
263
- instance forget_creates_connected_limits [connected J] {B : C} : creates_limits_of_shape J (forget : over B ⥤ C) :=
264
- { creates_limit := λ K,
265
- creates_limit_of_reflects_iso (λ c t,
266
- { lifted_cone := creates_connected.raise_cone c,
267
- valid_lift := eq_to_iso (creates_connected.raised_cone_lowers_to_original c t),
268
- makes_limit := creates_connected.raised_cone_is_limit t } ) }
269
-
270
- /-- The over category has any connected limit which the original category has. -/
271
- instance has_connected_limits {B : C} [connected J] [has_limits_of_shape J C] : has_limits_of_shape J (over B) :=
272
- { has_limit := λ F, has_limit_of_created F (forget : over B ⥤ C) }
273
-
274
- /-- Make sure we can derive pullbacks in `over B`. -/
275
- example {B : C} [has_pullbacks C] : has_pullbacks (over B) :=
276
- { has_limits_of_shape := infer_instance }
277
-
278
- /-- Make sure we can derive equalizers in `over B`. -/
279
- example {B : C} [has_equalizers C] : has_equalizers (over B) :=
280
- { has_limits_of_shape := infer_instance }
281
-
282
- instance has_finite_limits {B : C} [has_finite_wide_pullbacks C] : has_finite_limits (over B) :=
283
- begin
284
- apply @finite_limits_from_equalizers_and_finite_products _ _ _ _,
285
- { exact construct_products.over_finite_products_of_finite_wide_pullbacks },
286
- { apply @has_equalizers_of_pullbacks_and_binary_products _ _ _ _,
287
- { haveI : has_pullbacks C := ⟨infer_instance⟩,
288
- exact construct_products.over_binary_product_of_pullback },
289
- { split,
290
- apply_instance} }
291
- end
292
-
293
- instance has_limits {B : C} [has_wide_pullbacks C] : has_limits (over B) :=
294
- begin
295
- apply @limits_from_equalizers_and_products _ _ _ _,
296
- { exact construct_products.over_products_of_wide_pullbacks },
297
- { apply @has_equalizers_of_pullbacks_and_binary_products _ _ _ _,
298
- { haveI : has_pullbacks C := ⟨infer_instance⟩,
299
- exact construct_products.over_binary_product_of_pullback },
300
- { split,
301
- apply_instance } }
302
- end
303
-
304
92
end category_theory.over
305
93
306
94
namespace category_theory.under
0 commit comments