state
stringlengths
0
159k
srcUpToTactic
stringlengths
387
167k
nextTactic
stringlengths
3
9k
declUpToTactic
stringlengths
22
11.5k
declId
stringlengths
38
95
decl
stringlengths
16
1.89k
file_tag
stringlengths
17
73
case convert_2.naturality C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y hf : OpenEmbedding ⇑f F : Presheaf C X x : ↑X this : Functor.Initial (IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x) ⊢ autoParam (∀ {X_1 Y_1 : (OpenNhds x)ᵒᵖ} (f_1 : X_1 ⟶ Y_1), ((IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).op ⋙ (OpenNhds.inclusion (f x)).op ⋙ f _* F).map f_1 ≫ (F.mapIso (eqToIso (_ : (Opens.map f).op.obj ((OpenNhds.inclusion (f x)).op.obj ((IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).op.obj Y_1)) = (OpenNhds.inclusion x).op.obj Y_1))).hom = (F.mapIso (eqToIso (_ : (Opens.map f).op.obj ((OpenNhds.inclusion (f x)).op.obj ((IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).op.obj X_1)) = (OpenNhds.inclusion x).op.obj X_1))).hom ≫ (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F).map f_1) _auto✝
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) ·
intro U V i
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) ·
Mathlib.Topology.Sheaves.Stalks.202_0.hsVUPKIHRY0xmFk
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x)
Mathlib_Topology_Sheaves_Stalks
case convert_2.naturality C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y hf : OpenEmbedding ⇑f F : Presheaf C X x : ↑X this : Functor.Initial (IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x) U V : (OpenNhds x)ᵒᵖ i : U ⟶ V ⊢ ((IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).op ⋙ (OpenNhds.inclusion (f x)).op ⋙ f _* F).map i ≫ (F.mapIso (eqToIso (_ : (Opens.map f).op.obj ((OpenNhds.inclusion (f x)).op.obj ((IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).op.obj V)) = (OpenNhds.inclusion x).op.obj V))).hom = (F.mapIso (eqToIso (_ : (Opens.map f).op.obj ((OpenNhds.inclusion (f x)).op.obj ((IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).op.obj U)) = (OpenNhds.inclusion x).op.obj U))).hom ≫ (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F).map i
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i;
erw [← F.map_comp, ← F.map_comp]
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i;
Mathlib.Topology.Sheaves.Stalks.202_0.hsVUPKIHRY0xmFk
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x)
Mathlib_Topology_Sheaves_Stalks
case convert_2.naturality C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y hf : OpenEmbedding ⇑f F : Presheaf C X x : ↑X this : Functor.Initial (IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x) U V : (OpenNhds x)ᵒᵖ i : U ⟶ V ⊢ F.map ((Opens.map f).op.map ((OpenNhds.inclusion (f x)).op.map ((IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).op.map i)) ≫ (eqToIso (_ : (Opens.map f).op.obj ((OpenNhds.inclusion (f x)).op.obj ((IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).op.obj V)) = (OpenNhds.inclusion x).op.obj V)).hom) = F.map ((eqToIso (_ : (Opens.map f).op.obj ((OpenNhds.inclusion (f x)).op.obj ((IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).op.obj U)) = (OpenNhds.inclusion x).op.obj U)).hom ≫ (OpenNhds.inclusion x).op.map i)
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp];
congr 1
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp];
Mathlib.Topology.Sheaves.Stalks.202_0.hsVUPKIHRY0xmFk
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x)
Mathlib_Topology_Sheaves_Stalks
case h.e'_5.h C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y hf : OpenEmbedding ⇑f F : Presheaf C X x : ↑X this : Functor.Initial (IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x) e_3✝ : stalk (f _* F) (f x) = colimit ((OpenNhds.inclusion (f x)).op ⋙ f _* F) e_4✝ : stalk F x = colim.obj (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F) ⊢ stalkPushforward C f F x = ((Functor.Final.colimitIso (IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F)).symm ≪≫ colim.mapIso (NatIso.ofComponents fun U => F.mapIso (eqToIso (_ : (Opens.map f).op.obj ((OpenNhds.inclusion (f x)).op.obj ((IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).op.obj U)) = (OpenNhds.inclusion x).op.obj U)))).hom
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 ·
change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _)
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 ·
Mathlib.Topology.Sheaves.Stalks.202_0.hsVUPKIHRY0xmFk
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x)
Mathlib_Topology_Sheaves_Stalks
case h.e'_5.h C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y hf : OpenEmbedding ⇑f F : Presheaf C X x : ↑X this : Functor.Initial (IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x) e_3✝ : stalk (f _* F) (f x) = colimit ((OpenNhds.inclusion (f x)).op ⋙ f _* F) e_4✝ : stalk F x = colim.obj (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F) ⊢ stalkPushforward C f F x = ((Functor.Final.colimitIso (IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F)).symm ≪≫ colim.mapIso (NatIso.ofComponents fun U => F.mapIso (eqToIso (_ : (Opens.map f).op.obj ((OpenNhds.inclusion (f x)).op.obj ((IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).op.obj U)) = (OpenNhds.inclusion x).op.obj U)))).hom
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _)
ext U
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _)
Mathlib.Topology.Sheaves.Stalks.202_0.hsVUPKIHRY0xmFk
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x)
Mathlib_Topology_Sheaves_Stalks
case h.e'_5.h.w C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y hf : OpenEmbedding ⇑f F : Presheaf C X x : ↑X this : Functor.Initial (IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x) e_3✝ : stalk (f _* F) (f x) = colimit ((OpenNhds.inclusion (f x)).op ⋙ f _* F) e_4✝ : stalk F x = colim.obj (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F) U : (OpenNhds (f x))ᵒᵖ ⊢ colimit.ι (((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op).obj (f _* F)) U ≫ stalkPushforward C f F x = colimit.ι (((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op).obj (f _* F)) U ≫ ((Functor.Final.colimitIso (IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F)).symm ≪≫ colim.mapIso (NatIso.ofComponents fun U => F.mapIso (eqToIso (_ : (Opens.map f).op.obj ((OpenNhds.inclusion (f x)).op.obj ((IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).op.obj U)) = (OpenNhds.inclusion x).op.obj U)))).hom
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U
rw [← Iso.comp_inv_eq]
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U
Mathlib.Topology.Sheaves.Stalks.202_0.hsVUPKIHRY0xmFk
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x)
Mathlib_Topology_Sheaves_Stalks
case h.e'_5.h.w C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y hf : OpenEmbedding ⇑f F : Presheaf C X x : ↑X this : Functor.Initial (IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x) e_3✝ : stalk (f _* F) (f x) = colimit ((OpenNhds.inclusion (f x)).op ⋙ f _* F) e_4✝ : stalk F x = colim.obj (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F) U : (OpenNhds (f x))ᵒᵖ ⊢ (colimit.ι (((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op).obj (f _* F)) U ≫ stalkPushforward C f F x) ≫ ((Functor.Final.colimitIso (IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F)).symm ≪≫ colim.mapIso (NatIso.ofComponents fun U => F.mapIso (eqToIso (_ : (Opens.map f).op.obj ((OpenNhds.inclusion (f x)).op.obj ((IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).op.obj U)) = (OpenNhds.inclusion x).op.obj U)))).inv = colimit.ι (((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op).obj (f _* F)) U
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq]
erw [colimit.ι_map_assoc]
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq]
Mathlib.Topology.Sheaves.Stalks.202_0.hsVUPKIHRY0xmFk
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x)
Mathlib_Topology_Sheaves_Stalks
case h.e'_5.h.w C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y hf : OpenEmbedding ⇑f F : Presheaf C X x : ↑X this : Functor.Initial (IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x) e_3✝ : stalk (f _* F) (f x) = colimit ((OpenNhds.inclusion (f x)).op ⋙ f _* F) e_4✝ : stalk F x = colim.obj (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F) U : (OpenNhds (f x))ᵒᵖ ⊢ ((whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F).app U ≫ colimit.ι ((OpenNhds.map f x).op ⋙ ((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F) U ≫ colimit.pre (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F) (OpenNhds.map f x).op) ≫ ((Functor.Final.colimitIso (IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F)).symm ≪≫ colim.mapIso (NatIso.ofComponents fun U => F.mapIso (eqToIso (_ : (Opens.map f).op.obj ((OpenNhds.inclusion (f x)).op.obj ((IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).op.obj U)) = (OpenNhds.inclusion x).op.obj U)))).inv = colimit.ι (((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op).obj (f _* F)) U
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc]
rw [colimit.ι_pre, Category.assoc]
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc]
Mathlib.Topology.Sheaves.Stalks.202_0.hsVUPKIHRY0xmFk
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x)
Mathlib_Topology_Sheaves_Stalks
case h.e'_5.h.w C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y hf : OpenEmbedding ⇑f F : Presheaf C X x : ↑X this : Functor.Initial (IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x) e_3✝ : stalk (f _* F) (f x) = colimit ((OpenNhds.inclusion (f x)).op ⋙ f _* F) e_4✝ : stalk F x = colim.obj (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F) U : (OpenNhds (f x))ᵒᵖ ⊢ (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F).app U ≫ colimit.ι (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F) ((OpenNhds.map f x).op.obj U) ≫ ((Functor.Final.colimitIso (IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F)).symm ≪≫ colim.mapIso (NatIso.ofComponents fun U => F.mapIso (eqToIso (_ : (Opens.map f).op.obj ((OpenNhds.inclusion (f x)).op.obj ((IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).op.obj U)) = (OpenNhds.inclusion x).op.obj U)))).inv = colimit.ι (((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op).obj (f _* F)) U
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc]
erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc]
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc]
Mathlib.Topology.Sheaves.Stalks.202_0.hsVUPKIHRY0xmFk
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x)
Mathlib_Topology_Sheaves_Stalks
case h.e'_5.h.w C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y hf : OpenEmbedding ⇑f F : Presheaf C X x : ↑X this : Functor.Initial (IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x) e_3✝ : stalk (f _* F) (f x) = colimit ((OpenNhds.inclusion (f x)).op ⋙ f _* F) e_4✝ : stalk F x = colim.obj (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F) U : (OpenNhds (f x))ᵒᵖ ⊢ F.map ((NatTrans.op (OpenNhds.inclusionMapIso f x).inv).app U ≫ (eqToIso (_ : (Opens.map f).op.obj ((OpenNhds.inclusion (f x)).op.obj ((IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).op.obj ((OpenNhds.map f x).op.obj U))) = (OpenNhds.inclusion x).op.obj ((OpenNhds.map f x).op.obj U))).inv) ≫ colimit.ι ((OpenNhds.inclusion (f x)).op ⋙ f _* F) ((IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).op.obj ((OpenNhds.map f x).op.obj U)) = colimit.ι (((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op).obj (f _* F)) U
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc]
apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc]
Mathlib.Topology.Sheaves.Stalks.202_0.hsVUPKIHRY0xmFk
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x)
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y hf : OpenEmbedding ⇑f F : Presheaf C X x : ↑X this : Functor.Initial (IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x) e_3✝ : stalk (f _* F) (f x) = colimit ((OpenNhds.inclusion (f x)).op ⋙ f _* F) e_4✝ : stalk F x = colim.obj (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F) U : (OpenNhds (f x))ᵒᵖ ⊢ U ⟶ (IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).op.obj ((OpenNhds.map f x).op.obj U)
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _
dsimp only [Functor.op]
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _
Mathlib.Topology.Sheaves.Stalks.202_0.hsVUPKIHRY0xmFk
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x)
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y hf : OpenEmbedding ⇑f F : Presheaf C X x : ↑X this : Functor.Initial (IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x) e_3✝ : stalk (f _* F) (f x) = colimit ((OpenNhds.inclusion (f x)).op ⋙ f _* F) e_4✝ : stalk F x = colim.obj (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F) U : (OpenNhds (f x))ᵒᵖ ⊢ U ⟶ op ((IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).obj (op ((OpenNhds.map f x).obj U.unop)).unop)
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op]
refine' ((homOfLE _).op : op (unop U) ⟶ _)
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op]
Mathlib.Topology.Sheaves.Stalks.202_0.hsVUPKIHRY0xmFk
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x)
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y hf : OpenEmbedding ⇑f F : Presheaf C X x : ↑X this : Functor.Initial (IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x) e_3✝ : stalk (f _* F) (f x) = colimit ((OpenNhds.inclusion (f x)).op ⋙ f _* F) e_4✝ : stalk F x = colim.obj (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F) U : (OpenNhds (f x))ᵒᵖ ⊢ (IsOpenMap.functorNhds (_ : IsOpenMap ⇑f) x).obj (op ((OpenNhds.map f x).obj U.unop)).unop ≤ U.unop
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _)
exact Set.image_preimage_subset _ _
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _)
Mathlib.Topology.Sheaves.Stalks.202_0.hsVUPKIHRY0xmFk
theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x)
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C Y U : Opens ↑X x : ↥U x✝¹ x✝ : CostructuredArrow (Opens.map f).op (op U) i : x✝¹ ⟶ x✝ ⊢ (Lan.diagram (Opens.map f).op F (op U)).map i ≫ (fun V => germ F { val := f ↑x, property := (_ : ↑x ∈ ↑((Opens.map f).op.obj V.left).unop) }) x✝ = (fun V => germ F { val := f ↑x, property := (_ : ↑x ∈ ↑((Opens.map f).op.obj V.left).unop) }) x✝¹ ≫ ((Functor.const (CostructuredArrow (Opens.map f).op (op U))).obj (stalk F (f ↑x))).map i
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by
erw [Category.comp_id]
/-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by
Mathlib.Topology.Sheaves.Stalks.242_0.hsVUPKIHRY0xmFk
/-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X))
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C Y U : Opens ↑X x : ↥U x✝¹ x✝ : CostructuredArrow (Opens.map f).op (op U) i : x✝¹ ⟶ x✝ ⊢ (Lan.diagram (Opens.map f).op F (op U)).map i ≫ (fun V => germ F { val := f ↑x, property := (_ : ↑x ∈ ↑((Opens.map f).op.obj V.left).unop) }) x✝ = (fun V => germ F { val := f ↑x, property := (_ : ↑x ∈ ↑((Opens.map f).op.obj V.left).unop) }) x✝¹
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id];
exact F.germ_res i.left.unop _
/-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id];
Mathlib.Topology.Sheaves.Stalks.242_0.hsVUPKIHRY0xmFk
/-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X))
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C Y x : ↑X x✝² x✝¹ : (OpenNhds x)ᵒᵖ x✝ : x✝² ⟶ x✝¹ ⊢ ((OpenNhds.inclusion x).op ⋙ pullbackObj f F).map x✝ ≫ (fun U => germToPullbackStalk C f F U.unop.obj { val := x, property := (_ : x ∈ U.unop.obj) }) x✝¹ = (fun U => germToPullbackStalk C f F U.unop.obj { val := x, property := (_ : x ∈ U.unop.obj) }) x✝² ≫ ((Functor.const (OpenNhds x)ᵒᵖ).obj (stalk F (f x))).map x✝
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by
erw [colimit.pre_desc, Category.comp_id]
/-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by
Mathlib.Topology.Sheaves.Stalks.253_0.hsVUPKIHRY0xmFk
/-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x)
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C Y x : ↑X x✝² x✝¹ : (OpenNhds x)ᵒᵖ x✝ : x✝² ⟶ x✝¹ ⊢ colimit.desc (CostructuredArrow.map ((OpenNhds.inclusion x).op.map x✝) ⋙ Lan.diagram (Opens.map f).op F ((OpenNhds.inclusion x).op.obj x✝¹)) (Cocone.whisker (CostructuredArrow.map ((OpenNhds.inclusion x).op.map x✝)) { pt := stalk F (f ↑{ val := x, property := (_ : x ∈ x✝¹.unop.obj) }), ι := NatTrans.mk fun V => germ F { val := f ↑{ val := x, property := (_ : x ∈ x✝¹.unop.obj) }, property := (_ : ↑{ val := x, property := (_ : x ∈ x✝¹.unop.obj) } ∈ ↑((Opens.map f).op.obj V.left).unop) } }) = (fun U => germToPullbackStalk C f F U.unop.obj { val := x, property := (_ : x ∈ U.unop.obj) }) x✝²
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id];
congr
/-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id];
Mathlib.Topology.Sheaves.Stalks.253_0.hsVUPKIHRY0xmFk
/-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x)
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C Y x : ↑X ⊢ stalkPullbackHom C f F x ≫ stalkPullbackInv C f F x = 𝟙 (stalk F (f x))
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by
delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by
Mathlib.Topology.Sheaves.Stalks.264_0.hsVUPKIHRY0xmFk
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C Y x : ↑X ⊢ (((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op ⋙ colim).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ((lan (Opens.map f).op).obj F)) ≫ colimit.pre (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj ((lan (Opens.map f).op).obj F)) (OpenNhds.map f x).op) ≫ colimit.desc ((OpenNhds.inclusion x).op ⋙ pullbackObj f F) { pt := stalk F (f x), ι := NatTrans.mk fun U => colimit.desc (Lan.diagram (Opens.map f).op F (op U.unop.obj)) { pt := stalk F (f ↑{ val := x, property := (_ : x ∈ U.unop.obj) }), ι := NatTrans.mk fun V => colimit.ι ((OpenNhds.inclusion ↑{ val := f ↑{ val := x, property := (_ : x ∈ U.unop.obj) }, property := (_ : ↑{ val := x, property := (_ : x ∈ U.unop.obj) } ∈ ↑((Opens.map f).op.obj V.left).unop) }).op ⋙ F) (op { obj := V.left.unop, property := (_ : ↑{ val := f ↑{ val := x, property := (_ : x ∈ U.unop.obj) }, property := (_ : ↑{ val := x, property := (_ : x ∈ U.unop.obj) } ∈ ↑((Opens.map f).op.obj V.left).unop) } ∈ V.left.unop) }) } } = 𝟙 (stalk F (f x))
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ
change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _)
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ
Mathlib.Topology.Sheaves.Stalks.264_0.hsVUPKIHRY0xmFk
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C Y x : ↑X ⊢ (((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op ⋙ colim).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ((lan (Opens.map f).op).obj F)) ≫ colimit.pre (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj ((lan (Opens.map f).op).obj F)) (OpenNhds.map f x).op) ≫ colimit.desc ((OpenNhds.inclusion x).op ⋙ pullbackObj f F) { pt := stalk F (f x), ι := NatTrans.mk fun U => colimit.desc (Lan.diagram (Opens.map f).op F (op U.unop.obj)) { pt := stalk F (f ↑{ val := x, property := (_ : x ∈ U.unop.obj) }), ι := NatTrans.mk fun V => colimit.ι ((OpenNhds.inclusion ↑{ val := f ↑{ val := x, property := (_ : x ∈ U.unop.obj) }, property := (_ : ↑{ val := x, property := (_ : x ∈ U.unop.obj) } ∈ ↑((Opens.map f).op.obj V.left).unop) }).op ⋙ F) (op { obj := V.left.unop, property := (_ : ↑{ val := f ↑{ val := x, property := (_ : x ∈ U.unop.obj) }, property := (_ : ↑{ val := x, property := (_ : x ∈ U.unop.obj) } ∈ ↑((Opens.map f).op.obj V.left).unop) } ∈ V.left.unop) }) } } = 𝟙 (stalk F (f x))
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _)
ext j
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _)
Mathlib.Topology.Sheaves.Stalks.264_0.hsVUPKIHRY0xmFk
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom
Mathlib_Topology_Sheaves_Stalks
case w C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C Y x : ↑X j : (OpenNhds (f x))ᵒᵖ ⊢ colimit.ι (((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op).obj F) j ≫ (((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op ⋙ colim).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ((lan (Opens.map f).op).obj F)) ≫ colimit.pre (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj ((lan (Opens.map f).op).obj F)) (OpenNhds.map f x).op) ≫ colimit.desc ((OpenNhds.inclusion x).op ⋙ pullbackObj f F) { pt := stalk F (f x), ι := NatTrans.mk fun U => colimit.desc (Lan.diagram (Opens.map f).op F (op U.unop.obj)) { pt := stalk F (f ↑{ val := x, property := (_ : x ∈ U.unop.obj) }), ι := NatTrans.mk fun V => colimit.ι ((OpenNhds.inclusion ↑{ val := f ↑{ val := x, property := (_ : x ∈ U.unop.obj) }, property := (_ : ↑{ val := x, property := (_ : x ∈ U.unop.obj) } ∈ ↑((Opens.map f).op.obj V.left).unop) }).op ⋙ F) (op { obj := V.left.unop, property := (_ : ↑{ val := f ↑{ val := x, property := (_ : x ∈ U.unop.obj) }, property := (_ : ↑{ val := x, property := (_ : x ∈ U.unop.obj) } ∈ ↑((Opens.map f).op.obj V.left).unop) } ∈ V.left.unop) }) } } = colimit.ι (((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op).obj F) j ≫ 𝟙 (stalk F (f x))
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j
induction' j with j
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j
Mathlib.Topology.Sheaves.Stalks.264_0.hsVUPKIHRY0xmFk
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom
Mathlib_Topology_Sheaves_Stalks
case w.h C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C Y x : ↑X j : OpenNhds (f x) ⊢ colimit.ι (((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op).obj F) (op j) ≫ (((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op ⋙ colim).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ((lan (Opens.map f).op).obj F)) ≫ colimit.pre (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj ((lan (Opens.map f).op).obj F)) (OpenNhds.map f x).op) ≫ colimit.desc ((OpenNhds.inclusion x).op ⋙ pullbackObj f F) { pt := stalk F (f x), ι := NatTrans.mk fun U => colimit.desc (Lan.diagram (Opens.map f).op F (op U.unop.obj)) { pt := stalk F (f ↑{ val := x, property := (_ : x ∈ U.unop.obj) }), ι := NatTrans.mk fun V => colimit.ι ((OpenNhds.inclusion ↑{ val := f ↑{ val := x, property := (_ : x ∈ U.unop.obj) }, property := (_ : ↑{ val := x, property := (_ : x ∈ U.unop.obj) } ∈ ↑((Opens.map f).op.obj V.left).unop) }).op ⋙ F) (op { obj := V.left.unop, property := (_ : ↑{ val := f ↑{ val := x, property := (_ : x ∈ U.unop.obj) }, property := (_ : ↑{ val := x, property := (_ : x ∈ U.unop.obj) } ∈ ↑((Opens.map f).op.obj V.left).unop) } ∈ V.left.unop) }) } } = colimit.ι (((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op).obj F) (op j) ≫ 𝟙 (stalk F (f x))
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j
cases j
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j
Mathlib.Topology.Sheaves.Stalks.264_0.hsVUPKIHRY0xmFk
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom
Mathlib_Topology_Sheaves_Stalks
case w.h.mk C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C Y x : ↑X obj✝ : Opens ↑Y property✝ : f x ∈ obj✝ ⊢ colimit.ι (((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op).obj F) (op { obj := obj✝, property := property✝ }) ≫ (((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op ⋙ colim).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ((lan (Opens.map f).op).obj F)) ≫ colimit.pre (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj ((lan (Opens.map f).op).obj F)) (OpenNhds.map f x).op) ≫ colimit.desc ((OpenNhds.inclusion x).op ⋙ pullbackObj f F) { pt := stalk F (f x), ι := NatTrans.mk fun U => colimit.desc (Lan.diagram (Opens.map f).op F (op U.unop.obj)) { pt := stalk F (f ↑{ val := x, property := (_ : x ∈ U.unop.obj) }), ι := NatTrans.mk fun V => colimit.ι ((OpenNhds.inclusion ↑{ val := f ↑{ val := x, property := (_ : x ∈ U.unop.obj) }, property := (_ : ↑{ val := x, property := (_ : x ∈ U.unop.obj) } ∈ ↑((Opens.map f).op.obj V.left).unop) }).op ⋙ F) (op { obj := V.left.unop, property := (_ : ↑{ val := f ↑{ val := x, property := (_ : x ∈ U.unop.obj) }, property := (_ : ↑{ val := x, property := (_ : x ∈ U.unop.obj) } ∈ ↑((Opens.map f).op.obj V.left).unop) } ∈ V.left.unop) }) } } = colimit.ι (((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op).obj F) (op { obj := obj✝, property := property✝ }) ≫ 𝟙 (stalk F (f x))
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j
simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc]
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j
Mathlib.Topology.Sheaves.Stalks.264_0.hsVUPKIHRY0xmFk
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom
Mathlib_Topology_Sheaves_Stalks
case w.h.mk C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C Y x : ↑X obj✝ : Opens ↑Y property✝ : f x ∈ obj✝ ⊢ colimit.ι (Lan.diagram (Opens.map f).op F (op ((Opens.map f).obj ((OpenNhds.inclusion (f x)).op.obj (op { obj := obj✝, property := property✝ })).unop))) (CostructuredArrow.mk (𝟙 (op ((Opens.map f).obj ((OpenNhds.inclusion (f x)).op.obj (op { obj := obj✝, property := property✝ })).unop)))) ≫ colimit.pre (Lan.diagram (Opens.map f).op F ((OpenNhds.map f x ⋙ OpenNhds.inclusion x).op.obj (op { obj := obj✝, property := property✝ }))) (CostructuredArrow.map ((𝟙 (OpenNhds.map f x ⋙ OpenNhds.inclusion x).op).app (op { obj := obj✝, property := property✝ }))) ≫ colimit.ι (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj ((lan (Opens.map f).op).obj F)) ((OpenNhds.map f x).op.obj (op { obj := obj✝, property := property✝ })) ≫ colimit.desc ((OpenNhds.inclusion x).op ⋙ pullbackObj f F) { pt := stalk F (f x), ι := NatTrans.mk fun U => colimit.desc (Lan.diagram (Opens.map f).op F (op U.unop.obj)) { pt := stalk F (f x), ι := NatTrans.mk fun V => colimit.ι ((OpenNhds.inclusion (f x)).op ⋙ F) (op { obj := V.left.unop, property := (_ : ↑{ val := f x, property := (_ : ↑{ val := x, property := (_ : x ∈ U.unop.obj) } ∈ ↑((Opens.map f).op.obj V.left).unop) } ∈ V.left.unop) }) } } = colimit.ι (((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op).obj F) (op { obj := obj✝, property := property✝ }) ≫ 𝟙 (stalk F (f x))
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc]
erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id]
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc]
Mathlib.Topology.Sheaves.Stalks.264_0.hsVUPKIHRY0xmFk
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom
Mathlib_Topology_Sheaves_Stalks
case w.h.mk C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C Y x : ↑X obj✝ : Opens ↑Y property✝ : f x ∈ obj✝ ⊢ (Cocone.whisker (CostructuredArrow.map ((𝟙 (OpenNhds.map f x ⋙ OpenNhds.inclusion x).op).app (op { obj := obj✝, property := property✝ }))) { pt := stalk F (f x), ι := NatTrans.mk fun V => colimit.ι ((OpenNhds.inclusion (f x)).op ⋙ F) (op { obj := V.left.unop, property := (_ : ↑{ val := f x, property := (_ : ↑{ val := x, property := (_ : x ∈ ((OpenNhds.map f x).op.obj (op { obj := obj✝, property := property✝ })).unop.obj) } ∈ ↑((Opens.map f).op.obj V.left).unop) } ∈ V.left.unop) }) }).ι.app (CostructuredArrow.mk (𝟙 (op ((Opens.map f).obj ((OpenNhds.inclusion (f x)).op.obj (op { obj := obj✝, property := property✝ })).unop)))) = colimit.ι (((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op).obj F) (op { obj := obj✝, property := property✝ })
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id]
simp
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id]
Mathlib.Topology.Sheaves.Stalks.264_0.hsVUPKIHRY0xmFk
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C Y x : ↑X ⊢ stalkPullbackInv C f F x ≫ stalkPullbackHom C f F x = 𝟙 (stalk (pullbackObj f F) x)
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by
delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by
Mathlib.Topology.Sheaves.Stalks.264_0.hsVUPKIHRY0xmFk
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C Y x : ↑X ⊢ colimit.desc ((OpenNhds.inclusion x).op ⋙ pullbackObj f F) { pt := stalk F (f x), ι := NatTrans.mk fun U => germToPullbackStalk C f F U.unop.obj { val := x, property := (_ : x ∈ U.unop.obj) } } ≫ ((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op ⋙ colim).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ((lan (Opens.map f).op).obj F)) ≫ colimit.pre (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj ((lan (Opens.map f).op).obj F)) (OpenNhds.map f x).op = 𝟙 (stalk (pullbackObj f F) x)
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward
change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _)
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward
Mathlib.Topology.Sheaves.Stalks.264_0.hsVUPKIHRY0xmFk
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C Y x : ↑X ⊢ colimit.desc ((OpenNhds.inclusion x).op ⋙ pullbackObj f F) { pt := stalk F (f x), ι := NatTrans.mk fun U => germToPullbackStalk C f F U.unop.obj { val := x, property := (_ : x ∈ U.unop.obj) } } ≫ ((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op ⋙ colim).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ((lan (Opens.map f).op).obj F)) ≫ colimit.pre (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj ((lan (Opens.map f).op).obj F)) (OpenNhds.map f x).op = 𝟙 (stalk (pullbackObj f F) x)
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _)
ext ⟨U_obj, U_property⟩
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _)
Mathlib.Topology.Sheaves.Stalks.264_0.hsVUPKIHRY0xmFk
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom
Mathlib_Topology_Sheaves_Stalks
case w.mk.mk C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C Y x : ↑X U_obj : Opens ↑X U_property : x ∈ U_obj ⊢ colimit.ι (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj (pullbackObj f F)) { unop := { obj := U_obj, property := U_property } } ≫ colimit.desc ((OpenNhds.inclusion x).op ⋙ pullbackObj f F) { pt := stalk F (f x), ι := NatTrans.mk fun U => germToPullbackStalk C f F U.unop.obj { val := x, property := (_ : x ∈ U.unop.obj) } } ≫ ((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op ⋙ colim).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ((lan (Opens.map f).op).obj F)) ≫ colimit.pre (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj ((lan (Opens.map f).op).obj F)) (OpenNhds.map f x).op = colimit.ι (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj (pullbackObj f F)) { unop := { obj := U_obj, property := U_property } } ≫ 𝟙 (stalk (pullbackObj f F) x)
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩
change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _)
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩
Mathlib.Topology.Sheaves.Stalks.264_0.hsVUPKIHRY0xmFk
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom
Mathlib_Topology_Sheaves_Stalks
case w.mk.mk C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C Y x : ↑X U_obj : Opens ↑X U_property : x ∈ U_obj ⊢ colimit.ι (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj (pullbackObj f F)) { unop := { obj := U_obj, property := U_property } } ≫ colimit.desc ((OpenNhds.inclusion x).op ⋙ pullbackObj f F) { pt := stalk F (f x), ι := NatTrans.mk fun U => germToPullbackStalk C f F U.unop.obj { val := x, property := (_ : x ∈ U.unop.obj) } } ≫ ((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op ⋙ colim).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ((lan (Opens.map f).op).obj F)) ≫ colimit.pre (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj ((lan (Opens.map f).op).obj F)) (OpenNhds.map f x).op = colimit.ι (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj (pullbackObj f F)) { unop := { obj := U_obj, property := U_property } } ≫ 𝟙 (stalk (pullbackObj f F) x)
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _)
ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _)
Mathlib.Topology.Sheaves.Stalks.264_0.hsVUPKIHRY0xmFk
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom
Mathlib_Topology_Sheaves_Stalks
case w.mk.mk.w.mk.mk.unit C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C Y x : ↑X U_obj : Opens ↑X U_property : x ∈ U_obj j_left : (Opens ↑Y)ᵒᵖ j_hom : (Opens.map f).op.obj j_left ⟶ (Functor.fromPUnit ((OpenNhds.inclusion x).op.obj { unop := { obj := U_obj, property := U_property } })).obj { as := PUnit.unit } ⊢ colimit.ι (Lan.diagram (Opens.map f).op F ((OpenNhds.inclusion x).op.obj { unop := { obj := U_obj, property := U_property } })) { left := j_left, right := { as := PUnit.unit }, hom := j_hom } ≫ colimit.ι (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj (pullbackObj f F)) { unop := { obj := U_obj, property := U_property } } ≫ colimit.desc ((OpenNhds.inclusion x).op ⋙ pullbackObj f F) { pt := stalk F (f x), ι := NatTrans.mk fun U => germToPullbackStalk C f F U.unop.obj { val := x, property := (_ : x ∈ U.unop.obj) } } ≫ ((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op ⋙ colim).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ((lan (Opens.map f).op).obj F)) ≫ colimit.pre (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj ((lan (Opens.map f).op).obj F)) (OpenNhds.map f x).op = colimit.ι (Lan.diagram (Opens.map f).op F ((OpenNhds.inclusion x).op.obj { unop := { obj := U_obj, property := U_property } })) { left := j_left, right := { as := PUnit.unit }, hom := j_hom } ≫ colimit.ι (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj (pullbackObj f F)) { unop := { obj := U_obj, property := U_property } } ≫ 𝟙 (stalk (pullbackObj f F) x)
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩
erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id]
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩
Mathlib.Topology.Sheaves.Stalks.264_0.hsVUPKIHRY0xmFk
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom
Mathlib_Topology_Sheaves_Stalks
case w.mk.mk.w.mk.mk.unit C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C Y x : ↑X U_obj : Opens ↑X U_property : x ∈ U_obj j_left : (Opens ↑Y)ᵒᵖ j_hom : (Opens.map f).op.obj j_left ⟶ (Functor.fromPUnit ((OpenNhds.inclusion x).op.obj { unop := { obj := U_obj, property := U_property } })).obj { as := PUnit.unit } ⊢ ((Cocones.precompose (((whiskeringLeft (OpenNhds (f x))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f x)).op).map ((pushforwardPullbackAdjunction C f).unit.app F))).obj ((Cocones.precompose (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ((lan (Opens.map f).op).obj F))).obj (Cocone.whisker (OpenNhds.map f x).op (colimit.cocone (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj ((lan (Opens.map f).op).obj F)))))).ι.app (op { obj := { left := j_left, right := { as := PUnit.unit }, hom := j_hom }.left.unop, property := (_ : ↑{ val := f ↑{ val := x, property := (_ : x ∈ { unop := { obj := U_obj, property := U_property } }.unop.obj) }, property := (_ : ↑{ val := x, property := (_ : x ∈ { unop := { obj := U_obj, property := U_property } }.unop.obj) } ∈ ↑((Opens.map f).op.obj { left := j_left, right := { as := PUnit.unit }, hom := j_hom }.left).unop) } ∈ { left := j_left, right := { as := PUnit.unit }, hom := j_hom }.left.unop) }) = colimit.ι (Lan.diagram (Opens.map f).op F ((OpenNhds.inclusion x).op.obj { unop := { obj := U_obj, property := U_property } })) { left := j_left, right := { as := PUnit.unit }, hom := j_hom } ≫ colimit.ι (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj (pullbackObj f F)) { unop := { obj := U_obj, property := U_property } }
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id]
simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app]
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id]
Mathlib.Topology.Sheaves.Stalks.264_0.hsVUPKIHRY0xmFk
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom
Mathlib_Topology_Sheaves_Stalks
case w.mk.mk.w.mk.mk.unit C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C Y x : ↑X U_obj : Opens ↑X U_property : x ∈ U_obj j_left : (Opens ↑Y)ᵒᵖ j_hom : (Opens.map f).op.obj j_left ⟶ (Functor.fromPUnit ((OpenNhds.inclusion x).op.obj { unop := { obj := U_obj, property := U_property } })).obj { as := PUnit.unit } ⊢ colimit.ι (Lan.diagram (Opens.map f).op F (op ((Opens.map f).obj ((OpenNhds.inclusion (f x)).op.obj (op { obj := j_left.unop, property := (_ : ↑{ val := f x, property := (_ : ↑{ val := x, property := (_ : x ∈ { unop := { obj := U_obj, property := U_property } }.unop.obj) } ∈ ↑((Opens.map f).op.obj { left := j_left, right := { as := PUnit.unit }, hom := j_hom }.left).unop) } ∈ j_left.unop) })).unop))) (CostructuredArrow.mk (𝟙 (op ((Opens.map f).obj ((OpenNhds.inclusion (f x)).op.obj (op { obj := j_left.unop, property := (_ : ↑{ val := f x, property := (_ : ↑{ val := x, property := (_ : x ∈ { unop := { obj := U_obj, property := U_property } }.unop.obj) } ∈ ↑((Opens.map f).op.obj { left := j_left, right := { as := PUnit.unit }, hom := j_hom }.left).unop) } ∈ j_left.unop) })).unop)))) ≫ colimit.pre (Lan.diagram (Opens.map f).op F ((OpenNhds.map f x ⋙ OpenNhds.inclusion x).op.obj (op { obj := j_left.unop, property := (_ : ↑{ val := f x, property := (_ : ↑{ val := x, property := (_ : x ∈ { unop := { obj := U_obj, property := U_property } }.unop.obj) } ∈ ↑((Opens.map f).op.obj { left := j_left, right := { as := PUnit.unit }, hom := j_hom }.left).unop) } ∈ j_left.unop) }))) (CostructuredArrow.map ((𝟙 (OpenNhds.map f x ⋙ OpenNhds.inclusion x).op).app (op { obj := j_left.unop, property := (_ : ↑{ val := f x, property := (_ : ↑{ val := x, property := (_ : x ∈ { unop := { obj := U_obj, property := U_property } }.unop.obj) } ∈ ↑((Opens.map f).op.obj { left := j_left, right := { as := PUnit.unit }, hom := j_hom }.left).unop) } ∈ j_left.unop) }))) ≫ colimit.ι (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj ((lan (Opens.map f).op).obj F)) ((OpenNhds.map f x).op.obj (op { obj := j_left.unop, property := (_ : ↑{ val := f x, property := (_ : ↑{ val := x, property := (_ : x ∈ { unop := { obj := U_obj, property := U_property } }.unop.obj) } ∈ ↑((Opens.map f).op.obj { left := j_left, right := { as := PUnit.unit }, hom := j_hom }.left).unop) } ∈ j_left.unop) })) = colimit.ι (Lan.diagram (Opens.map f).op F ((OpenNhds.inclusion x).op.obj { unop := { obj := U_obj, property := U_property } })) { left := j_left, right := { as := PUnit.unit }, hom := j_hom } ≫ colimit.ι (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj (pullbackObj f F)) { unop := { obj := U_obj, property := U_property } }
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app]
erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op]
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app]
Mathlib.Topology.Sheaves.Stalks.264_0.hsVUPKIHRY0xmFk
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom
Mathlib_Topology_Sheaves_Stalks
case w.mk.mk.w.mk.mk.unit C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C Y x : ↑X U_obj : Opens ↑X U_property : x ∈ U_obj j_left : (Opens ↑Y)ᵒᵖ j_hom : (Opens.map f).op.obj j_left ⟶ (Functor.fromPUnit ((OpenNhds.inclusion x).op.obj { unop := { obj := U_obj, property := U_property } })).obj { as := PUnit.unit } ⊢ colimit.ι (Lan.diagram (Opens.map f).op F (op ((Opens.map f).obj ((OpenNhds.inclusion (f x)).op.obj (op { obj := j_left.unop, property := (_ : ↑{ val := f x, property := (_ : ↑{ val := x, property := (_ : x ∈ { unop := { obj := U_obj, property := U_property } }.unop.obj) } ∈ ↑((Opens.map f).op.obj { left := j_left, right := { as := PUnit.unit }, hom := j_hom }.left).unop) } ∈ j_left.unop) })).unop))) (CostructuredArrow.mk (𝟙 (op ((Opens.map f).obj ((OpenNhds.inclusion (f x)).op.obj (op { obj := j_left.unop, property := (_ : ↑{ val := f x, property := (_ : ↑{ val := x, property := (_ : x ∈ { unop := { obj := U_obj, property := U_property } }.unop.obj) } ∈ ↑((Opens.map f).op.obj { left := j_left, right := { as := PUnit.unit }, hom := j_hom }.left).unop) } ∈ j_left.unop) })).unop)))) ≫ colimit.pre (Lan.diagram (Opens.map f).op F ((OpenNhds.map f x ⋙ OpenNhds.inclusion x).op.obj (op { obj := j_left.unop, property := (_ : ↑{ val := f x, property := (_ : ↑{ val := x, property := (_ : x ∈ { unop := { obj := U_obj, property := U_property } }.unop.obj) } ∈ ↑((Opens.map f).op.obj { left := j_left, right := { as := PUnit.unit }, hom := j_hom }.left).unop) } ∈ j_left.unop) }))) (CostructuredArrow.map ((𝟙 (OpenNhds.map f x ⋙ OpenNhds.inclusion x).op).app (op { obj := j_left.unop, property := (_ : ↑{ val := f x, property := (_ : ↑{ val := x, property := (_ : x ∈ { unop := { obj := U_obj, property := U_property } }.unop.obj) } ∈ ↑((Opens.map f).op.obj { left := j_left, right := { as := PUnit.unit }, hom := j_hom }.left).unop) } ∈ j_left.unop) }))) ≫ (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj ((lan (Opens.map f).op).obj F)).map (homOfLE (_ : ((Functor.fromPUnit ((OpenNhds.inclusion x).op.obj { unop := { obj := U_obj, property := U_property } })).obj { as := PUnit.unit }).unop ≤ ((Opens.map f).op.obj j_left).unop)).op ≫ colimit.ι (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj ((lan (Opens.map f).op).obj F)) (op { obj := U_obj, property := U_property }) = colimit.ι (Lan.diagram (Opens.map f).op F ((OpenNhds.inclusion x).op.obj { unop := { obj := U_obj, property := U_property } })) { left := j_left, right := { as := PUnit.unit }, hom := j_hom } ≫ colimit.ι (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj (pullbackObj f F)) { unop := { obj := U_obj, property := U_property } }
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op]
erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)]
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op]
Mathlib.Topology.Sheaves.Stalks.264_0.hsVUPKIHRY0xmFk
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom
Mathlib_Topology_Sheaves_Stalks
case w.mk.mk.w.mk.mk.unit C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C Y x : ↑X U_obj : Opens ↑X U_property : x ∈ U_obj j_left : (Opens ↑Y)ᵒᵖ j_hom : (Opens.map f).op.obj j_left ⟶ (Functor.fromPUnit ((OpenNhds.inclusion x).op.obj { unop := { obj := U_obj, property := U_property } })).obj { as := PUnit.unit } ⊢ colimit.ι (Lan.diagram (Opens.map f).op F (op ((Opens.map f).obj ((OpenNhds.inclusion (f x)).op.obj (op { obj := j_left.unop, property := (_ : ↑{ val := f x, property := (_ : ↑{ val := x, property := (_ : x ∈ { unop := { obj := U_obj, property := U_property } }.unop.obj) } ∈ ↑((Opens.map f).op.obj { left := j_left, right := { as := PUnit.unit }, hom := j_hom }.left).unop) } ∈ j_left.unop) })).unop))) ((CostructuredArrow.map ((𝟙 (OpenNhds.map f x ⋙ OpenNhds.inclusion x).op).app (op { obj := j_left.unop, property := (_ : ↑{ val := f x, property := (_ : ↑{ val := x, property := (_ : x ∈ { unop := { obj := U_obj, property := U_property } }.unop.obj) } ∈ ↑((Opens.map f).op.obj { left := j_left, right := { as := PUnit.unit }, hom := j_hom }.left).unop) } ∈ j_left.unop) }))).obj (CostructuredArrow.mk (𝟙 (op ((Opens.map f).obj ((OpenNhds.inclusion (f x)).op.obj (op { obj := j_left.unop, property := (_ : ↑{ val := f x, property := (_ : ↑{ val := x, property := (_ : x ∈ { unop := { obj := U_obj, property := U_property } }.unop.obj) } ∈ ↑((Opens.map f).op.obj { left := j_left, right := { as := PUnit.unit }, hom := j_hom }.left).unop) } ∈ j_left.unop) })).unop))))) ≫ (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj ((lan (Opens.map f).op).obj F)).map (homOfLE (_ : ((Functor.fromPUnit ((OpenNhds.inclusion x).op.obj { unop := { obj := U_obj, property := U_property } })).obj { as := PUnit.unit }).unop ≤ ((Opens.map f).op.obj j_left).unop)).op ≫ colimit.ι (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj ((lan (Opens.map f).op).obj F)) (op { obj := U_obj, property := U_property }) = colimit.ι (Lan.diagram (Opens.map f).op F ((OpenNhds.inclusion x).op.obj { unop := { obj := U_obj, property := U_property } })) { left := j_left, right := { as := PUnit.unit }, hom := j_hom } ≫ colimit.ι (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj (pullbackObj f F)) { unop := { obj := U_obj, property := U_property } }
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)]
erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)]
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)]
Mathlib.Topology.Sheaves.Stalks.264_0.hsVUPKIHRY0xmFk
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom
Mathlib_Topology_Sheaves_Stalks
case w.mk.mk.w.mk.mk.unit C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C Y x : ↑X U_obj : Opens ↑X U_property : x ∈ U_obj j_left : (Opens ↑Y)ᵒᵖ j_hom : (Opens.map f).op.obj j_left ⟶ (Functor.fromPUnit ((OpenNhds.inclusion x).op.obj { unop := { obj := U_obj, property := U_property } })).obj { as := PUnit.unit } ⊢ colimit.ι (Lan.diagram (Opens.map f).op F (op U_obj)) ((CostructuredArrow.map ((OpenNhds.inclusion x).op.map (homOfLE (_ : ((Functor.fromPUnit ((OpenNhds.inclusion x).op.obj { unop := { obj := U_obj, property := U_property } })).obj { as := PUnit.unit }).unop ≤ ((Opens.map f).op.obj j_left).unop)).op)).obj ((CostructuredArrow.map ((𝟙 (OpenNhds.map f x ⋙ OpenNhds.inclusion x).op).app (op { obj := j_left.unop, property := (_ : ↑{ val := f x, property := (_ : ↑{ val := x, property := (_ : x ∈ { unop := { obj := U_obj, property := U_property } }.unop.obj) } ∈ ↑((Opens.map f).op.obj { left := j_left, right := { as := PUnit.unit }, hom := j_hom }.left).unop) } ∈ j_left.unop) }))).obj (CostructuredArrow.mk (𝟙 (op ((Opens.map f).obj ((OpenNhds.inclusion (f x)).op.obj (op { obj := j_left.unop, property := (_ : ↑{ val := f x, property := (_ : ↑{ val := x, property := (_ : x ∈ { unop := { obj := U_obj, property := U_property } }.unop.obj) } ∈ ↑((Opens.map f).op.obj { left := j_left, right := { as := PUnit.unit }, hom := j_hom }.left).unop) } ∈ j_left.unop) })).unop)))))) ≫ colimit.ι (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj ((lan (Opens.map f).op).obj F)) (op { obj := U_obj, property := U_property }) = colimit.ι (Lan.diagram (Opens.map f).op F ((OpenNhds.inclusion x).op.obj { unop := { obj := U_obj, property := U_property } })) { left := j_left, right := { as := PUnit.unit }, hom := j_hom } ≫ colimit.ι (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj (pullbackObj f F)) { unop := { obj := U_obj, property := U_property } }
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)]
rfl
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)]
Mathlib.Topology.Sheaves.Stalks.264_0.hsVUPKIHRY0xmFk
/-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat F : Presheaf C X x y : ↑X h : x ⤳ y ⊢ stalk F y ⟶ stalk F x
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by
refine' colimit.desc _ ⟨_, fun U => _, _⟩
/-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by
Mathlib.Topology.Sheaves.Stalks.310_0.hsVUPKIHRY0xmFk
/-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x
Mathlib_Topology_Sheaves_Stalks
case refine'_1 C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat F : Presheaf C X x y : ↑X h : x ⤳ y U : (OpenNhds y)ᵒᵖ ⊢ (((whiskeringLeft (OpenNhds y)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion y).op).obj F).obj U ⟶ ((Functor.const (OpenNhds y)ᵒᵖ).obj (colim.obj (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F))).obj U
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ ·
exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩)
/-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ ·
Mathlib.Topology.Sheaves.Stalks.310_0.hsVUPKIHRY0xmFk
/-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x
Mathlib_Topology_Sheaves_Stalks
case refine'_2 C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat F : Presheaf C X x y : ↑X h : x ⤳ y ⊢ ∀ ⦃X_1 Y : (OpenNhds y)ᵒᵖ⦄ (f : X_1 ⟶ Y), (((whiskeringLeft (OpenNhds y)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion y).op).obj F).map f ≫ (fun U => colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op { obj := U.unop.obj, property := (_ : x ∈ U.unop.obj.carrier) })) Y = (fun U => colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op { obj := U.unop.obj, property := (_ : x ∈ U.unop.obj.carrier) })) X_1 ≫ ((Functor.const (OpenNhds y)ᵒᵖ).obj (colim.obj (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F))).map f
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) ·
intro U V i
/-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) ·
Mathlib.Topology.Sheaves.Stalks.310_0.hsVUPKIHRY0xmFk
/-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x
Mathlib_Topology_Sheaves_Stalks
case refine'_2 C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat F : Presheaf C X x y : ↑X h : x ⤳ y U V : (OpenNhds y)ᵒᵖ i : U ⟶ V ⊢ (((whiskeringLeft (OpenNhds y)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion y).op).obj F).map i ≫ (fun U => colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op { obj := U.unop.obj, property := (_ : x ∈ U.unop.obj.carrier) })) V = (fun U => colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op { obj := U.unop.obj, property := (_ : x ∈ U.unop.obj.carrier) })) U ≫ ((Functor.const (OpenNhds y)ᵒᵖ).obj (colim.obj (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F))).map i
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i
dsimp
/-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i
Mathlib.Topology.Sheaves.Stalks.310_0.hsVUPKIHRY0xmFk
/-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x
Mathlib_Topology_Sheaves_Stalks
case refine'_2 C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat F : Presheaf C X x y : ↑X h : x ⤳ y U V : (OpenNhds y)ᵒᵖ i : U ⟶ V ⊢ F.map ((OpenNhds.inclusion y).map i.unop).op ≫ colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op { obj := V.unop.obj, property := (_ : x ∈ ↑V.unop.obj) }) = colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op { obj := U.unop.obj, property := (_ : x ∈ ↑U.unop.obj) }) ≫ 𝟙 (colimit ((OpenNhds.inclusion x).op ⋙ F))
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp
rw [Category.comp_id]
/-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp
Mathlib.Topology.Sheaves.Stalks.310_0.hsVUPKIHRY0xmFk
/-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x
Mathlib_Topology_Sheaves_Stalks
case refine'_2 C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat F : Presheaf C X x y : ↑X h : x ⤳ y U V : (OpenNhds y)ᵒᵖ i : U ⟶ V ⊢ F.map ((OpenNhds.inclusion y).map i.unop).op ≫ colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op { obj := V.unop.obj, property := (_ : x ∈ ↑V.unop.obj) }) = colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op { obj := U.unop.obj, property := (_ : x ∈ ↑U.unop.obj) })
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id]
let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩
/-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id]
Mathlib.Topology.Sheaves.Stalks.310_0.hsVUPKIHRY0xmFk
/-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x
Mathlib_Topology_Sheaves_Stalks
case refine'_2 C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat F : Presheaf C X x y : ↑X h : x ⤳ y U V : (OpenNhds y)ᵒᵖ i : U ⟶ V U' : OpenNhds x := { obj := U.unop.obj, property := (_ : x ∈ U.unop.obj.carrier) } ⊢ F.map ((OpenNhds.inclusion y).map i.unop).op ≫ colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op { obj := V.unop.obj, property := (_ : x ∈ ↑V.unop.obj) }) = colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op { obj := U.unop.obj, property := (_ : x ∈ ↑U.unop.obj) })
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩
let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩
/-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩
Mathlib.Topology.Sheaves.Stalks.310_0.hsVUPKIHRY0xmFk
/-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x
Mathlib_Topology_Sheaves_Stalks
case refine'_2 C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat F : Presheaf C X x y : ↑X h : x ⤳ y U V : (OpenNhds y)ᵒᵖ i : U ⟶ V U' : OpenNhds x := { obj := U.unop.obj, property := (_ : x ∈ U.unop.obj.carrier) } V' : OpenNhds x := { obj := V.unop.obj, property := (_ : x ∈ V.unop.obj.carrier) } ⊢ F.map ((OpenNhds.inclusion y).map i.unop).op ≫ colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op { obj := V.unop.obj, property := (_ : x ∈ ↑V.unop.obj) }) = colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op { obj := U.unop.obj, property := (_ : x ∈ ↑U.unop.obj) })
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩
exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op
/-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩
Mathlib.Topology.Sheaves.Stalks.310_0.hsVUPKIHRY0xmFk
/-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x
Mathlib_Topology_Sheaves_Stalks
C✝ : Type u inst✝³ : Category.{v, u} C✝ inst✝² : HasColimits C✝ X✝ Y Z : TopCat C : Type u_1 inst✝¹ : Category.{u_2, u_1} C inst✝ : HasColimits C X : TopCat F : Presheaf C X x : ↑X ⊢ stalkSpecializes F (_ : x ⤳ x) = 𝟙 (stalk F x)
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by
ext
@[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by
Mathlib.Topology.Sheaves.Stalks.340_0.hsVUPKIHRY0xmFk
@[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _
Mathlib_Topology_Sheaves_Stalks
case ih C✝ : Type u inst✝³ : Category.{v, u} C✝ inst✝² : HasColimits C✝ X✝ Y Z : TopCat C : Type u_1 inst✝¹ : Category.{u_2, u_1} C inst✝ : HasColimits C X : TopCat F : Presheaf C X x : ↑X U✝ : Opens ↑X hxU✝ : x ∈ U✝ ⊢ germ F { val := x, property := hxU✝ } ≫ stalkSpecializes F (_ : x ⤳ x) = germ F { val := x, property := hxU✝ } ≫ 𝟙 (stalk F x)
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext
simp
@[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext
Mathlib.Topology.Sheaves.Stalks.340_0.hsVUPKIHRY0xmFk
@[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _
Mathlib_Topology_Sheaves_Stalks
C✝ : Type u inst✝³ : Category.{v, u} C✝ inst✝² : HasColimits C✝ X✝ Y Z : TopCat C : Type u_1 inst✝¹ : Category.{u_2, u_1} C inst✝ : HasColimits C X : TopCat F : Presheaf C X x y z : ↑X h : x ⤳ y h' : y ⤳ z ⊢ stalkSpecializes F h' ≫ stalkSpecializes F h = stalkSpecializes F (_ : x ⤳ z)
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by
ext
@[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by
Mathlib.Topology.Sheaves.Stalks.348_0.hsVUPKIHRY0xmFk
@[reassoc (attr
Mathlib_Topology_Sheaves_Stalks
case ih C✝ : Type u inst✝³ : Category.{v, u} C✝ inst✝² : HasColimits C✝ X✝ Y Z : TopCat C : Type u_1 inst✝¹ : Category.{u_2, u_1} C inst✝ : HasColimits C X : TopCat F : Presheaf C X x y z : ↑X h : x ⤳ y h' : y ⤳ z U✝ : Opens ↑X hxU✝ : z ∈ U✝ ⊢ germ F { val := z, property := hxU✝ } ≫ stalkSpecializes F h' ≫ stalkSpecializes F h = germ F { val := z, property := hxU✝ } ≫ stalkSpecializes F (_ : x ⤳ z)
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext
simp
@[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext
Mathlib.Topology.Sheaves.Stalks.348_0.hsVUPKIHRY0xmFk
@[reassoc (attr
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat F G : Presheaf C X f : F ⟶ G x y : ↑X h : x ⤳ y ⊢ stalkSpecializes F h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ stalkSpecializes G h
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by
change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _)
@[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by
Mathlib.Topology.Sheaves.Stalks.357_0.hsVUPKIHRY0xmFk
@[reassoc (attr
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat F G : Presheaf C X f : F ⟶ G x y : ↑X h : x ⤳ y ⊢ stalkSpecializes F h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ stalkSpecializes G h
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _)
ext
@[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _)
Mathlib.Topology.Sheaves.Stalks.357_0.hsVUPKIHRY0xmFk
@[reassoc (attr
Mathlib_Topology_Sheaves_Stalks
case w C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat F G : Presheaf C X f : F ⟶ G x y : ↑X h : x ⤳ y j✝ : (OpenNhds y)ᵒᵖ ⊢ colimit.ι (((whiskeringLeft (OpenNhds y)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion y).op).obj F) j✝ ≫ stalkSpecializes F h ≫ (stalkFunctor C x).map f = colimit.ι (((whiskeringLeft (OpenNhds y)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion y).op).obj F) j✝ ≫ (stalkFunctor C y).map f ≫ stalkSpecializes G h
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext;
delta stalkFunctor
@[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext;
Mathlib.Topology.Sheaves.Stalks.357_0.hsVUPKIHRY0xmFk
@[reassoc (attr
Mathlib_Topology_Sheaves_Stalks
case w C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat F G : Presheaf C X f : F ⟶ G x y : ↑X h : x ⤳ y j✝ : (OpenNhds y)ᵒᵖ ⊢ colimit.ι (((whiskeringLeft (OpenNhds y)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion y).op).obj F) j✝ ≫ stalkSpecializes F h ≫ ((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op ⋙ colim).map f = colimit.ι (((whiskeringLeft (OpenNhds y)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion y).op).obj F) j✝ ≫ ((whiskeringLeft (OpenNhds y)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion y).op ⋙ colim).map f ≫ stalkSpecializes G h
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor;
simpa [stalkSpecializes] using by rfl
@[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor;
Mathlib.Topology.Sheaves.Stalks.357_0.hsVUPKIHRY0xmFk
@[reassoc (attr
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat F G : Presheaf C X f : F ⟶ G x y : ↑X h : x ⤳ y j✝ : (OpenNhds y)ᵒᵖ ⊢ f.app (op j✝.unop.obj) ≫ colimit.ι ((OpenNhds.inclusion x).op ⋙ G) (op { obj := j✝.unop.obj, property := (_ : x ∈ j✝.unop.obj.carrier) }) = f.app (op ((OpenNhds.inclusion y).obj j✝.unop)) ≫ colimit.ι ((OpenNhds.inclusion x).op ⋙ G) (op { obj := j✝.unop.obj, property := (_ : x ∈ j✝.unop.obj.carrier) })
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by
rfl
@[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by
Mathlib.Topology.Sheaves.Stalks.357_0.hsVUPKIHRY0xmFk
@[reassoc (attr
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C X x y : ↑X h : x ⤳ y ⊢ stalkSpecializes (f _* F) (_ : f x ⤳ f y) ≫ stalkPushforward C f F x = stalkPushforward C f F y ≫ stalkSpecializes F h
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by
change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _)
@[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by
Mathlib.Topology.Sheaves.Stalks.366_0.hsVUPKIHRY0xmFk
@[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C X x y : ↑X h : x ⤳ y ⊢ stalkSpecializes (f _* F) (_ : f x ⤳ f y) ≫ stalkPushforward C f F x = stalkPushforward C f F y ≫ stalkSpecializes F h
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _)
ext
@[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _)
Mathlib.Topology.Sheaves.Stalks.366_0.hsVUPKIHRY0xmFk
@[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h
Mathlib_Topology_Sheaves_Stalks
case w C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C X x y : ↑X h : x ⤳ y j✝ : (OpenNhds (f y))ᵒᵖ ⊢ colimit.ι (((whiskeringLeft (OpenNhds (f y))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f y)).op).obj (f _* F)) j✝ ≫ stalkSpecializes (f _* F) (_ : f x ⤳ f y) ≫ stalkPushforward C f F x = colimit.ι (((whiskeringLeft (OpenNhds (f y))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f y)).op).obj (f _* F)) j✝ ≫ stalkPushforward C f F y ≫ stalkSpecializes F h
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext;
delta stalkPushforward
@[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext;
Mathlib.Topology.Sheaves.Stalks.366_0.hsVUPKIHRY0xmFk
@[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h
Mathlib_Topology_Sheaves_Stalks
case w C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C X x y : ↑X h : x ⤳ y j✝ : (OpenNhds (f y))ᵒᵖ ⊢ colimit.ι (((whiskeringLeft (OpenNhds (f y))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f y)).op).obj (f _* F)) j✝ ≫ stalkSpecializes (f _* F) (_ : f x ⤳ f y) ≫ colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) ≫ colimit.pre (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F) (OpenNhds.map f x).op = colimit.ι (((whiskeringLeft (OpenNhds (f y))ᵒᵖ (Opens ↑Y)ᵒᵖ C).obj (OpenNhds.inclusion (f y)).op).obj (f _* F)) j✝ ≫ (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f y).inv) F) ≫ colimit.pre (((whiskeringLeft (OpenNhds y)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion y).op).obj F) (OpenNhds.map f y).op) ≫ stalkSpecializes F h
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward
simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc]
@[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward
Mathlib.Topology.Sheaves.Stalks.366_0.hsVUPKIHRY0xmFk
@[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h
Mathlib_Topology_Sheaves_Stalks
case w C : Type u inst✝¹ : Category.{v, u} C inst✝ : HasColimits C X Y Z : TopCat f : X ⟶ Y F : Presheaf C X x y : ↑X h : x ⤳ y j✝ : (OpenNhds (f y))ᵒᵖ ⊢ (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F).app (op { obj := j✝.unop.obj, property := (_ : f x ∈ j✝.unop.obj.carrier) }) ≫ colimit.ι (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F) ((OpenNhds.map f x).op.obj (op { obj := j✝.unop.obj, property := (_ : f x ∈ j✝.unop.obj.carrier) })) = (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f y).inv) F).app j✝ ≫ (Cocone.whisker (OpenNhds.map f y).op { pt := colim.obj (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F), ι := NatTrans.mk fun U => colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op { obj := U.unop.obj, property := (_ : x ∈ U.unop.obj.carrier) }) }).ι.app j✝
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc]
rfl
@[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc]
Mathlib.Topology.Sheaves.Stalks.366_0.hsVUPKIHRY0xmFk
@[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h
Mathlib_Topology_Sheaves_Stalks
C✝ : Type u inst✝³ : Category.{v, u} C✝ inst✝² : HasColimits C✝ X✝ Y Z : TopCat X : TopCat C : Type u_1 inst✝¹ : Category.{?u.683138, u_1} C inst✝ : HasColimits C F : Presheaf C X x y : ↑X e : Inseparable x y ⊢ stalkSpecializes F (_ : nhds y ≤ nhds x) ≫ stalkSpecializes F (_ : nhds x ≤ nhds y) = 𝟙 (stalk F x)
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by
simp
/-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by
Mathlib.Topology.Sheaves.Stalks.378_0.hsVUPKIHRY0xmFk
/-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y
Mathlib_Topology_Sheaves_Stalks
C✝ : Type u inst✝³ : Category.{v, u} C✝ inst✝² : HasColimits C✝ X✝ Y Z : TopCat X : TopCat C : Type u_1 inst✝¹ : Category.{?u.683138, u_1} C inst✝ : HasColimits C F : Presheaf C X x y : ↑X e : Inseparable x y ⊢ stalkSpecializes F (_ : nhds x ≤ nhds y) ≫ stalkSpecializes F (_ : nhds y ≤ nhds x) = 𝟙 (stalk F y)
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by
simp
/-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by
Mathlib.Topology.Sheaves.Stalks.378_0.hsVUPKIHRY0xmFk
/-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝² : Category.{v, u} C inst✝¹ : HasColimits C X Y Z : TopCat inst✝ : ConcreteCategory C F : Presheaf C X U V : Opens ↑X x : ↑X hxU : x ∈ U hxV : x ∈ V W : Opens ↑X hxW : x ∈ W iWU : W ⟶ U iWV : W ⟶ V sU : (forget C).obj (F.obj (op U)) sV : (forget C).obj (F.obj (op V)) ih : (F.map iWU.op) sU = (F.map iWV.op) sV ⊢ (germ F { val := x, property := hxU }) sU = (germ F { val := x, property := hxV }) sV
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by
erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih]
theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by
Mathlib.Topology.Sheaves.Stalks.400_0.hsVUPKIHRY0xmFk
theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝³ : Category.{v, u} C inst✝² : HasColimits C X Y Z : TopCat inst✝¹ : ConcreteCategory C inst✝ : PreservesFilteredColimits (forget C) F : Presheaf C X x : ↑X t : (forget C).obj (stalk F x) ⊢ ∃ U, ∃ (m : x ∈ U), ∃ s, (germ F { val := x, property := m }) s = t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by
obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t
/-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by
Mathlib.Topology.Sheaves.Stalks.410_0.hsVUPKIHRY0xmFk
/-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t
Mathlib_Topology_Sheaves_Stalks
case intro.intro C : Type u inst✝³ : Category.{v, u} C inst✝² : HasColimits C X Y Z : TopCat inst✝¹ : ConcreteCategory C inst✝ : PreservesFilteredColimits (forget C) F : Presheaf C X x : ↑X t : (forget C).obj (stalk F x) U : (OpenNhds x)ᵒᵖ s : (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F ⋙ forget C).obj U e : ((forget C).mapCocone (colimit.cocone (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F))).ι.app U s = t ⊢ ∃ U, ∃ (m : x ∈ U), ∃ s, (germ F { val := x, property := m }) s = t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t
revert s e
/-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t
Mathlib.Topology.Sheaves.Stalks.410_0.hsVUPKIHRY0xmFk
/-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t
Mathlib_Topology_Sheaves_Stalks
case intro.intro C : Type u inst✝³ : Category.{v, u} C inst✝² : HasColimits C X Y Z : TopCat inst✝¹ : ConcreteCategory C inst✝ : PreservesFilteredColimits (forget C) F : Presheaf C X x : ↑X t : (forget C).obj (stalk F x) U : (OpenNhds x)ᵒᵖ ⊢ ∀ (s : (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F ⋙ forget C).obj U), ((forget C).mapCocone (colimit.cocone (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F))).ι.app U s = t → ∃ U, ∃ (m : x ∈ U), ∃ s, (germ F { val := x, property := m }) s = t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e
induction U with | h U => ?_
/-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e
Mathlib.Topology.Sheaves.Stalks.410_0.hsVUPKIHRY0xmFk
/-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t
Mathlib_Topology_Sheaves_Stalks
case intro.intro C : Type u inst✝³ : Category.{v, u} C inst✝² : HasColimits C X Y Z : TopCat inst✝¹ : ConcreteCategory C inst✝ : PreservesFilteredColimits (forget C) F : Presheaf C X x : ↑X t : (forget C).obj (stalk F x) U : (OpenNhds x)ᵒᵖ ⊢ ∀ (s : (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F ⋙ forget C).obj U), ((forget C).mapCocone (colimit.cocone (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F))).ι.app U s = t → ∃ U, ∃ (m : x ∈ U), ∃ s, (germ F { val := x, property := m }) s = t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e
induction U with | h U => ?_
/-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e
Mathlib.Topology.Sheaves.Stalks.410_0.hsVUPKIHRY0xmFk
/-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t
Mathlib_Topology_Sheaves_Stalks
case intro.intro.h C : Type u inst✝³ : Category.{v, u} C inst✝² : HasColimits C X Y Z : TopCat inst✝¹ : ConcreteCategory C inst✝ : PreservesFilteredColimits (forget C) F : Presheaf C X x : ↑X t : (forget C).obj (stalk F x) U : OpenNhds x ⊢ ∀ (s : (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F ⋙ forget C).obj (op U)), ((forget C).mapCocone (colimit.cocone (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F))).ι.app (op U) s = t → ∃ U, ∃ (m : x ∈ U), ∃ s, (germ F { val := x, property := m }) s = t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_
cases' U with V m
/-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_
Mathlib.Topology.Sheaves.Stalks.410_0.hsVUPKIHRY0xmFk
/-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t
Mathlib_Topology_Sheaves_Stalks
case intro.intro.h.mk C : Type u inst✝³ : Category.{v, u} C inst✝² : HasColimits C X Y Z : TopCat inst✝¹ : ConcreteCategory C inst✝ : PreservesFilteredColimits (forget C) F : Presheaf C X x : ↑X t : (forget C).obj (stalk F x) V : Opens ↑X m : x ∈ V ⊢ ∀ (s : (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F ⋙ forget C).obj (op { obj := V, property := m })), ((forget C).mapCocone (colimit.cocone (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F))).ι.app (op { obj := V, property := m }) s = t → ∃ U, ∃ (m : x ∈ U), ∃ s, (germ F { val := x, property := m }) s = t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m
intro s e
/-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m
Mathlib.Topology.Sheaves.Stalks.410_0.hsVUPKIHRY0xmFk
/-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t
Mathlib_Topology_Sheaves_Stalks
case intro.intro.h.mk C : Type u inst✝³ : Category.{v, u} C inst✝² : HasColimits C X Y Z : TopCat inst✝¹ : ConcreteCategory C inst✝ : PreservesFilteredColimits (forget C) F : Presheaf C X x : ↑X t : (forget C).obj (stalk F x) V : Opens ↑X m : x ∈ V s : (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F ⋙ forget C).obj (op { obj := V, property := m }) e : ((forget C).mapCocone (colimit.cocone (((whiskeringLeft (OpenNhds x)ᵒᵖ (Opens ↑X)ᵒᵖ C).obj (OpenNhds.inclusion x).op).obj F))).ι.app (op { obj := V, property := m }) s = t ⊢ ∃ U, ∃ (m : x ∈ U), ∃ s, (germ F { val := x, property := m }) s = t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e
exact ⟨V, m, s, e⟩
/-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e
Mathlib.Topology.Sheaves.Stalks.410_0.hsVUPKIHRY0xmFk
/-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝³ : Category.{v, u} C inst✝² : HasColimits C X Y Z : TopCat inst✝¹ : ConcreteCategory C inst✝ : PreservesFilteredColimits (forget C) F : Presheaf C X U V : Opens ↑X x : ↑X mU : x ∈ U mV : x ∈ V s : (forget C).obj (F.obj (op U)) t : (forget C).obj (F.obj (op V)) h : (germ F { val := x, property := mU }) s = (germ F { val := x, property := mV }) t ⊢ ∃ W, ∃ (_ : x ∈ W), ∃ iU iV, (F.map iU.op) s = (F.map iV.op) t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by
obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h
theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by
Mathlib.Topology.Sheaves.Stalks.426_0.hsVUPKIHRY0xmFk
theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t
Mathlib_Topology_Sheaves_Stalks
case intro.intro.intro C : Type u inst✝³ : Category.{v, u} C inst✝² : HasColimits C X Y Z : TopCat inst✝¹ : ConcreteCategory C inst✝ : PreservesFilteredColimits (forget C) F : Presheaf C X U V : Opens ↑X x : ↑X mU : x ∈ U mV : x ∈ V s : (forget C).obj (F.obj (op U)) t : (forget C).obj (F.obj (op V)) h : (germ F { val := x, property := mU }) s = (germ F { val := x, property := mV }) t W : (OpenNhds x)ᵒᵖ iU : op { obj := U, property := (_ : ↑{ val := x, property := mU } ∈ U) } ⟶ W iV : op { obj := V, property := (_ : ↑{ val := x, property := mV } ∈ V) } ⟶ W e : (((OpenNhds.inclusion x).op ⋙ F) ⋙ forget C).map iU s = (((OpenNhds.inclusion x).op ⋙ F) ⋙ forget C).map iV t ⊢ ∃ W, ∃ (_ : x ∈ W), ∃ iU iV, (F.map iU.op) s = (F.map iV.op) t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h
exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩
theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h
Mathlib.Topology.Sheaves.Stalks.426_0.hsVUPKIHRY0xmFk
theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝³ : Category.{v, u} C inst✝² : HasColimits C X Y Z : TopCat inst✝¹ : ConcreteCategory C inst✝ : PreservesFilteredColimits (forget C) F G : Presheaf C X f : F ⟶ G h : ∀ (U : Opens ↑X), Function.Injective ⇑(f.app (op U)) x : ↑X s t : (forget C).obj ((stalkFunctor C x).obj F) hst : ((stalkFunctor C x).map f) s = ((stalkFunctor C x).map f) t ⊢ s = t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by
rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩
theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by
Mathlib.Topology.Sheaves.Stalks.436_0.hsVUPKIHRY0xmFk
theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f)
Mathlib_Topology_Sheaves_Stalks
case intro.intro.intro C : Type u inst✝³ : Category.{v, u} C inst✝² : HasColimits C X Y Z : TopCat inst✝¹ : ConcreteCategory C inst✝ : PreservesFilteredColimits (forget C) F G : Presheaf C X f : F ⟶ G h : ∀ (U : Opens ↑X), Function.Injective ⇑(f.app (op U)) x : ↑X t : (forget C).obj ((stalkFunctor C x).obj F) U₁ : Opens ↑X hxU₁ : x ∈ U₁ s : (forget C).obj (F.obj (op U₁)) hst : ((stalkFunctor C x).map f) ((germ F { val := x, property := hxU₁ }) s) = ((stalkFunctor C x).map f) t ⊢ (germ F { val := x, property := hxU₁ }) s = t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩
rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩
theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩
Mathlib.Topology.Sheaves.Stalks.436_0.hsVUPKIHRY0xmFk
theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f)
Mathlib_Topology_Sheaves_Stalks
case intro.intro.intro.intro.intro.intro C : Type u inst✝³ : Category.{v, u} C inst✝² : HasColimits C X Y Z : TopCat inst✝¹ : ConcreteCategory C inst✝ : PreservesFilteredColimits (forget C) F G : Presheaf C X f : F ⟶ G h : ∀ (U : Opens ↑X), Function.Injective ⇑(f.app (op U)) x : ↑X U₁ : Opens ↑X hxU₁ : x ∈ U₁ s : (forget C).obj (F.obj (op U₁)) U₂ : Opens ↑X hxU₂ : x ∈ U₂ t : (forget C).obj (F.obj (op U₂)) hst : ((stalkFunctor C x).map f) ((germ F { val := x, property := hxU₁ }) s) = ((stalkFunctor C x).map f) ((germ F { val := x, property := hxU₂ }) t) ⊢ (germ F { val := x, property := hxU₁ }) s = (germ F { val := x, property := hxU₂ }) t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩
erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst
theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩
Mathlib.Topology.Sheaves.Stalks.436_0.hsVUPKIHRY0xmFk
theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f)
Mathlib_Topology_Sheaves_Stalks
case intro.intro.intro.intro.intro.intro C : Type u inst✝³ : Category.{v, u} C inst✝² : HasColimits C X Y Z : TopCat inst✝¹ : ConcreteCategory C inst✝ : PreservesFilteredColimits (forget C) F G : Presheaf C X f : F ⟶ G h : ∀ (U : Opens ↑X), Function.Injective ⇑(f.app (op U)) x : ↑X U₁ : Opens ↑X hxU₁ : x ∈ U₁ s : (forget C).obj (F.obj (op U₁)) U₂ : Opens ↑X hxU₂ : x ∈ U₂ t : (forget C).obj (F.obj (op U₂)) hst : (colimit.ι ((OpenNhds.inclusion ↑{ val := x, property := hxU₁ }).op ⋙ G) (op { obj := U₁, property := (_ : ↑{ val := x, property := hxU₁ } ∈ U₁) })) ((f.app (op U₁)) s) = ((stalkFunctor C x).map f) ((germ F { val := x, property := hxU₂ }) t) ⊢ (germ F { val := x, property := hxU₁ }) s = (germ F { val := x, property := hxU₂ }) t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst
erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst
theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst
Mathlib.Topology.Sheaves.Stalks.436_0.hsVUPKIHRY0xmFk
theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f)
Mathlib_Topology_Sheaves_Stalks
case intro.intro.intro.intro.intro.intro C : Type u inst✝³ : Category.{v, u} C inst✝² : HasColimits C X Y Z : TopCat inst✝¹ : ConcreteCategory C inst✝ : PreservesFilteredColimits (forget C) F G : Presheaf C X f : F ⟶ G h : ∀ (U : Opens ↑X), Function.Injective ⇑(f.app (op U)) x : ↑X U₁ : Opens ↑X hxU₁ : x ∈ U₁ s : (forget C).obj (F.obj (op U₁)) U₂ : Opens ↑X hxU₂ : x ∈ U₂ t : (forget C).obj (F.obj (op U₂)) hst : (colimit.ι ((OpenNhds.inclusion ↑{ val := x, property := hxU₁ }).op ⋙ G) (op { obj := U₁, property := (_ : ↑{ val := x, property := hxU₁ } ∈ U₁) })) ((f.app (op U₁)) s) = (colimit.ι ((OpenNhds.inclusion ↑{ val := x, property := hxU₂ }).op ⋙ G) (op { obj := U₂, property := (_ : ↑{ val := x, property := hxU₂ } ∈ U₂) })) ((f.app (op U₂)) t) ⊢ (germ F { val := x, property := hxU₁ }) s = (germ F { val := x, property := hxU₂ }) t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst
obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst
theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst
Mathlib.Topology.Sheaves.Stalks.436_0.hsVUPKIHRY0xmFk
theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f)
Mathlib_Topology_Sheaves_Stalks
case intro.intro.intro.intro.intro.intro.intro.intro.intro.intro C : Type u inst✝³ : Category.{v, u} C inst✝² : HasColimits C X Y Z : TopCat inst✝¹ : ConcreteCategory C inst✝ : PreservesFilteredColimits (forget C) F G : Presheaf C X f : F ⟶ G h : ∀ (U : Opens ↑X), Function.Injective ⇑(f.app (op U)) x : ↑X U₁ : Opens ↑X hxU₁ : x ∈ U₁ s : (forget C).obj (F.obj (op U₁)) U₂ : Opens ↑X hxU₂ : x ∈ U₂ t : (forget C).obj (F.obj (op U₂)) hst : (colimit.ι ((OpenNhds.inclusion ↑{ val := x, property := hxU₁ }).op ⋙ G) (op { obj := U₁, property := (_ : ↑{ val := x, property := hxU₁ } ∈ U₁) })) ((f.app (op U₁)) s) = (colimit.ι ((OpenNhds.inclusion ↑{ val := x, property := hxU₂ }).op ⋙ G) (op { obj := U₂, property := (_ : ↑{ val := x, property := hxU₂ } ∈ U₂) })) ((f.app (op U₂)) t) W : Opens ↑X hxW : x ∈ W iWU₁ : W ⟶ U₁ iWU₂ : W ⟶ U₂ heq : (G.map iWU₁.op) ((f.app (op U₁)) s) = (G.map iWU₂.op) ((f.app (op U₂)) t) ⊢ (germ F { val := x, property := hxU₁ }) s = (germ F { val := x, property := hxU₂ }) t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst
rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq
theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst
Mathlib.Topology.Sheaves.Stalks.436_0.hsVUPKIHRY0xmFk
theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f)
Mathlib_Topology_Sheaves_Stalks
case intro.intro.intro.intro.intro.intro.intro.intro.intro.intro C : Type u inst✝³ : Category.{v, u} C inst✝² : HasColimits C X Y Z : TopCat inst✝¹ : ConcreteCategory C inst✝ : PreservesFilteredColimits (forget C) F G : Presheaf C X f : F ⟶ G h : ∀ (U : Opens ↑X), Function.Injective ⇑(f.app (op U)) x : ↑X U₁ : Opens ↑X hxU₁ : x ∈ U₁ s : (forget C).obj (F.obj (op U₁)) U₂ : Opens ↑X hxU₂ : x ∈ U₂ t : (forget C).obj (F.obj (op U₂)) hst : (colimit.ι ((OpenNhds.inclusion ↑{ val := x, property := hxU₁ }).op ⋙ G) (op { obj := U₁, property := (_ : ↑{ val := x, property := hxU₁ } ∈ U₁) })) ((f.app (op U₁)) s) = (colimit.ι ((OpenNhds.inclusion ↑{ val := x, property := hxU₂ }).op ⋙ G) (op { obj := U₂, property := (_ : ↑{ val := x, property := hxU₂ } ∈ U₂) })) ((f.app (op U₂)) t) W : Opens ↑X hxW : x ∈ W iWU₁ : W ⟶ U₁ iWU₂ : W ⟶ U₂ heq : (f.app (op W)) ((F.map iWU₁.op) s) = (f.app (op W)) ((F.map iWU₂.op) t) ⊢ (germ F { val := x, property := hxU₁ }) s = (germ F { val := x, property := hxU₂ }) t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq
replace heq := h W heq
theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq
Mathlib.Topology.Sheaves.Stalks.436_0.hsVUPKIHRY0xmFk
theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f)
Mathlib_Topology_Sheaves_Stalks
case intro.intro.intro.intro.intro.intro.intro.intro.intro.intro C : Type u inst✝³ : Category.{v, u} C inst✝² : HasColimits C X Y Z : TopCat inst✝¹ : ConcreteCategory C inst✝ : PreservesFilteredColimits (forget C) F G : Presheaf C X f : F ⟶ G h : ∀ (U : Opens ↑X), Function.Injective ⇑(f.app (op U)) x : ↑X U₁ : Opens ↑X hxU₁ : x ∈ U₁ s : (forget C).obj (F.obj (op U₁)) U₂ : Opens ↑X hxU₂ : x ∈ U₂ t : (forget C).obj (F.obj (op U₂)) hst : (colimit.ι ((OpenNhds.inclusion ↑{ val := x, property := hxU₁ }).op ⋙ G) (op { obj := U₁, property := (_ : ↑{ val := x, property := hxU₁ } ∈ U₁) })) ((f.app (op U₁)) s) = (colimit.ι ((OpenNhds.inclusion ↑{ val := x, property := hxU₂ }).op ⋙ G) (op { obj := U₂, property := (_ : ↑{ val := x, property := hxU₂ } ∈ U₂) })) ((f.app (op U₂)) t) W : Opens ↑X hxW : x ∈ W iWU₁ : W ⟶ U₁ iWU₂ : W ⟶ U₂ heq : (F.map iWU₁.op) s = (F.map iWU₂.op) t ⊢ (germ F { val := x, property := hxU₁ }) s = (germ F { val := x, property := hxU₂ }) t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq
convert congr_arg (F.germ ⟨x, hxW⟩) heq using 1
theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq
Mathlib.Topology.Sheaves.Stalks.436_0.hsVUPKIHRY0xmFk
theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f)
Mathlib_Topology_Sheaves_Stalks
case h.e'_2.h C : Type u inst✝³ : Category.{v, u} C inst✝² : HasColimits C X Y Z : TopCat inst✝¹ : ConcreteCategory C inst✝ : PreservesFilteredColimits (forget C) F G : Presheaf C X f : F ⟶ G h : ∀ (U : Opens ↑X), Function.Injective ⇑(f.app (op U)) x : ↑X U₁ : Opens ↑X hxU₁ : x ∈ U₁ s : (forget C).obj (F.obj (op U₁)) U₂ : Opens ↑X hxU₂ : x ∈ U₂ t : (forget C).obj (F.obj (op U₂)) hst : (colimit.ι ((OpenNhds.inclusion ↑{ val := x, property := hxU₁ }).op ⋙ G) (op { obj := U₁, property := (_ : ↑{ val := x, property := hxU₁ } ∈ U₁) })) ((f.app (op U₁)) s) = (colimit.ι ((OpenNhds.inclusion ↑{ val := x, property := hxU₂ }).op ⋙ G) (op { obj := U₂, property := (_ : ↑{ val := x, property := hxU₂ } ∈ U₂) })) ((f.app (op U₂)) t) W : Opens ↑X hxW : x ∈ W iWU₁ : W ⟶ U₁ iWU₂ : W ⟶ U₂ heq : (F.map iWU₁.op) s = (F.map iWU₂.op) t e_1✝ : (forget C).obj ((stalkFunctor C x).obj F) = (forget C).obj (stalk F ↑{ val := x, property := hxW }) ⊢ (germ F { val := x, property := hxU₁ }) s = (germ F { val := x, property := hxW }) ((F.map iWU₁.op) s) case h.e'_3.h C : Type u inst✝³ : Category.{v, u} C inst✝² : HasColimits C X Y Z : TopCat inst✝¹ : ConcreteCategory C inst✝ : PreservesFilteredColimits (forget C) F G : Presheaf C X f : F ⟶ G h : ∀ (U : Opens ↑X), Function.Injective ⇑(f.app (op U)) x : ↑X U₁ : Opens ↑X hxU₁ : x ∈ U₁ s : (forget C).obj (F.obj (op U₁)) U₂ : Opens ↑X hxU₂ : x ∈ U₂ t : (forget C).obj (F.obj (op U₂)) hst : (colimit.ι ((OpenNhds.inclusion ↑{ val := x, property := hxU₁ }).op ⋙ G) (op { obj := U₁, property := (_ : ↑{ val := x, property := hxU₁ } ∈ U₁) })) ((f.app (op U₁)) s) = (colimit.ι ((OpenNhds.inclusion ↑{ val := x, property := hxU₂ }).op ⋙ G) (op { obj := U₂, property := (_ : ↑{ val := x, property := hxU₂ } ∈ U₂) })) ((f.app (op U₂)) t) W : Opens ↑X hxW : x ∈ W iWU₁ : W ⟶ U₁ iWU₂ : W ⟶ U₂ heq : (F.map iWU₁.op) s = (F.map iWU₂.op) t e_1✝ : (forget C).obj ((stalkFunctor C x).obj F) = (forget C).obj (stalk F ↑{ val := x, property := hxW }) ⊢ (germ F { val := x, property := hxU₂ }) t = (germ F { val := x, property := hxW }) ((F.map iWU₂.op) t)
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq convert congr_arg (F.germ ⟨x, hxW⟩) heq using 1
exacts [(F.germ_res_apply iWU₁ ⟨x, hxW⟩ s).symm, (F.germ_res_apply iWU₂ ⟨x, hxW⟩ t).symm]
theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq convert congr_arg (F.germ ⟨x, hxW⟩) heq using 1
Mathlib.Topology.Sheaves.Stalks.436_0.hsVUPKIHRY0xmFk
theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f)
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝⁶ : Category.{v, u} C inst✝⁵ : HasColimits C X Y Z : TopCat inst✝⁴ : ConcreteCategory C inst✝³ : PreservesFilteredColimits (forget C) inst✝² : HasLimits C inst✝¹ : PreservesLimits (forget C) inst✝ : ReflectsIsomorphisms (forget C) F : Sheaf C X U : Opens ↑X s t : (forget C).obj (F.val.obj (op U)) h : ∀ (x : ↥U), (germ (Sheaf.presheaf F) x) s = (germ (Sheaf.presheaf F) x) t ⊢ s = t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq convert congr_arg (F.germ ⟨x, hxW⟩) heq using 1 exacts [(F.germ_res_apply iWU₁ ⟨x, hxW⟩ s).symm, (F.germ_res_apply iWU₂ ⟨x, hxW⟩ t).symm] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_injective_of_app_injective TopCat.Presheaf.stalkFunctor_map_injective_of_app_injective variable [HasLimits C] [PreservesLimits (forget C)] [ReflectsIsomorphisms (forget C)] /-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide.
choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x)
/-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide.
Mathlib.Topology.Sheaves.Stalks.453_0.hsVUPKIHRY0xmFk
/-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝⁶ : Category.{v, u} C inst✝⁵ : HasColimits C X Y Z : TopCat inst✝⁴ : ConcreteCategory C inst✝³ : PreservesFilteredColimits (forget C) inst✝² : HasLimits C inst✝¹ : PreservesLimits (forget C) inst✝ : ReflectsIsomorphisms (forget C) F : Sheaf C X U : Opens ↑X s t : (forget C).obj (F.val.obj (op U)) h : ∀ (x : ↥U), (germ (Sheaf.presheaf F) x) s = (germ (Sheaf.presheaf F) x) t V : ↥U → Opens ↑X m : ∀ (x : ↥U), ↑x ∈ V x i₁ i₂ : (x : ↥U) → V x ⟶ U heq : ∀ (x : ↥U), ((Sheaf.presheaf F).map (i₁ x).op) s = ((Sheaf.presheaf F).map (i₂ x).op) t ⊢ s = t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq convert congr_arg (F.germ ⟨x, hxW⟩) heq using 1 exacts [(F.germ_res_apply iWU₁ ⟨x, hxW⟩ s).symm, (F.germ_res_apply iWU₂ ⟨x, hxW⟩ t).symm] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_injective_of_app_injective TopCat.Presheaf.stalkFunctor_map_injective_of_app_injective variable [HasLimits C] [PreservesLimits (forget C)] [ReflectsIsomorphisms (forget C)] /-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`.
apply F.eq_of_locally_eq' V U i₁
/-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`.
Mathlib.Topology.Sheaves.Stalks.453_0.hsVUPKIHRY0xmFk
/-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t
Mathlib_Topology_Sheaves_Stalks
case hcover C : Type u inst✝⁶ : Category.{v, u} C inst✝⁵ : HasColimits C X Y Z : TopCat inst✝⁴ : ConcreteCategory C inst✝³ : PreservesFilteredColimits (forget C) inst✝² : HasLimits C inst✝¹ : PreservesLimits (forget C) inst✝ : ReflectsIsomorphisms (forget C) F : Sheaf C X U : Opens ↑X s t : (forget C).obj (F.val.obj (op U)) h : ∀ (x : ↥U), (germ (Sheaf.presheaf F) x) s = (germ (Sheaf.presheaf F) x) t V : ↥U → Opens ↑X m : ∀ (x : ↥U), ↑x ∈ V x i₁ i₂ : (x : ↥U) → V x ⟶ U heq : ∀ (x : ↥U), ((Sheaf.presheaf F).map (i₁ x).op) s = ((Sheaf.presheaf F).map (i₂ x).op) t ⊢ U ≤ iSup V
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq convert congr_arg (F.germ ⟨x, hxW⟩) heq using 1 exacts [(F.germ_res_apply iWU₁ ⟨x, hxW⟩ s).symm, (F.germ_res_apply iWU₂ ⟨x, hxW⟩ t).symm] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_injective_of_app_injective TopCat.Presheaf.stalkFunctor_map_injective_of_app_injective variable [HasLimits C] [PreservesLimits (forget C)] [ReflectsIsomorphisms (forget C)] /-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`. apply F.eq_of_locally_eq' V U i₁ ·
intro x hxU
/-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`. apply F.eq_of_locally_eq' V U i₁ ·
Mathlib.Topology.Sheaves.Stalks.453_0.hsVUPKIHRY0xmFk
/-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t
Mathlib_Topology_Sheaves_Stalks
case hcover C : Type u inst✝⁶ : Category.{v, u} C inst✝⁵ : HasColimits C X Y Z : TopCat inst✝⁴ : ConcreteCategory C inst✝³ : PreservesFilteredColimits (forget C) inst✝² : HasLimits C inst✝¹ : PreservesLimits (forget C) inst✝ : ReflectsIsomorphisms (forget C) F : Sheaf C X U : Opens ↑X s t : (forget C).obj (F.val.obj (op U)) h : ∀ (x : ↥U), (germ (Sheaf.presheaf F) x) s = (germ (Sheaf.presheaf F) x) t V : ↥U → Opens ↑X m : ∀ (x : ↥U), ↑x ∈ V x i₁ i₂ : (x : ↥U) → V x ⟶ U heq : ∀ (x : ↥U), ((Sheaf.presheaf F).map (i₁ x).op) s = ((Sheaf.presheaf F).map (i₂ x).op) t x : ↑X hxU : x ∈ ↑U ⊢ x ∈ ↑(iSup V)
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq convert congr_arg (F.germ ⟨x, hxW⟩) heq using 1 exacts [(F.germ_res_apply iWU₁ ⟨x, hxW⟩ s).symm, (F.germ_res_apply iWU₂ ⟨x, hxW⟩ t).symm] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_injective_of_app_injective TopCat.Presheaf.stalkFunctor_map_injective_of_app_injective variable [HasLimits C] [PreservesLimits (forget C)] [ReflectsIsomorphisms (forget C)] /-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`. apply F.eq_of_locally_eq' V U i₁ · intro x hxU
simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe]
/-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`. apply F.eq_of_locally_eq' V U i₁ · intro x hxU
Mathlib.Topology.Sheaves.Stalks.453_0.hsVUPKIHRY0xmFk
/-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t
Mathlib_Topology_Sheaves_Stalks
case hcover C : Type u inst✝⁶ : Category.{v, u} C inst✝⁵ : HasColimits C X Y Z : TopCat inst✝⁴ : ConcreteCategory C inst✝³ : PreservesFilteredColimits (forget C) inst✝² : HasLimits C inst✝¹ : PreservesLimits (forget C) inst✝ : ReflectsIsomorphisms (forget C) F : Sheaf C X U : Opens ↑X s t : (forget C).obj (F.val.obj (op U)) h : ∀ (x : ↥U), (germ (Sheaf.presheaf F) x) s = (germ (Sheaf.presheaf F) x) t V : ↥U → Opens ↑X m : ∀ (x : ↥U), ↑x ∈ V x i₁ i₂ : (x : ↥U) → V x ⟶ U heq : ∀ (x : ↥U), ((Sheaf.presheaf F).map (i₁ x).op) s = ((Sheaf.presheaf F).map (i₂ x).op) t x : ↑X hxU : x ∈ ↑U ⊢ ∃ i, x ∈ V i
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq convert congr_arg (F.germ ⟨x, hxW⟩) heq using 1 exacts [(F.germ_res_apply iWU₁ ⟨x, hxW⟩ s).symm, (F.germ_res_apply iWU₂ ⟨x, hxW⟩ t).symm] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_injective_of_app_injective TopCat.Presheaf.stalkFunctor_map_injective_of_app_injective variable [HasLimits C] [PreservesLimits (forget C)] [ReflectsIsomorphisms (forget C)] /-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`. apply F.eq_of_locally_eq' V U i₁ · intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe]
exact ⟨⟨x, hxU⟩, m ⟨x, hxU⟩⟩
/-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`. apply F.eq_of_locally_eq' V U i₁ · intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe]
Mathlib.Topology.Sheaves.Stalks.453_0.hsVUPKIHRY0xmFk
/-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t
Mathlib_Topology_Sheaves_Stalks
case h C : Type u inst✝⁶ : Category.{v, u} C inst✝⁵ : HasColimits C X Y Z : TopCat inst✝⁴ : ConcreteCategory C inst✝³ : PreservesFilteredColimits (forget C) inst✝² : HasLimits C inst✝¹ : PreservesLimits (forget C) inst✝ : ReflectsIsomorphisms (forget C) F : Sheaf C X U : Opens ↑X s t : (forget C).obj (F.val.obj (op U)) h : ∀ (x : ↥U), (germ (Sheaf.presheaf F) x) s = (germ (Sheaf.presheaf F) x) t V : ↥U → Opens ↑X m : ∀ (x : ↥U), ↑x ∈ V x i₁ i₂ : (x : ↥U) → V x ⟶ U heq : ∀ (x : ↥U), ((Sheaf.presheaf F).map (i₁ x).op) s = ((Sheaf.presheaf F).map (i₂ x).op) t ⊢ ∀ (i : ↥U), (F.val.map (i₁ i).op) s = (F.val.map (i₁ i).op) t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq convert congr_arg (F.germ ⟨x, hxW⟩) heq using 1 exacts [(F.germ_res_apply iWU₁ ⟨x, hxW⟩ s).symm, (F.germ_res_apply iWU₂ ⟨x, hxW⟩ t).symm] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_injective_of_app_injective TopCat.Presheaf.stalkFunctor_map_injective_of_app_injective variable [HasLimits C] [PreservesLimits (forget C)] [ReflectsIsomorphisms (forget C)] /-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`. apply F.eq_of_locally_eq' V U i₁ · intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, m ⟨x, hxU⟩⟩ ·
intro x
/-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`. apply F.eq_of_locally_eq' V U i₁ · intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, m ⟨x, hxU⟩⟩ ·
Mathlib.Topology.Sheaves.Stalks.453_0.hsVUPKIHRY0xmFk
/-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t
Mathlib_Topology_Sheaves_Stalks
case h C : Type u inst✝⁶ : Category.{v, u} C inst✝⁵ : HasColimits C X Y Z : TopCat inst✝⁴ : ConcreteCategory C inst✝³ : PreservesFilteredColimits (forget C) inst✝² : HasLimits C inst✝¹ : PreservesLimits (forget C) inst✝ : ReflectsIsomorphisms (forget C) F : Sheaf C X U : Opens ↑X s t : (forget C).obj (F.val.obj (op U)) h : ∀ (x : ↥U), (germ (Sheaf.presheaf F) x) s = (germ (Sheaf.presheaf F) x) t V : ↥U → Opens ↑X m : ∀ (x : ↥U), ↑x ∈ V x i₁ i₂ : (x : ↥U) → V x ⟶ U heq : ∀ (x : ↥U), ((Sheaf.presheaf F).map (i₁ x).op) s = ((Sheaf.presheaf F).map (i₂ x).op) t x : ↥U ⊢ (F.val.map (i₁ x).op) s = (F.val.map (i₁ x).op) t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq convert congr_arg (F.germ ⟨x, hxW⟩) heq using 1 exacts [(F.germ_res_apply iWU₁ ⟨x, hxW⟩ s).symm, (F.germ_res_apply iWU₂ ⟨x, hxW⟩ t).symm] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_injective_of_app_injective TopCat.Presheaf.stalkFunctor_map_injective_of_app_injective variable [HasLimits C] [PreservesLimits (forget C)] [ReflectsIsomorphisms (forget C)] /-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`. apply F.eq_of_locally_eq' V U i₁ · intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, m ⟨x, hxU⟩⟩ · intro x
rw [heq, Subsingleton.elim (i₁ x) (i₂ x)]
/-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`. apply F.eq_of_locally_eq' V U i₁ · intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, m ⟨x, hxU⟩⟩ · intro x
Mathlib.Topology.Sheaves.Stalks.453_0.hsVUPKIHRY0xmFk
/-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝⁶ : Category.{v, u} C inst✝⁵ : HasColimits C X Y Z : TopCat inst✝⁴ : ConcreteCategory C inst✝³ : PreservesFilteredColimits (forget C) inst✝² : HasLimits C inst✝¹ : PreservesLimits (forget C) inst✝ : ReflectsIsomorphisms (forget C) F : Sheaf C X G : Presheaf C X f : F.val ⟶ G U : Opens ↑X h : ∀ (x : ↥U), Function.Injective ⇑((stalkFunctor C ↑x).map f) s t : (forget C).obj (F.val.obj (op U)) hst : (f.app (op U)) s = (f.app (op U)) t x : ↥U ⊢ ((stalkFunctor C ↑x).map f) ((germ (Sheaf.presheaf F) x) s) = ((stalkFunctor C ↑x).map f) ((germ (Sheaf.presheaf F) x) t)
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq convert congr_arg (F.germ ⟨x, hxW⟩) heq using 1 exacts [(F.germ_res_apply iWU₁ ⟨x, hxW⟩ s).symm, (F.germ_res_apply iWU₂ ⟨x, hxW⟩ t).symm] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_injective_of_app_injective TopCat.Presheaf.stalkFunctor_map_injective_of_app_injective variable [HasLimits C] [PreservesLimits (forget C)] [ReflectsIsomorphisms (forget C)] /-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`. apply F.eq_of_locally_eq' V U i₁ · intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, m ⟨x, hxU⟩⟩ · intro x rw [heq, Subsingleton.elim (i₁ x) (i₂ x)] set_option linter.uppercaseLean3 false in #align Top.presheaf.section_ext TopCat.Presheaf.section_ext /- Note that the analogous statement for surjectivity is false: Surjectivity on stalks does not imply surjectivity of the components of a sheaf morphism. However it does imply that the morphism is an epi, but this fact is not yet formalized. -/ theorem app_injective_of_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) (U : Opens X) (h : ∀ x : U, Function.Injective ((stalkFunctor C x.val).map f)) : Function.Injective (f.app (op U)) := fun s t hst => section_ext F _ _ _ fun x => h x <| by
erw [stalkFunctor_map_germ_apply, stalkFunctor_map_germ_apply, hst]
theorem app_injective_of_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) (U : Opens X) (h : ∀ x : U, Function.Injective ((stalkFunctor C x.val).map f)) : Function.Injective (f.app (op U)) := fun s t hst => section_ext F _ _ _ fun x => h x <| by
Mathlib.Topology.Sheaves.Stalks.477_0.hsVUPKIHRY0xmFk
theorem app_injective_of_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) (U : Opens X) (h : ∀ x : U, Function.Injective ((stalkFunctor C x.val).map f)) : Function.Injective (f.app (op U))
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝⁶ : Category.{v, u} C inst✝⁵ : HasColimits C X Y Z : TopCat inst✝⁴ : ConcreteCategory C inst✝³ : PreservesFilteredColimits (forget C) inst✝² : HasLimits C inst✝¹ : PreservesLimits (forget C) inst✝ : ReflectsIsomorphisms (forget C) F G : Sheaf C X f : F ⟶ G U : Opens ↑X hinj : ∀ (x : ↥U), Function.Injective ⇑((stalkFunctor C ↑x).map f.val) hsurj : ∀ (t : (forget C).obj (G.val.obj (op U))) (x : ↥U), ∃ V, ∃ (_ : ↑x ∈ V), ∃ iVU s, (f.val.app (op V)) s = (G.val.map iVU.op) t ⊢ Function.Surjective ⇑(f.val.app (op U))
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq convert congr_arg (F.germ ⟨x, hxW⟩) heq using 1 exacts [(F.germ_res_apply iWU₁ ⟨x, hxW⟩ s).symm, (F.germ_res_apply iWU₂ ⟨x, hxW⟩ t).symm] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_injective_of_app_injective TopCat.Presheaf.stalkFunctor_map_injective_of_app_injective variable [HasLimits C] [PreservesLimits (forget C)] [ReflectsIsomorphisms (forget C)] /-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`. apply F.eq_of_locally_eq' V U i₁ · intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, m ⟨x, hxU⟩⟩ · intro x rw [heq, Subsingleton.elim (i₁ x) (i₂ x)] set_option linter.uppercaseLean3 false in #align Top.presheaf.section_ext TopCat.Presheaf.section_ext /- Note that the analogous statement for surjectivity is false: Surjectivity on stalks does not imply surjectivity of the components of a sheaf morphism. However it does imply that the morphism is an epi, but this fact is not yet formalized. -/ theorem app_injective_of_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) (U : Opens X) (h : ∀ x : U, Function.Injective ((stalkFunctor C x.val).map f)) : Function.Injective (f.app (op U)) := fun s t hst => section_ext F _ _ _ fun x => h x <| by erw [stalkFunctor_map_germ_apply, stalkFunctor_map_germ_apply, hst] set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_of_stalk_functor_map_injective TopCat.Presheaf.app_injective_of_stalkFunctor_map_injective theorem app_injective_iff_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) : (∀ x : X, Function.Injective ((stalkFunctor C x).map f)) ↔ ∀ U : Opens X, Function.Injective (f.app (op U)) := ⟨fun h U => app_injective_of_stalkFunctor_map_injective f U fun x => h x.1, stalkFunctor_map_injective_of_app_injective f⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_iff_stalk_functor_map_injective TopCat.Presheaf.app_injective_iff_stalkFunctor_map_injective instance stalkFunctor_preserves_mono (x : X) : Functor.PreservesMonomorphisms (Sheaf.forget C X ⋙ stalkFunctor C x) := ⟨@fun _𝓐 _𝓑 f _ => ConcreteCategory.mono_of_injective _ <| (app_injective_iff_stalkFunctor_map_injective f.1).mpr (fun c => (@ConcreteCategory.mono_iff_injective_of_preservesPullback _ _ _ _ _ (f.1.app (op c))).mp ((NatTrans.mono_iff_mono_app _ f.1).mp (CategoryTheory.presheaf_mono_of_mono ..) <| op c)) x⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_preserves_mono TopCat.Presheaf.stalkFunctor_preserves_mono theorem stalk_mono_of_mono {F G : Sheaf C X} (f : F ⟶ G) [Mono f] : ∀ x, Mono <| (stalkFunctor C x).map f.1 := fun x => Functor.map_mono (Sheaf.forget.{v} C X ⋙ stalkFunctor C x) f set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_mono_of_mono TopCat.Presheaf.stalk_mono_of_mono theorem mono_of_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) [∀ x, Mono <| (stalkFunctor C x).map f.1] : Mono f := (Sheaf.Hom.mono_iff_presheaf_mono _ _ _).mpr <| (NatTrans.mono_iff_mono_app _ _).mpr fun U => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mpr <| app_injective_of_stalkFunctor_map_injective f.1 U.unop fun ⟨_x, _hx⟩ => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mp <| inferInstance set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_of_stalk_mono TopCat.Presheaf.mono_of_stalk_mono theorem mono_iff_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) : Mono f ↔ ∀ x, Mono ((stalkFunctor C x).map f.1) := ⟨fun _ => stalk_mono_of_mono _, fun _ => mono_of_stalk_mono _⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_iff_stalk_mono TopCat.Presheaf.mono_iff_stalk_mono /-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by
intro t
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by
Mathlib.Topology.Sheaves.Stalks.530_0.hsVUPKIHRY0xmFk
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U))
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝⁶ : Category.{v, u} C inst✝⁵ : HasColimits C X Y Z : TopCat inst✝⁴ : ConcreteCategory C inst✝³ : PreservesFilteredColimits (forget C) inst✝² : HasLimits C inst✝¹ : PreservesLimits (forget C) inst✝ : ReflectsIsomorphisms (forget C) F G : Sheaf C X f : F ⟶ G U : Opens ↑X hinj : ∀ (x : ↥U), Function.Injective ⇑((stalkFunctor C ↑x).map f.val) hsurj : ∀ (t : (forget C).obj (G.val.obj (op U))) (x : ↥U), ∃ V, ∃ (_ : ↑x ∈ V), ∃ iVU s, (f.val.app (op V)) s = (G.val.map iVU.op) t t : (forget C).obj (G.val.obj (op U)) ⊢ ∃ a, (f.val.app (op U)) a = t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq convert congr_arg (F.germ ⟨x, hxW⟩) heq using 1 exacts [(F.germ_res_apply iWU₁ ⟨x, hxW⟩ s).symm, (F.germ_res_apply iWU₂ ⟨x, hxW⟩ t).symm] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_injective_of_app_injective TopCat.Presheaf.stalkFunctor_map_injective_of_app_injective variable [HasLimits C] [PreservesLimits (forget C)] [ReflectsIsomorphisms (forget C)] /-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`. apply F.eq_of_locally_eq' V U i₁ · intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, m ⟨x, hxU⟩⟩ · intro x rw [heq, Subsingleton.elim (i₁ x) (i₂ x)] set_option linter.uppercaseLean3 false in #align Top.presheaf.section_ext TopCat.Presheaf.section_ext /- Note that the analogous statement for surjectivity is false: Surjectivity on stalks does not imply surjectivity of the components of a sheaf morphism. However it does imply that the morphism is an epi, but this fact is not yet formalized. -/ theorem app_injective_of_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) (U : Opens X) (h : ∀ x : U, Function.Injective ((stalkFunctor C x.val).map f)) : Function.Injective (f.app (op U)) := fun s t hst => section_ext F _ _ _ fun x => h x <| by erw [stalkFunctor_map_germ_apply, stalkFunctor_map_germ_apply, hst] set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_of_stalk_functor_map_injective TopCat.Presheaf.app_injective_of_stalkFunctor_map_injective theorem app_injective_iff_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) : (∀ x : X, Function.Injective ((stalkFunctor C x).map f)) ↔ ∀ U : Opens X, Function.Injective (f.app (op U)) := ⟨fun h U => app_injective_of_stalkFunctor_map_injective f U fun x => h x.1, stalkFunctor_map_injective_of_app_injective f⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_iff_stalk_functor_map_injective TopCat.Presheaf.app_injective_iff_stalkFunctor_map_injective instance stalkFunctor_preserves_mono (x : X) : Functor.PreservesMonomorphisms (Sheaf.forget C X ⋙ stalkFunctor C x) := ⟨@fun _𝓐 _𝓑 f _ => ConcreteCategory.mono_of_injective _ <| (app_injective_iff_stalkFunctor_map_injective f.1).mpr (fun c => (@ConcreteCategory.mono_iff_injective_of_preservesPullback _ _ _ _ _ (f.1.app (op c))).mp ((NatTrans.mono_iff_mono_app _ f.1).mp (CategoryTheory.presheaf_mono_of_mono ..) <| op c)) x⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_preserves_mono TopCat.Presheaf.stalkFunctor_preserves_mono theorem stalk_mono_of_mono {F G : Sheaf C X} (f : F ⟶ G) [Mono f] : ∀ x, Mono <| (stalkFunctor C x).map f.1 := fun x => Functor.map_mono (Sheaf.forget.{v} C X ⋙ stalkFunctor C x) f set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_mono_of_mono TopCat.Presheaf.stalk_mono_of_mono theorem mono_of_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) [∀ x, Mono <| (stalkFunctor C x).map f.1] : Mono f := (Sheaf.Hom.mono_iff_presheaf_mono _ _ _).mpr <| (NatTrans.mono_iff_mono_app _ _).mpr fun U => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mpr <| app_injective_of_stalkFunctor_map_injective f.1 U.unop fun ⟨_x, _hx⟩ => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mp <| inferInstance set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_of_stalk_mono TopCat.Presheaf.mono_of_stalk_mono theorem mono_iff_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) : Mono f ↔ ∀ x, Mono ((stalkFunctor C x).map f.1) := ⟨fun _ => stalk_mono_of_mono _, fun _ => mono_of_stalk_mono _⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_iff_stalk_mono TopCat.Presheaf.mono_iff_stalk_mono /-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by intro t -- We use the axiom of choice to pick around each point `x` an open neighborhood `V` and a -- preimage under `f` on `V`.
choose V mV iVU sf heq using hsurj t
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by intro t -- We use the axiom of choice to pick around each point `x` an open neighborhood `V` and a -- preimage under `f` on `V`.
Mathlib.Topology.Sheaves.Stalks.530_0.hsVUPKIHRY0xmFk
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U))
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝⁶ : Category.{v, u} C inst✝⁵ : HasColimits C X Y Z : TopCat inst✝⁴ : ConcreteCategory C inst✝³ : PreservesFilteredColimits (forget C) inst✝² : HasLimits C inst✝¹ : PreservesLimits (forget C) inst✝ : ReflectsIsomorphisms (forget C) F G : Sheaf C X f : F ⟶ G U : Opens ↑X hinj : ∀ (x : ↥U), Function.Injective ⇑((stalkFunctor C ↑x).map f.val) hsurj : ∀ (t : (forget C).obj (G.val.obj (op U))) (x : ↥U), ∃ V, ∃ (_ : ↑x ∈ V), ∃ iVU s, (f.val.app (op V)) s = (G.val.map iVU.op) t t : (forget C).obj (G.val.obj (op U)) V : ↥U → Opens ↑X mV : ∀ (x : ↥U), ↑x ∈ V x iVU : (x : ↥U) → V x ⟶ U sf : (x : ↥U) → (forget C).obj (F.val.obj (op (V x))) heq : ∀ (x : ↥U), (f.val.app (op (V x))) (sf x) = (G.val.map (iVU x).op) t ⊢ ∃ a, (f.val.app (op U)) a = t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq convert congr_arg (F.germ ⟨x, hxW⟩) heq using 1 exacts [(F.germ_res_apply iWU₁ ⟨x, hxW⟩ s).symm, (F.germ_res_apply iWU₂ ⟨x, hxW⟩ t).symm] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_injective_of_app_injective TopCat.Presheaf.stalkFunctor_map_injective_of_app_injective variable [HasLimits C] [PreservesLimits (forget C)] [ReflectsIsomorphisms (forget C)] /-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`. apply F.eq_of_locally_eq' V U i₁ · intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, m ⟨x, hxU⟩⟩ · intro x rw [heq, Subsingleton.elim (i₁ x) (i₂ x)] set_option linter.uppercaseLean3 false in #align Top.presheaf.section_ext TopCat.Presheaf.section_ext /- Note that the analogous statement for surjectivity is false: Surjectivity on stalks does not imply surjectivity of the components of a sheaf morphism. However it does imply that the morphism is an epi, but this fact is not yet formalized. -/ theorem app_injective_of_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) (U : Opens X) (h : ∀ x : U, Function.Injective ((stalkFunctor C x.val).map f)) : Function.Injective (f.app (op U)) := fun s t hst => section_ext F _ _ _ fun x => h x <| by erw [stalkFunctor_map_germ_apply, stalkFunctor_map_germ_apply, hst] set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_of_stalk_functor_map_injective TopCat.Presheaf.app_injective_of_stalkFunctor_map_injective theorem app_injective_iff_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) : (∀ x : X, Function.Injective ((stalkFunctor C x).map f)) ↔ ∀ U : Opens X, Function.Injective (f.app (op U)) := ⟨fun h U => app_injective_of_stalkFunctor_map_injective f U fun x => h x.1, stalkFunctor_map_injective_of_app_injective f⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_iff_stalk_functor_map_injective TopCat.Presheaf.app_injective_iff_stalkFunctor_map_injective instance stalkFunctor_preserves_mono (x : X) : Functor.PreservesMonomorphisms (Sheaf.forget C X ⋙ stalkFunctor C x) := ⟨@fun _𝓐 _𝓑 f _ => ConcreteCategory.mono_of_injective _ <| (app_injective_iff_stalkFunctor_map_injective f.1).mpr (fun c => (@ConcreteCategory.mono_iff_injective_of_preservesPullback _ _ _ _ _ (f.1.app (op c))).mp ((NatTrans.mono_iff_mono_app _ f.1).mp (CategoryTheory.presheaf_mono_of_mono ..) <| op c)) x⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_preserves_mono TopCat.Presheaf.stalkFunctor_preserves_mono theorem stalk_mono_of_mono {F G : Sheaf C X} (f : F ⟶ G) [Mono f] : ∀ x, Mono <| (stalkFunctor C x).map f.1 := fun x => Functor.map_mono (Sheaf.forget.{v} C X ⋙ stalkFunctor C x) f set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_mono_of_mono TopCat.Presheaf.stalk_mono_of_mono theorem mono_of_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) [∀ x, Mono <| (stalkFunctor C x).map f.1] : Mono f := (Sheaf.Hom.mono_iff_presheaf_mono _ _ _).mpr <| (NatTrans.mono_iff_mono_app _ _).mpr fun U => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mpr <| app_injective_of_stalkFunctor_map_injective f.1 U.unop fun ⟨_x, _hx⟩ => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mp <| inferInstance set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_of_stalk_mono TopCat.Presheaf.mono_of_stalk_mono theorem mono_iff_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) : Mono f ↔ ∀ x, Mono ((stalkFunctor C x).map f.1) := ⟨fun _ => stalk_mono_of_mono _, fun _ => mono_of_stalk_mono _⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_iff_stalk_mono TopCat.Presheaf.mono_iff_stalk_mono /-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by intro t -- We use the axiom of choice to pick around each point `x` an open neighborhood `V` and a -- preimage under `f` on `V`. choose V mV iVU sf heq using hsurj t -- These neighborhoods clearly cover all of `U`.
have V_cover : U ≤ iSup V := by intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, mV ⟨x, hxU⟩⟩
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by intro t -- We use the axiom of choice to pick around each point `x` an open neighborhood `V` and a -- preimage under `f` on `V`. choose V mV iVU sf heq using hsurj t -- These neighborhoods clearly cover all of `U`.
Mathlib.Topology.Sheaves.Stalks.530_0.hsVUPKIHRY0xmFk
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U))
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝⁶ : Category.{v, u} C inst✝⁵ : HasColimits C X Y Z : TopCat inst✝⁴ : ConcreteCategory C inst✝³ : PreservesFilteredColimits (forget C) inst✝² : HasLimits C inst✝¹ : PreservesLimits (forget C) inst✝ : ReflectsIsomorphisms (forget C) F G : Sheaf C X f : F ⟶ G U : Opens ↑X hinj : ∀ (x : ↥U), Function.Injective ⇑((stalkFunctor C ↑x).map f.val) hsurj : ∀ (t : (forget C).obj (G.val.obj (op U))) (x : ↥U), ∃ V, ∃ (_ : ↑x ∈ V), ∃ iVU s, (f.val.app (op V)) s = (G.val.map iVU.op) t t : (forget C).obj (G.val.obj (op U)) V : ↥U → Opens ↑X mV : ∀ (x : ↥U), ↑x ∈ V x iVU : (x : ↥U) → V x ⟶ U sf : (x : ↥U) → (forget C).obj (F.val.obj (op (V x))) heq : ∀ (x : ↥U), (f.val.app (op (V x))) (sf x) = (G.val.map (iVU x).op) t ⊢ U ≤ iSup V
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq convert congr_arg (F.germ ⟨x, hxW⟩) heq using 1 exacts [(F.germ_res_apply iWU₁ ⟨x, hxW⟩ s).symm, (F.germ_res_apply iWU₂ ⟨x, hxW⟩ t).symm] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_injective_of_app_injective TopCat.Presheaf.stalkFunctor_map_injective_of_app_injective variable [HasLimits C] [PreservesLimits (forget C)] [ReflectsIsomorphisms (forget C)] /-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`. apply F.eq_of_locally_eq' V U i₁ · intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, m ⟨x, hxU⟩⟩ · intro x rw [heq, Subsingleton.elim (i₁ x) (i₂ x)] set_option linter.uppercaseLean3 false in #align Top.presheaf.section_ext TopCat.Presheaf.section_ext /- Note that the analogous statement for surjectivity is false: Surjectivity on stalks does not imply surjectivity of the components of a sheaf morphism. However it does imply that the morphism is an epi, but this fact is not yet formalized. -/ theorem app_injective_of_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) (U : Opens X) (h : ∀ x : U, Function.Injective ((stalkFunctor C x.val).map f)) : Function.Injective (f.app (op U)) := fun s t hst => section_ext F _ _ _ fun x => h x <| by erw [stalkFunctor_map_germ_apply, stalkFunctor_map_germ_apply, hst] set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_of_stalk_functor_map_injective TopCat.Presheaf.app_injective_of_stalkFunctor_map_injective theorem app_injective_iff_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) : (∀ x : X, Function.Injective ((stalkFunctor C x).map f)) ↔ ∀ U : Opens X, Function.Injective (f.app (op U)) := ⟨fun h U => app_injective_of_stalkFunctor_map_injective f U fun x => h x.1, stalkFunctor_map_injective_of_app_injective f⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_iff_stalk_functor_map_injective TopCat.Presheaf.app_injective_iff_stalkFunctor_map_injective instance stalkFunctor_preserves_mono (x : X) : Functor.PreservesMonomorphisms (Sheaf.forget C X ⋙ stalkFunctor C x) := ⟨@fun _𝓐 _𝓑 f _ => ConcreteCategory.mono_of_injective _ <| (app_injective_iff_stalkFunctor_map_injective f.1).mpr (fun c => (@ConcreteCategory.mono_iff_injective_of_preservesPullback _ _ _ _ _ (f.1.app (op c))).mp ((NatTrans.mono_iff_mono_app _ f.1).mp (CategoryTheory.presheaf_mono_of_mono ..) <| op c)) x⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_preserves_mono TopCat.Presheaf.stalkFunctor_preserves_mono theorem stalk_mono_of_mono {F G : Sheaf C X} (f : F ⟶ G) [Mono f] : ∀ x, Mono <| (stalkFunctor C x).map f.1 := fun x => Functor.map_mono (Sheaf.forget.{v} C X ⋙ stalkFunctor C x) f set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_mono_of_mono TopCat.Presheaf.stalk_mono_of_mono theorem mono_of_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) [∀ x, Mono <| (stalkFunctor C x).map f.1] : Mono f := (Sheaf.Hom.mono_iff_presheaf_mono _ _ _).mpr <| (NatTrans.mono_iff_mono_app _ _).mpr fun U => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mpr <| app_injective_of_stalkFunctor_map_injective f.1 U.unop fun ⟨_x, _hx⟩ => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mp <| inferInstance set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_of_stalk_mono TopCat.Presheaf.mono_of_stalk_mono theorem mono_iff_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) : Mono f ↔ ∀ x, Mono ((stalkFunctor C x).map f.1) := ⟨fun _ => stalk_mono_of_mono _, fun _ => mono_of_stalk_mono _⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_iff_stalk_mono TopCat.Presheaf.mono_iff_stalk_mono /-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by intro t -- We use the axiom of choice to pick around each point `x` an open neighborhood `V` and a -- preimage under `f` on `V`. choose V mV iVU sf heq using hsurj t -- These neighborhoods clearly cover all of `U`. have V_cover : U ≤ iSup V := by
intro x hxU
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by intro t -- We use the axiom of choice to pick around each point `x` an open neighborhood `V` and a -- preimage under `f` on `V`. choose V mV iVU sf heq using hsurj t -- These neighborhoods clearly cover all of `U`. have V_cover : U ≤ iSup V := by
Mathlib.Topology.Sheaves.Stalks.530_0.hsVUPKIHRY0xmFk
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U))
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝⁶ : Category.{v, u} C inst✝⁵ : HasColimits C X Y Z : TopCat inst✝⁴ : ConcreteCategory C inst✝³ : PreservesFilteredColimits (forget C) inst✝² : HasLimits C inst✝¹ : PreservesLimits (forget C) inst✝ : ReflectsIsomorphisms (forget C) F G : Sheaf C X f : F ⟶ G U : Opens ↑X hinj : ∀ (x : ↥U), Function.Injective ⇑((stalkFunctor C ↑x).map f.val) hsurj : ∀ (t : (forget C).obj (G.val.obj (op U))) (x : ↥U), ∃ V, ∃ (_ : ↑x ∈ V), ∃ iVU s, (f.val.app (op V)) s = (G.val.map iVU.op) t t : (forget C).obj (G.val.obj (op U)) V : ↥U → Opens ↑X mV : ∀ (x : ↥U), ↑x ∈ V x iVU : (x : ↥U) → V x ⟶ U sf : (x : ↥U) → (forget C).obj (F.val.obj (op (V x))) heq : ∀ (x : ↥U), (f.val.app (op (V x))) (sf x) = (G.val.map (iVU x).op) t x : ↑X hxU : x ∈ ↑U ⊢ x ∈ ↑(iSup V)
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq convert congr_arg (F.germ ⟨x, hxW⟩) heq using 1 exacts [(F.germ_res_apply iWU₁ ⟨x, hxW⟩ s).symm, (F.germ_res_apply iWU₂ ⟨x, hxW⟩ t).symm] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_injective_of_app_injective TopCat.Presheaf.stalkFunctor_map_injective_of_app_injective variable [HasLimits C] [PreservesLimits (forget C)] [ReflectsIsomorphisms (forget C)] /-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`. apply F.eq_of_locally_eq' V U i₁ · intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, m ⟨x, hxU⟩⟩ · intro x rw [heq, Subsingleton.elim (i₁ x) (i₂ x)] set_option linter.uppercaseLean3 false in #align Top.presheaf.section_ext TopCat.Presheaf.section_ext /- Note that the analogous statement for surjectivity is false: Surjectivity on stalks does not imply surjectivity of the components of a sheaf morphism. However it does imply that the morphism is an epi, but this fact is not yet formalized. -/ theorem app_injective_of_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) (U : Opens X) (h : ∀ x : U, Function.Injective ((stalkFunctor C x.val).map f)) : Function.Injective (f.app (op U)) := fun s t hst => section_ext F _ _ _ fun x => h x <| by erw [stalkFunctor_map_germ_apply, stalkFunctor_map_germ_apply, hst] set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_of_stalk_functor_map_injective TopCat.Presheaf.app_injective_of_stalkFunctor_map_injective theorem app_injective_iff_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) : (∀ x : X, Function.Injective ((stalkFunctor C x).map f)) ↔ ∀ U : Opens X, Function.Injective (f.app (op U)) := ⟨fun h U => app_injective_of_stalkFunctor_map_injective f U fun x => h x.1, stalkFunctor_map_injective_of_app_injective f⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_iff_stalk_functor_map_injective TopCat.Presheaf.app_injective_iff_stalkFunctor_map_injective instance stalkFunctor_preserves_mono (x : X) : Functor.PreservesMonomorphisms (Sheaf.forget C X ⋙ stalkFunctor C x) := ⟨@fun _𝓐 _𝓑 f _ => ConcreteCategory.mono_of_injective _ <| (app_injective_iff_stalkFunctor_map_injective f.1).mpr (fun c => (@ConcreteCategory.mono_iff_injective_of_preservesPullback _ _ _ _ _ (f.1.app (op c))).mp ((NatTrans.mono_iff_mono_app _ f.1).mp (CategoryTheory.presheaf_mono_of_mono ..) <| op c)) x⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_preserves_mono TopCat.Presheaf.stalkFunctor_preserves_mono theorem stalk_mono_of_mono {F G : Sheaf C X} (f : F ⟶ G) [Mono f] : ∀ x, Mono <| (stalkFunctor C x).map f.1 := fun x => Functor.map_mono (Sheaf.forget.{v} C X ⋙ stalkFunctor C x) f set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_mono_of_mono TopCat.Presheaf.stalk_mono_of_mono theorem mono_of_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) [∀ x, Mono <| (stalkFunctor C x).map f.1] : Mono f := (Sheaf.Hom.mono_iff_presheaf_mono _ _ _).mpr <| (NatTrans.mono_iff_mono_app _ _).mpr fun U => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mpr <| app_injective_of_stalkFunctor_map_injective f.1 U.unop fun ⟨_x, _hx⟩ => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mp <| inferInstance set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_of_stalk_mono TopCat.Presheaf.mono_of_stalk_mono theorem mono_iff_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) : Mono f ↔ ∀ x, Mono ((stalkFunctor C x).map f.1) := ⟨fun _ => stalk_mono_of_mono _, fun _ => mono_of_stalk_mono _⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_iff_stalk_mono TopCat.Presheaf.mono_iff_stalk_mono /-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by intro t -- We use the axiom of choice to pick around each point `x` an open neighborhood `V` and a -- preimage under `f` on `V`. choose V mV iVU sf heq using hsurj t -- These neighborhoods clearly cover all of `U`. have V_cover : U ≤ iSup V := by intro x hxU
simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe]
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by intro t -- We use the axiom of choice to pick around each point `x` an open neighborhood `V` and a -- preimage under `f` on `V`. choose V mV iVU sf heq using hsurj t -- These neighborhoods clearly cover all of `U`. have V_cover : U ≤ iSup V := by intro x hxU
Mathlib.Topology.Sheaves.Stalks.530_0.hsVUPKIHRY0xmFk
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U))
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝⁶ : Category.{v, u} C inst✝⁵ : HasColimits C X Y Z : TopCat inst✝⁴ : ConcreteCategory C inst✝³ : PreservesFilteredColimits (forget C) inst✝² : HasLimits C inst✝¹ : PreservesLimits (forget C) inst✝ : ReflectsIsomorphisms (forget C) F G : Sheaf C X f : F ⟶ G U : Opens ↑X hinj : ∀ (x : ↥U), Function.Injective ⇑((stalkFunctor C ↑x).map f.val) hsurj : ∀ (t : (forget C).obj (G.val.obj (op U))) (x : ↥U), ∃ V, ∃ (_ : ↑x ∈ V), ∃ iVU s, (f.val.app (op V)) s = (G.val.map iVU.op) t t : (forget C).obj (G.val.obj (op U)) V : ↥U → Opens ↑X mV : ∀ (x : ↥U), ↑x ∈ V x iVU : (x : ↥U) → V x ⟶ U sf : (x : ↥U) → (forget C).obj (F.val.obj (op (V x))) heq : ∀ (x : ↥U), (f.val.app (op (V x))) (sf x) = (G.val.map (iVU x).op) t x : ↑X hxU : x ∈ ↑U ⊢ ∃ i, x ∈ V i
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq convert congr_arg (F.germ ⟨x, hxW⟩) heq using 1 exacts [(F.germ_res_apply iWU₁ ⟨x, hxW⟩ s).symm, (F.germ_res_apply iWU₂ ⟨x, hxW⟩ t).symm] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_injective_of_app_injective TopCat.Presheaf.stalkFunctor_map_injective_of_app_injective variable [HasLimits C] [PreservesLimits (forget C)] [ReflectsIsomorphisms (forget C)] /-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`. apply F.eq_of_locally_eq' V U i₁ · intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, m ⟨x, hxU⟩⟩ · intro x rw [heq, Subsingleton.elim (i₁ x) (i₂ x)] set_option linter.uppercaseLean3 false in #align Top.presheaf.section_ext TopCat.Presheaf.section_ext /- Note that the analogous statement for surjectivity is false: Surjectivity on stalks does not imply surjectivity of the components of a sheaf morphism. However it does imply that the morphism is an epi, but this fact is not yet formalized. -/ theorem app_injective_of_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) (U : Opens X) (h : ∀ x : U, Function.Injective ((stalkFunctor C x.val).map f)) : Function.Injective (f.app (op U)) := fun s t hst => section_ext F _ _ _ fun x => h x <| by erw [stalkFunctor_map_germ_apply, stalkFunctor_map_germ_apply, hst] set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_of_stalk_functor_map_injective TopCat.Presheaf.app_injective_of_stalkFunctor_map_injective theorem app_injective_iff_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) : (∀ x : X, Function.Injective ((stalkFunctor C x).map f)) ↔ ∀ U : Opens X, Function.Injective (f.app (op U)) := ⟨fun h U => app_injective_of_stalkFunctor_map_injective f U fun x => h x.1, stalkFunctor_map_injective_of_app_injective f⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_iff_stalk_functor_map_injective TopCat.Presheaf.app_injective_iff_stalkFunctor_map_injective instance stalkFunctor_preserves_mono (x : X) : Functor.PreservesMonomorphisms (Sheaf.forget C X ⋙ stalkFunctor C x) := ⟨@fun _𝓐 _𝓑 f _ => ConcreteCategory.mono_of_injective _ <| (app_injective_iff_stalkFunctor_map_injective f.1).mpr (fun c => (@ConcreteCategory.mono_iff_injective_of_preservesPullback _ _ _ _ _ (f.1.app (op c))).mp ((NatTrans.mono_iff_mono_app _ f.1).mp (CategoryTheory.presheaf_mono_of_mono ..) <| op c)) x⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_preserves_mono TopCat.Presheaf.stalkFunctor_preserves_mono theorem stalk_mono_of_mono {F G : Sheaf C X} (f : F ⟶ G) [Mono f] : ∀ x, Mono <| (stalkFunctor C x).map f.1 := fun x => Functor.map_mono (Sheaf.forget.{v} C X ⋙ stalkFunctor C x) f set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_mono_of_mono TopCat.Presheaf.stalk_mono_of_mono theorem mono_of_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) [∀ x, Mono <| (stalkFunctor C x).map f.1] : Mono f := (Sheaf.Hom.mono_iff_presheaf_mono _ _ _).mpr <| (NatTrans.mono_iff_mono_app _ _).mpr fun U => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mpr <| app_injective_of_stalkFunctor_map_injective f.1 U.unop fun ⟨_x, _hx⟩ => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mp <| inferInstance set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_of_stalk_mono TopCat.Presheaf.mono_of_stalk_mono theorem mono_iff_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) : Mono f ↔ ∀ x, Mono ((stalkFunctor C x).map f.1) := ⟨fun _ => stalk_mono_of_mono _, fun _ => mono_of_stalk_mono _⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_iff_stalk_mono TopCat.Presheaf.mono_iff_stalk_mono /-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by intro t -- We use the axiom of choice to pick around each point `x` an open neighborhood `V` and a -- preimage under `f` on `V`. choose V mV iVU sf heq using hsurj t -- These neighborhoods clearly cover all of `U`. have V_cover : U ≤ iSup V := by intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe]
exact ⟨⟨x, hxU⟩, mV ⟨x, hxU⟩⟩
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by intro t -- We use the axiom of choice to pick around each point `x` an open neighborhood `V` and a -- preimage under `f` on `V`. choose V mV iVU sf heq using hsurj t -- These neighborhoods clearly cover all of `U`. have V_cover : U ≤ iSup V := by intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe]
Mathlib.Topology.Sheaves.Stalks.530_0.hsVUPKIHRY0xmFk
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U))
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝⁶ : Category.{v, u} C inst✝⁵ : HasColimits C X Y Z : TopCat inst✝⁴ : ConcreteCategory C inst✝³ : PreservesFilteredColimits (forget C) inst✝² : HasLimits C inst✝¹ : PreservesLimits (forget C) inst✝ : ReflectsIsomorphisms (forget C) F G : Sheaf C X f : F ⟶ G U : Opens ↑X hinj : ∀ (x : ↥U), Function.Injective ⇑((stalkFunctor C ↑x).map f.val) hsurj : ∀ (t : (forget C).obj (G.val.obj (op U))) (x : ↥U), ∃ V, ∃ (_ : ↑x ∈ V), ∃ iVU s, (f.val.app (op V)) s = (G.val.map iVU.op) t t : (forget C).obj (G.val.obj (op U)) V : ↥U → Opens ↑X mV : ∀ (x : ↥U), ↑x ∈ V x iVU : (x : ↥U) → V x ⟶ U sf : (x : ↥U) → (forget C).obj (F.val.obj (op (V x))) heq : ∀ (x : ↥U), (f.val.app (op (V x))) (sf x) = (G.val.map (iVU x).op) t V_cover : U ≤ iSup V ⊢ ∃ a, (f.val.app (op U)) a = t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq convert congr_arg (F.germ ⟨x, hxW⟩) heq using 1 exacts [(F.germ_res_apply iWU₁ ⟨x, hxW⟩ s).symm, (F.germ_res_apply iWU₂ ⟨x, hxW⟩ t).symm] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_injective_of_app_injective TopCat.Presheaf.stalkFunctor_map_injective_of_app_injective variable [HasLimits C] [PreservesLimits (forget C)] [ReflectsIsomorphisms (forget C)] /-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`. apply F.eq_of_locally_eq' V U i₁ · intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, m ⟨x, hxU⟩⟩ · intro x rw [heq, Subsingleton.elim (i₁ x) (i₂ x)] set_option linter.uppercaseLean3 false in #align Top.presheaf.section_ext TopCat.Presheaf.section_ext /- Note that the analogous statement for surjectivity is false: Surjectivity on stalks does not imply surjectivity of the components of a sheaf morphism. However it does imply that the morphism is an epi, but this fact is not yet formalized. -/ theorem app_injective_of_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) (U : Opens X) (h : ∀ x : U, Function.Injective ((stalkFunctor C x.val).map f)) : Function.Injective (f.app (op U)) := fun s t hst => section_ext F _ _ _ fun x => h x <| by erw [stalkFunctor_map_germ_apply, stalkFunctor_map_germ_apply, hst] set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_of_stalk_functor_map_injective TopCat.Presheaf.app_injective_of_stalkFunctor_map_injective theorem app_injective_iff_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) : (∀ x : X, Function.Injective ((stalkFunctor C x).map f)) ↔ ∀ U : Opens X, Function.Injective (f.app (op U)) := ⟨fun h U => app_injective_of_stalkFunctor_map_injective f U fun x => h x.1, stalkFunctor_map_injective_of_app_injective f⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_iff_stalk_functor_map_injective TopCat.Presheaf.app_injective_iff_stalkFunctor_map_injective instance stalkFunctor_preserves_mono (x : X) : Functor.PreservesMonomorphisms (Sheaf.forget C X ⋙ stalkFunctor C x) := ⟨@fun _𝓐 _𝓑 f _ => ConcreteCategory.mono_of_injective _ <| (app_injective_iff_stalkFunctor_map_injective f.1).mpr (fun c => (@ConcreteCategory.mono_iff_injective_of_preservesPullback _ _ _ _ _ (f.1.app (op c))).mp ((NatTrans.mono_iff_mono_app _ f.1).mp (CategoryTheory.presheaf_mono_of_mono ..) <| op c)) x⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_preserves_mono TopCat.Presheaf.stalkFunctor_preserves_mono theorem stalk_mono_of_mono {F G : Sheaf C X} (f : F ⟶ G) [Mono f] : ∀ x, Mono <| (stalkFunctor C x).map f.1 := fun x => Functor.map_mono (Sheaf.forget.{v} C X ⋙ stalkFunctor C x) f set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_mono_of_mono TopCat.Presheaf.stalk_mono_of_mono theorem mono_of_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) [∀ x, Mono <| (stalkFunctor C x).map f.1] : Mono f := (Sheaf.Hom.mono_iff_presheaf_mono _ _ _).mpr <| (NatTrans.mono_iff_mono_app _ _).mpr fun U => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mpr <| app_injective_of_stalkFunctor_map_injective f.1 U.unop fun ⟨_x, _hx⟩ => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mp <| inferInstance set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_of_stalk_mono TopCat.Presheaf.mono_of_stalk_mono theorem mono_iff_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) : Mono f ↔ ∀ x, Mono ((stalkFunctor C x).map f.1) := ⟨fun _ => stalk_mono_of_mono _, fun _ => mono_of_stalk_mono _⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_iff_stalk_mono TopCat.Presheaf.mono_iff_stalk_mono /-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by intro t -- We use the axiom of choice to pick around each point `x` an open neighborhood `V` and a -- preimage under `f` on `V`. choose V mV iVU sf heq using hsurj t -- These neighborhoods clearly cover all of `U`. have V_cover : U ≤ iSup V := by intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, mV ⟨x, hxU⟩⟩
suffices IsCompatible F.val V sf by -- Since `F` is a sheaf, we can glue all the local preimages together to get a global preimage. obtain ⟨s, s_spec, -⟩ := F.existsUnique_gluing' V U iVU V_cover sf this · use s apply G.eq_of_locally_eq' V U iVU V_cover intro x rw [← comp_apply, ← f.1.naturality, comp_apply, s_spec, heq]
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by intro t -- We use the axiom of choice to pick around each point `x` an open neighborhood `V` and a -- preimage under `f` on `V`. choose V mV iVU sf heq using hsurj t -- These neighborhoods clearly cover all of `U`. have V_cover : U ≤ iSup V := by intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, mV ⟨x, hxU⟩⟩
Mathlib.Topology.Sheaves.Stalks.530_0.hsVUPKIHRY0xmFk
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U))
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝⁶ : Category.{v, u} C inst✝⁵ : HasColimits C X Y Z : TopCat inst✝⁴ : ConcreteCategory C inst✝³ : PreservesFilteredColimits (forget C) inst✝² : HasLimits C inst✝¹ : PreservesLimits (forget C) inst✝ : ReflectsIsomorphisms (forget C) F G : Sheaf C X f : F ⟶ G U : Opens ↑X hinj : ∀ (x : ↥U), Function.Injective ⇑((stalkFunctor C ↑x).map f.val) hsurj : ∀ (t : (forget C).obj (G.val.obj (op U))) (x : ↥U), ∃ V, ∃ (_ : ↑x ∈ V), ∃ iVU s, (f.val.app (op V)) s = (G.val.map iVU.op) t t : (forget C).obj (G.val.obj (op U)) V : ↥U → Opens ↑X mV : ∀ (x : ↥U), ↑x ∈ V x iVU : (x : ↥U) → V x ⟶ U sf : (x : ↥U) → (forget C).obj (F.val.obj (op (V x))) heq : ∀ (x : ↥U), (f.val.app (op (V x))) (sf x) = (G.val.map (iVU x).op) t V_cover : U ≤ iSup V this : IsCompatible F.val V sf ⊢ ∃ a, (f.val.app (op U)) a = t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq convert congr_arg (F.germ ⟨x, hxW⟩) heq using 1 exacts [(F.germ_res_apply iWU₁ ⟨x, hxW⟩ s).symm, (F.germ_res_apply iWU₂ ⟨x, hxW⟩ t).symm] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_injective_of_app_injective TopCat.Presheaf.stalkFunctor_map_injective_of_app_injective variable [HasLimits C] [PreservesLimits (forget C)] [ReflectsIsomorphisms (forget C)] /-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`. apply F.eq_of_locally_eq' V U i₁ · intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, m ⟨x, hxU⟩⟩ · intro x rw [heq, Subsingleton.elim (i₁ x) (i₂ x)] set_option linter.uppercaseLean3 false in #align Top.presheaf.section_ext TopCat.Presheaf.section_ext /- Note that the analogous statement for surjectivity is false: Surjectivity on stalks does not imply surjectivity of the components of a sheaf morphism. However it does imply that the morphism is an epi, but this fact is not yet formalized. -/ theorem app_injective_of_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) (U : Opens X) (h : ∀ x : U, Function.Injective ((stalkFunctor C x.val).map f)) : Function.Injective (f.app (op U)) := fun s t hst => section_ext F _ _ _ fun x => h x <| by erw [stalkFunctor_map_germ_apply, stalkFunctor_map_germ_apply, hst] set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_of_stalk_functor_map_injective TopCat.Presheaf.app_injective_of_stalkFunctor_map_injective theorem app_injective_iff_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) : (∀ x : X, Function.Injective ((stalkFunctor C x).map f)) ↔ ∀ U : Opens X, Function.Injective (f.app (op U)) := ⟨fun h U => app_injective_of_stalkFunctor_map_injective f U fun x => h x.1, stalkFunctor_map_injective_of_app_injective f⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_iff_stalk_functor_map_injective TopCat.Presheaf.app_injective_iff_stalkFunctor_map_injective instance stalkFunctor_preserves_mono (x : X) : Functor.PreservesMonomorphisms (Sheaf.forget C X ⋙ stalkFunctor C x) := ⟨@fun _𝓐 _𝓑 f _ => ConcreteCategory.mono_of_injective _ <| (app_injective_iff_stalkFunctor_map_injective f.1).mpr (fun c => (@ConcreteCategory.mono_iff_injective_of_preservesPullback _ _ _ _ _ (f.1.app (op c))).mp ((NatTrans.mono_iff_mono_app _ f.1).mp (CategoryTheory.presheaf_mono_of_mono ..) <| op c)) x⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_preserves_mono TopCat.Presheaf.stalkFunctor_preserves_mono theorem stalk_mono_of_mono {F G : Sheaf C X} (f : F ⟶ G) [Mono f] : ∀ x, Mono <| (stalkFunctor C x).map f.1 := fun x => Functor.map_mono (Sheaf.forget.{v} C X ⋙ stalkFunctor C x) f set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_mono_of_mono TopCat.Presheaf.stalk_mono_of_mono theorem mono_of_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) [∀ x, Mono <| (stalkFunctor C x).map f.1] : Mono f := (Sheaf.Hom.mono_iff_presheaf_mono _ _ _).mpr <| (NatTrans.mono_iff_mono_app _ _).mpr fun U => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mpr <| app_injective_of_stalkFunctor_map_injective f.1 U.unop fun ⟨_x, _hx⟩ => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mp <| inferInstance set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_of_stalk_mono TopCat.Presheaf.mono_of_stalk_mono theorem mono_iff_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) : Mono f ↔ ∀ x, Mono ((stalkFunctor C x).map f.1) := ⟨fun _ => stalk_mono_of_mono _, fun _ => mono_of_stalk_mono _⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_iff_stalk_mono TopCat.Presheaf.mono_iff_stalk_mono /-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by intro t -- We use the axiom of choice to pick around each point `x` an open neighborhood `V` and a -- preimage under `f` on `V`. choose V mV iVU sf heq using hsurj t -- These neighborhoods clearly cover all of `U`. have V_cover : U ≤ iSup V := by intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, mV ⟨x, hxU⟩⟩ suffices IsCompatible F.val V sf by -- Since `F` is a sheaf, we can glue all the local preimages together to get a global preimage.
obtain ⟨s, s_spec, -⟩ := F.existsUnique_gluing' V U iVU V_cover sf this
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by intro t -- We use the axiom of choice to pick around each point `x` an open neighborhood `V` and a -- preimage under `f` on `V`. choose V mV iVU sf heq using hsurj t -- These neighborhoods clearly cover all of `U`. have V_cover : U ≤ iSup V := by intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, mV ⟨x, hxU⟩⟩ suffices IsCompatible F.val V sf by -- Since `F` is a sheaf, we can glue all the local preimages together to get a global preimage.
Mathlib.Topology.Sheaves.Stalks.530_0.hsVUPKIHRY0xmFk
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U))
Mathlib_Topology_Sheaves_Stalks
case intro.intro C : Type u inst✝⁶ : Category.{v, u} C inst✝⁵ : HasColimits C X Y Z : TopCat inst✝⁴ : ConcreteCategory C inst✝³ : PreservesFilteredColimits (forget C) inst✝² : HasLimits C inst✝¹ : PreservesLimits (forget C) inst✝ : ReflectsIsomorphisms (forget C) F G : Sheaf C X f : F ⟶ G U : Opens ↑X hinj : ∀ (x : ↥U), Function.Injective ⇑((stalkFunctor C ↑x).map f.val) hsurj : ∀ (t : (forget C).obj (G.val.obj (op U))) (x : ↥U), ∃ V, ∃ (_ : ↑x ∈ V), ∃ iVU s, (f.val.app (op V)) s = (G.val.map iVU.op) t t : (forget C).obj (G.val.obj (op U)) V : ↥U → Opens ↑X mV : ∀ (x : ↥U), ↑x ∈ V x iVU : (x : ↥U) → V x ⟶ U sf : (x : ↥U) → (forget C).obj (F.val.obj (op (V x))) heq : ∀ (x : ↥U), (f.val.app (op (V x))) (sf x) = (G.val.map (iVU x).op) t V_cover : U ≤ iSup V this : IsCompatible F.val V sf s : (forget C).obj (F.val.obj (op U)) s_spec : ∀ (i : ↥U), (F.val.map (iVU i).op) s = sf i ⊢ ∃ a, (f.val.app (op U)) a = t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq convert congr_arg (F.germ ⟨x, hxW⟩) heq using 1 exacts [(F.germ_res_apply iWU₁ ⟨x, hxW⟩ s).symm, (F.germ_res_apply iWU₂ ⟨x, hxW⟩ t).symm] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_injective_of_app_injective TopCat.Presheaf.stalkFunctor_map_injective_of_app_injective variable [HasLimits C] [PreservesLimits (forget C)] [ReflectsIsomorphisms (forget C)] /-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`. apply F.eq_of_locally_eq' V U i₁ · intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, m ⟨x, hxU⟩⟩ · intro x rw [heq, Subsingleton.elim (i₁ x) (i₂ x)] set_option linter.uppercaseLean3 false in #align Top.presheaf.section_ext TopCat.Presheaf.section_ext /- Note that the analogous statement for surjectivity is false: Surjectivity on stalks does not imply surjectivity of the components of a sheaf morphism. However it does imply that the morphism is an epi, but this fact is not yet formalized. -/ theorem app_injective_of_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) (U : Opens X) (h : ∀ x : U, Function.Injective ((stalkFunctor C x.val).map f)) : Function.Injective (f.app (op U)) := fun s t hst => section_ext F _ _ _ fun x => h x <| by erw [stalkFunctor_map_germ_apply, stalkFunctor_map_germ_apply, hst] set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_of_stalk_functor_map_injective TopCat.Presheaf.app_injective_of_stalkFunctor_map_injective theorem app_injective_iff_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) : (∀ x : X, Function.Injective ((stalkFunctor C x).map f)) ↔ ∀ U : Opens X, Function.Injective (f.app (op U)) := ⟨fun h U => app_injective_of_stalkFunctor_map_injective f U fun x => h x.1, stalkFunctor_map_injective_of_app_injective f⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_iff_stalk_functor_map_injective TopCat.Presheaf.app_injective_iff_stalkFunctor_map_injective instance stalkFunctor_preserves_mono (x : X) : Functor.PreservesMonomorphisms (Sheaf.forget C X ⋙ stalkFunctor C x) := ⟨@fun _𝓐 _𝓑 f _ => ConcreteCategory.mono_of_injective _ <| (app_injective_iff_stalkFunctor_map_injective f.1).mpr (fun c => (@ConcreteCategory.mono_iff_injective_of_preservesPullback _ _ _ _ _ (f.1.app (op c))).mp ((NatTrans.mono_iff_mono_app _ f.1).mp (CategoryTheory.presheaf_mono_of_mono ..) <| op c)) x⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_preserves_mono TopCat.Presheaf.stalkFunctor_preserves_mono theorem stalk_mono_of_mono {F G : Sheaf C X} (f : F ⟶ G) [Mono f] : ∀ x, Mono <| (stalkFunctor C x).map f.1 := fun x => Functor.map_mono (Sheaf.forget.{v} C X ⋙ stalkFunctor C x) f set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_mono_of_mono TopCat.Presheaf.stalk_mono_of_mono theorem mono_of_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) [∀ x, Mono <| (stalkFunctor C x).map f.1] : Mono f := (Sheaf.Hom.mono_iff_presheaf_mono _ _ _).mpr <| (NatTrans.mono_iff_mono_app _ _).mpr fun U => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mpr <| app_injective_of_stalkFunctor_map_injective f.1 U.unop fun ⟨_x, _hx⟩ => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mp <| inferInstance set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_of_stalk_mono TopCat.Presheaf.mono_of_stalk_mono theorem mono_iff_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) : Mono f ↔ ∀ x, Mono ((stalkFunctor C x).map f.1) := ⟨fun _ => stalk_mono_of_mono _, fun _ => mono_of_stalk_mono _⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_iff_stalk_mono TopCat.Presheaf.mono_iff_stalk_mono /-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by intro t -- We use the axiom of choice to pick around each point `x` an open neighborhood `V` and a -- preimage under `f` on `V`. choose V mV iVU sf heq using hsurj t -- These neighborhoods clearly cover all of `U`. have V_cover : U ≤ iSup V := by intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, mV ⟨x, hxU⟩⟩ suffices IsCompatible F.val V sf by -- Since `F` is a sheaf, we can glue all the local preimages together to get a global preimage. obtain ⟨s, s_spec, -⟩ := F.existsUnique_gluing' V U iVU V_cover sf this ·
use s
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by intro t -- We use the axiom of choice to pick around each point `x` an open neighborhood `V` and a -- preimage under `f` on `V`. choose V mV iVU sf heq using hsurj t -- These neighborhoods clearly cover all of `U`. have V_cover : U ≤ iSup V := by intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, mV ⟨x, hxU⟩⟩ suffices IsCompatible F.val V sf by -- Since `F` is a sheaf, we can glue all the local preimages together to get a global preimage. obtain ⟨s, s_spec, -⟩ := F.existsUnique_gluing' V U iVU V_cover sf this ·
Mathlib.Topology.Sheaves.Stalks.530_0.hsVUPKIHRY0xmFk
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U))
Mathlib_Topology_Sheaves_Stalks
case h C : Type u inst✝⁶ : Category.{v, u} C inst✝⁵ : HasColimits C X Y Z : TopCat inst✝⁴ : ConcreteCategory C inst✝³ : PreservesFilteredColimits (forget C) inst✝² : HasLimits C inst✝¹ : PreservesLimits (forget C) inst✝ : ReflectsIsomorphisms (forget C) F G : Sheaf C X f : F ⟶ G U : Opens ↑X hinj : ∀ (x : ↥U), Function.Injective ⇑((stalkFunctor C ↑x).map f.val) hsurj : ∀ (t : (forget C).obj (G.val.obj (op U))) (x : ↥U), ∃ V, ∃ (_ : ↑x ∈ V), ∃ iVU s, (f.val.app (op V)) s = (G.val.map iVU.op) t t : (forget C).obj (G.val.obj (op U)) V : ↥U → Opens ↑X mV : ∀ (x : ↥U), ↑x ∈ V x iVU : (x : ↥U) → V x ⟶ U sf : (x : ↥U) → (forget C).obj (F.val.obj (op (V x))) heq : ∀ (x : ↥U), (f.val.app (op (V x))) (sf x) = (G.val.map (iVU x).op) t V_cover : U ≤ iSup V this : IsCompatible F.val V sf s : (forget C).obj (F.val.obj (op U)) s_spec : ∀ (i : ↥U), (F.val.map (iVU i).op) s = sf i ⊢ (f.val.app (op U)) s = t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq convert congr_arg (F.germ ⟨x, hxW⟩) heq using 1 exacts [(F.germ_res_apply iWU₁ ⟨x, hxW⟩ s).symm, (F.germ_res_apply iWU₂ ⟨x, hxW⟩ t).symm] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_injective_of_app_injective TopCat.Presheaf.stalkFunctor_map_injective_of_app_injective variable [HasLimits C] [PreservesLimits (forget C)] [ReflectsIsomorphisms (forget C)] /-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`. apply F.eq_of_locally_eq' V U i₁ · intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, m ⟨x, hxU⟩⟩ · intro x rw [heq, Subsingleton.elim (i₁ x) (i₂ x)] set_option linter.uppercaseLean3 false in #align Top.presheaf.section_ext TopCat.Presheaf.section_ext /- Note that the analogous statement for surjectivity is false: Surjectivity on stalks does not imply surjectivity of the components of a sheaf morphism. However it does imply that the morphism is an epi, but this fact is not yet formalized. -/ theorem app_injective_of_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) (U : Opens X) (h : ∀ x : U, Function.Injective ((stalkFunctor C x.val).map f)) : Function.Injective (f.app (op U)) := fun s t hst => section_ext F _ _ _ fun x => h x <| by erw [stalkFunctor_map_germ_apply, stalkFunctor_map_germ_apply, hst] set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_of_stalk_functor_map_injective TopCat.Presheaf.app_injective_of_stalkFunctor_map_injective theorem app_injective_iff_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) : (∀ x : X, Function.Injective ((stalkFunctor C x).map f)) ↔ ∀ U : Opens X, Function.Injective (f.app (op U)) := ⟨fun h U => app_injective_of_stalkFunctor_map_injective f U fun x => h x.1, stalkFunctor_map_injective_of_app_injective f⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_iff_stalk_functor_map_injective TopCat.Presheaf.app_injective_iff_stalkFunctor_map_injective instance stalkFunctor_preserves_mono (x : X) : Functor.PreservesMonomorphisms (Sheaf.forget C X ⋙ stalkFunctor C x) := ⟨@fun _𝓐 _𝓑 f _ => ConcreteCategory.mono_of_injective _ <| (app_injective_iff_stalkFunctor_map_injective f.1).mpr (fun c => (@ConcreteCategory.mono_iff_injective_of_preservesPullback _ _ _ _ _ (f.1.app (op c))).mp ((NatTrans.mono_iff_mono_app _ f.1).mp (CategoryTheory.presheaf_mono_of_mono ..) <| op c)) x⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_preserves_mono TopCat.Presheaf.stalkFunctor_preserves_mono theorem stalk_mono_of_mono {F G : Sheaf C X} (f : F ⟶ G) [Mono f] : ∀ x, Mono <| (stalkFunctor C x).map f.1 := fun x => Functor.map_mono (Sheaf.forget.{v} C X ⋙ stalkFunctor C x) f set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_mono_of_mono TopCat.Presheaf.stalk_mono_of_mono theorem mono_of_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) [∀ x, Mono <| (stalkFunctor C x).map f.1] : Mono f := (Sheaf.Hom.mono_iff_presheaf_mono _ _ _).mpr <| (NatTrans.mono_iff_mono_app _ _).mpr fun U => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mpr <| app_injective_of_stalkFunctor_map_injective f.1 U.unop fun ⟨_x, _hx⟩ => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mp <| inferInstance set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_of_stalk_mono TopCat.Presheaf.mono_of_stalk_mono theorem mono_iff_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) : Mono f ↔ ∀ x, Mono ((stalkFunctor C x).map f.1) := ⟨fun _ => stalk_mono_of_mono _, fun _ => mono_of_stalk_mono _⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_iff_stalk_mono TopCat.Presheaf.mono_iff_stalk_mono /-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by intro t -- We use the axiom of choice to pick around each point `x` an open neighborhood `V` and a -- preimage under `f` on `V`. choose V mV iVU sf heq using hsurj t -- These neighborhoods clearly cover all of `U`. have V_cover : U ≤ iSup V := by intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, mV ⟨x, hxU⟩⟩ suffices IsCompatible F.val V sf by -- Since `F` is a sheaf, we can glue all the local preimages together to get a global preimage. obtain ⟨s, s_spec, -⟩ := F.existsUnique_gluing' V U iVU V_cover sf this · use s
apply G.eq_of_locally_eq' V U iVU V_cover
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by intro t -- We use the axiom of choice to pick around each point `x` an open neighborhood `V` and a -- preimage under `f` on `V`. choose V mV iVU sf heq using hsurj t -- These neighborhoods clearly cover all of `U`. have V_cover : U ≤ iSup V := by intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, mV ⟨x, hxU⟩⟩ suffices IsCompatible F.val V sf by -- Since `F` is a sheaf, we can glue all the local preimages together to get a global preimage. obtain ⟨s, s_spec, -⟩ := F.existsUnique_gluing' V U iVU V_cover sf this · use s
Mathlib.Topology.Sheaves.Stalks.530_0.hsVUPKIHRY0xmFk
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U))
Mathlib_Topology_Sheaves_Stalks
case h.h C : Type u inst✝⁶ : Category.{v, u} C inst✝⁵ : HasColimits C X Y Z : TopCat inst✝⁴ : ConcreteCategory C inst✝³ : PreservesFilteredColimits (forget C) inst✝² : HasLimits C inst✝¹ : PreservesLimits (forget C) inst✝ : ReflectsIsomorphisms (forget C) F G : Sheaf C X f : F ⟶ G U : Opens ↑X hinj : ∀ (x : ↥U), Function.Injective ⇑((stalkFunctor C ↑x).map f.val) hsurj : ∀ (t : (forget C).obj (G.val.obj (op U))) (x : ↥U), ∃ V, ∃ (_ : ↑x ∈ V), ∃ iVU s, (f.val.app (op V)) s = (G.val.map iVU.op) t t : (forget C).obj (G.val.obj (op U)) V : ↥U → Opens ↑X mV : ∀ (x : ↥U), ↑x ∈ V x iVU : (x : ↥U) → V x ⟶ U sf : (x : ↥U) → (forget C).obj (F.val.obj (op (V x))) heq : ∀ (x : ↥U), (f.val.app (op (V x))) (sf x) = (G.val.map (iVU x).op) t V_cover : U ≤ iSup V this : IsCompatible F.val V sf s : (forget C).obj (F.val.obj (op U)) s_spec : ∀ (i : ↥U), (F.val.map (iVU i).op) s = sf i ⊢ ∀ (i : ↥U), (G.val.map (iVU i).op) ((f.val.app (op U)) s) = (G.val.map (iVU i).op) t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq convert congr_arg (F.germ ⟨x, hxW⟩) heq using 1 exacts [(F.germ_res_apply iWU₁ ⟨x, hxW⟩ s).symm, (F.germ_res_apply iWU₂ ⟨x, hxW⟩ t).symm] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_injective_of_app_injective TopCat.Presheaf.stalkFunctor_map_injective_of_app_injective variable [HasLimits C] [PreservesLimits (forget C)] [ReflectsIsomorphisms (forget C)] /-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`. apply F.eq_of_locally_eq' V U i₁ · intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, m ⟨x, hxU⟩⟩ · intro x rw [heq, Subsingleton.elim (i₁ x) (i₂ x)] set_option linter.uppercaseLean3 false in #align Top.presheaf.section_ext TopCat.Presheaf.section_ext /- Note that the analogous statement for surjectivity is false: Surjectivity on stalks does not imply surjectivity of the components of a sheaf morphism. However it does imply that the morphism is an epi, but this fact is not yet formalized. -/ theorem app_injective_of_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) (U : Opens X) (h : ∀ x : U, Function.Injective ((stalkFunctor C x.val).map f)) : Function.Injective (f.app (op U)) := fun s t hst => section_ext F _ _ _ fun x => h x <| by erw [stalkFunctor_map_germ_apply, stalkFunctor_map_germ_apply, hst] set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_of_stalk_functor_map_injective TopCat.Presheaf.app_injective_of_stalkFunctor_map_injective theorem app_injective_iff_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) : (∀ x : X, Function.Injective ((stalkFunctor C x).map f)) ↔ ∀ U : Opens X, Function.Injective (f.app (op U)) := ⟨fun h U => app_injective_of_stalkFunctor_map_injective f U fun x => h x.1, stalkFunctor_map_injective_of_app_injective f⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_iff_stalk_functor_map_injective TopCat.Presheaf.app_injective_iff_stalkFunctor_map_injective instance stalkFunctor_preserves_mono (x : X) : Functor.PreservesMonomorphisms (Sheaf.forget C X ⋙ stalkFunctor C x) := ⟨@fun _𝓐 _𝓑 f _ => ConcreteCategory.mono_of_injective _ <| (app_injective_iff_stalkFunctor_map_injective f.1).mpr (fun c => (@ConcreteCategory.mono_iff_injective_of_preservesPullback _ _ _ _ _ (f.1.app (op c))).mp ((NatTrans.mono_iff_mono_app _ f.1).mp (CategoryTheory.presheaf_mono_of_mono ..) <| op c)) x⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_preserves_mono TopCat.Presheaf.stalkFunctor_preserves_mono theorem stalk_mono_of_mono {F G : Sheaf C X} (f : F ⟶ G) [Mono f] : ∀ x, Mono <| (stalkFunctor C x).map f.1 := fun x => Functor.map_mono (Sheaf.forget.{v} C X ⋙ stalkFunctor C x) f set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_mono_of_mono TopCat.Presheaf.stalk_mono_of_mono theorem mono_of_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) [∀ x, Mono <| (stalkFunctor C x).map f.1] : Mono f := (Sheaf.Hom.mono_iff_presheaf_mono _ _ _).mpr <| (NatTrans.mono_iff_mono_app _ _).mpr fun U => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mpr <| app_injective_of_stalkFunctor_map_injective f.1 U.unop fun ⟨_x, _hx⟩ => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mp <| inferInstance set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_of_stalk_mono TopCat.Presheaf.mono_of_stalk_mono theorem mono_iff_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) : Mono f ↔ ∀ x, Mono ((stalkFunctor C x).map f.1) := ⟨fun _ => stalk_mono_of_mono _, fun _ => mono_of_stalk_mono _⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_iff_stalk_mono TopCat.Presheaf.mono_iff_stalk_mono /-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by intro t -- We use the axiom of choice to pick around each point `x` an open neighborhood `V` and a -- preimage under `f` on `V`. choose V mV iVU sf heq using hsurj t -- These neighborhoods clearly cover all of `U`. have V_cover : U ≤ iSup V := by intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, mV ⟨x, hxU⟩⟩ suffices IsCompatible F.val V sf by -- Since `F` is a sheaf, we can glue all the local preimages together to get a global preimage. obtain ⟨s, s_spec, -⟩ := F.existsUnique_gluing' V U iVU V_cover sf this · use s apply G.eq_of_locally_eq' V U iVU V_cover
intro x
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by intro t -- We use the axiom of choice to pick around each point `x` an open neighborhood `V` and a -- preimage under `f` on `V`. choose V mV iVU sf heq using hsurj t -- These neighborhoods clearly cover all of `U`. have V_cover : U ≤ iSup V := by intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, mV ⟨x, hxU⟩⟩ suffices IsCompatible F.val V sf by -- Since `F` is a sheaf, we can glue all the local preimages together to get a global preimage. obtain ⟨s, s_spec, -⟩ := F.existsUnique_gluing' V U iVU V_cover sf this · use s apply G.eq_of_locally_eq' V U iVU V_cover
Mathlib.Topology.Sheaves.Stalks.530_0.hsVUPKIHRY0xmFk
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U))
Mathlib_Topology_Sheaves_Stalks
case h.h C : Type u inst✝⁶ : Category.{v, u} C inst✝⁵ : HasColimits C X Y Z : TopCat inst✝⁴ : ConcreteCategory C inst✝³ : PreservesFilteredColimits (forget C) inst✝² : HasLimits C inst✝¹ : PreservesLimits (forget C) inst✝ : ReflectsIsomorphisms (forget C) F G : Sheaf C X f : F ⟶ G U : Opens ↑X hinj : ∀ (x : ↥U), Function.Injective ⇑((stalkFunctor C ↑x).map f.val) hsurj : ∀ (t : (forget C).obj (G.val.obj (op U))) (x : ↥U), ∃ V, ∃ (_ : ↑x ∈ V), ∃ iVU s, (f.val.app (op V)) s = (G.val.map iVU.op) t t : (forget C).obj (G.val.obj (op U)) V : ↥U → Opens ↑X mV : ∀ (x : ↥U), ↑x ∈ V x iVU : (x : ↥U) → V x ⟶ U sf : (x : ↥U) → (forget C).obj (F.val.obj (op (V x))) heq : ∀ (x : ↥U), (f.val.app (op (V x))) (sf x) = (G.val.map (iVU x).op) t V_cover : U ≤ iSup V this : IsCompatible F.val V sf s : (forget C).obj (F.val.obj (op U)) s_spec : ∀ (i : ↥U), (F.val.map (iVU i).op) s = sf i x : ↥U ⊢ (G.val.map (iVU x).op) ((f.val.app (op U)) s) = (G.val.map (iVU x).op) t
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq convert congr_arg (F.germ ⟨x, hxW⟩) heq using 1 exacts [(F.germ_res_apply iWU₁ ⟨x, hxW⟩ s).symm, (F.germ_res_apply iWU₂ ⟨x, hxW⟩ t).symm] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_injective_of_app_injective TopCat.Presheaf.stalkFunctor_map_injective_of_app_injective variable [HasLimits C] [PreservesLimits (forget C)] [ReflectsIsomorphisms (forget C)] /-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`. apply F.eq_of_locally_eq' V U i₁ · intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, m ⟨x, hxU⟩⟩ · intro x rw [heq, Subsingleton.elim (i₁ x) (i₂ x)] set_option linter.uppercaseLean3 false in #align Top.presheaf.section_ext TopCat.Presheaf.section_ext /- Note that the analogous statement for surjectivity is false: Surjectivity on stalks does not imply surjectivity of the components of a sheaf morphism. However it does imply that the morphism is an epi, but this fact is not yet formalized. -/ theorem app_injective_of_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) (U : Opens X) (h : ∀ x : U, Function.Injective ((stalkFunctor C x.val).map f)) : Function.Injective (f.app (op U)) := fun s t hst => section_ext F _ _ _ fun x => h x <| by erw [stalkFunctor_map_germ_apply, stalkFunctor_map_germ_apply, hst] set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_of_stalk_functor_map_injective TopCat.Presheaf.app_injective_of_stalkFunctor_map_injective theorem app_injective_iff_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) : (∀ x : X, Function.Injective ((stalkFunctor C x).map f)) ↔ ∀ U : Opens X, Function.Injective (f.app (op U)) := ⟨fun h U => app_injective_of_stalkFunctor_map_injective f U fun x => h x.1, stalkFunctor_map_injective_of_app_injective f⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_iff_stalk_functor_map_injective TopCat.Presheaf.app_injective_iff_stalkFunctor_map_injective instance stalkFunctor_preserves_mono (x : X) : Functor.PreservesMonomorphisms (Sheaf.forget C X ⋙ stalkFunctor C x) := ⟨@fun _𝓐 _𝓑 f _ => ConcreteCategory.mono_of_injective _ <| (app_injective_iff_stalkFunctor_map_injective f.1).mpr (fun c => (@ConcreteCategory.mono_iff_injective_of_preservesPullback _ _ _ _ _ (f.1.app (op c))).mp ((NatTrans.mono_iff_mono_app _ f.1).mp (CategoryTheory.presheaf_mono_of_mono ..) <| op c)) x⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_preserves_mono TopCat.Presheaf.stalkFunctor_preserves_mono theorem stalk_mono_of_mono {F G : Sheaf C X} (f : F ⟶ G) [Mono f] : ∀ x, Mono <| (stalkFunctor C x).map f.1 := fun x => Functor.map_mono (Sheaf.forget.{v} C X ⋙ stalkFunctor C x) f set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_mono_of_mono TopCat.Presheaf.stalk_mono_of_mono theorem mono_of_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) [∀ x, Mono <| (stalkFunctor C x).map f.1] : Mono f := (Sheaf.Hom.mono_iff_presheaf_mono _ _ _).mpr <| (NatTrans.mono_iff_mono_app _ _).mpr fun U => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mpr <| app_injective_of_stalkFunctor_map_injective f.1 U.unop fun ⟨_x, _hx⟩ => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mp <| inferInstance set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_of_stalk_mono TopCat.Presheaf.mono_of_stalk_mono theorem mono_iff_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) : Mono f ↔ ∀ x, Mono ((stalkFunctor C x).map f.1) := ⟨fun _ => stalk_mono_of_mono _, fun _ => mono_of_stalk_mono _⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_iff_stalk_mono TopCat.Presheaf.mono_iff_stalk_mono /-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by intro t -- We use the axiom of choice to pick around each point `x` an open neighborhood `V` and a -- preimage under `f` on `V`. choose V mV iVU sf heq using hsurj t -- These neighborhoods clearly cover all of `U`. have V_cover : U ≤ iSup V := by intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, mV ⟨x, hxU⟩⟩ suffices IsCompatible F.val V sf by -- Since `F` is a sheaf, we can glue all the local preimages together to get a global preimage. obtain ⟨s, s_spec, -⟩ := F.existsUnique_gluing' V U iVU V_cover sf this · use s apply G.eq_of_locally_eq' V U iVU V_cover intro x
rw [← comp_apply, ← f.1.naturality, comp_apply, s_spec, heq]
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by intro t -- We use the axiom of choice to pick around each point `x` an open neighborhood `V` and a -- preimage under `f` on `V`. choose V mV iVU sf heq using hsurj t -- These neighborhoods clearly cover all of `U`. have V_cover : U ≤ iSup V := by intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, mV ⟨x, hxU⟩⟩ suffices IsCompatible F.val V sf by -- Since `F` is a sheaf, we can glue all the local preimages together to get a global preimage. obtain ⟨s, s_spec, -⟩ := F.existsUnique_gluing' V U iVU V_cover sf this · use s apply G.eq_of_locally_eq' V U iVU V_cover intro x
Mathlib.Topology.Sheaves.Stalks.530_0.hsVUPKIHRY0xmFk
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U))
Mathlib_Topology_Sheaves_Stalks
C : Type u inst✝⁶ : Category.{v, u} C inst✝⁵ : HasColimits C X Y Z : TopCat inst✝⁴ : ConcreteCategory C inst✝³ : PreservesFilteredColimits (forget C) inst✝² : HasLimits C inst✝¹ : PreservesLimits (forget C) inst✝ : ReflectsIsomorphisms (forget C) F G : Sheaf C X f : F ⟶ G U : Opens ↑X hinj : ∀ (x : ↥U), Function.Injective ⇑((stalkFunctor C ↑x).map f.val) hsurj : ∀ (t : (forget C).obj (G.val.obj (op U))) (x : ↥U), ∃ V, ∃ (_ : ↑x ∈ V), ∃ iVU s, (f.val.app (op V)) s = (G.val.map iVU.op) t t : (forget C).obj (G.val.obj (op U)) V : ↥U → Opens ↑X mV : ∀ (x : ↥U), ↑x ∈ V x iVU : (x : ↥U) → V x ⟶ U sf : (x : ↥U) → (forget C).obj (F.val.obj (op (V x))) heq : ∀ (x : ↥U), (f.val.app (op (V x))) (sf x) = (G.val.map (iVU x).op) t V_cover : U ≤ iSup V ⊢ IsCompatible F.val V sf
/- Copyright (c) 2019 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Justus Springer -/ import Mathlib.Topology.Category.TopCat.OpenNhds import Mathlib.Topology.Sheaves.Presheaf import Mathlib.Topology.Sheaves.SheafCondition.UniqueGluing import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.Limits.Preserves.Filtered import Mathlib.CategoryTheory.Limits.Final import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Algebra.Category.Ring.Colimits import Mathlib.CategoryTheory.Sites.Pullback #align_import topology.sheaves.stalks from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8" /-! # Stalks For a presheaf `F` on a topological space `X`, valued in some category `C`, the *stalk* of `F` at the point `x : X` is defined as the colimit of the composition of the inclusion of categories `(OpenNhds x)ᵒᵖ ⥤ (Opens X)ᵒᵖ` and the functor `F : (Opens X)ᵒᵖ ⥤ C`. For an open neighborhood `U` of `x`, we define the map `F.germ x : F.obj (op U) ⟶ F.stalk x` as the canonical morphism into this colimit. Taking stalks is functorial: For every point `x : X` we define a functor `stalkFunctor C x`, sending presheaves on `X` to objects of `C`. Furthermore, for a map `f : X ⟶ Y` between topological spaces, we define `stalkPushforward` as the induced map on the stalks `(f _* ℱ).stalk (f x) ⟶ ℱ.stalk x`. Some lemmas about stalks and germs only hold for certain classes of concrete categories. A basic property of forgetful functors of categories of algebraic structures (like `MonCat`, `CommRingCat`,...) is that they preserve filtered colimits. Since stalks are filtered colimits, this ensures that the stalks of presheaves valued in these categories behave exactly as for `Type`-valued presheaves. For example, in `germ_exist` we prove that in such a category, every element of the stalk is the germ of a section. Furthermore, if we require the forgetful functor to reflect isomorphisms and preserve limits (as is the case for most algebraic structures), we have access to the unique gluing API and can prove further properties. Most notably, in `is_iso_iff_stalk_functor_map_iso`, we prove that in such a category, a morphism of sheaves is an isomorphism if and only if all of its stalk maps are isomorphisms. See also the definition of "algebraic structures" in the stacks project: https://stacks.math.columbia.edu/tag/007L -/ noncomputable section universe v u v' u' open CategoryTheory open TopCat open CategoryTheory.Limits open TopologicalSpace open Opposite variable {C : Type u} [Category.{v} C] variable [HasColimits.{v} C] variable {X Y Z : TopCat.{v}} namespace TopCat.Presheaf variable (C) /-- Stalks are functorial with respect to morphisms of presheaves over a fixed `X`. -/ def stalkFunctor (x : X) : X.Presheaf C ⥤ C := (whiskeringLeft _ _ C).obj (OpenNhds.inclusion x).op ⋙ colim set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor TopCat.Presheaf.stalkFunctor variable {C} /-- The stalk of a presheaf `F` at a point `x` is calculated as the colimit of the functor nbhds x ⥤ opens F.X ⥤ C -/ def stalk (ℱ : X.Presheaf C) (x : X) : C := (stalkFunctor C x).obj ℱ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk TopCat.Presheaf.stalk -- -- colimit ((open_nhds.inclusion x).op ⋙ ℱ) @[simp] theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x := rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_obj TopCat.Presheaf.stalkFunctor_obj /-- The germ of a section of a presheaf over an open at a point of that open. -/ def germ (F : X.Presheaf C) {U : Opens X} (x : U) : F.obj (op U) ⟶ stalk F x := colimit.ι ((OpenNhds.inclusion x.1).op ⋙ F) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.germ TopCat.Presheaf.germ theorem germ_res (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) : F.map i.op ≫ germ F x = germ F (i x : V) := let i' : (⟨U, x.2⟩ : OpenNhds x.1) ⟶ ⟨V, (i x : V).2⟩ := i colimit.w ((OpenNhds.inclusion x.1).op ⋙ F) i'.op set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res TopCat.Presheaf.germ_res -- Porting note : `@[elementwise]` did not generate the best lemma when applied to `germ_res` theorem germ_res_apply (F : X.Presheaf C) {U V : Opens X} (i : U ⟶ V) (x : U) [ConcreteCategory C] (s) : germ F x (F.map i.op s) = germ F (i x) s := by rw [← comp_apply, germ_res] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_res_apply TopCat.Presheaf.germ_res_apply /-- A morphism from the stalk of `F` at `x` to some object `Y` is completely determined by its composition with the `germ` morphisms. -/ @[ext] theorem stalk_hom_ext (F : X.Presheaf C) {x} {Y : C} {f₁ f₂ : F.stalk x ⟶ Y} (ih : ∀ (U : Opens X) (hxU : x ∈ U), F.germ ⟨x, hxU⟩ ≫ f₁ = F.germ ⟨x, hxU⟩ ≫ f₂) : f₁ = f₂ := colimit.hom_ext fun U => by induction' U using Opposite.rec with U; cases' U with U hxU; exact ih U hxU set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_hom_ext TopCat.Presheaf.stalk_hom_ext @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) : germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x := colimit.ι_map (whiskerLeft (OpenNhds.inclusion x.1).op f) (op ⟨U, x.2⟩) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_germ TopCat.Presheaf.stalkFunctor_map_germ variable (C) /-- For a presheaf `F` on a space `X`, a continuous map `f : X ⟶ Y` induces a morphisms between the stalk of `f _ * F` at `f x` and the stalk of `F` at `x`. -/ def stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) (x : X) : (f _* F).stalk (f x) ⟶ F.stalk x := by -- This is a hack; Lean doesn't like to elaborate the term written directly. -- Porting note: The original proof was `trans; swap`, but `trans` does nothing. refine' ?_ ≫ colimit.pre _ (OpenNhds.map f x).op exact colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) F) set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward TopCat.Presheaf.stalkPushforward @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkPushforward_germ (f : X ⟶ Y) (F : X.Presheaf C) (U : Opens Y) (x : (Opens.map f).obj U) : (f _* F).germ ⟨(f : X → Y) (x : X), x.2⟩ ≫ F.stalkPushforward C f x = F.germ x := by rw [stalkPushforward, germ, colimit.ι_map_assoc, colimit.ι_pre, whiskerRight_app] erw [CategoryTheory.Functor.map_id, Category.id_comp] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward_germ TopCat.Presheaf.stalkPushforward_germ -- Here are two other potential solutions, suggested by @fpvandoorn at -- <https://github.com/leanprover-community/mathlib/pull/1018#discussion_r283978240> -- However, I can't get the subsequent two proofs to work with either one. -- def stalkPushforward'' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- colim.map ((Functor.associator _ _ _).inv ≫ -- whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op -- def stalkPushforward''' (f : X ⟶ Y) (ℱ : X.Presheaf C) (x : X) : -- (f _* ℱ).stalk (f x) ⟶ ℱ.stalk x := -- (colim.map (whiskerRight (NatTrans.op (OpenNhds.inclusionMapIso f x).inv) ℱ) : -- colim.obj ((OpenNhds.inclusion (f x) ⋙ Opens.map f).op ⋙ ℱ) ⟶ _) ≫ -- colimit.pre ((OpenNhds.inclusion x).op ⋙ ℱ) (OpenNhds.map f x).op namespace stalkPushforward @[simp] theorem id (ℱ : X.Presheaf C) (x : X) : ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom := by -- Porting note: We need to this to help ext tactic. change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext1 j induction' j with j rcases j with ⟨⟨_, _⟩, _⟩ erw [colimit.ι_map_assoc] simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.id TopCat.Presheaf.stalkPushforward.id -- This proof is sadly not at all robust: -- having to use `erw` at all is a bad sign. @[simp] theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : ℱ.stalkPushforward C (f ≫ g) x = (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rcases U with ⟨⟨_, _⟩, _⟩ simp [stalkFunctor, stalkPushforward] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.comp TopCat.Presheaf.stalkPushforward.comp theorem stalkPushforward_iso_of_openEmbedding {f : X ⟶ Y} (hf : OpenEmbedding f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by haveI := Functor.initial_of_adjunction (hf.isOpenMap.adjunctionNhds x) convert IsIso.of_iso ((Functor.Final.colimitIso (hf.isOpenMap.functorNhds x).op ((OpenNhds.inclusion (f x)).op ⋙ f _* F) : _).symm ≪≫ colim.mapIso _) swap · fapply NatIso.ofComponents · intro U refine' F.mapIso (eqToIso _) dsimp only [Functor.op] exact congr_arg op (Opens.ext <| Set.preimage_image_eq (unop U).1.1 hf.inj) · intro U V i; erw [← F.map_comp, ← F.map_comp]; congr 1 · change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext U rw [← Iso.comp_inv_eq] erw [colimit.ι_map_assoc] rw [colimit.ι_pre, Category.assoc] erw [colimit.ι_map_assoc, colimit.ι_pre, ← F.map_comp_assoc] apply colimit.w ((OpenNhds.inclusion (f x)).op ⋙ f _* F) _ dsimp only [Functor.op] refine' ((homOfLE _).op : op (unop U) ⟶ _) exact Set.image_preimage_subset _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pushforward.stalk_pushforward_iso_of_open_embedding TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_openEmbedding end stalkPushforward section stalkPullback /-- The morphism `ℱ_{f x} ⟶ (f⁻¹ℱ)ₓ` that factors through `(f_*f⁻¹ℱ)_{f x}`. -/ def stalkPullbackHom (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ⟶ (pullbackObj f F).stalk x := (stalkFunctor _ (f x)).map ((pushforwardPullbackAdjunction C f).unit.app F) ≫ stalkPushforward _ _ _ x set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_hom TopCat.Presheaf.stalkPullbackHom /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) : (pullbackObj f F).obj (op U) ⟶ F.stalk ((f : X → Y) (x : X)) := colimit.desc (Lan.diagram (Opens.map f).op F (op U)) { pt := F.stalk ((f : X → Y) (x : X)) ι := { app := fun V => F.germ ⟨((f : X → Y) (x : X)), V.hom.unop.le x.2⟩ naturality := fun _ _ i => by erw [Category.comp_id]; exact F.germ_res i.left.unop _ } } set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_to_pullback_stalk TopCat.Presheaf.germToPullbackStalk /-- The morphism `(f⁻¹ℱ)ₓ ⟶ ℱ_{f(x)}`. -/ def stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : (pullbackObj f F).stalk x ⟶ F.stalk (f x) := colimit.desc ((OpenNhds.inclusion x).op ⋙ Presheaf.pullbackObj f F) { pt := F.stalk (f x) ι := { app := fun U => F.germToPullbackStalk _ f (unop U).1 ⟨x, (unop U).2⟩ naturality := fun _ _ _ => by erw [colimit.pre_desc, Category.comp_id]; congr } } set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_inv TopCat.Presheaf.stalkPullbackInv /-- The isomorphism `ℱ_{f(x)} ≅ (f⁻¹ℱ)ₓ`. -/ def stalkPullbackIso (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) : F.stalk (f x) ≅ (pullbackObj f F).stalk x where hom := stalkPullbackHom _ _ _ _ inv := stalkPullbackInv _ _ _ _ hom_inv_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward germToPullbackStalk germ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext j induction' j with j cases j simp only [TopologicalSpace.OpenNhds.inclusionMapIso_inv, whiskerRight_app, whiskerLeft_app, whiskeringLeft_obj_map, Functor.comp_map, colimit.ι_map_assoc, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app, Category.assoc, colimit.ι_pre_assoc] erw [colimit.ι_desc, colimit.pre_desc, colimit.ι_desc, Category.comp_id] simp inv_hom_id := by delta stalkPullbackHom stalkPullbackInv stalkFunctor Presheaf.pullback stalkPushforward change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨U_obj, U_property⟩ change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext ⟨j_left, ⟨⟨⟩⟩, j_hom⟩ erw [colimit.map_desc, colimit.map_desc, colimit.ι_desc_assoc, colimit.ι_desc_assoc, colimit.ι_desc, Category.comp_id] simp only [Cocone.whisker_ι, colimit.cocone_ι, OpenNhds.inclusionMapIso_inv, Cocones.precompose_obj_ι, whiskerRight_app, whiskerLeft_app, NatTrans.comp_app, whiskeringLeft_obj_map, NatTrans.op_id, lan_obj_map, pushforwardPullbackAdjunction_unit_app_app] erw [← colimit.w _ (@homOfLE (OpenNhds x) _ ⟨_, U_property⟩ ⟨(Opens.map f).obj (unop j_left), j_hom.unop.le U_property⟩ j_hom.unop.le).op] erw [colimit.ι_pre_assoc (Lan.diagram _ F _) (CostructuredArrow.map _)] erw [colimit.ι_pre_assoc (Lan.diagram _ F (op U_obj)) (CostructuredArrow.map _)] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_pullback_iso TopCat.Presheaf.stalkPullbackIso end stalkPullback section stalkSpecializes variable {C} /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : F.stalk y ⟶ F.stalk x := by refine' colimit.desc _ ⟨_, fun U => _, _⟩ · exact colimit.ι ((OpenNhds.inclusion x).op ⋙ F) (op ⟨(unop U).1, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩) · intro U V i dsimp rw [Category.comp_id] let U' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop U).1.2 (unop U).2 : _)⟩ let V' : OpenNhds x := ⟨_, (specializes_iff_forall_open.mp h _ (unop V).1.2 (unop V).2 : _)⟩ exact colimit.w ((OpenNhds.inclusion x).op ⋙ F) (show V' ⟶ U' from i.unop).op set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes TopCat.Presheaf.stalkSpecializes @[reassoc (attr := simp), elementwise nosimp] theorem germ_stalkSpecializes (F : X.Presheaf C) {U : Opens X} {y : U} {x : X} (h : x ⤳ y) : F.germ y ≫ F.stalkSpecializes h = F.germ (⟨x, h.mem_open U.isOpen y.prop⟩ : U) := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes TopCat.Presheaf.germ_stalkSpecializes @[reassoc, elementwise nosimp] theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y) (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩ := colimit.ι_desc _ _ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_stalk_specializes' TopCat.Presheaf.germ_stalkSpecializes' @[simp] theorem stalkSpecializes_refl {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) (x : X) : F.stalkSpecializes (specializes_refl x) = 𝟙 _ := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_refl TopCat.Presheaf.stalkSpecializes_refl @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat} (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) : F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h') := by ext simp set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_comp TopCat.Presheaf.stalkSpecializes_comp @[reassoc (attr := simp), elementwise (attr := simp)] theorem stalkSpecializes_stalkFunctor_map {F G : X.Presheaf C} (f : F ⟶ G) {x y : X} (h : x ⤳ y) : F.stalkSpecializes h ≫ (stalkFunctor C x).map f = (stalkFunctor C y).map f ≫ G.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkFunctor; simpa [stalkSpecializes] using by rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_functor_map TopCat.Presheaf.stalkSpecializes_stalkFunctor_map @[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x = F.stalkPushforward _ f y ≫ F.stalkSpecializes h := by change (_ : colimit _ ⟶ _) = (_ : colimit _ ⟶ _) ext; delta stalkPushforward simp only [stalkSpecializes, colimit.ι_desc_assoc, colimit.ι_map_assoc, colimit.ι_pre, Category.assoc, colimit.pre_desc, colimit.ι_desc] rfl set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_specializes_stalk_pushforward TopCat.Presheaf.stalkSpecializes_stalkPushforward /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X} (e : Inseparable x y) : F.stalk x ≅ F.stalk y := ⟨F.stalkSpecializes e.ge, F.stalkSpecializes e.le, by simp, by simp⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_congr TopCat.Presheaf.stalkCongr end stalkSpecializes section Concrete variable {C} variable [ConcreteCategory.{v} C] attribute [local instance] ConcreteCategory.hasCoeToSort -- Porting note: The following does not seem to be needed. -- ConcreteCategory.hasCoeToFun -- Porting note: Todo: @[ext] attribute only applies to structures or lemmas proving x = y -- @[ext] theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V} (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)} (ih : F.map iWU.op sU = F.map iWV.op sV) : F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV := by erw [← F.germ_res iWU ⟨x, hxW⟩, ← F.germ_res iWV ⟨x, hxW⟩, comp_apply, comp_apply, ih] set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_ext TopCat.Presheaf.germ_ext variable [PreservesFilteredColimits (forget C)] /-- For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits, every element of the stalk is the germ of a section. -/ theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) : ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t := by obtain ⟨U, s, e⟩ := Types.jointly_surjective.{v, v} _ (isColimitOfPreserves (forget C) (colimit.isColimit _)) t revert s e induction U with | h U => ?_ cases' U with V m intro s e exact ⟨V, m, s, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_exist TopCat.Presheaf.germ_exist theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) (s : F.obj (op U)) (t : F.obj (op V)) (h : germ F ⟨x, mU⟩ s = germ F ⟨x, mV⟩ t) : ∃ (W : Opens X) (_m : x ∈ W) (iU : W ⟶ U) (iV : W ⟶ V), F.map iU.op s = F.map iV.op t := by obtain ⟨W, iU, iV, e⟩ := (Types.FilteredColimit.isColimit_eq_iff.{v, v} _ (isColimitOfPreserves _ (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)))).mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.germ_eq TopCat.Presheaf.germ_eq theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} (f : F ⟶ G) (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by rcases germ_exist F x s with ⟨U₁, hxU₁, s, rfl⟩ rcases germ_exist F x t with ⟨U₂, hxU₂, t, rfl⟩ erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst erw [stalkFunctor_map_germ_apply _ ⟨x, _⟩] at hst obtain ⟨W, hxW, iWU₁, iWU₂, heq⟩ := G.germ_eq x hxU₁ hxU₂ _ _ hst rw [← comp_apply, ← comp_apply, ← f.naturality, ← f.naturality, comp_apply, comp_apply] at heq replace heq := h W heq convert congr_arg (F.germ ⟨x, hxW⟩) heq using 1 exacts [(F.germ_res_apply iWU₁ ⟨x, hxW⟩ s).symm, (F.germ_res_apply iWU₂ ⟨x, hxW⟩ t).symm] set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_map_injective_of_app_injective TopCat.Presheaf.stalkFunctor_map_injective_of_app_injective variable [HasLimits C] [PreservesLimits (forget C)] [ReflectsIsomorphisms (forget C)] /-- Let `F` be a sheaf valued in a concrete category, whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits. Then two sections who agree on every stalk must be equal. -/ theorem section_ext (F : Sheaf C X) (U : Opens X) (s t : F.1.obj (op U)) (h : ∀ x : U, F.presheaf.germ x s = F.presheaf.germ x t) : s = t := by -- We use `germ_eq` and the axiom of choice, to pick for every point `x` a neighbourhood -- `V x`, such that the restrictions of `s` and `t` to `V x` coincide. choose V m i₁ i₂ heq using fun x : U => F.presheaf.germ_eq x.1 x.2 x.2 s t (h x) -- Since `F` is a sheaf, we can prove the equality locally, if we can show that these -- neighborhoods form a cover of `U`. apply F.eq_of_locally_eq' V U i₁ · intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, m ⟨x, hxU⟩⟩ · intro x rw [heq, Subsingleton.elim (i₁ x) (i₂ x)] set_option linter.uppercaseLean3 false in #align Top.presheaf.section_ext TopCat.Presheaf.section_ext /- Note that the analogous statement for surjectivity is false: Surjectivity on stalks does not imply surjectivity of the components of a sheaf morphism. However it does imply that the morphism is an epi, but this fact is not yet formalized. -/ theorem app_injective_of_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) (U : Opens X) (h : ∀ x : U, Function.Injective ((stalkFunctor C x.val).map f)) : Function.Injective (f.app (op U)) := fun s t hst => section_ext F _ _ _ fun x => h x <| by erw [stalkFunctor_map_germ_apply, stalkFunctor_map_germ_apply, hst] set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_of_stalk_functor_map_injective TopCat.Presheaf.app_injective_of_stalkFunctor_map_injective theorem app_injective_iff_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) : (∀ x : X, Function.Injective ((stalkFunctor C x).map f)) ↔ ∀ U : Opens X, Function.Injective (f.app (op U)) := ⟨fun h U => app_injective_of_stalkFunctor_map_injective f U fun x => h x.1, stalkFunctor_map_injective_of_app_injective f⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.app_injective_iff_stalk_functor_map_injective TopCat.Presheaf.app_injective_iff_stalkFunctor_map_injective instance stalkFunctor_preserves_mono (x : X) : Functor.PreservesMonomorphisms (Sheaf.forget C X ⋙ stalkFunctor C x) := ⟨@fun _𝓐 _𝓑 f _ => ConcreteCategory.mono_of_injective _ <| (app_injective_iff_stalkFunctor_map_injective f.1).mpr (fun c => (@ConcreteCategory.mono_iff_injective_of_preservesPullback _ _ _ _ _ (f.1.app (op c))).mp ((NatTrans.mono_iff_mono_app _ f.1).mp (CategoryTheory.presheaf_mono_of_mono ..) <| op c)) x⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_functor_preserves_mono TopCat.Presheaf.stalkFunctor_preserves_mono theorem stalk_mono_of_mono {F G : Sheaf C X} (f : F ⟶ G) [Mono f] : ∀ x, Mono <| (stalkFunctor C x).map f.1 := fun x => Functor.map_mono (Sheaf.forget.{v} C X ⋙ stalkFunctor C x) f set_option linter.uppercaseLean3 false in #align Top.presheaf.stalk_mono_of_mono TopCat.Presheaf.stalk_mono_of_mono theorem mono_of_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) [∀ x, Mono <| (stalkFunctor C x).map f.1] : Mono f := (Sheaf.Hom.mono_iff_presheaf_mono _ _ _).mpr <| (NatTrans.mono_iff_mono_app _ _).mpr fun U => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mpr <| app_injective_of_stalkFunctor_map_injective f.1 U.unop fun ⟨_x, _hx⟩ => (ConcreteCategory.mono_iff_injective_of_preservesPullback _).mp <| inferInstance set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_of_stalk_mono TopCat.Presheaf.mono_of_stalk_mono theorem mono_iff_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) : Mono f ↔ ∀ x, Mono ((stalkFunctor C x).map f.1) := ⟨fun _ => stalk_mono_of_mono _, fun _ => mono_of_stalk_mono _⟩ set_option linter.uppercaseLean3 false in #align Top.presheaf.mono_iff_stalk_mono TopCat.Presheaf.mono_iff_stalk_mono /-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by intro t -- We use the axiom of choice to pick around each point `x` an open neighborhood `V` and a -- preimage under `f` on `V`. choose V mV iVU sf heq using hsurj t -- These neighborhoods clearly cover all of `U`. have V_cover : U ≤ iSup V := by intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, mV ⟨x, hxU⟩⟩ suffices IsCompatible F.val V sf by -- Since `F` is a sheaf, we can glue all the local preimages together to get a global preimage. obtain ⟨s, s_spec, -⟩ := F.existsUnique_gluing' V U iVU V_cover sf this · use s apply G.eq_of_locally_eq' V U iVU V_cover intro x rw [← comp_apply, ← f.1.naturality, comp_apply, s_spec, heq]
intro x y
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U)) := by intro t -- We use the axiom of choice to pick around each point `x` an open neighborhood `V` and a -- preimage under `f` on `V`. choose V mV iVU sf heq using hsurj t -- These neighborhoods clearly cover all of `U`. have V_cover : U ≤ iSup V := by intro x hxU simp only [Opens.coe_iSup, Set.mem_iUnion, SetLike.mem_coe] exact ⟨⟨x, hxU⟩, mV ⟨x, hxU⟩⟩ suffices IsCompatible F.val V sf by -- Since `F` is a sheaf, we can glue all the local preimages together to get a global preimage. obtain ⟨s, s_spec, -⟩ := F.existsUnique_gluing' V U iVU V_cover sf this · use s apply G.eq_of_locally_eq' V U iVU V_cover intro x rw [← comp_apply, ← f.1.naturality, comp_apply, s_spec, heq]
Mathlib.Topology.Sheaves.Stalks.530_0.hsVUPKIHRY0xmFk
/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` agree on `V`. -/ theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1)) (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)), f.1.app (op V) s = G.1.map iVU.op t) : Function.Surjective (f.1.app (op U))
Mathlib_Topology_Sheaves_Stalks