File: Mathlib/RingTheory/Derivation/Basic.lean

full_name: Derivation.leibniz'
code: /-- `D : Derivation R A M` is an `R`-linear map from `A` to `M` that satisfies the `leibniz`
equality. We also require that `D 1 = 0`. See `Derivation.mk'` for a constructor that deduces this
assumption from the Leibniz rule when `M` is cancellative.

TODO: update this when bimodules are defined. -/
structure Derivation (R : Type*) (A : Type*) (M : Type*)
    [CommSemiring R] [CommSemiring A] [AddCommMonoid M] [Algebra R A] [Module A M] [Module R M]
    extends A →ₗ[R] M where
  protected map_one_eq_zero' : toLinearMap 1 = 0
  protected leibniz' (a b : A) : toLinearMap (a * b) = a • toLinearMap b + b • toLinearMap a
goal: ↑self (a * b) = a • ↑self b + b • ↑self a

full_name: Derivation
code: /-- `D : Derivation R A M` is an `R`-linear map from `A` to `M` that satisfies the `leibniz`
equality. We also require that `D 1 = 0`. See `Derivation.mk'` for a constructor that deduces this
assumption from the Leibniz rule when `M` is cancellative.

TODO: update this when bimodules are defined. -/
structure Derivation (R : Type*) (A : Type*) (M : Type*)
    [CommSemiring R] [CommSemiring A] [AddCommMonoid M] [Algebra R A] [Module A M] [Module R M]
    extends A →ₗ[R] M where
  protected map_one_eq_zero' : toLinearMap 1 = 0
  protected leibniz' (a b : A) : toLinearMap (a * b) = a • toLinearMap b + b • toLinearMap a
goal: Type (max u_2 u_3)

full_name: Derivation.map_one_eq_zero'
code: /-- `D : Derivation R A M` is an `R`-linear map from `A` to `M` that satisfies the `leibniz`
equality. We also require that `D 1 = 0`. See `Derivation.mk'` for a constructor that deduces this
assumption from the Leibniz rule when `M` is cancellative.

TODO: update this when bimodules are defined. -/
structure Derivation (R : Type*) (A : Type*) (M : Type*)
    [CommSemiring R] [CommSemiring A] [AddCommMonoid M] [Algebra R A] [Module A M] [Module R M]
    extends A →ₗ[R] M where
  protected map_one_eq_zero' : toLinearMap 1 = 0
  protected leibniz' (a b : A) : toLinearMap (a * b) = a • toLinearMap b + b • toLinearMap a
goal: ↑self 1 = 0

full_name: Derivation.instFunLike
code: instance : FunLike (Derivation R A M) A M 
goal: FunLike (Derivation R A M) A M

full_name: Derivation.instAddMonoidHomClass
code: instance : AddMonoidHomClass (Derivation R A M) A M 
goal: AddMonoidHomClass (Derivation R A M) A M

full_name: Derivation.toFun_eq_coe
code: theorem toFun_eq_coe : D.toFun = ⇑D 
goal: (↑D).toFun = ⇑D

full_name: Derivation.Simps.apply
code: /-- See Note [custom simps projection] -/
def Simps.apply (D : Derivation R A M) : A → M 
goal: A → M

full_name: Derivation.hasCoeToLinearMap
code: instance hasCoeToLinearMap : Coe (Derivation R A M) (A →ₗ[R] M) 
goal: Coe (Derivation R A M) (A →ₗ[R] M)

full_name: Derivation.mk_coe
code: @[simp]
theorem mk_coe (f : A →ₗ[R] M) (h₁ h₂) : ((⟨f, h₁, h₂⟩ : Derivation R A M) : A → M) = f 
goal: ⇑{ toLinearMap := f, map_one_eq_zero' := h₁, leibniz' := h₂ } = ⇑f

full_name: Derivation.coeFn_coe
code: @[simp, norm_cast]
theorem coeFn_coe (f : Derivation R A M) : ⇑(f : A →ₗ[R] M) = f 
goal: ⇑↑f = ⇑f

full_name: Derivation.coe_injective
code: theorem coe_injective : @Function.Injective (Derivation R A M) (A → M) DFunLike.coe 
goal: Function.Injective DFunLike.coe

full_name: Derivation.ext
code: @[ext]
theorem ext (H : ∀ a, D1 a = D2 a) : D1 = D2 
goal: D1 = D2

full_name: Derivation.congr_fun
code: theorem congr_fun (h : D1 = D2) (a : A) : D1 a = D2 a 
goal: D1 a = D2 a

full_name: Derivation.map_add
code: protected theorem map_add : D (a + b) = D a + D b 
goal: D (a + b) = D a + D b

full_name: Derivation.map_zero
code: protected theorem map_zero : D 0 = 0 
goal: D 0 = 0

full_name: Derivation.map_smul
code: @[simp]
theorem map_smul : D (r • a) = r • D a 
goal: D (r • a) = r • D a

full_name: Derivation.leibniz
code: @[simp]
theorem leibniz : D (a * b) = a • D b + b • D a 
goal: D (a * b) = a • D b + b • D a

full_name: Derivation.map_smul_of_tower
code: @[simp]
theorem map_smul_of_tower {S : Type*} [SMul S A] [SMul S M] [LinearMap.CompatibleSMul A M S R]
    (D : Derivation R A M) (r : S) (a : A) : D (r • a) = r • D a 
goal: D (r • a) = r • D a

full_name: Derivation.map_one_eq_zero
code: @[simp]
theorem map_one_eq_zero : D 1 = 0 
goal: D 1 = 0

full_name: Derivation.map_algebraMap
code: @[simp]
theorem map_algebraMap : D (algebraMap R A r) = 0 
goal: D ((algebraMap R A) r) = 0

full_name: Derivation.map_natCast
code: @[simp]
theorem map_natCast (n : ℕ) : D (n : A) = 0 
goal: D ↑n = 0

full_name: Derivation.leibniz_pow
code: @[simp]
theorem leibniz_pow (n : ℕ) : D (a ^ n) = n • a ^ (n - 1) • D a 
goal: D (a ^ n) = n • a ^ (n - 1) • D a

full_name: Derivation.map_aeval
code: @[simp]
theorem map_aeval (P : R[X]) (x : A) :
    D (aeval x P) = aeval x (derivative P) • D x 
goal: D ((Polynomial.aeval x) P) = (Polynomial.aeval x) (Polynomial.derivative P) • D x

full_name: Derivation.eqOn_adjoin
code: theorem eqOn_adjoin {s : Set A} (h : Set.EqOn D1 D2 s) : Set.EqOn D1 D2 (adjoin R s) 
goal: Set.EqOn ⇑D1 ⇑D2 ↑(Algebra.adjoin R s)

full_name: Derivation.ext_of_adjoin_eq_top
code: /-- If adjoin of a set is the whole algebra, then any two derivations equal on this set are equal
on the whole algebra. -/
theorem ext_of_adjoin_eq_top (s : Set A) (hs : adjoin R s = ⊤) (h : Set.EqOn D1 D2 s) : D1 = D2 
goal: D1 = D2

full_name: Derivation.instZero
code: instance : Zero (Derivation R A M) 
goal: Zero (Derivation R A M)

full_name: Derivation.coe_zero
code: @[simp]
theorem coe_zero : ⇑(0 : Derivation R A M) = 0 
goal: ⇑0 = 0

full_name: Derivation.coe_zero_linearMap
code: @[simp]
theorem coe_zero_linearMap : ↑(0 : Derivation R A M) = (0 : A →ₗ[R] M) 
goal: ↑0 = 0

full_name: Derivation.zero_apply
code: theorem zero_apply (a : A) : (0 : Derivation R A M) a = 0 
goal: 0 a = 0

full_name: Derivation.instAdd
code: instance : Add (Derivation R A M) 
goal: Add (Derivation R A M)

full_name: Derivation.coe_add
code: @[simp]
theorem coe_add (D1 D2 : Derivation R A M) : ⇑(D1 + D2) = D1 + D2 
goal: ⇑(D1 + D2) = ⇑D1 + ⇑D2

full_name: Derivation.coe_add_linearMap
code: @[simp]
theorem coe_add_linearMap (D1 D2 : Derivation R A M) : ↑(D1 + D2) = (D1 + D2 : A →ₗ[R] M) 
goal: ↑(D1 + D2) = ↑D1 + ↑D2

full_name: Derivation.add_apply
code: theorem add_apply : (D1 + D2) a = D1 a + D2 a 
goal: (D1 + D2) a = D1 a + D2 a

full_name: Derivation.instInhabited
code: instance : Inhabited (Derivation R A M) 
goal: Inhabited (Derivation R A M)

full_name: Derivation.instSMul
code: instance : SMul S (Derivation R A M) 
goal: SMul S (Derivation R A M)

full_name: Derivation.coe_smul
code: @[simp]
theorem coe_smul (r : S) (D : Derivation R A M) : ⇑(r • D) = r • ⇑D 
goal: ⇑(r • D) = r • ⇑D

full_name: Derivation.coe_smul_linearMap
code: @[simp]
theorem coe_smul_linearMap (r : S) (D : Derivation R A M) : ↑(r • D) = r • (D : A →ₗ[R] M) 
goal: ↑(r • D) = r • ↑D

full_name: Derivation.smul_apply
code: theorem smul_apply (r : S) (D : Derivation R A M) : (r • D) a = r • D a 
goal: (r • D) a = r • D a

full_name: Derivation.instAddCommMonoid
code: instance : AddCommMonoid (Derivation R A M) 
goal: AddCommMonoid (Derivation R A M)

full_name: Derivation.coeFnAddMonoidHom
code: /-- `coe_fn` as an `AddMonoidHom`. -/
def coeFnAddMonoidHom : Derivation R A M →+ A → M 
goal: Derivation R A M →+ A → M

full_name: Derivation.instDistribMulAction
code: instance : DistribMulAction S (Derivation R A M) 
goal: DistribMulAction S (Derivation R A M)

full_name: Derivation.instIsCentralScalar
code: instance [DistribMulAction Sᵐᵒᵖ M] [IsCentralScalar S M] :
    IsCentralScalar S (Derivation R A M) 
goal: IsCentralScalar S (Derivation R A M)

full_name: Derivation.instIsScalarTower
code: instance [SMul S T] [IsScalarTower S T M] : IsScalarTower S T (Derivation R A M) 
goal: IsScalarTower S T (Derivation R A M)

full_name: Derivation.instSMulCommClass
code: instance [SMulCommClass S T M] : SMulCommClass S T (Derivation R A M) 
goal: SMulCommClass S T (Derivation R A M)

full_name: Derivation.instModule
code: instance instModule {S : Type*} [Semiring S] [Module S M] [SMulCommClass R S M]
    [SMulCommClass S A M] : Module S (Derivation R A M) 
goal: Module S (Derivation R A M)

full_name: LinearMap.compDer
code: /-- 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 
goal: Derivation R A M →ₗ[R] Derivation R A N

full_name: Derivation.coe_to_linearMap_comp
code: @[simp]
theorem coe_to_linearMap_comp : (f.compDer D : A →ₗ[R] N) = (f : M →ₗ[R] N).comp (D : A →ₗ[R] M) 
goal: ↑(f.compDer D) = ↑R f ∘ₗ ↑D

full_name: Derivation.coe_comp
code: @[simp]
theorem coe_comp : (f.compDer D : A → N) = (f : M →ₗ[R] N).comp (D : A →ₗ[R] M) 
goal: ⇑(f.compDer D) = ⇑(↑R f ∘ₗ ↑D)

full_name: Derivation.llcomp
code: /-- The composition of a derivation with a linear map as a bilinear map -/
@[simps]
def llcomp : (M →ₗ[A] N) →ₗ[A] Derivation R A M →ₗ[R] Derivation R A N 
goal: (M →ₗ[A] N) →ₗ[A] Derivation R A M →ₗ[R] Derivation R A N

full_name: Derivation.llcomp_apply
code: /-- The composition of a derivation with a linear map as a bilinear map -/
@[simps]
def llcomp : (M →ₗ[A] N) →ₗ[A] Derivation R A M →ₗ[R] Derivation R A N 
goal: Derivation.llcomp f = f.compDer

full_name: LinearEquiv.compDer
code: /-- Pushing a derivation forward through a linear equivalence is an equivalence. -/
def _root_.LinearEquiv.compDer : Derivation R A M ≃ₗ[R] Derivation R A N 
goal: Derivation R A M ≃ₗ[R] Derivation R A N

full_name: Derivation.linearEquiv_coe_to_linearMap_comp
code: @[simp]
theorem linearEquiv_coe_to_linearMap_comp :
    (e.compDer D : A →ₗ[R] N) = (e.toLinearMap : M →ₗ[R] N).comp (D : A →ₗ[R] M) 
goal: ↑(e.compDer D) = ↑R ↑e ∘ₗ ↑D

full_name: Derivation.linearEquiv_coe_comp
code: @[simp]
theorem linearEquiv_coe_comp :
    (e.compDer D : A → N) = (e.toLinearMap : M →ₗ[R] N).comp (D : A →ₗ[R] M) 
goal: ⇑(e.compDer D) = ⇑(↑R ↑e ∘ₗ ↑D)

full_name: Derivation.compAlgebraMap_apply
code: /-- For a tower `R → A → B` and an `R`-derivation `B → M`, we may compose with `A → B` to obtain an
`R`-derivation `A → M`. -/
@[simps!]
def compAlgebraMap [Algebra A B] [IsScalarTower R A B] [IsScalarTower A B M]
    (d : Derivation R B M) : Derivation R A M 
goal: ∀ (a : A), (Derivation.compAlgebraMap A d) a = d ((algebraMap A B) a)

full_name: Derivation.compAlgebraMap
code: /-- For a tower `R → A → B` and an `R`-derivation `B → M`, we may compose with `A → B` to obtain an
`R`-derivation `A → M`. -/
@[simps!]
def compAlgebraMap [Algebra A B] [IsScalarTower R A B] [IsScalarTower A B M]
    (d : Derivation R B M) : Derivation R A M 
goal: Derivation R A M

full_name: Derivation.restrictScalars
code: /-- If `A` is both an `R`-algebra and an `S`-algebra; `M` is both an `R`-module and an `S`-module,
then an `S`-derivation `A → M` is also an `R`-derivation if it is also `R`-linear. -/
protected def restrictScalars (d : Derivation S A M) : Derivation R A M 
goal: Derivation R A M

full_name: Derivation.coe_restrictScalars
code: lemma coe_restrictScalars (d : Derivation S A M) : ⇑(d.restrictScalars R) = ⇑d 
goal: ⇑(Derivation.restrictScalars R d) = ⇑d

full_name: Derivation.restrictScalars_apply
code: @[simp]
lemma restrictScalars_apply (d : Derivation S A M) (x : A) : d.restrictScalars R x = d x 
goal: (Derivation.restrictScalars R d) x = d x

full_name: Derivation.mk'
code: /-- Define `Derivation R A M` from a linear map when `M` is cancellative by verifying the Leibniz
rule. -/
def mk' (D : A →ₗ[R] M) (h : ∀ a b, D (a * b) = a • D b + b • D a) : Derivation R A M 
goal: Derivation R A M

full_name: Derivation.coe_mk'
code: @[simp]
theorem coe_mk' (D : A →ₗ[R] M) (h) : ⇑(mk' D h) = D 
goal: ⇑(Derivation.mk' D h) = ⇑D

full_name: Derivation.coe_mk'_linearMap
code: @[simp]
theorem coe_mk'_linearMap (D : A →ₗ[R] M) (h) : (mk' D h : A →ₗ[R] M) = D 
goal: ↑(Derivation.mk' D h) = D

full_name: Derivation.map_neg
code: protected theorem map_neg : D (-a) = -D a 
goal: D (-a) = -D a

full_name: Derivation.map_sub
code: protected theorem map_sub : D (a - b) = D a - D b 
goal: D (a - b) = D a - D b

full_name: Derivation.map_intCast
code: @[simp]
theorem map_intCast (n : ℤ) : D (n : A) = 0 
goal: D ↑n = 0

full_name: Derivation.leibniz_of_mul_eq_one
code: theorem leibniz_of_mul_eq_one {a b : A} (h : a * b = 1) : D a = -a ^ 2 • D b 
goal: D a = -a ^ 2 • D b

full_name: Derivation.leibniz_invOf
code: theorem leibniz_invOf [Invertible a] : D (⅟ a) = -⅟ a ^ 2 • D a 
goal: D ⅟a = -⅟a ^ 2 • D a

full_name: Derivation.leibniz_inv
code: theorem leibniz_inv (a : K) : D a⁻¹ = -a⁻¹ ^ 2 • D a 
goal: D a⁻¹ = -a⁻¹ ^ 2 • D a

full_name: Derivation.leibniz_div
code: theorem leibniz_div (a b : K) : D (a / b) = b⁻¹ ^ 2 • (b • D a - a • D b) 
goal: D (a / b) = b⁻¹ ^ 2 • (b • D a - a • D b)

full_name: Derivation.leibniz_div_const
code: theorem leibniz_div_const (a b : K) (h : D b = 0) : D (a / b) = b⁻¹ • D a 
goal: D (a / b) = b⁻¹ • D a

full_name: Derivation.leibniz_zpow
code: lemma leibniz_zpow (a : K) (n : ℤ) : D (a ^ n) = n • a ^ (n - 1) • D a 
goal: D (a ^ n) = n • a ^ (n - 1) • D a

full_name: Derivation.instNeg
code: instance : Neg (Derivation R A M) 
goal: Neg (Derivation R A M)

full_name: Derivation.coe_neg
code: @[simp]
theorem coe_neg (D : Derivation R A M) : ⇑(-D) = -D 
goal: ⇑(-D) = -⇑D

full_name: Derivation.coe_neg_linearMap
code: @[simp]
theorem coe_neg_linearMap (D : Derivation R A M) : ↑(-D) = (-D : A →ₗ[R] M) 
goal: ↑(-D) = -↑D

full_name: Derivation.neg_apply
code: theorem neg_apply : (-D) a = -D a 
goal: (-D) a = -D a

full_name: Derivation.instSub
code: instance : Sub (Derivation R A M) 
goal: Sub (Derivation R A M)

full_name: Derivation.coe_sub
code: @[simp]
theorem coe_sub (D1 D2 : Derivation R A M) : ⇑(D1 - D2) = D1 - D2 
goal: ⇑(D1 - D2) = ⇑D1 - ⇑D2

full_name: Derivation.coe_sub_linearMap
code: @[simp]
theorem coe_sub_linearMap (D1 D2 : Derivation R A M) : ↑(D1 - D2) = (D1 - D2 : A →ₗ[R] M) 
goal: ↑(D1 - D2) = ↑D1 - ↑D2

full_name: Derivation.sub_apply
code: theorem sub_apply : (D1 - D2) a = D1 a - D2 a 
goal: (D1 - D2) a = D1 a - D2 a

full_name: Derivation.instAddCommGroup
code: instance : AddCommGroup (Derivation R A M) 
goal: AddCommGroup (Derivation R A M)