import OAI.AlgebraicGeometry.SheafCohomology.ZeroOutside /-! # Generated Subsheaf -/ namespace OAI.AlgebraicGeometry.SheafCohomology noncomputable section open _root_.TopCat open _root_.CategoryTheory _root_.TopologicalSpace _root_.Order open _root_.CategoryTheory.Limits _root_.Opposite set_option backward.isDefEq.respectTransparency false open OAI.AlgebraicGeometry.SheafCohomology.Vanishing.Projective.TopCat /-! # Generated subsheaves via coproduct images Generic coproduct-image API used to express subsheaves generated by a family of local sections. ## Main definitions * `TopCat.Sheaf.familyMap` — the universal map from a family coproduct into a sheaf. * `TopCat.Sheaf.familyImage` — the image subsheaf generated by such a family. * `TopCat.Presheaf.SectionIndex` — generic indexing type for local sections of a presheaf. * `TopCat.Presheaf.finsetGeneratorMap`, `TopCat.Presheaf.finsetGeneratedSheaf` — finite-section wrappers around the same generated-subsheaf construction. * `TopCat.Presheaf.allSectionMap` — the canonical coproduct map from all `zeroOutsideInt` generators of `F`, together with its `Epi` instance. -/ universe u open Limits instance GeneratedSubsheaf.ProjectiveVanishing.nativeSheafColimits (X : TopCat.{u}) : HasColimitsOfSize.{u, u} (Vanishing.Projective.TopCat.Sheaf AddCommGrpCat.{u} X) := IsGrothendieckAbelian.hasColimits _ section open _root_.TopCat.Sheaf /-- For a family of morphisms into `F`, the universal map from their coproduct into `F`. -/ abbrev Vanishing.Projective.TopCat.Sheaf.familyMap {C : Type*} [Category C] {X : TopCat.{u}} {ι : Type*} (G : ι → Vanishing.Projective.TopCat.Sheaf C X) {F : Vanishing.Projective.TopCat.Sheaf C X} (f : ∀ i, G i ⟶ F) [HasCoproduct G] : (∐ G) ⟶ F := Sigma.desc f /-- The image subsheaf generated by a family of morphisms into `F`. -/ abbrev Vanishing.Projective.TopCat.Sheaf.familyImage {C : Type*} [Category C] {X : TopCat.{u}} {ι : Type*} (G : ι → Vanishing.Projective.TopCat.Sheaf C X) {F : Vanishing.Projective.TopCat.Sheaf C X} (f : ∀ i, G i ⟶ F) [HasCoproduct G] [HasImage (Vanishing.Projective.TopCat.Sheaf.familyMap G f)] : Vanishing.Projective.TopCat.Sheaf C X := Limits.image (Vanishing.Projective.TopCat.Sheaf.familyMap G f) end namespace GeneratedSubsheaf.ProjectiveVanishing.TopCat.Presheaf open _root_.TopCat.Presheaf /-- Indexing type for all local sections of a presheaf. -/ abbrev SectionIndex {C : Type*} [Category C] {FC : C → C → Type*} {CC : C → Type*} [∀ X Y, FunLike (FC X Y) (CC X) (CC Y)] [ConcreteCategory C FC] {X : TopCat.{u}} (F : TopCat.Presheaf C X) := Σ U : Opens X, ToType (F.obj (op U)) /-- The canonical map attached to a finite set of local sections. -/ abbrev finsetGeneratorMap {X : TopCat.{u}} {F : TopCat.Presheaf AddCommGrpCat.{u} X} (hF : F.IsSheaf) (S : Finset (SectionIndex F)) [HasCoproduct fun σ : {σ // σ ∈ S} ↦ Vanishing.Projective.TopCat.Sheaf.zeroOutsideInt σ.1.1] : (∐ fun σ : {σ // σ ∈ S} ↦ Vanishing.Projective.TopCat.Sheaf.zeroOutsideInt σ.1.1) ⟶ (⟨F, hF⟩ : Vanishing.Projective.TopCat.Sheaf AddCommGrpCat.{u} X) := Vanishing.Projective.TopCat.Sheaf.familyMap (fun σ : {σ // σ ∈ S} ↦ Vanishing.Projective.TopCat.Sheaf.zeroOutsideInt σ.1.1) (fun σ ↦ ObjectProperty.homMk (Vanishing.Projective.TopCat.Sheaf.zeroOutsideInt.sHomVal hF σ.1.2)) /-- The subsheaf of `F` generated by a finite set of local sections. -/ abbrev finsetGeneratedSheaf {X : TopCat.{u}} {F : TopCat.Presheaf AddCommGrpCat.{u} X} (hF : F.IsSheaf) (S : Finset (SectionIndex F)) [HasCoproduct fun σ : {σ // σ ∈ S} ↦ Vanishing.Projective.TopCat.Sheaf.zeroOutsideInt σ.1.1] : Vanishing.Projective.TopCat.Sheaf AddCommGrpCat.{u} X := Vanishing.Projective.TopCat.Sheaf.familyImage (F := (⟨F, hF⟩ : Vanishing.Projective.TopCat.Sheaf AddCommGrpCat.{u} X)) (fun σ : {σ // σ ∈ S} ↦ Vanishing.Projective.TopCat.Sheaf.zeroOutsideInt σ.1.1) (fun σ ↦ ObjectProperty.homMk (Vanishing.Projective.TopCat.Sheaf.zeroOutsideInt.sHomVal hF σ.1.2)) /-- Coproduct inclusion induced by `S ⊆ S'` on the finite generator coproducts. -/ noncomputable def finsetCoproductInclGen {X : TopCat.{u}} {F : TopCat.Presheaf AddCommGrpCat.{u} X} {S S' : Finset (SectionIndex F)} (h : S ⊆ S') : (∐ fun σ : {σ // σ ∈ S} ↦ Vanishing.Projective.TopCat.Sheaf.zeroOutsideInt σ.1.1) ⟶ (∐ fun σ : {σ // σ ∈ S'} ↦ Vanishing.Projective.TopCat.Sheaf.zeroOutsideInt σ.1.1) := Sigma.desc fun σ ↦ Sigma.ι (fun τ : {τ // τ ∈ S'} ↦ Vanishing.Projective.TopCat.Sheaf.zeroOutsideInt τ.1.1) ⟨σ.1, h σ.2⟩ /-- Inclusion of finitely generated subsheaves induced by `S ⊆ S'`. -/ noncomputable def finsetImageInclGen {X : TopCat.{u}} {F : TopCat.Presheaf AddCommGrpCat.{u} X} (hF : F.IsSheaf) {S S' : Finset (SectionIndex F)} (h : S ⊆ S') : finsetGeneratedSheaf hF S ⟶ finsetGeneratedSheaf hF S' := Limits.image.lift { I := finsetGeneratedSheaf hF S' m := Limits.image.ι (finsetGeneratorMap hF S') e := finsetCoproductInclGen h ≫ factorThruImage (finsetGeneratorMap hF S') fac := by rw [Category.assoc, Limits.image.fac] ext ⟨σ, hσ⟩ simp [finsetCoproductInclGen, finsetGeneratorMap, Vanishing.Projective.TopCat.Sheaf.familyMap] } theorem finsetImageInclGen_comp_ι {X : TopCat.{u}} {F : TopCat.Presheaf AddCommGrpCat.{u} X} (hF : F.IsSheaf) {S S' : Finset (SectionIndex F)} (h : S ⊆ S') : finsetImageInclGen hF h ≫ Limits.image.ι (finsetGeneratorMap hF S') = Limits.image.ι (finsetGeneratorMap hF S) := by simpa [finsetImageInclGen] using (Limits.image.lift_fac (f := finsetGeneratorMap hF S) { I := finsetGeneratedSheaf hF S' m := Limits.image.ι (finsetGeneratorMap hF S') e := finsetCoproductInclGen h ≫ factorThruImage (finsetGeneratorMap hF S') fac := by rw [Category.assoc, Limits.image.fac] ext ⟨σ, hσ⟩ simp [finsetCoproductInclGen, finsetGeneratorMap, Vanishing.Projective.TopCat.Sheaf.familyMap] }) instance finsetImageInclGen_mono {X : TopCat.{u}} {F : TopCat.Presheaf AddCommGrpCat.{u} X} (hF : F.IsSheaf) {S S' : Finset (SectionIndex F)} (h : S ⊆ S') : Mono (finsetImageInclGen hF h) := mono_of_mono_fac (finsetImageInclGen_comp_ι hF h) /-- The canonical map from the coproduct of all `zeroOutsideInt U` indexed by local sections of `F` onto the sheaf associated to `F`. This is the formal Step 3A starting point for building finitely generated subsheaves via images of smaller subcoproducts. -/ abbrev allSectionMap {X : TopCat.{u}} {F : TopCat.Presheaf AddCommGrpCat.{u} X} (hF : F.IsSheaf) [HasCoproduct (fun σ : SectionIndex F ↦ Vanishing.Projective.TopCat.Sheaf.zeroOutsideInt σ.1)] : (∐ fun σ : SectionIndex F ↦ Vanishing.Projective.TopCat.Sheaf.zeroOutsideInt σ.1) ⟶ (⟨F, hF⟩ : Vanishing.Projective.TopCat.Sheaf AddCommGrpCat.{u} X) := Vanishing.Projective.TopCat.Sheaf.familyMap (fun σ : SectionIndex F ↦ Vanishing.Projective.TopCat.Sheaf.zeroOutsideInt σ.1) (fun σ ↦ ObjectProperty.homMk (Vanishing.Projective.TopCat.Sheaf.zeroOutsideInt.sHomVal hF σ.2)) instance allSectionMap_epi {X : TopCat.{u}} {F : TopCat.Presheaf AddCommGrpCat.{u} X} (hF : F.IsSheaf) [HasCoproduct (fun σ : SectionIndex F ↦ Vanishing.Projective.TopCat.Sheaf.zeroOutsideInt σ.1)] : Epi (allSectionMap hF) := by let : Balanced (CategoryTheory.Sheaf (Opens.grothendieckTopology X) AddCommGrpCat.{u}) := balanced_of_strongEpiCategory rw [← Sheaf.isLocallySurjective_iff_epi' AddCommGrpCat.{u}] change TopCat.Presheaf.IsLocallySurjective (allSectionMap hF).hom rw [TopCat.Presheaf.isLocallySurjective_iff] intro U t x hx refine ⟨U, le_rfl, ?_, hx⟩ refine ⟨(Sigma.ι (fun σ : SectionIndex F ↦ Vanishing.Projective.TopCat.Sheaf.zeroOutsideInt σ.1) ⟨U, t⟩).hom.app (op U) (Vanishing.Projective.TopCat.Sheaf.zeroOutsideInt.generator U), ?_⟩ change (((Sigma.ι (fun σ : SectionIndex F ↦ Vanishing.Projective.TopCat.Sheaf.zeroOutsideInt σ.1) ⟨U, t⟩) ≫ allSectionMap hF).hom.app (op U) (Vanishing.Projective.TopCat.Sheaf.zeroOutsideInt.generator U)) = TopCat.Presheaf.restrict t (𝟙 U) rw [Sigma.ι_comp_desc] trans t · simpa using Vanishing.Projective.TopCat.Sheaf.zeroOutsideInt.sHomVal_app_generator (F := F) hF t · symm change F.map (𝟙 (Opposite.op U)) t = t simp end GeneratedSubsheaf.ProjectiveVanishing.TopCat.Presheaf end end OAI.AlgebraicGeometry.SheafCohomology