/- 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 Mathlib.AlgebraicGeometry.ProjectiveSpectrum.Functor import OAI.AlgebraicGeometry.SheafCohomology.Projective.AwayCongr /-! # To Spec Zero -/ namespace OAI.AlgebraicGeometry.SheafCohomology.Projective.ToSpecZero /-! # Naturality of `Proj.toSpecZero` under `Proj.map` For a graded ring homomorphism `g: π’œ β†’+*ᡍ ℬ` (with the irrelevant-ideal hypothesis of `Proj.map`), the structure morphism `Proj.toSpecZero` is natural: `Proj.map g` lies over `Spec` of the degree-`0` restriction of `g`. In particular, when `g` fixes the degree-`0` part (e.g. an `π’œβ‚€`-algebra endomorphism), `Proj.map g` is a morphism over `Spec (π’œ 0)`. This is the scheme-level input for showing that a `Proj`-endomorphism induced by a graded coordinate-ring endomorphism which is the identity in degree `0` β€” such as the negation of a Weierstrass model β€” is a morphism over the base. ## Main definitions / results * `gradedRingHomZero`: the degree-`0` part `π’œ 0 β†’+* ℬ 0` of a graded ring hom. * `map_comp_toSpecZero`: `Proj.map g hf ≫ Proj.toSpecZero π’œ = Proj.toSpecZero ℬ ≫ Spec.map gβ‚€`. AINTLIB Hodge.Projective (T-W7.0b infrastructure); upstream candidate. -/ open _root_.AlgebraicGeometry _root_.CategoryTheory _root_.HomogeneousLocalization universe u variable {R A S B : Type u} [CommRing R] [CommRing A] [Algebra R A] [CommRing S] [CommRing B] [Algebra S B] {π’œ : β„• β†’ Submodule R A} [GradedAlgebra π’œ] {ℬ : β„• β†’ Submodule S B} [GradedAlgebra ℬ] /-- For a positive-degree homogeneous element, the map on global sections induced by `Proj.awayΞΉ` is restriction to the basic open followed by the inverse of the canonical homogeneous-localization presentation. -/ theorem Proj_awayΞΉ_appTop_Ξ“SpecIso (π’œ : β„• β†’ Submodule R A) [GradedAlgebra π’œ] {m : β„•} (f : A) (f_deg : f ∈ π’œ m) (hm : 0 < m) : (Proj.awayΞΉ π’œ f f_deg hm).appTop ≫ (Scheme.Ξ“SpecIso (CommRingCat.of (HomogeneousLocalization.Away π’œ f))).hom = (Proj π’œ).presheaf.map (homOfLE le_top).op ≫ (Proj.basicOpenIsoAway π’œ f f_deg hm).inv := by rw [Iso.eq_comp_inv, Category.assoc] have hΟƒ : (Proj.basicOpenIsoAway π’œ f f_deg hm).hom = Proj.awayToSection π’œ f := rfl rw [hΟƒ] have hhomTop : (Proj.basicOpenToSpec π’œ f).appTop ≫ (Proj.basicOpen π’œ f).topIso.hom = (Scheme.Ξ“SpecIso _).hom ≫ Proj.awayToSection π’œ f := by rw [show (Proj.basicOpenToSpec π’œ f).appTop = (Proj.basicOpenToSpec π’œ f).app ⊀ from rfl] rw [Proj.basicOpenToSpec_app_top, Category.assoc, Category.assoc, Iso.inv_hom_id, Category.comp_id] rw [← hhomTop, ← Proj.basicOpenIsoSpec_inv_ΞΉ π’œ f f_deg hm, Scheme.Hom.comp_appTop, Category.assoc] rw [show Proj.basicOpenToSpec π’œ f = (Proj.basicOpenIsoSpec π’œ f f_deg hm).hom from rfl] rw [← Category.assoc ((Proj.basicOpenIsoSpec π’œ f f_deg hm).inv.appTop)] rw [show (Proj.basicOpenIsoSpec π’œ f f_deg hm).inv.appTop ≫ (Proj.basicOpenIsoSpec π’œ f f_deg hm).hom.appTop = πŸ™ _ from by rw [← Scheme.Hom.comp_appTop, Iso.hom_inv_id] simp] rw [Category.id_comp, Scheme.Opens.ΞΉ_appTop, Scheme.Opens.topIso_hom] refine ((Proj π’œ).presheaf.map_comp _ _).symm.trans (congrArg ((Proj π’œ).presheaf.map) ?_) exact Quiver.Hom.unop_inj (Subsingleton.elim _ _) /-- The composite from a coefficient ring to sections on a positive projective basic open, then to its degree-zero homogeneous localization, is the canonical degree-zero map. -/ theorem Proj_structure_section_square (π’œ : β„• β†’ Submodule R A) [GradedAlgebra π’œ] (c : S β†’+* π’œ 0) {m : β„•} (f : A) (f_deg : f ∈ π’œ m) (hm : 0 < m) : (Scheme.Ξ“SpecIso (CommRingCat.of S)).inv ≫ (Proj.toSpecZero π’œ ≫ Spec.map (CommRingCat.ofHom c)).appTop ≫ (Proj π’œ).presheaf.map (homOfLE le_top).op ≫ (Proj.basicOpenIsoAway π’œ f f_deg hm).inv = CommRingCat.ofHom ((HomogeneousLocalization.fromZeroRingHom π’œ (Submonoid.powers f)).comp c) := by have hbridge := Proj_awayΞΉ_appTop_Ξ“SpecIso π’œ f f_deg hm have hscheme : Proj.awayΞΉ π’œ f f_deg hm ≫ (Proj.toSpecZero π’œ ≫ Spec.map (CommRingCat.ofHom c)) = Spec.map (CommRingCat.ofHom ((HomogeneousLocalization.fromZeroRingHom π’œ (Submonoid.powers f)).comp c)) := by rw [← Category.assoc, Proj.awayΞΉ_toSpecZero, ← Spec.map_comp, ← CommRingCat.ofHom_comp] have hΞ“ := congrArg Scheme.Hom.appTop hscheme rw [Scheme.Hom.comp_appTop] at hΞ“ calc (Scheme.Ξ“SpecIso (CommRingCat.of S)).inv ≫ (Proj.toSpecZero π’œ ≫ Spec.map (CommRingCat.ofHom c)).appTop ≫ (Proj π’œ).presheaf.map (homOfLE le_top).op ≫ (Proj.basicOpenIsoAway π’œ f f_deg hm).inv = (Scheme.Ξ“SpecIso (CommRingCat.of S)).inv ≫ ((Proj.toSpecZero π’œ ≫ Spec.map (CommRingCat.ofHom c)).appTop ≫ (Proj.awayΞΉ π’œ f f_deg hm).appTop) ≫ (Scheme.Ξ“SpecIso (CommRingCat.of (HomogeneousLocalization.Away π’œ f))).hom := by rw [← hbridge] simp only [Category.assoc] _ = (Scheme.Ξ“SpecIso (CommRingCat.of S)).inv ≫ (Spec.map (CommRingCat.ofHom ((HomogeneousLocalization.fromZeroRingHom π’œ (Submonoid.powers f)).comp c))).appTop ≫ (Scheme.Ξ“SpecIso (CommRingCat.of (HomogeneousLocalization.Away π’œ f))).hom := by rw [hΞ“] _ = _ := by rw [Scheme.Ξ“SpecIso_naturality, ← Category.assoc, Iso.inv_hom_id, Category.id_comp] /-- The degree-`0` part of a graded ring homomorphism, as a ring homomorphism `π’œ 0 β†’+* ℬ 0`. -/ def gradedRingHomZero (g : π’œ β†’+*ᡍ ℬ) : π’œ 0 β†’+* ℬ 0 where toFun a := ⟨g a, g.map_mem a.2⟩ map_one' := Subtype.ext (by simp [g.map_one]) map_mul' a b := Subtype.ext (by simp [g.map_mul a b]) map_zero' := Subtype.ext (by simp) map_add' a b := Subtype.ext (by simp) @[simp] lemma gradedRingHomZero_coe (g : π’œ β†’+*ᡍ ℬ) (a : π’œ 0) : (gradedRingHomZero g a : B) = g a := rfl set_option backward.isDefEq.respectTransparency false in /-- **Naturality of `Proj.toSpecZero` under `Proj.map`.** For a graded ring hom `g: π’œ β†’+*ᡍ ℬ`, the induced `Proj.map g` sits over `Spec` of the degree-`0` restriction. -/ theorem map_comp_toSpecZero (g : π’œ β†’+*ᡍ ℬ) (hf : HomogeneousIdeal.irrelevant ℬ ≀ (HomogeneousIdeal.irrelevant π’œ).map g) : Proj.map g hf ≫ Proj.toSpecZero π’œ = Proj.toSpecZero ℬ ≫ Spec.map (CommRingCat.ofHom (gradedRingHomZero g)) := by refine (Proj.mapAffineOpenCover g hf).openCover.hom_ext _ _ fun s ↦ ?_ simp only [Scheme.AffineOpenCover.openCover_f, Proj.mapAffineOpenCover_f] rw [← Category.assoc, Proj.awayΞΉ_comp_map g hf s.1.2 s.2 s.2.2, Category.assoc, Proj.awayΞΉ_toSpecZero, ← Category.assoc, Proj.awayΞΉ_toSpecZero, ← Spec.map_comp, ← Spec.map_comp, ← CommRingCat.ofHom_comp, ← CommRingCat.ofHom_comp] congr 2 exact RingHom.ext fun a => AwayCongr.awayMap_fromZeroRingHom g s.2 a end OAI.AlgebraicGeometry.SheafCohomology.Projective.ToSpecZero