@@ -8,12 +8,14 @@ import category_theory.discrete_category
8
8
import category_theory.yoneda
9
9
import category_theory.reflects_isomorphisms
10
10
11
- universes v u u' -- morphism levels before object levels. See note [category_theory universes].
11
+ universes v u₁ u₂ -- morphism levels before object levels. See note [category_theory universes].
12
12
13
13
open category_theory
14
14
15
15
variables {J : Type v} [small_category J]
16
- variables {C : Type u} [category.{v} C]
16
+ variables {K : Type v} [small_category K]
17
+ variables {C : Type u₁} [category.{v} C]
18
+ variables {D : Type u₂} [category.{v} D]
17
19
18
20
open category_theory
19
21
open category_theory.category
@@ -31,7 +33,7 @@ natural transformations from the constant functor with value `X` to `F`.
31
33
An object representing this functor is a limit of `F`.
32
34
-/
33
35
@[simps]
34
- def cones : Cᵒᵖ ⥤ Type v := (const J).op ⋙ ( yoneda.obj F)
36
+ def cones : Cᵒᵖ ⥤ Type v := (const J).op ⋙ yoneda.obj F
35
37
36
38
/--
37
39
`F.cocones` is the functor assigning to an object `X` the type of
@@ -79,14 +81,11 @@ structure cone (F : J ⥤ C) :=
79
81
80
82
instance inhabited_cone (F : discrete punit ⥤ C) : inhabited (cone F) :=
81
83
⟨{ X := F.obj punit.star,
82
- π :=
83
- { app := λ X, match X with
84
- | punit.star := 𝟙 _
85
- end } }⟩
84
+ π := { app := λ ⟨⟩, 𝟙 _ } }⟩
86
85
87
86
@[simp, reassoc] lemma cone.w {F : J ⥤ C} (c : cone F) {j j' : J} (f : j ⟶ j') :
88
87
c.π.app j ≫ F.map f = c.π.app j' :=
89
- by { rw ← ( c.π.naturality f) , apply id_comp }
88
+ by { rw ← c.π.naturality f, apply id_comp }
90
89
91
90
/--
92
91
A `c : cocone F` is
@@ -101,41 +100,36 @@ structure cocone (F : J ⥤ C) :=
101
100
102
101
instance inhabited_cocone (F : discrete punit ⥤ C) : inhabited (cocone F) :=
103
102
⟨{ X := F.obj punit.star,
104
- ι :=
105
- { app := λ X, match X with
106
- | punit.star := 𝟙 _
107
- end } }⟩
103
+ ι := { app := λ ⟨⟩, 𝟙 _ } }⟩
108
104
109
105
@[simp, reassoc] lemma cocone.w {F : J ⥤ C} (c : cocone F) {j j' : J} (f : j ⟶ j') :
110
106
F.map f ≫ c.ι.app j' = c.ι.app j :=
111
- by { rw ( c.ι.naturality f) , apply comp_id }
107
+ by { rw c.ι.naturality f, apply comp_id }
112
108
113
109
variables {F : J ⥤ C}
114
110
115
111
namespace cone
116
112
117
113
/-- The isomorphism between a cone on `F` and an element of the functor `F.cones`. -/
114
+ @[simps]
118
115
def equiv (F : J ⥤ C) : cone F ≅ Σ X, F.cones.obj X :=
119
116
{ hom := λ c, ⟨op c.X, c.π⟩,
120
- inv := λ c, { X := unop c.1 , π := c.2 },
121
- hom_inv_id' := begin ext1, cases x, refl, end ,
122
- inv_hom_id' := begin ext1, cases x, refl, end }
117
+ inv := λ c, { X := c.1 .unop , π := c.2 },
118
+ hom_inv_id' := by { ext1, cases x, refl } ,
119
+ inv_hom_id' := by { ext1, cases x, refl } }
123
120
124
121
/-- A map to the vertex of a cone naturally induces a cone by composition. -/
125
- @[simp] def extensions (c : cone F) : yoneda.obj c.X ⟶ F.cones :=
122
+ @[simps] def extensions (c : cone F) :
123
+ yoneda.obj c.X ⟶ F.cones :=
126
124
{ app := λ X f, (const J).map f ≫ c.π }
127
125
128
126
/-- A map to the vertex of a cone induces a cone by composition. -/
129
- @[simp ] def extend (c : cone F) {X : C} (f : X ⟶ c.X) : cone F :=
127
+ @[simps ] def extend (c : cone F) {X : C} (f : X ⟶ c.X) : cone F :=
130
128
{ X := X,
131
129
π := c.extensions.app (op X) f }
132
130
133
- @[simp] lemma extend_π (c : cone F) {X : Cᵒᵖ} (f : unop X ⟶ c.X) :
134
- (extend c f).π = c.extensions.app X f :=
135
- rfl
136
-
137
131
/-- Whisker a cone by precomposition of a functor. -/
138
- @[simps] def whisker {K : Type v} [small_category K] (E : K ⥤ J) (c : cone F) : cone (E ⋙ F) :=
132
+ @[simps] def whisker (E : K ⥤ J) (c : cone F) : cone (E ⋙ F) :=
139
133
{ X := c.X,
140
134
π := whisker_left E c.π }
141
135
@@ -147,27 +141,23 @@ namespace cocone
147
141
def equiv (F : J ⥤ C) : cocone F ≅ Σ X, F.cocones.obj X :=
148
142
{ hom := λ c, ⟨c.X, c.ι⟩,
149
143
inv := λ c, { X := c.1 , ι := c.2 },
150
- hom_inv_id' := begin ext1, cases x, refl, end ,
151
- inv_hom_id' := begin ext1, cases x, refl, end }
144
+ hom_inv_id' := by { ext1, cases x, refl } ,
145
+ inv_hom_id' := by { ext1, cases x, refl } }
152
146
153
147
/-- A map from the vertex of a cocone naturally induces a cocone by composition. -/
154
- @[simp ] def extensions (c : cocone F) : coyoneda.obj (op c.X) ⟶ F.cocones :=
148
+ @[simps ] def extensions (c : cocone F) : coyoneda.obj (op c.X) ⟶ F.cocones :=
155
149
{ app := λ X f, c.ι ≫ (const J).map f }
156
150
157
151
/-- A map from the vertex of a cocone induces a cocone by composition. -/
158
- @[simp ] def extend (c : cocone F) {X : C} (f : c.X ⟶ X) : cocone F :=
152
+ @[simps ] def extend (c : cocone F) {X : C} (f : c.X ⟶ X) : cocone F :=
159
153
{ X := X,
160
154
ι := c.extensions.app X f }
161
155
162
- @[simp] lemma extend_ι (c : cocone F) {X : C} (f : c.X ⟶ X) :
163
- (extend c f).ι = c.extensions.app X f :=
164
- rfl
165
-
166
156
/--
167
157
Whisker a cocone by precomposition of a functor. See `whiskering` for a functorial
168
158
version.
169
159
-/
170
- @[simps] def whisker {K : Type v} [small_category K] (E : K ⥤ J) (c : cocone F) : cocone (E ⋙ F) :=
160
+ @[simps] def whisker (E : K ⥤ J) (c : cocone F) : cocone (E ⋙ F) :=
171
161
{ X := c.X,
172
162
ι := whisker_left E c.ι }
173
163
@@ -183,10 +173,10 @@ restate_axiom cone_morphism.w'
183
173
attribute [simp, reassoc] cone_morphism.w
184
174
185
175
instance inhabited_cone_morphism (A : cone F) : inhabited (cone_morphism A A) :=
186
- ⟨{ hom := 𝟙 _}⟩
176
+ ⟨{ hom := 𝟙 _ }⟩
187
177
188
178
/-- The category of cones on a given diagram. -/
189
- @[simps] instance cone.category : category.{v} (cone F) :=
179
+ @[simps] instance cone.category : category (cone F) :=
190
180
{ hom := λ A B, cone_morphism A B,
191
181
comp := λ X Y Z f g, { hom := f.hom ≫ g.hom },
192
182
id := λ B, { hom := 𝟙 B.X } }
@@ -214,16 +204,17 @@ Functorially postcompose a cone for `F` by a natural transformation `F ⟶ G` to
214
204
-/
215
205
@[simps] def postcompose {G : J ⥤ C} (α : F ⟶ G) : cone F ⥤ cone G :=
216
206
{ obj := λ c, { X := c.X, π := c.π ≫ α },
217
- map := λ c₁ c₂ f, { hom := f.hom, w' :=
218
- by intro; erw ← category.assoc; simp [-category.assoc] } }
207
+ map := λ c₁ c₂ f, { hom := f.hom } }
219
208
220
209
/-- Postcomposing a cone by the composite natural transformation `α ≫ β` is the same as
221
210
postcomposing by `α` and then by `β`. -/
211
+ @[simps]
222
212
def postcompose_comp {G H : J ⥤ C} (α : F ⟶ G) (β : G ⟶ H) :
223
213
postcompose (α ≫ β) ≅ postcompose α ⋙ postcompose β :=
224
214
nat_iso.of_components (λ s, cones.ext (iso.refl _) (by tidy)) (by tidy)
225
215
226
216
/-- Postcomposing by the identity does not change the cone up to isomorphism. -/
217
+ @[simps]
227
218
def postcompose_id : postcompose (𝟙 F) ≅ 𝟭 (cone F) :=
228
219
nat_iso.of_components (λ s, cones.ext (iso.refl _) (by tidy)) (by tidy)
229
220
@@ -242,37 +233,32 @@ def postcompose_equivalence {G : J ⥤ C} (α : F ≅ G) : cone F ≌ cone G :=
242
233
Whiskering on the left by `E : K ⥤ J` gives a functor from `cone F` to `cone (E ⋙ F)`.
243
234
-/
244
235
@[simps]
245
- def whiskering {K : Type v} [small_category K] (E : K ⥤ J) : cone F ⥤ cone (E ⋙ F) :=
236
+ def whiskering (E : K ⥤ J) : cone F ⥤ cone (E ⋙ F) :=
246
237
{ obj := λ c, c.whisker E,
247
- map := λ c c' f, { hom := f.hom, } }
238
+ map := λ c c' f, { hom := f.hom } }
248
239
249
240
/--
250
241
Whiskering by an equivalence gives an equivalence between categories of cones.
251
242
-/
252
243
@[simps]
253
- def whiskering_equivalence {K : Type v} [small_category K] (e : K ≌ J) :
244
+ def whiskering_equivalence (e : K ≌ J) :
254
245
cone F ≌ cone (e.functor ⋙ F) :=
255
246
{ functor := whiskering e.functor,
256
- inverse := whiskering e.inverse ⋙
257
- postcompose ((functor.associator _ _ _).inv ≫ (whisker_right (e.counit_iso).hom F) ≫
258
- (functor.left_unitor F).hom),
247
+ inverse := whiskering e.inverse ⋙ postcompose (e.inv_fun_id_assoc F).hom,
259
248
unit_iso := nat_iso.of_components (λ s, cones.ext (iso.refl _) (by tidy)) (by tidy),
260
249
counit_iso := nat_iso.of_components (λ s, cones.ext (iso.refl _)
261
250
(begin
262
251
intro k,
263
- have t := s.π.naturality (e.unit_inv.app k),
264
- dsimp at t,
265
- simp only [←e.counit_app_functor k, id_comp] at t,
266
- dsimp,
267
- simp [t],
252
+ dsimp, -- See library note [dsimp, simp]
253
+ simpa [e.counit_app_functor] using s.w (e.unit_inv.app k),
268
254
end )) (by tidy), }
269
255
270
256
/--
271
257
The categories of cones over `F` and `G` are equivalent if `F` and `G` are naturally isomorphic
272
258
(possibly after changing the indexing category by an equivalence).
273
259
-/
274
- @[simps functor_obj ]
275
- def equivalence_of_reindexing {K : Type v} [small_category K] { G : K ⥤ C}
260
+ @[simps functor inverse unit_iso counit_iso ]
261
+ def equivalence_of_reindexing {G : K ⥤ C}
276
262
(e : K ≌ J) (α : e.functor ⋙ F ≅ G) : cone F ≌ cone G :=
277
263
(whiskering_equivalence e).trans (postcompose_equivalence α)
278
264
@@ -284,7 +270,7 @@ variable (F)
284
270
def forget : cone F ⥤ C :=
285
271
{ obj := λ t, t.X, map := λ s t f, f.hom }
286
272
287
- variables {D : Type u'} [category.{v} D] (G : C ⥤ D)
273
+ variables (G : C ⥤ D)
288
274
289
275
/-- A functor `G : C ⥤ D` sends cones over `F` to cones over `F ⋙ G` functorially. -/
290
276
@[simps] def functoriality : cone F ⥤ cone (F ⋙ G) :=
@@ -293,7 +279,7 @@ variables {D : Type u'} [category.{v} D] (G : C ⥤ D)
293
279
π := { app := λ j, G.map (A.π.app j), naturality' := by intros; erw ←G.map_comp; tidy } },
294
280
map := λ X Y f,
295
281
{ hom := G.map f.hom,
296
- w' := by intros; rw [←functor.map_comp, f.w] } }
282
+ w' := λ j, by simp [-cone_morphism.w, ← f.w j ] } }
297
283
298
284
instance functoriality_full [full G] [faithful G] : full (functoriality F G) :=
299
285
{ preimage := λ X Y t,
@@ -348,7 +334,7 @@ instance inhabited_cocone_morphism (A : cocone F) : inhabited (cocone_morphism A
348
334
restate_axiom cocone_morphism.w'
349
335
attribute [simp, reassoc] cocone_morphism.w
350
336
351
- @[simps] instance cocone.category : category.{v} (cocone F) :=
337
+ @[simps] instance cocone.category : category (cocone F) :=
352
338
{ hom := λ A B, cocone_morphism A B,
353
339
comp := λ _ _ _ f g,
354
340
{ hom := f.hom ≫ g.hom },
@@ -403,15 +389,15 @@ def precompose_equivalence {G : J ⥤ C} (α : G ≅ F) : cocone F ≌ cocone G
403
389
Whiskering on the left by `E : K ⥤ J` gives a functor from `cocone F` to `cocone (E ⋙ F)`.
404
390
-/
405
391
@[simps]
406
- def whiskering {K : Type v} [small_category K] (E : K ⥤ J) : cocone F ⥤ cocone (E ⋙ F) :=
392
+ def whiskering (E : K ⥤ J) : cocone F ⥤ cocone (E ⋙ F) :=
407
393
{ obj := λ c, c.whisker E,
408
394
map := λ c c' f, { hom := f.hom, } }
409
395
410
396
/--
411
397
Whiskering by an equivalence gives an equivalence between categories of cones.
412
398
-/
413
399
@[simps]
414
- def whiskering_equivalence {K : Type v} [small_category K] (e : K ≌ J) :
400
+ def whiskering_equivalence (e : K ≌ J) :
415
401
cocone F ≌ cocone (e.functor ⋙ F) :=
416
402
{ functor := whiskering e.functor,
417
403
inverse := whiskering e.inverse ⋙
@@ -421,19 +407,16 @@ def whiskering_equivalence {K : Type v} [small_category K] (e : K ≌ J) :
421
407
counit_iso := nat_iso.of_components (λ s, cocones.ext (iso.refl _)
422
408
(begin
423
409
intro k,
424
- have t := s.ι.naturality (e.unit.app k),
425
- dsimp at t,
426
- simp only [←e.counit_inv_app_functor k, comp_id] at t,
427
410
dsimp,
428
- simp [t] ,
411
+ simpa [e.counit_inv_app_functor k] using s.w (e.unit.app k) ,
429
412
end )) (by tidy), }
430
413
431
414
/--
432
415
The categories of cocones over `F` and `G` are equivalent if `F` and `G` are naturally isomorphic
433
416
(possibly after changing the indexing category by an equivalence).
434
417
-/
435
418
@[simps functor_obj]
436
- def equivalence_of_reindexing {K : Type v} [small_category K] { G : K ⥤ C}
419
+ def equivalence_of_reindexing {G : K ⥤ C}
437
420
(e : K ≌ J) (α : e.functor ⋙ F ≅ G) : cocone F ≌ cocone G :=
438
421
(whiskering_equivalence e).trans (precompose_equivalence α.symm)
439
422
@@ -445,7 +428,7 @@ variable (F)
445
428
def forget : cocone F ⥤ C :=
446
429
{ obj := λ t, t.X, map := λ s t f, f.hom }
447
430
448
- variables {D : Type u'} [category.{v} D] (G : C ⥤ D)
431
+ variables (G : C ⥤ D)
449
432
450
433
/-- A functor `G : C ⥤ D` sends cocones over `F` to cocones over `F ⋙ G` functorially. -/
451
434
@[simps] def functoriality : cocone F ⥤ cocone (F ⋙ G) :=
@@ -510,7 +493,6 @@ end limits
510
493
511
494
namespace functor
512
495
513
- variables {D : Type u'} [category.{v} D]
514
496
variables {F : J ⥤ C} {G : J ⥤ C} (H : C ⥤ D)
515
497
516
498
open category_theory.limits
@@ -636,8 +618,6 @@ def map_cocone_precompose_equivalence_functor {α : F ≅ G} {c} :
636
618
(cocones.precompose_equivalence (iso_whisker_right α H : _)).functor.obj (H.map_cocone c) :=
637
619
cocones.ext (iso.refl _) (by tidy)
638
620
639
- variables {K : Type v} [small_category K]
640
-
641
621
/--
642
622
`map_cone` commutes with `whisker`
643
623
-/
@@ -682,16 +662,14 @@ variables {F : J ⥤ C}
682
662
{ X := unop c.X,
683
663
π :=
684
664
{ app := λ j, (c.ι.app (op j)).unop,
685
- naturality' := λ j j' f, has_hom.hom.op_inj
686
- begin dsimp, simp only [comp_id], exact (c.w f.op).symm, end } }
665
+ naturality' := λ j j' f, has_hom.hom.op_inj (c.ι.naturality f.op).symm } }
687
666
688
667
/-- Change a `cone F.op` into a `cocone F`. -/
689
668
@[simps] def cone.unop (c : cone F.op) : cocone F :=
690
669
{ X := unop c.X,
691
670
ι :=
692
671
{ app := λ j, (c.π.app (op j)).unop,
693
- naturality' := λ j j' f, has_hom.hom.op_inj
694
- begin dsimp, simp only [id_comp], exact (c.w f.op), end } }
672
+ naturality' := λ j j' f, has_hom.hom.op_inj (c.π.naturality f.op).symm } }
695
673
696
674
variables (F)
697
675
@@ -778,16 +756,17 @@ namespace category_theory.functor
778
756
open category_theory.limits
779
757
780
758
variables {F : J ⥤ C}
781
- variables {D : Type u'} [category.{v} D]
782
759
783
760
section
784
761
variables (G : C ⥤ D)
785
762
786
763
/-- The opposite cocone of the image of a cone is the image of the opposite cocone. -/
764
+ @[simps {rhs_md := semireducible}]
787
765
def map_cone_op (t : cone F) : (G.map_cone t).op ≅ (G.op.map_cocone t.op) :=
788
766
cocones.ext (iso.refl _) (by tidy)
789
767
790
768
/-- The opposite cone of the image of a cocone is the image of the opposite cone. -/
769
+ @[simps {rhs_md := semireducible}]
791
770
def map_cocone_op {t : cocone F} : (G.map_cocone t).op ≅ (G.op.map_cone t.op) :=
792
771
cones.ext (iso.refl _) (by tidy)
793
772
0 commit comments