Theorem: AlgebraicGeometry.IsOpenImmersion.range_pullback_fst_of_right
File: Mathlib/AlgebraicGeometry/OpenImmersion.lean

tactic: rw [← show _ = (pullback.fst : pullback g f ⟶ _).1.base from
    PreservesPullback.iso_hom_fst Scheme.forgetToTop g f]
state_before: C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Set.range ⇑pullback.fst.val.base = (g ⁻¹ᵁ { carrier := Set.range ⇑f.val.base, is_open' := ⋯ }).carrier
state_after: C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Set.range ⇑((PreservesPullback.iso Scheme.forgetToTop g f).hom ≫ pullback.fst) =
    (g ⁻¹ᵁ { carrier := Set.range ⇑f.val.base, is_open' := ⋯ }).carrier

tactic: erw [coe_comp]
state_before: C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Set.range ⇑((PreservesPullback.iso Scheme.forgetToTop g f).hom ≫ pullback.fst) =
    (g ⁻¹ᵁ { carrier := Set.range ⇑f.val.base, is_open' := ⋯ }).carrier
state_after: C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Set.range (⇑pullback.fst ∘ ⇑(PreservesPullback.iso Scheme.forgetToTop g f).hom) =
    (g ⁻¹ᵁ { carrier := Set.range ⇑f.val.base, is_open' := ⋯ }).carrier

tactic: rw [Set.range_comp, Set.range_iff_surjective.mpr, ←
  @Set.preimage_univ _ _ (pullback.snd : pullback g.1.base f.1.base ⟶ _)]
state_before: C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Set.range (⇑pullback.fst ∘ ⇑(PreservesPullback.iso Scheme.forgetToTop g f).hom) =
    (g ⁻¹ᵁ { carrier := Set.range ⇑f.val.base, is_open' := ⋯ }).carrier
state_after: C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ ⇑pullback.fst '' (⇑pullback.snd ⁻¹' Set.univ) = (g ⁻¹ᵁ { carrier := Set.range ⇑f.val.base, is_open' := ⋯ }).carrier

C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Function.Surjective ⇑(PreservesPullback.iso Scheme.forgetToTop g f).hom

tactic: erw [← TopCat.epi_iff_surjective]
state_before: C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Function.Surjective ⇑(PreservesPullback.iso Scheme.forgetToTop g f).hom
state_after: C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Epi (PreservesPullback.iso Scheme.forgetToTop g f).hom

tactic: infer_instance
state_before: C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Epi (PreservesPullback.iso Scheme.forgetToTop g f).hom
state_after: no goals

tactic: erw [TopCat.pullback_fst_image_snd_preimage]
state_before: C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ ⇑pullback.fst '' (⇑pullback.snd ⁻¹' Set.univ) = (g ⁻¹ᵁ { carrier := Set.range ⇑f.val.base, is_open' := ⋯ }).carrier
state_after: C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ ⇑(Scheme.forgetToTop.map g) ⁻¹' (⇑(Scheme.forgetToTop.map f) '' Set.univ) =
    (g ⁻¹ᵁ { carrier := Set.range ⇑f.val.base, is_open' := ⋯ }).carrier

tactic: rw [Set.image_univ]
state_before: C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ ⇑(Scheme.forgetToTop.map g) ⁻¹' (⇑(Scheme.forgetToTop.map f) '' Set.univ) =
    (g ⁻¹ᵁ { carrier := Set.range ⇑f.val.base, is_open' := ⋯ }).carrier
state_after: C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ ⇑(Scheme.forgetToTop.map g) ⁻¹' Set.range ⇑(Scheme.forgetToTop.map f) =
    (g ⁻¹ᵁ { carrier := Set.range ⇑f.val.base, is_open' := ⋯ }).carrier

tactic: rfl
state_before: C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ ⇑(Scheme.forgetToTop.map g) ⁻¹' Set.range ⇑(Scheme.forgetToTop.map f) =
    (g ⁻¹ᵁ { carrier := Set.range ⇑f.val.base, is_open' := ⋯ }).carrier
state_after: no goals