Theorem: AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.to_iso
File: Mathlib/Geometry/RingedSpace/OpenImmersion.lean

tactic: have : ∀ (U : (Opens Y)ᵒᵖ), IsIso (f.c.app U) := by
  intro U
  have : U = op (opensFunctor f |>.obj ((Opens.map f.base).obj (unop U))) := by
    induction U using Opposite.rec' with | h U => ?_
    cases U
    dsimp only [Functor.op, Opens.map]
    congr
    exact (Set.image_preimage_eq _ ((TopCat.epi_iff_surjective _).mp h')).symm
  convert H.c_iso (Opens.map f.base |>.obj <| unop U)
state_before: C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
⊢ IsIso f
state_after: C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
this : ∀ (U : (Opens ↑↑Y)ᵒᵖ), IsIso (f.c.app U)
⊢ IsIso f

tactic: have : IsIso f.c := NatIso.isIso_of_isIso_app _
state_before: C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
this : ∀ (U : (Opens ↑↑Y)ᵒᵖ), IsIso (f.c.app U)
⊢ IsIso f
state_after: C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
this✝ : ∀ (U : (Opens ↑↑Y)ᵒᵖ), IsIso (f.c.app U)
this : IsIso f.c
⊢ IsIso f

tactic: apply (config := { allowSynthFailures := true }) isIso_of_components
state_before: C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
this✝ : ∀ (U : (Opens ↑↑Y)ᵒᵖ), IsIso (f.c.app U)
this : IsIso f.c
⊢ IsIso f
state_after: case inst
C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
this✝ : ∀ (U : (Opens ↑↑Y)ᵒᵖ), IsIso (f.c.app U)
this : IsIso f.c
⊢ IsIso f.base

tactic: let t : X ≃ₜ Y := (Homeomorph.ofEmbedding _ H.base_open.toEmbedding).trans
  { toFun := Subtype.val
    invFun := fun x =>
      ⟨x, by rw [Set.range_iff_surjective.mpr ((TopCat.epi_iff_surjective _).mp h')]; trivial⟩
    left_inv := fun ⟨_, _⟩ => rfl
    right_inv := fun _ => rfl }
state_before: case inst
C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
this✝ : ∀ (U : (Opens ↑↑Y)ᵒᵖ), IsIso (f.c.app U)
this : IsIso f.c
⊢ IsIso f.base
state_after: case inst
C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
this✝ : ∀ (U : (Opens ↑↑Y)ᵒᵖ), IsIso (f.c.app U)
this : IsIso f.c
t : ↑↑X ≃ₜ ↑↑Y :=
  (Homeomorph.ofEmbedding ⇑f.base ⋯).trans
    { toFun := Subtype.val, invFun := fun x => ⟨x, ⋯⟩, left_inv := ⋯, right_inv := ⋯, continuous_toFun := ⋯,
      continuous_invFun := ⋯ }
⊢ IsIso f.base

tactic: exact (TopCat.isoOfHomeo t).isIso_hom
state_before: case inst
C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
this✝ : ∀ (U : (Opens ↑↑Y)ᵒᵖ), IsIso (f.c.app U)
this : IsIso f.c
t : ↑↑X ≃ₜ ↑↑Y :=
  (Homeomorph.ofEmbedding ⇑f.base ⋯).trans
    { toFun := Subtype.val, invFun := fun x => ⟨x, ⋯⟩, left_inv := ⋯, right_inv := ⋯, continuous_toFun := ⋯,
      continuous_invFun := ⋯ }
⊢ IsIso f.base
state_after: no goals

tactic: intro U
state_before: C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
⊢ ∀ (U : (Opens ↑↑Y)ᵒᵖ), IsIso (f.c.app U)
state_after: C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
U : (Opens ↑↑Y)ᵒᵖ
⊢ IsIso (f.c.app U)

tactic: have : U = op (opensFunctor f |>.obj ((Opens.map f.base).obj (unop U))) := by
  induction U using Opposite.rec' with | h U => ?_
  cases U
  dsimp only [Functor.op, Opens.map]
  congr
  exact (Set.image_preimage_eq _ ((TopCat.epi_iff_surjective _).mp h')).symm
state_before: C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
U : (Opens ↑↑Y)ᵒᵖ
⊢ IsIso (f.c.app U)
state_after: C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
U : (Opens ↑↑Y)ᵒᵖ
this : U = { unop := (opensFunctor f).obj ((Opens.map f.base).obj U.unop) }
⊢ IsIso (f.c.app U)

tactic: convert H.c_iso (Opens.map f.base |>.obj <| unop U)
state_before: C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
U : (Opens ↑↑Y)ᵒᵖ
this : U = { unop := (opensFunctor f).obj ((Opens.map f.base).obj U.unop) }
⊢ IsIso (f.c.app U)
state_after: no goals

tactic: induction U using Opposite.rec' with | h U => ?_
state_before: C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
U : (Opens ↑↑Y)ᵒᵖ
⊢ U = { unop := (opensFunctor f).obj ((Opens.map f.base).obj U.unop) }
state_after: case h
C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
U : Opens ↑↑Y
⊢ { unop := U } = { unop := (opensFunctor f).obj ((Opens.map f.base).obj { unop := U }.unop) }

tactic: cases U
state_before: case h
C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
U : Opens ↑↑Y
⊢ { unop := U } = { unop := (opensFunctor f).obj ((Opens.map f.base).obj { unop := U }.unop) }
state_after: case h.mk
C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
carrier✝ : Set ↑↑Y
is_open'✝ : IsOpen carrier✝
⊢ { unop := { carrier := carrier✝, is_open' := is_open'✝ } } =
    {
      unop :=
        (opensFunctor f).obj ((Opens.map f.base).obj { unop := { carrier := carrier✝, is_open' := is_open'✝ } }.unop) }

tactic: dsimp only [Functor.op, Opens.map]
state_before: case h.mk
C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
carrier✝ : Set ↑↑Y
is_open'✝ : IsOpen carrier✝
⊢ { unop := { carrier := carrier✝, is_open' := is_open'✝ } } =
    {
      unop :=
        (opensFunctor f).obj ((Opens.map f.base).obj { unop := { carrier := carrier✝, is_open' := is_open'✝ } }.unop) }
state_after: case h.mk
C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
carrier✝ : Set ↑↑Y
is_open'✝ : IsOpen carrier✝
⊢ { unop := { carrier := carrier✝, is_open' := is_open'✝ } } =
    {
      unop :=
        (opensFunctor f).obj { carrier := ⇑f.base ⁻¹' ↑{ carrier := carrier✝, is_open' := is_open'✝ }, is_open' := ⋯ } }

tactic: congr
state_before: case h.mk
C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
carrier✝ : Set ↑↑Y
is_open'✝ : IsOpen carrier✝
⊢ { unop := { carrier := carrier✝, is_open' := is_open'✝ } } =
    {
      unop :=
        (opensFunctor f).obj { carrier := ⇑f.base ⁻¹' ↑{ carrier := carrier✝, is_open' := is_open'✝ }, is_open' := ⋯ } }
state_after: case h.mk.e_unop.e_carrier
C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
carrier✝ : Set ↑↑Y
is_open'✝ : IsOpen carrier✝
⊢ carrier✝ = ⇑f.base '' ↑{ carrier := ⇑f.base ⁻¹' ↑{ carrier := carrier✝, is_open' := is_open'✝ }, is_open' := ⋯ }

tactic: exact (Set.image_preimage_eq _ ((TopCat.epi_iff_surjective _).mp h')).symm
state_before: case h.mk.e_unop.e_carrier
C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
carrier✝ : Set ↑↑Y
is_open'✝ : IsOpen carrier✝
⊢ carrier✝ = ⇑f.base '' ↑{ carrier := ⇑f.base ⁻¹' ↑{ carrier := carrier✝, is_open' := is_open'✝ }, is_open' := ⋯ }
state_after: no goals

tactic: rw [Set.range_iff_surjective.mpr ((TopCat.epi_iff_surjective _).mp h')]
state_before: C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
this✝ : ∀ (U : (Opens ↑↑Y)ᵒᵖ), IsIso (f.c.app U)
this : IsIso f.c
x : ↑↑Y
⊢ x ∈ Set.range ⇑f.base
state_after: C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
this✝ : ∀ (U : (Opens ↑↑Y)ᵒᵖ), IsIso (f.c.app U)
this : IsIso f.c
x : ↑↑Y
⊢ x ∈ Set.univ

tactic: trivial
state_before: C : Type u
inst✝ : Category.{v, u} C
X Y : PresheafedSpace C
f : X ⟶ Y
H : IsOpenImmersion f
h' : Epi f.base
this✝ : ∀ (U : (Opens ↑↑Y)ᵒᵖ), IsIso (f.c.app U)
this : IsIso f.c
x : ↑↑Y
⊢ x ∈ Set.univ
state_after: no goals