/- Copyright 2026 The Formal Conjectures Authors. Released under Apache 2.0 license as described in the file LICENSE. This file has been modified. -/ import OAI.AlgebraicTopology.Sheaf.OpenRestriction import Mathlib.CategoryTheory.Sites.CoverLifting /-! # Open Sheafification -/ namespace OAI.AlgebraicTopology.Sheaf.OpenSheafification noncomputable section open _root_.TopCat open _root_.Topology open _root_.Topology.IsOpenEmbedding /-! # Sheafification commutes with open restriction Open-image functors lift covering sieves. The resulting sheafification comparison is the sheafification lift of the restricted unit. -/ open _root_.CategoryTheory _root_.TopologicalSpace Opposite universe u namespace Topology.IsOpenEmbedding variable {X Y : TopCat.{u}} {f : X ⟶ Y} (hf : IsOpenEmbedding f) /-- Covering sieves on an open image pull back to covering sieves in the open subspace. -/ lemma functor_isCocontinuous : hf.functor.IsCocontinuous (Opens.grothendieckTopology X) (Opens.grothendieckTopology Y) where cover_lift {U S} hS x hx := by obtain ⟨V, i, hV, hxV⟩ := hS (f x) ⟨x, hx, rfl⟩ let V' := (Opens.map f).obj V have hle : V' ≤ U := by intro y hy obtain ⟨z, hz, hzy⟩ := i.le hy exact hf.injective hzy ▸ hz exact ⟨V', homOfLE hle, S.downward_closed hV (homOfLE (Set.image_preimage_subset f V)), hxV⟩ end Topology.IsOpenEmbedding namespace TopCat variable (X : TopCat.{u}) (U : Opens X) set_option backward.defeqAttrib.useBackward true in set_option backward.isDefEq.respectTransparency false in /-- Let `U` be open in a topological space `X` and `P` a presheaf of abelian groups on `X`. This natural isomorphism `(P⁺⁺)|_U ≅ (P|_U)⁺⁺` identifies restriction of the sheafification of `P` with sheafification of its restriction. -/ def openRestrictionSheafificationIso (P : Presheaf AddCommGrpCat.{u} X) : (presheafToSheaf (Opens.grothendieckTopology (TopCat.of U)) AddCommGrpCat).obj (U.isOpenEmbedding.functor.op ⋙ P) ≅ (U.isOpenEmbedding.sheafPullback AddCommGrpCat).obj ((presheafToSheaf (Opens.grothendieckTopology X) AddCommGrpCat).obj P) := letI : U.isOpenEmbedding.functor.IsContinuous (Opens.grothendieckTopology (TopCat.of U)) (Opens.grothendieckTopology X) := U.isOpenEmbedding.functor_isContinuous letI : U.isOpenEmbedding.functor.IsCocontinuous (Opens.grothendieckTopology (TopCat.of U)) (Opens.grothendieckTopology X) := (Topology.IsOpenEmbedding.functor_isCocontinuous U.isOpenEmbedding) (U.isOpenEmbedding.functor.pushforwardContinuousSheafificationCompatibility AddCommGrpCat (Opens.grothendieckTopology (TopCat.of U)) (Opens.grothendieckTopology X)).app P set_option backward.defeqAttrib.useBackward true in set_option backward.isDefEq.respectTransparency false in /-- The comparison is normalized by the restricted sheafification unit. -/ @[reassoc] lemma toSheafify_openRestrictionSheafificationIso (P : Presheaf AddCommGrpCat.{u} X) : toSheafify (Opens.grothendieckTopology (TopCat.of U)) (U.isOpenEmbedding.functor.op ⋙ P) ≫ (openRestrictionSheafificationIso X U P).hom.hom = Functor.whiskerLeft U.isOpenEmbedding.functor.op (toSheafify (Opens.grothendieckTopology X) P) := by let : U.isOpenEmbedding.functor.IsContinuous (Opens.grothendieckTopology (TopCat.of U)) (Opens.grothendieckTopology X) := U.isOpenEmbedding.functor_isContinuous let : U.isOpenEmbedding.functor.IsCocontinuous (Opens.grothendieckTopology (TopCat.of U)) (Opens.grothendieckTopology X) := (Topology.IsOpenEmbedding.functor_isCocontinuous U.isOpenEmbedding) exact U.isOpenEmbedding.functor.toSheafify_pullbackSheafificationCompatibility AddCommGrpCat (Opens.grothendieckTopology (TopCat.of U)) (Opens.grothendieckTopology X) P set_option backward.defeqAttrib.useBackward true in set_option backward.isDefEq.respectTransparency false in @[reassoc] lemma openRestrictionSheafificationIso_naturality {P Q : Presheaf AddCommGrpCat.{u} X} (f : P ⟶ Q) : (presheafToSheaf (Opens.grothendieckTopology (TopCat.of U)) AddCommGrpCat).map (Functor.whiskerLeft U.isOpenEmbedding.functor.op f) ≫ (openRestrictionSheafificationIso X U Q).hom = (openRestrictionSheafificationIso X U P).hom ≫ (U.isOpenEmbedding.sheafPullback AddCommGrpCat).map ((presheafToSheaf (Opens.grothendieckTopology X) AddCommGrpCat).map f) := by let : U.isOpenEmbedding.functor.IsContinuous (Opens.grothendieckTopology (TopCat.of U)) (Opens.grothendieckTopology X) := U.isOpenEmbedding.functor_isContinuous let : U.isOpenEmbedding.functor.IsCocontinuous (Opens.grothendieckTopology (TopCat.of U)) (Opens.grothendieckTopology X) := (Topology.IsOpenEmbedding.functor_isCocontinuous U.isOpenEmbedding) exact (U.isOpenEmbedding.functor.pushforwardContinuousSheafificationCompatibility AddCommGrpCat (Opens.grothendieckTopology (TopCat.of U)) (Opens.grothendieckTopology X)).hom.naturality f end TopCat end end OAI.AlgebraicTopology.Sheaf.OpenSheafification