cfahlgren1's picture
download
raw
15.5 kB
import OAI.Analysis.LienardCycles.SmoothFlow
namespace OAI
universe uE
open Set Filter MeasureTheory
open scoped Topology ContDiff
open Set Filter Metric
open scoped Topology NNReal ContDiff Manifold
namespace QuinticLienard.GlobalODE
variable {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E]
theorem bounded_lipschitz_global_solution (V : E → E) {K L : ℝ≥0}
(hK : LipschitzWith K V) (hL : ∀ x, ‖V x‖ ≤ L) (x₀ : E) :
∃ u : ℝ → E, u 0 = x₀ ∧ ∀ t, HasDerivAt u (V (u t)) t := by
have hex (N : ℕ) : ∃ u : ℝ → E, u 0 = x₀ ∧
∀ t, |t| < (N:ℝ)+1 → HasDerivAt u (V (u t)) t := by
let T : ℝ := (N:ℝ)+1
have hT : 0 < T := by dsimp [T]; positivity
let t₀ : Icc (-T) T := ⟨0, by constructor <;> linarith⟩
have hpl : IsPicardLindelof (fun _ : ℝ => V) t₀ x₀ (L * (N+1)) 0 L K := by
constructor
· exact fun _ _ => hK.lipschitzOnWith
· exact fun _ _ => continuous_const.continuousOn
· exact fun _ _ x _ => hL x
· simp [t₀, T, mul_add]
obtain ⟨u,hu,hdu⟩ := hpl.exists_eq_forall_mem_Icc_hasDerivWithinAt₀
refine ⟨u,hu,fun t ht => ?_⟩
have ht' : t ∈ Ioo (-T) T := abs_lt.mp ht
exact (hdu t (Ioo_subset_Icc_self ht')).hasDerivAt (Icc_mem_nhds ht'.1 ht'.2)
choose u hu hdu using hex
have hmatch (N M : ℕ) {t : ℝ} (htN : |t| < (N:ℝ)+1) (htM : |t| < (M:ℝ)+1) :
u N t = u M t := by
let R : ℝ := min ((N:ℝ)+1) ((M:ℝ)+1)
have hR : 0 < R := lt_min (by positivity) (by positivity)
have hsubN {s : ℝ} (hs : s ∈ Ioo (-R) R) : |s| < (N:ℝ)+1 :=
(abs_lt.mpr hs).trans_le (min_le_left _ _)
have hsubM {s : ℝ} (hs : s ∈ Ioo (-R) R) : |s| < (M:ℝ)+1 :=
(abs_lt.mpr hs).trans_le (min_le_right _ _)
have he := ODE_solution_unique_of_mem_Ioo
(v := fun _ : ℝ => V) (s := fun _ => (Set.univ : Set E))
(fun _ _ => hK.lipschitzOnWith)
(show (0:ℝ) ∈ Ioo (-R) R by constructor <;> linarith)
(fun s hs => ⟨hdu N s (hsubN hs), mem_univ _⟩)
(fun s hs => ⟨hdu M s (hsubM hs), mem_univ _⟩)
(by rw [hu N, hu M])
exact he (abs_lt.mp (lt_min htN htM))
let U : ℝ → E := fun t => u ⌈|t|⌉₊ t
have hpoint (N : ℕ) {t : ℝ} (ht : |t| < (N:ℝ)+1) : U t = u N t := by
apply hmatch _ N _ ht
exact (Nat.le_ceil _).trans_lt (by linarith)
refine ⟨U,by simp [U,hu],fun t => ?_⟩
let N := ⌈|t|⌉₊
have ht : |t| < (N:ℝ)+1 := (Nat.le_ceil _).trans_lt (by linarith)
have hevent : U =ᶠ[𝓝 t] u N := by
filter_upwards [Ioo_mem_nhds (abs_lt.mp ht).1 (abs_lt.mp ht).2] with s hs
exact hpoint N (abs_lt.mpr hs)
rw [hpoint N ht]
exact (hdu N t ht).congr_of_eventuallyEq hevent
section Flow
variable (V : E → E) {K L : ℝ≥0} (hK : LipschitzWith K V) (hL : ∀ x, ‖V x‖ ≤ L)
noncomputable def flow (x : E) : ℝ → E :=
Classical.choose (bounded_lipschitz_global_solution V hK hL x)
@[simp] theorem flow_zero (x : E) : flow V hK hL x 0 = x :=
(Classical.choose_spec (bounded_lipschitz_global_solution V hK hL x)).1
theorem flow_deriv (x : E) (t : ℝ) :
HasDerivAt (flow V hK hL x) (V (flow V hK hL x t)) t :=
(Classical.choose_spec (bounded_lipschitz_global_solution V hK hL x)).2 t
theorem flow_unique {x : E} {u : ℝ → E} (hu : ∀ t, HasDerivAt u (V (u t)) t)
(h0 : u 0 = x) : u = flow V hK hL x := by
apply ODE_solution_unique_univ (v := fun _ : ℝ => V) (s := fun _ => Set.univ) (t₀ := 0)
· exact fun _ => hK.lipschitzOnWith
· exact fun t => ⟨hu t, mem_univ _⟩
· exact fun t => ⟨flow_deriv V hK hL x t, mem_univ _⟩
· simpa using h0
theorem flow_add (x : E) (s t : ℝ) :
flow V hK hL x (s+t) = flow V hK hL (flow V hK hL x s) t := by
have hu : ∀ t, HasDerivAt (fun t => flow V hK hL x (s+t))
(V (flow V hK hL x (s+t))) t := by
intro t
simpa [Function.comp_def] using (flow_deriv V hK hL x (s+t)).scomp t ((hasDerivAt_id t).const_add s)
exact congrFun (flow_unique V hK hL hu (by simp)) t
theorem flow_lipschitz_time (x : E) : LipschitzWith L (flow V hK hL x) := by
apply lipschitzWith_of_nnnorm_deriv_le
· exact fun t => (flow_deriv V hK hL x t).differentiableAt
· intro t
rw [(flow_deriv V hK hL x t).deriv]
exact_mod_cast hL (flow V hK hL x t)
theorem flow_dist_initial (x y : E) (t : ℝ) :
dist (flow V hK hL x t) (flow V hK hL y t) ≤ dist x y * Real.exp (K * |t|) := by
have hpos {W : E → E} (hW : LipschitzWith K W) {f g : ℝ → E}
(hf : ∀ s, HasDerivAt f (W (f s)) s) (hg : ∀ s, HasDerivAt g (W (g s)) s)
{t : ℝ} (ht : 0 ≤ t) : dist (f t) (g t) ≤ dist (f 0) (g 0) * Real.exp (K*t) := by
simpa using dist_le_of_trajectories_ODE (v := fun _ : ℝ => W)
(fun _ => hW) (fun z _ => (hf z).continuousAt.continuousWithinAt)
(fun z _ => (hf z).hasDerivWithinAt)
(fun z _ => (hg z).continuousAt.continuousWithinAt)
(fun z _ => (hg z).hasDerivWithinAt) (le_refl (dist (f 0) (g 0))) t ⟨ht,le_rfl⟩
rcases le_total 0 t with ht | ht
· simpa [abs_of_nonneg ht] using hpos hK (flow_deriv V hK hL x)
(flow_deriv V hK hL y) ht
· have hder (a : E) (s : ℝ) : HasDerivAt (fun s => flow V hK hL a (-s))
(-V (flow V hK hL a (-s))) s := by
simpa [Function.comp_def] using (flow_deriv V hK hL a (-s)).scomp s (hasDerivAt_id s).neg
simpa [abs_of_nonpos ht] using
hpos hK.neg (hder x) (hder y) (neg_nonneg.mpr ht)
theorem continuous_flow : Continuous (fun p : E × ℝ => flow V hK hL p.1 p.2) := by
rw [continuous_iff_continuousAt]
intro p
apply tendsto_iff_dist_tendsto_zero.mpr
have hbound (q : E × ℝ) : dist (flow V hK hL q.1 q.2) (flow V hK hL p.1 p.2) ≤
L * dist q.2 p.2 + dist q.1 p.1 * Real.exp (K * |p.2|) := by
calc
_ ≤ dist (flow V hK hL q.1 q.2) (flow V hK hL q.1 p.2) +
dist (flow V hK hL q.1 p.2) (flow V hK hL p.1 p.2) := dist_triangle _ _ _
_ ≤ _ := add_le_add ((flow_lipschitz_time V hK hL q.1).dist_le_mul _ _)
(flow_dist_initial V hK hL q.1 p.1 p.2)
apply squeeze_zero (fun _ => dist_nonneg) hbound
have hc : Continuous (fun q : E × ℝ =>
L * dist q.2 p.2 + dist q.1 p.1 * Real.exp (K * |p.2|)) := by fun_prop
simpa using hc.tendsto p
theorem local_family_eq (x₀ : E) (f : E × ℝ → E)
(hf : ∀ᶠ p in 𝓝 (x₀,(0:ℝ)), f (p.1,0) = p.1 ∧
HasDerivAt (fun t => f (p.1,t)) (V (f p)) p.2) :
f =ᶠ[𝓝 (x₀,(0:ℝ))] (fun p => flow V hK hL p.1 p.2) := by
obtain ⟨r,hr,hrf⟩ := Metric.mem_nhds_iff.mp hf
have he (x : E) (hx : dist x x₀ < r) (t : ℝ) (ht : |t| < r) :
f (x,t) = flow V hK hL x t := by
have hdo (s : ℝ) (hs : s ∈ Ioo (-r) r) := hrf
(show (x,s) ∈ ball (x₀,(0:ℝ)) r by
simpa only [mem_ball, Prod.dist_eq, Real.dist_eq, sub_zero, max_lt_iff]
using And.intro hx (abs_lt.mpr hs))
apply ODE_solution_unique_of_mem_Ioo
(v := fun _ : ℝ => V) (s := fun _ => Set.univ)
(fun _ _ => hK.lipschitzOnWith)
(show (0:ℝ) ∈ Ioo (-r) r by constructor <;> linarith)
(fun s hs => ⟨(hdo s hs).2, mem_univ _⟩)
(fun s _ => ⟨flow_deriv V hK hL x s, mem_univ _⟩)
(by simpa using (hdo 0 (by constructor <;> linarith)).1)
(abs_lt.mp ht)
filter_upwards [Metric.ball_mem_nhds (x₀,(0:ℝ)) hr] with p hp
have hp' : dist p.1 x₀ < r ∧ |p.2| < r := by
simpa only [mem_ball, Prod.dist_eq, Real.dist_eq, sub_zero, max_lt_iff] using hp
exact he p.1 hp'.1 p.2 hp'.2
theorem analytic_flow_on_trajectory (x : E) {I : Set ℝ} (hI : IsPreconnected I)
(h0 : 0 ∈ I)
(hloc : ∀ t ∈ I, ContDiffAt ℝ ω (fun p : E × ℝ => flow V hK hL p.1 p.2)
(flow V hK hL x t,0)) :
∀ t ∈ I, ContDiffAt ℝ ω (fun p : E × ℝ => flow V hK hL p.1 p.2) (x,t) := by
let F : E × ℝ → E := fun p => flow V hK hL p.1 p.2
let A : Set ℝ := {t | ContDiffAt ℝ ω F (x,t)}
have hA : IsOpen A := by
rw [isOpen_iff_mem_nhds]
intro t ht
change ContDiffAt ℝ ω F (x,t) at ht
have hc : ContinuousAt (fun s : ℝ => (x,s)) t := by fun_prop
exact hc.eventually ((ht : ContDiffAt ℝ ω F (x,t)).eventually (by simp))
have hA0 : (I ∩ A).Nonempty := by
refine ⟨0,h0,?_⟩
simpa [A,F] using hloc 0 h0
apply hI.subset_of_closure_inter_subset hA hA0
intro t ht
have hc : ContinuousAt (fun s : ℝ => (flow V hK hL x s,t-s)) t :=
((flow_lipschitz_time V hK hL x).continuous.continuousAt).prodMk
(continuousAt_const.sub continuousAt_id)
have he : ∀ᶠ s in 𝓝 t, ContDiffAt ℝ ω F (flow V hK hL x s,t-s) := by
apply hc.eventually
simpa only [sub_self] using (hloc t ht.2).eventually (by simp)
obtain ⟨s,hs,hsA⟩ := mem_closure_iff_nhds.mp ht.1 _ he
change ContDiffAt ℝ ω F (x,s) at hsA
have hslice : ContDiffAt ℝ ω (fun z : E => flow V hK hL z s) x :=
(hsA : ContDiffAt ℝ ω F (x,s)).comp x (contDiffAt_id.prodMk contDiffAt_const)
have hpair : ContDiffAt ℝ ω (fun p : E × ℝ => (flow V hK hL p.1 s,p.2-s)) (x,t) :=
(hslice.comp (x,t) contDiffAt_fst).prodMk (contDiffAt_snd.sub contDiffAt_const)
change ContDiffAt ℝ ω F (flow V hK hL x s,t-s) at hs
have ht' := hs.comp (x,t) hpair
change ContDiffAt ℝ ω F (x,t)
convert ht' using 1
ext p
simp only [F, Function.comp_def]
rw [← flow_add V hK hL p.1 s (p.2-s)]
congr 1
ring
end Flow
omit [CompleteSpace E] in
theorem exists_bounded_lipschitz_cutoff [FiniteDimensional ℝ E] (V : E → E)
(hV : ContDiff ℝ 1 V) (r : ℝ) :
∃ (W : E → E) (K L : ℝ≥0), LipschitzWith K W ∧ (∀ x, ‖W x‖ ≤ L) ∧
EqOn W V (closedBall 0 r) := by
let b : ContDiffBump (0 : E) := ⟨max r 0 + 1,max r 0 + 2,
by positivity,by linarith⟩
let W : E → E := fun x => b x • V x
have hs : HasCompactSupport W := b.hasCompactSupport.smul_right
have hd : ContDiff ℝ 1 W := b.contDiff.smul hV
obtain ⟨K,hK⟩ := hd.lipschitzWith_of_hasCompactSupport hs (by norm_num)
obtain ⟨L,hL⟩ := hs.exists_bound_of_continuous hd.continuous
refine ⟨W,K,⟨max L 0,le_max_right _ _⟩,hK,fun x => (hL x).trans (le_max_left _ _),?_⟩
intro x hx
have hb : b x = 1 := b.one_of_mem_closedBall (closedBall_subset_closedBall
(show r ≤ b.rIn by dsimp [b]; exact (le_max_left _ _).trans (by linarith)) hx)
simp [W,hb]
omit [CompleteSpace E] in
theorem exists_bounded_lipschitz_cutoff_on [FiniteDimensional ℝ E]
(V : E → E) {s U : Set E} (hs : IsCompact s) (hU : IsOpen U)
(hsub : s ⊆ U) (hV : ContDiffOn ℝ 1 V U) :
∃ (W : E → E) (K L : ℝ≥0), LipschitzWith K W ∧ (∀ x, ‖W x‖ ≤ L) ∧
∀ x ∈ s, W =ᶠ[𝓝 x] V := by
obtain ⟨f,hf0,hf1,_⟩ := exists_contMDiffMap_zero_one_nhds_of_isClosed
(𝓘(ℝ,E)) (n := 1) hU.isClosed_compl hs.isClosed
(disjoint_compl_left_iff.mpr hsub)
have hfd : ContDiff ℝ 1 (fun x => f x) := contMDiff_iff_contDiff.mp f.contMDiff
obtain ⟨r,hr⟩ := hs.isBounded.subset_closedBall (0:E)
let b : ContDiffBump (0:E) := ⟨max r 0+1,max r 0+2,by positivity,by linarith⟩
let W : E → E := fun x => b x • (f x • V x)
have hWd : ContDiff ℝ 1 W := by
apply contDiff_iff_contDiffAt.mpr
intro x
by_cases hx : x ∈ U
· exact b.contDiff.contDiffAt.smul (hfd.contDiffAt.smul
(hV.contDiffAt (hU.mem_nhds hx)))
· apply (contDiffAt_const (c := (0:E))).congr_of_eventuallyEq
filter_upwards [hf0.filter_mono (nhds_le_nhdsSet hx)] with y hy
simp [W,hy]
have hWs : HasCompactSupport W := b.hasCompactSupport.smul_right
obtain ⟨K,hK⟩ := hWd.lipschitzWith_of_hasCompactSupport hWs (by norm_num)
obtain ⟨L,hL⟩ := hWs.exists_bound_of_continuous hWd.continuous
refine ⟨W,K,⟨max L 0,le_max_right _ _⟩,hK,
fun x => (hL x).trans (le_max_left _ _),?_⟩
intro x hx
have hb : (fun y => b y) =ᶠ[𝓝 x] 1 := b.eventuallyEq_one_of_mem_ball (by
have hx' := hr hx
change dist x 0 ≤ r at hx'
change dist x 0 < max r 0+1
exact hx'.trans_lt ((le_max_left _ _).trans_lt (by linarith)))
filter_upwards [hb,hf1.filter_mono (nhds_le_nhdsSet hx)] with y hy hy'
simp [W,hy,hy']
theorem analytic_family_along_compact_solution [FiniteDimensional ℝ E]
(V : E → E) {U : Set E} (hU : IsOpen U) (hV : ContDiffOn ℝ 1 V U)
(hloc : ∀ x ∈ U, ∃ f : E × ℝ → E, ContDiffAt ℝ ω f (x,0) ∧
∀ᶠ p in 𝓝 (x,(0:ℝ)), f (p.1,0) = p.1 ∧
HasDerivAt (fun t => f (p.1,t)) (V (f p)) p.2)
{γ : ℝ → E} {a b c : ℝ} (ha : a < c) (hb : c < b)
(hγ : Continuous γ) (hγU : ∀ y ∈ Icc a b, γ y ∈ U)
(hγd : ∀ y ∈ Icc a b, HasDerivAt γ (V (γ y)) y) :
∃ f : E × ℝ → E, Continuous f ∧ (∀ x, f (x,0) = x) ∧
(∀ y ∈ Icc a b, f (γ c,y-c) = γ y) ∧
(∀ y ∈ Icc a b, ContDiffAt ℝ ω f (γ c,y-c)) ∧
∀ y ∈ Icc a b, ∀ᶠ p in 𝓝 (γ c,y-c),
HasDerivAt (fun t => f (p.1,t)) (V (f p)) p.2 := by
obtain ⟨W,K,L,hK,hL,hW⟩ := exists_bounded_lipschitz_cutoff_on V
(isCompact_Icc.image hγ) hU (by rintro _ ⟨y,hy,rfl⟩; exact hγU y hy) hV
let f : E × ℝ → E := fun p => flow W hK hL p.1 p.2
have hmatch : ∀ y ∈ Icc a b, f (γ c,y-c) = γ y := by
apply ODE_solution_unique_of_mem_Icc
(v := fun _ => W) (s := fun _ => Set.univ) (K := K)
(fun _ _ => hK.lipschitzOnWith) ⟨ha,hb⟩
((continuous_flow W hK hL).comp (by fun_prop)).continuousOn
_ (fun _ _ => mem_univ _) hγ.continuousOn _ (fun _ _ => mem_univ _)
(by simp)
· intro y _
simpa [f,Function.comp_def] using
(flow_deriv W hK hL (γ c) (y-c)).scomp y ((hasDerivAt_id y).sub_const c)
· intro y hy
rw [(hW (γ y) ⟨y,Ioo_subset_Icc_self hy,rfl⟩).self_of_nhds]
exact hγd y (Ioo_subset_Icc_self hy)
have hlocalW (y : ℝ) (hy : y ∈ Icc a b) :
ContDiffAt ℝ ω f (γ y,0) := by
obtain ⟨g,hgd,hge⟩ := hloc (γ y) (hγU y hy)
have hg0 : g (γ y,0) = γ y := hge.self_of_nhds.1
have heV : ∀ᶠ p in 𝓝 (γ y,(0:ℝ)), W (g p) = V (g p) := by
have ht := hgd.continuousAt.tendsto
rw [hg0] at ht
exact ht.eventually (hW (γ y) ⟨y,hy,rfl⟩)
have heq : g =ᶠ[𝓝 (γ y,(0:ℝ))] f := by
apply local_family_eq W hK hL (γ y) g
filter_upwards [hge,heV] with p hp hp'
exact ⟨hp.1,hp' ▸ hp.2⟩
exact hgd.congr_of_eventuallyEq heq.symm
have hd : ∀ y ∈ Icc a b, ContDiffAt ℝ ω f (γ c,y-c) := by
have hh := analytic_flow_on_trajectory W hK hL (γ c)
(I := Icc (a-c) (b-c)) isPreconnected_Icc
(show (0:ℝ) ∈ Icc (a-c) (b-c) by constructor <;> linarith)
(fun s hs => by
have hs' : s+c ∈ Icc a b := by constructor <;> linarith [hs.1,hs.2]
have heq : flow W hK hL (γ c) s = γ (s+c) := by
simpa [f] using hmatch (s+c) hs'
rw [heq]
exact hlocalW (s+c) hs')
exact fun y hy => hh (y-c) (by constructor <;> linarith [hy.1,hy.2])
refine ⟨f,continuous_flow W hK hL,fun x => flow_zero W hK hL x,hmatch,hd,?_⟩
intro y hy
have hfc : Tendsto f (𝓝 (γ c,y-c)) (𝓝 (γ y)) := by
have hc : ContinuousAt f (γ c,y-c) := (continuous_flow W hK hL).continuousAt
simpa only [hmatch y hy] using hc.tendsto
filter_upwards [hfc.eventually (hW (γ y) ⟨y,hy,rfl⟩)] with p hp
rw [←hp]
exact flow_deriv W hK hL p.1 p.2
end QuinticLienard.GlobalODE
end OAI

Xet Storage Details

Size:
15.5 kB
·
Xet hash:
ee6487a0d9b1a611dbb6a1d251d1b461da936df178ce1d3bb6abae2d6562fda5

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.