/-- For any `S`-module Y, there is a natural `R`-linear map from `S ⨂ Y` to `Y` by
`s ⊗ y ↦ s • y`
-/
@[simps apply]
def Counit.map {Y} : (restrictScalars f ⋙ extendScalars f).obj Y ⟶ Y := by
  letI m1 : Module R S := Module.compHom S f
  letI m2 : Module R Y := Module.compHom Y f
  refine'
    {toFun := TensorProduct.lift
      {toFun := fun s : S => {toFun := fun y : Y => s • y, map_add' := smul_add _, map_smul' := _},
        map_add' := _, map_smul' := _}, map_add' := _, map_smul' := _}
  · intros r y
    dsimp
    change s • f r • y = f r • s • y
    rw [← mul_smul, mul_comm, mul_smul]
  · intros s₁ s₂
    ext y
    change (s₁ + s₂) • y = s₁ • y + s₂ • y
    rw [add_smul]
  · 

Proof state:
case refine'_3
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
Y : ModuleCat S
m1 : Module R S := Module.compHom S f
m2 : Module R ↑Y := Module.compHom (↑Y) f
⊢ ∀ (r : R) (x : S),
    AddHom.toFun
        {
          toFun := fun s =>
            {
              toAddHom :=
                { toFun := fun y => s • y, map_add' := (_ : ∀ (b₁ b₂ : ↑Y), s • (b₁ + b₂) = s • b₁ + s • b₂) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (y : ↑Y),
                    AddHom.toFun
                        { toFun := fun y => s • y, map_add' := (_ : ∀ (b₁ b₂ : ↑Y), s • (b₁ + b₂) = s • b₁ + s • b₂) }
                        (r • y) =
                      (RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun y => s • y, map_add' := (_ : ∀ (b₁ b₂ : ↑Y), s • (b₁ + b₂) = s • b₁ + s • b₂) }
                          y) },
          map_add' :=
            (_ :
              ∀ (s₁ s₂ : S),
                (fun s =>
                      {
                        toAddHom :=
                          { toFun := fun y => s • y,
                            map_add' := (_ : ∀ (b₁ b₂ : ↑Y), s • (b₁ + b₂) = s • b₁ + s • b₂) },
                        map_smul' :=
                          (_ :
                            ∀ (r : R) (y : ↑Y),
                              AddHom.toFun
                                  { toFun := fun y => s • y,
                                    map_add' := (_ : ∀ (b₁ b₂ : ↑Y), s • (b₁ + b₂) = s • b₁ + s • b₂) }
                                  (r • y) =
                                (RingHom.id R) r •
                                  AddHom.toFun
                                    { toFun := fun y => s • y,
                                      map_add' := (_ : ∀ (b₁ b₂ : ↑Y), s • (b₁ + b₂) = s • b₁ + s • b₂) }
                                    y) })
                    (s₁ + s₂) =
                  (fun s =>
                        {
                          toAddHom :=
                            { toFun := fun y => s • y,
                              map_add' := (_ : ∀ (b₁ b₂ : ↑Y), s • (b₁ + b₂) = s • b₁ + s • b₂) },
                          map_smul' :=
                            (_ :
                              ∀ (r : R) (y : ↑Y),
                                AddHom.toFun
                                    { toFun := fun y => s • y,
                                      map_add' := (_ : ∀ (b₁ b₂ : ↑Y), s • (b₁ + b₂) = s • b₁ + s • b₂) }
                                    (r • y) =
                                  (RingHom.id R) r •
                                    AddHom.toFun
                                      { toFun := fun y => s • y,
                                        map_add' := (_ : ∀ (b₁ b₂ : ↑Y), s • (b₁ + b₂) = s • b₁ + s • b₂) }
                                      y) })
                      s₁ +
                    (fun s =>
                        {
                          toAddHom :=
                            { toFun := fun y => s • y,
                              map_add' := (_ : ∀ (b₁ b₂ : ↑Y), s • (b₁ + b₂) = s • b₁ + s • b₂) },
                          map_smul' :=
                            (_ :
                              ∀ (r : R) (y : ↑Y),
                                AddHom.toFun
                                    { toFun := fun y => s • y,
                                      map_add' := (_ : ∀ (b₁ b₂ : ↑Y), s • (b₁ + b₂) = s • b₁ + s • b₂) }
                                    (r • y) =
                                  (RingHom.id R) r •
                                    AddHom.toFun
                                      { toFun := fun y => s • y,
                                        map_add' := (_ : ∀ (b₁ b₂ : ↑Y), s • (b₁ + b₂) = s • b₁ + s • b₂) }
                                      y) })
                      s₂) }
        (r • x) =
      (RingHom.id R) r •
        AddHom.toFun
          {
            toFun := fun s =>
              {
                toAddHom :=
                  { toFun := fun y => s • y, map_add' := (_ : ∀ (b₁ b₂ : ↑Y), s • (b₁ + b₂) = s • b₁ + s • b₂) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (y : ↑Y),
                      AddHom.toFun
                          { toFun := fun y => s • y, map_add' := (_ : ∀ (b₁ b₂ : ↑Y), s • (b₁ + b₂) = s • b₁ + s • b₂) }
                          (r • y) =
                        (RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun y => s • y,
                              map_add' := (_ : ∀ (b₁ b₂ : ↑Y), s • (b₁ + b₂) = s • b₁ + s • b₂) }
                            y) },
            map_add' :=
              (_ :
                ∀ (s₁ s₂ : S),
                  (fun s =>
                        {
                          toAddHom :=
                            { toFun := fun y => s • y,
                              map_add' := (_ : ∀ (b₁ b₂ : ↑Y), s • (b₁ + b₂) = s • b₁ + s • b₂) },
                          map_smul' :=
                            (_ :
                              ∀ (r : R) (y : ↑Y),
                                AddHom.toFun
                                    { toFun := fun y => s • y,
                                      map_add' := (_ : ∀ (b₁ b₂ : ↑Y), s • (b₁ + b₂) = s • b₁ + s • b₂) }
                                    (r • y) =
                                  (RingHom.id R) r •
                                    AddHom.toFun
                                      { toFun := fun y => s • y,
                                        map_add' := (_ : ∀ (b₁ b₂ : ↑Y), s • (b₁ + b₂) = s • b₁ + s • b₂) }
                                      y) })
                      (s₁ + s₂) =
                    (fun s =>
                          {
                            toAddHom :=
                              { toFun := fun y => s • y,
                                map_add' := (_ : ∀ (b₁ b₂ : ↑Y), s • (b₁ + b₂) = s • b₁ + s • b₂) },
                            map_smul' :=
                              (_ :
                                ∀ (r : R) (y : ↑Y),
                                  AddHom.toFun
                                      { toFun := fun y => s • y,
                                        map_add' := (_ : ∀ (b₁ b₂ : ↑Y), s • (b₁ + b₂) = s • b₁ + s • b₂) }
                                      (r • y) =
                                    (RingHom.id R) r •
                                      AddHom.toFun
                                        { toFun := fun y => s • y,
                                          map_add' := (_ : ∀ (b₁ b₂ : ↑Y), s • (b₁ + b₂) = s • b₁ + s • b₂) }
                                        y) })
                        s₁ +
                      (fun s =>
                          {
                            toAddHom :=
                              { toFun := fun y => s • y,
                                map_add' := (_ : ∀ (b₁ b₂ : ↑Y), s • (b₁ + b₂) = s • b₁ + s • b₂) },
                            map_smul' :=
                              (_ :
                                ∀ (r : R) (y : ↑Y),
                                  AddHom.toFun
                                      { toFun := fun y => s • y,
                                        map_add' := (_ : ∀ (b₁ b₂ : ↑Y), s • (b₁ + b₂) = s • b₁ + s • b₂) }
                                      (r • y) =
                                    (RingHom.id R) r •
                                      AddHom.toFun
                                        { toFun := fun y => s • y,
                                          map_add' := (_ : ∀ (b₁ b₂ : ↑Y), s • (b₁ + b₂) = s • b₁ + s • b₂) }
                                        y) })
                        s₂) }
          x

Next tactic:
intros r s