File: Mathlib/AlgebraicGeometry/AffineScheme.lean

full_name: AlgebraicGeometry.AffineScheme
code: /-- The category of affine schemes -/
-- Porting note(#5171): linter not ported yet
-- @[nolint has_nonempty_instance]
def AffineScheme 
goal: Type (u_1 + 1)

full_name: AlgebraicGeometry.IsAffine
code: /-- A Scheme is affine if the canonical map `X ⟶ Spec Γ(X)` is an isomorphism. -/
class IsAffine (X : Scheme) : Prop where
  affine : IsIso (ΓSpec.adjunction.unit.app X)
goal: Prop

full_name: AlgebraicGeometry.IsAffine.affine
code: /-- A Scheme is affine if the canonical map `X ⟶ Spec Γ(X)` is an isomorphism. -/
class IsAffine (X : Scheme) : Prop where
  affine : IsIso (ΓSpec.adjunction.unit.app X)
goal: CategoryTheory.IsIso (AlgebraicGeometry.ΓSpec.adjunction.unit.app X)

full_name: AlgebraicGeometry.Scheme.isoSpec_hom
code: /-- The canonical isomorphism `X ≅ Spec Γ(X)` for an affine scheme. -/
@[simps! (config := .lemmasOnly) hom]
def Scheme.isoSpec (X : Scheme) [IsAffine X] : X ≅ Spec Γ(X, ⊤) 
goal: X.isoSpec.hom = AlgebraicGeometry.ΓSpec.adjunction.unit.app X

full_name: AlgebraicGeometry.Scheme.isoSpec
code: /-- The canonical isomorphism `X ≅ Spec Γ(X)` for an affine scheme. -/
@[simps! (config := .lemmasOnly) hom]
def Scheme.isoSpec (X : Scheme) [IsAffine X] : X ≅ Spec Γ(X, ⊤) 
goal: X ≅ AlgebraicGeometry.Spec (X.presheaf.obj (Opposite.op ⊤))

full_name: AlgebraicGeometry.Scheme.isoSpec_hom_naturality
code: @[reassoc]
theorem Scheme.isoSpec_hom_naturality {X Y : Scheme} [IsAffine X] [IsAffine Y] (f : X ⟶ Y) :
    X.isoSpec.hom ≫ Spec.map (f.app ⊤) = f ≫ Y.isoSpec.hom 
goal: X.isoSpec.hom ≫ AlgebraicGeometry.Spec.map (AlgebraicGeometry.Scheme.Hom.app f ⊤) = f ≫ Y.isoSpec.hom

full_name: AlgebraicGeometry.Scheme.isoSpec_inv_naturality
code: @[reassoc]
theorem Scheme.isoSpec_inv_naturality {X Y : Scheme} [IsAffine X] [IsAffine Y] (f : X ⟶ Y) :
    Spec.map (f.app ⊤) ≫ Y.isoSpec.inv = X.isoSpec.inv ≫ f 
goal: AlgebraicGeometry.Spec.map (AlgebraicGeometry.Scheme.Hom.app f ⊤) ≫ Y.isoSpec.inv = X.isoSpec.inv ≫ f

full_name: AlgebraicGeometry.AffineScheme.mk
code: /-- Construct an affine scheme from a scheme and the information that it is affine.
Also see `AffineScheme.of` for a typeclass version. -/
@[simps]
def AffineScheme.mk (X : Scheme) (_ : IsAffine X) : AffineScheme 
goal: AlgebraicGeometry.IsAffine X → AlgebraicGeometry.AffineScheme

full_name: AlgebraicGeometry.AffineScheme.mk_obj
code: /-- Construct an affine scheme from a scheme and the information that it is affine.
Also see `AffineScheme.of` for a typeclass version. -/
@[simps]
def AffineScheme.mk (X : Scheme) (_ : IsAffine X) : AffineScheme 
goal: ∀ (x : AlgebraicGeometry.IsAffine X), (AlgebraicGeometry.AffineScheme.mk X x).obj = X

full_name: AlgebraicGeometry.AffineScheme.of
code: /-- Construct an affine scheme from a scheme. Also see `AffineScheme.mk` for a non-typeclass
version. -/
def AffineScheme.of (X : Scheme) [h : IsAffine X] : AffineScheme 
goal: AlgebraicGeometry.AffineScheme

full_name: AlgebraicGeometry.AffineScheme.ofHom
code: /-- Type check a morphism of schemes as a morphism in `AffineScheme`. -/
def AffineScheme.ofHom {X Y : Scheme} [IsAffine X] [IsAffine Y] (f : X ⟶ Y) :
    AffineScheme.of X ⟶ AffineScheme.of Y 
goal: AlgebraicGeometry.AffineScheme.of X ⟶ AlgebraicGeometry.AffineScheme.of Y

full_name: AlgebraicGeometry.mem_Spec_essImage
code: theorem mem_Spec_essImage (X : Scheme) : X ∈ Scheme.Spec.essImage ↔ IsAffine X 
goal: X ∈ AlgebraicGeometry.Scheme.Spec.essImage ↔ AlgebraicGeometry.IsAffine X

full_name: AlgebraicGeometry.isAffine_affineScheme
code: instance isAffine_affineScheme (X : AffineScheme.{u}) : IsAffine X.obj 
goal: AlgebraicGeometry.IsAffine X.obj

full_name: AlgebraicGeometry.instIsAffineObjOppositeCommRingCatSchemeSpec
code: instance (R : CommRingCatᵒᵖ) : IsAffine (Scheme.Spec.obj R) 
goal: AlgebraicGeometry.IsAffine (AlgebraicGeometry.Scheme.Spec.obj R)

full_name: AlgebraicGeometry.isAffine_Spec
code: instance isAffine_Spec (R : CommRingCat) : IsAffine (Spec R) 
goal: AlgebraicGeometry.IsAffine (AlgebraicGeometry.Spec R)

full_name: AlgebraicGeometry.isAffine_of_isIso
code: theorem isAffine_of_isIso {X Y : Scheme} (f : X ⟶ Y) [IsIso f] [h : IsAffine Y] : IsAffine X 
goal: AlgebraicGeometry.IsAffine X

full_name: AlgebraicGeometry.arrowIsoSpecΓOfIsAffine
code: /-- If `f : X ⟶ Y` is a morphism between affine schemes, the corresponding arrow is isomorphic
to the arrow of the morphism on prime spectra induced by the map on global sections. -/
noncomputable
def arrowIsoSpecΓOfIsAffine {X Y : Scheme} [IsAffine X] [IsAffine Y] (f : X ⟶ Y) :
    Arrow.mk f ≅ Arrow.mk (Spec.map (Scheme.Γ.map f.op)) 
goal: CategoryTheory.Arrow.mk f ≅ CategoryTheory.Arrow.mk (AlgebraicGeometry.Spec.map (AlgebraicGeometry.Scheme.Γ.map f.op))

full_name: AlgebraicGeometry.AffineScheme.Spec
code: /-- The `Spec` functor into the category of affine schemes. -/
def Spec : CommRingCatᵒᵖ ⥤ AffineScheme 
goal: CommRingCatᵒᵖ ⥤ AlgebraicGeometry.AffineScheme

full_name: AlgebraicGeometry.AffineScheme.Spec_full
code: instance Spec_full : Spec.Full 
goal: AlgebraicGeometry.AffineScheme.Spec.Full

full_name: AlgebraicGeometry.AffineScheme.Spec_faithful
code: instance Spec_faithful : Spec.Faithful 
goal: AlgebraicGeometry.AffineScheme.Spec.Faithful

full_name: AlgebraicGeometry.AffineScheme.Spec_essSurj
code: instance Spec_essSurj : Spec.EssSurj 
goal: AlgebraicGeometry.AffineScheme.Spec.EssSurj

full_name: AlgebraicGeometry.AffineScheme.forgetToScheme_map
code: /-- The forgetful functor `AffineScheme ⥤ Scheme`. -/
@[simps!]
def forgetToScheme : AffineScheme ⥤ Scheme 
goal: ∀ {X Y : CategoryTheory.InducedCategory AlgebraicGeometry.Scheme CategoryTheory.FullSubcategory.obj} (f : X ⟶ Y),
  AlgebraicGeometry.AffineScheme.forgetToScheme.map f = f

full_name: AlgebraicGeometry.AffineScheme.forgetToScheme
code: /-- The forgetful functor `AffineScheme ⥤ Scheme`. -/
@[simps!]
def forgetToScheme : AffineScheme ⥤ Scheme 
goal: AlgebraicGeometry.AffineScheme ⥤ AlgebraicGeometry.Scheme

full_name: AlgebraicGeometry.AffineScheme.forgetToScheme_obj
code: /-- The forgetful functor `AffineScheme ⥤ Scheme`. -/
@[simps!]
def forgetToScheme : AffineScheme ⥤ Scheme 
goal: AlgebraicGeometry.AffineScheme.forgetToScheme.obj self = self.obj

full_name: AlgebraicGeometry.AffineScheme.forgetToScheme_full
code: instance forgetToScheme_full : forgetToScheme.Full 
goal: AlgebraicGeometry.AffineScheme.forgetToScheme.Full

full_name: AlgebraicGeometry.AffineScheme.forgetToScheme_faithful
code: instance forgetToScheme_faithful : forgetToScheme.Faithful 
goal: AlgebraicGeometry.AffineScheme.forgetToScheme.Faithful

full_name: AlgebraicGeometry.AffineScheme.Γ
code: /-- The global section functor of an affine scheme. -/
def Γ : AffineSchemeᵒᵖ ⥤ CommRingCat 
goal: AlgebraicGeometry.AffineSchemeᵒᵖ ⥤ CommRingCat

full_name: AlgebraicGeometry.AffineScheme.equivCommRingCat
code: /-- The category of affine schemes is equivalent to the category of commutative rings. -/
def equivCommRingCat : AffineScheme ≌ CommRingCatᵒᵖ 
goal: AlgebraicGeometry.AffineScheme ≌ CommRingCatᵒᵖ

full_name: AlgebraicGeometry.AffineScheme.instIsEquivalenceOppositeCommRingCatRightOpΓ
code: instance : Γ.{u}.rightOp.IsEquivalence 
goal: AlgebraicGeometry.AffineScheme.Γ.rightOp.IsEquivalence

full_name: AlgebraicGeometry.AffineScheme.instIsEquivalenceOppositeCommRingCatOpRightOpΓ
code: instance : Γ.{u}.rightOp.op.IsEquivalence 
goal: AlgebraicGeometry.AffineScheme.Γ.rightOp.op.IsEquivalence

full_name: AlgebraicGeometry.AffineScheme.ΓIsEquiv
code: instance ΓIsEquiv : Γ.{u}.IsEquivalence 
goal: AlgebraicGeometry.AffineScheme.Γ.IsEquivalence

full_name: AlgebraicGeometry.AffineScheme.hasColimits
code: instance hasColimits : HasColimits AffineScheme.{u} 
goal: CategoryTheory.Limits.HasColimits AlgebraicGeometry.AffineScheme

full_name: AlgebraicGeometry.AffineScheme.hasLimits
code: instance hasLimits : HasLimits AffineScheme.{u} 
goal: CategoryTheory.Limits.HasLimits AlgebraicGeometry.AffineScheme

full_name: AlgebraicGeometry.AffineScheme.Γ_preservesLimits
code: noncomputable instance Γ_preservesLimits : PreservesLimits Γ.{u}.rightOp 
goal: CategoryTheory.Limits.PreservesLimits AlgebraicGeometry.AffineScheme.Γ.rightOp

full_name: AlgebraicGeometry.AffineScheme.forgetToScheme_preservesLimits
code: noncomputable instance forgetToScheme_preservesLimits : PreservesLimits forgetToScheme 
goal: CategoryTheory.Limits.PreservesLimits AlgebraicGeometry.AffineScheme.forgetToScheme

full_name: AlgebraicGeometry.IsAffineOpen
code: /-- An open subset of a scheme is affine if the open subscheme is affine. -/
def IsAffineOpen {X : Scheme} (U : X.Opens) : Prop 
goal: Prop

full_name: AlgebraicGeometry.Scheme.affineOpens
code: /-- The set of affine opens as a subset of `opens X`. -/
def Scheme.affineOpens (X : Scheme) : Set X.Opens 
goal: Set X.Opens

full_name: AlgebraicGeometry.instIsAffineToSchemeValOpensMemSetAffineOpens
code: instance {Y : Scheme.{u}} (U : Y.affineOpens) : IsAffine U 
goal: AlgebraicGeometry.IsAffine ↑↑U

full_name: AlgebraicGeometry.isAffineOpen_opensRange
code: theorem isAffineOpen_opensRange {X Y : Scheme} [IsAffine X] (f : X ⟶ Y)
    [H : IsOpenImmersion f] : IsAffineOpen (Scheme.Hom.opensRange f) 
goal: AlgebraicGeometry.IsAffineOpen (AlgebraicGeometry.Scheme.Hom.opensRange f)

full_name: AlgebraicGeometry.isAffineOpen_top
code: theorem isAffineOpen_top (X : Scheme) [IsAffine X] : IsAffineOpen (⊤ : X.Opens) 
goal: AlgebraicGeometry.IsAffineOpen ⊤

full_name: AlgebraicGeometry.Scheme.isAffine_affineCover
code: instance Scheme.isAffine_affineCover (X : Scheme) (i : X.affineCover.J) :
    IsAffine (X.affineCover.obj i) 
goal: AlgebraicGeometry.IsAffine (X.affineCover.obj i)

full_name: AlgebraicGeometry.Scheme.isAffine_affineBasisCover
code: instance Scheme.isAffine_affineBasisCover (X : Scheme) (i : X.affineBasisCover.J) :
    IsAffine (X.affineBasisCover.obj i) 
goal: AlgebraicGeometry.IsAffine (X.affineBasisCover.obj i)

full_name: AlgebraicGeometry.Scheme.isAffine_affineOpenCover
code: instance Scheme.isAffine_affineOpenCover (X : Scheme) (𝒰 : X.AffineOpenCover) (i : 𝒰.J) :
    IsAffine (𝒰.openCover.obj i) 
goal: AlgebraicGeometry.IsAffine (𝒰.openCover.obj i)

full_name: AlgebraicGeometry.instIsAffineObjOpenCoverOfIsIsoIdScheme
code: instance {X} [IsAffine X] (i) : IsAffine ((Scheme.openCoverOfIsIso (𝟙 X)).obj i) 
goal: AlgebraicGeometry.IsAffine ((AlgebraicGeometry.Scheme.openCoverOfIsIso (𝟙 X)).obj i)

full_name: AlgebraicGeometry.isBasis_affine_open
code: theorem isBasis_affine_open (X : Scheme) : Opens.IsBasis X.affineOpens 
goal: TopologicalSpace.Opens.IsBasis X.affineOpens

full_name: AlgebraicGeometry.iSup_affineOpens_eq_top
code: theorem iSup_affineOpens_eq_top (X : Scheme) : ⨆ i : X.affineOpens, (i : X.Opens) = ⊤ 
goal: ⨆ i, ↑i = ⊤

full_name: AlgebraicGeometry.Scheme.map_PrimeSpectrum_basicOpen_of_affine
code: theorem Scheme.map_PrimeSpectrum_basicOpen_of_affine
    (X : Scheme) [IsAffine X] (f : Scheme.Γ.obj (op X)) :
    X.isoSpec.hom ⁻¹ᵁ PrimeSpectrum.basicOpen f = X.basicOpen f 
goal: (TopologicalSpace.Opens.map X.isoSpec.hom.val.base).obj (PrimeSpectrum.basicOpen f) = X.basicOpen f

full_name: AlgebraicGeometry.isBasis_basicOpen
code: theorem isBasis_basicOpen (X : Scheme) [IsAffine X] :
    Opens.IsBasis (Set.range (X.basicOpen : Γ(X, ⊤) → X.Opens)) 
goal: TopologicalSpace.Opens.IsBasis (Set.range X.basicOpen)

full_name: AlgebraicGeometry.IsAffineOpen.fromSpec
code: /-- The open immersion `Spec Γ(X, U) ⟶ X` for an affine `U`. -/
def fromSpec :
    Spec Γ(X, U) ⟶ X 
goal: AlgebraicGeometry.Spec (X.presheaf.obj (Opposite.op U)) ⟶ X

full_name: AlgebraicGeometry.IsAffineOpen.isOpenImmersion_fromSpec
code: instance isOpenImmersion_fromSpec :
    IsOpenImmersion hU.fromSpec 
goal: AlgebraicGeometry.IsOpenImmersion hU.fromSpec

full_name: AlgebraicGeometry.IsAffineOpen.range_fromSpec
code: @[simp]
theorem range_fromSpec :
    Set.range hU.fromSpec.1.base = (U : Set X) 
goal: Set.range ⇑hU.fromSpec.val.base = ↑U

full_name: AlgebraicGeometry.IsAffineOpen.opensRange_fromSpec
code: @[simp]
theorem opensRange_fromSpec : Scheme.Hom.opensRange hU.fromSpec = U 
goal: AlgebraicGeometry.Scheme.Hom.opensRange hU.fromSpec = U

full_name: AlgebraicGeometry.IsAffineOpen.map_fromSpec
code: @[reassoc (attr := simp)]
theorem map_fromSpec {V : X.Opens} (hV : IsAffineOpen V) (f : op U ⟶ op V) :
    Spec.map (X.presheaf.map f) ≫ hU.fromSpec = hV.fromSpec 
goal: AlgebraicGeometry.Spec.map (X.presheaf.map f) ≫ hU.fromSpec = hV.fromSpec

full_name: AlgebraicGeometry.IsAffineOpen.isCompact
code: protected theorem isCompact :
    IsCompact (U : Set X) 
goal: IsCompact ↑U

full_name: AlgebraicGeometry.IsAffineOpen.image_of_isOpenImmersion
code: theorem image_of_isOpenImmersion (f : X ⟶ Y) [H : IsOpenImmersion f] :
    IsAffineOpen (f ''ᵁ U) 
goal: AlgebraicGeometry.IsAffineOpen ((AlgebraicGeometry.Scheme.Hom.opensFunctor f).obj U)

full_name: AlgebraicGeometry.IsAffineOpen.preimage_of_isIso
code: theorem preimage_of_isIso {U : Y.Opens} (hU : IsAffineOpen U) (f : X ⟶ Y) [IsIso f] :
    IsAffineOpen (f ⁻¹ᵁ U) 
goal: AlgebraicGeometry.IsAffineOpen ((TopologicalSpace.Opens.map f.val.base).obj U)

full_name: AlgebraicGeometry.Scheme.Hom.isAffineOpen_iff_of_isOpenImmersion
code: theorem _root_.AlgebraicGeometry.Scheme.Hom.isAffineOpen_iff_of_isOpenImmersion
    (f : AlgebraicGeometry.Scheme.Hom X Y) [H : IsOpenImmersion f] {U : X.Opens} :
    IsAffineOpen (f ''ᵁ U) ↔ IsAffineOpen U 
goal: AlgebraicGeometry.IsAffineOpen (f.opensFunctor.obj U) ↔ AlgebraicGeometry.IsAffineOpen U

full_name: AlgebraicGeometry.IsOpenImmersion.affineOpensEquiv
code: /-- The affine open sets of an open subscheme corresponds to
the affine open sets containing in the image. -/
@[simps]
def _root_.AlgebraicGeometry.IsOpenImmersion.affineOpensEquiv (f : X ⟶ Y) [H : IsOpenImmersion f] :
    X.affineOpens ≃ { U : Y.affineOpens // U ≤ f.opensRange } 
goal: ↑X.affineOpens ≃ { U // ↑U ≤ AlgebraicGeometry.Scheme.Hom.opensRange f }

full_name: AlgebraicGeometry.IsOpenImmersion.affineOpensEquiv_apply_coe_coe
code: /-- The affine open sets of an open subscheme corresponds to
the affine open sets containing in the image. -/
@[simps]
def _root_.AlgebraicGeometry.IsOpenImmersion.affineOpensEquiv (f : X ⟶ Y) [H : IsOpenImmersion f] :
    X.affineOpens ≃ { U : Y.affineOpens // U ≤ f.opensRange } 
goal: ↑↑((AlgebraicGeometry.IsOpenImmersion.affineOpensEquiv f) U) = (AlgebraicGeometry.Scheme.Hom.opensFunctor f).obj ↑U

full_name: AlgebraicGeometry.IsOpenImmersion.affineOpensEquiv_symm_apply_coe
code: /-- The affine open sets of an open subscheme corresponds to
the affine open sets containing in the image. -/
@[simps]
def _root_.AlgebraicGeometry.IsOpenImmersion.affineOpensEquiv (f : X ⟶ Y) [H : IsOpenImmersion f] :
    X.affineOpens ≃ { U : Y.affineOpens // U ≤ f.opensRange } 
goal: ↑((AlgebraicGeometry.IsOpenImmersion.affineOpensEquiv f).symm U) = (TopologicalSpace.Opens.map f.val.base).obj ↑↑U

full_name: AlgebraicGeometry.affineOpensRestrict
code: /-- The affine open sets of an open subscheme
corresponds to the affine open sets containing in the subset. -/
@[simps! apply_coe_coe]
def _root_.AlgebraicGeometry.affineOpensRestrict {X : Scheme.{u}} (U : X.Opens) :
    U.toScheme.affineOpens ≃ { V : X.affineOpens // V ≤ U } 
goal: ↑(↑U).affineOpens ≃ { V // ↑V ≤ U }

full_name: AlgebraicGeometry.affineOpensRestrict_apply_coe_coe
code: /-- The affine open sets of an open subscheme
corresponds to the affine open sets containing in the subset. -/
@[simps! apply_coe_coe]
def _root_.AlgebraicGeometry.affineOpensRestrict {X : Scheme.{u}} (U : X.Opens) :
    U.toScheme.affineOpens ≃ { V : X.affineOpens // V ≤ U } 
goal: ∀ (a : ↑(↑U).affineOpens),
  ↑↑((AlgebraicGeometry.affineOpensRestrict U) a) = (AlgebraicGeometry.Scheme.Hom.opensFunctor U.ι).obj ↑a

full_name: AlgebraicGeometry.affineOpensRestrict_symm_apply_coe
code: @[simp]
lemma _root_.AlgebraicGeometry.affineOpensRestrict_symm_apply_coe
    {X : Scheme.{u}} (U : X.Opens) (V) :
    ((affineOpensRestrict U).symm V).1 = U.ι ⁻¹ᵁ V 
goal: ↑((AlgebraicGeometry.affineOpensRestrict U).symm V) = (TopologicalSpace.Opens.map U.ι.val.base).obj ↑↑V

full_name: AlgebraicGeometry.Scheme.compactSpace_of_isAffine
code: instance (priority := 100) _root_.AlgebraicGeometry.Scheme.compactSpace_of_isAffine
    (X : Scheme) [IsAffine X] :
    CompactSpace X 
goal: CompactSpace ↑↑X.toPresheafedSpace

full_name: AlgebraicGeometry.IsAffineOpen.fromSpec_preimage_self
code: @[simp]
theorem fromSpec_preimage_self :
    hU.fromSpec ⁻¹ᵁ U = ⊤ 
goal: (TopologicalSpace.Opens.map hU.fromSpec.val.base).obj U = ⊤

full_name: AlgebraicGeometry.IsAffineOpen.SpecΓIdentity_hom_app_fromSpec
code: theorem SpecΓIdentity_hom_app_fromSpec :
    (Scheme.ΓSpecIso Γ(X, U)).hom ≫ hU.fromSpec.app U =
      (Spec Γ(X, U)).presheaf.map (eqToHom hU.fromSpec_preimage_self).op 
goal: (AlgebraicGeometry.Scheme.ΓSpecIso (X.presheaf.obj (Opposite.op U))).hom ≫
    AlgebraicGeometry.Scheme.Hom.app hU.fromSpec U =
  (AlgebraicGeometry.Spec (X.presheaf.obj (Opposite.op U))).presheaf.map (CategoryTheory.eqToHom ⋯).op

full_name: AlgebraicGeometry.IsAffineOpen.fromSpec_app_self
code: @[elementwise]
theorem fromSpec_app_self :
    hU.fromSpec.app U = (Scheme.ΓSpecIso Γ(X, U)).inv ≫
      (Spec Γ(X, U)).presheaf.map (eqToHom hU.fromSpec_preimage_self).op 
goal: AlgebraicGeometry.Scheme.Hom.app hU.fromSpec U =
  (AlgebraicGeometry.Scheme.ΓSpecIso (X.presheaf.obj (Opposite.op U))).inv ≫
    (AlgebraicGeometry.Spec (X.presheaf.obj (Opposite.op U))).presheaf.map (CategoryTheory.eqToHom ⋯).op

full_name: AlgebraicGeometry.IsAffineOpen.fromSpec_preimage_basicOpen'
code: theorem fromSpec_preimage_basicOpen' :
    hU.fromSpec ⁻¹ᵁ X.basicOpen f = (Spec Γ(X, U)).basicOpen ((Scheme.ΓSpecIso Γ(X, U)).inv f) 
goal: (TopologicalSpace.Opens.map hU.fromSpec.val.base).obj (X.basicOpen f) =
  (AlgebraicGeometry.Spec (X.presheaf.obj (Opposite.op U))).basicOpen
    ((AlgebraicGeometry.Scheme.ΓSpecIso (X.presheaf.obj (Opposite.op U))).inv f)

full_name: AlgebraicGeometry.IsAffineOpen.fromSpec_preimage_basicOpen
code: theorem fromSpec_preimage_basicOpen :
    hU.fromSpec ⁻¹ᵁ X.basicOpen f = PrimeSpectrum.basicOpen f 
goal: (TopologicalSpace.Opens.map hU.fromSpec.val.base).obj (X.basicOpen f) = PrimeSpectrum.basicOpen f

full_name: AlgebraicGeometry.IsAffineOpen.fromSpec_image_basicOpen
code: theorem fromSpec_image_basicOpen :
    hU.fromSpec ''ᵁ (PrimeSpectrum.basicOpen f) = X.basicOpen f 
goal: (AlgebraicGeometry.Scheme.Hom.opensFunctor hU.fromSpec).obj (PrimeSpectrum.basicOpen f) = X.basicOpen f

full_name: AlgebraicGeometry.IsAffineOpen.basicOpen_fromSpec_app
code: @[simp]
theorem basicOpen_fromSpec_app :
    (Spec Γ(X, U)).basicOpen (hU.fromSpec.app U f) = PrimeSpectrum.basicOpen f 
goal: (AlgebraicGeometry.Spec (X.presheaf.obj (Opposite.op U))).basicOpen
    ((AlgebraicGeometry.Scheme.Hom.app hU.fromSpec U) f) =
  PrimeSpectrum.basicOpen f

full_name: AlgebraicGeometry.IsAffineOpen.basicOpen
code: theorem basicOpen :
    IsAffineOpen (X.basicOpen f) 
goal: AlgebraicGeometry.IsAffineOpen (X.basicOpen f)

full_name: AlgebraicGeometry.IsAffineOpen.instIsAffineToSchemeBasicOpen
code: instance [IsAffine X] (r : Γ(X, ⊤)) : IsAffine (X.basicOpen r) 
goal: AlgebraicGeometry.IsAffine ↑(X.basicOpen r)

full_name: AlgebraicGeometry.IsAffineOpen.ι_basicOpen_preimage
code: theorem ι_basicOpen_preimage (r : Γ(X, ⊤)) :
    IsAffineOpen ((X.basicOpen r).ι ⁻¹ᵁ U) 
goal: AlgebraicGeometry.IsAffineOpen ((TopologicalSpace.Opens.map (X.basicOpen r).ι.val.base).obj U)

full_name: AlgebraicGeometry.IsAffineOpen.exists_basicOpen_le
code: theorem exists_basicOpen_le {V : X.Opens} (x : V) (h : ↑x ∈ U) :
    ∃ f : Γ(X, U), X.basicOpen f ≤ V ∧ ↑x ∈ X.basicOpen f 
goal: ∃ f, X.basicOpen f ≤ V ∧ ↑x ∈ X.basicOpen f

full_name: AlgebraicGeometry.IsAffineOpen.basicOpenSectionsToAffine
code: /-- Given an affine open U and some `f : U`,
this is the canonical map `Γ(𝒪ₓ, D(f)) ⟶ Γ(Spec 𝒪ₓ(U), D(f))`
This is an isomorphism, as witnessed by an `IsIso` instance. -/
def basicOpenSectionsToAffine :
    Γ(X, X.basicOpen f) ⟶ Γ(Spec Γ(X, U), PrimeSpectrum.basicOpen f) 
goal: X.presheaf.obj (Opposite.op (X.basicOpen f)) ⟶
  (AlgebraicGeometry.Spec (X.presheaf.obj (Opposite.op U))).presheaf.obj (Opposite.op (PrimeSpectrum.basicOpen f))

full_name: AlgebraicGeometry.IsAffineOpen.basicOpenSectionsToAffine_isIso
code: instance basicOpenSectionsToAffine_isIso :
    IsIso (basicOpenSectionsToAffine hU f) 
goal: CategoryTheory.IsIso (hU.basicOpenSectionsToAffine f)

full_name: AlgebraicGeometry.IsAffineOpen.isLocalization_basicOpen
code: theorem isLocalization_basicOpen :
    IsLocalization.Away f Γ(X, X.basicOpen f) 
goal: IsLocalization.Away f ↑(X.presheaf.obj (Opposite.op (X.basicOpen f)))

full_name: AlgebraicGeometry.isLocalization_away_of_isAffine
code: instance _root_.AlgebraicGeometry.isLocalization_away_of_isAffine
    [IsAffine X] (r : Γ(X, ⊤)) :
    IsLocalization.Away r Γ(X, X.basicOpen r) 
goal: IsLocalization.Away r ↑(X.presheaf.obj (Opposite.op (X.basicOpen r)))

full_name: AlgebraicGeometry.IsAffineOpen.appLE_eq_away_map
code: lemma appLE_eq_away_map {X Y : Scheme.{u}} (f : X ⟶ Y) {U : Y.Opens} (hU : IsAffineOpen U)
    {V : X.Opens} (hV : IsAffineOpen V) (e) (r : Γ(Y, U)) :
    letI := hU.isLocalization_basicOpen r
    letI := hV.isLocalization_basicOpen (f.appLE U V e r)
    f.appLE (Y.basicOpen r) (X.basicOpen (f.appLE U V e r)) (by simp [Scheme.Hom.appLE]) =
        IsLocalization.Away.map _ _ (f.appLE U V e) r 
goal: AlgebraicGeometry.Scheme.Hom.appLE f (Y.basicOpen r) (X.basicOpen ((AlgebraicGeometry.Scheme.Hom.appLE f U V e) r)) ⋯ =
  IsLocalization.Away.map (↑(Y.presheaf.obj (Opposite.op (Y.basicOpen r))))
    (↑(X.presheaf.obj (Opposite.op (X.basicOpen ((AlgebraicGeometry.Scheme.Hom.appLE f U V e) r)))))
    (AlgebraicGeometry.Scheme.Hom.appLE f U V e) r

full_name: AlgebraicGeometry.IsAffineOpen.isLocalization_of_eq_basicOpen
code: theorem isLocalization_of_eq_basicOpen {V : X.Opens} (i : V ⟶ U) (e : V = X.basicOpen f) :
    @IsLocalization.Away _ _ f Γ(X, V) _ (X.presheaf.map i.op).toAlgebra 
goal: IsLocalization.Away f ↑(X.presheaf.obj (Opposite.op V))

full_name: AlgebraicGeometry.Γ_restrict_isLocalization
code: instance _root_.AlgebraicGeometry.Γ_restrict_isLocalization
    (X : Scheme.{u}) [IsAffine X] (r : Γ(X, ⊤)) :
    IsLocalization.Away r Γ(X.basicOpen r, ⊤) 
goal: IsLocalization.Away r ↑((↑(X.basicOpen r)).presheaf.obj (Opposite.op ⊤))

full_name: AlgebraicGeometry.IsAffineOpen.basicOpen_basicOpen_is_basicOpen
code: theorem basicOpen_basicOpen_is_basicOpen (g : Γ(X, X.basicOpen f)) :
    ∃ f' : Γ(X, U), X.basicOpen f' = X.basicOpen g 
goal: ∃ f', X.basicOpen f' = X.basicOpen g

full_name: AlgebraicGeometry.exists_basicOpen_le_affine_inter
code: theorem _root_.AlgebraicGeometry.exists_basicOpen_le_affine_inter
    {V : X.Opens} (hV : IsAffineOpen V) (x : X) (hx : x ∈ U ⊓ V) :
    ∃ (f : Γ(X, U)) (g : Γ(X, V)), X.basicOpen f = X.basicOpen g ∧ x ∈ X.basicOpen f 
goal: ∃ f g, X.basicOpen f = X.basicOpen g ∧ x ∈ X.basicOpen f

full_name: AlgebraicGeometry.IsAffineOpen.primeIdealOf
code: /-- The prime ideal of `𝒪ₓ(U)` corresponding to a point `x : U`. -/
noncomputable def primeIdealOf (x : U) :
    PrimeSpectrum Γ(X, U) 
goal: PrimeSpectrum ↑(X.presheaf.obj (Opposite.op U))

full_name: AlgebraicGeometry.IsAffineOpen.fromSpec_primeIdealOf
code: theorem fromSpec_primeIdealOf (x : U) :
    hU.fromSpec.val.base (hU.primeIdealOf x) = x.1 
goal: hU.fromSpec.val.base (hU.primeIdealOf x) = ↑x

full_name: AlgebraicGeometry.IsAffineOpen.isLocalization_stalk'
code: theorem isLocalization_stalk' (y : PrimeSpectrum Γ(X, U)) (hy : hU.fromSpec.1.base y ∈ U) :
    @IsLocalization.AtPrime
      (R := Γ(X, U))
      (S := X.presheaf.stalk <| hU.fromSpec.1.base y) _ _
      ((TopCat.Presheaf.algebra_section_stalk X.presheaf _)) y.asIdeal _ 
goal: IsLocalization.AtPrime (↑(X.presheaf.stalk (hU.fromSpec.val.base y))) y.asIdeal

full_name: AlgebraicGeometry.IsAffineOpen.isLocalization_stalk
code: theorem isLocalization_stalk (x : U) :
    IsLocalization.AtPrime (X.presheaf.stalk x) (hU.primeIdealOf x).asIdeal 
goal: IsLocalization.AtPrime (↑(X.presheaf.stalk ↑x)) (hU.primeIdealOf x).asIdeal

full_name: AlgebraicGeometry.Scheme.affineBasicOpen_coe
code: /-- The basic open set of a section `f` on an affine open as an `X.affineOpens`. -/
@[simps]
def _root_.AlgebraicGeometry.Scheme.affineBasicOpen
    (X : Scheme) {U : X.affineOpens} (f : Γ(X, U)) : X.affineOpens 
goal: ↑(X.affineBasicOpen f) = X.basicOpen f

full_name: AlgebraicGeometry.Scheme.affineBasicOpen
code: /-- The basic open set of a section `f` on an affine open as an `X.affineOpens`. -/
@[simps]
def _root_.AlgebraicGeometry.Scheme.affineBasicOpen
    (X : Scheme) {U : X.affineOpens} (f : Γ(X, U)) : X.affineOpens 
goal: ↑X.affineOpens

full_name: AlgebraicGeometry.IsAffineOpen.basicOpen_union_eq_self_iff
code: /--
In an affine open set `U`, a family of basic open covers `U` iff the sections span `Γ(X, U)`.
See `iSup_basicOpen_of_span_eq_top` for the inverse direction without the affine-ness assuption.
-/
theorem basicOpen_union_eq_self_iff (s : Set Γ(X, U)) :
    ⨆ f : s, X.basicOpen (f : Γ(X, U)) = U ↔ Ideal.span s = ⊤ 
goal: ⨆ f, X.basicOpen ↑f = U ↔ Ideal.span s = ⊤

full_name: AlgebraicGeometry.IsAffineOpen.self_le_basicOpen_union_iff
code: theorem self_le_basicOpen_union_iff (s : Set Γ(X, U)) :
    (U ≤ ⨆ f : s, X.basicOpen f.1) ↔ Ideal.span s = ⊤ 
goal: U ≤ ⨆ f, X.basicOpen ↑f ↔ Ideal.span s = ⊤

full_name: AlgebraicGeometry.iSup_basicOpen_of_span_eq_top
code: /--
Given a spanning set of `Γ(X, U)`, the corresponding basic open sets cover `U`.
See `IsAffineOpen.basicOpen_union_eq_self_iff` for the inverse direction for affine open sets.
-/
lemma iSup_basicOpen_of_span_eq_top {X : Scheme} (U) (s : Set Γ(X, U))
    (hs : Ideal.span s = ⊤) : (⨆ i ∈ s, X.basicOpen i) = U 
goal: ⨆ i ∈ s, X.basicOpen i = U

full_name: AlgebraicGeometry.of_affine_open_cover
code: /-- Let `P` be a predicate on the affine open sets of `X` satisfying
1. If `P` holds on `U`, then `P` holds on the basic open set of every section on `U`.
2. If `P` holds for a family of basic open sets covering `U`, then `P` holds for `U`.
3. There exists an affine open cover of `X` each satisfying `P`.

Then `P` holds for every affine open of `X`.

This is also known as the **Affine communication lemma** in [*The rising sea*][RisingSea]. -/
@[elab_as_elim]
theorem of_affine_open_cover {X : Scheme} {P : X.affineOpens → Prop}
    {ι} (U : ι → X.affineOpens) (iSup_U : (⨆ i, U i : X.Opens) = ⊤)
    (V : X.affineOpens)
    (basicOpen : ∀ (U : X.affineOpens) (f : Γ(X, U)), P U → P (X.affineBasicOpen f))
    (openCover :
      ∀ (U : X.affineOpens) (s : Finset (Γ(X, U)))
        (_ : Ideal.span (s : Set (Γ(X, U))) = ⊤),
        (∀ f : s, P (X.affineBasicOpen f.1)) → P U)
    (hU : ∀ i, P (U i)) : P V 
goal: P V

full_name: AlgebraicGeometry.Scheme.toΓSpec_preimage_zeroLocus_eq
code: /-- On a locally ringed space `X`, the preimage of the zero locus of the prime spectrum
of `Γ(X, ⊤)` under `toΓSpecFun` agrees with the associated zero locus on `X`. -/
lemma Scheme.toΓSpec_preimage_zeroLocus_eq {X : Scheme.{u}} (s : Set Γ(X, ⊤)) :
    (ΓSpec.adjunction.unit.app X).val.base ⁻¹' PrimeSpectrum.zeroLocus s = X.zeroLocus s 
goal: ⇑(AlgebraicGeometry.ΓSpec.adjunction.unit.app X).val.base ⁻¹' PrimeSpectrum.zeroLocus s = X.zeroLocus s

full_name: AlgebraicGeometry.Scheme.toΓSpec_image_zeroLocus_eq_of_isAffine
code: /-- If `X` is affine, the image of the zero locus of global sections of `X` under `toΓSpecFun`
is the zero locus in terms of the prime spectrum of `Γ(X, ⊤)`. -/
lemma Scheme.toΓSpec_image_zeroLocus_eq_of_isAffine {X : Scheme.{u}} [IsAffine X]
    (s : Set Γ(X, ⊤)) :
    X.isoSpec.hom.val.base '' X.zeroLocus s = PrimeSpectrum.zeroLocus s 
goal: ⇑X.isoSpec.hom.val.base '' X.zeroLocus s = PrimeSpectrum.zeroLocus s

full_name: AlgebraicGeometry.Scheme.eq_zeroLocus_of_isClosed_of_isAffine
code: /-- If `X` is an affine scheme, every closed set of `X` is the zero locus
of a set of global sections. -/
lemma Scheme.eq_zeroLocus_of_isClosed_of_isAffine (X : Scheme.{u}) [IsAffine X] (s : Set X) :
    IsClosed s ↔ ∃ I : Ideal (Γ(X, ⊤)), s = X.zeroLocus (I : Set Γ(X, ⊤)) 
goal: IsClosed s ↔ ∃ I, s = X.zeroLocus ↑I

full_name: AlgebraicGeometry.Scheme.localRingHom_comp_stalkIso
code: /-- Variant of `AlgebraicGeometry.localRingHom_comp_stalkIso` for `Spec.map`. -/
@[elementwise]
lemma Scheme.localRingHom_comp_stalkIso {R S : CommRingCat.{u}} (f : R ⟶ S) (p : PrimeSpectrum S) :
    (StructureSheaf.stalkIso R (PrimeSpectrum.comap f p)).hom ≫
      (CommRingCat.ofHom <| Localization.localRingHom
        (PrimeSpectrum.comap f p).asIdeal p.asIdeal f rfl) ≫
      (StructureSheaf.stalkIso S p).inv = (Spec.map f).stalkMap p 
goal: (AlgebraicGeometry.StructureSheaf.stalkIso (↑R) ((PrimeSpectrum.comap f) p)).hom ≫
    CommRingCat.ofHom (Localization.localRingHom ((PrimeSpectrum.comap f) p).asIdeal p.asIdeal f ⋯) ≫
      (AlgebraicGeometry.StructureSheaf.stalkIso (↑S) p).inv =
  AlgebraicGeometry.Scheme.Hom.stalkMap (AlgebraicGeometry.Spec.map f) p

full_name: AlgebraicGeometry.Scheme.arrowStalkMapSpecIso
code: /-- Given a morphism of rings `f : R ⟶ S`, the stalk map of `Spec S ⟶ Spec R` at
a prime of `S` is isomorphic to the localized ring homomorphism. -/
def Scheme.arrowStalkMapSpecIso {R S : CommRingCat.{u}} (f : R ⟶ S) (p : PrimeSpectrum S) :
    Arrow.mk ((Spec.map f).stalkMap p) ≅ Arrow.mk (CommRingCat.ofHom <| Localization.localRingHom
      (PrimeSpectrum.comap f p).asIdeal p.asIdeal f rfl) 
goal: CategoryTheory.Arrow.mk (AlgebraicGeometry.Scheme.Hom.stalkMap (AlgebraicGeometry.Spec.map f) p) ≅
  CategoryTheory.Arrow.mk
    (CommRingCat.ofHom (Localization.localRingHom ((PrimeSpectrum.comap f) p).asIdeal p.asIdeal f ⋯))