File: Mathlib/AlgebraicGeometry/Restrict.lean

full_name: AlgebraicGeometry.Scheme.Opens.toScheme
code: /-- Open subset of a scheme as a scheme. -/
@[coe]
def toScheme {X : Scheme.{u}} (U : X.Opens) : Scheme.{u} 
goal: AlgebraicGeometry.Scheme

full_name: AlgebraicGeometry.Scheme.Opens.instCoeOut
code: instance : CoeOut X.Opens Scheme 
goal: CoeOut X.Opens AlgebraicGeometry.Scheme

full_name: AlgebraicGeometry.Scheme.Opens.ι_val_base_apply
code: /-- The restriction of a scheme to an open subset. -/
@[simps! val_base_apply]
def ι : ↑U ⟶ X 
goal: U.ι.val.base self = ↑self

full_name: AlgebraicGeometry.Scheme.Opens.ι
code: /-- The restriction of a scheme to an open subset. -/
@[simps! val_base_apply]
def ι : ↑U ⟶ X 
goal: ↑U ⟶ X

full_name: AlgebraicGeometry.Scheme.Opens.instIsOpenImmersionι
code: instance : IsOpenImmersion U.ι 
goal: AlgebraicGeometry.IsOpenImmersion U.ι

full_name: AlgebraicGeometry.Scheme.Opens.toScheme_carrier
code: lemma toScheme_carrier : (U : Type u) = (U : Set X) 
goal: ↑↑(↑U).toPresheafedSpace = ↑↑U

full_name: AlgebraicGeometry.Scheme.Opens.toScheme_presheaf_obj
code: lemma toScheme_presheaf_obj (V) : Γ(U, V) = Γ(X, U.ι ''ᵁ V) 
goal: (↑U).presheaf.obj (Opposite.op V) = X.presheaf.obj (Opposite.op ((AlgebraicGeometry.Scheme.Hom.opensFunctor U.ι).obj V))

full_name: AlgebraicGeometry.Scheme.Opens.toScheme_presheaf_map
code: @[simp]
lemma toScheme_presheaf_map {V W} (i : V ⟶ W) :
    U.toScheme.presheaf.map i = X.presheaf.map (U.ι.opensFunctor.map i.unop).op 
goal: (↑U).presheaf.map i = X.presheaf.map ((AlgebraicGeometry.Scheme.Hom.opensFunctor U.ι).map i.unop).op

full_name: AlgebraicGeometry.Scheme.Opens.ι_app
code: @[simp]
lemma ι_app (V) : U.ι.app V = X.presheaf.map
    (homOfLE (x := U.ι ''ᵁ U.ι ⁻¹ᵁ V) (Set.image_preimage_subset _ _)).op 
goal: AlgebraicGeometry.Scheme.Hom.app U.ι V = X.presheaf.map (CategoryTheory.homOfLE ⋯).op

full_name: AlgebraicGeometry.Scheme.Opens.ι_appLE
code: @[simp]
lemma ι_appLE (V W e) :
    U.ι.appLE V W e =
      X.presheaf.map (homOfLE (x := U.ι ''ᵁ W) (Set.image_subset_iff.mpr ‹_›)).op 
goal: AlgebraicGeometry.Scheme.Hom.appLE U.ι V W e = X.presheaf.map (CategoryTheory.homOfLE ⋯).op

full_name: AlgebraicGeometry.Scheme.Opens.ι_appIso
code: @[simp]
lemma ι_appIso (V) : U.ι.appIso V = Iso.refl _ 
goal: AlgebraicGeometry.Scheme.Hom.appIso U.ι V =
  CategoryTheory.Iso.refl (X.presheaf.obj (Opposite.op ((AlgebraicGeometry.Scheme.Hom.opensFunctor U.ι).obj V)))

full_name: AlgebraicGeometry.Scheme.Opens.opensRange_ι
code: @[simp]
lemma opensRange_ι : U.ι.opensRange = U 
goal: AlgebraicGeometry.Scheme.Hom.opensRange U.ι = U

full_name: AlgebraicGeometry.Scheme.Opens.range_ι
code: @[simp]
lemma range_ι : Set.range U.ι.val.base = U 
goal: Set.range ⇑U.ι.val.base = ↑U

full_name: AlgebraicGeometry.Scheme.Opens.ι_image_top
code: lemma ι_image_top : U.ι ''ᵁ ⊤ = U 
goal: (AlgebraicGeometry.Scheme.Hom.opensFunctor U.ι).obj ⊤ = U

full_name: AlgebraicGeometry.Scheme.Opens.ι_preimage_self
code: @[simp]
lemma ι_preimage_self : U.ι ⁻¹ᵁ U = ⊤ 
goal: (TopologicalSpace.Opens.map U.ι.val.base).obj U = ⊤

full_name: AlgebraicGeometry.Scheme.Opens.ι_appLE_isIso
code: instance ι_appLE_isIso :
    IsIso (U.ι.appLE U ⊤ U.ι_preimage_self.ge) 
goal: CategoryTheory.IsIso (AlgebraicGeometry.Scheme.Hom.appLE U.ι U ⊤ ⋯)

full_name: AlgebraicGeometry.Scheme.Opens.ι_app_self
code: lemma ι_app_self : U.ι.app U = X.presheaf.map (eqToHom (X := U.ι ''ᵁ _) (by simp)).op 
goal: AlgebraicGeometry.Scheme.Hom.app U.ι U = X.presheaf.map (CategoryTheory.eqToHom ⋯).op

full_name: AlgebraicGeometry.Scheme.Opens.eq_presheaf_map_eqToHom
code: lemma eq_presheaf_map_eqToHom {V W : Opens U} (e : U.ι ''ᵁ V = U.ι ''ᵁ W) :
    X.presheaf.map (eqToHom e).op =
      U.toScheme.presheaf.map (eqToHom <| U.openEmbedding.functor_obj_injective e).op 
goal: X.presheaf.map (CategoryTheory.eqToHom e).op = (↑U).presheaf.map (CategoryTheory.eqToHom ⋯).op

full_name: AlgebraicGeometry.Scheme.Opens.nonempty_iff
code: @[simp]
lemma nonempty_iff : Nonempty U.toScheme ↔ (U : Set X).Nonempty 
goal: Nonempty ↑↑(↑U).toPresheafedSpace ↔ (↑U).Nonempty

full_name: AlgebraicGeometry.Scheme.Opens.topIso_inv
code: /-- The global sections of the restriction is isomorphic to the sections on the open set. -/
@[simps!]
def topIso : Γ(U, ⊤) ≅ Γ(X, U) 
goal: U.topIso.inv = X.presheaf.map (CategoryTheory.eqToHom ⋯).op

full_name: AlgebraicGeometry.Scheme.Opens.topIso_hom
code: /-- The global sections of the restriction is isomorphic to the sections on the open set. -/
@[simps!]
def topIso : Γ(U, ⊤) ≅ Γ(X, U) 
goal: U.topIso.hom = X.presheaf.map (CategoryTheory.eqToHom ⋯).op

full_name: AlgebraicGeometry.Scheme.Opens.topIso
code: /-- The global sections of the restriction is isomorphic to the sections on the open set. -/
@[simps!]
def topIso : Γ(U, ⊤) ≅ Γ(X, U) 
goal: (↑U).presheaf.obj (Opposite.op ⊤) ≅ X.presheaf.obj (Opposite.op U)

full_name: AlgebraicGeometry.Scheme.Opens.stalkIso
code: /-- The stalks of an open subscheme are isomorphic to the stalks of the original scheme. -/
def stalkIso {X : Scheme.{u}} (U : X.Opens) (x : U) :
    U.toScheme.presheaf.stalk x ≅ X.presheaf.stalk x.1 
goal: (↑U).presheaf.stalk x ≅ X.presheaf.stalk ↑x

full_name: AlgebraicGeometry.Scheme.Opens.germ_stalkIso_hom
code: @[reassoc (attr := simp)]
lemma germ_stalkIso_hom {X : Scheme.{u}} (U : X.Opens)
    {V : U.toScheme.Opens} (x : V) :
      U.toScheme.presheaf.germ x ≫ (U.stalkIso x.1).hom =
        X.presheaf.germ ⟨x.1.1, show x.1.1 ∈ U.ι ''ᵁ V from ⟨x.1, x.2, rfl⟩⟩ 
goal: (↑U).presheaf.germ x ≫ (U.stalkIso ↑x).hom = X.presheaf.germ ⟨↑↑x, ⋯⟩

full_name: AlgebraicGeometry.Scheme.Opens.germ_stalkIso_hom'
code: @[reassoc (attr := simp)]
lemma germ_stalkIso_hom' {X : Scheme.{u}} (U : X.Opens)
    {V : TopologicalSpace.Opens U} (x : U) (hx : x ∈ V) :
      U.toScheme.presheaf.germ ⟨x, hx⟩ ≫ (U.stalkIso x).hom =
        X.presheaf.germ ⟨x.1, show x.1 ∈ U.ι ''ᵁ V from ⟨x, hx, rfl⟩⟩ 
goal: (↑U).presheaf.germ ⟨x, hx⟩ ≫ (U.stalkIso x).hom = X.presheaf.germ ⟨↑x, ⋯⟩

full_name: AlgebraicGeometry.Scheme.Opens.germ_stalkIso_inv
code: @[simp, reassoc]
lemma germ_stalkIso_inv {X : Scheme.{u}} (U : X.Opens) (V : U.toScheme.Opens) (x : U)
    (hx : x ∈ V) : X.presheaf.germ ⟨x.val, show x.val ∈ U.ι ''ᵁ V from ⟨x, hx, rfl⟩⟩ ≫
      (U.stalkIso x).inv = U.toScheme.presheaf.germ ⟨x, hx⟩ 
goal: X.presheaf.germ ⟨↑x, ⋯⟩ ≫ (U.stalkIso x).inv = (↑U).presheaf.germ ⟨x, hx⟩

full_name: AlgebraicGeometry.Scheme.openCoverOfISupEqTop_J
code: /-- If `U` is a family of open sets that covers `X`, then `X.restrict U` forms an `X.open_cover`. -/
@[simps! J obj map]
def Scheme.openCoverOfISupEqTop {s : Type*} (X : Scheme.{u}) (U : s → X.Opens)
    (hU : ⨆ i, U i = ⊤) : X.OpenCover 
goal: (X.openCoverOfISupEqTop U hU).J = s

full_name: AlgebraicGeometry.Scheme.openCoverOfISupEqTop_obj
code: /-- If `U` is a family of open sets that covers `X`, then `X.restrict U` forms an `X.open_cover`. -/
@[simps! J obj map]
def Scheme.openCoverOfISupEqTop {s : Type*} (X : Scheme.{u}) (U : s → X.Opens)
    (hU : ⨆ i, U i = ⊤) : X.OpenCover 
goal: (X.openCoverOfISupEqTop U hU).obj i = ↑(U i)

full_name: AlgebraicGeometry.Scheme.openCoverOfISupEqTop_map
code: /-- If `U` is a family of open sets that covers `X`, then `X.restrict U` forms an `X.open_cover`. -/
@[simps! J obj map]
def Scheme.openCoverOfISupEqTop {s : Type*} (X : Scheme.{u}) (U : s → X.Opens)
    (hU : ⨆ i, U i = ⊤) : X.OpenCover 
goal: (X.openCoverOfISupEqTop U hU).map i = (U i).ι

full_name: AlgebraicGeometry.Scheme.openCoverOfISupEqTop
code: /-- If `U` is a family of open sets that covers `X`, then `X.restrict U` forms an `X.open_cover`. -/
@[simps! J obj map]
def Scheme.openCoverOfISupEqTop {s : Type*} (X : Scheme.{u}) (U : s → X.Opens)
    (hU : ⨆ i, U i = ⊤) : X.OpenCover 
goal: X.OpenCover

full_name: AlgebraicGeometry.opensRestrict_apply_coe_coe
code: /-- The open sets of an open subscheme corresponds to the open sets containing in the subset. -/
@[simps!]
def opensRestrict :
    Scheme.Opens U ≃ { V : X.Opens // V ≤ U } 
goal: ∀ (a : (↑U).Opens), ↑↑((AlgebraicGeometry.opensRestrict U) a) = ⇑U.ι.val.base '' ↑a

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

full_name: AlgebraicGeometry.opensRestrict_symm_apply_coe
code: /-- The open sets of an open subscheme corresponds to the open sets containing in the subset. -/
@[simps!]
def opensRestrict :
    Scheme.Opens U ≃ { V : X.Opens // V ≤ U } 
goal: ∀ (a : { V // V ≤ U }),
  ↑((AlgebraicGeometry.opensRestrict U).symm a) = ⇑U.ι.val.base ⁻¹' ↑↑((Equiv.subtypeEquivProp ⋯).symm a)

full_name: AlgebraicGeometry.ΓRestrictAlgebra
code: instance ΓRestrictAlgebra {X : Scheme.{u}} (U : X.Opens) :
    Algebra (Γ(X, ⊤)) Γ(U, ⊤) 
goal: Algebra ↑(X.presheaf.obj (Opposite.op ⊤)) ↑((↑U).presheaf.obj (Opposite.op ⊤))

full_name: AlgebraicGeometry.Scheme.map_basicOpen'
code: lemma Scheme.map_basicOpen' (r : Γ(U, ⊤)) :
    U.ι ''ᵁ (U.toScheme.basicOpen r) = X.basicOpen
      (X.presheaf.map (eqToHom U.openEmbedding_obj_top.symm).op r) 
goal: (AlgebraicGeometry.Scheme.Hom.opensFunctor U.ι).obj ((↑U).basicOpen r) =
  X.basicOpen ((X.presheaf.map (CategoryTheory.eqToHom ⋯).op) r)

full_name: AlgebraicGeometry.Scheme.Opens.ι_image_basicOpen
code: lemma Scheme.Opens.ι_image_basicOpen (r : Γ(U, ⊤)) :
    U.ι ''ᵁ (U.toScheme.basicOpen r) = X.basicOpen r 
goal: (AlgebraicGeometry.Scheme.Hom.opensFunctor U.ι).obj ((↑U).basicOpen r) = X.basicOpen r

full_name: AlgebraicGeometry.Scheme.map_basicOpen_map
code: lemma Scheme.map_basicOpen_map (r : Γ(X, U)) :
    U.ι ''ᵁ (U.toScheme.basicOpen <| U.topIso.inv r) = X.basicOpen r 
goal: (AlgebraicGeometry.Scheme.Hom.opensFunctor U.ι).obj ((↑U).basicOpen (U.topIso.inv r)) = X.basicOpen r

full_name: AlgebraicGeometry.Scheme.restrictFunctor
code: /-- The functor taking open subsets of `X` to open subschemes of `X`. -/
-- @[simps obj_left obj_hom mapLeft]
def Scheme.restrictFunctor : X.Opens ⥤ Over X 
goal: X.Opens ⥤ CategoryTheory.Over X

full_name: AlgebraicGeometry.Scheme.restrictFunctor_obj_left
code: @[simp] lemma Scheme.restrictFunctor_obj_left (U : X.Opens) :
  (X.restrictFunctor.obj U).left = U 
goal: (X.restrictFunctor.obj U).left = ↑U

full_name: AlgebraicGeometry.Scheme.restrictFunctor_obj_hom
code: @[simp] lemma Scheme.restrictFunctor_obj_hom (U : X.Opens) :
  (X.restrictFunctor.obj U).hom = U.ι 
goal: (X.restrictFunctor.obj U).hom = U.ι

full_name: AlgebraicGeometry.Scheme.restrictFunctor_map_left
code: @[simp] lemma Scheme.restrictFunctor_map_left {U V : X.Opens} (i : U ⟶ V) :
  (X.restrictFunctor.map i).left = IsOpenImmersion.lift (V.ι) U.ι (by simpa using i.le) 
goal: (X.restrictFunctor.map i).left = AlgebraicGeometry.IsOpenImmersion.lift V.ι U.ι ⋯

full_name: AlgebraicGeometry.Scheme.restrictFunctor_map_ofRestrict
code: @[reassoc]
theorem Scheme.restrictFunctor_map_ofRestrict {U V : X.Opens} (i : U ⟶ V) :
    (X.restrictFunctor.map i).1 ≫ V.ι = U.ι 
goal: (X.restrictFunctor.map i).left ≫ V.ι = U.ι

full_name: AlgebraicGeometry.Scheme.restrictFunctor_map_base
code: theorem Scheme.restrictFunctor_map_base {U V : X.Opens} (i : U ⟶ V) :
    (X.restrictFunctor.map i).1.val.base = (Opens.toTopCat _).map i 
goal: (X.restrictFunctor.map i).left.val.base = (TopologicalSpace.Opens.toTopCat ↑X.toPresheafedSpace).map i

full_name: AlgebraicGeometry.Scheme.restrictFunctor_map_app_aux
code: theorem Scheme.restrictFunctor_map_app_aux {U V : X.Opens} (i : U ⟶ V) (W : Opens V) :
    U.ι ''ᵁ ((X.restrictFunctor.map i).1 ⁻¹ᵁ W) ≤ V.ι ''ᵁ W 
goal: (AlgebraicGeometry.Scheme.Hom.opensFunctor U.ι).obj
    ((TopologicalSpace.Opens.map (X.restrictFunctor.map i).left.val.base).obj W) ≤
  (AlgebraicGeometry.Scheme.Hom.opensFunctor V.ι).obj W

full_name: AlgebraicGeometry.Scheme.restrictFunctor_map_app
code: theorem Scheme.restrictFunctor_map_app {U V : X.Opens} (i : U ⟶ V) (W : Opens V) :
    (X.restrictFunctor.map i).1.app W =
      X.presheaf.map (homOfLE <| X.restrictFunctor_map_app_aux i W).op 
goal: AlgebraicGeometry.Scheme.Hom.app (X.restrictFunctor.map i).left W = X.presheaf.map (CategoryTheory.homOfLE ⋯).op

full_name: AlgebraicGeometry.Scheme.restrictFunctorΓ_inv_app
code: /-- The functor that restricts to open subschemes and then takes global section is
isomorphic to the structure sheaf. -/
@[simps!]
def Scheme.restrictFunctorΓ : X.restrictFunctor.op ⋙ (Over.forget X).op ⋙ Scheme.Γ ≅ X.presheaf 
goal: ∀ (X_1 : X.Opensᵒᵖ), AlgebraicGeometry.Scheme.restrictFunctorΓ.inv.app X_1 = X.presheaf.map (CategoryTheory.eqToHom ⋯)

full_name: AlgebraicGeometry.Scheme.restrictFunctorΓ_hom_app
code: /-- The functor that restricts to open subschemes and then takes global section is
isomorphic to the structure sheaf. -/
@[simps!]
def Scheme.restrictFunctorΓ : X.restrictFunctor.op ⋙ (Over.forget X).op ⋙ Scheme.Γ ≅ X.presheaf 
goal: ∀ (X_1 : X.Opensᵒᵖ), AlgebraicGeometry.Scheme.restrictFunctorΓ.hom.app X_1 = X.presheaf.map (CategoryTheory.eqToHom ⋯)

full_name: AlgebraicGeometry.Scheme.restrictFunctorΓ
code: /-- The functor that restricts to open subschemes and then takes global section is
isomorphic to the structure sheaf. -/
@[simps!]
def Scheme.restrictFunctorΓ : X.restrictFunctor.op ⋙ (Over.forget X).op ⋙ Scheme.Γ ≅ X.presheaf 
goal: X.restrictFunctor.op ⋙ (CategoryTheory.Over.forget X).op ⋙ AlgebraicGeometry.Scheme.Γ ≅ X.presheaf

full_name: AlgebraicGeometry.Scheme.restrictRestrictComm
code: /-- `X ∣_ U ∣_ V` is isomorphic to `X ∣_ V ∣_ U` -/
noncomputable
def Scheme.restrictRestrictComm (X : Scheme.{u}) (U V : X.Opens) :
    (U.ι ⁻¹ᵁ V).toScheme ≅ V.ι ⁻¹ᵁ U 
goal: ↑((TopologicalSpace.Opens.map U.ι.val.base).obj V) ≅ ↑((TopologicalSpace.Opens.map V.ι.val.base).obj U)

full_name: AlgebraicGeometry.Scheme.restrictRestrict
code: /-- If `V` is an open subset of `U`, then `X ∣_ U ∣_ V` is isomorphic to `X ∣_ V`. -/
noncomputable
def Scheme.restrictRestrict (X : Scheme.{u}) (U : X.Opens) (V : U.toScheme.Opens) :
    V.toScheme ≅ U.ι ''ᵁ V 
goal: ↑V ≅ ↑((AlgebraicGeometry.Scheme.Hom.opensFunctor U.ι).obj V)

full_name: AlgebraicGeometry.Scheme.restrictRestrict_hom_restrict
code: @[simp, reassoc]
lemma Scheme.restrictRestrict_hom_restrict (X : Scheme.{u}) (U : X.Opens)
    (V : U.toScheme.Opens) :
    (X.restrictRestrict U V).hom ≫ Opens.ι _ = V.ι ≫ U.ι 
goal: (X.restrictRestrict U V).hom ≫ ((AlgebraicGeometry.Scheme.Hom.opensFunctor U.ι).obj V).ι = V.ι ≫ U.ι

full_name: AlgebraicGeometry.Scheme.restrictRestrict_inv_restrict_restrict
code: @[simp, reassoc]
lemma Scheme.restrictRestrict_inv_restrict_restrict (X : Scheme.{u}) (U : X.Opens)
    (V : U.toScheme.Opens) :
    (X.restrictRestrict U V).inv ≫ V.ι ≫ U.ι = Opens.ι _ 
goal: (X.restrictRestrict U V).inv ≫ V.ι ≫ U.ι = ((AlgebraicGeometry.Scheme.Hom.opensFunctor U.ι).obj V).ι

full_name: AlgebraicGeometry.Scheme.restrictIsoOfEq
code: /-- If `U = V`, then `X ∣_ U` is isomorphic to `X ∣_ V`. -/
noncomputable
def Scheme.restrictIsoOfEq (X : Scheme.{u}) {U V : X.Opens} (e : U = V) :
    (U : Scheme.{u}) ≅ V 
goal: ↑U ≅ ↑V

full_name: AlgebraicGeometry.Scheme.restrictMapIso
code: /-- The restriction of an isomorphism onto an open set. -/
noncomputable abbrev Scheme.restrictMapIso {X Y : Scheme.{u}} (f : X ⟶ Y) [IsIso f]
    (U : Y.Opens) : (f ⁻¹ᵁ U).toScheme ≅ U 
goal: ↑((TopologicalSpace.Opens.map f.val.base).obj U) ≅ ↑U

full_name: AlgebraicGeometry.pullbackRestrictIsoRestrict
code: /-- Given a morphism `f : X ⟶ Y` and an open set `U ⊆ Y`, we have `X ×[Y] U ≅ X |_{f ⁻¹ U}` -/
def pullbackRestrictIsoRestrict {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Opens) :
    pullback f (U.ι) ≅ f ⁻¹ᵁ U 
goal: CategoryTheory.Limits.pullback f U.ι ≅ ↑((TopologicalSpace.Opens.map f.val.base).obj U)

full_name: AlgebraicGeometry.pullbackRestrictIsoRestrict_inv_fst
code: @[simp, reassoc]
theorem pullbackRestrictIsoRestrict_inv_fst {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Opens) :
    (pullbackRestrictIsoRestrict f U).inv ≫ pullback.fst f _ = (f ⁻¹ᵁ U).ι 
goal: (AlgebraicGeometry.pullbackRestrictIsoRestrict f U).inv ≫ CategoryTheory.Limits.pullback.fst f U.ι =
  ((TopologicalSpace.Opens.map f.val.base).obj U).ι

full_name: AlgebraicGeometry.pullbackRestrictIsoRestrict_hom_restrict
code: @[simp, reassoc]
theorem pullbackRestrictIsoRestrict_hom_restrict {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Opens) :
    (pullbackRestrictIsoRestrict f U).hom ≫ (f ⁻¹ᵁ U).ι = pullback.fst f _ 
goal: (AlgebraicGeometry.pullbackRestrictIsoRestrict f U).hom ≫ ((TopologicalSpace.Opens.map f.val.base).obj U).ι =
  CategoryTheory.Limits.pullback.fst f U.ι

full_name: AlgebraicGeometry.morphismRestrict
code: /-- The restriction of a morphism `X ⟶ Y` onto `X |_{f ⁻¹ U} ⟶ Y |_ U`. -/
def morphismRestrict {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Opens) : (f ⁻¹ᵁ U).toScheme ⟶ U 
goal: ↑((TopologicalSpace.Opens.map f.val.base).obj U) ⟶ ↑U

full_name: AlgebraicGeometry._aux_Mathlib_AlgebraicGeometry_Restrict___unexpand_AlgebraicGeometry_morphismRestrict_1
code: /-- the notation for restricting a morphism of scheme to an open subset of the target scheme -/
infixl:85 " ∣_ " => morphismRestrict
goal: Lean.PrettyPrinter.Unexpander

full_name: AlgebraicGeometry.«_aux_Mathlib_AlgebraicGeometry_Restrict___macroRules_AlgebraicGeometry_term_∣___1»
code: /-- the notation for restricting a morphism of scheme to an open subset of the target scheme -/
infixl:85 " ∣_ " => morphismRestrict
goal: Lean.Macro

full_name: AlgebraicGeometry.pullbackRestrictIsoRestrict_hom_morphismRestrict
code: @[simp, reassoc]
theorem pullbackRestrictIsoRestrict_hom_morphismRestrict {X Y : Scheme.{u}} (f : X ⟶ Y)
    (U : Y.Opens) : (pullbackRestrictIsoRestrict f U).hom ≫ f ∣_ U = pullback.snd _ _ 
goal: (AlgebraicGeometry.pullbackRestrictIsoRestrict f U).hom ≫ f ∣_ U = CategoryTheory.Limits.pullback.snd f U.ι

full_name: AlgebraicGeometry.morphismRestrict_ι
code: @[simp, reassoc]
theorem morphismRestrict_ι {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Opens) :
    (f ∣_ U) ≫ U.ι = (f ⁻¹ᵁ U).ι ≫ f 
goal: f ∣_ U ≫ U.ι = ((TopologicalSpace.Opens.map f.val.base).obj U).ι ≫ f

full_name: AlgebraicGeometry.isPullback_morphismRestrict
code: theorem isPullback_morphismRestrict {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Opens) :
    IsPullback (f ∣_ U) (f ⁻¹ᵁ U).ι U.ι f 
goal: CategoryTheory.IsPullback (f ∣_ U) ((TopologicalSpace.Opens.map f.val.base).obj U).ι U.ι f

full_name: AlgebraicGeometry.morphismRestrict_id
code: @[simp]
lemma morphismRestrict_id {X : Scheme.{u}} (U : X.Opens) : 𝟙 X ∣_ U = 𝟙 _ 
goal: 𝟙 X ∣_ U = 𝟙 ↑((TopologicalSpace.Opens.map (𝟙 X).val.base).obj U)

full_name: AlgebraicGeometry.morphismRestrict_comp
code: theorem morphismRestrict_comp {X Y Z : Scheme.{u}} (f : X ⟶ Y) (g : Y ⟶ Z) (U : Opens Z) :
    (f ≫ g) ∣_ U = f ∣_ g ⁻¹ᵁ U ≫ g ∣_ U 
goal: (f ≫ g) ∣_ U = f ∣_ (TopologicalSpace.Opens.map g.val.base).obj U ≫ g ∣_ U

full_name: AlgebraicGeometry.instIsIsoSchemeMorphismRestrict
code: instance {X Y : Scheme.{u}} (f : X ⟶ Y) [IsIso f] (U : Y.Opens) : IsIso (f ∣_ U) 
goal: CategoryTheory.IsIso (f ∣_ U)

full_name: AlgebraicGeometry.morphismRestrict_base_coe
code: theorem morphismRestrict_base_coe {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Opens) (x) :
    @Coe.coe U Y (⟨fun x => x.1⟩) ((f ∣_ U).val.base x) = f.val.base x.1 
goal: Coe.coe ((f ∣_ U).val.base x) = f.val.base ↑x

full_name: AlgebraicGeometry.morphismRestrict_val_base
code: theorem morphismRestrict_val_base {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Opens) :
    ⇑(f ∣_ U).val.base = U.1.restrictPreimage f.val.base 
goal: ⇑(f ∣_ U).val.base = U.carrier.restrictPreimage ⇑f.val.base

full_name: AlgebraicGeometry.image_morphismRestrict_preimage
code: theorem image_morphismRestrict_preimage {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Opens) (V : Opens U) :
    (f ⁻¹ᵁ U).ι ''ᵁ ((f ∣_ U) ⁻¹ᵁ V) = f ⁻¹ᵁ (U.ι ''ᵁ V) 
goal: (AlgebraicGeometry.Scheme.Hom.opensFunctor ((TopologicalSpace.Opens.map f.val.base).obj U).ι).obj
    ((TopologicalSpace.Opens.map (f ∣_ U).val.base).obj V) =
  (TopologicalSpace.Opens.map f.val.base).obj ((AlgebraicGeometry.Scheme.Hom.opensFunctor U.ι).obj V)

full_name: AlgebraicGeometry.eqToHom_eq_homOfLE
code: lemma eqToHom_eq_homOfLE {C} [Preorder C] {X Y : C} (e : X = Y) : eqToHom e = homOfLE e.le 
goal: CategoryTheory.eqToHom e = CategoryTheory.homOfLE ⋯

full_name: AlgebraicGeometry.morphismRestrict_app
code: theorem morphismRestrict_app {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Opens) (V : U.toScheme.Opens) :
    (f ∣_ U).app V = f.app (U.ι ''ᵁ V) ≫
        X.presheaf.map (eqToHom (image_morphismRestrict_preimage f U V)).op 
goal: AlgebraicGeometry.Scheme.Hom.app (f ∣_ U) V =
  AlgebraicGeometry.Scheme.Hom.app f ((AlgebraicGeometry.Scheme.Hom.opensFunctor U.ι).obj V) ≫
    X.presheaf.map (CategoryTheory.eqToHom ⋯).op

full_name: AlgebraicGeometry.morphismRestrict_app'
code: @[simp]
theorem morphismRestrict_app' {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Opens) (V : Opens U) :
    (f ∣_ U).app V = f.appLE _ _ (image_morphismRestrict_preimage f U V).le 
goal: AlgebraicGeometry.Scheme.Hom.app (f ∣_ U) V =
  AlgebraicGeometry.Scheme.Hom.appLE f ((AlgebraicGeometry.Scheme.Hom.opensFunctor U.ι).obj V)
    ((AlgebraicGeometry.Scheme.Hom.opensFunctor ((TopologicalSpace.Opens.map f.val.base).obj U).ι).obj
      ((TopologicalSpace.Opens.map (f ∣_ U).val.base).obj V))
    ⋯

full_name: AlgebraicGeometry.morphismRestrict_appLE
code: @[simp]
theorem morphismRestrict_appLE {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Opens) (V W e) :
    (f ∣_ U).appLE V W e = f.appLE (U.ι ''ᵁ V) ((f ⁻¹ᵁ U).ι ''ᵁ W)
      ((Set.image_subset _ e).trans (image_morphismRestrict_preimage f U V).le) 
goal: AlgebraicGeometry.Scheme.Hom.appLE (f ∣_ U) V W e =
  AlgebraicGeometry.Scheme.Hom.appLE f ((AlgebraicGeometry.Scheme.Hom.opensFunctor U.ι).obj V)
    ((AlgebraicGeometry.Scheme.Hom.opensFunctor ((TopologicalSpace.Opens.map f.val.base).obj U).ι).obj W) ⋯

full_name: AlgebraicGeometry.Γ_map_morphismRestrict
code: theorem Γ_map_morphismRestrict {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Opens) :
    Scheme.Γ.map (f ∣_ U).op =
      Y.presheaf.map (eqToHom U.openEmbedding_obj_top.symm).op ≫
        f.app U ≫ X.presheaf.map (eqToHom (f ⁻¹ᵁ U).openEmbedding_obj_top).op 
goal: AlgebraicGeometry.Scheme.Γ.map (f ∣_ U).op =
  Y.presheaf.map (CategoryTheory.eqToHom ⋯).op ≫
    AlgebraicGeometry.Scheme.Hom.app f U ≫ X.presheaf.map (CategoryTheory.eqToHom ⋯).op

full_name: AlgebraicGeometry.morphismRestrictOpensRange
code: /-- Restricting a morphism onto the image of an open immersion is isomorphic to the base change
along the immersion. -/
def morphismRestrictOpensRange
    {X Y U : Scheme.{u}} (f : X ⟶ Y) (g : U ⟶ Y) [hg : IsOpenImmersion g] :
    Arrow.mk (f ∣_ g.opensRange) ≅ Arrow.mk (pullback.snd f g) 
goal: CategoryTheory.Arrow.mk (f ∣_ AlgebraicGeometry.Scheme.Hom.opensRange g) ≅
  CategoryTheory.Arrow.mk (CategoryTheory.Limits.pullback.snd f g)

full_name: AlgebraicGeometry.morphismRestrictEq
code: /-- The restrictions onto two equal open sets are isomorphic. This currently has bad defeqs when
unfolded, but it should not matter for now. Replace this definition if better defeqs are needed. -/
def morphismRestrictEq {X Y : Scheme.{u}} (f : X ⟶ Y) {U V : Y.Opens} (e : U = V) :
    Arrow.mk (f ∣_ U) ≅ Arrow.mk (f ∣_ V) 
goal: CategoryTheory.Arrow.mk (f ∣_ U) ≅ CategoryTheory.Arrow.mk (f ∣_ V)

full_name: AlgebraicGeometry.morphismRestrictRestrict
code: /-- Restricting a morphism twice is isomorphic to one restriction. -/
def morphismRestrictRestrict {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Opens) (V : U.toScheme.Opens) :
    Arrow.mk (f ∣_ U ∣_ V) ≅ Arrow.mk (f ∣_ U.ι ''ᵁ V) 
goal: CategoryTheory.Arrow.mk (f ∣_ U ∣_ V) ≅
  CategoryTheory.Arrow.mk (f ∣_ (AlgebraicGeometry.Scheme.Hom.opensFunctor U.ι).obj V)

full_name: AlgebraicGeometry.morphismRestrictRestrictBasicOpen
code: /-- Restricting a morphism twice onto a basic open set is isomorphic to one restriction.  -/
def morphismRestrictRestrictBasicOpen {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Opens) (r : Γ(Y, U)) :
    Arrow.mk (f ∣_ U ∣_
          U.toScheme.basicOpen (Y.presheaf.map (eqToHom U.openEmbedding_obj_top).op r)) ≅
      Arrow.mk (f ∣_ Y.basicOpen r) 
goal: CategoryTheory.Arrow.mk (f ∣_ U ∣_ (↑U).basicOpen ((Y.presheaf.map (CategoryTheory.eqToHom ⋯).op) r)) ≅
  CategoryTheory.Arrow.mk (f ∣_ Y.basicOpen r)

full_name: AlgebraicGeometry.morphismRestrictStalkMap
code: /-- The stalk map of a restriction of a morphism is isomorphic to the stalk map of the original map.
-/
def morphismRestrictStalkMap {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Opens) (x) :
    Arrow.mk ((f ∣_ U).stalkMap x) ≅ Arrow.mk (f.stalkMap x.1) 
goal: CategoryTheory.Arrow.mk (AlgebraicGeometry.Scheme.Hom.stalkMap (f ∣_ U) x) ≅
  CategoryTheory.Arrow.mk (AlgebraicGeometry.Scheme.Hom.stalkMap f ↑x)

full_name: AlgebraicGeometry.instIsOpenImmersionMorphismRestrict
code: instance {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Opens) [IsOpenImmersion f] :
    IsOpenImmersion (f ∣_ U) 
goal: AlgebraicGeometry.IsOpenImmersion (f ∣_ U)

full_name: AlgebraicGeometry.Scheme.OpenCover.restrict_J
code: /-- The restriction of an open cover to an open subset. -/
@[simps! J obj map]
noncomputable
def Scheme.OpenCover.restrict {X : Scheme.{u}} (𝒰 : X.OpenCover) (U : Opens X) :
    U.toScheme.OpenCover 
goal: (𝒰.restrict U).J = 𝒰.J

full_name: AlgebraicGeometry.Scheme.OpenCover.restrict_obj
code: /-- The restriction of an open cover to an open subset. -/
@[simps! J obj map]
noncomputable
def Scheme.OpenCover.restrict {X : Scheme.{u}} (𝒰 : X.OpenCover) (U : Opens X) :
    U.toScheme.OpenCover 
goal: ∀ (x : 𝒰.J), (𝒰.restrict U).obj x = ↑((TopologicalSpace.Opens.map (𝒰.map x).val.base).obj U)

full_name: AlgebraicGeometry.Scheme.OpenCover.restrict
code: /-- The restriction of an open cover to an open subset. -/
@[simps! J obj map]
noncomputable
def Scheme.OpenCover.restrict {X : Scheme.{u}} (𝒰 : X.OpenCover) (U : Opens X) :
    U.toScheme.OpenCover 
goal: (↑U).OpenCover

full_name: AlgebraicGeometry.Scheme.OpenCover.restrict_map
code: /-- The restriction of an open cover to an open subset. -/
@[simps! J obj map]
noncomputable
def Scheme.OpenCover.restrict {X : Scheme.{u}} (𝒰 : X.OpenCover) (U : Opens X) :
    U.toScheme.OpenCover 
goal: ∀ (x : 𝒰.J), (𝒰.restrict U).map x = 𝒰.map x ∣_ U