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

Commit df91623

Browse files
kim-emmergify[bot]
authored andcommitted
chore(category_theory/whiskering): clean up (#1613)
* chore(category_theory/whiskering): clean up * ugh, the stalks proofs are so fragile * fixes * minor * fix * fix
1 parent cd0bc32 commit df91623

File tree

5 files changed

+39
-70
lines changed

5 files changed

+39
-70
lines changed

src/algebraic_geometry/stalks.lean

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ begin
5555
op_induction U,
5656
cases U,
5757
simp only [colim.ι_map_assoc, colimit.ι_pre_assoc, colimit.ι_pre,
58-
whisker_left.app, whisker_right.app,
58+
whisker_left_app, whisker_right_app,
5959
assoc, id_comp, map_id, map_comp],
6060
dsimp,
6161
simp only [map_id, assoc],
6262
-- FIXME Why doesn't simp do this:
63+
erw [category_theory.functor.map_id],
64+
erw [category_theory.functor.map_id],
6365
erw [id_comp, id_comp],
6466
end
6567
end stalk_map

src/category_theory/monad/limits.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ variables (D : J ⥤ algebra T) [has_limit.{v₁} (D ⋙ forget T)]
4646
begin
4747
ext1,
4848
dsimp,
49-
simp only [limit.lift_π, γ_app, c_π, limit.cone_π, functor.const_comp, whisker_right.app,
49+
simp only [limit.lift_π, γ_app, c_π, limit.cone_π, functor.const_comp, whisker_right_app,
5050
nat_trans.comp_app, category.assoc],
5151
dsimp,
5252
simp only [id_comp],
@@ -75,7 +75,7 @@ def forget_creates_limits (D : J ⥤ algebra T) [has_limit.{v₁} (D ⋙ forget
7575
begin
7676
ext, dsimp,
7777
simp only [limit.lift_π, limit.cone_π, forget_map, id_comp, functor.const_comp,
78-
whisker_right.app, nat_trans.comp_app, category.assoc, functor.map_cone_π],
78+
whisker_right_app, nat_trans.comp_app, category.assoc, functor.map_cone_π],
7979
dsimp,
8080
rw [id_comp, ←category.assoc, ←T.map_comp],
8181
simp only [limit.lift_π, monad.forget_map, algebra.hom.h, functor.map_cone_π],

src/category_theory/opposites.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,17 +163,17 @@ include 𝒟
163163
section
164164
variables {F G : C ⥤ D}
165165

166-
protected definition op (α : F ⟶ G) : G.op ⟶ F.op :=
166+
@[simps] protected definition op (α : F ⟶ G) : G.op ⟶ F.op :=
167167
{ app := λ X, (α.app (unop X)).op,
168168
naturality' := begin tidy, erw α.naturality, refl, end }
169169

170-
@[simp] lemma op_app : F ⟶ G) (X) : (nat_trans.op α).app X = (α.app (unop X)).op := rfl
170+
@[simp] lemma op_id (F : C ⥤ D) : nat_trans.op (𝟙 F) = 𝟙 (F.op) := rfl
171171

172-
protected definition unop (α : F.op ⟶ G.op) : G ⟶ F :=
172+
@[simps] protected definition unop (α : F.op ⟶ G.op) : G ⟶ F :=
173173
{ app := λ X, (α.app (op X)).unop,
174174
naturality' := begin tidy, erw α.naturality, refl, end }
175175

176-
@[simp] lemma unop_app : F.op ⟶ G.op) (X) : (nat_trans.unop α).app X = (α.app (op X)).unop := rfl
176+
@[simp] lemma unop_id (F : C ⥤ D) : nat_trans.unop (𝟙 F.op) = 𝟙 F := rfl
177177

178178
end
179179

src/category_theory/whiskering.lean

Lines changed: 19 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,35 @@ namespace category_theory
1010
universes u₁ v₁ u₂ v₂ u₃ v₃ u₄ v₄
1111

1212
section
13-
variables (C : Type u₁) [𝒞 : category.{v₁} C]
14-
(D : Type u₂) [𝒟 : category.{v₂} D]
15-
(E : Type u₃) [ℰ : category.{v₃} E]
13+
variables {C : Type u₁} [𝒞 : category.{v₁} C]
14+
{D : Type u₂} [𝒟 : category.{v₂} D]
15+
{E : Type u₃} [ℰ : category.{v₃} E]
1616
include 𝒞 𝒟 ℰ
1717

18-
def whiskering_left : (C ⥤ D) ⥤ ((D ⥤ E) ⥤ (C ⥤ E)) :=
18+
@[simps] def whisker_left (F : C ⥤ D) {G H : D ⥤ E} (α : G ⟶ H) : (F ⋙ G) ⟶ (F ⋙ H) :=
19+
{ app := λ c, α.app (F.obj c),
20+
naturality' := λ X Y f, by rw [functor.comp_map, functor.comp_map, α.naturality] }
21+
22+
@[simps] def whisker_right {G H : C ⥤ D} (α : G ⟶ H) (F : D ⥤ E) : (G ⋙ F) ⟶ (H ⋙ F) :=
23+
{ app := λ c, F.map (α.app c),
24+
naturality' := λ X Y f, by rw [functor.comp_map, functor.comp_map, ←F.map_comp, ←F.map_comp, α.naturality] }
25+
26+
variables (C D E)
27+
28+
@[simps] def whiskering_left : (C ⥤ D) ⥤ ((D ⥤ E) ⥤ (C ⥤ E)) :=
1929
{ obj := λ F,
2030
{ obj := λ G, F ⋙ G,
21-
map := λ G H α,
22-
{ app := λ c, α.app (F.obj c),
23-
naturality' := by intros X Y f; rw [functor.comp_map, functor.comp_map, α.naturality] } },
31+
map := λ G H α, whisker_left F α },
2432
map := λ F G τ,
2533
{ app := λ H,
2634
{ app := λ c, H.map (τ.app c),
2735
naturality' := λ X Y f, begin dsimp, rw [←H.map_comp, ←H.map_comp, ←τ.naturality] end },
2836
naturality' := λ X Y f, begin ext1, dsimp, rw [f.naturality] end } }
2937

30-
def whiskering_right : (D ⥤ E) ⥤ ((C ⥤ D) ⥤ (C ⥤ E)) :=
38+
@[simps] def whiskering_right : (D ⥤ E) ⥤ ((C ⥤ D) ⥤ (C ⥤ E)) :=
3139
{ obj := λ H,
3240
{ obj := λ F, F ⋙ H,
33-
map := λ _ _ α,
34-
{ app := λ c, H.map (α.app c),
35-
naturality' := by intros X Y f;
36-
rw [functor.comp_map, functor.comp_map, ←H.map_comp, ←H.map_comp, α.naturality] } },
41+
map := λ _ _ α, whisker_right α H },
3742
map := λ G H τ,
3843
{ app := λ F,
3944
{ app := λ c, τ.app (F.obj c),
@@ -42,38 +47,6 @@ def whiskering_right : (D ⥤ E) ⥤ ((C ⥤ D) ⥤ (C ⥤ E)) :=
4247

4348
variables {C} {D} {E}
4449

45-
def whisker_left (F : C ⥤ D) {G H : D ⥤ E} (α : G ⟶ H) : (F ⋙ G) ⟶ (F ⋙ H) :=
46-
((whiskering_left C D E).obj F).map α
47-
48-
@[simp] lemma whiskering_left_obj_obj (F : C ⥤ D) (G : D ⥤ E) :
49-
((whiskering_left C D E).obj F).obj G = F ⋙ G :=
50-
rfl
51-
@[simp] lemma whiskering_left_obj_map (F : C ⥤ D) {G H : D ⥤ E} (α : G ⟶ H) :
52-
((whiskering_left C D E).obj F).map α = whisker_left F α :=
53-
rfl
54-
@[simp] lemma whiskering_left_map_app_app {F G : C ⥤ D} (τ : F ⟶ G) (H : D ⥤ E) (c) :
55-
(((whiskering_left C D E).map τ).app H).app c = H.map (τ.app c) :=
56-
rfl
57-
@[simp] lemma whisker_left.app (F : C ⥤ D) {G H : D ⥤ E} (α : G ⟶ H) (X : C) :
58-
(whisker_left F α).app X = α.app (F.obj X) :=
59-
rfl
60-
61-
def whisker_right {G H : C ⥤ D} (α : G ⟶ H) (F : D ⥤ E) : (G ⋙ F) ⟶ (H ⋙ F) :=
62-
((whiskering_right C D E).obj F).map α
63-
64-
@[simp] lemma whiskering_right_obj_obj (G : C ⥤ D) (F : D ⥤ E) :
65-
((whiskering_right C D E).obj F).obj G = G ⋙ F :=
66-
rfl
67-
@[simp] lemma whiskering_right_obj_map {G H : C ⥤ D} (α : G ⟶ H) (F : D ⥤ E) :
68-
((whiskering_right C D E).obj F).map α = whisker_right α F :=
69-
rfl
70-
@[simp] lemma whiskering_right_map_app_app (F : C ⥤ D) {G H : D ⥤ E} (τ : G ⟶ H) (c) :
71-
(((whiskering_right C D E).map τ).app F).app c = τ.app (F.obj c) :=
72-
rfl
73-
@[simp] lemma whisker_right.app {G H : C ⥤ D} (α : G ⟶ H) (F : D ⥤ E) (X : C) :
74-
(whisker_right α F).app X = F.map (α.app X) :=
75-
rfl
76-
7750
@[simp] lemma whisker_left_id (F : C ⥤ D) {G : D ⥤ E} :
7851
whisker_left F (nat_trans.id G) = nat_trans.id (F.comp G) :=
7952
rfl
@@ -166,11 +139,7 @@ omit 𝒟
166139
lemma triangle (F : A ⥤ B) (G : B ⥤ C) :
167140
(associator F (𝟭 B) G).hom ≫ (whisker_left F (left_unitor G).hom) =
168141
(whisker_right (right_unitor F).hom G) :=
169-
begin
170-
ext1,
171-
dsimp [associator, left_unitor, right_unitor],
172-
simp
173-
end
142+
by { ext1, dsimp, simp }
174143

175144
variables {E : Type u₅} [ℰ : category.{v₅} E]
176145
include 𝒟 ℰ
@@ -180,11 +149,7 @@ variables (F : A ⥤ B) (G : B ⥤ C) (H : C ⥤ D) (K : D ⥤ E)
180149
lemma pentagon :
181150
(whisker_right (associator F G H).hom K) ≫ (associator F (G ⋙ H) K).hom ≫ (whisker_left F (associator G H K).hom) =
182151
((associator (F ⋙ G) H K).hom ≫ (associator F G (H ⋙ K)).hom) :=
183-
begin
184-
ext1,
185-
dsimp [associator],
186-
simp,
187-
end
152+
by { ext1, dsimp, simp }
188153

189154
end functor
190155

src/topology/sheaves/stalks.lean

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,15 @@ begin
7474
ext1,
7575
tactic.op_induction',
7676
cases j, cases j_val,
77-
rw [colim.ι_map_assoc, colim.ι_map, colimit.ι_pre, whisker_left.app, whisker_right.app,
77+
rw [colim.ι_map_assoc, colim.ι_map, colimit.ι_pre, whisker_left_app, whisker_right_app,
7878
pushforward.id_hom_app, eq_to_hom_map, eq_to_hom_refl],
7979
dsimp,
80-
rw [category_theory.functor.map_id]
80+
-- FIXME A simp lemma which unfortunately doesn't fire:
81+
erw [category_theory.functor.map_id],
8182
end
8283

84+
-- This proof is sadly not at all robust:
85+
-- having to use `erw` at all is a bad sign.
8386
@[simp] lemma comp (ℱ : X.presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) :
8487
ℱ.stalk_pushforward C (f ≫ g) x =
8588
((f _* ℱ).stalk_pushforward C g (f x)) ≫ (ℱ.stalk_pushforward C f x) :=
@@ -89,14 +92,13 @@ begin
8992
op_induction U,
9093
cases U,
9194
cases U_val,
92-
simp only [colim.ι_map_assoc, colimit.ι_pre_assoc, colimit.ι_pre,
93-
whisker_right.app, category.assoc],
94-
dsimp,
95-
simp only [category.id_comp, category_theory.functor.map_id],
96-
-- FIXME A simp lemma which unfortunately doesn't fire:
97-
rw [category_theory.functor.map_id],
95+
simp only [colim.ι_map_assoc, colimit.ι_pre_assoc,
96+
whisker_right_app, category.assoc],
9897
dsimp,
99-
simp,
98+
-- FIXME: Some of these are simp lemmas, but don't fire successfully:
99+
erw [category_theory.functor.map_id, category.id_comp, category.id_comp, category.id_comp,
100+
colimit.ι_pre, colimit.ι_pre],
101+
refl,
100102
end
101103

102104
end stalk_pushforward

0 commit comments

Comments
 (0)