/--
Given `R`-module X and `S`-module Y and a map `X ⟶ (restrictScalars f).obj Y`, i.e `R`-linear map
`X ⟶ Y`, there is a map `(extend_scalars f).obj X ⟶ Y`, i.e `S`-linear map `S ⨂ X → Y` by
`s ⊗ x ↦ s • g x`.
-/
@[simps apply]
def HomEquiv.fromExtendScalars {X Y} (g : X ⟶ (restrictScalars f).obj Y) :
    (extendScalars f).obj X ⟶ Y := by
  letI m1 : Module R S := Module.compHom S f; letI m2 : Module R Y := Module.compHom Y f
  refine {toFun := fun z => TensorProduct.lift ?_ z, map_add' := ?_, map_smul' := ?_}
  · refine
    {toFun := fun s => HomEquiv.evalAt f s g, map_add' := fun (s₁ s₂ : S) => ?_,
      map_smul' := fun (r : R) (s : S) => ?_}
    · ext
      dsimp
      rw [← add_smul]
    · ext x
      apply mul_smul (f r) s (g x)
  · intros z₁ z₂
    change lift _ (z₁ + z₂) = lift _ z₁ + lift _ z₂
    rw [map_add]
  · intro s z
    change lift _ (s • z) = s • lift _ z
    induction' z using TensorProduct.induction_on with s' x x y ih1 ih2
    · rw [smul_zero, map_zero, smul_zero]
    · rw [LinearMap.coe_mk, ExtendScalars.smul_tmul]
      erw [lift.tmul, lift.tmul]
      set s' : S := s'
      change (s * s') • (g x) = s • s' • (g x)
      rw [mul_smul]
    · 

Proof state:
case refine_3.add
R✝ : Type u₁
S✝ : Type u₂
inst✝³ : CommRing R✝
inst✝² : CommRing S✝
f✝ : R✝ →+* S✝
R : Type u₁
S : Type u₂
inst✝¹ : CommRing R
inst✝ : CommRing S
f : R →+* S
X : ModuleCat R
Y : ModuleCat S
g : X ⟶ (restrictScalars f).obj Y
m1 : Module R S := Module.compHom S f
m2 : Module R ↑Y := Module.compHom (↑Y) f
s : S
x y : ↑((restrictScalars f).obj (mk S)) ⊗[R] ↑X
ih1 :
  (lift
        {
          toAddHom :=
            { toFun := fun s => evalAt f s g,
              map_add' :=
                (_ :
                  ∀ (s₁ s₂ : S),
                    (fun s => evalAt f s g) (s₁ + s₂) = (fun s => evalAt f s g) s₁ + (fun s => evalAt f s g) s₂) },
          map_smul' :=
            (_ :
              ∀ (r : R) (s : S),
                AddHom.toFun
                    { toFun := fun s => evalAt f s g,
                      map_add' :=
                        (_ :
                          ∀ (s₁ s₂ : S),
                            (fun s => evalAt f s g) (s₁ + s₂) =
                              (fun s => evalAt f s g) s₁ + (fun s => evalAt f s g) s₂) }
                    (r • s) =
                  (RingHom.id R) r •
                    AddHom.toFun
                      { toFun := fun s => evalAt f s g,
                        map_add' :=
                          (_ :
                            ∀ (s₁ s₂ : S),
                              (fun s => evalAt f s g) (s₁ + s₂) =
                                (fun s => evalAt f s g) s₁ + (fun s => evalAt f s g) s₂) }
                      s) })
      (s • x) =
    s •
      (lift
          {
            toAddHom :=
              { toFun := fun s => evalAt f s g,
                map_add' :=
                  (_ :
                    ∀ (s₁ s₂ : S),
                      (fun s => evalAt f s g) (s₁ + s₂) = (fun s => evalAt f s g) s₁ + (fun s => evalAt f s g) s₂) },
            map_smul' :=
              (_ :
                ∀ (r : R) (s : S),
                  AddHom.toFun
                      { toFun := fun s => evalAt f s g,
                        map_add' :=
                          (_ :
                            ∀ (s₁ s₂ : S),
                              (fun s => evalAt f s g) (s₁ + s₂) =
                                (fun s => evalAt f s g) s₁ + (fun s => evalAt f s g) s₂) }
                      (r • s) =
                    (RingHom.id R) r •
                      AddHom.toFun
                        { toFun := fun s => evalAt f s g,
                          map_add' :=
                            (_ :
                              ∀ (s₁ s₂ : S),
                                (fun s => evalAt f s g) (s₁ + s₂) =
                                  (fun s => evalAt f s g) s₁ + (fun s => evalAt f s g) s₂) }
                        s) })
        x
ih2 :
  (lift
        {
          toAddHom :=
            { toFun := fun s => evalAt f s g,
              map_add' :=
                (_ :
                  ∀ (s₁ s₂ : S),
                    (fun s => evalAt f s g) (s₁ + s₂) = (fun s => evalAt f s g) s₁ + (fun s => evalAt f s g) s₂) },
          map_smul' :=
            (_ :
              ∀ (r : R) (s : S),
                AddHom.toFun
                    { toFun := fun s => evalAt f s g,
                      map_add' :=
                        (_ :
                          ∀ (s₁ s₂ : S),
                            (fun s => evalAt f s g) (s₁ + s₂) =
                              (fun s => evalAt f s g) s₁ + (fun s => evalAt f s g) s₂) }
                    (r • s) =
                  (RingHom.id R) r •
                    AddHom.toFun
                      { toFun := fun s => evalAt f s g,
                        map_add' :=
                          (_ :
                            ∀ (s₁ s₂ : S),
                              (fun s => evalAt f s g) (s₁ + s₂) =
                                (fun s => evalAt f s g) s₁ + (fun s => evalAt f s g) s₂) }
                      s) })
      (s • y) =
    s •
      (lift
          {
            toAddHom :=
              { toFun := fun s => evalAt f s g,
                map_add' :=
                  (_ :
                    ∀ (s₁ s₂ : S),
                      (fun s => evalAt f s g) (s₁ + s₂) = (fun s => evalAt f s g) s₁ + (fun s => evalAt f s g) s₂) },
            map_smul' :=
              (_ :
                ∀ (r : R) (s : S),
                  AddHom.toFun
                      { toFun := fun s => evalAt f s g,
                        map_add' :=
                          (_ :
                            ∀ (s₁ s₂ : S),
                              (fun s => evalAt f s g) (s₁ + s₂) =
                                (fun s => evalAt f s g) s₁ + (fun s => evalAt f s g) s₂) }
                      (r • s) =
                    (RingHom.id R) r •
                      AddHom.toFun
                        { toFun := fun s => evalAt f s g,
                          map_add' :=
                            (_ :
                              ∀ (s₁ s₂ : S),
                                (fun s => evalAt f s g) (s₁ + s₂) =
                                  (fun s => evalAt f s g) s₁ + (fun s => evalAt f s g) s₂) }
                        s) })
        y
⊢ (lift
        {
          toAddHom :=
            { toFun := fun s => evalAt f s g,
              map_add' :=
                (_ :
                  ∀ (s₁ s₂ : S),
                    (fun s => evalAt f s g) (s₁ + s₂) = (fun s => evalAt f s g) s₁ + (fun s => evalAt f s g) s₂) },
          map_smul' :=
            (_ :
              ∀ (r : R) (s : S),
                AddHom.toFun
                    { toFun := fun s => evalAt f s g,
                      map_add' :=
                        (_ :
                          ∀ (s₁ s₂ : S),
                            (fun s => evalAt f s g) (s₁ + s₂) =
                              (fun s => evalAt f s g) s₁ + (fun s => evalAt f s g) s₂) }
                    (r • s) =
                  (RingHom.id R) r •
                    AddHom.toFun
                      { toFun := fun s => evalAt f s g,
                        map_add' :=
                          (_ :
                            ∀ (s₁ s₂ : S),
                              (fun s => evalAt f s g) (s₁ + s₂) =
                                (fun s => evalAt f s g) s₁ + (fun s => evalAt f s g) s₂) }
                      s) })
      (s • (x + y)) =
    s •
      (lift
          {
            toAddHom :=
              { toFun := fun s => evalAt f s g,
                map_add' :=
                  (_ :
                    ∀ (s₁ s₂ : S),
                      (fun s => evalAt f s g) (s₁ + s₂) = (fun s => evalAt f s g) s₁ + (fun s => evalAt f s g) s₂) },
            map_smul' :=
              (_ :
                ∀ (r : R) (s : S),
                  AddHom.toFun
                      { toFun := fun s => evalAt f s g,
                        map_add' :=
                          (_ :
                            ∀ (s₁ s₂ : S),
                              (fun s => evalAt f s g) (s₁ + s₂) =
                                (fun s => evalAt f s g) s₁ + (fun s => evalAt f s g) s₂) }
                      (r • s) =
                    (RingHom.id R) r •
                      AddHom.toFun
                        { toFun := fun s => evalAt f s g,
                          map_add' :=
                            (_ :
                              ∀ (s₁ s₂ : S),
                                (fun s => evalAt f s g) (s₁ + s₂) =
                                  (fun s => evalAt f s g) s₁ + (fun s => evalAt f s g) s₂) }
                        s) })
        (x + y)

Next tactic:
rw [smul_add, map_add, ih1, ih2, map_add, smul_add]