-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathStalk.lean
More file actions
212 lines (185 loc) · 10.5 KB
/
Stalk.lean
File metadata and controls
212 lines (185 loc) · 10.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
/-
Copyright (c) 2026 Andrew Yang. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Andrew Yang
-/
module
public import Mathlib.Algebra.Category.ModuleCat.Presheaf
public import Mathlib.Algebra.Category.Ring.Colimits
public import Mathlib.Algebra.Category.Ring.FilteredColimits
public import Mathlib.CategoryTheory.Limits.Filtered
public import Mathlib.Topology.Sheaves.Stalks
/-!
# Module structure on stalks
Let `M` be a presheaf of `R`-modules on a topological space. We endow `M.presheaf.stalk x` with
an `R.stalk x`-module structure.
The key characterizing lemma is `PresheafOfModules.germ_smul`, which describes the compatibility
of the scalar action and `TopCat.Presheaf.germ`.
-/
@[expose] public section
open CategoryTheory LinearMap Opposite TopologicalSpace
universe w₀ w u v
namespace CategoryTheory.Limits
open IsFiltered
variable {C : Type*} [SmallCategory C] [IsFiltered C] (R : C ⥤ RingCat) (M : C ⥤ Ab)
[∀ i, Module (R.obj i) (M.obj i)]
(H : ∀ {i j} (f : i ⟶ j) r m, M.map f (r • m) = R.map f r • M.map f m)
set_option backward.isDefEq.respectTransparency false in
/-- (Implementation). The scalar multiplication function on `ColimitType`. -/
protected noncomputable
def colimit.smul (r : (R ⋙ forget _).ColimitType) (m : (M ⋙ forget _).ColimitType) :
(M ⋙ forget _).ColimitType := by
refine Quot.liftOn₂ r m (fun Ua Vb ↦ Functor.ιColimitType _ (max Ua.1 Vb.1) <|
letI a : R.obj (max Ua.1 Vb.1) := R.map (leftToMax Ua.1 Vb.1) Ua.2
letI b : M.obj (max Ua.1 Vb.1) := M.map (rightToMax Ua.1 Vb.1) Vb.2
a • b) ?_ ?_
· rintro ⟨U, a⟩ ⟨V₁, b₁⟩ ⟨V₂, b₂⟩ ⟨f : V₁ ⟶ V₂, rfl : b₂ = M.map _ b₁⟩
obtain ⟨s, α, β, h₁, h₂⟩ :=
bowtie (leftToMax U V₁) (leftToMax U V₂)
(rightToMax U V₁) (f ≫ rightToMax U V₂)
refine Functor.ιColimitType_eq_of_map_eq_map _ _ _ α β ?_
simp [*, ← R.map_comp_apply, ← M.map_comp_apply, -Functor.map_comp]
· rintro ⟨U₁, a₁⟩ ⟨U₂, a₂⟩ ⟨V, b⟩ ⟨f : U₁ ⟶ U₂, rfl : a₂ = R.map _ a₁⟩
obtain ⟨s, α, β, h₁, h₂⟩ :=
bowtie (leftToMax U₁ V) (f ≫ leftToMax U₂ V)
(rightToMax U₁ V) (rightToMax U₂ V)
refine Functor.ιColimitType_eq_of_map_eq_map _ _ _ α β ?_
simp [*, ← R.map_comp_apply, ← M.map_comp_apply, -Functor.map_comp]
#adaptation_note /-- As of nightly-2026-02-10, we need to increase the maxHeartbeats limits here. -/
set_option backward.isDefEq.respectTransparency false in
set_option maxHeartbeats 700000 in --
set_option synthInstance.maxHeartbeats 40000 in
/-- (Implementation). The module structure on `AddCommGrpCat.FilteredColimits.colimit`. -/
noncomputable abbrev filteredColimitsModule : Module (RingCat.FilteredColimits.colimit R)
(AddCommGrpCat.FilteredColimits.colimit M) where
smul := colimit.smul R M H
mul_smul r s m := Quot.induction_on₃ r s m <| by
rintro ⟨U₁, a₁⟩ ⟨U₂, a₂⟩ ⟨V, b⟩
obtain ⟨s, α, β, h₁, h₂, h₃⟩ := crown₃
(leftToMax U₁ U₂ ≫ leftToMax (max U₁ U₂) V) (leftToMax U₁ (max U₂ V))
(rightToMax U₁ U₂ ≫ leftToMax (max U₁ U₂) V) (leftToMax U₂ V ≫ rightToMax U₁ (max U₂ V))
(rightToMax (max U₁ U₂) V) (rightToMax U₂ V ≫ rightToMax U₁ (max U₂ V))
refine Functor.ιColimitType_eq_of_map_eq_map _ _ _ α β ?_
dsimp
simp only [map_mul, ← ConcreteCategory.comp_apply, ← Functor.map_comp, mul_smul, *]
one_smul m := Quot.induction_on m <| by
rintro ⟨V, b⟩
refine Functor.ιColimitType_eq_of_map_eq_map _ _ _ (𝟙 _) (rightToMax _ _) ?_
dsimp
simp only [map_one, ← ConcreteCategory.comp_apply, ← Functor.map_comp, one_smul,
Category.comp_id]
smul_zero r := Quot.induction_on r <| by
rintro ⟨U, a⟩
refine Functor.ιColimitType_eq_of_map_eq_map _ _ _ (𝟙 _) (rightToMax _ _) ?_
dsimp
simp only [map_zero, smul_zero]
smul_add r m n := Quot.induction_on₃ r m n <| by
rintro ⟨U, a⟩ ⟨V₁, b₁⟩ ⟨V₂, b₂⟩
obtain ⟨s, α, β, h₁, h₂, h₃, h₄⟩ := crown₄
(leftToMax U V₁ ≫ leftToMax (max U V₁) (max U V₂)) (leftToMax U (max V₁ V₂))
(leftToMax U V₂ ≫ rightToMax (max U V₁) (max U V₂)) (leftToMax U (max V₁ V₂))
(rightToMax U V₁ ≫ leftToMax (max U V₁) (max U V₂))
(leftToMax V₁ V₂ ≫ rightToMax U (max V₁ V₂))
(rightToMax U V₂ ≫ rightToMax (max U V₁) (max U V₂))
(rightToMax V₁ V₂ ≫ rightToMax U (max V₁ V₂))
refine Functor.ιColimitType_eq_of_map_eq_map _ _ _ β α ?_
dsimp
simp only [*, ← ConcreteCategory.comp_apply, ← Functor.map_comp, map_add, smul_add]
add_smul r s m := Quot.induction_on₃ r s m <| by
rintro ⟨U₁, a₁⟩ ⟨U₂, a₂⟩ ⟨V, b⟩
obtain ⟨s, α, β, h₁, h₂, h₃, h₄⟩ := crown₄
(rightToMax U₁ V ≫ leftToMax (max U₁ V) (max U₂ V)) (rightToMax (max U₁ U₂) V)
(rightToMax U₂ V ≫ rightToMax (max U₁ V) (max U₂ V)) (rightToMax (max U₁ U₂) V)
(leftToMax U₁ V ≫ leftToMax (max U₁ V) (max U₂ V))
(leftToMax U₁ U₂ ≫ leftToMax (max U₁ U₂) V)
(leftToMax U₂ V ≫ rightToMax (max U₁ V) (max U₂ V))
(rightToMax U₁ U₂ ≫ leftToMax (max U₁ U₂) V)
refine Functor.ιColimitType_eq_of_map_eq_map _ _ _ β α ?_
dsimp
simp only [add_smul, map_add, ← ConcreteCategory.comp_apply, ← Functor.map_comp, *]
zero_smul m := Quot.induction_on m <| by
rintro ⟨V, b⟩
refine Functor.ιColimitType_eq_of_map_eq_map _ _ _ (𝟙 _) (leftToMax _ _) ?_
dsimp
simp only [map_zero, zero_smul, *]
/-- Given a cofiltered diagram of rings `R`, and a module `M` over `R`,
this is the `colim R`-module structure of `colim M`. -/
noncomputable abbrev IsColimit.module {cR : Cocone R} (hcR : IsColimit cR) {cM : Cocone M}
(hcM : IsColimit cM) : Module cR.pt cM.pt :=
letI := filteredColimitsModule R M H
letI : Module (RingCat.FilteredColimits.colimit R) cM.pt :=
AddEquiv.module (β := AddCommGrpCat.FilteredColimits.colimit M) _
(IsColimit.coconePointUniqueUpToIso hcM
(AddCommGrpCat.FilteredColimits.colimitCoconeIsColimit M)).addCommGroupIsoToAddEquiv
.compHom (R := RingCat.FilteredColimits.colimit R) _
(IsColimit.coconePointUniqueUpToIso hcR
(RingCat.FilteredColimits.colimitCoconeIsColimit R)).ringCatIsoToRingEquiv.toRingHom
set_option backward.isDefEq.respectTransparency false in
lemma IsColimit.ι_smul {cR : Cocone R} (hcR : IsColimit cR) {cM : Cocone M}
(hcM : IsColimit cM) (i : C) (r : R.obj i) (m : M.obj i) :
letI := IsColimit.module R M H hcR hcM
cM.ι.app i (r • m) =
HSMul.hSMul (α := cR.pt) (β := cM.pt) (cR.ι.app i r) (cM.ι.app i m) := by
letI := filteredColimitsModule R M H
let α := IsColimit.coconePointUniqueUpToIso hcM
(AddCommGrpCat.FilteredColimits.colimitCoconeIsColimit M)
let β := IsColimit.coconePointUniqueUpToIso hcR
(RingCat.FilteredColimits.colimitCoconeIsColimit R)
apply α.addCommGroupIsoToAddEquiv.eq_symm_apply.mpr ?_
change (cM.ι.app i ≫ α.hom) _ = (HSMul.hSMul (α := RingCat.FilteredColimits.colimit R)
(β := AddCommGrpCat.FilteredColimits.colimit M)
((cR.ι.app i ≫ β.hom) r) ((cM.ι.app i ≫ α.hom) m))
simp only [Functor.const_obj_obj, comp_coconePointUniqueUpToIso_hom, α, β]
obtain ⟨s, α, H⟩ := IsFilteredOrEmpty.cocone_maps (leftToMax i i) (rightToMax i i)
refine Functor.ιColimitType_eq_of_map_eq_map _ _ _ (leftToMax _ _ ≫ α) α ?_
dsimp
simp only [← ConcreteCategory.comp_apply, ← Functor.map_comp, *]
end CategoryTheory.Limits
namespace PresheafOfModules
variable {X : TopCat.{u}} {R : X.Presheaf RingCat.{u}} (M : PresheafOfModules.{u} R)
variable (x : X)
set_option backward.isDefEq.respectTransparency false in
noncomputable
instance : Module (R.stalk x) ↑(TopCat.Presheaf.stalk M.presheaf x) :=
letI (i : (OpenNhds x)ᵒᵖ) : Module (((OpenNhds.inclusion x).op ⋙ R).obj i)
(((OpenNhds.inclusion x).op ⋙ M.presheaf).obj i) := by
dsimp; infer_instance
Limits.IsColimit.module ((OpenNhds.inclusion x).op ⋙ R) ((OpenNhds.inclusion x).op ⋙ M.presheaf)
(fun f r m ↦ M.map_smul _ _ _) (Limits.colimit.isColimit _) (Limits.colimit.isColimit _)
set_option backward.isDefEq.respectTransparency false in
lemma germ_ringCat_smul (U : Opens X) (hx : x ∈ U) (r : R.obj (op U)) (m : M.obj (op U)) :
TopCat.Presheaf.germ M.presheaf U x hx (r • m) =
R.germ U x hx r • TopCat.Presheaf.germ M.presheaf U x hx m :=
letI (i : (OpenNhds x)ᵒᵖ) : Module (((OpenNhds.inclusion x).op ⋙ R).obj i)
(((OpenNhds.inclusion x).op ⋙ M.presheaf).obj i) := by
dsimp; infer_instance
Limits.IsColimit.ι_smul ((OpenNhds.inclusion x).op ⋙ R) ((OpenNhds.inclusion x).op ⋙ M.presheaf)
(fun f r m ↦ M.map_smul _ _ _)
(Limits.colimit.isColimit _) (Limits.colimit.isColimit _) ⟨_, _⟩ _ _
section CommRingCat
variable {X : TopCat.{u}} {R : X.Presheaf CommRingCat.{u}}
(M : PresheafOfModules.{u} (R ⋙ forget₂ _ _))
set_option backward.isDefEq.respectTransparency false in
noncomputable
instance (x : X) : Module (R.stalk x) ↑(TopCat.Presheaf.stalk M.presheaf x) :=
letI (i : (OpenNhds x)ᵒᵖ) : Module (((OpenNhds.inclusion x).op ⋙ R ⋙ forget₂ _ RingCat).obj i)
(((OpenNhds.inclusion x).op ⋙ M.presheaf).obj i) := by
dsimp; infer_instance
Limits.IsColimit.module ((OpenNhds.inclusion x).op ⋙ R ⋙ forget₂ _ _)
((OpenNhds.inclusion x).op ⋙ M.presheaf)
(fun f r m ↦ M.map_smul _ _ _) (Limits.isColimitOfPreserves (forget₂ _ _)
(Limits.colimit.isColimit ((OpenNhds.inclusion x).op ⋙ R))) (Limits.colimit.isColimit _)
set_option backward.isDefEq.respectTransparency false in
lemma germ_smul (x : X) (U : Opens X) (hx : x ∈ U) (r : R.obj (op U)) (m : M.obj (op U)) :
TopCat.Presheaf.germ M.presheaf U x hx (r • m) =
R.germ U x hx r • TopCat.Presheaf.germ M.presheaf U x hx m :=
letI (i : (OpenNhds x)ᵒᵖ) : Module (((OpenNhds.inclusion x).op ⋙ R ⋙ forget₂ _ RingCat).obj i)
(((OpenNhds.inclusion x).op ⋙ M.presheaf).obj i) := by
dsimp; infer_instance
Limits.IsColimit.ι_smul ((OpenNhds.inclusion x).op ⋙ R ⋙ forget₂ _ _)
((OpenNhds.inclusion x).op ⋙ M.presheaf)
(fun f r m ↦ M.map_smul _ _ _) (Limits.isColimitOfPreserves (forget₂ _ _)
(Limits.colimit.isColimit ((OpenNhds.inclusion x).op ⋙ R))) (Limits.colimit.isColimit _)
⟨_, _⟩ _ _
end CommRingCat
end PresheafOfModules