Update partialDeriv.lean

This commit is contained in:
Stefan Kebekus 2024-06-05 16:31:55 +02:00
parent 9c53bb793a
commit a15d473434
1 changed files with 65 additions and 0 deletions

View File

@ -226,6 +226,33 @@ lemma partialDeriv_fderivOn
· simp · simp
lemma partialDeriv_fderivAt
{z : E}
{f : E → F}
(hf : ContDiffAt 𝕜 2 f z)
(a b : E) :
fderiv 𝕜 (fderiv 𝕜 f) z b a = partialDeriv 𝕜 b (partialDeriv 𝕜 a f) z := by
unfold partialDeriv
rw [fderiv_clm_apply]
simp
-- DifferentiableAt 𝕜 (fun w => fderiv 𝕜 f w) z
obtain ⟨f', ⟨u, h₁u, h₂u⟩, hf' ⟩ := contDiffAt_succ_iff_hasFDerivAt.1 hf
have t₁ : (fun w ↦ fderiv 𝕜 f w) =ᶠ[nhds z] f' := by
apply Filter.eventuallyEq_iff_exists_mem.2
use u
constructor
· exact h₁u
· intro x hx
exact HasFDerivAt.fderiv (h₂u x hx)
rw [Filter.EventuallyEq.differentiableAt_iff t₁]
exact hf'.differentiableAt le_rfl
-- DifferentiableAt 𝕜 (fun w => a) z
exact differentiableAt_const a
theorem partialDeriv_eventuallyEq {f₁ f₂ : E → F} {x : E} (h : f₁ =ᶠ[nhds x] f₂) : ∀ v : E, partialDeriv 𝕜 v f₁ x = partialDeriv 𝕜 v f₂ x := by theorem partialDeriv_eventuallyEq {f₁ f₂ : E → F} {x : E} (h : f₁ =ᶠ[nhds x] f₂) : ∀ v : E, partialDeriv 𝕜 v f₁ x = partialDeriv 𝕜 v f₂ x := by
unfold partialDeriv unfold partialDeriv
rw [Filter.EventuallyEq.fderiv_eq h] rw [Filter.EventuallyEq.fderiv_eq h]
@ -356,3 +383,41 @@ theorem partialDeriv_commOn
rw [← partialDeriv_fderivOn hs h v₂ v₁ z hz] rw [← partialDeriv_fderivOn hs h v₂ v₁ z hz]
rw [derivSymm] rw [derivSymm]
rw [← partialDeriv_fderivOn hs h v₁ v₂ z hz] rw [← partialDeriv_fderivOn hs h v₁ v₂ z hz]
theorem partialDeriv_commAt
{E : Type*} [NormedAddCommGroup E] [NormedSpace E]
{F : Type*} [NormedAddCommGroup F] [NormedSpace F]
{z : E}
{f : E → F}
(h : ContDiffAt 2 f z) :
∀ v₁ v₂ : E, partialDeriv v₁ (partialDeriv v₂ f) z = partialDeriv v₂ (partialDeriv v₁ f) z := by
intro v₁ v₂
have derivSymm :
(fderiv (fun w => fderiv f w) z) v₁ v₂ = (fderiv (fun w => fderiv f w) z) v₂ v₁ := by
let f' := fderiv f
have h₀ : ∀ y ∈ s, HasFDerivAt f (f' y) y := by
intro y hy
apply DifferentiableAt.hasFDerivAt
apply DifferentiableOn.differentiableAt _ (IsOpen.mem_nhds hs hy)
apply h.differentiableOn one_le_two
let f'' := (fderiv f' z)
have h₁ : HasFDerivAt f' f'' z := by
apply DifferentiableAt.hasFDerivAt
apply DifferentiableOn.differentiableAt _ (IsOpen.mem_nhds hs hz)
apply ContDiffOn.differentiableOn _ (Submonoid.oneLE.proof_2 ℕ∞)
exact ((contDiffOn_succ_iff_fderiv_of_isOpen hs).1 h).2
have h₀' : ∀ᶠ (y : E) in nhds z, HasFDerivAt f (f' y) y := by
apply eventually_nhds_iff.mpr
use s
exact second_derivative_symmetric_of_eventually h₀' h₁ v₁ v₂
rw [← partialDeriv_fderivAt hs h v₂ v₁ z hz]
rw [derivSymm]
rw [← partialDeriv_fderivOn hs h v₁ v₂ z hz]