introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
3.98 kB
import Mathlib.Analysis.ODE.ExistUnique
import Mathlib.Analysis.Calculus.Deriv.Comp
import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic
import Mathlib.Tactic.Linarith
import Mathlib.Tactic.NormNum
namespace OAI
noncomputable section
open Set Metric
open scoped NNReal Interval
namespace SmoothLocal.ODE
def curvatureField (k : ℝ β†’ ℝ) (t : ℝ) (u : ℝ Γ— ℝ) : ℝ Γ— ℝ :=
(u.2, -k t * u.1)
theorem curvatureField_lipschitz {k : ℝ β†’ ℝ} {t : ℝ}
(hk : |k t| ≀ (1 : ℝ) / 1000) :
LipschitzWith 1 (curvatureField k t) := by
apply LipschitzWith.of_dist_le_mul
intro u v
rw [NNReal.coe_one, one_mul, dist_eq_norm, dist_eq_norm]
change max β€–u.2 - v.2β€– β€–-k t * u.1 - -k t * v.1β€– ≀ β€–u - vβ€–
refine max_le (norm_snd_le (u - v)) ?_
calc
β€–-k t * u.1 - -k t * v.1β€– = |k t| * β€–u.1 - v.1β€– := by
rw [← mul_sub, norm_mul, Real.norm_eq_abs, abs_neg]
_ ≀ 1 * β€–u.1 - v.1β€– :=
mul_le_mul_of_nonneg_right (by linarith) (norm_nonneg _)
_ ≀ β€–u - vβ€– := by simpa using norm_fst_le (u - v)
theorem curvatureField_norm_le {k : ℝ β†’ ℝ} {t : ℝ}
(hk : |k t| ≀ (1 : ℝ) / 1000) {u : ℝ Γ— ℝ}
(hu : u ∈ closedBall ((1 : ℝ), (0 : ℝ)) 2) :
β€–curvatureField k t uβ€– ≀ 2 := by
have hu' : β€–u - ((1 : ℝ), (0 : ℝ))β€– ≀ 2 := by
simpa only [mem_closedBall, dist_eq_norm] using hu
have hfst : |u.1 - 1| ≀ 2 := by
exact (norm_fst_le (u - ((1 : ℝ), (0 : ℝ)))).trans hu'
have hsnd : β€–u.2β€– ≀ 2 := by
simpa using (norm_snd_le (u - ((1 : ℝ), (0 : ℝ)))).trans hu'
have hu1 : |u.1| ≀ 3 := by
obtain ⟨ha, hb⟩ := abs_le.mp hfst
exact abs_le.mpr ⟨by linarith, by linarith⟩
change max β€–u.2β€– β€–-k t * u.1β€– ≀ 2
refine max_le hsnd ?_
rw [norm_mul, Real.norm_eq_abs, Real.norm_eq_abs, abs_neg]
have hh := mul_le_mul hk hu1 (abs_nonneg _) (by norm_num : (0 : ℝ) ≀ 1 / 1000)
linarith
theorem exists_curvature_state_on_closed_interval
(k : ℝ β†’ ℝ) (r : ℝ) (hr : 0 ≀ r) (hr1 : r ≀ 1)
(hkcont : ContinuousOn k (Icc (-r) r))
(hkbound : βˆ€ t ∈ Icc (-r) r, |k t| ≀ (1 : ℝ) / 1000) :
βˆƒ Ξ± : ℝ β†’ ℝ Γ— ℝ, Ξ± 0 = (1, 0) ∧
βˆ€ t ∈ Icc (-r) r,
HasDerivWithinAt Ξ± (curvatureField k t (Ξ± t)) (Icc (-r) r) t := by
let tβ‚€ : Icc (-r) r := ⟨0, by constructor <;> linarith⟩
have hPL : IsPicardLindelof (curvatureField k) tβ‚€ (1, 0) 2 0 2 1 := by
refine ⟨?_, ?_, ?_, ?_⟩
Β· intro t ht
apply LipschitzOnWith.of_dist_le_mul
intro u _ v _
exact (curvatureField_lipschitz (hkbound t ht)).dist_le_mul u v
Β· intro u _
exact continuousOn_const.prodMk (hkcont.neg.mul continuousOn_const)
Β· intro t ht u hu
exact curvatureField_norm_le (hkbound t ht) hu
Β· change (2 : ℝ) * max (r - 0) (0 - -r) ≀ (2 : ℝ) - 0
simp only [sub_zero, zero_sub, neg_neg, max_self]
linarith
simpa only [tβ‚€] using hPL.exists_eq_forall_mem_Icc_hasDerivWithinAtβ‚€
theorem curvature_integral_bound (k f : ℝ β†’ ℝ) (x F : ℝ)
(hF : 0 ≀ F)
(hk : βˆ€ t ∈ Set.uIoc 0 x, |k t| ≀ (1 : ℝ) / 1000)
(hf : βˆ€ t ∈ Set.uIoc 0 x, |f t| ≀ F) :
|∫ t in 0..x, k t * f t| ≀ ((1 : ℝ) / 1000) * F * |x| := by
have h := intervalIntegral.norm_integral_le_of_norm_le_const
(a := 0) (b := x) (C := ((1 : ℝ) / 1000) * F)
(f := fun t => k t * f t) (fun t ht => by
rw [Real.norm_eq_abs, abs_mul]
exact (mul_le_mul_of_nonneg_left (hf t ht) (abs_nonneg _)).trans
(mul_le_mul_of_nonneg_right (hk t ht) hF))
simpa only [Real.norm_eq_abs, sub_zero] using h
theorem positive_of_integral_bounds (f F : ℝ)
(hF : F ≀ 1 + ((1 : ℝ) / 1000) * F)
(hf : |f - 1| ≀ ((1 : ℝ) / 1000) * F) :
(998 : ℝ) / 999 ≀ f ∧ f ≀ (1000 : ℝ) / 999 := by
obtain ⟨ha, hb⟩ := abs_le.mp hf
constructor <;> linarith
end SmoothLocal.ODE
end
end OAI