File size: 3,831 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | import Mathlib.Analysis.Calculus.FDeriv.Partial
import Mathlib.Analysis.Calculus.ContDiff.Comp
import Mathlib.Analysis.Calculus.ContDiff.Operations
namespace OAI
noncomputable section
open Set Filter
open scoped ContDiff Topology
namespace SmoothLocal.ODE
def jointDifferential (fx fy : β) : (β Γ β) βL[β] β :=
(ContinuousLinearMap.fst β β β).smulRight fx +
(ContinuousLinearMap.snd β β β).smulRight fy
theorem jointDifferential_eq_coprod (fx fy : β) :
jointDifferential fx fy =
(ContinuousLinearMap.toSpanSingleton β fx).coprod
(ContinuousLinearMap.toSpanSingleton β fy) := by
apply ContinuousLinearMap.ext
intro v
simp [jointDifferential]
theorem hasFDerivAt_of_continuous_partials
{s : Set (β Γ β)} (hs : IsOpen s) {f fx fy : (β Γ β) β β}
(hcx : ContinuousOn fx s) (hcy : ContinuousOn fy s)
(hdx : β p β s, HasDerivAt (fun x => f (x, p.2)) (fx p) p.1)
(hdy : β p β s, HasDerivAt (fun y => f (p.1, y)) (fy p) p.2)
{p : β Γ β} (hp : p β s) :
HasFDerivAt f (jointDifferential (fx p) (fy p)) p := by
have hspan : Continuous (ContinuousLinearMap.toSpanSingleton β :
β β (β βL[β] β)) :=
(ContinuousLinearMap.toSpanSingletonCLE (π := β) (E := β)).continuous
have hfirst : βαΆ q in π p,
HasFDerivAt (fun x => f (x, q.2))
(ContinuousLinearMap.toSpanSingleton β (fx q)) q.1 := by
filter_upwards [hs.mem_nhds hp] with q hq
exact (hdx q hq).hasFDerivAt
have hsecond : βαΆ q in π p,
HasFDerivAt (fun y => f (q.1, y))
(ContinuousLinearMap.toSpanSingleton β (fy q)) q.2 := by
filter_upwards [hs.mem_nhds hp] with q hq
exact (hdy q hq).hasFDerivAt
have hfull := hasStrictFDerivAt_uncurry_coprod (π := β)
(f := fun x y => f (x, y))
(fβ := fun x y => ContinuousLinearMap.toSpanSingleton β (fx (x, y)))
(fβ := fun x y => ContinuousLinearMap.toSpanSingleton β (fy (x, y)))
hfirst hsecond
(hspan.continuousAt.comp (hcx.continuousAt (hs.mem_nhds hp)))
(hspan.continuousAt.comp (hcy.continuousAt (hs.mem_nhds hp)))
rw [jointDifferential_eq_coprod]
exact hfull.hasFDerivAt
theorem joint_smooth_of_partial_derivative_sequence
{s : Set (β Γ β)} (hs : IsOpen s)
(H : β β β β (β Γ β) β β)
(hc : β i j, ContinuousOn (H i j) s)
(hdx : β i j p, p β s β
HasDerivAt (fun x => H i j (x, p.2)) (H (i + 1) j p) p.1)
(hdy : β i j p, p β s β
HasDerivAt (fun y => H i j (p.1, y)) (H i (j + 1) p) p.2) :
β i j, ContDiffOn β β (H i j) s := by
have hd (i j : β) (p : β Γ β) (hp : p β s) :
HasFDerivAt (H i j)
(jointDifferential (H (i + 1) j p) (H i (j + 1) p)) p :=
hasFDerivAt_of_continuous_partials hs (hc (i + 1) j) (hc i (j + 1))
(hdx i j) (hdy i j) hp
have hnat : β n : β, β i j, ContDiffOn β n (H i j) s := by
intro n
induction n with
| zero =>
intro i j
simpa only [Nat.cast_zero, contDiffOn_zero] using hc i j
| succ n hn =>
intro i j
have hnext : ContDiffOn β ((n : ββΟ) + 1) (H i j) s := by
rw [contDiffOn_succ_iff_fderiv_of_isOpen hs]
refine β¨fun p hp => (hd i j p hp).differentiableAt.differentiableWithinAt,
by simp, ?_β©
have hfield : ContDiffOn β n
(fun p => jointDifferential (H (i + 1) j p) (H i (j + 1) p)) s :=
(contDiffOn_const.smulRight (hn (i + 1) j)).add
(contDiffOn_const.smulRight (hn i (j + 1)))
exact hfield.congr (fun p hp => (hd i j p hp).fderiv)
simpa only [Nat.cast_add, Nat.cast_one] using hnext
intro i j
exact contDiffOn_infty.mpr (fun n => hnat n i j)
end SmoothLocal.ODE
end
end OAI
|