# The structure sheaf on PrimeSpectrum R. #

We define the structure sheaf on TopCat.of (PrimeSpectrum R), for a commutative ring R and prove basic properties about it. We define this as a subsheaf of the sheaf of dependent functions into the localizations, cut out by the condition that the function must be locally equal to a ratio of elements of R.

Because the condition "is equal to a fraction" passes to smaller open subsets, the subset of functions satisfying this condition is automatically a subpresheaf. Because the condition "is locally equal to a fraction" is local, it is also a subsheaf.

(It may be helpful to refer back to Mathlib/Topology/Sheaves/SheafOfFunctions.lean, where we show that dependent functions into any type family form a sheaf, and also Mathlib/Topology/Sheaves/LocalPredicate.lean, where we characterise the predicates which pick out sub-presheaves and sub-sheaves of these sheaves.)

We also set up the ring structure, obtaining structureSheaf : Sheaf CommRingCat (PrimeSpectrum.Top R).

We then construct two basic isomorphisms, relating the structure sheaf to the underlying ring R. First, StructureSheaf.stalkIso gives an isomorphism between the stalk of the structure sheaf at a point p and the localization of R at the prime ideal p. Second, StructureSheaf.basicOpenIso gives an isomorphism between the structure sheaf on basicOpen f and the localization of R at the submonoid of powers of f.

## References #

• [Robin Hartshorne, Algebraic Geometry][Har77]

The prime spectrum, just as a topological space.

Equations
Instances For

The type family over PrimeSpectrum R consisting of the localization over each point.

Equations
Instances For
Equations
• =
Equations
• = { default := 1 }
Equations
def AlgebraicGeometry.StructureSheaf.IsFraction {R : Type u} [] (f : (x : U) → ) :

The predicate saying that a dependent function on an open U is realised as a fixed fraction r / s in each of the stalks (which are localizations at various prime ideals).

Equations
• One or more equations did not get rendered due to their size.
Instances For
theorem AlgebraicGeometry.StructureSheaf.IsFraction.eq_mk' {R : Type u} [] {f : (x : U) → } :
∃ (r : R) (s : R), ∀ (x : U), ∃ (hs : s(x).asIdeal), f x = IsLocalization.mk' (Localization.AtPrime (x).asIdeal) r s, hs

The predicate IsFraction is "prelocal", in the sense that if it holds on U it holds on any open subset V of U.

Equations
• One or more equations did not get rendered due to their size.
Instances For

We will define the structure sheaf as the subsheaf of all dependent functions in Π x : U, Localizations R x consisting of those functions which can locally be expressed as a ratio of (the images in the localization of) elements of R.

Quoting Hartshorne:

For an open set $U ⊆ Spec A$, we define $𝒪(U)$ to be the set of functions $s : U → ⨆_{𝔭 ∈ U} A_𝔭$, such that $s(𝔭) ∈ A_𝔭$ for each $𝔭$, and such that $s$ is locally a quotient of elements of $A$: to be precise, we require that for each $𝔭 ∈ U$, there is a neighborhood $V$ of $𝔭$, contained in $U$, and elements $a, f ∈ A$, such that for each $𝔮 ∈ V, f ∉ 𝔮$, and $s(𝔮) = a/f$ in $A_𝔮$.

Now Hartshorne had the disadvantage of not knowing about dependent functions, so we replace his circumlocution about functions into a disjoint union with Π x : U, Localizations x.

Equations
Instances For
@[simp]
theorem AlgebraicGeometry.StructureSheaf.isLocallyFraction_pred (R : Type u) [] (f : (x : U) → ) :
= ∀ (x : U), ∃ (V : ) (_ : x V) (i : V U) (r : R) (s : R), ∀ (y : V), s(y).asIdeal f ((fun (x : V) => x, ) y) * (algebraMap R (AlgebraicGeometry.StructureSheaf.Localizations R ((fun (x : V) => x, ) y))) s = (algebraMap R (AlgebraicGeometry.StructureSheaf.Localizations R ((fun (x : V) => x, ) y))) r
def AlgebraicGeometry.StructureSheaf.sectionsSubring (R : Type u) [] :
Subring ((x : U.unop) → )

The functions satisfying isLocallyFraction form a subring.

Equations
• One or more equations did not get rendered due to their size.
Instances For

The structure sheaf (valued in Type, not yet CommRingCat) is the subsheaf consisting of functions satisfying isLocallyFraction.

Equations
Instances For
@[simp]
theorem AlgebraicGeometry.structurePresheafInCommRing_map_apply (R : Type u) [] (i : U V) :
∀ (a : .obj U), () a = .map i a

The structure presheaf, valued in CommRingCat, constructed by dressing up the Type valued structure presheaf.

Equations
• One or more equations did not get rendered due to their size.
Instances For

Some glue, verifying that the structure presheaf valued in CommRingCat agrees with the Type valued structure presheaf.

Equations
• One or more equations did not get rendered due to their size.
Instances For

The structure sheaf on $Spec R$, valued in CommRingCat.

This is provided as a bundled SheafedSpace as Spec.SheafedSpace R later.

Equations
• = { val := , cond := }
Instances For
@[simp]
theorem AlgebraicGeometry.StructureSheaf.res_apply (R : Type u) [] (i : V U) (s : (.obj { unop := U })) (x : V) :
((.map i.op) s) x = s ((fun (x : V) => x, ) x)
def AlgebraicGeometry.StructureSheaf.const (R : Type u) [] (f : R) (g : R) (hu : xU, g x.asIdeal.primeCompl) :
(.obj { unop := U })

The section of structureSheaf R on an open U sending each x ∈ U to the element f/g in the localization of R at x.

Equations
• = fun (x : { unop := U }.unop) => ,
Instances For
@[simp]
theorem AlgebraicGeometry.StructureSheaf.const_apply (R : Type u) [] (f : R) (g : R) (hu : xU, g x.asIdeal.primeCompl) (x : U) :
() x =
theorem AlgebraicGeometry.StructureSheaf.const_apply' (R : Type u) [] (f : R) (g : R) (hu : xU, g x.asIdeal.primeCompl) (x : U) (hx : g (x).asIdeal.primeCompl) :
() x =
theorem AlgebraicGeometry.StructureSheaf.exists_const (R : Type u) [] (s : (.obj { unop := U })) (x : ) (hx : x U) :
∃ (V : ) (_ : x V) (i : V U) (f : R) (g : R) (hg : xV, g x.asIdeal.primeCompl), = (.map i.op) s
@[simp]
theorem AlgebraicGeometry.StructureSheaf.res_const (R : Type u) [] (f : R) (g : R) (hu : xU, g x.asIdeal.primeCompl) (hv : xV, g x.asIdeal.primeCompl) (i : { unop := U } { unop := V }) :
(.map i) () =
theorem AlgebraicGeometry.StructureSheaf.res_const' (R : Type u) [] (f : R) (g : R) (hv : ) :
(.map .op) =
theorem AlgebraicGeometry.StructureSheaf.const_zero (R : Type u) [] (f : R) (hu : xU, f x.asIdeal.primeCompl) :
= 0
theorem AlgebraicGeometry.StructureSheaf.const_self (R : Type u) [] (f : R) (hu : xU, f x.asIdeal.primeCompl) :
= 1
theorem AlgebraicGeometry.StructureSheaf.const_add (R : Type u) [] (f₁ : R) (f₂ : R) (g₁ : R) (g₂ : R) (hu₁ : xU, g₁ x.asIdeal.primeCompl) (hu₂ : xU, g₂ x.asIdeal.primeCompl) :
+ = AlgebraicGeometry.StructureSheaf.const R (f₁ * g₂ + f₂ * g₁) (g₁ * g₂) U
theorem AlgebraicGeometry.StructureSheaf.const_mul (R : Type u) [] (f₁ : R) (f₂ : R) (g₁ : R) (g₂ : R) (hu₁ : xU, g₁ x.asIdeal.primeCompl) (hu₂ : xU, g₂ x.asIdeal.primeCompl) :
* = AlgebraicGeometry.StructureSheaf.const R (f₁ * f₂) (g₁ * g₂) U
theorem AlgebraicGeometry.StructureSheaf.const_ext (R : Type u) [] {f₁ : R} {f₂ : R} {g₁ : R} {g₂ : R} {hu₁ : xU, g₁ x.asIdeal.primeCompl} {hu₂ : xU, g₂ x.asIdeal.primeCompl} (h : f₁ * g₂ = f₂ * g₁) :
=
theorem AlgebraicGeometry.StructureSheaf.const_congr (R : Type u) [] {f₁ : R} {f₂ : R} {g₁ : R} {g₂ : R} {hu : xU, g₁ x.asIdeal.primeCompl} (hf : f₁ = f₂) (hg : g₁ = g₂) :
=
theorem AlgebraicGeometry.StructureSheaf.const_mul_rev (R : Type u) [] (f : R) (g : R) (hu₁ : xU, g x.asIdeal.primeCompl) (hu₂ : xU, f x.asIdeal.primeCompl) :
* = 1
theorem AlgebraicGeometry.StructureSheaf.const_mul_cancel (R : Type u) [] (f : R) (g₁ : R) (g₂ : R) (hu₁ : xU, g₁ x.asIdeal.primeCompl) (hu₂ : xU, g₂ x.asIdeal.primeCompl) :
* =
theorem AlgebraicGeometry.StructureSheaf.const_mul_cancel' (R : Type u) [] (f : R) (g₁ : R) (g₂ : R) (hu₁ : xU, g₁ x.asIdeal.primeCompl) (hu₂ : xU, g₂ x.asIdeal.primeCompl) :
* =
def AlgebraicGeometry.StructureSheaf.toOpen (R : Type u) [] :
.obj { unop := U }

The canonical ring homomorphism interpreting an element of R as a section of the structure sheaf.

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
@[simp]
theorem AlgebraicGeometry.StructureSheaf.toOpen_apply (R : Type u) [] (f : R) (x : U) :
() x =
def AlgebraicGeometry.StructureSheaf.toStalk (R : Type u) [] (x : ) :
.presheaf.stalk x

The canonical ring homomorphism interpreting an element of R as an element of the stalk of structureSheaf R at x.

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
@[simp]
theorem AlgebraicGeometry.StructureSheaf.germ_toOpen (R : Type u) [] (x : U) (f : R) :
(.presheaf.germ x) () =
theorem AlgebraicGeometry.StructureSheaf.germ_to_top (R : Type u) [] (x : ) (f : R) :
(.presheaf.germ x, trivial) =
theorem AlgebraicGeometry.StructureSheaf.isUnit_toStalk (R : Type u) [] (x : ) (f : x.asIdeal.primeCompl) :

The canonical ring homomorphism from the localization of R at p to the stalk of the structure sheaf at the point p.

Equations
• = let_fun this := ; this
Instances For
@[simp]
theorem AlgebraicGeometry.StructureSheaf.localizationToStalk_of (R : Type u) [] (x : ) (f : R) :
((algebraMap R (Localization x.asIdeal.primeCompl)) f) =
@[simp]
theorem AlgebraicGeometry.StructureSheaf.localizationToStalk_mk' (R : Type u) [] (x : ) (f : R) (s : x.asIdeal.primeCompl) :
(IsLocalization.mk' (Localization.AtPrime x.asIdeal) f s) = (.presheaf.germ x, ) ()
def AlgebraicGeometry.StructureSheaf.openToLocalization (R : Type u) [] (x : ) (hx : x U) :
.obj { unop := U } CommRingCat.of (Localization.AtPrime x.asIdeal)

The ring homomorphism that takes a section of the structure sheaf of R on the open set U, implemented as a subtype of dependent functions to localizations at prime ideals, and evaluates the section on the point corresponding to a given prime ideal.

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem AlgebraicGeometry.StructureSheaf.coe_openToLocalization (R : Type u) [] (x : ) (hx : x U) :
= fun (s : (.obj { unop := U })) => s x, hx
theorem AlgebraicGeometry.StructureSheaf.openToLocalization_apply (R : Type u) [] (x : ) (hx : x U) (s : (.obj { unop := U })) :
= s x, hx

The ring homomorphism from the stalk of the structure sheaf of R at a point corresponding to a prime ideal p to the localization of R at p, formed by gluing the openToLocalization maps.

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem AlgebraicGeometry.StructureSheaf.stalkToFiberRingHom_germ' (R : Type u) [] (x : ) (hx : x U) (s : (.obj { unop := U })) :
((.presheaf.germ x, hx) s) = s x, hx
@[simp]
theorem AlgebraicGeometry.StructureSheaf.stalkToFiberRingHom_germ (R : Type u) [] (x : U) (s : (.obj { unop := U })) :
((.presheaf.germ x) s) = s x
@[simp]
@[simp]
def AlgebraicGeometry.StructureSheaf.stalkIso (R : Type u) [] (x : ) :
.presheaf.stalk x CommRingCat.of (Localization.AtPrime x.asIdeal)

The ring isomorphism between the stalk of the structure sheaf of R at a point p corresponding to a prime ideal in R and the localization of R at p.

Equations
• One or more equations did not get rendered due to their size.
Instances For
Equations
• =
Equations
• =
@[simp]
@[simp]
def AlgebraicGeometry.StructureSheaf.toBasicOpen (R : Type u) [] (f : R) :
→+* (.obj { unop := })

The canonical ring homomorphism interpreting s ∈ R_f as a section of the structure sheaf on the basic open defined by f ∈ R.

Equations
Instances For
@[simp]
theorem AlgebraicGeometry.StructureSheaf.toBasicOpen_mk' (R : Type u) [] (s : R) (f : R) (g : ()) :
@[simp]
theorem AlgebraicGeometry.StructureSheaf.toBasicOpen_to_map (R : Type u) [] (s : R) (f : R) :
theorem AlgebraicGeometry.StructureSheaf.locally_const_basicOpen (R : Type u) [] (s : (.obj { unop := U })) (x : U) :
∃ (f : R) (g : R) (i : ), = (.map i.op) s
theorem AlgebraicGeometry.StructureSheaf.normalize_finite_fraction_representation (R : Type u) [] (s : (.obj { unop := U })) {ι : Type u_1} (t : ) (a : ιR) (h : ιR) (iDh : (i : ι) → U) (h_cover : U it, ) (hs : ∀ (i : ι), AlgebraicGeometry.StructureSheaf.const R (a i) (h i) () = (.map (iDh i).op) s) :
∃ (a' : ιR) (h' : ιR) (iDh' : (i : ι) → PrimeSpectrum.basicOpen (h' i) U), U it, PrimeSpectrum.basicOpen (h' i) (it, jt, a' i * h' j = h' i * a' j) it, (.map (iDh' i).op) s = AlgebraicGeometry.StructureSheaf.const R (a' i) (h' i) (PrimeSpectrum.basicOpen (h' i))
instance AlgebraicGeometry.StructureSheaf.isIso_toBasicOpen (R : Type u) [] (f : R) :
CategoryTheory.IsIso (let_fun this := ; this)
Equations
• =
def AlgebraicGeometry.StructureSheaf.basicOpenIso (R : Type u) [] (f : R) :
.obj { unop := }

The ring isomorphism between the structure sheaf on basicOpen f and the localization of R at the submonoid of powers of f.

Equations
Instances For
instance AlgebraicGeometry.StructureSheaf.stalkAlgebra (R : Type u) [] (p : ) :
Algebra R (.presheaf.stalk p)
Equations
@[simp]
theorem AlgebraicGeometry.StructureSheaf.stalkAlgebra_map (R : Type u) [] (p : ) (r : R) :
(algebraMap R (.presheaf.stalk p)) r =
instance AlgebraicGeometry.StructureSheaf.IsLocalization.to_stalk (R : Type u) [] (p : ) :
IsLocalization.AtPrime ((.presheaf.stalk p)) p.asIdeal

Stalk of the structure sheaf at a prime p as localization of R

Equations
• =
instance AlgebraicGeometry.StructureSheaf.openAlgebra (R : Type u) [] (U : ) :
Algebra R (.obj U)
Equations
@[simp]
theorem AlgebraicGeometry.StructureSheaf.openAlgebra_map (R : Type u) [] (U : ) (r : R) :
(algebraMap R (.obj U)) r = () r

Sections of the structure sheaf of Spec R on a basic open as localization of R

Equations
• =
Equations
• =
theorem AlgebraicGeometry.StructureSheaf.to_global_factors_apply (R : Type u) [] (x : ) :
= (.map ) ( (() x))
Equations
• =
@[simp]
@[simp]
theorem AlgebraicGeometry.StructureSheaf.globalSectionsIso_hom_apply_coe (R : Type u) [] (f : ()) (x : { unop := }.unop) :
x =

The ring isomorphism between the ring R and the global sections Γ(X, 𝒪ₓ).

Equations
Instances For
theorem AlgebraicGeometry.StructureSheaf.toStalk_stalkSpecializes_assoc {R : Type u_1} [] {x : } {y : } (h : x y) {Z : CommRingCat} (h : .presheaf.stalk x Z) :
theorem AlgebraicGeometry.StructureSheaf.toStalk_stalkSpecializes_apply {R : Type u_1} [] {x : } {y : } (h : x✝ y) (x : ) :
(.presheaf.stalkSpecializes h) () =
@[simp]
theorem AlgebraicGeometry.StructureSheaf.toStalk_stalkSpecializes {R : Type u_1} [] {x : } {y : } (h : x y) :
CategoryTheory.CategoryStruct.comp (.presheaf.stalkSpecializes h) =
theorem AlgebraicGeometry.StructureSheaf.localizationToStalk_stalkSpecializes_assoc {R : Type u_1} [] {x : } {y : } (h : x y) {Z : CommRingCat} (h : .presheaf.stalk x Z) :
theorem AlgebraicGeometry.StructureSheaf.localizationToStalk_stalkSpecializes_apply {R : Type u_1} [] {x : } {y : } (h : x✝ y) (x : (CommRingCat.of (Localization.AtPrime y.asIdeal))) :
(.presheaf.stalkSpecializes h) =
@[simp]
theorem AlgebraicGeometry.StructureSheaf.stalkSpecializes_stalk_to_fiber_apply {R : Type u_1} [] {x : } {y : } (h : x✝ y) (x : (.presheaf.stalk y)) :
((.presheaf.stalkSpecializes h) x) =
@[simp]
theorem AlgebraicGeometry.StructureSheaf.stalkSpecializes_stalk_to_fiber {R : Type u_1} [] {x : } {y : } (h : x y) :
CategoryTheory.CategoryStruct.comp (.presheaf.stalkSpecializes h) = CategoryTheory.CategoryStruct.comp (let_fun this := ; this)
def AlgebraicGeometry.StructureSheaf.comapFun {R : Type u} [] {S : Type u} [] (f : R →+* S) (hUV : V.carrier ⁻¹' U.carrier) (s : (x : U) → ) (y : V) :

Given a ring homomorphism f : R →+* S, an open set U of the prime spectrum of R and an open set V of the prime spectrum of S, such that V ⊆ (comap f) ⁻¹' U, we can push a section s on U to a section on V, by composing with Localization.localRingHom _ _ f from the left and comap f from the right. Explicitly, if s evaluates on comap f p to a / b, its image on V evaluates on p to f(a) / f(b).

At the moment, we work with arbitrary dependent functions s : Π x : U, Localizations R x. Below, we prove the predicate isLocallyFraction is preserved by this map, hence it can be extended to a morphism between the structure sheaves of R and S.

Equations
Instances For
theorem AlgebraicGeometry.StructureSheaf.comapFunIsLocallyFraction {R : Type u} [] {S : Type u} [] (f : R →+* S) (hUV : V.carrier ⁻¹' U.carrier) (s : (x : U) → ) (hs : ) :
()
def AlgebraicGeometry.StructureSheaf.comap {R : Type u} [] {S : Type u} [] (f : R →+* S) (hUV : V.carrier ⁻¹' U.carrier) :
(.obj { unop := U }) →+* (.obj { unop := V })

For a ring homomorphism f : R →+* S and open sets U and V of the prime spectra of R and S such that V ⊆ (comap f) ⁻¹ U, the induced ring homomorphism from the structure sheaf of R at U to the structure sheaf of S at V.

Explicitly, this map is given as follows: For a point p : V, if the section s evaluates on p to the fraction a / b, its image on V evaluates on p to the fraction f(a) / f(b).

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem AlgebraicGeometry.StructureSheaf.comap_apply {R : Type u} [] {S : Type u} [] (f : R →+* S) (hUV : V.carrier ⁻¹' U.carrier) (s : (.obj { unop := U })) (p : V) :
(() s) p = (Localization.localRingHom ( p).asIdeal (p).asIdeal f ) (s p, )
theorem AlgebraicGeometry.StructureSheaf.comap_const {R : Type u} [] {S : Type u} [] (f : R →+* S) (hUV : V.carrier ⁻¹' U.carrier) (a : R) (b : R) (hb : xU, b x.asIdeal.primeCompl) :
() () = AlgebraicGeometry.StructureSheaf.const S (f a) (f b) V
theorem AlgebraicGeometry.StructureSheaf.comap_id_eq_map {R : Type u} [] (iVU : V U) :
= .map iVU.op

For an inclusion i : V ⟶ U between open sets of the prime spectrum of R, the comap of the identity from OO_X(U) to OO_X(V) equals as the restriction map of the structure sheaf.

This is a generalization of the fact that, for fixed U, the comap of the identity from OO_X(U) to OO_X(U) is the identity.

theorem AlgebraicGeometry.StructureSheaf.comap_id {R : Type u} [] (hUV : U = V) :

The comap of the identity is the identity. In this variant of the lemma, two open subsets U and V are given as arguments, together with a proof that U = V. This is useful when U and V are not definitionally equal.

@[simp]
theorem AlgebraicGeometry.StructureSheaf.comap_id' {R : Type u} [] :
= RingHom.id (.obj { unop := U })
theorem AlgebraicGeometry.StructureSheaf.comap_comp {R : Type u} [] {S : Type u} [] {P : Type u} [] (f : R →+* S) (g : S →+* P) (hUV : pV, p U) (hVW : pW, p V) :
AlgebraicGeometry.StructureSheaf.comap (g.comp f) U W = ().comp ()
theorem AlgebraicGeometry.StructureSheaf.toOpen_comp_comap_apply {R : Type u} [] {S : Type u} [] (f : R →+* S) (x : ) :
=
theorem AlgebraicGeometry.StructureSheaf.toOpen_comp_comap_assoc {R : Type u} [] {S : Type u} [] (f : R →+* S) {Z : CommRingCat} (h : .obj { unop := } Z) :
theorem AlgebraicGeometry.StructureSheaf.comap_basicOpen {R : Type u} [] {S : Type u} [] (f : R →+* S) (x : R) :
= IsLocalization.map ((.obj { unop := })) f