/- 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.Algebra.Homology.Notation import OAI.AlgebraicTopology.Sheaf.CohomologyStalkIs import OAI.AlgebraicTopology.Sheaf.OpenRestriction import OAI.Algebra.Homology.ShortExactQuasiIso /-! # Flasque Comparison -/ namespace OAI.AlgebraicTopology.Support.FlasqueComparison.TopCat.Sheaf noncomputable section open _root_.TopCat open _root_.TopCat.Sheaf /-! # Local sections of flasque resolution comparisons A quasi-isomorphism of bounded-below termwise-flasque complexes remains a quasi-isomorphism on every open set. The proof restricts to that open set and uses the flasque global-sections theorem. Consequently its direct image under any continuous map is a sheaf quasi-isomorphism. This is a theorem about flasque models, not an assertion that arbitrary direct image is exact. The localization sequence is short exact on every open set for flasque coefficients, so the supported-sections complex computes the fiber of restriction even for the singular-cochain flasque model. -/ open _root_.CategoryTheory Limits _root_.TopologicalSpace Opposite _root_.HomologicalComplex universe u variable (X : TopCat.{u}) (U : Opens X) /-- Let `X` be a topological space and `U ⊆ X` open. This natural isomorphism identifies global sections of a sheaf of abelian groups restricted to the space `U` with its original sections on the open subset `U`. -/ def openRestrictionGlobalSectionsIso : U.isOpenEmbedding.sheafPullback AddCommGrpCat.{u} ⋙ AlgebraicTopology.Sheaf.FlasqueBoundedBelow.TopCat.IsFlasque.BoundedBelowComplex.globalSectionsFunctor (TopCat.of U) ≅ DerivedSectionsLocalization.TopCat.Sheaf.supportEvaluation X U := NatIso.ofComponents (fun F => F.obj.mapIso (eqToIso (congrArg op (Opens.isOpenEmbedding_obj_top U)))) (fun {_ _} f => (f.hom.naturality (eqToHom (congrArg op (Opens.isOpenEmbedding_obj_top U)))).symm) set_option backward.isDefEq.respectTransparency false in set_option backward.defeqAttrib.useBackward true in /-- Open-set sections preserve quasi-isomorphisms between bounded-below termwise-flasque complexes. -/ theorem supportEvaluation_map_quasiIso_of_flasque {K L : CochainComplex (Sheaf AddCommGrpCat.{u} X) ℤ} (f : K ⟶ L) [QuasiIso f] (nK nL : ℤ) [K.IsStrictlyGE nK] [L.IsStrictlyGE nL] (hK : ∀ n, (K.X n).IsFlasque) (hL : ∀ n, (L.X n).IsFlasque) : QuasiIso (((DerivedSectionsLocalization.TopCat.Sheaf.supportEvaluation X U).mapHomologicalComplex ℤᵘᵖ).map f) := by let R := U.isOpenEmbedding.sheafPullback AddCommGrpCat.{u} let Γ := AlgebraicTopology.Sheaf.FlasqueBoundedBelow.TopCat.IsFlasque.BoundedBelowComplex.globalSectionsFunctor (TopCat.of U) let K' : CochainComplex (Sheaf AddCommGrpCat.{u} (TopCat.of U)) ℤ := (R.mapHomologicalComplex ℤᵘᵖ).obj K let L' : CochainComplex (Sheaf AddCommGrpCat.{u} (TopCat.of U)) ℤ := (R.mapHomologicalComplex ℤᵘᵖ).obj L let f' : K' ⟶ L' := (R.mapHomologicalComplex ℤᵘᵖ).map f let : QuasiIso f' := AlgebraicTopology.Sheaf.OpenRestriction.TopCat.openSheafRestriction_map_quasiIso X U f have hK' (n : ℤ) : (K'.X n).IsFlasque := by let : (K.X n).IsFlasque := hK n exact AlgebraicTopology.Sheaf.OpenRestriction.TopCat.openSheafRestriction_isFlasque X U _ have hL' (n : ℤ) : (L'.X n).IsFlasque := by let : (L.X n).IsFlasque := hL n exact AlgebraicTopology.Sheaf.OpenRestriction.TopCat.openSheafRestriction_isFlasque X U _ let : QuasiIso ((Γ.mapHomologicalComplex ℤᵘᵖ).map f') := AlgebraicTopology.Sheaf.FlasqueQuasiIso.TopCat.IsFlasque.BoundedBelowComplex.globalSectionsComplex_map_quasiIso f' nK nL hK' hL' let e := NatIso.mapHomologicalComplex (openRestrictionGlobalSectionsIso X U) ℤᵘᵖ apply (quasiIso_iff_of_arrow_mk_iso ((Γ.mapHomologicalComplex ℤᵘᵖ).map f') (((DerivedSectionsLocalization.TopCat.Sheaf.supportEvaluation X U).mapHomologicalComplex ℤᵘᵖ).map f) (Arrow.isoMk (e.app K) (e.app L) (e.hom.naturality f).symm)).mp infer_instance /-- The flasque localization sequence is short exact on each open set. -/ lemma supportRestrictionSectionsShortComplex_shortExact_of_flasque (V : Opens X) (F : Sheaf AddCommGrpCat.{u} X) [F.IsFlasque] : (DerivedSectionsExact.TopCat.Sheaf.supportRestrictionSectionsShortComplex X U V F).ShortExact where exact := ShortComplex.exact_of_f_is_kernel _ (KernelFork.mapIsLimit _ (kernelIsKernel _) (DerivedSectionsLocalization.TopCat.Sheaf.supportEvaluation X V)) mono_f := mono_of_isLimit_fork (KernelFork.mapIsLimit _ (kernelIsKernel _) (DerivedSectionsLocalization.TopCat.Sheaf.supportEvaluation X V)) epi_g := DerivedSectionsLocalization.TopCat.Sheaf.toOpenRestrictionPushforward_app_epi X U F V /-- Termwise flasqueness is sufficient for the localization sequence of section complexes to be short exact. -/ lemma supportRestrictionSectionsComplexShortComplex_shortExact_of_flasque (V : Opens X) (K : CochainComplex (Sheaf AddCommGrpCat.{u} X) ℤ) (hK : ∀ n, (K.X n).IsFlasque) : (DerivedSectionsLocalization.TopCat.Sheaf.supportRestrictionSectionsComplexShortComplex X U V K).ShortExact := by apply HomologicalComplex.shortExact_of_degreewise_shortExact intro n exact supportRestrictionSectionsShortComplex_shortExact_of_flasque X U V (K.X n) /-- Let `X` be a topological space, `U ⊆ X` open, and `f: K → L` a map of integer-indexed sheaf complexes. This is the induced map from `Γ_{X \ U}(K) → K → j_*(K|_U)` to the same sequence for `L`, applying `f` to supported sections, all sections, and restricted sections. -/ def supportRestrictionComplexShortComplexMap {K L : CochainComplex (Sheaf AddCommGrpCat.{u} X) ℤ} (f : K ⟶ L) : DerivedSectionsLocalization.TopCat.Sheaf.supportRestrictionComplexShortComplex X U K ⟶ DerivedSectionsLocalization.TopCat.Sheaf.supportRestrictionComplexShortComplex X U L where τ₁ := ((DerivedSections.TopCat.Sheaf.sheafSectionsSupportedOutside X U).mapHomologicalComplex ℤᵘᵖ).map f τ₂ := f τ₃ := ((DerivedSections.TopCat.Sheaf.openRestrictionPushforward X U).mapHomologicalComplex ℤᵘᵖ).map f comm₁₂ := by ext n exact (DerivedSections.TopCat.Sheaf.sheafSectionsSupportedOutsideInclusion X U).naturality (f.f n) comm₂₃ := by ext n exact (DerivedSections.TopCat.Sheaf.toOpenRestrictionPushforward X U).naturality (f.f n) /-- Supported sections of a quasi-isomorphism between bounded-below flasque models are a quasi-isomorphism on every open set. -/ theorem supportedSections_map_quasiIso_of_flasque (V : Opens X) {K L : CochainComplex (Sheaf AddCommGrpCat.{u} X) ℤ} (f : K ⟶ L) [QuasiIso f] (nK nL : ℤ) [K.IsStrictlyGE nK] [L.IsStrictlyGE nL] (hK : ∀ n, (K.X n).IsFlasque) (hL : ∀ n, (L.X n).IsFlasque) : QuasiIso (((DerivedSectionsLocalization.TopCat.Sheaf.supportEvaluation X V).mapHomologicalComplex ℤᵘᵖ).map (((DerivedSections.TopCat.Sheaf.sheafSectionsSupportedOutside X U).mapHomologicalComplex ℤᵘᵖ).map f)) := by let φ := (((DerivedSectionsLocalization.TopCat.Sheaf.supportEvaluation X V).mapHomologicalComplex ℤᵘᵖ).mapShortComplex).map (supportRestrictionComplexShortComplexMap X U f) have h₂ : QuasiIso φ.τ₂ := supportEvaluation_map_quasiIso_of_flasque X V f nK nL hK hL have h₃ : QuasiIso φ.τ₃ := by change QuasiIso (((DerivedSectionsLocalization.TopCat.Sheaf.supportEvaluation X (U.isOpenEmbedding.functor.obj ((Opens.map U.inclusion').obj V))).mapHomologicalComplex ℤᵘᵖ).map f) exact supportEvaluation_map_quasiIso_of_flasque X _ f nK nL hK hL exact Algebra.Homology.ShortExactQuasiIso.CochainComplex.quasiIso_first_of_shortExact φ (supportRestrictionSectionsComplexShortComplex_shortExact_of_flasque X U V K hK) (supportRestrictionSectionsComplexShortComplex_shortExact_of_flasque X U V L hL) /-- Termwise supported sections preserve quasi-isomorphisms between bounded-below flasque models, as detected by their section complexes. -/ theorem sheafSectionsSupportedOutside_map_quasiIso_of_flasque {K L : CochainComplex (Sheaf AddCommGrpCat.{u} X) ℤ} (f : K ⟶ L) [QuasiIso f] (nK nL : ℤ) [K.IsStrictlyGE nK] [L.IsStrictlyGE nL] (hK : ∀ n, (K.X n).IsFlasque) (hL : ∀ n, (L.X n).IsFlasque) : QuasiIso (((DerivedSections.TopCat.Sheaf.sheafSectionsSupportedOutside X U).mapHomologicalComplex ℤᵘᵖ).map f) := by apply AlgebraicTopology.Sheaf.CohomologyStalkIs.TopCat.quasiIso_of_cofinal_section_quasiIso exact fun x V hxV => ⟨V, le_rfl, hxV, supportedSections_map_quasiIso_of_flasque X U V f nK nL hK hL⟩ end end OAI.AlgebraicTopology.Support.FlasqueComparison.TopCat.Sheaf