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