/- Copyright (c) 2026 Chris Birkbeck. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck This file has been modified. -/ import OAI.AlgebraicGeometry.SheafCohomology.Projective.IdealModule import OAI.AlgebraicGeometry.SheafCohomology.Projective.AffineRankOneRestriction /-! # Ideal Invertible -/ namespace OAI.AlgebraicGeometry.SheafCohomology.Projective.IdealInvertible noncomputable section /-! Actual rank-one frames for kernel ideals generated by nonzerodivisors. -/ set_option backward.isDefEq.respectTransparency false open _root_.CategoryTheory _root_.AlgebraicGeometry _root_.TopologicalSpace universe u /-- A principal nonzerodivisor ideal has an explicit basis on its affine open. -/ def principalIdealModuleSectionsEquiv {X Y : Scheme.{u}} (f : X ⟶ Y) [QuasiCompact f] (U : Y.affineOpens) (r : Γ(Y, U.1)) (hspan : f.ker.ideal U = Ideal.span {r}) (hnzd : r ∈ nonZeroDivisors Γ(Y, U.1)) : Γ(Y, U.1) ≃ₗ[Γ(Y, U.1)] Γ(IdealModule.idealModule f, U.1) := ((IdealModule.principalIdealEquiv r hnzd).trans (LinearEquiv.ofEq _ _ hspan.symm)).trans (IdealModule.idealModuleAppIdealIso f U).toLinearEquiv.symm /-- The affine-section basis gives a genuine local trivialization. -/ def principalIdealModuleRestrictionIso {X Y : Scheme.{u}} (f : X ⟶ Y) [IsAffineHom f] (U : Y.affineOpens) (r : Γ(Y, U.1)) (hspan : f.ker.ideal U = Ideal.span {r}) (hnzd : r ∈ nonZeroDivisors Γ(Y, U.1)) : Invertible.Scheme.Modules.unitObj U.1.toScheme ≅ (IdealModule.idealModule f).restrict U.1.ι := by letI : (IdealModule.idealModule f).IsQuasicoherent := IdealModule.idealModule_quasicoherent f exact AffineRankOneRestriction.affineRankOneRestrictionIso (IdealModule.idealModule f) U (principalIdealModuleSectionsEquiv f U r hspan hnzd) /-- Affine-locally principal kernel ideals generated by nonzerodivisors are invertible as actual sheaves of modules. -/ theorem idealModule_isInvertible_of_locallyPrincipal {X Y : Scheme.{u}} (f : X ⟶ Y) [IsAffineHom f] (hlocal : ∀ y : Y, ∃ U : Y.affineOpens, y ∈ U.1 ∧ ∃ r : Γ(Y, U.1), f.ker.ideal U = Ideal.span {r} ∧ r ∈ nonZeroDivisors Γ(Y, U.1)) : Invertible.Scheme.Modules.IsInvertible (IdealModule.idealModule f) := by choose U hy r hr hnzd using hlocal refine ⟨Y, fun y => (U y).1, ?_, fun y => ?_⟩ · apply top_unique intro y _ exact Opens.mem_iSup.mpr ⟨y, hy y⟩ · exact ⟨Invertible.Scheme.Modules.pullbackIsoOfRestrictIso (IdealModule.idealModule f) (U y).1 (principalIdealModuleRestrictionIso f (U y) (r y) (hr y) (hnzd y)).symm⟩ end end OAI.AlgebraicGeometry.SheafCohomology.Projective.IdealInvertible