Theorem: AlgebraicGeometry.Scheme.Hom.isAffineOpen_iff_of_isOpenImmersion
File: Mathlib/AlgebraicGeometry/AffineScheme.lean

tactic: refine ⟨fun hU => @isAffine_of_isIso _ _
  (IsOpenImmersion.isoOfRangeEq (X.ofRestrict U.openEmbedding ≫ f) (Y.ofRestrict _) ?_).hom ?_ hU,
  fun hU => hU.image_of_isOpenImmersion f⟩
state_before: X Y : Scheme
U✝ : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U✝
f✝ : ↑Γ(X, U✝)
f : X.Hom Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
⊢ IsAffineOpen (f ''ᵁ U) ↔ IsAffineOpen U
state_after: case refine_1
X Y : Scheme
U✝ : Opens ↑↑X.toPresheafedSpace
hU✝ : IsAffineOpen U✝
f✝ : ↑Γ(X, U✝)
f : X.Hom Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen (f ''ᵁ U)
⊢ Set.range ⇑(X.ofRestrict ⋯ ≫ f).val.base = Set.range ⇑(Y.ofRestrict ⋯).val.base

case refine_2
X Y : Scheme
U✝ : Opens ↑↑X.toPresheafedSpace
hU✝ : IsAffineOpen U✝
f✝ : ↑Γ(X, U✝)
f : X.Hom Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen (f ''ᵁ U)
⊢ IsIso (IsOpenImmersion.isoOfRangeEq (X.ofRestrict ⋯ ≫ f) (Y.ofRestrict ⋯) ?refine_1).hom

tactic: erw [Scheme.comp_val_base, coe_comp, Set.range_comp]
state_before: case refine_1
X Y : Scheme
U✝ : Opens ↑↑X.toPresheafedSpace
hU✝ : IsAffineOpen U✝
f✝ : ↑Γ(X, U✝)
f : X.Hom Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen (f ''ᵁ U)
⊢ Set.range ⇑(X.ofRestrict ⋯ ≫ f).val.base = Set.range ⇑(Y.ofRestrict ⋯).val.base
state_after: case refine_1
X Y : Scheme
U✝ : Opens ↑↑X.toPresheafedSpace
hU✝ : IsAffineOpen U✝
f✝ : ↑Γ(X, U✝)
f : X.Hom Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen (f ''ᵁ U)
⊢ ⇑f.val.base '' Set.range ⇑(X.ofRestrict ⋯).val.base = Set.range ⇑(Y.ofRestrict ⋯).val.base

tactic: dsimp [Opens.coe_inclusion, Scheme.restrict]
state_before: case refine_1
X Y : Scheme
U✝ : Opens ↑↑X.toPresheafedSpace
hU✝ : IsAffineOpen U✝
f✝ : ↑Γ(X, U✝)
f : X.Hom Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen (f ''ᵁ U)
⊢ ⇑f.val.base '' Set.range ⇑(X.ofRestrict ⋯).val.base = Set.range ⇑(Y.ofRestrict ⋯).val.base
state_after: case refine_1
X Y : Scheme
U✝ : Opens ↑↑X.toPresheafedSpace
hU✝ : IsAffineOpen U✝
f✝ : ↑Γ(X, U✝)
f : X.Hom Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen (f ''ᵁ U)
⊢ ⇑f.val.base '' Set.range ⇑U.inclusion = Set.range Subtype.val

tactic: erw [Subtype.range_coe, Subtype.range_coe]
state_before: case refine_1
X Y : Scheme
U✝ : Opens ↑↑X.toPresheafedSpace
hU✝ : IsAffineOpen U✝
f✝ : ↑Γ(X, U✝)
f : X.Hom Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen (f ''ᵁ U)
⊢ ⇑f.val.base '' Set.range ⇑U.inclusion = Set.range Subtype.val
state_after: case refine_1
X Y : Scheme
U✝ : Opens ↑↑X.toPresheafedSpace
hU✝ : IsAffineOpen U✝
f✝ : ↑Γ(X, U✝)
f : X.Hom Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen (f ''ᵁ U)
⊢ ⇑f.val.base '' ↑U = ↑(f ''ᵁ U)

tactic: rfl
state_before: case refine_1
X Y : Scheme
U✝ : Opens ↑↑X.toPresheafedSpace
hU✝ : IsAffineOpen U✝
f✝ : ↑Γ(X, U✝)
f : X.Hom Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen (f ''ᵁ U)
⊢ ⇑f.val.base '' ↑U = ↑(f ''ᵁ U)
state_after: no goals

tactic: infer_instance
state_before: case refine_2
X Y : Scheme
U✝ : Opens ↑↑X.toPresheafedSpace
hU✝ : IsAffineOpen U✝
f✝ : ↑Γ(X, U✝)
f : X.Hom Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen (f ''ᵁ U)
⊢ IsIso (IsOpenImmersion.isoOfRangeEq (X.ofRestrict ⋯ ≫ f) (Y.ofRestrict ⋯) ⋯).hom
state_after: no goals