l3lab/ntp-mathlib huggingface dataset:
theorem Integrable.condKernel_ae {f : α × Ω → F} (hf_int : Integrable f ρ) :
    ∀ᵐ a ∂ρ.fst, Integrable (fun ω => f (a, ω)) (ρ.condKernel a) := by
  have hf_ae : AEStronglyMeasurable f ρ := hf_int.1
  

Proof state:
α : Type u_1
Ω : Type u_2
E : Type u_3
F : Type u_4
mα : MeasurableSpace α
inst✝⁷ : MeasurableSpace Ω
inst✝⁶ : StandardBorelSpace Ω
inst✝⁵ : Nonempty Ω
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : CompleteSpace E
inst✝¹ : NormedAddCommGroup F
ρ : Measure (α × Ω)
inst✝ : IsFiniteMeasure ρ
f : α × Ω → F
hf_int : Integrable f
hf_ae : AEStronglyMeasurable f ρ
⊢ ∀ᵐ (a : α) ∂Measure.fst ρ, Integrable fun ω => f (a, ω)

Next tactic:
rw [← hf_ae.ae_integrable_condKernel_iff] at hf_int
theorem Integrable.condKernel_ae {f : α × Ω → F} (hf_int : Integrable f ρ) :
    ∀ᵐ a ∂ρ.fst, Integrable (fun ω => f (a, ω)) (ρ.condKernel a) := by
  have hf_ae : AEStronglyMeasurable f ρ := hf_int.1
  rw [← hf_ae.ae_integrable_condKernel_iff] at hf_int
  

Proof state:
α : Type u_1
Ω : Type u_2
E : Type u_3
F : Type u_4
mα : MeasurableSpace α
inst✝⁷ : MeasurableSpace Ω
inst✝⁶ : StandardBorelSpace Ω
inst✝⁵ : Nonempty Ω
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : CompleteSpace E
inst✝¹ : NormedAddCommGroup F
ρ : Measure (α × Ω)
inst✝ : IsFiniteMeasure ρ
f : α × Ω → F
hf_int :
  (∀ᵐ (a : α) ∂Measure.fst ρ, Integrable fun ω => f (a, ω)) ∧
    Integrable fun a => ∫ (ω : Ω), ‖f (a, ω)‖ ∂(Measure.condKernel ρ) a
hf_ae : AEStronglyMeasurable f ρ
⊢ ∀ᵐ (a : α) ∂Measure.fst ρ, Integrable fun ω => f (a, ω)

Next tactic:
exact hf_int.1
theorem Integrable.integral_norm_condKernel {f : α × Ω → F} (hf_int : Integrable f ρ) :
    Integrable (fun x => ∫ y, ‖f (x, y)‖ ∂ρ.condKernel x) ρ.fst := by
  

Proof state:
α : Type u_1
Ω : Type u_2
E : Type u_3
F : Type u_4
mα : MeasurableSpace α
inst✝⁷ : MeasurableSpace Ω
inst✝⁶ : StandardBorelSpace Ω
inst✝⁵ : Nonempty Ω
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : CompleteSpace E
inst✝¹ : NormedAddCommGroup F
ρ : Measure (α × Ω)
inst✝ : IsFiniteMeasure ρ
f : α × Ω → F
hf_int : Integrable f
⊢ Integrable fun x => ∫ (y : Ω), ‖f (x, y)‖ ∂(Measure.condKernel ρ) x

Next tactic:
have hf_ae : AEStronglyMeasurable f ρ := hf_int.1
theorem Integrable.integral_norm_condKernel {f : α × Ω → F} (hf_int : Integrable f ρ) :
    Integrable (fun x => ∫ y, ‖f (x, y)‖ ∂ρ.condKernel x) ρ.fst := by
  have hf_ae : AEStronglyMeasurable f ρ := hf_int.1
  

Proof state:
α : Type u_1
Ω : Type u_2
E : Type u_3
F : Type u_4
mα : MeasurableSpace α
inst✝⁷ : MeasurableSpace Ω
inst✝⁶ : StandardBorelSpace Ω
inst✝⁵ : Nonempty Ω
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : CompleteSpace E
inst✝¹ : NormedAddCommGroup F
ρ : Measure (α × Ω)
inst✝ : IsFiniteMeasure ρ
f : α × Ω → F
hf_int : Integrable f
hf_ae : AEStronglyMeasurable f ρ
⊢ Integrable fun x => ∫ (y : Ω), ‖f (x, y)‖ ∂(Measure.condKernel ρ) x

Next tactic:
rw [← hf_ae.ae_integrable_condKernel_iff] at hf_int
theorem Integrable.integral_norm_condKernel {f : α × Ω → F} (hf_int : Integrable f ρ) :
    Integrable (fun x => ∫ y, ‖f (x, y)‖ ∂ρ.condKernel x) ρ.fst := by
  have hf_ae : AEStronglyMeasurable f ρ := hf_int.1
  rw [← hf_ae.ae_integrable_condKernel_iff] at hf_int
  

Proof state:
α : Type u_1
Ω : Type u_2
E : Type u_3
F : Type u_4
mα : MeasurableSpace α
inst✝⁷ : MeasurableSpace Ω
inst✝⁶ : StandardBorelSpace Ω
inst✝⁵ : Nonempty Ω
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : CompleteSpace E
inst✝¹ : NormedAddCommGroup F
ρ : Measure (α × Ω)
inst✝ : IsFiniteMeasure ρ
f : α × Ω → F
hf_int :
  (∀ᵐ (a : α) ∂Measure.fst ρ, Integrable fun ω => f (a, ω)) ∧
    Integrable fun a => ∫ (ω : Ω), ‖f (a, ω)‖ ∂(Measure.condKernel ρ) a
hf_ae : AEStronglyMeasurable f ρ
⊢ Integrable fun x => ∫ (y : Ω), ‖f (x, y)‖ ∂(Measure.condKernel ρ) x

Next tactic:
exact hf_int.2
theorem Integrable.norm_integral_condKernel {f : α × Ω → E} (hf_int : Integrable f ρ) :
    Integrable (fun x => ‖∫ y, f (x, y) ∂ρ.condKernel x‖) ρ.fst := by
  

Proof state:
α : Type u_1
Ω : Type u_2
E : Type u_3
F : Type u_4
mα : MeasurableSpace α
inst✝⁷ : MeasurableSpace Ω
inst✝⁶ : StandardBorelSpace Ω
inst✝⁵ : Nonempty Ω
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : CompleteSpace E
inst✝¹ : NormedAddCommGroup F
ρ : Measure (α × Ω)
inst✝ : IsFiniteMeasure ρ
f : α × Ω → E
hf_int : Integrable f
⊢ Integrable fun x => ‖∫ (y : Ω), f (x, y) ∂(Measure.condKernel ρ) x‖

Next tactic:
refine' hf_int.integral_norm_condKernel.mono hf_int.1.integral_condKernel.norm _
theorem Integrable.norm_integral_condKernel {f : α × Ω → E} (hf_int : Integrable f ρ) :
    Integrable (fun x => ‖∫ y, f (x, y) ∂ρ.condKernel x‖) ρ.fst := by
  refine' hf_int.integral_norm_condKernel.mono hf_int.1.integral_condKernel.norm _
  

Proof state:
α : Type u_1
Ω : Type u_2
E : Type u_3
F : Type u_4
mα : MeasurableSpace α
inst✝⁷ : MeasurableSpace Ω
inst✝⁶ : StandardBorelSpace Ω
inst✝⁵ : Nonempty Ω
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : CompleteSpace E
inst✝¹ : NormedAddCommGroup F
ρ : Measure (α × Ω)
inst✝ : IsFiniteMeasure ρ
f : α × Ω → E
hf_int : Integrable f
⊢ ∀ᵐ (a : α) ∂Measure.fst ρ,
    ‖‖∫ (y : Ω), f (a, y) ∂(Measure.condKernel ρ) a‖‖ ≤ ‖∫ (y : Ω), ‖f (a, y)‖ ∂(Measure.condKernel ρ) a‖

Next tactic:
refine' eventually_of_forall fun x => _
theorem Integrable.norm_integral_condKernel {f : α × Ω → E} (hf_int : Integrable f ρ) :
    Integrable (fun x => ‖∫ y, f (x, y) ∂ρ.condKernel x‖) ρ.fst := by
  refine' hf_int.integral_norm_condKernel.mono hf_int.1.integral_condKernel.norm _
  refine' eventually_of_forall fun x => _
  

Proof state:
α : Type u_1
Ω : Type u_2
E : Type u_3
F : Type u_4
mα : MeasurableSpace α
inst✝⁷ : MeasurableSpace Ω
inst✝⁶ : StandardBorelSpace Ω
inst✝⁵ : Nonempty Ω
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : CompleteSpace E
inst✝¹ : NormedAddCommGroup F
ρ : Measure (α × Ω)
inst✝ : IsFiniteMeasure ρ
f : α × Ω → E
hf_int : Integrable f
x : α
⊢ ‖‖∫ (y : Ω), f (x, y) ∂(Measure.condKernel ρ) x‖‖ ≤ ‖∫ (y : Ω), ‖f (x, y)‖ ∂(Measure.condKernel ρ) x‖

Next tactic:
rw [norm_norm]
theorem Integrable.norm_integral_condKernel {f : α × Ω → E} (hf_int : Integrable f ρ) :
    Integrable (fun x => ‖∫ y, f (x, y) ∂ρ.condKernel x‖) ρ.fst := by
  refine' hf_int.integral_norm_condKernel.mono hf_int.1.integral_condKernel.norm _
  refine' eventually_of_forall fun x => _
  rw [norm_norm]
  

Proof state:
α : Type u_1
Ω : Type u_2
E : Type u_3
F : Type u_4
mα : MeasurableSpace α
inst✝⁷ : MeasurableSpace Ω
inst✝⁶ : StandardBorelSpace Ω
inst✝⁵ : Nonempty Ω
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : CompleteSpace E
inst✝¹ : NormedAddCommGroup F
ρ : Measure (α × Ω)
inst✝ : IsFiniteMeasure ρ
f : α × Ω → E
hf_int : Integrable f
x : α
⊢ ‖∫ (y : Ω), f (x, y) ∂(Measure.condKernel ρ) x‖ ≤ ‖∫ (y : Ω), ‖f (x, y)‖ ∂(Measure.condKernel ρ) x‖

Next tactic:
refine' (norm_integral_le_integral_norm _).trans_eq (Real.norm_of_nonneg _).symm
theorem Integrable.norm_integral_condKernel {f : α × Ω → E} (hf_int : Integrable f ρ) :
    Integrable (fun x => ‖∫ y, f (x, y) ∂ρ.condKernel x‖) ρ.fst := by
  refine' hf_int.integral_norm_condKernel.mono hf_int.1.integral_condKernel.norm _
  refine' eventually_of_forall fun x => _
  rw [norm_norm]
  refine' (norm_integral_le_integral_norm _).trans_eq (Real.norm_of_nonneg _).symm
  

Proof state:
α : Type u_1
Ω : Type u_2
E : Type u_3
F : Type u_4
mα : MeasurableSpace α
inst✝⁷ : MeasurableSpace Ω
inst✝⁶ : StandardBorelSpace Ω
inst✝⁵ : Nonempty Ω
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : CompleteSpace E
inst✝¹ : NormedAddCommGroup F
ρ : Measure (α × Ω)
inst✝ : IsFiniteMeasure ρ
f : α × Ω → E
hf_int : Integrable f
x : α
⊢ 0 ≤ ∫ (a : Ω), ‖f (x, a)‖ ∂(Measure.condKernel ρ) x

Next tactic:
exact integral_nonneg_of_ae (eventually_of_forall fun y => norm_nonneg _)
/-- `Polynomial.derivative` as a derivation. -/
@[simps]
def derivative' : Derivation R R[X] R[X] where
  toFun := derivative
  map_add' _ _ := derivative_add
  map_smul' := derivative_smul
  map_one_eq_zero' := derivative_one
  leibniz' f g := by 

Proof state:
R : Type u_1
A : Type u_2
inst✝ : CommSemiring R
f g : R[X]
⊢ {
        toAddHom :=
          { toFun := ⇑derivative,
            map_add' := (_ : ∀ (x x_1 : R[X]), derivative (x + x_1) = derivative x + derivative x_1) },
        map_smul' := (_ : ∀ (s : R) (p : R[X]), derivative (s • p) = s • derivative p) }
      (f * g) =
    f •
        {
            toAddHom :=
              { toFun := ⇑derivative,
                map_add' := (_ : ∀ (x x_1 : R[X]), derivative (x + x_1) = derivative x + derivative x_1) },
            map_smul' := (_ : ∀ (s : R) (p : R[X]), derivative (s • p) = s • derivative p) }
          g +
      g •
        {
            toAddHom :=
              { toFun := ⇑derivative,
                map_add' := (_ : ∀ (x x_1 : R[X]), derivative (x + x_1) = derivative x + derivative x_1) },
            map_smul' := (_ : ∀ (s : R) (p : R[X]), derivative (s • p) = s • derivative p) }
          f

Next tactic:
simp [mul_comm, add_comm, derivative_mul]
@[simp]
theorem C_smul_derivation_apply (D : Derivation R R[X] A) (a : R) (f : R[X]) :
    C a • D f = a • D f := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid A
inst✝¹ : Module R A
inst✝ : Module R[X] A
D : Derivation R R[X] A
a : R
f : R[X]
⊢ C a • D f = a • D f

Next tactic:
have : C a • D f = D (C a * f) := by simp
@[simp]
theorem C_smul_derivation_apply (D : Derivation R R[X] A) (a : R) (f : R[X]) :
    C a • D f = a • D f := by
  have : C a • D f = D (C a * f) := by 

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid A
inst✝¹ : Module R A
inst✝ : Module R[X] A
D : Derivation R R[X] A
a : R
f : R[X]
⊢ C a • D f = D (C a * f)

Next tactic:
simp
@[simp]
theorem C_smul_derivation_apply (D : Derivation R R[X] A) (a : R) (f : R[X]) :
    C a • D f = a • D f := by
  have : C a • D f = D (C a * f) := by simp
  

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid A
inst✝¹ : Module R A
inst✝ : Module R[X] A
D : Derivation R R[X] A
a : R
f : R[X]
this : C a • D f = D (C a * f)
⊢ C a • D f = a • D f

Next tactic:
rw [this, C_mul', D.map_smul]
@[ext]
theorem derivation_ext {D₁ D₂ : Derivation R R[X] A} (h : D₁ X = D₂ X) : D₁ = D₂ :=
  Derivation.ext fun f => Derivation.eqOn_adjoin (Set.eqOn_singleton.2 h) <| by
    

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid A
inst✝¹ : Module R A
inst✝ : Module R[X] A
D₁ D₂ : Derivation R R[X] A
h : D₁ X = D₂ X
f : R[X]
⊢ f ∈ ↑(Algebra.adjoin R {X})

Next tactic:
simp only [adjoin_X, Algebra.coe_top, Set.mem_univ]
/-- The derivation on `R[X]` that takes the value `a` on `X`. -/
def mkDerivation : A →ₗ[R] Derivation R R[X] A where
  toFun := fun a ↦ (LinearMap.toSpanSingleton R[X] A a).compDer derivative'
  map_add' := fun a b ↦ by 

Proof state:
R : Type u_1
A : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : AddCommMonoid A
inst✝² : Module R A
inst✝¹ : Module R[X] A
inst✝ : IsScalarTower R R[X] A
a b : A
⊢ (fun a => (LinearMap.compDer (LinearMap.toSpanSingleton R[X] A a)) derivative') (a + b) =
    (fun a => (LinearMap.compDer (LinearMap.toSpanSingleton R[X] A a)) derivative') a +
      (fun a => (LinearMap.compDer (LinearMap.toSpanSingleton R[X] A a)) derivative') b

Next tactic:
ext
/-- The derivation on `R[X]` that takes the value `a` on `X`. -/
def mkDerivation : A →ₗ[R] Derivation R R[X] A where
  toFun := fun a ↦ (LinearMap.toSpanSingleton R[X] A a).compDer derivative'
  map_add' := fun a b ↦ by ext; 

Proof state:
case h
R : Type u_1
A : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : AddCommMonoid A
inst✝² : Module R A
inst✝¹ : Module R[X] A
inst✝ : IsScalarTower R R[X] A
a b : A
⊢ ((fun a => (LinearMap.compDer (LinearMap.toSpanSingleton R[X] A a)) derivative') (a + b)) X =
    ((fun a => (LinearMap.compDer (LinearMap.toSpanSingleton R[X] A a)) derivative') a +
        (fun a => (LinearMap.compDer (LinearMap.toSpanSingleton R[X] A a)) derivative') b)
      X

Next tactic:
simp
/-- The derivation on `R[X]` that takes the value `a` on `X`. -/
def mkDerivation : A →ₗ[R] Derivation R R[X] A where
  toFun := fun a ↦ (LinearMap.toSpanSingleton R[X] A a).compDer derivative'
  map_add' := fun a b ↦ by ext; simp
  map_smul' := fun t a ↦ by 

Proof state:
R : Type u_1
A : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : AddCommMonoid A
inst✝² : Module R A
inst✝¹ : Module R[X] A
inst✝ : IsScalarTower R R[X] A
t : R
a : A
⊢ AddHom.toFun
      { toFun := fun a => (LinearMap.compDer (LinearMap.toSpanSingleton R[X] A a)) derivative',
        map_add' :=
          (_ :
            ∀ (a b : A),
              (fun a => (LinearMap.compDer (LinearMap.toSpanSingleton R[X] A a)) derivative') (a + b) =
                (fun a => (LinearMap.compDer (LinearMap.toSpanSingleton R[X] A a)) derivative') a +
                  (fun a => (LinearMap.compDer (LinearMap.toSpanSingleton R[X] A a)) derivative') b) }
      (t • a) =
    (RingHom.id R) t •
      AddHom.toFun
        { toFun := fun a => (LinearMap.compDer (LinearMap.toSpanSingleton R[X] A a)) derivative',
          map_add' :=
            (_ :
              ∀ (a b : A),
                (fun a => (LinearMap.compDer (LinearMap.toSpanSingleton R[X] A a)) derivative') (a + b) =
                  (fun a => (LinearMap.compDer (LinearMap.toSpanSingleton R[X] A a)) derivative') a +
                    (fun a => (LinearMap.compDer (LinearMap.toSpanSingleton R[X] A a)) derivative') b) }
        a

Next tactic:
ext
/-- The derivation on `R[X]` that takes the value `a` on `X`. -/
def mkDerivation : A →ₗ[R] Derivation R R[X] A where
  toFun := fun a ↦ (LinearMap.toSpanSingleton R[X] A a).compDer derivative'
  map_add' := fun a b ↦ by ext; simp
  map_smul' := fun t a ↦ by ext; 

Proof state:
case h
R : Type u_1
A : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : AddCommMonoid A
inst✝² : Module R A
inst✝¹ : Module R[X] A
inst✝ : IsScalarTower R R[X] A
t : R
a : A
⊢ (AddHom.toFun
        { toFun := fun a => (LinearMap.compDer (LinearMap.toSpanSingleton R[X] A a)) derivative',
          map_add' :=
            (_ :
              ∀ (a b : A),
                (fun a => (LinearMap.compDer (LinearMap.toSpanSingleton R[X] A a)) derivative') (a + b) =
                  (fun a => (LinearMap.compDer (LinearMap.toSpanSingleton R[X] A a)) derivative') a +
                    (fun a => (LinearMap.compDer (LinearMap.toSpanSingleton R[X] A a)) derivative') b) }
        (t • a))
      X =
    ((RingHom.id R) t •
        AddHom.toFun
          { toFun := fun a => (LinearMap.compDer (LinearMap.toSpanSingleton R[X] A a)) derivative',
            map_add' :=
              (_ :
                ∀ (a b : A),
                  (fun a => (LinearMap.compDer (LinearMap.toSpanSingleton R[X] A a)) derivative') (a + b) =
                    (fun a => (LinearMap.compDer (LinearMap.toSpanSingleton R[X] A a)) derivative') a +
                      (fun a => (LinearMap.compDer (LinearMap.toSpanSingleton R[X] A a)) derivative') b) }
          a)
      X

Next tactic:
simp
lemma mkDerivation_apply (a : A) (f : R[X]) :
    mkDerivation R a f = derivative f • a := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : AddCommMonoid A
inst✝² : Module R A
inst✝¹ : Module R[X] A
inst✝ : IsScalarTower R R[X] A
a : A
f : R[X]
⊢ ((mkDerivation R) a) f = derivative f • a

Next tactic:
rfl
@[simp]
theorem mkDerivation_X (a : A) : mkDerivation R a X = a := by 

Proof state:
R : Type u_1
A : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : AddCommMonoid A
inst✝² : Module R A
inst✝¹ : Module R[X] A
inst✝ : IsScalarTower R R[X] A
a : A
⊢ ((mkDerivation R) a) X = a

Next tactic:
simp [mkDerivation_apply]
lemma mkDerivation_one_eq_derivative' : mkDerivation R (1 : R[X]) = derivative' := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : AddCommMonoid A
inst✝² : Module R A
inst✝¹ : Module R[X] A
inst✝ : IsScalarTower R R[X] A
⊢ (mkDerivation R) 1 = derivative'

Next tactic:
ext : 1
lemma mkDerivation_one_eq_derivative' : mkDerivation R (1 : R[X]) = derivative' := by
  ext : 1
  

Proof state:
case h
R : Type u_1
A : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : AddCommMonoid A
inst✝² : Module R A
inst✝¹ : Module R[X] A
inst✝ : IsScalarTower R R[X] A
⊢ ((mkDerivation R) 1) X = derivative' X

Next tactic:
simp [derivative']
lemma mkDerivation_one_eq_derivative (f : R[X]) : mkDerivation R (1 : R[X]) f = derivative f := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : AddCommMonoid A
inst✝² : Module R A
inst✝¹ : Module R[X] A
inst✝ : IsScalarTower R R[X] A
f : R[X]
⊢ ((mkDerivation R) 1) f = derivative f

Next tactic:
rw [mkDerivation_one_eq_derivative']
lemma mkDerivation_one_eq_derivative (f : R[X]) : mkDerivation R (1 : R[X]) f = derivative f := by
  rw [mkDerivation_one_eq_derivative']
  

Proof state:
R : Type u_1
A : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : AddCommMonoid A
inst✝² : Module R A
inst✝¹ : Module R[X] A
inst✝ : IsScalarTower R R[X] A
f : R[X]
⊢ derivative' f = derivative f

Next tactic:
rfl
@[simp] lemma mkDerivationEquiv_apply (a : A) :
    mkDerivationEquiv R a = mkDerivation R a := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : AddCommMonoid A
inst✝² : Module R A
inst✝¹ : Module R[X] A
inst✝ : IsScalarTower R R[X] A
a : A
⊢ (mkDerivationEquiv R) a = (mkDerivation R) a

Next tactic:
rfl
/--
For a derivation `d : A → M` and an element `a : A`, `d.compAEval a` is the
derivation of `R[X]` which takes a polynomial `f` to `d(aeval a f)`.

This derivation takes values in `Module.AEval R M a`, which is `M`, regarded as an
`R[X]`-module, with the action of a polynomial `f` defined by `f • m = (aeval a f) • m`.
-/
/-
Note: `compAEval` is not defined using `Derivation.compAlgebraMap`.
This because `A` is not an `R[X]` algebra and it would be messy to create an algebra instance
within the definition.
-/
@[simps]
def compAEval : Derivation R R[X] <| AEval R M a where
  toFun f          := AEval.of R M a (d (aeval a f))
  map_add'         := by 

Proof state:
R : Type u_1
A : Type u_2
M : Type u_3
inst✝⁶ : CommSemiring R
inst✝⁵ : CommSemiring A
inst✝⁴ : Algebra R A
inst✝³ : AddCommMonoid M
inst✝² : Module A M
inst✝¹ : Module R M
inst✝ : IsScalarTower R A M
d : Derivation R A M
a : A
⊢ ∀ (x y : R[X]),
    (fun f => (AEval.of R M a) (d ((aeval a) f))) (x + y) =
      (fun f => (AEval.of R M a) (d ((aeval a) f))) x + (fun f => (AEval.of R M a) (d ((aeval a) f))) y

Next tactic:
simp
/--
For a derivation `d : A → M` and an element `a : A`, `d.compAEval a` is the
derivation of `R[X]` which takes a polynomial `f` to `d(aeval a f)`.

This derivation takes values in `Module.AEval R M a`, which is `M`, regarded as an
`R[X]`-module, with the action of a polynomial `f` defined by `f • m = (aeval a f) • m`.
-/
/-
Note: `compAEval` is not defined using `Derivation.compAlgebraMap`.
This because `A` is not an `R[X]` algebra and it would be messy to create an algebra instance
within the definition.
-/
@[simps]
def compAEval : Derivation R R[X] <| AEval R M a where
  toFun f          := AEval.of R M a (d (aeval a f))
  map_add'         := by simp
  map_smul'        := by 

Proof state:
R : Type u_1
A : Type u_2
M : Type u_3
inst✝⁶ : CommSemiring R
inst✝⁵ : CommSemiring A
inst✝⁴ : Algebra R A
inst✝³ : AddCommMonoid M
inst✝² : Module A M
inst✝¹ : Module R M
inst✝ : IsScalarTower R A M
d : Derivation R A M
a : A
⊢ ∀ (r : R) (x : R[X]),
    AddHom.toFun
        { toFun := fun f => (AEval.of R M a) (d ((aeval a) f)),
          map_add' :=
            (_ :
              ∀ (a_1 a_2 : R[X]),
                (AEval.of R M a) (d ((aeval a) (a_1 + a_2))) =
                  (AEval.of R M a) (d ((aeval a) a_1)) + (AEval.of R M a) (d ((aeval a) a_2))) }
        (r • x) =
      (RingHom.id R) r •
        AddHom.toFun
          { toFun := fun f => (AEval.of R M a) (d ((aeval a) f)),
            map_add' :=
              (_ :
                ∀ (a_1 a_2 : R[X]),
                  (AEval.of R M a) (d ((aeval a) (a_1 + a_2))) =
                    (AEval.of R M a) (d ((aeval a) a_1)) + (AEval.of R M a) (d ((aeval a) a_2))) }
          x

Next tactic:
simp
/--
For a derivation `d : A → M` and an element `a : A`, `d.compAEval a` is the
derivation of `R[X]` which takes a polynomial `f` to `d(aeval a f)`.

This derivation takes values in `Module.AEval R M a`, which is `M`, regarded as an
`R[X]`-module, with the action of a polynomial `f` defined by `f • m = (aeval a f) • m`.
-/
/-
Note: `compAEval` is not defined using `Derivation.compAlgebraMap`.
This because `A` is not an `R[X]` algebra and it would be messy to create an algebra instance
within the definition.
-/
@[simps]
def compAEval : Derivation R R[X] <| AEval R M a where
  toFun f          := AEval.of R M a (d (aeval a f))
  map_add'         := by simp
  map_smul'        := by simp
  leibniz'         := by simp [AEval.of_aeval_smul]
  map_one_eq_zero' := by 

Proof state:
R : Type u_1
A : Type u_2
M : Type u_3
inst✝⁶ : CommSemiring R
inst✝⁵ : CommSemiring A
inst✝⁴ : Algebra R A
inst✝³ : AddCommMonoid M
inst✝² : Module A M
inst✝¹ : Module R M
inst✝ : IsScalarTower R A M
d : Derivation R A M
a : A
⊢ {
        toAddHom :=
          { toFun := fun f => (AEval.of R M a) (d ((aeval a) f)),
            map_add' :=
              (_ :
                ∀ (a_1 a_2 : R[X]),
                  (AEval.of R M a) (d ((aeval a) (a_1 + a_2))) =
                    (AEval.of R M a) (d ((aeval a) a_1)) + (AEval.of R M a) (d ((aeval a) a_2))) },
        map_smul' :=
          (_ :
            ∀ (a_1 : R) (a_2 : R[X]),
              (AEval.of R M a) (d ((aeval a) (a_1 • a_2))) = a_1 • (AEval.of R M a) (d ((aeval a) a_2))) }
      1 =
    0

Next tactic:
simp