import Mathlib import OAI.Geometry.BallPacking.Flows.AnnularPathGerms namespace OAI noncomputable section namespace PackingSufficiencySupport.Hamiltonian section open scoped ContDiff Manifold Topology open Set Function Manifold variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {M : Type*} [TopologicalSpace M] [ChartedSpace E M] [IsManifold π“˜(ℝ,E) ∞ M] def manifoldPullback (Ξ¦ : ℝ Γ— M β†’ M) (Ξ© : ℝ β†’ ManifoldTwoForm E M) (t : ℝ) (x : M) : E β†’L[ℝ] E β†’L[ℝ] ℝ := (Ξ© t (Ξ¦ (t,x))).bilinearComp (preferredDifferential (E := E) (fun y => Ξ¦ (t,y)) x) (preferredDifferential (E := E) (fun y => Ξ¦ (t,y)) x) theorem manifold_form_transport_derivative {Ξ¦ : ℝ Γ— M β†’ M} {V : (p : ℝ Γ— M) β†’ TangentSpace π“˜(ℝ,E) p.2} (hΞ¦ : ContMDiff ((π“˜(ℝ,ℝ)).prod π“˜(ℝ,E)) π“˜(ℝ,E) ∞ Ξ¦) (hV : ContMDiff ((π“˜(ℝ,ℝ)).prod π“˜(ℝ,E)) (π“˜(ℝ,E)).tangent ∞ (fun p => (⟨p.2,V p⟩ : TangentBundle π“˜(ℝ,E) M))) {U : Set ℝ} (hU : IsOpen U) (hflow : βˆ€ x s, s ∈ U β†’ HasMFDerivAt π“˜(ℝ,ℝ) π“˜(ℝ,E) (fun r => Ξ¦ (r,x)) s ((1 : ℝ β†’L[ℝ] ℝ).smulRight (V (s,Ξ¦ (s,x))))) {Ξ© : ℝ β†’ ManifoldTwoForm E M} (hΞ© : βˆ€ c, ContDiffOn ℝ ∞ (fun q : ℝ Γ— E => chartTwoForm (Ξ© q.1) c q.2) (univ Γ—Λ’ (extChartAt π“˜(ℝ,E) c).target)) {t : ℝ} (ht : t ∈ U) (hPDE : βˆ€ c y, y ∈ (extChartAt π“˜(ℝ,E) c).target β†’ βˆ€ u w, fderiv ℝ (fun q : ℝ Γ— E => chartTwoForm (Ξ© q.1) c q.2) (t,y) (1,timeChartField V c (t,y)) u w + chartTwoForm (Ξ© t) c y (fderiv ℝ (timeChartField V c) (t,y) (0,u)) w + chartTwoForm (Ξ© t) c y u (fderiv ℝ (timeChartField V c) (t,y) (0,w)) = 0) (x : M) (v w : E) : HasDerivAt (fun s => manifoldPullback Ξ¦ Ξ© s x v w) 0 t := by let a := extChartAt π“˜(ℝ,E) x let c := Ξ¦ (t,x) let b := extChartAt π“˜(ℝ,E) c let p : ℝ Γ— E := (t,a x) let H : ℝ Γ— E β†’ M := fun q => Ξ¦ (q.1,a.symm q.2) let F : ℝ Γ— E β†’ E := b ∘ H have hx : x ∈ a.source := mem_extChartAt_source x have hy : a x ∈ a.target := a.map_source hx have hcx : Ξ¦ (t,x) ∈ b.source := mem_extChartAt_source c have hH : H p = Ξ¦ (t,x) := by dsimp [H,p]; rw [a.left_inv hx] have hc : H p ∈ b.source := hH β–Έ hcx have hi : ContMDiffAt π“˜(ℝ,E) π“˜(ℝ,E) ∞ a.symm (a x) := (contMDiffOn_extChartAt_symm (I := π“˜(ℝ,E)) (n := ∞) x).contMDiffAt ((isOpen_extChartAt_target (I := π“˜(ℝ,E)) x).mem_nhds hy) have hHs : ContMDiffAt π“˜(ℝ,ℝ Γ— E) π“˜(ℝ,E) ∞ H p := hΞ¦.contMDiffAt.comp p (contDiffAt_fst.contMDiffAt.prodMk (hi.comp p contDiffAt_snd.contMDiffAt)) have hFc : ContDiffAt ℝ ∞ F p := manifoldFamily_coordinate_smoothAt hΞ¦ hy hc have hbc : F p ∈ b.target := b.map_source hc have hn : (univ Γ—Λ’ b.target) ∈ 𝓝 (t,F p) := (isOpen_univ.prod (isOpen_extChartAt_target (I := π“˜(ℝ,E)) c)).mem_nhds ⟨mem_univ _,hbc⟩ have hX := ((timeChartField_contDiffOn hV c).contDiffAt hn).differentiableAt (by simp) have hO := ((hΞ© c).contDiffAt hn).differentiableAt (by simp) have hflowc : βˆ€αΆ  q in 𝓝 p, HasDerivAt (fun s => F (s,q.2)) (timeChartField V c (q.1,F q)) q.1 := by have hneigh := hHs.continuousAt.preimage_mem_nhds ((isOpen_extChartAt_source (I := π“˜(ℝ,E)) c).mem_nhds hc) have htime : βˆ€αΆ  q in 𝓝 p, q.1 ∈ U := continuousAt_fst.preimage_mem_nhds (hU.mem_nhds ht) filter_upwards [hneigh,htime] with q hq hqt exact timeChartField_hasDerivAt (hflow (a.symm q.2) q.1 hqt) hq have hd := local_flow_form_derivative hFc hX hflowc hO (hPDE c (F p) hbc) v w apply hd.congr_of_eventuallyEq have hΞ¦t : ContinuousAt (fun s => Ξ¦ (s,x)) t := hΞ¦.continuous.continuousAt.comp (continuousAt_id.prodMk continuousAt_const) filter_upwards [hΞ¦t.preimage_mem_nhds ((isOpen_extChartAt_source (I := π“˜(ℝ,E)) c).mem_nhds hcx)] with s hs have hfs : MDifferentiableAt π“˜(ℝ,E) π“˜(ℝ,E) (fun y => Ξ¦ (s,y)) x := (hΞ¦.comp (contMDiff_const.prodMk contMDiff_id)).mdifferentiable (by simp) x have he := chart_spatial_pullback hfs hs (Ξ© s) v w dsimp only [F,H,p,Function.comp_apply] rw [a.left_inv hx] exact he.symm omit [IsManifold π“˜(ℝ,E) ∞ M] in theorem manifold_form_transport_constant {Ξ¦ : ℝ Γ— M β†’ M} {Ξ© : ℝ β†’ ManifoldTwoForm E M} (hd : βˆ€ t ∈ Icc (0:ℝ) 1, βˆ€ x v w, HasDerivAt (fun s => manifoldPullback Ξ¦ Ξ© s x v w) 0 t) {t : ℝ} (ht : t ∈ Icc (0:ℝ) 1) (x : M) (v w : E) : manifoldPullback Ξ¦ Ξ© t x v w = manifoldPullback Ξ¦ Ξ© 0 x v w := by have he := (convex_Icc (0:ℝ) 1).norm_image_sub_le_of_norm_hasDerivWithin_le (fun s hs => (hd s hs x v w).hasDerivWithinAt) (fun s hs => (by simp : β€–(0:ℝ)β€– ≀ (0:ℝ))) (show (0:ℝ) ∈ Icc (0:ℝ) 1 by norm_num) ht simpa only [zero_mul,norm_le_zero_iff,sub_eq_zero] using he theorem local_manifold_form_transport_derivative {Ξ¦ : ℝ Γ— M β†’ M} {V : (p : ℝ Γ— M) β†’ TangentSpace π“˜(ℝ,E) p.2} (hΞ¦ : ContMDiff ((π“˜(ℝ,ℝ)).prod π“˜(ℝ,E)) π“˜(ℝ,E) ∞ Ξ¦) (hV : ContMDiff ((π“˜(ℝ,ℝ)).prod π“˜(ℝ,E)) (π“˜(ℝ,E)).tangent ∞ (fun p => (⟨p.2,V p⟩ : TangentBundle π“˜(ℝ,E) M))) {U : Set ℝ} (hU : IsOpen U) (hflow : βˆ€ x s, s ∈ U β†’ HasMFDerivAt π“˜(ℝ,ℝ) π“˜(ℝ,E) (fun r => Ξ¦ (r,x)) s ((1 : ℝ β†’L[ℝ] ℝ).smulRight (V (s,Ξ¦ (s,x))))) {Ξ© : ℝ β†’ ManifoldTwoForm E M} (hΞ© : βˆ€ c, ContDiffOn ℝ ∞ (fun q : ℝ Γ— E => chartTwoForm (Ξ© q.1) c q.2) (univ Γ—Λ’ (extChartAt π“˜(ℝ,E) c).target)) {t : ℝ} (ht : t ∈ U) (x : M) (hPDE : βˆ€ c y, y ∈ (extChartAt π“˜(ℝ,E) c).target β†’ (extChartAt π“˜(ℝ,E) c).symm y=Ξ¦ (t,x) β†’ βˆ€ u w, fderiv ℝ (fun q : ℝ Γ— E => chartTwoForm (Ξ© q.1) c q.2) (t,y) (1,timeChartField V c (t,y)) u w + chartTwoForm (Ξ© t) c y (fderiv ℝ (timeChartField V c) (t,y) (0,u)) w + chartTwoForm (Ξ© t) c y u (fderiv ℝ (timeChartField V c) (t,y) (0,w)) = 0) (v w : E) : HasDerivAt (fun s => manifoldPullback Ξ¦ Ξ© s x v w) 0 t := by let a := extChartAt π“˜(ℝ,E) x let c := Ξ¦ (t,x) let b := extChartAt π“˜(ℝ,E) c let p : ℝ Γ— E := (t,a x) let H : ℝ Γ— E β†’ M := fun q => Ξ¦ (q.1,a.symm q.2) let F : ℝ Γ— E β†’ E := b ∘ H have hx : x ∈ a.source := mem_extChartAt_source x have hy : a x ∈ a.target := a.map_source hx have hcx : Ξ¦ (t,x) ∈ b.source := mem_extChartAt_source c have hH : H p = Ξ¦ (t,x) := by dsimp [H,p]; rw [a.left_inv hx] have hc : H p ∈ b.source := hH β–Έ hcx have hi : ContMDiffAt π“˜(ℝ,E) π“˜(ℝ,E) ∞ a.symm (a x) := (contMDiffOn_extChartAt_symm (I := π“˜(ℝ,E)) (n := ∞) x).contMDiffAt ((isOpen_extChartAt_target (I := π“˜(ℝ,E)) x).mem_nhds hy) have hHs : ContMDiffAt π“˜(ℝ,ℝ Γ— E) π“˜(ℝ,E) ∞ H p := hΞ¦.contMDiffAt.comp p (contDiffAt_fst.contMDiffAt.prodMk (hi.comp p contDiffAt_snd.contMDiffAt)) have hFc : ContDiffAt ℝ ∞ F p := manifoldFamily_coordinate_smoothAt hΞ¦ hy hc have hbc : F p ∈ b.target := b.map_source hc have hn : (univ Γ—Λ’ b.target) ∈ 𝓝 (t,F p) := (isOpen_univ.prod (isOpen_extChartAt_target (I := π“˜(ℝ,E)) c)).mem_nhds ⟨mem_univ _,hbc⟩ have hX := ((timeChartField_contDiffOn hV c).contDiffAt hn).differentiableAt (by simp) have hO := ((hΞ© c).contDiffAt hn).differentiableAt (by simp) have hflowc : βˆ€αΆ  q in 𝓝 p, HasDerivAt (fun s => F (s,q.2)) (timeChartField V c (q.1,F q)) q.1 := by have hneigh := hHs.continuousAt.preimage_mem_nhds ((isOpen_extChartAt_source (I := π“˜(ℝ,E)) c).mem_nhds hc) have htime : βˆ€αΆ  q in 𝓝 p, q.1 ∈ U := continuousAt_fst.preimage_mem_nhds (hU.mem_nhds ht) filter_upwards [hneigh,htime] with q hq hqt exact timeChartField_hasDerivAt (hflow (a.symm q.2) q.1 hqt) hq have hd := local_flow_form_derivative hFc hX hflowc hO (hPDE c (F p) hbc ((b.left_inv hc).trans hH)) v w apply hd.congr_of_eventuallyEq have hΞ¦t : ContinuousAt (fun s => Ξ¦ (s,x)) t := hΞ¦.continuous.continuousAt.comp (continuousAt_id.prodMk continuousAt_const) filter_upwards [hΞ¦t.preimage_mem_nhds ((isOpen_extChartAt_source (I := π“˜(ℝ,E)) c).mem_nhds hcx)] with s hs have hfs : MDifferentiableAt π“˜(ℝ,E) π“˜(ℝ,E) (fun y => Ξ¦ (s,y)) x := (hΞ¦.comp (contMDiff_const.prodMk contMDiff_id)).mdifferentiable (by simp) x have he := chart_spatial_pullback hfs hs (Ξ© s) v w dsimp only [F,H,p,Function.comp_apply] rw [a.left_inv hx] exact he.symm end section open scoped ContDiff Manifold Topology open Set Function Manifold variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {M : Type*} [TopologicalSpace M] [ChartedSpace E M] theorem manifoldMoserField_moment_tangent {Ξ© : ℝ β†’ ManifoldTwoForm E M} {Ξ± : ℝ β†’ ManifoldOneForm E M} {p : ℝ Γ— M} (hinv : (Ξ© p.1 p.2).IsInvertible) (hskew : βˆ€ u v, Ξ© p.1 p.2 u v = -Ξ© p.1 p.2 v u) (L : E β†’L[ℝ] ℝ) (Z : E) (hface : Ξ© p.1 p.2 Z = -L) (hhor : Ξ± p.1 p.2 Z=0) : L (manifoldMoserField Ξ© Ξ± p)=0 := by let v : E := manifoldMoserField Ξ© Ξ± p change L v = 0 have hs : Ξ© p.1 p.2 v = -Ξ± p.1 p.2 := by simp only [v,manifoldMoserField,map_neg,hinv.self_apply_inverse] have hh := congrArg (fun A : E β†’L[ℝ] ℝ => A Z) hs have hz := congrArg (fun A : E β†’L[ℝ] ℝ => A v) hface simp only [neg_apply,hhor,neg_zero] at hh simp only [neg_apply] at hz rw [hskew] at hh linarith end section open scoped ContDiff Manifold Topology open Set Function Manifold variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {M : Type*} [TopologicalSpace M] [ChartedSpace E M] [IsManifold π“˜(ℝ,E) ∞ M] def chartField (v : (x : M) β†’ TangentSpace π“˜(ℝ,E) x) (x : M) (y : E) : E := let z := (extChartAt π“˜(ℝ,E) x).symm y tangentCoordChange π“˜(ℝ,E) z x z (v z) theorem chartField_smoothOn {v : (x : M) β†’ TangentSpace π“˜(ℝ,E) x} (hv : ContMDiff π“˜(ℝ,E) (π“˜(ℝ,E)).tangent ∞ (fun x => (⟨x,v x⟩ : TangentBundle π“˜(ℝ,E) M))) (x : M) : ContDiffOn ℝ ∞ (chartField v x) (extChartAt π“˜(ℝ,E) x).target := by have h := (contMDiff_iff.mp hv).2 x (⟨x,v x⟩ : TangentBundle π“˜(ℝ,E) M) have hh := h.snd change ContDiffOn ℝ ∞ (chartField v x) _ at hh apply hh.mono intro y hy refine ⟨hy,?_⟩ simp only [Set.mem_preimage, extChartAt_source, TangentBundle.mem_chart_source_iff] simpa only [extChartAt_source] using (extChartAt π“˜(ℝ,E) x).map_target hy theorem chartCurve_hasMFDerivAt {v : (z : M) β†’ TangentSpace π“˜(ℝ,E) z} (x : M) {f : ℝ β†’ E} {t : ℝ} (hf : f t ∈ (extChartAt π“˜(ℝ,E) x).target) (hd : HasDerivAt f (chartField v x (f t)) t) : HasMFDerivAt π“˜(ℝ,ℝ) π“˜(ℝ,E) ((extChartAt π“˜(ℝ,E) x).symm ∘ f) t ((1 : ℝ β†’L[ℝ] ℝ).smulRight (v ((extChartAt π“˜(ℝ,E) x).symm (f t)))) := by change M β†’ E at v let z : M := (extChartAt π“˜(ℝ,E) x).symm (f t) have hz : z ∈ (extChartAt π“˜(ℝ,E) x).source := (extChartAt π“˜(ℝ,E) x).map_target hf have hz' := mem_extChartAt_source (I := π“˜(ℝ,E)) z have hd' : HasDerivAt f (tangentCoordChange π“˜(ℝ,E) z x z (v z)) t := hd refine ⟨(continuousAt_extChartAt_symm'' hf).comp hd.continuousAt, HasDerivWithinAt.hasFDerivWithinAt ?_⟩ simp only [mfld_simps,hasDerivWithinAt_univ] change HasDerivAt ((extChartAt π“˜(ℝ,E) z ∘ (extChartAt π“˜(ℝ,E) x).symm) ∘ f) (v z) t rw [←tangentCoordChange_self (I := π“˜(ℝ,E)) (x := z) (z := z) (v := v z) hz', ←tangentCoordChange_comp (x := x) ⟨⟨hz',hz⟩,hz'⟩] apply HasFDerivAt.comp_hasDerivAt _ _ hd' apply HasFDerivWithinAt.hasFDerivAt (s := range π“˜(ℝ,E)) _ (by simp) rw [←(extChartAt π“˜(ℝ,E) x).right_inv hf] exact hasFDerivWithinAt_tangentCoordChange ⟨hz,hz'⟩ end section open scoped ContDiff Manifold Topology NNReal open Set Function Manifold variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] theorem exists_global_bounded_trajectory {X : E β†’ E} {L : ℝβ‰₯0} (hL : LipschitzWith L X) {B : ℝβ‰₯0} (hB : βˆ€ x, β€–X xβ€– ≀ B) (x : E) : βˆƒ Ξ³ : ℝ β†’ E, Ξ³ 0 = x ∧ βˆ€ t, HasDerivAt Ξ³ (X (Ξ³ t)) t := by have hex (a : ℝβ‰₯0) : βˆƒ Ξ³ : ℝ β†’ E, Ξ³ 0 = x ∧ βˆ€ t ∈ Icc (-(a:ℝ)) a, HasDerivWithinAt Ξ³ (X (Ξ³ t)) (Icc (-(a:ℝ)) a) t := by let tβ‚€ : Icc (-(a:ℝ)) a := ⟨0, neg_nonpos.mpr a.coe_nonneg, a.coe_nonneg⟩ have hp : IsPicardLindelof (fun _ : ℝ => X) tβ‚€ x (B*a) 0 B L := { lipschitzOnWith := fun _ _ => hL.lipschitzOnWith continuousOn := fun _ _ => continuousOn_const norm_le := fun _ _ y _ => hB y mul_max_le := by simp [tβ‚€] } exact hp.exists_eq_forall_mem_Icc_hasDerivWithinAtβ‚€ choose u hu0 hud using hex have heq {a b : ℝβ‰₯0} (hab : a ≀ b) : EqOn (u a) (u b) (Ioo (-(a:ℝ)) a) := by by_cases ha : a = 0 Β· simp [ha] Β· have ha' : (0:ℝ) < a := NNReal.coe_pos.mpr (pos_iff_ne_zero.mpr ha) apply ODE_solution_unique_of_mem_Ioo (s := fun _ => univ) (fun _ _ => hL.lipschitzOnWith) (tβ‚€ := 0) ⟨by linarith,ha'⟩ (fun t ht => ⟨(hud a t (Ioo_subset_Icc_self ht)).hasDerivAt (Icc_mem_nhds ht.1 ht.2),mem_univ _⟩) Β· intro t ht have ht' : t ∈ Ioo (-(b:ℝ)) b := by have hab' : (a:ℝ) ≀ b := hab constructor <;> linarith [ht.1,ht.2] exact ⟨(hud b t (Ioo_subset_Icc_self ht')).hasDerivAt (Icc_mem_nhds ht'.1 ht'.2),mem_univ _⟩ Β· rw [hu0 a,hu0 b] let Ξ³ : ℝ β†’ E := fun t => u (β€–tβ€–β‚Š+1) t have hmatch {a : ℝβ‰₯0} : EqOn Ξ³ (u a) (Ioo (-(a:ℝ)) a) := by intro t ht have ht' : t ∈ Ioo (-((β€–tβ€–β‚Š+1:ℝβ‰₯0):ℝ)) (β€–tβ€–β‚Š+1:ℝβ‰₯0) := by simp only [NNReal.coe_add,NNReal.coe_one,coe_nnnorm,Real.norm_eq_abs] exact abs_lt.mp (lt_add_one |t|) rcases le_total (β€–tβ€–β‚Š+1) a with h | h Β· exact heq h ht' Β· exact (heq h ht).symm refine ⟨γ,?_,?_⟩ Β· change u (β€–(0:ℝ)β€–β‚Š+1) 0 = x exact hu0 _ Β· intro t let a : ℝβ‰₯0 := β€–tβ€–β‚Š+1 have ht : t ∈ Ioo (-(a:ℝ)) a := by simpa only [a,NNReal.coe_add,NNReal.coe_one,coe_nnnorm,Real.norm_eq_abs,mem_Ioo] using abs_lt.mp (lt_add_one |t|) have he : Ξ³ =αΆ [𝓝 t] u a := Filter.eventually_of_mem (isOpen_Ioo.mem_nhds ht) (fun s hs => hmatch hs) have hd := (hud a t (Ioo_subset_Icc_self ht)).hasDerivAt (Icc_mem_nhds ht.1 ht.2) rw [he.eq_of_nhds] exact hd.congr_of_eventuallyEq he end section open scoped ContDiff Topology NNReal open Set Function variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] theorem stepEndpoint_eq_trajectory {L : ℝβ‰₯0} (X : C(E,E)) (hX : LipschitzWith L X) {h : ℝ} (hh : β€–hβ€–*L < 1) {Ξ³ : ℝ β†’ E} (hΞ³ : βˆ€ t, HasDerivAt Ξ³ (X (Ξ³ t)) t) : stepEndpoint X hX h (Ξ³ 0) = Ξ³ h := by have hΞ³c : Continuous Ξ³ := continuous_iff_continuousAt.mpr (fun t => (hΞ³ t).continuousAt) let u : C(Time,E) := ⟨fun s => Ξ³ (h*(s:ℝ)), hΞ³c.comp (continuous_const.mul continuous_subtype_val)⟩ have hu0 : u ⟨0,by simp⟩ = Ξ³ 0 := by simp [u] have hud (s : ℝ) (hs : s ∈ Ioo (0:ℝ) 1) : HasDerivAt (extendPath u) (h β€’ X (extendPath u s)) s := by have he : extendPath u =αΆ [𝓝 s] (fun t => Ξ³ (h*t)) := by filter_upwards [Icc_mem_nhds hs.1 hs.2] with t ht exact extendPath_coe u ⟨t,ht⟩ have hd := (hΞ³ (h*s)).scomp s (hasDerivAt_const_mul h) rw [he.eq_of_nhds] exact hd.congr_of_eventuallyEq he have he := fixedStep_eq_solution X hX hh u (Ξ³ 0) hu0 hud have he' := congrArg (fun v : C(Time,E) => v ⟨1,by simp⟩) he simpa only [stepEndpoint,u,ContinuousMap.coe_mk,mul_one] using he' def shortFlow {L : ℝβ‰₯0} (X : C(E,E)) (hX : LipschitzWith L X) (p : ℝ Γ— E) : E := stepEndpoint X hX p.1 p.2 theorem shortFlow_zero {L : ℝβ‰₯0} (X : C(E,E)) (hX : LipschitzWith L X) (x : E) : shortFlow X hX (0,x) = x := by have he := fixedStep_equation X hX (h := 0) (by simp) x simp only [zero_smul,add_zero] at he change fixedStep X hX 0 x ⟨1,by simp⟩ = x rw [he] rfl variable [FiniteDimensional ℝ E] theorem shortFlow_smoothOn {L : ℝβ‰₯0} (X : C(E,E)) (hX : LipschitzWith L X) (hXs : ContDiff ℝ ∞ X) : ContDiffOn ℝ ∞ (shortFlow X hX) {p : ℝ Γ— E | β€–p.1β€–*(L:ℝ) < 1} := by have hc := (localPath_smooth X hX hXs).comp (contDiff_snd.prodMk contDiff_fst).contDiffOn (fun p hp => hp) exact (ContinuousMap.evalCLM (M := E) ℝ (⟨1,by simp⟩ : Time)).contDiff.comp_contDiffOn hc omit [FiniteDimensional ℝ E] in theorem shortFlow_derivative {L : ℝβ‰₯0} (X : C(E,E)) (hX : LipschitzWith L X) (hXc : HasCompactSupport X) {t : ℝ} (ht : β€–tβ€–*(L:ℝ) < 1) (x : E) : HasDerivAt (fun s => shortFlow X hX (s,x)) (X (shortFlow X hX (t,x))) t := by obtain ⟨B,hB⟩ := X.continuous.bounded_above_of_compact_support hXc have hB0 : 0 ≀ B := (norm_nonneg (X x)).trans (hB x) obtain ⟨γ,hΞ³0,hΞ³d⟩ := exists_global_bounded_trajectory hX (B := ⟨B,hB0⟩) hB x have hopen : IsOpen {s : ℝ | β€–sβ€–*(L:ℝ) < 1} := isOpen_lt (continuous_id.norm.mul continuous_const) continuous_const have he : (fun s => shortFlow X hX (s,x)) =αΆ [𝓝 t] Ξ³ := by filter_upwards [hopen.mem_nhds ht] with s hs change stepEndpoint X hX s x = Ξ³ s rw [←hΞ³0] exact stepEndpoint_eq_trajectory X hX hs hΞ³d rw [he.eq_of_nhds] exact (hΞ³d t).congr_of_eventuallyEq he end section open scoped ContDiff Manifold Topology NNReal open Set Function Manifold variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] {M : Type*} [TopologicalSpace M] [ChartedSpace E M] [IsManifold π“˜(ℝ,E) ∞ M] theorem exists_smooth_local_manifold_flow {v : (x : M) β†’ TangentSpace π“˜(ℝ,E) x} (hv : ContMDiff π“˜(ℝ,E) (π“˜(ℝ,E)).tangent ∞ (fun x => (⟨x,v x⟩ : TangentBundle π“˜(ℝ,E) M))) (x : M) : βˆƒ (Ξ΅ : ℝ) (U : Set E) (Ξ¦ : ℝ Γ— E β†’ M), 0 < Ξ΅ ∧ IsOpen U ∧ extChartAt π“˜(ℝ,E) x x ∈ U ∧ U βŠ† (extChartAt π“˜(ℝ,E) x).target ∧ ContMDiffOn π“˜(ℝ,ℝ Γ— E) π“˜(ℝ,E) ∞ Ξ¦ (Ioo (-Ξ΅) Ξ΅ Γ—Λ’ U) ∧ (βˆ€ y ∈ U, Ξ¦ (0,y) = (extChartAt π“˜(ℝ,E) x).symm y) ∧ (βˆ€ y ∈ U, IsMIntegralCurveOn (fun t => Ξ¦ (t,y)) v (Ioo (-Ξ΅) Ξ΅)) := by let c := extChartAt π“˜(ℝ,E) x x have hc : c ∈ (extChartAt π“˜(ℝ,E) x).target := mem_extChartAt_target x have hT := isOpen_extChartAt_target (I := π“˜(ℝ,E)) x obtain βŸ¨Ο‡,_,_,_,_,_,hXs,hXc,hEq⟩ := exists_smooth_compact_extension (isCompact_singleton (x := c)) hT (singleton_subset_iff.mpr hc) (chartField_smoothOn hv x) let X : C(E,E) := ⟨fun y => Ο‡ y β€’ chartField v x y,hXs.continuous⟩ obtain ⟨L,hL⟩ := ContDiff.lipschitzWith_of_hasCompactSupport hXc hXs (by simp) have heq : βˆ€αΆ  y in 𝓝 c, X y = chartField v x y := by simpa only [nhdsSet_singleton,X,ContinuousMap.coe_mk] using hEq have hnb : {y | X y = chartField v x y ∧ y ∈ (extChartAt π“˜(ℝ,E) x).target} ∈ 𝓝 c := heq.and (hT.mem_nhds hc) obtain ⟨V,hVsub,hVo,hcV⟩ := mem_nhds_iff.mp hnb let D : Set (ℝ Γ— E) := {p | β€–p.1β€–*(L:ℝ) < 1} have hDo : IsOpen D := isOpen_lt (continuous_fst.norm.mul continuous_const) continuous_const have hcD : ((0,c) : ℝ Γ— E) ∈ D := by simp [D] have hflowc : ContinuousAt (shortFlow X hL) (0,c) := ((shortFlow_smoothOn X hL hXs).contDiffAt (hDo.mem_nhds hcD)).continuousAt have hpV : (shortFlow X hL) ⁻¹' V ∈ 𝓝 ((0,c) : ℝ Γ— E) := by apply hflowc.preimage_mem_nhds rw [shortFlow_zero] exact hVo.mem_nhds hcV obtain ⟨δ,hΞ΄,hball⟩ := Metric.mem_nhds_iff.mp (Filter.inter_mem (hDo.mem_nhds hcD) hpV) let U : Set E := Metric.ball c Ξ΄ have hroom {t : ℝ} (ht : t ∈ Ioo (-Ξ΄) Ξ΄) {y : E} (hy : y ∈ U) : (t,y) ∈ D ∧ shortFlow X hL (t,y) ∈ V := by apply hball rw [Metric.mem_ball,Prod.dist_eq,max_lt_iff] exact ⟨by simpa only [dist_zero_right,Real.norm_eq_abs] using (abs_lt.mpr ht),hy⟩ have hUtarget : U βŠ† (extChartAt π“˜(ℝ,E) x).target := by intro y hy have hm := (hroom (t := 0) ⟨by linarith,hδ⟩ hy).2 rw [shortFlow_zero] at hm exact (hVsub hm).2 let Ξ¦ : ℝ Γ— E β†’ M := (extChartAt π“˜(ℝ,E) x).symm ∘ shortFlow X hL refine ⟨δ,U,Ξ¦,hΞ΄,Metric.isOpen_ball,Metric.mem_ball_self hΞ΄,hUtarget,?_,?_,?_⟩ Β· apply (contMDiffOn_extChartAt_symm (I := π“˜(ℝ,E)) x).comp ((shortFlow_smoothOn X hL hXs).mono (fun p hp => (hroom hp.1 hp.2).1)).contMDiffOn intro p hp exact (hVsub (hroom hp.1 hp.2).2).2 Β· intro y _ change (extChartAt π“˜(ℝ,E) x).symm (shortFlow X hL (0,y)) = _ rw [shortFlow_zero] Β· intro y hy t ht have hm := hroom ht hy have hd := shortFlow_derivative X hL hXc hm.1 y rw [(hVsub hm.2).1] at hd exact (chartCurve_hasMFDerivAt x (hVsub hm.2).2 hd).hasMFDerivWithinAt theorem exists_smooth_local_manifold_family {v : (x : M) β†’ TangentSpace π“˜(ℝ,E) x} (hv : ContMDiff π“˜(ℝ,E) (π“˜(ℝ,E)).tangent ∞ (fun x => (⟨x,v x⟩ : TangentBundle π“˜(ℝ,E) M))) (x : M) : βˆƒ (Ξ΅ : ℝ) (W : Set M) (Ξ¨ : ℝ Γ— M β†’ M), 0 < Ξ΅ ∧ IsOpen W ∧ x ∈ W ∧ ContMDiffOn ((π“˜(ℝ,ℝ)).prod π“˜(ℝ,E)) π“˜(ℝ,E) ∞ Ξ¨ (Ioo (-Ξ΅) Ξ΅ Γ—Λ’ W) ∧ (βˆ€ y ∈ W, Ξ¨ (0,y) = y) ∧ (βˆ€ y ∈ W, IsMIntegralCurveOn (fun t => Ξ¨ (t,y)) v (Ioo (-Ξ΅) Ξ΅)) := by obtain ⟨Ρ,U,Ξ¦,hΞ΅,hU,hxU,_,hΞ¦,hΞ¦0,hΞ¦d⟩ := exists_smooth_local_manifold_flow hv x let e := extChartAt π“˜(ℝ,E) x let W : Set M := e.source ∩ e ⁻¹' U have hW : IsOpen W := (continuousOn_extChartAt x).isOpen_inter_preimage (isOpen_extChartAt_source x) hU have hxW : x ∈ W := ⟨mem_extChartAt_source x,hxU⟩ let Ξ¨ : ℝ Γ— M β†’ M := fun p => Ξ¦ (p.1,e p.2) refine ⟨Ρ,W,Ξ¨,hΞ΅,hW,hxW,?_,?_,?_⟩ Β· have hc : ContMDiffOn ((π“˜(ℝ,ℝ)).prod π“˜(ℝ,E)) π“˜(ℝ,E) ∞ (fun p : ℝ Γ— M => e p.2) (Ioo (-Ξ΅) Ξ΅ Γ—Λ’ W) := (contMDiffOn_extChartAt (I := π“˜(ℝ,E)) (x := x)).comp contMDiff_snd.contMDiffOn (fun p hp => by change p.2 ∈ (chartAt E x).source simpa only [e,extChartAt_source] using hp.2.1) exact hΞ¦.comp (contMDiff_fst.contMDiffOn.prodMk_space hc) (fun _ hp => ⟨hp.1,hp.2.2⟩) Β· intro y hy exact (hΞ¦0 (e y) hy.2).trans (e.left_inv hy.1) Β· intro y hy exact hΞ¦d (e y) hy.2 end open scoped ContDiff Manifold Topology open Set Function Manifold variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] {M : Type*} [TopologicalSpace M] [T2Space M] [ChartedSpace E M] [IsManifold π“˜(ℝ,E) ∞ M] theorem exists_uniform_smooth_manifold_families {v : (x : M) β†’ TangentSpace π“˜(ℝ,E) x} (hv : ContMDiff π“˜(ℝ,E) (π“˜(ℝ,E)).tangent ∞ (fun x => (⟨x,v x⟩ : TangentBundle π“˜(ℝ,E) M))) {K : Set M} (hK : IsCompact K) (hvK : βˆ€ x, x βˆ‰ K β†’ v x = 0) : βˆƒ Ξ΅ : ℝ, 0 < Ξ΅ ∧ βˆ€ x : M, βˆƒ (W : Set M) (Ξ¨ : ℝ Γ— M β†’ M), IsOpen W ∧ x ∈ W ∧ ContMDiffOn ((π“˜(ℝ,ℝ)).prod π“˜(ℝ,E)) π“˜(ℝ,E) ∞ Ξ¨ (Ioo (-Ξ΅) Ξ΅ Γ—Λ’ W) ∧ (βˆ€ y ∈ W, Ξ¨ (0,y) = y) ∧ (βˆ€ y ∈ W, IsMIntegralCurveOn (fun t => Ξ¨ (t,y)) v (Ioo (-Ξ΅) Ξ΅)) := by classical choose Ξ΅ W Ξ¨ hΞ΅ hW hxW hΞ¨s hΞ¨0 hΞ¨d using exists_smooth_local_manifold_family hv obtain ⟨s,hs⟩ := hK.elim_finite_subcover W hW (fun x _ => mem_iUnion.mpr ⟨x,hxW x⟩) have hsmall : βˆƒ Ξ΄ : ℝ, 0 < Ξ΄ ∧ βˆ€ x ∈ s, Ξ΄ ≀ Ξ΅ x := by clear hs induction s using Finset.induction_on with | empty => exact ⟨1,by norm_num,by simp⟩ | @insert a s ha ih => obtain ⟨δ,hΞ΄,hΞ΄s⟩ := ih refine ⟨min (Ξ΅ a) Ξ΄,lt_min (hΞ΅ a) hΞ΄,?_⟩ intro x hx rcases Finset.mem_insert.mp hx with rfl | hx Β· exact min_le_left _ _ Β· exact (min_le_right _ _).trans (hΞ΄s x hx) obtain ⟨δ,hΞ΄,hΞ΄s⟩ := hsmall refine ⟨δ,hΞ΄,fun x => ?_⟩ by_cases hx : x ∈ K Β· obtain ⟨a,ha,hxa⟩ := mem_iUnionβ‚‚.mp (hs hx) have hI : Ioo (-Ξ΄) Ξ΄ βŠ† Ioo (-Ξ΅ a) (Ξ΅ a) := Ioo_subset_Ioo (neg_le_neg (hΞ΄s a ha)) (hΞ΄s a ha) exact ⟨W a,Ξ¨ a,hW a,hxa,(hΞ¨s a).mono (prod_mono hI Subset.rfl), hΞ¨0 a,fun y hy => (hΞ¨d a y hy).mono hI⟩ Β· exact ⟨Kᢜ,Prod.snd,hK.isClosed.isOpen_compl,hx,contMDiff_snd.contMDiffOn, fun _ _ => rfl,fun y hy => (isMIntegralCurve_const (hvK y hy)).isMIntegralCurveOn _⟩ theorem exists_global_compact_manifold_trajectory {v : (x : M) β†’ TangentSpace π“˜(ℝ,E) x} (hv : ContMDiff π“˜(ℝ,E) (π“˜(ℝ,E)).tangent ∞ (fun x => (⟨x,v x⟩ : TangentBundle π“˜(ℝ,E) M))) {K : Set M} (hK : IsCompact K) (hvK : βˆ€ x, x βˆ‰ K β†’ v x = 0) (x : M) : βˆƒ Ξ³ : ℝ β†’ M, Ξ³ 0 = x ∧ IsMIntegralCurve Ξ³ v := by obtain ⟨Ρ,hΞ΅,h⟩ := exists_uniform_smooth_manifold_families hv hK hvK apply exists_isMIntegralCurve_of_isMIntegralCurveOn (hv.of_le (by simp)) hΞ΅ _ x intro y obtain ⟨W,Ξ¨,_,hy,_,hΞ¨0,hΞ¨d⟩ := h y exact ⟨fun t => Ξ¨ (t,y),hΞ¨0 y hy,hΞ¨d y hy⟩ end PackingSufficiencySupport.Hamiltonian end end OAI