/--
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₂
    

Proof state:
case refine_2
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
z₁ z₂ : ↑((extendScalars f).obj X)
⊢ (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) })
      (z₁ + z₂) =
    (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) })
        z₁ +
      (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) })
        z₂

Next tactic:
rw [map_add]