-- Lean 4 proof step from Mathlib.AlgebraicGeometry.StructureSheaf (goal)
Goal:
R M A : Type u
inst : CommRing R
inst_1 : AddCommGroup M
inst_2 : Module R M
inst_3 : CommRing A
inst_4 : Algebra R A
U : Opens (↑(PrimeSpectrum.Top R) : Type u)
x : (↑(PrimeSpectrum.Top R) : Type u)
hxU : x ∈ U
r : R
m :
  Functor.obj
    (ObjectProperty.FullSubcategory.obj (P :=
      CategoryTheory.Presheaf.IsSheaf (Opens.grothendieckTopology (↑(PrimeSpectrum.Top R) : Type u)))
      (structureSheafInType R M))
    (op U)
⊢ ZeroHom.toFun
      (↑(AddCommGrpCat.Hom.hom (Presheaf.germ (PresheafOfModules.presheaf (moduleStructurePresheaf R M)) U x hxU)) :
        ZeroHom (↑((moduleStructurePresheaf R M).presheaf.obj (op U)) : Type u)
          (↑(Presheaf.stalk (moduleStructurePresheaf R M).presheaf x) : Type u))
      (r • m) =
    HSMul.hSMul (α := (↑(Presheaf.stalk (structurePresheafInCommRingCat R) x) : Type u)) (β :=
      (↑(Presheaf.stalk (PresheafOfModules.presheaf (moduleStructurePresheaf R M)) x) : Type u))
      ((ConcreteCategory.hom (FC := fun (R S : CommRingCat.{u}) ↦ (↑R : Type u) →+* (↑S : Type u)) (CC :=
              CommRingCat.carrier) (toStalk R x) :
            (a : (↑(CommRingCat.of R) : Type u)) → (↑((structurePresheafInCommRingCat R).stalk x) : Type u))
          ((RingHom.id R : (a : R) → R) r : R) :
        (↑(Presheaf.stalk (structurePresheafInCommRingCat R) x) : Type u))
      ((ConcreteCategory.hom (FC := fun (x1 x2 : AddCommGrpCat.{u}) ↦ (↑x1 : Type u) →+ (↑x2 : Type u)) (CC :=
              AddCommGrpCat.carrier) (X :=
              Functor.obj (PresheafOfModules.presheaf (moduleStructurePresheaf R M)) (op U)) (Y :=
              Presheaf.stalk (PresheafOfModules.presheaf (moduleStructurePresheaf R M)) x)
              (Presheaf.germ (PresheafOfModules.presheaf (moduleStructurePresheaf R M)) U x hxU) :
            (a : (↑((moduleStructurePresheaf R M).presheaf.obj (op U)) : Type u)) →
              (↑(Presheaf.stalk (moduleStructurePresheaf R M).presheaf x) : Type u))
          m :
        (↑(Presheaf.stalk (PresheafOfModules.presheaf (moduleStructurePresheaf R M)) x) : Type u))
have rw : ZeroHom.toFun
    (↑(AddCommGrpCat.Hom.hom (Presheaf.germ (PresheafOfModules.presheaf (moduleStructurePresheaf R M)) U x hxU)) :
      ZeroHom (↑((moduleStructurePresheaf R M).presheaf.obj (op U)) : Type u)
        (↑(Presheaf.stalk (moduleStructurePresheaf R M).presheaf x) : Type u))
    (r • m) =
  HSMul.hSMul (α := (↑(Presheaf.stalk (structurePresheafInCommRingCat R) x) : Type u)) (β :=
    (↑(Presheaf.stalk (PresheafOfModules.presheaf (moduleStructurePresheaf R M)) x) : Type u))
    (((ConcreteCategory.hom (FC := fun (R S : CommRingCat.{u}) ↦ (↑R : Type u) →+* (↑S : Type u)) (CC :=
              CommRingCat.carrier) (X :=
              CommRingCat.of
                (Functor.obj
                  (ObjectProperty.FullSubcategory.obj (P :=
                    CategoryTheory.Presheaf.IsSheaf (Opens.grothendieckTopology (↑(PrimeSpectrum.Top R) : Type u)))
                    (structureSheafInType R R))
                  (op U)))
              (Y := Presheaf.stalk (structurePresheafInCommRingCat R) x)
              (Presheaf.germ (structurePresheafInCommRingCat R) U x hxU) :
            (↑(CommRingCat.of
                    (Functor.obj
                      (ObjectProperty.FullSubcategory.obj (P :=
                        CategoryTheory.Presheaf.IsSheaf (Opens.grothendieckTopology (↑(PrimeSpectrum.Top R) : Type u)))
                        (structureSheafInType R R))
                      (op U))) :
                Type u) →+*
              (↑(Presheaf.stalk (structurePresheafInCommRingCat R) x) : Type u)) :
          (a : (structureSheafInType R R).obj.obj (op U)) → (↑((structurePresheafInCommRingCat R).stalk x) : Type u))
        ((algebraMap R
                (Functor.obj
                  (ObjectProperty.FullSubcategory.obj (P :=
                    CategoryTheory.Presheaf.IsSheaf (Opens.grothendieckTopology (↑(PrimeSpectrum.Top R) : Type u)))
                    (structureSheafInType R R))
                  (op U)) :
              (a : R) → (structureSheafInType R R).obj.obj (op U))
            ((RingHom.id R : (a : R) → R) r) :
          Functor.obj
            (ObjectProperty.FullSubcategory.obj (P :=
              CategoryTheory.Presheaf.IsSheaf (Opens.grothendieckTopology (↑(PrimeSpectrum.Top R) : Type u)))
              (structureSheafInType R R))
            (op U)) :
      (↑(Presheaf.stalk (structurePresheafInCommRingCat R) x) : Type u))
    ((ConcreteCategory.hom (FC := fun (x1 x2 : AddCommGrpCat.{u}) ↦ (↑x1 : Type u) →+ (↑x2 : Type u)) (CC :=
            AddCommGrpCat.carrier) (X := Functor.obj (PresheafOfModules.presheaf (moduleStructurePresheaf R M)) (op U))
            (Y := Presheaf.stalk (PresheafOfModules.presheaf (moduleStructurePresheaf R M)) x)
            (Presheaf.germ (PresheafOfModules.presheaf (moduleStructurePresheaf R M)) U x hxU) :
          (a : (↑((moduleStructurePresheaf R M).presheaf.obj (op U)) : Type u)) →
            (↑(Presheaf.stalk (moduleStructurePresheaf R M).presheaf x) : Type u))
        m :
      (↑(Presheaf.stalk (PresheafOfModules.presheaf (moduleStructurePresheaf R M)) x) : Type u))
Tactic: rw [← algebraMap_germ_apply U x hxU]