Theorem: AlgebraicGeometry.StructureSheaf.isLocalizedModule_toPushforwardStalkAlgHom_aux
File: Mathlib/AlgebraicGeometry/Spec.lean

tactic: obtain ⟨U, hp, s, e⟩ := TopCat.Presheaf.germ_exist
  (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf S).val) _ y
state_before: R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
⊢ ∃ x, x.2 • y = (toPushforwardStalkAlgHom R S p) x.1
state_after: case intro.intro.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
U : TopologicalSpace.Opens ↑(Spec.topObj R)
hp : p ∈ U
s : (forget CommRingCat).obj ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := U })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hp⟩) s = y
⊢ ∃ x, x.2 • y = (toPushforwardStalkAlgHom R S p) x.1

tactic: obtain ⟨_, ⟨r, rfl⟩, hpr : p ∈ PrimeSpectrum.basicOpen r, hrU : PrimeSpectrum.basicOpen r ≤ U⟩ :=
  PrimeSpectrum.isTopologicalBasis_basic_opens.exists_subset_of_mem_open (show p ∈ U from hp) U.2
state_before: case intro.intro.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
U : TopologicalSpace.Opens ↑(Spec.topObj R)
hp : p ∈ U
s : (forget CommRingCat).obj ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := U })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hp⟩) s = y
⊢ ∃ x, x.2 • y = (toPushforwardStalkAlgHom R S p) x.1
state_after: case intro.intro.intro.intro.intro.intro.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
U : TopologicalSpace.Opens ↑(Spec.topObj R)
hp : p ∈ U
s : (forget CommRingCat).obj ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := U })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hp⟩) s = y
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
hrU : PrimeSpectrum.basicOpen r ≤ U
⊢ ∃ x, x.2 • y = (toPushforwardStalkAlgHom R S p) x.1

tactic: replace e :=
  ((Spec.topMap (algebraMap R S) _* (structureSheaf S).1).germ_res_apply (homOfLE hrU)
        ⟨p, hpr⟩ _).trans e
state_before: case intro.intro.intro.intro.intro.intro.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
U : TopologicalSpace.Opens ↑(Spec.topObj R)
hp : p ∈ U
s : (forget CommRingCat).obj ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := U })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hp⟩) s = y
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
hrU : PrimeSpectrum.basicOpen r ≤ U
⊢ ∃ x, x.2 • y = (toPushforwardStalkAlgHom R S p) x.1
state_after: case intro.intro.intro.intro.intro.intro.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
U : TopologicalSpace.Opens ↑(Spec.topObj R)
hp : p ∈ U
s : (forget CommRingCat).obj ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := U })
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
hrU : PrimeSpectrum.basicOpen r ≤ U
e :
  ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩)
      (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE hrU).op) s) =
    y
⊢ ∃ x, x.2 • y = (toPushforwardStalkAlgHom R S p) x.1

tactic: set s' := (Spec.topMap (algebraMap R S) _* (structureSheaf S).1).map (homOfLE hrU).op s with h
state_before: case intro.intro.intro.intro.intro.intro.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
U : TopologicalSpace.Opens ↑(Spec.topObj R)
hp : p ∈ U
s : (forget CommRingCat).obj ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := U })
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
hrU : PrimeSpectrum.basicOpen r ≤ U
e :
  ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩)
      (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE hrU).op) s) =
    y
⊢ ∃ x, x.2 • y = (toPushforwardStalkAlgHom R S p) x.1
state_after: case intro.intro.intro.intro.intro.intro.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
U : TopologicalSpace.Opens ↑(Spec.topObj R)
hp : p ∈ U
s : (forget CommRingCat).obj ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := U })
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
hrU : PrimeSpectrum.basicOpen r ≤ U
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r }) :=
  ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE hrU).op) s
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
h : s' = ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE hrU).op) s
⊢ ∃ x, x.2 • y = (toPushforwardStalkAlgHom R S p) x.1

tactic: replace e : ((Spec.topMap (algebraMap R S) _* (structureSheaf S).val).germ ⟨p, hpr⟩) s' = y := by
  rw [h]; exact e
state_before: case intro.intro.intro.intro.intro.intro.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
U : TopologicalSpace.Opens ↑(Spec.topObj R)
hp : p ∈ U
s : (forget CommRingCat).obj ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := U })
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
hrU : PrimeSpectrum.basicOpen r ≤ U
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r }) :=
  ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE hrU).op) s
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
h : s' = ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE hrU).op) s
⊢ ∃ x, x.2 • y = (toPushforwardStalkAlgHom R S p) x.1
state_after: case intro.intro.intro.intro.intro.intro.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
U : TopologicalSpace.Opens ↑(Spec.topObj R)
hp : p ∈ U
s : (forget CommRingCat).obj ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := U })
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
hrU : PrimeSpectrum.basicOpen r ≤ U
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r }) :=
  ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE hrU).op) s
h : s' = ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE hrU).op) s
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
⊢ ∃ x, x.2 • y = (toPushforwardStalkAlgHom R S p) x.1

tactic: clear_value s'
state_before: case intro.intro.intro.intro.intro.intro.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
U : TopologicalSpace.Opens ↑(Spec.topObj R)
hp : p ∈ U
s : (forget CommRingCat).obj ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := U })
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
hrU : PrimeSpectrum.basicOpen r ≤ U
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r }) :=
  ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE hrU).op) s
h : s' = ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE hrU).op) s
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
⊢ ∃ x, x.2 • y = (toPushforwardStalkAlgHom R S p) x.1
state_after: case intro.intro.intro.intro.intro.intro.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
U : TopologicalSpace.Opens ↑(Spec.topObj R)
hp : p ∈ U
s : (forget CommRingCat).obj ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := U })
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
hrU : PrimeSpectrum.basicOpen r ≤ U
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
h : s' = ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE hrU).op) s
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
⊢ ∃ x, x.2 • y = (toPushforwardStalkAlgHom R S p) x.1

tactic: clear! U
state_before: case intro.intro.intro.intro.intro.intro.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
U : TopologicalSpace.Opens ↑(Spec.topObj R)
hp : p ∈ U
s : (forget CommRingCat).obj ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := U })
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
hrU : PrimeSpectrum.basicOpen r ≤ U
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
h : s' = ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE hrU).op) s
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
⊢ ∃ x, x.2 • y = (toPushforwardStalkAlgHom R S p) x.1
state_after: case intro.intro.intro.intro.intro.intro.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
⊢ ∃ x, x.2 • y = (toPushforwardStalkAlgHom R S p) x.1

tactic: obtain ⟨⟨s, ⟨_, n, rfl⟩⟩, hsn⟩ :=
  @IsLocalization.surj _ _ _ _ _ _
    (StructureSheaf.IsLocalization.to_basicOpen S <| algebraMap R S r) s'
state_before: case intro.intro.intro.intro.intro.intro.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
⊢ ∃ x, x.2 • y = (toPushforwardStalkAlgHom R S p) x.1
state_after: case intro.intro.intro.intro.intro.intro.intro.intro.mk.mk.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
s : ↑S
n : ℕ
hsn :
  s' *
      (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
        ↑(s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).2 =
    (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
      (s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).1
⊢ ∃ x, x.2 • y = (toPushforwardStalkAlgHom R S p) x.1

tactic: refine ⟨⟨s, ⟨r, hpr⟩ ^ n⟩, ?_⟩
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.mk.mk.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
s : ↑S
n : ℕ
hsn :
  s' *
      (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
        ↑(s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).2 =
    (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
      (s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).1
⊢ ∃ x, x.2 • y = (toPushforwardStalkAlgHom R S p) x.1
state_after: case intro.intro.intro.intro.intro.intro.intro.intro.mk.mk.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
s : ↑S
n : ℕ
hsn :
  s' *
      (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
        ↑(s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).2 =
    (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
      (s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).1
⊢ (s, ⟨r, hpr⟩ ^ n).2 • y = (toPushforwardStalkAlgHom R S p) (s, ⟨r, hpr⟩ ^ n).1

tactic: rw [Submonoid.smul_def, Algebra.smul_def, algebraMap_pushforward_stalk, toPushforwardStalk,
  comp_apply, comp_apply]
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.mk.mk.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
s : ↑S
n : ℕ
hsn :
  s' *
      (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
        ↑(s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).2 =
    (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
      (s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).1
⊢ (s, ⟨r, hpr⟩ ^ n).2 • y = (toPushforwardStalkAlgHom R S p) (s, ⟨r, hpr⟩ ^ n).1
state_after: case intro.intro.intro.intro.intro.intro.intro.intro.mk.mk.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
s : ↑S
n : ℕ
hsn :
  s' *
      (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
        ↑(s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).2 =
    (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
      (s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).1
⊢ ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, trivial⟩)
        ((toOpen ↑S ⊤) ((algebraMap ↑R ↑S) ↑(s, ⟨r, hpr⟩ ^ n).2)) *
      y =
    (toPushforwardStalkAlgHom R S p) (s, ⟨r, hpr⟩ ^ n).1

tactic: iterate 2
  erw [← (Spec.topMap (algebraMap R S) _* (structureSheaf S).1).germ_res_apply (homOfLE le_top)
    ⟨p, hpr⟩]
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.mk.mk.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
s : ↑S
n : ℕ
hsn :
  s' *
      (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
        ↑(s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).2 =
    (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
      (s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).1
⊢ ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, trivial⟩)
        ((toOpen ↑S ⊤) ((algebraMap ↑R ↑S) ↑(s, ⟨r, hpr⟩ ^ n).2)) *
      y =
    (toPushforwardStalkAlgHom R S p) (s, ⟨r, hpr⟩ ^ n).1
state_after: case intro.intro.intro.intro.intro.intro.intro.intro.mk.mk.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
s : ↑S
n : ℕ
hsn :
  s' *
      (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
        ↑(s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).2 =
    (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
      (s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).1
⊢ ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩)
        (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
          ((toOpen ↑S ⊤) ((algebraMap ↑R ↑S) ↑(s, ⟨r, hpr⟩ ^ n).2))) *
      y =
    ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩)
      (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
        ((toOpen ↑S ⊤) (s, ⟨r, hpr⟩ ^ n).1))

tactic: rw [← e]
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.mk.mk.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
s : ↑S
n : ℕ
hsn :
  s' *
      (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
        ↑(s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).2 =
    (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
      (s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).1
⊢ ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩)
        (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
          ((toOpen ↑S ⊤) ((algebraMap ↑R ↑S) ↑(s, ⟨r, hpr⟩ ^ n).2))) *
      y =
    ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩)
      (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
        ((toOpen ↑S ⊤) (s, ⟨r, hpr⟩ ^ n).1))
state_after: case intro.intro.intro.intro.intro.intro.intro.intro.mk.mk.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
s : ↑S
n : ℕ
hsn :
  s' *
      (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
        ↑(s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).2 =
    (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
      (s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).1
⊢ ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩)
        (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
          ((toOpen ↑S ⊤) ((algebraMap ↑R ↑S) ↑(s, ⟨r, hpr⟩ ^ n).2))) *
      ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' =
    ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩)
      (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
        ((toOpen ↑S ⊤) (s, ⟨r, hpr⟩ ^ n).1))

tactic: let f := TopCat.Presheaf.germ (Spec.topMap (algebraMap R S) _* (structureSheaf S).val) ⟨p, hpr⟩
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.mk.mk.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
s : ↑S
n : ℕ
hsn :
  s' *
      (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
        ↑(s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).2 =
    (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
      (s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).1
⊢ ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩)
        (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
          ((toOpen ↑S ⊤) ((algebraMap ↑R ↑S) ↑(s, ⟨r, hpr⟩ ^ n).2))) *
      ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' =
    ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩)
      (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
        ((toOpen ↑S ⊤) (s, ⟨r, hpr⟩ ^ n).1))
state_after: case intro.intro.intro.intro.intro.intro.intro.intro.mk.mk.intro
R S : CommRingCat
f✝ : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
s : ↑S
n : ℕ
hsn :
  s' *
      (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
        ↑(s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).2 =
    (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
      (s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).1
f : (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r } ⟶
  (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk ↑⟨p, hpr⟩ :=
  (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩
⊢ ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩)
        (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
          ((toOpen ↑S ⊤) ((algebraMap ↑R ↑S) ↑(s, ⟨r, hpr⟩ ^ n).2))) *
      ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' =
    ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩)
      (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
        ((toOpen ↑S ⊤) (s, ⟨r, hpr⟩ ^ n).1))

tactic: change f _ * f _ = f _
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.mk.mk.intro
R S : CommRingCat
f✝ : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
s : ↑S
n : ℕ
hsn :
  s' *
      (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
        ↑(s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).2 =
    (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
      (s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).1
f : (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r } ⟶
  (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk ↑⟨p, hpr⟩ :=
  (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩
⊢ ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩)
        (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
          ((toOpen ↑S ⊤) ((algebraMap ↑R ↑S) ↑(s, ⟨r, hpr⟩ ^ n).2))) *
      ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' =
    ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩)
      (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
        ((toOpen ↑S ⊤) (s, ⟨r, hpr⟩ ^ n).1))
state_after: case intro.intro.intro.intro.intro.intro.intro.intro.mk.mk.intro
R S : CommRingCat
f✝ : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
s : ↑S
n : ℕ
hsn :
  s' *
      (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
        ↑(s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).2 =
    (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
      (s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).1
f : (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r } ⟶
  (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk ↑⟨p, hpr⟩ :=
  (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩
⊢ f
        (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
          ((toOpen ↑S ⊤) ((algebraMap ↑R ↑S) ↑(s, ⟨r, hpr⟩ ^ n).2))) *
      f s' =
    f
      (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
        ((toOpen ↑S ⊤) (s, ⟨r, hpr⟩ ^ n).1))

tactic: rw [← map_mul, mul_comm]
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.mk.mk.intro
R S : CommRingCat
f✝ : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
s : ↑S
n : ℕ
hsn :
  s' *
      (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
        ↑(s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).2 =
    (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
      (s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).1
f : (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r } ⟶
  (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk ↑⟨p, hpr⟩ :=
  (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩
⊢ f
        (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
          ((toOpen ↑S ⊤) ((algebraMap ↑R ↑S) ↑(s, ⟨r, hpr⟩ ^ n).2))) *
      f s' =
    f
      (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
        ((toOpen ↑S ⊤) (s, ⟨r, hpr⟩ ^ n).1))
state_after: case intro.intro.intro.intro.intro.intro.intro.intro.mk.mk.intro
R S : CommRingCat
f✝ : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
s : ↑S
n : ℕ
hsn :
  s' *
      (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
        ↑(s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).2 =
    (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
      (s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).1
f : (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r } ⟶
  (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk ↑⟨p, hpr⟩ :=
  (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩
⊢ f
      (s' *
        ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
          ((toOpen ↑S ⊤) ((algebraMap ↑R ↑S) ↑(s, ⟨r, hpr⟩ ^ n).2))) =
    f
      (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
        ((toOpen ↑S ⊤) (s, ⟨r, hpr⟩ ^ n).1))

tactic: dsimp only [Subtype.coe_mk] at hsn
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.mk.mk.intro
R S : CommRingCat
f✝ : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
s : ↑S
n : ℕ
hsn :
  s' *
      (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
        ↑(s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).2 =
    (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
      (s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).1
f : (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r } ⟶
  (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk ↑⟨p, hpr⟩ :=
  (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩
⊢ f
      (s' *
        ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
          ((toOpen ↑S ⊤) ((algebraMap ↑R ↑S) ↑(s, ⟨r, hpr⟩ ^ n).2))) =
    f
      (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
        ((toOpen ↑S ⊤) (s, ⟨r, hpr⟩ ^ n).1))
state_after: case intro.intro.intro.intro.intro.intro.intro.intro.mk.mk.intro
R S : CommRingCat
f✝ : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
s : ↑S
n : ℕ
hsn :
  s' *
      (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
        ((algebraMap ↑R ↑S) r ^ n) =
    (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) })) s
f : (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r } ⟶
  (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk ↑⟨p, hpr⟩ :=
  (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩
⊢ f
      (s' *
        ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
          ((toOpen ↑S ⊤) ((algebraMap ↑R ↑S) ↑(s, ⟨r, hpr⟩ ^ n).2))) =
    f
      (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
        ((toOpen ↑S ⊤) (s, ⟨r, hpr⟩ ^ n).1))

tactic: rw [← map_pow (algebraMap R S)] at hsn
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.mk.mk.intro
R S : CommRingCat
f✝ : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
s : ↑S
n : ℕ
hsn :
  s' *
      (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
        ((algebraMap ↑R ↑S) r ^ n) =
    (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) })) s
f : (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r } ⟶
  (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk ↑⟨p, hpr⟩ :=
  (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩
⊢ f
      (s' *
        ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
          ((toOpen ↑S ⊤) ((algebraMap ↑R ↑S) ↑(s, ⟨r, hpr⟩ ^ n).2))) =
    f
      (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
        ((toOpen ↑S ⊤) (s, ⟨r, hpr⟩ ^ n).1))
state_after: case intro.intro.intro.intro.intro.intro.intro.intro.mk.mk.intro
R S : CommRingCat
f✝ : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
s : ↑S
n : ℕ
hsn :
  s' *
      (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
        ((algebraMap ↑R ↑S) (r ^ n)) =
    (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) })) s
f : (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r } ⟶
  (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk ↑⟨p, hpr⟩ :=
  (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩
⊢ f
      (s' *
        ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
          ((toOpen ↑S ⊤) ((algebraMap ↑R ↑S) ↑(s, ⟨r, hpr⟩ ^ n).2))) =
    f
      (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
        ((toOpen ↑S ⊤) (s, ⟨r, hpr⟩ ^ n).1))

tactic: congr 1
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.mk.mk.intro
R S : CommRingCat
f✝ : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
s : ↑S
n : ℕ
hsn :
  s' *
      (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
        ((algebraMap ↑R ↑S) (r ^ n)) =
    (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) })) s
f : (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r } ⟶
  (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk ↑⟨p, hpr⟩ :=
  (Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩
⊢ f
      (s' *
        ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
          ((toOpen ↑S ⊤) ((algebraMap ↑R ↑S) ↑(s, ⟨r, hpr⟩ ^ n).2))) =
    f
      (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
        ((toOpen ↑S ⊤) (s, ⟨r, hpr⟩ ^ n).1))
state_after: no goals

tactic: rw [h]
state_before: R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
U : TopologicalSpace.Opens ↑(Spec.topObj R)
hp : p ∈ U
s : (forget CommRingCat).obj ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := U })
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
hrU : PrimeSpectrum.basicOpen r ≤ U
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r }) :=
  ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE hrU).op) s
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
h : s' = ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE hrU).op) s
⊢ ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
state_after: R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
U : TopologicalSpace.Opens ↑(Spec.topObj R)
hp : p ∈ U
s : (forget CommRingCat).obj ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := U })
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
hrU : PrimeSpectrum.basicOpen r ≤ U
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r }) :=
  ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE hrU).op) s
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
h : s' = ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE hrU).op) s
⊢ ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩)
      (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE hrU).op) s) =
    y

tactic: exact e
state_before: R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
U : TopologicalSpace.Opens ↑(Spec.topObj R)
hp : p ∈ U
s : (forget CommRingCat).obj ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := U })
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
hrU : PrimeSpectrum.basicOpen r ≤ U
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r }) :=
  ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE hrU).op) s
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
h : s' = ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE hrU).op) s
⊢ ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩)
      (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE hrU).op) s) =
    y
state_after: no goals

tactic: erw [← (Spec.topMap (algebraMap R S) _* (structureSheaf S).1).germ_res_apply (homOfLE le_top)
  ⟨p, hpr⟩]
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.mk.mk.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
s : ↑S
n : ℕ
hsn :
  s' *
      (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
        ↑(s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).2 =
    (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
      (s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).1
⊢ ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩)
        (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
          ((toOpen ↑S ⊤) ((algebraMap ↑R ↑S) ↑(s, ⟨r, hpr⟩ ^ n).2))) *
      y =
    (toPushforwardStalkAlgHom R S p) (s, ⟨r, hpr⟩ ^ n).1
state_after: case intro.intro.intro.intro.intro.intro.intro.intro.mk.mk.intro
R S : CommRingCat
f : R ⟶ S
p : PrimeSpectrum ↑R
inst✝ : Algebra ↑R ↑S
y : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).stalk p)
r : ↑R
hpr : p ∈ PrimeSpectrum.basicOpen r
s' : ↑((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).obj { unop := PrimeSpectrum.basicOpen r })
e : ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩) s' = y
s : ↑S
n : ℕ
hsn :
  s' *
      (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
        ↑(s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).2 =
    (algebraMap ↑S ↑((structureSheaf ↑S).val.obj { unop := PrimeSpectrum.basicOpen ((algebraMap ↑R ↑S) r) }))
      (s, ⟨(fun x => (algebraMap ↑R ↑S) r ^ x) n, ⋯⟩).1
⊢ ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩)
        (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
          ((toOpen ↑S ⊤) ((algebraMap ↑R ↑S) ↑(s, ⟨r, hpr⟩ ^ n).2))) *
      y =
    ((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).germ ⟨p, hpr⟩)
      (((Spec.topMap (algebraMap ↑R ↑S) _* (structureSheaf ↑S).val).map (homOfLE ⋯).op)
        ((toOpen ↑S ⊤) (s, ⟨r, hpr⟩ ^ n).1))