Theorem: AlgebraicGeometry.LocallyRingedSpace.preimage_basicOpen
File: Mathlib/AlgebraicGeometry/LocallyRingedSpace.lean

tactic: ext x
state_before: X✝ : LocallyRingedSpace
X Y : LocallyRingedSpace
f : X ⟶ Y
U : Opens ↑(toTopCat Y)
s : ↑(Y.presheaf.obj U.op)
⊢ (Opens.map f.val.base).obj (RingedSpace.basicOpen (toRingedSpace Y) s) =
    RingedSpace.basicOpen (toRingedSpace X) (↑(f.val.c.app U.op) s)

tactic: constructor
state_before: case h.h
X✝ : LocallyRingedSpace
X Y : LocallyRingedSpace
f : X ⟶ Y
U : Opens ↑(toTopCat Y)
s : ↑(Y.presheaf.obj U.op)
x : ↑↑X.toPresheafedSpace
⊢ x ∈ ↑((Opens.map f.val.base).obj (RingedSpace.basicOpen (toRingedSpace Y) s)) ↔
    x ∈ ↑(RingedSpace.basicOpen (toRingedSpace X) (↑(f.val.c.app U.op) s))

tactic: rintro ⟨⟨y, hyU⟩, hy : IsUnit _, rfl : y = _⟩
state_before: case h.h.mp
X✝ : LocallyRingedSpace
X Y : LocallyRingedSpace
f : X ⟶ Y
U : Opens ↑(toTopCat Y)
s : ↑(Y.presheaf.obj U.op)
x : ↑↑X.toPresheafedSpace
⊢ x ∈ ↑((Opens.map f.val.base).obj (RingedSpace.basicOpen (toRingedSpace Y) s)) →
    x ∈ ↑(RingedSpace.basicOpen (toRingedSpace X) (↑(f.val.c.app U.op) s))

tactic: erw [RingedSpace.mem_basicOpen _ _ ⟨x, show x ∈ (Opens.map f.1.base).obj U from hyU⟩]
state_before: case h.h.mp.intro.mk.intro
X✝ : LocallyRingedSpace
X Y : LocallyRingedSpace
f : X ⟶ Y
U : Opens ↑(toTopCat Y)
s : ↑(Y.presheaf.obj U.op)
x : ↑↑X.toPresheafedSpace
hyU : (forget TopCat).map f.val.base x ∈ U
hy :
  IsUnit
    (↑(Presheaf.germ (toRingedSpace Y).toPresheafedSpace.presheaf
          { val := (forget TopCat).map f.val.base x, property := hyU })
      s)
⊢ x ∈ ↑(RingedSpace.basicOpen (toRingedSpace X) (↑(f.val.c.app U.op) s))

tactic: have eq1 := PresheafedSpace.stalkMap_germ_apply _ _
  ⟨x, show x ∈ (Opens.map f.1.base).obj U from hyU⟩
state_before: case h.h.mp.intro.mk.intro
X✝ : LocallyRingedSpace
X Y : LocallyRingedSpace
f : X ⟶ Y
U : Opens ↑(toTopCat Y)
s : ↑(Y.presheaf.obj U.op)
x : ↑↑X.toPresheafedSpace
hyU : (forget TopCat).map f.val.base x ∈ U
hy :
  IsUnit
    (↑(Presheaf.germ (toRingedSpace Y).toPresheafedSpace.presheaf
          { val := (forget TopCat).map f.val.base x, property := hyU })
      s)
⊢ IsUnit
    (↑(Presheaf.germ X.presheaf { val := x, property := (_ : x ∈ (Opens.map f.val.base).obj U) })
      (↑(f.val.c.app U.op) s))

tactic: dsimp at eq1
state_before: case h.h.mp.intro.mk.intro
X✝ : LocallyRingedSpace
X Y : LocallyRingedSpace
f : X ⟶ Y
U : Opens ↑(toTopCat Y)
s : ↑(Y.presheaf.obj U.op)
x : ↑↑X.toPresheafedSpace
hyU : (forget TopCat).map f.val.base x ∈ U
hy :
  IsUnit
    (↑(Presheaf.germ (toRingedSpace Y).toPresheafedSpace.presheaf
          { val := (forget TopCat).map f.val.base x, property := hyU })
      s)
eq1 :
  ∀ (x_1 : (forget CommRingCat).obj (Y.presheaf.obj U.op)),
    (forget CommRingCat).map
        (PresheafedSpace.stalkMap f.val ↑{ val := x, property := (_ : x ∈ (Opens.map f.val.base).obj U) })
        ((forget CommRingCat).map
          (Presheaf.germ Y.presheaf
            { val := (forget TopCat).map f.val.base ↑{ val := x, property := (_ : x ∈ (Opens.map f.val.base).obj U) },
              property :=
                (_ :
                  ↑{ val := x, property := (_ : x ∈ (Opens.map f.val.base).obj U) } ∈ (Opens.map f.val.base).obj U) })
          x_1) =
      (forget CommRingCat).map
        (Presheaf.germ X.presheaf { val := x, property := (_ : x ∈ (Opens.map f.val.base).obj U) })
        ((forget CommRingCat).map (f.val.c.app U.op) x_1)
⊢ IsUnit
    (↑(Presheaf.germ X.presheaf { val := x, property := (_ : x ∈ (Opens.map f.val.base).obj U) })
      (↑(f.val.c.app U.op) s))

tactic: rw [← eq1]
state_before: case h.h.mp.intro.mk.intro
X✝ : LocallyRingedSpace
X Y : LocallyRingedSpace
f : X ⟶ Y
U : Opens ↑(toTopCat Y)
s : ↑(Y.presheaf.obj U.op)
x : ↑↑X.toPresheafedSpace
hyU : (forget TopCat).map f.val.base x ∈ U
hy :
  IsUnit
    (↑(Presheaf.germ (toRingedSpace Y).toPresheafedSpace.presheaf
          { val := (forget TopCat).map f.val.base x, property := hyU })
      s)
eq1 :
  ∀ (x_1 : (forget CommRingCat).obj (Y.presheaf.obj U.op)),
    ↑(PresheafedSpace.stalkMap f.val x)
        (↑(Presheaf.germ Y.presheaf
              { val := (forget TopCat).map f.val.base x, property := (_ : (forget TopCat).map f.val.base x ∈ U) })
          x_1) =
      ↑(Presheaf.germ X.presheaf { val := x, property := (_ : (forget TopCat).map f.val.base x ∈ U) })
        (↑(f.val.c.app U.op) x_1)
⊢ IsUnit
    (↑(Presheaf.germ X.presheaf { val := x, property := (_ : x ∈ (Opens.map f.val.base).obj U) })
      (↑(f.val.c.app U.op) s))

tactic: exact (PresheafedSpace.stalkMap f.1 _).isUnit_map hy
state_before: case h.h.mp.intro.mk.intro
X✝ : LocallyRingedSpace
X Y : LocallyRingedSpace
f : X ⟶ Y
U : Opens ↑(toTopCat Y)
s : ↑(Y.presheaf.obj U.op)
x : ↑↑X.toPresheafedSpace
hyU : (forget TopCat).map f.val.base x ∈ U
hy :
  IsUnit
    (↑(Presheaf.germ (toRingedSpace Y).toPresheafedSpace.presheaf
          { val := (forget TopCat).map f.val.base x, property := hyU })
      s)
eq1 :
  ∀ (x_1 : (forget CommRingCat).obj (Y.presheaf.obj U.op)),
    ↑(PresheafedSpace.stalkMap f.val x)
        (↑(Presheaf.germ Y.presheaf
              { val := (forget TopCat).map f.val.base x, property := (_ : (forget TopCat).map f.val.base x ∈ U) })
          x_1) =
      ↑(Presheaf.germ X.presheaf { val := x, property := (_ : (forget TopCat).map f.val.base x ∈ U) })
        (↑(f.val.c.app U.op) x_1)
⊢ IsUnit
    (↑(PresheafedSpace.stalkMap f.val x)
      (↑(Presheaf.germ Y.presheaf
            { val := (forget TopCat).map f.val.base x, property := (_ : (forget TopCat).map f.val.base x ∈ U) })
        s))

tactic: rintro ⟨y, hy : IsUnit _, rfl⟩
state_before: case h.h.mpr
X✝ : LocallyRingedSpace
X Y : LocallyRingedSpace
f : X ⟶ Y
U : Opens ↑(toTopCat Y)
s : ↑(Y.presheaf.obj U.op)
x : ↑↑X.toPresheafedSpace
⊢ x ∈ ↑(RingedSpace.basicOpen (toRingedSpace X) (↑(f.val.c.app U.op) s)) →
    x ∈ ↑((Opens.map f.val.base).obj (RingedSpace.basicOpen (toRingedSpace Y) s))

tactic: erw [RingedSpace.mem_basicOpen _ _ ⟨f.1.base y.1, y.2⟩]
state_before: case h.h.mpr.intro.intro
X✝ : LocallyRingedSpace
X Y : LocallyRingedSpace
f : X ⟶ Y
U : Opens ↑(toTopCat Y)
s : ↑(Y.presheaf.obj U.op)
y : { x // x ∈ (Opens.map f.val.base).obj U }
hy : IsUnit (↑(Presheaf.germ (toRingedSpace X).toPresheafedSpace.presheaf y) (↑(f.val.c.app U.op) s))
⊢ ↑y ∈ ↑((Opens.map f.val.base).obj (RingedSpace.basicOpen (toRingedSpace Y) s))

tactic: have eq1 := PresheafedSpace.stalkMap_germ_apply _ _ y
state_before: case h.h.mpr.intro.intro
X✝ : LocallyRingedSpace
X Y : LocallyRingedSpace
f : X ⟶ Y
U : Opens ↑(toTopCat Y)
s : ↑(Y.presheaf.obj U.op)
y : { x // x ∈ (Opens.map f.val.base).obj U }
hy : IsUnit (↑(Presheaf.germ (toRingedSpace X).toPresheafedSpace.presheaf y) (↑(f.val.c.app U.op) s))
⊢ IsUnit
    (↑(Presheaf.germ Y.presheaf
          { val := (forget TopCat).map f.val.base ↑y, property := (_ : ↑y ∈ (Opens.map f.val.base).obj U) })
      s)

tactic: dsimp at eq1
state_before: case h.h.mpr.intro.intro
X✝ : LocallyRingedSpace
X Y : LocallyRingedSpace
f : X ⟶ Y
U : Opens ↑(toTopCat Y)
s : ↑(Y.presheaf.obj U.op)
y : { x // x ∈ (Opens.map f.val.base).obj U }
hy : IsUnit (↑(Presheaf.germ (toRingedSpace X).toPresheafedSpace.presheaf y) (↑(f.val.c.app U.op) s))
eq1 :
  ∀ (x : (forget CommRingCat).obj (Y.presheaf.obj U.op)),
    (forget CommRingCat).map (PresheafedSpace.stalkMap f.val ↑y)
        ((forget CommRingCat).map
          (Presheaf.germ Y.presheaf
            { val := (forget TopCat).map f.val.base ↑y, property := (_ : ↑y ∈ (Opens.map f.val.base).obj U) })
          x) =
      (forget CommRingCat).map (Presheaf.germ (toRingedSpace X).toPresheafedSpace.presheaf y)
        ((forget CommRingCat).map (f.val.c.app U.op) x)
⊢ IsUnit
    (↑(Presheaf.germ Y.presheaf
          { val := (forget TopCat).map f.val.base ↑y, property := (_ : ↑y ∈ (Opens.map f.val.base).obj U) })
      s)

tactic: rw [← eq1] at hy
state_before: case h.h.mpr.intro.intro
X✝ : LocallyRingedSpace
X Y : LocallyRingedSpace
f : X ⟶ Y
U : Opens ↑(toTopCat Y)
s : ↑(Y.presheaf.obj U.op)
y : { x // x ∈ (Opens.map f.val.base).obj U }
hy : IsUnit (↑(Presheaf.germ (toRingedSpace X).toPresheafedSpace.presheaf y) (↑(f.val.c.app U.op) s))
eq1 :
  ∀ (x : (forget CommRingCat).obj (Y.presheaf.obj U.op)),
    ↑(PresheafedSpace.stalkMap f.val ↑y)
        (↑(Presheaf.germ Y.presheaf
              { val := (forget TopCat).map f.val.base ↑y, property := (_ : ↑y ∈ (Opens.map f.val.base).obj U) })
          x) =
      ↑(Presheaf.germ (toRingedSpace X).toPresheafedSpace.presheaf y) (↑(f.val.c.app U.op) x)
⊢ IsUnit
    (↑(Presheaf.germ Y.presheaf
          { val := (forget TopCat).map f.val.base ↑y, property := (_ : ↑y ∈ (Opens.map f.val.base).obj U) })
      s)

tactic: exact (isUnit_map_iff (PresheafedSpace.stalkMap f.1 _) _).mp hy
state_before: case h.h.mpr.intro.intro
X✝ : LocallyRingedSpace
X Y : LocallyRingedSpace
f : X ⟶ Y
U : Opens ↑(toTopCat Y)
s : ↑(Y.presheaf.obj U.op)
y : { x // x ∈ (Opens.map f.val.base).obj U }
hy :
  IsUnit
    (↑(PresheafedSpace.stalkMap f.val ↑y)
      (↑(Presheaf.germ Y.presheaf
            { val := (forget TopCat).map f.val.base ↑y, property := (_ : ↑y ∈ (Opens.map f.val.base).obj U) })
        s))
eq1 :
  ∀ (x : (forget CommRingCat).obj (Y.presheaf.obj U.op)),
    ↑(PresheafedSpace.stalkMap f.val ↑y)
        (↑(Presheaf.germ Y.presheaf
              { val := (forget TopCat).map f.val.base ↑y, property := (_ : ↑y ∈ (Opens.map f.val.base).obj U) })
          x) =
      ↑(Presheaf.germ (toRingedSpace X).toPresheafedSpace.presheaf y) (↑(f.val.c.app U.op) x)
⊢ IsUnit
    (↑(Presheaf.germ Y.presheaf
          { val := (forget TopCat).map f.val.base ↑y, property := (_ : ↑y ∈ (Opens.map f.val.base).obj U) })
      s)