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