Update partialDeriv.lean

This commit is contained in:
Stefan Kebekus 2024-05-07 17:32:41 +02:00
parent e45017277a
commit 6061fa4279
1 changed files with 13 additions and 11 deletions

View File

@ -9,13 +9,15 @@ import Mathlib.Analysis.Calculus.FDeriv.Comp
import Mathlib.Analysis.Calculus.FDeriv.Linear import Mathlib.Analysis.Calculus.FDeriv.Linear
import Mathlib.Analysis.Calculus.FDeriv.Symmetric import Mathlib.Analysis.Calculus.FDeriv.Symmetric
variable {𝕜 : Type*} [NontriviallyNormedField 𝕜]
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace E]
variable {F : Type*} [NormedAddCommGroup F] [NormedSpace F]
noncomputable def Real.partialDeriv : → () → () := noncomputable def Real.partialDeriv : E → (E → F) → (E → F) :=
fun v ↦ (fun f ↦ (fun w ↦ fderiv f w v)) fun v ↦ (fun f ↦ (fun w ↦ fderiv f w v))
theorem partialDeriv_smul₁ {f : E → F} {a : } {v : E} : Real.partialDeriv (a • v) f = a • Real.partialDeriv v f := by
theorem partialDeriv_smul₁ {f : } {a : } {v : } : Real.partialDeriv (a • v) f = a • Real.partialDeriv v f := by
unfold Real.partialDeriv unfold Real.partialDeriv
conv => conv =>
left left
@ -23,7 +25,7 @@ theorem partialDeriv_smul₁ {f : } {a : } {v : } : Real.partia
rw [map_smul] rw [map_smul]
theorem partialDeriv_add₁ {f : } {v₁ v₂ : } : Real.partialDeriv (v₁ + v₂) f = (Real.partialDeriv v₁ f) + (Real.partialDeriv v₂ f) := by theorem partialDeriv_add₁ {f : E → F} {v₁ v₂ : E} : Real.partialDeriv (v₁ + v₂) f = (Real.partialDeriv v₁ f) + (Real.partialDeriv v₂ f) := by
unfold Real.partialDeriv unfold Real.partialDeriv
conv => conv =>
left left
@ -31,7 +33,7 @@ theorem partialDeriv_add₁ {f : } {v₁ v₂ : } : Real.partialDe
rw [map_add] rw [map_add]
theorem partialDeriv_smul₂ {f : } {a v : } (h : Differentiable f) : Real.partialDeriv v (a • f) = a • Real.partialDeriv v f := by theorem partialDeriv_smul₂ {f : E → F} {a : } {v : E} (h : Differentiable f) : Real.partialDeriv v (a • f) = a • Real.partialDeriv v f := by
unfold Real.partialDeriv unfold Real.partialDeriv
have : a • f = fun y ↦ a • f y := by rfl have : a • f = fun y ↦ a • f y := by rfl
@ -43,7 +45,7 @@ theorem partialDeriv_smul₂ {f : } {a v : } (h : Differentiable
rw [fderiv_const_smul (h w)] rw [fderiv_const_smul (h w)]
theorem partialDeriv_add₂ {f₁ f₂ : } {v : } (h₁ : Differentiable f₁) (h₂ : Differentiable f₂) : Real.partialDeriv v (f₁ + f₂) = (Real.partialDeriv v f₁) + (Real.partialDeriv v f₂) := by theorem partialDeriv_add₂ {f₁ f₂ : E → F} {v : E} (h₁ : Differentiable f₁) (h₂ : Differentiable f₂) : Real.partialDeriv v (f₁ + f₂) = (Real.partialDeriv v f₁) + (Real.partialDeriv v f₂) := by
unfold Real.partialDeriv unfold Real.partialDeriv
have : f₁ + f₂ = fun y ↦ f₁ y + f₂ y := by rfl have : f₁ + f₂ = fun y ↦ f₁ y + f₂ y := by rfl
@ -55,7 +57,7 @@ theorem partialDeriv_add₂ {f₁ f₂ : } {v : } (h₁ : Differen
rw [fderiv_add (h₁ w) (h₂ w)] rw [fderiv_add (h₁ w) (h₂ w)]
theorem partialDeriv_compContLin {f : } {l : →L[] } {v : } (h : Differentiable f) : Real.partialDeriv v (l ∘ f) = l ∘ Real.partialDeriv v f := by theorem partialDeriv_compContLin {f : E → F} {l : F →L[] F} {v : E} (h : Differentiable f) : Real.partialDeriv v (l ∘ f) = l ∘ Real.partialDeriv v f := by
unfold Real.partialDeriv unfold Real.partialDeriv
conv => conv =>
@ -67,7 +69,7 @@ theorem partialDeriv_compContLin {f : } {l : →L[] } {v :
rfl rfl
theorem partialDeriv_contDiff {n : } {f : } (h : ContDiff (n + 1) f) : ∀ v : , ContDiff n (Real.partialDeriv v f) := by theorem partialDeriv_contDiff {n : } {f : E → F} (h : ContDiff (n + 1) f) : ∀ v : E, ContDiff n (Real.partialDeriv v f) := by
unfold Real.partialDeriv unfold Real.partialDeriv
intro v intro v
@ -85,7 +87,7 @@ theorem partialDeriv_contDiff {n : } {f : } (h : ContDiff (n +
exact contDiff_const exact contDiff_const
lemma partialDeriv_fderiv {f : } (hf : ContDiff 2 f) (z a b : ) : lemma partialDeriv_fderiv {f : E → F} (hf : ContDiff 2 f) (z a b : E) :
fderiv (fderiv f) z b a = Real.partialDeriv b (Real.partialDeriv a f) z := by fderiv (fderiv f) z b a = Real.partialDeriv b (Real.partialDeriv a f) z := by
unfold Real.partialDeriv unfold Real.partialDeriv
@ -95,8 +97,8 @@ lemma partialDeriv_fderiv {f : } (hf : ContDiff 2 f) (z a b :
· simp · simp
theorem partialDeriv_comm {f : } (h : ContDiff 2 f) : theorem partialDeriv_comm {f : E → F} (h : ContDiff 2 f) :
∀ v₁ v₂ : , Real.partialDeriv v₁ (Real.partialDeriv v₂ f) = Real.partialDeriv v₂ (Real.partialDeriv v₁ f) := by ∀ v₁ v₂ : E, Real.partialDeriv v₁ (Real.partialDeriv v₂ f) = Real.partialDeriv v₂ (Real.partialDeriv v₁ f) := by
intro v₁ v₂ intro v₁ v₂
funext z funext z