File size: 3,980 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 96 97 98 99 100 | 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
|