File: Mathlib/AlgebraicGeometry/OpenImmersion.lean

full_name: AlgebraicGeometry.IsOpenImmersion
code: /-- A morphism of Schemes is an open immersion if it is an open immersion as a morphism
of LocallyRingedSpaces
-/
abbrev IsOpenImmersion {X Y : Scheme.{u}} (f : X ⟶ Y) : Prop 
goal: Prop

full_name: AlgebraicGeometry.IsOpenImmersion.comp
code: instance IsOpenImmersion.comp {X Y Z : Scheme.{u}} (f : X ⟶ Y) (g : Y ⟶ Z)
  [IsOpenImmersion f] [IsOpenImmersion g] : IsOpenImmersion (f ≫ g) 
goal: AlgebraicGeometry.IsOpenImmersion (f ≫ g)

full_name: AlgebraicGeometry.LocallyRingedSpace.IsOpenImmersion.scheme
code: /-- To show that a locally ringed space is a scheme, it suffices to show that it has a jointly
surjective family of open immersions from affine schemes. -/
protected def scheme (X : LocallyRingedSpace.{u})
    (h :
      ∀ x : X,
        ∃ (R : CommRingCat) (f : Spec.toLocallyRingedSpace.obj (op R) ⟶ X),
          (x ∈ Set.range f.1.base : _) ∧ LocallyRingedSpace.IsOpenImmersion f) :
    Scheme 
goal: AlgebraicGeometry.Scheme

full_name: AlgebraicGeometry.IsOpenImmersion.isOpen_range
code: theorem IsOpenImmersion.isOpen_range {X Y : Scheme.{u}} (f : X ⟶ Y) [H : IsOpenImmersion f] :
    IsOpen (Set.range f.1.base) 
goal: IsOpen (Set.range ⇑f.val.base)

full_name: AlgebraicGeometry.Scheme.Hom.openEmbedding
code: theorem openEmbedding : OpenEmbedding f.1.base 
goal: OpenEmbedding ⇑f.val.base

full_name: AlgebraicGeometry.Scheme.Hom.opensRange_coe
code: /-- The image of an open immersion as an open set. -/
@[simps]
def opensRange : Y.Opens 
goal: ↑f.opensRange = Set.range ⇑f.val.base

full_name: AlgebraicGeometry.Scheme.Hom.opensRange
code: /-- The image of an open immersion as an open set. -/
@[simps]
def opensRange : Y.Opens 
goal: Y.Opens

full_name: AlgebraicGeometry.Scheme.Hom.opensFunctor
code: /-- The functor `opens X ⥤ opens Y` associated with an open immersion `f : X ⟶ Y`. -/
abbrev opensFunctor : X.Opens ⥤ Y.Opens 
goal: X.Opens ⥤ Y.Opens

full_name: AlgebraicGeometry.«_aux_Mathlib_AlgebraicGeometry_OpenImmersion___macroRules_AlgebraicGeometry_term_''ᵁ__1»
code: /-- `f ''ᵁ U` is notation for the image (as an open set) of `U` under an open immersion `f`. -/
scoped[AlgebraicGeometry] notation3:90 f:91 " ''ᵁ " U:90 => (Scheme.Hom.opensFunctor f).obj U
goal: Lean.Macro

full_name: AlgebraicGeometry.Scheme.Hom.image_le_image_of_le
code: lemma image_le_image_of_le {U V : X.Opens} (e : U ≤ V) : f ''ᵁ U ≤ f ''ᵁ V 
goal: f.opensFunctor.obj U ≤ f.opensFunctor.obj V

full_name: AlgebraicGeometry.Scheme.Hom.opensFunctor_map_homOfLE
code: @[simp]
lemma opensFunctor_map_homOfLE {U V : X.Opens} (e : U ≤ V) :
    (Scheme.Hom.opensFunctor f).map (homOfLE e) = homOfLE (f.image_le_image_of_le e) 
goal: f.opensFunctor.map (CategoryTheory.homOfLE e) = CategoryTheory.homOfLE ⋯

full_name: AlgebraicGeometry.Scheme.Hom.image_top_eq_opensRange
code: @[simp]
lemma image_top_eq_opensRange : f ''ᵁ ⊤ = f.opensRange 
goal: f.opensFunctor.obj ⊤ = f.opensRange

full_name: AlgebraicGeometry.Scheme.Hom.preimage_image_eq
code: @[simp]
lemma preimage_image_eq (U : X.Opens) : f ⁻¹ᵁ f ''ᵁ U = U 
goal: (TopologicalSpace.Opens.map f.val.base).obj (f.opensFunctor.obj U) = U

full_name: AlgebraicGeometry.Scheme.Hom.image_preimage_eq_opensRange_inter
code: lemma image_preimage_eq_opensRange_inter (U : Y.Opens) : f ''ᵁ f ⁻¹ᵁ U = f.opensRange ⊓ U 
goal: f.opensFunctor.obj ((TopologicalSpace.Opens.map f.val.base).obj U) = f.opensRange ⊓ U

full_name: AlgebraicGeometry.Scheme.Hom.appIso
code: /-- The isomorphism `Γ(Y, f(U)) ≅ Γ(X, U)` induced by an open immersion `f : X ⟶ Y`. -/
def appIso (U) : Γ(Y, f ''ᵁ U) ≅ Γ(X, U) 
goal: Y.presheaf.obj (Opposite.op (f.opensFunctor.obj U)) ≅ X.presheaf.obj (Opposite.op U)

full_name: AlgebraicGeometry.Scheme.Hom.appIso_inv_naturality
code: @[reassoc (attr := simp)]
theorem appIso_inv_naturality {U V : X.Opens} (i : op U ⟶ op V) :
    X.presheaf.map i ≫ (f.appIso V).inv =
      (f.appIso U).inv ≫ Y.presheaf.map (f.opensFunctor.op.map i) 
goal: X.presheaf.map i ≫ (f.appIso V).inv = (f.appIso U).inv ≫ Y.presheaf.map (f.opensFunctor.op.map i)

full_name: AlgebraicGeometry.Scheme.Hom.appIso_hom
code: theorem appIso_hom (U) :
    (f.appIso U).hom = f.app (f ''ᵁ U) ≫ X.presheaf.map
      (eqToHom (preimage_image_eq f U).symm).op 
goal: (f.appIso U).hom = f.app (f.opensFunctor.obj U) ≫ X.presheaf.map (CategoryTheory.eqToHom ⋯).op

full_name: AlgebraicGeometry.Scheme.Hom.appIso_hom'
code: theorem appIso_hom' (U) :
    (f.appIso U).hom = f.appLE (f ''ᵁ U) U (preimage_image_eq f U).ge 
goal: (f.appIso U).hom = f.appLE (f.opensFunctor.obj U) U ⋯

full_name: AlgebraicGeometry.Scheme.Hom.app_appIso_inv
code: @[reassoc (attr := simp)]
theorem app_appIso_inv (U) :
    f.app U ≫ (f.appIso (f ⁻¹ᵁ U)).inv =
      Y.presheaf.map (homOfLE (Set.image_preimage_subset f.1.base U.1)).op 
goal: f.app U ≫ (f.appIso ((TopologicalSpace.Opens.map f.val.base).obj U)).inv = Y.presheaf.map (CategoryTheory.homOfLE ⋯).op

full_name: AlgebraicGeometry.Scheme.Hom.app_invApp'
code: /-- A variant of `app_invApp` that gives an `eqToHom` instead of `homOfLE`. -/
@[reassoc]
theorem app_invApp' (U) (hU : U ≤ f.opensRange) :
    f.app U ≫ (f.appIso (f ⁻¹ᵁ U)).inv =
      Y.presheaf.map (eqToHom (Opens.ext <| by simpa [Set.image_preimage_eq_inter_range])).op 
goal: f.app U ≫ (f.appIso ((TopologicalSpace.Opens.map f.val.base).obj U)).inv = Y.presheaf.map (CategoryTheory.eqToHom ⋯).op

full_name: AlgebraicGeometry.Scheme.Hom.appIso_inv_app
code: @[reassoc (attr := simp), elementwise (attr := simp)]
theorem appIso_inv_app (U) :
    (f.appIso U).inv ≫ f.app (f ''ᵁ U) = X.presheaf.map (eqToHom (preimage_image_eq f U)).op 
goal: (f.appIso U).inv ≫ f.app (f.opensFunctor.obj U) = X.presheaf.map (CategoryTheory.eqToHom ⋯).op

full_name: AlgebraicGeometry.Scheme.Hom.appLE_appIso_inv
code: @[reassoc (attr := simp), elementwise]
lemma appLE_appIso_inv {X Y : Scheme.{u}} (f : X ⟶ Y) [IsOpenImmersion f] {U : Y.Opens}
    {V : X.Opens} (e : V ≤ f ⁻¹ᵁ U) :
    f.appLE U V e ≫ (f.appIso V).inv =
        Y.presheaf.map (homOfLE <| (f.image_le_image_of_le e).trans
          (f.image_preimage_eq_opensRange_inter U ▸ inf_le_right)).op 
goal: AlgebraicGeometry.Scheme.Hom.appLE f U V e ≫ (AlgebraicGeometry.Scheme.Hom.appIso f V).inv =
  Y.presheaf.map (CategoryTheory.homOfLE ⋯).op

full_name: AlgebraicGeometry.Scheme.Hom.appIso_inv_appLE
code: @[reassoc (attr := simp)]
lemma appIso_inv_appLE {X Y : Scheme.{u}} (f : X ⟶ Y) [IsOpenImmersion f] {U V : X.Opens}
    (e : V ≤ f ⁻¹ᵁ f ''ᵁ U) :
    (f.appIso U).inv ≫ f.appLE (f ''ᵁ U) V e =
        X.presheaf.map (homOfLE (by rwa [preimage_image_eq] at e)).op 
goal: (AlgebraicGeometry.Scheme.Hom.appIso f U).inv ≫
    AlgebraicGeometry.Scheme.Hom.appLE f ((AlgebraicGeometry.Scheme.Hom.opensFunctor f).obj U) V e =
  X.presheaf.map (CategoryTheory.homOfLE ⋯).op

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

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

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

full_name: AlgebraicGeometry.Scheme.basic_open_isOpenImmersion
code: instance basic_open_isOpenImmersion {R : CommRingCat.{u}} (f : R) :
    IsOpenImmersion (Spec.map (CommRingCat.ofHom (algebraMap R (Localization.Away f)))) 
goal: AlgebraicGeometry.IsOpenImmersion
  (AlgebraicGeometry.Spec.map (CommRingCat.ofHom (algebraMap (↑R) (Localization.Away f))))

full_name: AlgebraicGeometry.Scheme.instIsOpenImmersionMapOfHomAwayAlgebraMap
code: instance {R} [CommRing R] (f : R) :
    IsOpenImmersion (Spec.map (CommRingCat.ofHom (algebraMap R (Localization.Away f)))) 
goal: AlgebraicGeometry.IsOpenImmersion (AlgebraicGeometry.Spec.map (CommRingCat.ofHom (algebraMap R (Localization.Away f))))

full_name: AlgebraicGeometry.Scheme.IsOpenImmersion.of_isLocalization
code: lemma IsOpenImmersion.of_isLocalization {R S} [CommRing R] [CommRing S]
    [Algebra R S] (f : R) [IsLocalization.Away f S] :
    IsOpenImmersion (Spec.map (CommRingCat.ofHom (algebraMap R S))) 
goal: AlgebraicGeometry.IsOpenImmersion (AlgebraicGeometry.Spec.map (CommRingCat.ofHom (algebraMap R S)))

full_name: AlgebraicGeometry.Scheme.exists_affine_mem_range_and_range_subset
code: theorem exists_affine_mem_range_and_range_subset
    {X : Scheme.{u}} {x : X} {U : X.Opens} (hxU : x ∈ U) :
    ∃ (R : CommRingCat) (f : Spec R ⟶ X),
      IsOpenImmersion f ∧ x ∈ Set.range f.1.base ∧ Set.range f.1.base ⊆ U 
goal: ∃ R f, AlgebraicGeometry.IsOpenImmersion f ∧ x ∈ Set.range ⇑f.val.base ∧ Set.range ⇑f.val.base ⊆ ↑U

full_name: AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.toScheme
code: /-- If `X ⟶ Y` is an open immersion, and `Y` is a scheme, then so is `X`. -/
def toScheme : Scheme 
goal: AlgebraicGeometry.Scheme

full_name: AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.toScheme_toLocallyRingedSpace
code: @[simp]
theorem toScheme_toLocallyRingedSpace :
    (toScheme Y f).toLocallyRingedSpace = toLocallyRingedSpace Y.1 f 
goal: (AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.toScheme Y f).toLocallyRingedSpace =
  AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.toLocallyRingedSpace Y.toLocallyRingedSpace f

full_name: AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.toSchemeHom
code: /-- If `X ⟶ Y` is an open immersion of PresheafedSpaces, and `Y` is a Scheme, we can
upgrade it into a morphism of Schemes.
-/
def toSchemeHom : toScheme Y f ⟶ Y 
goal: AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.toScheme Y f ⟶ Y

full_name: AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.toSchemeHom_val
code: @[simp]
theorem toSchemeHom_val : (toSchemeHom Y f).val = f 
goal: (AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.toSchemeHom Y f).val = f

full_name: AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.toSchemeHom_isOpenImmersion
code: instance toSchemeHom_isOpenImmersion : AlgebraicGeometry.IsOpenImmersion (toSchemeHom Y f) 
goal: AlgebraicGeometry.IsOpenImmersion (AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.toSchemeHom Y f)

full_name: AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.scheme_eq_of_locallyRingedSpace_eq
code: theorem scheme_eq_of_locallyRingedSpace_eq {X Y : Scheme.{u}}
    (H : X.toLocallyRingedSpace = Y.toLocallyRingedSpace) : X = Y 
goal: X = Y

full_name: AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.scheme_toScheme
code: theorem scheme_toScheme {X Y : Scheme.{u}} (f : X ⟶ Y) [AlgebraicGeometry.IsOpenImmersion f] :
    toScheme Y f.1 = X 
goal: AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.toScheme Y f.val = X

full_name: AlgebraicGeometry.Scheme.restrict_presheaf_obj
code: /-- The restriction of a Scheme along an open embedding. -/
@[simps! (config := .lemmasOnly) carrier, simps! presheaf_obj]
def Scheme.restrict : Scheme 
goal: ∀ (X_1 : (TopologicalSpace.Opens ↑U)ᵒᵖ),
  (X.restrict h).presheaf.obj X_1 = X.presheaf.obj (Opposite.op (⋯.functor.obj (Opposite.unop X_1)))

full_name: AlgebraicGeometry.Scheme.restrict
code: /-- The restriction of a Scheme along an open embedding. -/
@[simps! (config := .lemmasOnly) carrier, simps! presheaf_obj]
def Scheme.restrict : Scheme 
goal: AlgebraicGeometry.Scheme

full_name: AlgebraicGeometry.Scheme.restrict_carrier
code: /-- The restriction of a Scheme along an open embedding. -/
@[simps! (config := .lemmasOnly) carrier, simps! presheaf_obj]
def Scheme.restrict : Scheme 
goal: ↑(X.restrict h).toPresheafedSpace = U

full_name: AlgebraicGeometry.Scheme.restrict_toPresheafedSpace
code: lemma Scheme.restrict_toPresheafedSpace :
    (X.restrict h).toPresheafedSpace = X.toPresheafedSpace.restrict h 
goal: (X.restrict h).toPresheafedSpace = X.restrict h

full_name: AlgebraicGeometry.Scheme.ofRestrict_val_base
code: /-- The canonical map from the restriction to the subspace. -/
@[simps! val_base, simps! (config := .lemmasOnly) val_c_app]
def Scheme.ofRestrict : X.restrict h ⟶ X 
goal: (X.ofRestrict h).val.base = f

full_name: AlgebraicGeometry.Scheme.ofRestrict_val_c_app
code: /-- The canonical map from the restriction to the subspace. -/
@[simps! val_base, simps! (config := .lemmasOnly) val_c_app]
def Scheme.ofRestrict : X.restrict h ⟶ X 
goal: (X.ofRestrict h).val.c.app V = X.presheaf.map (⋯.adjunction.counit.app (Opposite.unop V)).op

full_name: AlgebraicGeometry.Scheme.ofRestrict
code: /-- The canonical map from the restriction to the subspace. -/
@[simps! val_base, simps! (config := .lemmasOnly) val_c_app]
def Scheme.ofRestrict : X.restrict h ⟶ X 
goal: X.restrict h ⟶ X

full_name: AlgebraicGeometry.Scheme.ofRestrict_app
code: @[simp]
lemma Scheme.ofRestrict_app (V) :
    (X.ofRestrict h).app V = X.presheaf.map (h.isOpenMap.adjunction.counit.app V).op  
goal: AlgebraicGeometry.Scheme.Hom.app (X.ofRestrict h) V = X.presheaf.map (⋯.adjunction.counit.app V).op

full_name: AlgebraicGeometry.IsOpenImmersion.ofRestrict
code: instance IsOpenImmersion.ofRestrict : IsOpenImmersion (X.ofRestrict h) 
goal: AlgebraicGeometry.IsOpenImmersion (X.ofRestrict h)

full_name: AlgebraicGeometry.Scheme.ofRestrict_appLE
code: @[simp]
lemma Scheme.ofRestrict_appLE (V W e) :
    (X.ofRestrict h).appLE V W e = X.presheaf.map
      (homOfLE (show X.ofRestrict h ''ᵁ _ ≤ _ by exact Set.image_subset_iff.mpr e)).op 
goal: AlgebraicGeometry.Scheme.Hom.appLE (X.ofRestrict h) V W e = X.presheaf.map (CategoryTheory.homOfLE ⋯).op

full_name: AlgebraicGeometry.Scheme.ofRestrict_appIso
code: @[simp]
lemma Scheme.ofRestrict_appIso (U) :
    (X.ofRestrict h).appIso U = Iso.refl _ 
goal: ∀ (U_1 : (X.restrict h).Opens),
  AlgebraicGeometry.Scheme.Hom.appIso (X.ofRestrict h) U_1 =
    CategoryTheory.Iso.refl
      (X.presheaf.obj (Opposite.op ((AlgebraicGeometry.Scheme.Hom.opensFunctor (X.ofRestrict h)).obj U_1)))

full_name: AlgebraicGeometry.Scheme.restrict_presheaf_map
code: @[simp]
lemma Scheme.restrict_presheaf_map (V W) (i : V ⟶ W) :
    (X.restrict h).presheaf.map i = X.presheaf.map (homOfLE (show X.ofRestrict h ''ᵁ W.unop ≤
      X.ofRestrict h ''ᵁ V.unop from Set.image_subset _ i.unop.le)).op 
goal: (X.restrict h).presheaf.map i = X.presheaf.map (CategoryTheory.homOfLE ⋯).op

full_name: AlgebraicGeometry.IsOpenImmersion.of_isIso
code: instance (priority := 100) of_isIso [IsIso g] : IsOpenImmersion g 
goal: AlgebraicGeometry.IsOpenImmersion g

full_name: AlgebraicGeometry.IsOpenImmersion.to_iso
code: theorem to_iso {X Y : Scheme.{u}} (f : X ⟶ Y) [h : IsOpenImmersion f] [Epi f.1.base] : IsIso f 
goal: CategoryTheory.IsIso f

full_name: AlgebraicGeometry.IsOpenImmersion.of_stalk_iso
code: theorem of_stalk_iso {X Y : Scheme.{u}} (f : X ⟶ Y) (hf : OpenEmbedding f.1.base)
    [∀ x, IsIso (f.stalkMap x)] : IsOpenImmersion f 
goal: AlgebraicGeometry.IsOpenImmersion f

full_name: AlgebraicGeometry.IsOpenImmersion.stalk_iso
code: instance stalk_iso {X Y : Scheme.{u}} (f : X ⟶ Y) [IsOpenImmersion f] (x : X) :
    IsIso (f.stalkMap x) 
goal: CategoryTheory.IsIso (AlgebraicGeometry.Scheme.Hom.stalkMap f x)

full_name: AlgebraicGeometry.IsOpenImmersion.iff_stalk_iso
code: theorem iff_stalk_iso {X Y : Scheme.{u}} (f : X ⟶ Y) :
    IsOpenImmersion f ↔ OpenEmbedding f.1.base ∧ ∀ x, IsIso (f.stalkMap x) 
goal: AlgebraicGeometry.IsOpenImmersion f ↔
  OpenEmbedding ⇑f.val.base ∧
    ∀ (x : ↑↑X.toPresheafedSpace), CategoryTheory.IsIso (AlgebraicGeometry.Scheme.Hom.stalkMap f x)

full_name: AlgebraicGeometry.isIso_iff_isOpenImmersion
code: theorem _root_.AlgebraicGeometry.isIso_iff_isOpenImmersion {X Y : Scheme.{u}} (f : X ⟶ Y) :
    IsIso f ↔ IsOpenImmersion f ∧ Epi f.1.base 
goal: CategoryTheory.IsIso f ↔ AlgebraicGeometry.IsOpenImmersion f ∧ CategoryTheory.Epi f.val.base

full_name: AlgebraicGeometry.isIso_iff_stalk_iso
code: theorem _root_.AlgebraicGeometry.isIso_iff_stalk_iso {X Y : Scheme.{u}} (f : X ⟶ Y) :
    IsIso f ↔ IsIso f.1.base ∧ ∀ x, IsIso (f.stalkMap x) 
goal: CategoryTheory.IsIso f ↔
  CategoryTheory.IsIso f.val.base ∧
    ∀ (x : ↑↑X.toPresheafedSpace), CategoryTheory.IsIso (AlgebraicGeometry.Scheme.Hom.stalkMap f x)

full_name: AlgebraicGeometry.IsOpenImmersion.isoRestrict
code: /-- An open immersion induces an isomorphism from the domain onto the image -/
def isoRestrict : X ≅ (Z.restrict H.base_open : _) 
goal: X ≅ Z.restrict ⋯

full_name: AlgebraicGeometry.IsOpenImmersion._aux_Mathlib_AlgebraicGeometry_OpenImmersion___macroRules_AlgebraicGeometry_IsOpenImmersion_termForget_1
code: local notation "forget" => Scheme.forgetToLocallyRingedSpace
goal: Lean.Macro

full_name: AlgebraicGeometry.IsOpenImmersion._aux_Mathlib_AlgebraicGeometry_OpenImmersion___unexpand_AlgebraicGeometry_Scheme_forgetToLocallyRingedSpace_1
code: local notation "forget" => Scheme.forgetToLocallyRingedSpace
goal: Lean.PrettyPrinter.Unexpander

full_name: AlgebraicGeometry.IsOpenImmersion.mono
code: instance mono : Mono f 
goal: CategoryTheory.Mono f

full_name: AlgebraicGeometry.IsOpenImmersion.forget_map_isOpenImmersion
code: instance forget_map_isOpenImmersion : LocallyRingedSpace.IsOpenImmersion ((forget).map f) 
goal: AlgebraicGeometry.LocallyRingedSpace.IsOpenImmersion (AlgebraicGeometry.Scheme.forgetToLocallyRingedSpace.map f)

full_name: AlgebraicGeometry.IsOpenImmersion.hasLimit_cospan_forget_of_left
code: instance hasLimit_cospan_forget_of_left :
    HasLimit (cospan f g ⋙ Scheme.forgetToLocallyRingedSpace) 
goal: CategoryTheory.Limits.HasLimit (CategoryTheory.Limits.cospan f g ⋙ AlgebraicGeometry.Scheme.forgetToLocallyRingedSpace)

full_name: AlgebraicGeometry.IsOpenImmersion.hasLimit_cospan_forget_of_left'
code: instance hasLimit_cospan_forget_of_left' :
    HasLimit (cospan ((cospan f g ⋙ forget).map Hom.inl) ((cospan f g ⋙ forget).map Hom.inr)) 
goal: CategoryTheory.Limits.HasLimit
  (CategoryTheory.Limits.cospan
    ((CategoryTheory.Limits.cospan f g ⋙ AlgebraicGeometry.Scheme.forgetToLocallyRingedSpace).map
      CategoryTheory.Limits.WalkingCospan.Hom.inl)
    ((CategoryTheory.Limits.cospan f g ⋙ AlgebraicGeometry.Scheme.forgetToLocallyRingedSpace).map
      CategoryTheory.Limits.WalkingCospan.Hom.inr))

full_name: AlgebraicGeometry.IsOpenImmersion.hasLimit_cospan_forget_of_right
code: instance hasLimit_cospan_forget_of_right : HasLimit (cospan g f ⋙ forget) 
goal: CategoryTheory.Limits.HasLimit (CategoryTheory.Limits.cospan g f ⋙ AlgebraicGeometry.Scheme.forgetToLocallyRingedSpace)

full_name: AlgebraicGeometry.IsOpenImmersion.hasLimit_cospan_forget_of_right'
code: instance hasLimit_cospan_forget_of_right' :
    HasLimit (cospan ((cospan g f ⋙ forget).map Hom.inl) ((cospan g f ⋙ forget).map Hom.inr)) 
goal: CategoryTheory.Limits.HasLimit
  (CategoryTheory.Limits.cospan
    ((CategoryTheory.Limits.cospan g f ⋙ AlgebraicGeometry.Scheme.forgetToLocallyRingedSpace).map
      CategoryTheory.Limits.WalkingCospan.Hom.inl)
    ((CategoryTheory.Limits.cospan g f ⋙ AlgebraicGeometry.Scheme.forgetToLocallyRingedSpace).map
      CategoryTheory.Limits.WalkingCospan.Hom.inr))

full_name: AlgebraicGeometry.IsOpenImmersion.forgetCreatesPullbackOfLeft
code: instance forgetCreatesPullbackOfLeft : CreatesLimit (cospan f g) forget 
goal: CategoryTheory.CreatesLimit (CategoryTheory.Limits.cospan f g) AlgebraicGeometry.Scheme.forgetToLocallyRingedSpace

full_name: AlgebraicGeometry.IsOpenImmersion.forgetCreatesPullbackOfRight
code: instance forgetCreatesPullbackOfRight : CreatesLimit (cospan g f) forget 
goal: CategoryTheory.CreatesLimit (CategoryTheory.Limits.cospan g f) AlgebraicGeometry.Scheme.forgetToLocallyRingedSpace

full_name: AlgebraicGeometry.IsOpenImmersion.forgetPreservesOfLeft
code: instance forgetPreservesOfLeft : PreservesLimit (cospan f g) forget 
goal: CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan f g)
  AlgebraicGeometry.Scheme.forgetToLocallyRingedSpace

full_name: AlgebraicGeometry.IsOpenImmersion.forgetPreservesOfRight
code: instance forgetPreservesOfRight : PreservesLimit (cospan g f) forget 
goal: CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan g f)
  AlgebraicGeometry.Scheme.forgetToLocallyRingedSpace

full_name: AlgebraicGeometry.IsOpenImmersion.hasPullback_of_left
code: instance hasPullback_of_left : HasPullback f g 
goal: CategoryTheory.Limits.HasPullback f g

full_name: AlgebraicGeometry.IsOpenImmersion.hasPullback_of_right
code: instance hasPullback_of_right : HasPullback g f 
goal: CategoryTheory.Limits.HasPullback g f

full_name: AlgebraicGeometry.IsOpenImmersion.pullback_snd_of_left
code: instance pullback_snd_of_left : IsOpenImmersion (pullback.snd f g) 
goal: AlgebraicGeometry.IsOpenImmersion (CategoryTheory.Limits.pullback.snd f g)

full_name: AlgebraicGeometry.IsOpenImmersion.pullback_fst_of_right
code: instance pullback_fst_of_right : IsOpenImmersion (pullback.fst g f) 
goal: AlgebraicGeometry.IsOpenImmersion (CategoryTheory.Limits.pullback.fst g f)

full_name: AlgebraicGeometry.IsOpenImmersion.pullback_to_base
code: instance pullback_to_base [IsOpenImmersion g] :
    IsOpenImmersion (limit.π (cospan f g) WalkingCospan.one) 
goal: AlgebraicGeometry.IsOpenImmersion
  (CategoryTheory.Limits.limit.π (CategoryTheory.Limits.cospan f g) CategoryTheory.Limits.WalkingCospan.one)

full_name: AlgebraicGeometry.IsOpenImmersion.forgetToTopPreservesOfLeft
code: instance forgetToTopPreservesOfLeft : PreservesLimit (cospan f g) Scheme.forgetToTop 
goal: CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan f g) AlgebraicGeometry.Scheme.forgetToTop

full_name: AlgebraicGeometry.IsOpenImmersion.forgetToTopPreservesOfRight
code: instance forgetToTopPreservesOfRight : PreservesLimit (cospan g f) Scheme.forgetToTop 
goal: CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan g f) AlgebraicGeometry.Scheme.forgetToTop

full_name: AlgebraicGeometry.IsOpenImmersion.range_pullback_snd_of_left
code: theorem range_pullback_snd_of_left :
    Set.range (pullback.snd f g).1.base = (g ⁻¹ᵁ f.opensRange).1 
goal: Set.range ⇑(CategoryTheory.Limits.pullback.snd f g).val.base =
  ((TopologicalSpace.Opens.map g.val.base).obj (AlgebraicGeometry.Scheme.Hom.opensRange f)).carrier

full_name: AlgebraicGeometry.IsOpenImmersion.opensRange_pullback_snd_of_left
code: theorem opensRange_pullback_snd_of_left :
    (pullback.snd f g).opensRange = g ⁻¹ᵁ f.opensRange 
goal: AlgebraicGeometry.Scheme.Hom.opensRange (CategoryTheory.Limits.pullback.snd f g) =
  (TopologicalSpace.Opens.map g.val.base).obj (AlgebraicGeometry.Scheme.Hom.opensRange f)

full_name: AlgebraicGeometry.IsOpenImmersion.range_pullback_fst_of_right
code: theorem range_pullback_fst_of_right :
    Set.range (pullback.fst g f).1.base =
      ((Opens.map g.1.base).obj ⟨Set.range f.1.base, H.base_open.isOpen_range⟩).1 
goal: Set.range ⇑(CategoryTheory.Limits.pullback.fst g f).val.base =
  ((TopologicalSpace.Opens.map g.val.base).obj { carrier := Set.range ⇑f.val.base, is_open' := ⋯ }).carrier

full_name: AlgebraicGeometry.IsOpenImmersion.opensRange_pullback_fst_of_right
code: theorem opensRange_pullback_fst_of_right :
    (pullback.fst g f).opensRange = g ⁻¹ᵁ f.opensRange 
goal: AlgebraicGeometry.Scheme.Hom.opensRange (CategoryTheory.Limits.pullback.fst g f) =
  (TopologicalSpace.Opens.map g.val.base).obj (AlgebraicGeometry.Scheme.Hom.opensRange f)

full_name: AlgebraicGeometry.IsOpenImmersion.range_pullback_to_base_of_left
code: theorem range_pullback_to_base_of_left :
    Set.range (pullback.fst f g ≫ f).1.base =
      Set.range f.1.base ∩ Set.range g.1.base 
goal: Set.range ⇑(CategoryTheory.Limits.pullback.fst f g ≫ f).val.base = Set.range ⇑f.val.base ∩ Set.range ⇑g.val.base

full_name: AlgebraicGeometry.IsOpenImmersion.range_pullback_to_base_of_right
code: theorem range_pullback_to_base_of_right :
    Set.range (pullback.fst g f ≫ g).1.base =
      Set.range g.1.base ∩ Set.range f.1.base 
goal: Set.range ⇑(CategoryTheory.Limits.pullback.fst g f ≫ g).val.base = Set.range ⇑g.val.base ∩ Set.range ⇑f.val.base

full_name: AlgebraicGeometry.IsOpenImmersion.lift
code: /-- The universal property of open immersions:
For an open immersion `f : X ⟶ Z`, given any morphism of schemes `g : Y ⟶ Z` whose topological
image is contained in the image of `f`, we can lift this morphism to a unique `Y ⟶ X` that
commutes with these maps.
-/
def lift (H' : Set.range g.1.base ⊆ Set.range f.1.base) : Y ⟶ X 
goal: Y ⟶ X

full_name: AlgebraicGeometry.IsOpenImmersion.lift_fac
code: @[simp, reassoc]
theorem lift_fac (H' : Set.range g.1.base ⊆ Set.range f.1.base) : lift f g H' ≫ f = g 
goal: AlgebraicGeometry.IsOpenImmersion.lift f g H' ≫ f = g

full_name: AlgebraicGeometry.IsOpenImmersion.lift_uniq
code: theorem lift_uniq (H' : Set.range g.1.base ⊆ Set.range f.1.base) (l : Y ⟶ X) (hl : l ≫ f = g) :
    l = lift f g H' 
goal: l = AlgebraicGeometry.IsOpenImmersion.lift f g H'

full_name: AlgebraicGeometry.IsOpenImmersion.isoOfRangeEq
code: /-- Two open immersions with equal range are isomorphic. -/
def isoOfRangeEq [IsOpenImmersion g] (e : Set.range f.1.base = Set.range g.1.base) : X ≅ Y 
goal: X ≅ Y

full_name: AlgebraicGeometry.IsOpenImmersion.isoOfRangeEq_hom_fac
code: @[simp, reassoc]
lemma isoOfRangeEq_hom_fac {X Y Z : Scheme.{u}} (f : X ⟶ Z) (g : Y ⟶ Z)
    [IsOpenImmersion f] [IsOpenImmersion g] (e : Set.range f.1.base = Set.range g.1.base) :
    (isoOfRangeEq f g e).hom ≫ g = f 
goal: (AlgebraicGeometry.IsOpenImmersion.isoOfRangeEq f g e).hom ≫ g = f

full_name: AlgebraicGeometry.IsOpenImmersion.isoOfRangeEq_inv_fac
code: @[simp, reassoc]
lemma isoOfRangeEq_inv_fac {X Y Z : Scheme.{u}} (f : X ⟶ Z) (g : Y ⟶ Z)
    [IsOpenImmersion f] [IsOpenImmersion g] (e : Set.range f.1.base = Set.range g.1.base) :
    (isoOfRangeEq f g e).inv ≫ f = g 
goal: (AlgebraicGeometry.IsOpenImmersion.isoOfRangeEq f g e).inv ≫ f = g

full_name: AlgebraicGeometry.IsOpenImmersion.app_eq_invApp_app_of_comp_eq_aux
code: theorem app_eq_invApp_app_of_comp_eq_aux {X Y U : Scheme.{u}} (f : Y ⟶ U) (g : U ⟶ X) (fg : Y ⟶ X)
    (H : fg = f ≫ g) [h : IsOpenImmersion g] (V : U.Opens) :
    f ⁻¹ᵁ V = fg ⁻¹ᵁ (g ''ᵁ V) 
goal: (TopologicalSpace.Opens.map f.val.base).obj V =
  (TopologicalSpace.Opens.map fg.val.base).obj ((AlgebraicGeometry.Scheme.Hom.opensFunctor g).obj V)

full_name: AlgebraicGeometry.IsOpenImmersion.app_eq_appIso_inv_app_of_comp_eq
code: /-- The `fg` argument is to avoid nasty stuff about dependent types. -/
theorem app_eq_appIso_inv_app_of_comp_eq {X Y U : Scheme.{u}} (f : Y ⟶ U) (g : U ⟶ X) (fg : Y ⟶ X)
    (H : fg = f ≫ g) [h : IsOpenImmersion g] (V : U.Opens) :
    f.app V = (g.appIso V).inv ≫ fg.app (g ''ᵁ V) ≫ Y.presheaf.map
      (eqToHom <| IsOpenImmersion.app_eq_invApp_app_of_comp_eq_aux f g fg H V).op 
goal: AlgebraicGeometry.Scheme.Hom.app f V =
  (AlgebraicGeometry.Scheme.Hom.appIso g V).inv ≫
    AlgebraicGeometry.Scheme.Hom.app fg ((AlgebraicGeometry.Scheme.Hom.opensFunctor g).obj V) ≫
      Y.presheaf.map (CategoryTheory.eqToHom ⋯).op

full_name: AlgebraicGeometry.IsOpenImmersion.lift_app
code: theorem lift_app {X Y U : Scheme.{u}} (f : U ⟶ Y) (g : X ⟶ Y) [IsOpenImmersion f] (H)
    (V : U.Opens) :
    (IsOpenImmersion.lift f g H).app V = (f.appIso V).inv ≫ g.app (f ''ᵁ V) ≫
      X.presheaf.map (eqToHom <| IsOpenImmersion.app_eq_invApp_app_of_comp_eq_aux _ _ _
        (IsOpenImmersion.lift_fac f g H).symm V).op 
goal: AlgebraicGeometry.Scheme.Hom.app (AlgebraicGeometry.IsOpenImmersion.lift f g H) V =
  (AlgebraicGeometry.Scheme.Hom.appIso f V).inv ≫
    AlgebraicGeometry.Scheme.Hom.app g ((AlgebraicGeometry.Scheme.Hom.opensFunctor f).obj V) ≫
      X.presheaf.map (CategoryTheory.eqToHom ⋯).op

full_name: AlgebraicGeometry.IsOpenImmersion.ΓIso
code: /-- If `f` is an open immersion `X ⟶ Y`, the global sections of `X`
are naturally isomorphic to the sections of `Y` over the image of `f`. -/
noncomputable
def ΓIso {X Y : Scheme.{u}} (f : X ⟶ Y) [IsOpenImmersion f] (U : Y.Opens) :
    Γ(X, f⁻¹ᵁ U) ≅ Γ(Y, f.opensRange ⊓ U) 
goal: X.presheaf.obj (Opposite.op ((TopologicalSpace.Opens.map f.val.base).obj U)) ≅
  Y.presheaf.obj (Opposite.op (AlgebraicGeometry.Scheme.Hom.opensRange f ⊓ U))

full_name: AlgebraicGeometry.IsOpenImmersion.ΓIso_inv
code: @[simp]
lemma ΓIso_inv {X Y : Scheme.{u}} (f : X ⟶ Y) [IsOpenImmersion f] (U : Y.Opens) :
    (ΓIso f U).inv = f.appLE (f.opensRange ⊓ U) (f⁻¹ᵁ U)
      (by rw [← f.image_preimage_eq_opensRange_inter, f.preimage_image_eq]) 
goal: (AlgebraicGeometry.IsOpenImmersion.ΓIso f U).inv =
  AlgebraicGeometry.Scheme.Hom.appLE f (AlgebraicGeometry.Scheme.Hom.opensRange f ⊓ U)
    ((TopologicalSpace.Opens.map f.val.base).obj U) ⋯

full_name: AlgebraicGeometry.IsOpenImmersion.map_ΓIso_inv
code: @[reassoc, elementwise]
lemma map_ΓIso_inv {X Y : Scheme.{u}} (f : X ⟶ Y) [IsOpenImmersion f] (U : Y.Opens) :
    Y.presheaf.map (homOfLE inf_le_right).op ≫ (ΓIso f U).inv = f.app U 
goal: Y.presheaf.map (CategoryTheory.homOfLE ⋯).op ≫ (AlgebraicGeometry.IsOpenImmersion.ΓIso f U).inv =
  AlgebraicGeometry.Scheme.Hom.app f U

full_name: AlgebraicGeometry.IsOpenImmersion.ΓIso_hom_map
code: @[reassoc, elementwise]
lemma ΓIso_hom_map {X Y : Scheme.{u}} (f : X ⟶ Y) [IsOpenImmersion f] (U : Y.Opens) :
    f.app U ≫ (ΓIso f U).hom = Y.presheaf.map (homOfLE inf_le_right).op 
goal: AlgebraicGeometry.Scheme.Hom.app f U ≫ (AlgebraicGeometry.IsOpenImmersion.ΓIso f U).hom =
  Y.presheaf.map (CategoryTheory.homOfLE ⋯).op

full_name: AlgebraicGeometry.IsOpenImmersion.ΓIsoTop
code: /-- Given an open immersion `f : U ⟶ X`, the isomorphism between global sections
  of `U` and the sections of `X` at the image of `f`. -/
noncomputable
def ΓIsoTop {X Y : Scheme.{u}} (f : X ⟶ Y) [IsOpenImmersion f] :
    Γ(X, ⊤) ≅ Γ(Y, f.opensRange) 
goal: X.presheaf.obj (Opposite.op ⊤) ≅ Y.presheaf.obj (Opposite.op (AlgebraicGeometry.Scheme.Hom.opensRange f))

full_name: AlgebraicGeometry.Scheme.image_basicOpen
code: theorem image_basicOpen {X Y : Scheme.{u}} (f : X ⟶ Y) [H : IsOpenImmersion f] {U : X.Opens}
    (r : Γ(X, U)) :
    f ''ᵁ X.basicOpen r = Y.basicOpen ((f.appIso U).inv r) 
goal: (AlgebraicGeometry.Scheme.Hom.opensFunctor f).obj (X.basicOpen r) =
  Y.basicOpen ((AlgebraicGeometry.Scheme.Hom.appIso f U).inv r)