Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 857cbd5

Browse files
committed
chore(category_theory/limits/preserves): split up files and remove redundant defs (#4717)
Broken off from #4163 and #4716. While the diff of this PR is quite big, it actually doesn't do very much: - I removed the definitions of `preserves_(co)limits_iso` from `preserves/basic`, since there's already a version in `preserves/shapes` which has lemmas about it. (I didn't keep them in `preserves/basic` since that file is already getting quite big, so I chose to instead put them into the smaller file. - I split up `preserves/shapes` into two files: `preserves/limits` and `preserves/shapes`. From my other PRs my plan is for `shapes` to contain isomorphisms and constructions for special shapes, eg `fan.mk` and `fork`s, some of which aren't already present, and `limits` to have things for the general case. In this PR I don't change the situation for special shapes (other than simplifying some proofs), other than moving it into a separate file for clarity.
1 parent 8489972 commit 857cbd5

File tree

5 files changed

+126
-63
lines changed

5 files changed

+126
-63
lines changed

src/algebraic_geometry/presheafed_space/has_colimits.lean

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,19 @@ def colimit_cocone_is_colimit (F : J ⥤ PresheafedSpace C) : is_colimit (colimi
233233
c :=
234234
{ app := λ U, desc_c_app F s U,
235235
naturality' := λ U V i, desc_c_naturality F s i }, },
236+
fac' := -- tidy can do this but it takes too long
237+
begin
238+
intros s j,
239+
dsimp,
240+
fapply PresheafedSpace.ext,
241+
{ simp, },
242+
{ ext,
243+
dsimp [desc_c_app],
244+
simp only [eq_to_hom_op, limit.lift_π_assoc, eq_to_hom_map, assoc, pushforward.comp_inv_app,
245+
limit_obj_iso_limit_comp_evaluation_inv_π_app_assoc],
246+
dsimp,
247+
simp },
248+
end,
236249
uniq' := λ s m w,
237250
begin
238251
-- We need to use the identity on the continuous maps twice, so we prepare that first:

src/category_theory/limits/functor_category.lean

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright (c) 2018 Scott Morrison. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Scott Morrison
55
-/
6-
import category_theory.limits.preserves.basic
6+
import category_theory.limits.preserves.limits
77

88
open category_theory category_theory.category
99

@@ -155,15 +155,15 @@ then the evaluation of that limit at `k` is the limit of the evaluations of `F.o
155155
-/
156156
def limit_obj_iso_limit_comp_evaluation [has_limits_of_shape J C] (F : J ⥤ K ⥤ C) (k : K) :
157157
(limit F).obj k ≅ limit (F ⋙ ((evaluation K C).obj k)) :=
158-
preserves_limit_iso F ((evaluation K C).obj k)
158+
preserves_limit_iso ((evaluation K C).obj k) F
159159

160160
@[simp, reassoc]
161161
lemma limit_obj_iso_limit_comp_evaluation_hom_π
162162
[has_limits_of_shape J C] (F : J ⥤ (K ⥤ C)) (j : J) (k : K) :
163163
(limit_obj_iso_limit_comp_evaluation F k).hom ≫ limit.π (F ⋙ ((evaluation K C).obj k)) j =
164164
(limit.π F j).app k :=
165165
begin
166-
dsimp [limit_obj_iso_limit_comp_evaluation, limits.preserves_limit_iso],
166+
dsimp [limit_obj_iso_limit_comp_evaluation],
167167
simp,
168168
end
169169

@@ -173,7 +173,7 @@ lemma limit_obj_iso_limit_comp_evaluation_inv_π_app
173173
(limit_obj_iso_limit_comp_evaluation F k).inv ≫ (limit.π F j).app k =
174174
limit.π (F ⋙ ((evaluation K C).obj k)) j :=
175175
begin
176-
dsimp [limit_obj_iso_limit_comp_evaluation, limits.preserves_limit_iso],
176+
dsimp [limit_obj_iso_limit_comp_evaluation],
177177
rw iso.inv_comp_eq,
178178
simp,
179179
end
@@ -201,15 +201,15 @@ then the evaluation of that colimit at `k` is the colimit of the evaluations of
201201
-/
202202
def colimit_obj_iso_colimit_comp_evaluation [has_colimits_of_shape J C] (F : J ⥤ K ⥤ C) (k : K) :
203203
(colimit F).obj k ≅ colimit (F ⋙ ((evaluation K C).obj k)) :=
204-
preserves_colimit_iso F ((evaluation K C).obj k)
204+
preserves_colimit_iso ((evaluation K C).obj k) F
205205

206206
@[simp, reassoc]
207207
lemma colimit_obj_iso_colimit_comp_evaluation_ι_inv
208208
[has_colimits_of_shape J C] (F : J ⥤ (K ⥤ C)) (j : J) (k : K) :
209209
colimit.ι (F ⋙ ((evaluation K C).obj k)) j ≫ (colimit_obj_iso_colimit_comp_evaluation F k).inv =
210210
(colimit.ι F j).app k :=
211211
begin
212-
dsimp [colimit_obj_iso_colimit_comp_evaluation, limits.preserves_colimit_iso],
212+
dsimp [colimit_obj_iso_colimit_comp_evaluation],
213213
simp,
214214
end
215215

@@ -219,7 +219,7 @@ lemma colimit_obj_iso_colimit_comp_evaluation_ι_app_hom
219219
(colimit.ι F j).app k ≫ (colimit_obj_iso_colimit_comp_evaluation F k).hom =
220220
colimit.ι (F ⋙ ((evaluation K C).obj k)) j :=
221221
begin
222-
dsimp [colimit_obj_iso_colimit_comp_evaluation, limits.preserves_colimit_iso],
222+
dsimp [colimit_obj_iso_colimit_comp_evaluation],
223223
rw ←iso.eq_comp_inv,
224224
simp,
225225
end

src/category_theory/limits/preserves/basic.lean

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,6 @@ if `F` maps any colimit cocone over `K` to a colimit cocone.
5858
class preserves_colimit (K : J ⥤ C) (F : C ⥤ D) : Type (max u₁ u₂ v) :=
5959
(preserves : Π {c : cocone K}, is_colimit c → is_colimit (F.map_cocone c))
6060

61-
/--
62-
A functor which preserves limits preserves
63-
the arbitrary choice of limit provided by `has_limit`, up to isomorphism.
64-
-/
65-
def preserves_limit_iso (K : J ⥤ C) [has_limit K] (F : C ⥤ D) [has_limit (K ⋙ F)] [preserves_limit K F] :
66-
F.obj (limit K) ≅ limit (K ⋙ F) :=
67-
is_limit.cone_point_unique_up_to_iso (preserves_limit.preserves (limit.is_limit K)) (limit.is_limit (K ⋙ F))
68-
/--
69-
A functor which preserves colimits preserves
70-
the arbitrary choice of colimit provided by `has_colimit` up to isomorphism.
71-
-/
72-
def preserves_colimit_iso (K : J ⥤ C) [has_colimit K] (F : C ⥤ D) [has_colimit (K ⋙ F)] [preserves_colimit K F] :
73-
F.obj (colimit K) ≅ colimit (K ⋙ F) :=
74-
is_colimit.cocone_point_unique_up_to_iso (preserves_colimit.preserves (colimit.is_colimit K)) (colimit.is_colimit (K ⋙ F))
75-
7661
/-- We say that `F` preserves limits of shape `J` if `F` preserves limits for every diagram
7762
`K : J ⥤ C`, i.e., `F` maps limit cones over `K` to limit cones. -/
7863
class preserves_limits_of_shape (J : Type v) [small_category J] (F : C ⥤ D) : Type (max u₁ u₂ v) :=
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
/-
2+
Copyright (c) 2020 Scott Morrison. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Scott Morrison, Bhavik Mehta
5+
-/
6+
import category_theory.limits.preserves.basic
7+
import category_theory.limits.shapes
8+
9+
/-!
10+
# Isomorphisms about functors which preserve (co)limits
11+
12+
If `G` preserves limits, and `C` and `D` have limits, then for any diagram `F : J ⥤ C` we have a
13+
canonical isomorphism `preserves_limit_iso : G.obj (limit F) ≅ limit (F ⋙ G)`.
14+
We also show that we can commute `is_limit.lift` of a preserved limit with `functor.map_cone`:
15+
`(preserves_limit.preserves t).lift (G.map_cone c₂) = G.map (t.lift c₂)`.
16+
17+
The duals of these are also given. For functors which preserve (co)limits of specific shapes, see
18+
`preserves/shapes.lean`.
19+
-/
20+
21+
universes v u₁ u₂
22+
23+
noncomputable theory
24+
25+
open category_theory category_theory.category category_theory.limits
26+
27+
variables {C : Type u₁} [category.{v} C]
28+
variables {D : Type u₂} [category.{v} D]
29+
variables (G : C ⥤ D)
30+
variables {J : Type v} [small_category J]
31+
variables (F : J ⥤ C)
32+
33+
section
34+
variables [preserves_limit F G]
35+
36+
@[simp]
37+
lemma preserves_lift_map_cone (c₁ c₂ : cone F) (t : is_limit c₁) :
38+
(preserves_limit.preserves t).lift (G.map_cone c₂) = G.map (t.lift c₂) :=
39+
((preserves_limit.preserves t).uniq (G.map_cone c₂) _ (by simp [← G.map_comp])).symm
40+
41+
variables [has_limit F] [has_limit (F ⋙ G)]
42+
/--
43+
If `G` preserves limits, we have an isomorphism from the image of the limit of a functor `F`
44+
to the limit of the functor `F ⋙ G`.
45+
-/
46+
def preserves_limit_iso : G.obj (limit F) ≅ limit (F ⋙ G) :=
47+
(preserves_limit.preserves (limit.is_limit _)).cone_point_unique_up_to_iso (limit.is_limit _)
48+
49+
@[simp, reassoc]
50+
lemma preserves_limits_iso_hom_π (j) :
51+
(preserves_limit_iso G F).hom ≫ limit.π _ j = G.map (limit.π F j) :=
52+
is_limit.cone_point_unique_up_to_iso_hom_comp _ _ j
53+
54+
@[simp, reassoc]
55+
lemma preserves_limits_iso_inv_π (j) :
56+
(preserves_limit_iso G F).inv ≫ G.map (limit.π F j) = limit.π _ j :=
57+
is_limit.cone_point_unique_up_to_iso_inv_comp _ _ j
58+
59+
@[simp, reassoc]
60+
lemma lift_comp_preserves_limits_iso_hom (t : cone F) :
61+
G.map (limit.lift _ t) ≫ (preserves_limit_iso G F).hom = limit.lift (F ⋙ G) (G.map_cone _) :=
62+
by { ext, simp [← G.map_comp] }
63+
end
64+
65+
section
66+
variables [preserves_colimit F G]
67+
68+
@[simp]
69+
lemma preserves_desc_map_cocone (c₁ c₂ : cocone F) (t : is_colimit c₁) :
70+
(preserves_colimit.preserves t).desc (G.map_cocone _) = G.map (t.desc c₂) :=
71+
((preserves_colimit.preserves t).uniq (G.map_cocone _) _ (by simp [← G.map_comp])).symm
72+
73+
variables [has_colimit F] [has_colimit (F ⋙ G)]
74+
/--
75+
If `G` preserves colimits, we have an isomorphism from the image of the colimit of a functor `F`
76+
to the colimit of the functor `F ⋙ G`.
77+
-/
78+
-- TODO: think about swapping the order here
79+
def preserves_colimit_iso : G.obj (colimit F) ≅ colimit (F ⋙ G) :=
80+
(preserves_colimit.preserves (colimit.is_colimit _)).cocone_point_unique_up_to_iso
81+
(colimit.is_colimit _)
82+
83+
@[simp, reassoc]
84+
lemma ι_preserves_colimits_iso_inv (j : J) :
85+
colimit.ι _ j ≫ (preserves_colimit_iso G F).inv = G.map (colimit.ι F j) :=
86+
is_colimit.comp_cocone_point_unique_up_to_iso_inv _ (colimit.is_colimit (F ⋙ G)) j
87+
88+
@[simp, reassoc]
89+
lemma ι_preserves_colimits_iso_hom (j : J) :
90+
G.map (colimit.ι F j) ≫ (preserves_colimit_iso G F).hom = colimit.ι (F ⋙ G) j :=
91+
(preserves_colimit.preserves (colimit.is_colimit _)).comp_cocone_point_unique_up_to_iso_hom _ j
92+
93+
@[simp, reassoc]
94+
lemma preserves_colimits_iso_inv_comp_desc (t : cocone F) :
95+
(preserves_colimit_iso G F).inv ≫ G.map (colimit.desc _ t) = colimit.desc _ (G.map_cocone t) :=
96+
by { ext, simp [← G.map_comp] }
97+
end

src/category_theory/limits/preserves/shapes.lean

Lines changed: 9 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,22 @@ Copyright (c) 2020 Scott Morrison. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Scott Morrison
55
-/
6-
import category_theory.limits.preserves.basic
7-
import category_theory.limits.shapes.products
6+
import category_theory.limits.preserves.limits
7+
import category_theory.limits.shapes
88

99
universes v u₁ u₂
1010

1111
noncomputable theory
1212

13-
open category_theory
14-
open category_theory.limits
13+
open category_theory category_theory.category category_theory.limits
1514

1615
variables {C : Type u₁} [category.{v} C]
1716
variables {D : Type u₂} [category.{v} D]
1817
variables (G : C ⥤ D) [preserves_limits G]
1918

20-
section
21-
variables {J : Type v} [small_category J]
19+
section preserve_products
2220

23-
/--
24-
If `G` preserves limits, we have an isomorphism from the image of the limit of a functor `F`
25-
to the limit of the functor `F ⋙ G`.
26-
-/
27-
def preserves_limits_iso (F : J ⥤ C) [has_limit F] [has_limit (F ⋙ G)] :
28-
G.obj (limit F) ≅ limit (F ⋙ G) :=
29-
(cones.forget _).map_iso
30-
(is_limit.unique_up_to_iso
31-
(preserves_limit.preserves (limit.is_limit F))
32-
(limit.is_limit (F ⋙ G)))
33-
34-
@[simp, reassoc]
35-
lemma preserves_limits_iso_hom_π
36-
(F : J ⥤ C) [has_limit F] [has_limit (F ⋙ G)] (j) :
37-
(preserves_limits_iso G F).hom ≫ limit.π _ j = G.map (limit.π F j) :=
38-
begin
39-
dsimp [preserves_limits_iso, has_limit.iso_of_nat_iso, cones.postcompose,
40-
is_limit.unique_up_to_iso, is_limit.lift_cone_morphism],
41-
simp,
42-
end
21+
variables {J : Type v} (f : J → C)
4322

4423
/--
4524
If `G` preserves limits, we have an isomorphism
@@ -48,30 +27,19 @@ from the image of a product to the product of the images.
4827
-- TODO perhaps weaken the assumptions here, to just require the relevant limits?
4928
def preserves_products_iso {J : Type v} (f : J → C) [has_limits C] [has_limits D] :
5029
G.obj (pi_obj f) ≅ pi_obj (λ j, G.obj (f j)) :=
51-
preserves_limits_iso G (discrete.functor f) ≪≫
30+
preserves_limit_iso G (discrete.functor f) ≪≫
5231
has_limit.iso_of_nat_iso (discrete.nat_iso (λ j, iso.refl _))
5332

5433
@[simp, reassoc]
5534
lemma preserves_products_iso_hom_π
5635
{J : Type v} (f : J → C) [has_limits C] [has_limits D] (j) :
5736
(preserves_products_iso G f).hom ≫ pi.π _ j = G.map (pi.π f j) :=
58-
begin
59-
dsimp [preserves_products_iso, preserves_limits_iso, has_limit.iso_of_nat_iso, cones.postcompose,
60-
is_limit.unique_up_to_iso, is_limit.lift_cone_morphism, is_limit.map],
61-
simp only [limit.lift_π, discrete.nat_iso_hom_app, limit.cone_π, limit.lift_π_assoc,
62-
nat_trans.comp_app, category.assoc, functor.map_cone_π, is_limit.map_π],
63-
dsimp, simp, -- See note [dsimp, simp],
64-
end
37+
by simp [preserves_products_iso]
6538

6639
@[simp, reassoc]
6740
lemma map_lift_comp_preserves_products_iso_hom
6841
{J : Type v} (f : J → C) [has_limits C] [has_limits D] (P : C) (g : Π j, P ⟶ f j) :
6942
G.map (pi.lift g) ≫ (preserves_products_iso G f).hom = pi.lift (λ j, G.map (g j)) :=
70-
begin
71-
ext,
72-
simp only [limit.lift_π, fan.mk_π_app, preserves_products_iso_hom_π, category.assoc],
73-
simp only [←G.map_comp],
74-
simp only [limit.lift_π, fan.mk_π_app],
75-
end
43+
by { ext, simp [←G.map_comp] }
7644

77-
end
45+
end preserve_products

0 commit comments

Comments
 (0)