Theorem: AlgebraicGeometry.IsAffineOpen.exists_basicOpen_le
File: Mathlib/AlgebraicGeometry/AffineScheme.lean

tactic: have : IsAffine _ := hU
state_before: X Y : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : Opens ↑↑X.toPresheafedSpace
x : ↥V
h : ↑x ∈ U
⊢ ∃ f, X.basicOpen f ≤ V ∧ ↑x ∈ X.basicOpen f
state_after: X Y : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : Opens ↑↑X.toPresheafedSpace
x : ↥V
h : ↑x ∈ U
this : IsAffine (X.restrict ⋯)
⊢ ∃ f, X.basicOpen f ≤ V ∧ ↑x ∈ X.basicOpen f

tactic: obtain ⟨_, ⟨_, ⟨r, rfl⟩, rfl⟩, h₁, h₂⟩ :=
  (isBasis_basicOpen (X ∣_ᵤ U)).exists_subset_of_mem_open (x.2 : ⟨x, h⟩ ∈ _)
    ((Opens.map U.inclusion).obj V).isOpen
state_before: X Y : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : Opens ↑↑X.toPresheafedSpace
x : ↥V
h : ↑x ∈ U
this : IsAffine (X.restrict ⋯)
⊢ ∃ f, X.basicOpen f ≤ V ∧ ↑x ∈ X.basicOpen f
state_after: case intro.intro.intro.intro.intro.intro
X Y : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : Opens ↑↑X.toPresheafedSpace
x : ↥V
h : ↑x ∈ U
this : IsAffine (X.restrict ⋯)
r : ↑Γ(X ∣_ᵤ U, ⊤)
h₁ : ⟨↑x, h⟩ ∈ ↑((X ∣_ᵤ U).basicOpen r)
h₂ : ↑((X ∣_ᵤ U).basicOpen r) ⊆ ↑((Opens.map U.inclusion).obj V)
⊢ ∃ f, X.basicOpen f ≤ V ∧ ↑x ∈ X.basicOpen f

tactic: have :
  U.openEmbedding.isOpenMap.functor.obj ((X ∣_ᵤ U).basicOpen r) =
    X.basicOpen (X.presheaf.map (eqToHom U.openEmbedding_obj_top.symm).op r) := by
  refine (Scheme.image_basicOpen (X.ofRestrict U.openEmbedding) r).trans ?_
  rw [← Scheme.basicOpen_res_eq _ _ (eqToHom U.openEmbedding_obj_top).op,
    ← comp_apply, ← CategoryTheory.Functor.map_comp, ← op_comp, eqToHom_trans, eqToHom_refl,
    op_id, CategoryTheory.Functor.map_id, Scheme.Hom.invApp]
  erw [LocallyRingedSpace.IsOpenImmersion.ofRestrict_invApp]
  congr
state_before: case intro.intro.intro.intro.intro.intro
X Y : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : Opens ↑↑X.toPresheafedSpace
x : ↥V
h : ↑x ∈ U
this : IsAffine (X.restrict ⋯)
r : ↑Γ(X ∣_ᵤ U, ⊤)
h₁ : ⟨↑x, h⟩ ∈ ↑((X ∣_ᵤ U).basicOpen r)
h₂ : ↑((X ∣_ᵤ U).basicOpen r) ⊆ ↑((Opens.map U.inclusion).obj V)
⊢ ∃ f, X.basicOpen f ≤ V ∧ ↑x ∈ X.basicOpen f
state_after: case intro.intro.intro.intro.intro.intro
X Y : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : Opens ↑↑X.toPresheafedSpace
x : ↥V
h : ↑x ∈ U
this✝ : IsAffine (X.restrict ⋯)
r : ↑Γ(X ∣_ᵤ U, ⊤)
h₁ : ⟨↑x, h⟩ ∈ ↑((X ∣_ᵤ U).basicOpen r)
h₂ : ↑((X ∣_ᵤ U).basicOpen r) ⊆ ↑((Opens.map U.inclusion).obj V)
this : ⋯.functor.obj ((X ∣_ᵤ U).basicOpen r) = X.basicOpen ((X.presheaf.map (eqToHom ⋯).op) r)
⊢ ∃ f, X.basicOpen f ≤ V ∧ ↑x ∈ X.basicOpen f

tactic: use X.presheaf.map (eqToHom U.openEmbedding_obj_top.symm).op r
state_before: case intro.intro.intro.intro.intro.intro
X Y : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : Opens ↑↑X.toPresheafedSpace
x : ↥V
h : ↑x ∈ U
this✝ : IsAffine (X.restrict ⋯)
r : ↑Γ(X ∣_ᵤ U, ⊤)
h₁ : ⟨↑x, h⟩ ∈ ↑((X ∣_ᵤ U).basicOpen r)
h₂ : ↑((X ∣_ᵤ U).basicOpen r) ⊆ ↑((Opens.map U.inclusion).obj V)
this : ⋯.functor.obj ((X ∣_ᵤ U).basicOpen r) = X.basicOpen ((X.presheaf.map (eqToHom ⋯).op) r)
⊢ ∃ f, X.basicOpen f ≤ V ∧ ↑x ∈ X.basicOpen f
state_after: case h
X Y : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : Opens ↑↑X.toPresheafedSpace
x : ↥V
h : ↑x ∈ U
this✝ : IsAffine (X.restrict ⋯)
r : ↑Γ(X ∣_ᵤ U, ⊤)
h₁ : ⟨↑x, h⟩ ∈ ↑((X ∣_ᵤ U).basicOpen r)
h₂ : ↑((X ∣_ᵤ U).basicOpen r) ⊆ ↑((Opens.map U.inclusion).obj V)
this : ⋯.functor.obj ((X ∣_ᵤ U).basicOpen r) = X.basicOpen ((X.presheaf.map (eqToHom ⋯).op) r)
⊢ X.basicOpen ((X.presheaf.map (eqToHom ⋯).op) r) ≤ V ∧ ↑x ∈ X.basicOpen ((X.presheaf.map (eqToHom ⋯).op) r)

tactic: rw [← this]
state_before: case h
X Y : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : Opens ↑↑X.toPresheafedSpace
x : ↥V
h : ↑x ∈ U
this✝ : IsAffine (X.restrict ⋯)
r : ↑Γ(X ∣_ᵤ U, ⊤)
h₁ : ⟨↑x, h⟩ ∈ ↑((X ∣_ᵤ U).basicOpen r)
h₂ : ↑((X ∣_ᵤ U).basicOpen r) ⊆ ↑((Opens.map U.inclusion).obj V)
this : ⋯.functor.obj ((X ∣_ᵤ U).basicOpen r) = X.basicOpen ((X.presheaf.map (eqToHom ⋯).op) r)
⊢ X.basicOpen ((X.presheaf.map (eqToHom ⋯).op) r) ≤ V ∧ ↑x ∈ X.basicOpen ((X.presheaf.map (eqToHom ⋯).op) r)
state_after: case h
X Y : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : Opens ↑↑X.toPresheafedSpace
x : ↥V
h : ↑x ∈ U
this✝ : IsAffine (X.restrict ⋯)
r : ↑Γ(X ∣_ᵤ U, ⊤)
h₁ : ⟨↑x, h⟩ ∈ ↑((X ∣_ᵤ U).basicOpen r)
h₂ : ↑((X ∣_ᵤ U).basicOpen r) ⊆ ↑((Opens.map U.inclusion).obj V)
this : ⋯.functor.obj ((X ∣_ᵤ U).basicOpen r) = X.basicOpen ((X.presheaf.map (eqToHom ⋯).op) r)
⊢ ⋯.functor.obj ((X ∣_ᵤ U).basicOpen r) ≤ V ∧ ↑x ∈ ⋯.functor.obj ((X ∣_ᵤ U).basicOpen r)

tactic: exact ⟨Set.image_subset_iff.mpr h₂, ⟨_, h⟩, h₁, rfl⟩
state_before: case h
X Y : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : Opens ↑↑X.toPresheafedSpace
x : ↥V
h : ↑x ∈ U
this✝ : IsAffine (X.restrict ⋯)
r : ↑Γ(X ∣_ᵤ U, ⊤)
h₁ : ⟨↑x, h⟩ ∈ ↑((X ∣_ᵤ U).basicOpen r)
h₂ : ↑((X ∣_ᵤ U).basicOpen r) ⊆ ↑((Opens.map U.inclusion).obj V)
this : ⋯.functor.obj ((X ∣_ᵤ U).basicOpen r) = X.basicOpen ((X.presheaf.map (eqToHom ⋯).op) r)
⊢ ⋯.functor.obj ((X ∣_ᵤ U).basicOpen r) ≤ V ∧ ↑x ∈ ⋯.functor.obj ((X ∣_ᵤ U).basicOpen r)
state_after: no goals

tactic: refine (Scheme.image_basicOpen (X.ofRestrict U.openEmbedding) r).trans ?_
state_before: X Y : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : Opens ↑↑X.toPresheafedSpace
x : ↥V
h : ↑x ∈ U
this : IsAffine (X.restrict ⋯)
r : ↑Γ(X ∣_ᵤ U, ⊤)
h₁ : ⟨↑x, h⟩ ∈ ↑((X ∣_ᵤ U).basicOpen r)
h₂ : ↑((X ∣_ᵤ U).basicOpen r) ⊆ ↑((Opens.map U.inclusion).obj V)
⊢ ⋯.functor.obj ((X ∣_ᵤ U).basicOpen r) = X.basicOpen ((X.presheaf.map (eqToHom ⋯).op) r)
state_after: X Y : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : Opens ↑↑X.toPresheafedSpace
x : ↥V
h : ↑x ∈ U
this : IsAffine (X.restrict ⋯)
r : ↑Γ(X ∣_ᵤ U, ⊤)
h₁ : ⟨↑x, h⟩ ∈ ↑((X ∣_ᵤ U).basicOpen r)
h₂ : ↑((X ∣_ᵤ U).basicOpen r) ⊆ ↑((Opens.map U.inclusion).obj V)
⊢ X.basicOpen ((Scheme.Hom.invApp (X.ofRestrict ⋯) ⊤) r) = X.basicOpen ((X.presheaf.map (eqToHom ⋯).op) r)

tactic: rw [← Scheme.basicOpen_res_eq _ _ (eqToHom U.openEmbedding_obj_top).op,
  ← comp_apply, ← CategoryTheory.Functor.map_comp, ← op_comp, eqToHom_trans, eqToHom_refl,
  op_id, CategoryTheory.Functor.map_id, Scheme.Hom.invApp]
state_before: X Y : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : Opens ↑↑X.toPresheafedSpace
x : ↥V
h : ↑x ∈ U
this : IsAffine (X.restrict ⋯)
r : ↑Γ(X ∣_ᵤ U, ⊤)
h₁ : ⟨↑x, h⟩ ∈ ↑((X ∣_ᵤ U).basicOpen r)
h₂ : ↑((X ∣_ᵤ U).basicOpen r) ⊆ ↑((Opens.map U.inclusion).obj V)
⊢ X.basicOpen ((Scheme.Hom.invApp (X.ofRestrict ⋯) ⊤) r) = X.basicOpen ((X.presheaf.map (eqToHom ⋯).op) r)
state_after: X Y : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : Opens ↑↑X.toPresheafedSpace
x : ↥V
h : ↑x ∈ U
this : IsAffine (X.restrict ⋯)
r : ↑Γ(X ∣_ᵤ U, ⊤)
h₁ : ⟨↑x, h⟩ ∈ ↑((X ∣_ᵤ U).basicOpen r)
h₂ : ↑((X ∣_ᵤ U).basicOpen r) ⊆ ↑((Opens.map U.inclusion).obj V)
⊢ X.basicOpen ((LocallyRingedSpace.IsOpenImmersion.invApp (X.ofRestrict ⋯) ⊤) r) =
    X.basicOpen ((𝟙 Γ(X, ⋯.functor.obj ⊤)) r)

tactic: erw [LocallyRingedSpace.IsOpenImmersion.ofRestrict_invApp]
state_before: X Y : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : Opens ↑↑X.toPresheafedSpace
x : ↥V
h : ↑x ∈ U
this : IsAffine (X.restrict ⋯)
r : ↑Γ(X ∣_ᵤ U, ⊤)
h₁ : ⟨↑x, h⟩ ∈ ↑((X ∣_ᵤ U).basicOpen r)
h₂ : ↑((X ∣_ᵤ U).basicOpen r) ⊆ ↑((Opens.map U.inclusion).obj V)
⊢ X.basicOpen ((LocallyRingedSpace.IsOpenImmersion.invApp (X.ofRestrict ⋯) ⊤) r) =
    X.basicOpen ((𝟙 Γ(X, ⋯.functor.obj ⊤)) r)
state_after: X Y : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : Opens ↑↑X.toPresheafedSpace
x : ↥V
h : ↑x ∈ U
this : IsAffine (X.restrict ⋯)
r : ↑Γ(X ∣_ᵤ U, ⊤)
h₁ : ⟨↑x, h⟩ ∈ ↑((X ∣_ᵤ U).basicOpen r)
h₂ : ↑((X ∣_ᵤ U).basicOpen r) ⊆ ↑((Opens.map U.inclusion).obj V)
⊢ X.basicOpen ((𝟙 ((X.restrict ⋯).presheaf.obj { unop := ⊤ })) r) = X.basicOpen ((𝟙 Γ(X, ⋯.functor.obj ⊤)) r)

tactic: congr
state_before: X Y : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : Opens ↑↑X.toPresheafedSpace
x : ↥V
h : ↑x ∈ U
this : IsAffine (X.restrict ⋯)
r : ↑Γ(X ∣_ᵤ U, ⊤)
h₁ : ⟨↑x, h⟩ ∈ ↑((X ∣_ᵤ U).basicOpen r)
h₂ : ↑((X ∣_ᵤ U).basicOpen r) ⊆ ↑((Opens.map U.inclusion).obj V)
⊢ X.basicOpen ((𝟙 ((X.restrict ⋯).presheaf.obj { unop := ⊤ })) r) = X.basicOpen ((𝟙 Γ(X, ⋯.functor.obj ⊤)) r)
state_after: no goals