import OAI.AlgebraicGeometry.CycleClass.Geometric.RelativeChainSupport import OAI.AlgebraicGeometry.CycleClass.Geometric.LocalHomologyPresheaf import Mathlib.LinearAlgebra.Finsupp.Supported import Mathlib.LinearAlgebra.Isomorphisms /-! # Relative Chain Coefficients -/ namespace OAI.AlgebraicGeometry.CycleClass.Geometric.RelativeChainCoefficients.Cycles noncomputable section /-! # Coefficients of relative singular chains with support The actual relative group `C_n(X, X ∖ K; ℤ)` is freely generated by the global singular simplices whose images meet `K`. Its coefficient module is realized as a supported submodule on the fixed set of all global simplices. The quotient projection and restriction to a smaller support set are the corresponding coefficient truncations. No condition on `K` is required. -/ open _root_.CategoryTheory _root_.CategoryTheory.Limits open scoped Simplicial Classical set_option backward.isDefEq.respectTransparency false set_option backward.isDefEq.respectTransparency.types false variable (X : TopCat.{0}) (K : Set X) (n : ℕ) /-- Keep precisely the coefficients of global singular simplices meeting `K`. -/ def relativeChainCoefficientTruncation : (LocalHomology.Cycles.integralSingularChains X).X n →ₗ[ℤ] Finsupp.supported ℤ ℤ {σ | (LocallyFiniteChains.Cycles.singularSimplexImage X n σ ∩ K).Nonempty} := by classical exact (Finsupp.restrictDom ℤ ℤ _).comp (LocallyFiniteCompact.Cycles.ordinarySingularChainCoefficients ℤ X n).toLinearMap theorem relativeChainCoefficientTruncation_apply (c : (LocalHomology.Cycles.integralSingularChains X).X n) (σ : (TopCat.toSSet.obj X).obj (.op ⦋n⦌)) : (relativeChainCoefficientTruncation X K n c).val σ = if (LocallyFiniteChains.Cycles.singularSimplexImage X n σ ∩ K).Nonempty then LocallyFiniteCompact.Cycles.ordinarySingularChainCoefficients ℤ X n c σ else 0 := by classical rfl /-- Every supported coefficient function is the truncation of an ordinary chain. -/ theorem relativeChainCoefficientTruncation_surjective : Function.Surjective (relativeChainCoefficientTruncation X K n) := by classical intro c refine ⟨(LocallyFiniteCompact.Cycles.ordinarySingularChainCoefficients ℤ X n).symm c.val, ?_⟩ change Finsupp.restrictDom ℤ ℤ _ (LocallyFiniteCompact.Cycles.ordinarySingularChainCoefficients ℤ X n ((LocallyFiniteCompact.Cycles.ordinarySingularChainCoefficients ℤ X n).symm c.val)) = c rw [LinearEquiv.apply_symm_apply] exact LinearMap.congr_fun (Finsupp.restrictDom_comp_subtype _) c /-- Truncation vanishes exactly on chains supported in the complement. -/ theorem relativeChainCoefficientTruncation_eq_zero_iff (c : (LocalHomology.Cycles.integralSingularChains X).X n) : relativeChainCoefficientTruncation X K n c = 0 ↔ ∀ σ, LocallyFiniteCompact.Cycles.ordinarySingularChainCoefficients ℤ X n c σ ≠ 0 → LocallyFiniteChains.Cycles.singularSimplexImage X n σ ⊆ Kᶜ := by classical constructor · intro hc σ hσ x hx hxK have he := congrArg (fun d : Finsupp.supported ℤ ℤ {σ | (LocallyFiniteChains.Cycles.singularSimplexImage X n σ ∩ K).Nonempty} => d.val σ) hc have hm : (LocallyFiniteChains.Cycles.singularSimplexImage X n σ ∩ K).Nonempty := ⟨x, hx, hxK⟩ rw [relativeChainCoefficientTruncation_apply, ite_eq_left hm] at he exact hσ he · intro hc apply Subtype.ext apply Finsupp.ext intro σ change (relativeChainCoefficientTruncation X K n c).val σ = 0 rw [relativeChainCoefficientTruncation_apply] split_ifs with hσ · by_contra hne obtain ⟨x, hx, hxK⟩ := hσ exact hc σ hne hx hxK · rfl /-- The genuine quotient projection and coefficient truncation have the same kernel. -/ theorem relativeChainProjection_ker_eq_coefficientTruncation : LinearMap.ker ((LocalHomology.Cycles.relativeChainProjection X Kᶜ).f n).hom = LinearMap.ker (relativeChainCoefficientTruncation X K n) := by ext c change (LocalHomology.Cycles.relativeChainProjection X Kᶜ).f n c = 0 ↔ relativeChainCoefficientTruncation X K n c = 0 rw [RelativeChainSupport.Cycles.relativeChainProjection_eq_zero_iff_supported, relativeChainCoefficientTruncation_eq_zero_iff] private theorem projection_surjective : Function.Surjective ((LocalHomology.Cycles.relativeChainProjection X Kᶜ).f n) := (ModuleCat.epi_iff_surjective _).1 (LocalHomology.Cycles.relativeChainSequence_degreewiseShortExact X Kᶜ n).epi_g /-- Actual relative singular chains identified with finite global coefficients supported on simplices whose images meet `K`. -/ def relativeChainCoefficients : (LocalHomology.Cycles.relativeSingularChains X Kᶜ).X n ≃ₗ[ℤ] Finsupp.supported ℤ ℤ {σ | (LocallyFiniteChains.Cycles.singularSimplexImage X n σ ∩ K).Nonempty} := ((((LocalHomology.Cycles.relativeChainProjection X Kᶜ).f n).hom.quotKerEquivOfSurjective (projection_surjective X K n)).symm.trans (Submodule.quotEquivOfEq _ _ (relativeChainProjection_ker_eq_coefficientTruncation X K n))).trans ((relativeChainCoefficientTruncation X K n).quotKerEquivOfSurjective (relativeChainCoefficientTruncation_surjective X K n)) /-- The relative quotient projection is precisely coefficient truncation. -/ theorem relativeChainCoefficients_projection (c : (LocalHomology.Cycles.integralSingularChains X).X n) : relativeChainCoefficients X K n ((LocalHomology.Cycles.relativeChainProjection X Kᶜ).f n c) = relativeChainCoefficientTruncation X K n c := by simp only [relativeChainCoefficients, LinearEquiv.trans_apply, LinearMap.quotKerEquivOfSurjective_symm_apply, Submodule.quotEquivOfEq_mk, LinearMap.quotKerEquivOfSurjective_apply_mk] /-- The coefficient of a projected chain is unchanged exactly when its simplex meets `K`. -/ theorem relativeChainCoefficients_projection_apply (c : (LocalHomology.Cycles.integralSingularChains X).X n) (σ : (TopCat.toSSet.obj X).obj (.op ⦋n⦌)) : (relativeChainCoefficients X K n ((LocalHomology.Cycles.relativeChainProjection X Kᶜ).f n c)).val σ = if (LocallyFiniteChains.Cycles.singularSimplexImage X n σ ∩ K).Nonempty then LocallyFiniteCompact.Cycles.ordinarySingularChainCoefficients ℤ X n c σ else 0 := by classical rw [relativeChainCoefficients_projection, relativeChainCoefficientTruncation_apply] /-- The inverse equivalence projects the ordinary chain with those same coefficients. -/ theorem relativeChainCoefficients_symm_apply (c : Finsupp.supported ℤ ℤ {σ | (LocallyFiniteChains.Cycles.singularSimplexImage X n σ ∩ K).Nonempty}) : (relativeChainCoefficients X K n).symm c = (LocalHomology.Cycles.relativeChainProjection X Kᶜ).f n ((LocallyFiniteCompact.Cycles.ordinarySingularChainCoefficients ℤ X n).symm c.val) := by classical apply (relativeChainCoefficients X K n).injective rw [LinearEquiv.apply_symm_apply, relativeChainCoefficients_projection] change c = Finsupp.restrictDom ℤ ℤ _ (LocallyFiniteCompact.Cycles.ordinarySingularChainCoefficients ℤ X n ((LocallyFiniteCompact.Cycles.ordinarySingularChainCoefficients ℤ X n).symm c.val)) rw [LinearEquiv.apply_symm_apply] exact (LinearMap.congr_fun (Finsupp.restrictDom_comp_subtype _) c).symm variable {K} {L : Set X} /-- Restricting the support set truncates the relative coefficients once more. -/ theorem relativeChainCoefficients_restriction_apply (hKL : K ⊆ L) (c : (LocalHomology.Cycles.relativeSingularChains X Lᶜ).X n) (σ : (TopCat.toSSet.obj X).obj (.op ⦋n⦌)) : (relativeChainCoefficients X K n ((LocalHomologyPresheaf.Cycles.relativeComplementChainRestriction X hKL).f n c)).val σ = if (LocallyFiniteChains.Cycles.singularSimplexImage X n σ ∩ K).Nonempty then (relativeChainCoefficients X L n c).val σ else 0 := by classical obtain ⟨a, rfl⟩ := projection_surjective X L n c have hproj := ConcreteCategory.congr_hom (HomologicalComplex.congr_hom (LocalHomologyPresheaf.Cycles.relativeComplementChainRestriction_projection X hKL) n) a change (LocalHomologyPresheaf.Cycles.relativeComplementChainRestriction X hKL).f n ((LocalHomology.Cycles.relativeChainProjection X Lᶜ).f n a) = (LocalHomology.Cycles.relativeChainProjection X Kᶜ).f n a at hproj rw [hproj, relativeChainCoefficients_projection_apply, relativeChainCoefficients_projection_apply] by_cases hσ : (LocallyFiniteChains.Cycles.singularSimplexImage X n σ ∩ K).Nonempty · have hσL : (LocallyFiniteChains.Cycles.singularSimplexImage X n σ ∩ L).Nonempty := by obtain ⟨x, hx, hxK⟩ := hσ exact ⟨x, hx, hKL hxK⟩ simp only [ite_eq_left hσ, ite_eq_left hσL] · simp only [ite_eq_right hσ] /-- On every simplex meeting the smaller set, support restriction preserves its coefficient. -/ theorem relativeChainCoefficients_restriction_of_meets (hKL : K ⊆ L) (c : (LocalHomology.Cycles.relativeSingularChains X Lᶜ).X n) (σ : (TopCat.toSSet.obj X).obj (.op ⦋n⦌)) (hσ : (LocallyFiniteChains.Cycles.singularSimplexImage X n σ ∩ K).Nonempty) : (relativeChainCoefficients X K n ((LocalHomologyPresheaf.Cycles.relativeComplementChainRestriction X hKL).f n c)).val σ = (relativeChainCoefficients X L n c).val σ := by rw [relativeChainCoefficients_restriction_apply, ite_eq_left hσ] /-- Support restriction as equality of supported coefficient functions. -/ theorem relativeChainCoefficients_restriction (hKL : K ⊆ L) (c : (LocalHomology.Cycles.relativeSingularChains X Lᶜ).X n) : relativeChainCoefficients X K n ((LocalHomologyPresheaf.Cycles.relativeComplementChainRestriction X hKL).f n c) = Finsupp.restrictDom ℤ ℤ {σ | (LocallyFiniteChains.Cycles.singularSimplexImage X n σ ∩ K).Nonempty} (relativeChainCoefficients X L n c).val := by classical apply Subtype.ext apply Finsupp.ext intro σ exact relativeChainCoefficients_restriction_apply X n hKL c σ end end OAI.AlgebraicGeometry.CycleClass.Geometric.RelativeChainCoefficients.Cycles