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

Proof steps:
state_before: X Y : Scheme
U : X.Opens
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : X.Opens
x : ↥V
h : ↑x ∈ U
⊢ ∃ f, X.basicOpen f ≤ V ∧ ↑x ∈ X.basicOpen f
state_after: X Y : Scheme
U : X.Opens
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : X.Opens
x : ↥V
h : ↑x ∈ U
this : IsAffine ↑U
⊢ ∃ f, X.basicOpen f ≤ V ∧ ↑x ∈ X.basicOpen f
tactic: have : IsAffine _ := hU
state_before: X Y : Scheme
U : X.Opens
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : X.Opens
x : ↥V
h : ↑x ∈ U
this : IsAffine ↑U
⊢ ∃ f, X.basicOpen f ≤ V ∧ ↑x ∈ X.basicOpen f
state_after: case intro.intro.intro.intro.intro.intro
X Y : Scheme
U : X.Opens
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : X.Opens
x : ↥V
h : ↑x ∈ U
this : IsAffine ↑U
r : ↑Γ(↑U, ⊤)
h₁ : ⟨↑x, h⟩ ∈ ↑((↑U).basicOpen r)
h₂ : ↑((↑U).basicOpen r) ⊆ ↑((Opens.map (Opens.inclusion U)).obj V)
⊢ ∃ f, X.basicOpen f ≤ V ∧ ↑x ∈ X.basicOpen f
tactic: obtain ⟨_, ⟨_, ⟨r, rfl⟩, rfl⟩, h₁, h₂⟩ :=
    (isBasis_basicOpen U).exists_subset_of_mem_open (x.2 : ⟨x, h⟩ ∈ _)
      ((Opens.map U.inclusion).obj V).isOpen
state_before: case intro.intro.intro.intro.intro.intro
X Y : Scheme
U : X.Opens
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : X.Opens
x : ↥V
h : ↑x ∈ U
this : IsAffine ↑U
r : ↑Γ(↑U, ⊤)
h₁ : ⟨↑x, h⟩ ∈ ↑((↑U).basicOpen r)
h₂ : ↑((↑U).basicOpen r) ⊆ ↑((Opens.map (Opens.inclusion U)).obj V)
⊢ ∃ f, X.basicOpen f ≤ V ∧ ↑x ∈ X.basicOpen f
state_after: case intro.intro.intro.intro.intro.intro
X Y : Scheme
U : X.Opens
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : X.Opens
x : ↥V
h : ↑x ∈ U
this✝ : IsAffine ↑U
r : ↑Γ(↑U, ⊤)
h₁ : ⟨↑x, h⟩ ∈ ↑((↑U).basicOpen r)
h₂ : ↑((↑U).basicOpen r) ⊆ ↑((Opens.map (Opens.inclusion U)).obj V)
this : U.ι ''ᵁ (↑U).basicOpen r = X.basicOpen ((X.presheaf.map (eqToHom ⋯).op) r)
⊢ ∃ f, X.basicOpen f ≤ V ∧ ↑x ∈ X.basicOpen f
tactic: have :
    U.ι ''ᵁ (U.toScheme.basicOpen r) =
      X.basicOpen (X.presheaf.map (eqToHom U.openEmbedding_obj_top.symm).op r) := by
    refine (Scheme.image_basicOpen U.ι r).trans ?_
    rw [Scheme.basicOpen_res_eq]
    simp only [Scheme.Opens.toScheme_presheaf_obj, Scheme.Opens.ι_appIso, Iso.refl_inv,
      CommRingCat.id_apply]
state_before: case intro.intro.intro.intro.intro.intro
X Y : Scheme
U : X.Opens
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : X.Opens
x : ↥V
h : ↑x ∈ U
this✝ : IsAffine ↑U
r : ↑Γ(↑U, ⊤)
h₁ : ⟨↑x, h⟩ ∈ ↑((↑U).basicOpen r)
h₂ : ↑((↑U).basicOpen r) ⊆ ↑((Opens.map (Opens.inclusion U)).obj V)
this : U.ι ''ᵁ (↑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 : X.Opens
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : X.Opens
x : ↥V
h : ↑x ∈ U
this✝ : IsAffine ↑U
r : ↑Γ(↑U, ⊤)
h₁ : ⟨↑x, h⟩ ∈ ↑((↑U).basicOpen r)
h₂ : ↑((↑U).basicOpen r) ⊆ ↑((Opens.map (Opens.inclusion U)).obj V)
this : U.ι ''ᵁ (↑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: use X.presheaf.map (eqToHom U.openEmbedding_obj_top.symm).op r
state_before: case h
X Y : Scheme
U : X.Opens
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : X.Opens
x : ↥V
h : ↑x ∈ U
this✝ : IsAffine ↑U
r : ↑Γ(↑U, ⊤)
h₁ : ⟨↑x, h⟩ ∈ ↑((↑U).basicOpen r)
h₂ : ↑((↑U).basicOpen r) ⊆ ↑((Opens.map (Opens.inclusion U)).obj V)
this : U.ι ''ᵁ (↑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 : X.Opens
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : X.Opens
x : ↥V
h : ↑x ∈ U
this✝ : IsAffine ↑U
r : ↑Γ(↑U, ⊤)
h₁ : ⟨↑x, h⟩ ∈ ↑((↑U).basicOpen r)
h₂ : ↑((↑U).basicOpen r) ⊆ ↑((Opens.map (Opens.inclusion U)).obj V)
this : U.ι ''ᵁ (↑U).basicOpen r = X.basicOpen ((X.presheaf.map (eqToHom ⋯).op) r)
⊢ U.ι ''ᵁ (↑U).basicOpen r ≤ V ∧ ↑x ∈ U.ι ''ᵁ (↑U).basicOpen r
tactic: rw [← this]
state_before: case h
X Y : Scheme
U : X.Opens
hU : IsAffineOpen U
f : ↑Γ(X, U)
V : X.Opens
x : ↥V
h : ↑x ∈ U
this✝ : IsAffine ↑U
r : ↑Γ(↑U, ⊤)
h₁ : ⟨↑x, h⟩ ∈ ↑((↑U).basicOpen r)
h₂ : ↑((↑U).basicOpen r) ⊆ ↑((Opens.map (Opens.inclusion U)).obj V)
this : U.ι ''ᵁ (↑U).basicOpen r = X.basicOpen ((X.presheaf.map (eqToHom ⋯).op) r)
⊢ U.ι ''ᵁ (↑U).basicOpen r ≤ V ∧ ↑x ∈ U.ι ''ᵁ (↑U).basicOpen r
state_after: no goals
tactic: exact ⟨Set.image_subset_iff.mpr h₂, ⟨_, h⟩, h₁, rfl⟩