/-- We can push forward derivations using linear maps, i.e., the composition of a derivation with a
linear map is a derivation. Furthermore, this operation is linear on the spaces of derivations. -/
def _root_.LinearMap.compDer : Derivation R A M →ₗ[R] Derivation R A N where
  toFun D :=
    { toLinearMap := (f : M →ₗ[R] N).comp (D : A →ₗ[R] M)
      map_one_eq_zero' := by simp only [LinearMap.comp_apply, coeFn_coe, map_one_eq_zero, map_zero]
      leibniz' := fun a b => by
        simp only [coeFn_coe, LinearMap.comp_apply, LinearMap.map_add, leibniz,
          LinearMap.coe_restrictScalars, LinearMap.map_smul] }
  map_add' D₁ D₂ := by ext; exact LinearMap.map_add _ _ _
  map_smul' r D := by 

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
M : Type u_4
inst✝¹³ : CommSemiring R
inst✝¹² : CommSemiring A
inst✝¹¹ : CommSemiring B
inst✝¹⁰ : AddCommMonoid M
inst✝⁹ : Algebra R A
inst✝⁸ : Algebra R B
inst✝⁷ : Module A M
inst✝⁶ : Module B M
inst✝⁵ : Module R M
D✝ D1 D2 : Derivation R A M
r✝ : R
a b : A
N : Type u_5
inst✝⁴ : AddCommMonoid N
inst✝³ : Module A N
inst✝² : Module R N
inst✝¹ : IsScalarTower R A M
inst✝ : IsScalarTower R A N
f : M →ₗ[A] N
e : M ≃ₗ[A] N
r : R
D : Derivation R A M
⊢ AddHom.toFun
      {
        toFun := fun D =>
          { toLinearMap := ↑R f ∘ₗ ↑D, map_one_eq_zero' := (_ : (↑R f) (D 1) = 0),
            leibniz' := (_ : ∀ (a b : A), (↑R f) (D (a * b)) = a • f (D b) + b • f (D a)) },
        map_add' :=
          (_ :
            ∀ (D₁ D₂ : Derivation R A M),
              (fun D =>
                    { toLinearMap := ↑R f ∘ₗ ↑D, map_one_eq_zero' := (_ : (↑R f) (D 1) = 0),
                      leibniz' := (_ : ∀ (a b : A), (↑R f) (D (a * b)) = a • f (D b) + b • f (D a)) })
                  (D₁ + D₂) =
                (fun D =>
                      { toLinearMap := ↑R f ∘ₗ ↑D, map_one_eq_zero' := (_ : (↑R f) (D 1) = 0),
                        leibniz' := (_ : ∀ (a b : A), (↑R f) (D (a * b)) = a • f (D b) + b • f (D a)) })
                    D₁ +
                  (fun D =>
                      { toLinearMap := ↑R f ∘ₗ ↑D, map_one_eq_zero' := (_ : (↑R f) (D 1) = 0),
                        leibniz' := (_ : ∀ (a b : A), (↑R f) (D (a * b)) = a • f (D b) + b • f (D a)) })
                    D₂) }
      (r • D) =
    (RingHom.id R) r •
      AddHom.toFun
        {
          toFun := fun D =>
            { toLinearMap := ↑R f ∘ₗ ↑D, map_one_eq_zero' := (_ : (↑R f) (D 1) = 0),
              leibniz' := (_ : ∀ (a b : A), (↑R f) (D (a * b)) = a • f (D b) + b • f (D a)) },
          map_add' :=
            (_ :
              ∀ (D₁ D₂ : Derivation R A M),
                (fun D =>
                      { toLinearMap := ↑R f ∘ₗ ↑D, map_one_eq_zero' := (_ : (↑R f) (D 1) = 0),
                        leibniz' := (_ : ∀ (a b : A), (↑R f) (D (a * b)) = a • f (D b) + b • f (D a)) })
                    (D₁ + D₂) =
                  (fun D =>
                        { toLinearMap := ↑R f ∘ₗ ↑D, map_one_eq_zero' := (_ : (↑R f) (D 1) = 0),
                          leibniz' := (_ : ∀ (a b : A), (↑R f) (D (a * b)) = a • f (D b) + b • f (D a)) })
                      D₁ +
                    (fun D =>
                        { toLinearMap := ↑R f ∘ₗ ↑D, map_one_eq_zero' := (_ : (↑R f) (D 1) = 0),
                          leibniz' := (_ : ∀ (a b : A), (↑R f) (D (a * b)) = a • f (D b) + b • f (D a)) })
                      D₂) }
        D

Next tactic:
dsimp