File: Mathlib/AlgebraicGeometry/ProjectiveSpectrum/StructureSheaf.lean

full_name: AlgebraicGeometry._aux_Mathlib_AlgebraicGeometry_ProjectiveSpectrum_StructureSheaf___macroRules_AlgebraicGeometry_termAt__1
code: local notation3 "at " x =>
  HomogeneousLocalization.AtPrime 𝒜
    (HomogeneousIdeal.toIdeal (ProjectiveSpectrum.asHomogeneousIdeal x))
goal: Lean.Macro

full_name: AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.IsFraction
code: /-- The predicate saying that a dependent function on an open `U` is realised as a fixed fraction
`r / s` of *same grading* in each of the stalks (which are localizations at various prime ideals).
-/
def IsFraction {U : Opens (ProjectiveSpectrum.top 𝒜)} (f : ∀ x : U, at x.1) : Prop 
goal: Prop

full_name: AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.isFractionPrelocal
code: /--
The predicate `IsFraction` is "prelocal", in the sense that if it holds on `U` it holds on any open
subset `V` of `U`.
-/
def isFractionPrelocal : PrelocalPredicate fun x : ProjectiveSpectrum.top 𝒜 => at x 
goal: TopCat.PrelocalPredicate fun x => HomogeneousLocalization.AtPrime 𝒜 x.asHomogeneousIdeal.toIdeal

full_name: AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.isLocallyFraction
code: /-- We will define the structure sheaf as the subsheaf of all dependent functions in
`Π x : U, HomogeneousLocalization 𝒜 x` consisting of those functions which can locally be expressed
as a ratio of `A` of same grading. -/
def isLocallyFraction : LocalPredicate fun x : ProjectiveSpectrum.top 𝒜 => at x 
goal: TopCat.LocalPredicate fun x => HomogeneousLocalization.AtPrime 𝒜 x.asHomogeneousIdeal.toIdeal

full_name: AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.SectionSubring.zero_mem'
code: theorem zero_mem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) :
    (isLocallyFraction 𝒜).pred (0 : ∀ x : U.unop, at x.1) 
goal: (AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.isLocallyFraction 𝒜).pred 0

full_name: AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.SectionSubring.one_mem'
code: theorem one_mem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) :
    (isLocallyFraction 𝒜).pred (1 : ∀ x : U.unop, at x.1) 
goal: (AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.isLocallyFraction 𝒜).pred 1

full_name: AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.SectionSubring.add_mem'
code: theorem add_mem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) (a b : ∀ x : U.unop, at x.1)
    (ha : (isLocallyFraction 𝒜).pred a) (hb : (isLocallyFraction 𝒜).pred b) :
    (isLocallyFraction 𝒜).pred (a + b) 
goal: (AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.isLocallyFraction 𝒜).pred (a + b)

full_name: AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.SectionSubring.neg_mem'
code: theorem neg_mem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) (a : ∀ x : U.unop, at x.1)
    (ha : (isLocallyFraction 𝒜).pred a) : (isLocallyFraction 𝒜).pred (-a) 
goal: (AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.isLocallyFraction 𝒜).pred (-a)

full_name: AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.SectionSubring.mul_mem'
code: theorem mul_mem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) (a b : ∀ x : U.unop, at x.1)
    (ha : (isLocallyFraction 𝒜).pred a) (hb : (isLocallyFraction 𝒜).pred b) :
    (isLocallyFraction 𝒜).pred (a * b) 
goal: (AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.isLocallyFraction 𝒜).pred (a * b)

full_name: AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.sectionsSubring
code: /-- The functions satisfying `isLocallyFraction` form a subring of all dependent functions
`Π x : U, HomogeneousLocalization 𝒜 x`. -/
def sectionsSubring (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) :
    Subring (∀ x : U.unop, at x.1) 
goal: Subring ((x : ↥(Opposite.unop U)) → HomogeneousLocalization.AtPrime 𝒜 (↑x).asHomogeneousIdeal.toIdeal)

full_name: AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.structureSheafInType
code: /-- The structure sheaf (valued in `Type`, not yet `CommRing`) is the subsheaf consisting of
functions satisfying `isLocallyFraction`. -/
def structureSheafInType : Sheaf (Type _) (ProjectiveSpectrum.top 𝒜) 
goal: TopCat.Sheaf (Type u_2) (ProjectiveSpectrum.top 𝒜)

full_name: AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.commRingStructureSheafInTypeObj
code: instance commRingStructureSheafInTypeObj (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) :
    CommRing ((structureSheafInType 𝒜).1.obj U) 
goal: CommRing ((AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.structureSheafInType 𝒜).val.obj U)

full_name: AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.structurePresheafInCommRing_map_apply
code: /-- The structure presheaf, valued in `CommRing`, constructed by dressing up the `Type` valued
structure presheaf. -/
@[simps]
def structurePresheafInCommRing : Presheaf CommRingCat (ProjectiveSpectrum.top 𝒜) 
goal: ∀ {X Y : (TopologicalSpace.Opens ↑(ProjectiveSpectrum.top 𝒜))ᵒᵖ} (i : X ⟶ Y)
  (a : (AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.structureSheafInType 𝒜).val.obj X),
  ((AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.structurePresheafInCommRing 𝒜).map i) a =
    (AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.structureSheafInType 𝒜).val.map i a

full_name: AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.structurePresheafInCommRing_obj
code: /-- The structure presheaf, valued in `CommRing`, constructed by dressing up the `Type` valued
structure presheaf. -/
@[simps]
def structurePresheafInCommRing : Presheaf CommRingCat (ProjectiveSpectrum.top 𝒜) 
goal: (AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.structurePresheafInCommRing 𝒜).obj U =
  CommRingCat.of ((AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.structureSheafInType 𝒜).val.obj U)

full_name: AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.structurePresheafInCommRing
code: /-- The structure presheaf, valued in `CommRing`, constructed by dressing up the `Type` valued
structure presheaf. -/
@[simps]
def structurePresheafInCommRing : Presheaf CommRingCat (ProjectiveSpectrum.top 𝒜) 
goal: TopCat.Presheaf CommRingCat (ProjectiveSpectrum.top 𝒜)

full_name: AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.structurePresheafCompForget
code: /-- Some glue, verifying that the structure presheaf valued in `CommRing` agrees with the `Type`
valued structure presheaf. -/
def structurePresheafCompForget :
    structurePresheafInCommRing 𝒜 ⋙ forget CommRingCat ≅ (structureSheafInType 𝒜).1 
goal: CategoryTheory.Functor.comp (AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.structurePresheafInCommRing 𝒜)
    (CategoryTheory.forget CommRingCat) ≅
  (AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.structureSheafInType 𝒜).val

full_name: AlgebraicGeometry.ProjectiveSpectrum.Proj.structureSheaf
code: /-- The structure sheaf on `Proj` 𝒜, valued in `CommRing`. -/
def Proj.structureSheaf : Sheaf CommRingCat (ProjectiveSpectrum.top 𝒜) 
goal: TopCat.Sheaf CommRingCat (ProjectiveSpectrum.top 𝒜)

full_name: AlgebraicGeometry.Proj.res_apply
code: @[simp]
theorem Proj.res_apply (x) : ((Proj.structureSheaf 𝒜).1.map i s).1 x = s.1 (i.unop x) 
goal: ↑(((AlgebraicGeometry.ProjectiveSpectrum.Proj.structureSheaf 𝒜).val.map i) s) x = ↑s ((fun x => ⟨↑x, ⋯⟩) x)

full_name: AlgebraicGeometry.Proj.ext
code: @[ext] theorem Proj.ext (h : s.1 = t.1) : s = t 
goal: s = t

full_name: AlgebraicGeometry.Proj.add_apply
code: @[simp] theorem Proj.add_apply : (s + t).1 x = s.1 x + t.1 x 
goal: ↑(s + t) x = ↑s x + ↑t x

full_name: AlgebraicGeometry.Proj.mul_apply
code: @[simp] theorem Proj.mul_apply : (s * t).1 x = s.1 x * t.1 x 
goal: ↑(s * t) x = ↑s x * ↑t x

full_name: AlgebraicGeometry.Proj.sub_apply
code: @[simp] theorem Proj.sub_apply : (s - t).1 x = s.1 x - t.1 x 
goal: ↑(s - t) x = ↑s x - ↑t x

full_name: AlgebraicGeometry.Proj.pow_apply
code: @[simp] theorem Proj.pow_apply (n : ℕ) : (s ^ n).1 x = s.1 x ^ n 
goal: ↑(s ^ n) x = ↑s x ^ n

full_name: AlgebraicGeometry.Proj.zero_apply
code: @[simp] theorem Proj.zero_apply : (0 : (Proj.structureSheaf 𝒜).1.obj V).1 x = 0 
goal: ↑0 x = 0

full_name: AlgebraicGeometry.Proj.one_apply
code: @[simp] theorem Proj.one_apply : (1 : (Proj.structureSheaf 𝒜).1.obj V).1 x = 1 
goal: ↑1 x = 1

full_name: AlgebraicGeometry.Proj.toSheafedSpace
code: /-- `Proj` of a graded ring as a `SheafedSpace`-/
def Proj.toSheafedSpace : SheafedSpace CommRingCat 
goal: AlgebraicGeometry.SheafedSpace CommRingCat

full_name: AlgebraicGeometry.openToLocalization
code: /-- The ring homomorphism that takes a section of the structure sheaf of `Proj` on the open set `U`,
implemented as a subtype of dependent functions to localizations at homogeneous prime ideals, and
evaluates the section on the point corresponding to a given homogeneous prime ideal. -/
def openToLocalization (U : Opens (ProjectiveSpectrum.top 𝒜)) (x : ProjectiveSpectrum.top 𝒜)
    (hx : x ∈ U) : (Proj.structureSheaf 𝒜).1.obj (op U) ⟶ CommRingCat.of (at x) 
goal: (AlgebraicGeometry.ProjectiveSpectrum.Proj.structureSheaf 𝒜).val.obj (Opposite.op U) ⟶
  CommRingCat.of (HomogeneousLocalization.AtPrime 𝒜 x.asHomogeneousIdeal.toIdeal)

full_name: AlgebraicGeometry.stalkToFiberRingHom
code: /-- The ring homomorphism from the stalk of the structure sheaf of `Proj` at a point corresponding
to a homogeneous prime ideal `x` to the *homogeneous localization* at `x`,
formed by gluing the `openToLocalization` maps. -/
def stalkToFiberRingHom (x : ProjectiveSpectrum.top 𝒜) :
    (Proj.structureSheaf 𝒜).presheaf.stalk x ⟶ CommRingCat.of (at x) 
goal: (AlgebraicGeometry.ProjectiveSpectrum.Proj.structureSheaf 𝒜).presheaf.stalk x ⟶
  CommRingCat.of (HomogeneousLocalization.AtPrime 𝒜 x.asHomogeneousIdeal.toIdeal)

full_name: AlgebraicGeometry.germ_comp_stalkToFiberRingHom
code: @[simp]
theorem germ_comp_stalkToFiberRingHom (U : Opens (ProjectiveSpectrum.top 𝒜)) (x : U) :
    (Proj.structureSheaf 𝒜).presheaf.germ x ≫ stalkToFiberRingHom 𝒜 x =
      openToLocalization 𝒜 U x x.2 
goal: CategoryTheory.CategoryStruct.comp ((AlgebraicGeometry.ProjectiveSpectrum.Proj.structureSheaf 𝒜).presheaf.germ x)
    (AlgebraicGeometry.stalkToFiberRingHom 𝒜 ↑x) =
  AlgebraicGeometry.openToLocalization 𝒜 U ↑x ⋯

full_name: AlgebraicGeometry.stalkToFiberRingHom_germ'
code: @[simp]
theorem stalkToFiberRingHom_germ' (U : Opens (ProjectiveSpectrum.top 𝒜))
    (x : ProjectiveSpectrum.top 𝒜) (hx : x ∈ U) (s : (Proj.structureSheaf 𝒜).1.obj (op U)) :
    stalkToFiberRingHom 𝒜 x ((Proj.structureSheaf 𝒜).presheaf.germ ⟨x, hx⟩ s) = (s.1 ⟨x, hx⟩ : _) 
goal: (AlgebraicGeometry.stalkToFiberRingHom 𝒜 x)
    (((AlgebraicGeometry.ProjectiveSpectrum.Proj.structureSheaf 𝒜).presheaf.germ ⟨x, hx⟩) s) =
  ↑s ⟨x, hx⟩

full_name: AlgebraicGeometry.stalkToFiberRingHom_germ
code: @[simp]
theorem stalkToFiberRingHom_germ (U : Opens (ProjectiveSpectrum.top 𝒜)) (x : U)
    (s : (Proj.structureSheaf 𝒜).1.obj (op U)) :
    stalkToFiberRingHom 𝒜 x ((Proj.structureSheaf 𝒜).presheaf.germ x s) = s.1 x 
goal: (AlgebraicGeometry.stalkToFiberRingHom 𝒜 ↑x)
    (((AlgebraicGeometry.ProjectiveSpectrum.Proj.structureSheaf 𝒜).presheaf.germ x) s) =
  ↑s x

full_name: AlgebraicGeometry.mem_basicOpen_den
code: theorem mem_basicOpen_den (x : ProjectiveSpectrum.top 𝒜)
    (f : HomogeneousLocalization.NumDenSameDeg 𝒜 x.asHomogeneousIdeal.toIdeal.primeCompl) :
    x ∈ ProjectiveSpectrum.basicOpen 𝒜 f.den 
goal: x ∈ ProjectiveSpectrum.basicOpen 𝒜 ↑f.den

full_name: AlgebraicGeometry.sectionInBasicOpen
code: /-- Given a point `x` corresponding to a homogeneous prime ideal, there is a (dependent) function
such that, for any `f` in the homogeneous localization at `x`, it returns the obvious section in the
basic open set `D(f.den)`-/
def sectionInBasicOpen (x : ProjectiveSpectrum.top 𝒜) :
    ∀ f : HomogeneousLocalization.NumDenSameDeg 𝒜 x.asHomogeneousIdeal.toIdeal.primeCompl,
    (Proj.structureSheaf 𝒜).1.obj (op (ProjectiveSpectrum.basicOpen 𝒜 f.den)) 
goal: ↑((AlgebraicGeometry.ProjectiveSpectrum.Proj.structureSheaf 𝒜).val.obj
    (Opposite.op (ProjectiveSpectrum.basicOpen 𝒜 ↑f.den)))

full_name: AlgebraicGeometry.homogeneousLocalizationToStalk
code: /-- Given any point `x` and `f` in the homogeneous localization at `x`, there is an element in the
stalk at `x` obtained by `sectionInBasicOpen`. This is the inverse of `stalkToFiberRingHom`.
-/
def homogeneousLocalizationToStalk (x : ProjectiveSpectrum.top 𝒜) (y : at x) :
    (Proj.structureSheaf 𝒜).presheaf.stalk x 
goal: ↑((AlgebraicGeometry.ProjectiveSpectrum.Proj.structureSheaf 𝒜).presheaf.stalk x)

full_name: AlgebraicGeometry.homogeneousLocalizationToStalk_stalkToFiberRingHom
code: lemma homogeneousLocalizationToStalk_stalkToFiberRingHom (x z) :
    homogeneousLocalizationToStalk 𝒜 x (stalkToFiberRingHom 𝒜 x z) = z 
goal: AlgebraicGeometry.homogeneousLocalizationToStalk 𝒜 x ((AlgebraicGeometry.stalkToFiberRingHom 𝒜 x) z) = z

full_name: AlgebraicGeometry.stalkToFiberRingHom_homogeneousLocalizationToStalk
code: lemma stalkToFiberRingHom_homogeneousLocalizationToStalk (x z) :
    stalkToFiberRingHom 𝒜 x (homogeneousLocalizationToStalk 𝒜 x z) = z 
goal: (AlgebraicGeometry.stalkToFiberRingHom 𝒜 x) (AlgebraicGeometry.homogeneousLocalizationToStalk 𝒜 x z) = z

full_name: AlgebraicGeometry.Proj.stalkIso'
code: /-- Using `homogeneousLocalizationToStalk`, we construct a ring isomorphism between stalk at `x`
and homogeneous localization at `x` for any point `x` in `Proj`. -/
def Proj.stalkIso' (x : ProjectiveSpectrum.top 𝒜) :
    (Proj.structureSheaf 𝒜).presheaf.stalk x ≃+* at x 
goal: ↑((AlgebraicGeometry.ProjectiveSpectrum.Proj.structureSheaf 𝒜).presheaf.stalk x) ≃+*
  HomogeneousLocalization.AtPrime 𝒜 x.asHomogeneousIdeal.toIdeal

full_name: AlgebraicGeometry.Proj.stalkIso'_germ'
code: @[simp]
theorem Proj.stalkIso'_germ' (U : Opens (ProjectiveSpectrum.top 𝒜))
    (x : ProjectiveSpectrum.top 𝒜) (hx : x ∈ U) (s : (Proj.structureSheaf 𝒜).1.obj (op U)) :
    Proj.stalkIso' 𝒜 x ((Proj.structureSheaf 𝒜).presheaf.germ ⟨x, hx⟩ s) = (s.1 ⟨x, hx⟩ : _) 
goal: (AlgebraicGeometry.Proj.stalkIso' 𝒜 x)
    (((AlgebraicGeometry.ProjectiveSpectrum.Proj.structureSheaf 𝒜).presheaf.germ ⟨x, hx⟩) s) =
  ↑s ⟨x, hx⟩

full_name: AlgebraicGeometry.Proj.stalkIso'_germ
code: @[simp]
theorem Proj.stalkIso'_germ (U : Opens (ProjectiveSpectrum.top 𝒜)) (x : U)
    (s : (Proj.structureSheaf 𝒜).1.obj (op U)) :
    Proj.stalkIso' 𝒜 x ((Proj.structureSheaf 𝒜).presheaf.germ x s) = s.1 x 
goal: (AlgebraicGeometry.Proj.stalkIso' 𝒜 ↑x)
    (((AlgebraicGeometry.ProjectiveSpectrum.Proj.structureSheaf 𝒜).presheaf.germ x) s) =
  ↑s x

full_name: AlgebraicGeometry.Proj.stalkIso'_symm_mk
code: @[simp]
theorem Proj.stalkIso'_symm_mk (x) (f) :
    (Proj.stalkIso' 𝒜 x).symm (.mk f) = (Proj.structureSheaf 𝒜).presheaf.germ
      ⟨x, mem_basicOpen_den _ x f⟩ (sectionInBasicOpen _ x f) 
goal: (AlgebraicGeometry.Proj.stalkIso' 𝒜 x).symm (HomogeneousLocalization.mk f) =
  ((AlgebraicGeometry.ProjectiveSpectrum.Proj.structureSheaf 𝒜).presheaf.germ ⟨x, ⋯⟩)
    (AlgebraicGeometry.sectionInBasicOpen 𝒜 x f)

full_name: AlgebraicGeometry.Proj.toLocallyRingedSpace
code: /-- `Proj` of a graded ring as a `LocallyRingedSpace`-/
def Proj.toLocallyRingedSpace : LocallyRingedSpace 
goal: AlgebraicGeometry.LocallyRingedSpace