File size: 12,975 Bytes
59d1c80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
import OAI.Geometry.IsometricImmersion.Flows.FlowSecondVariation

namespace OAI

noncomputable section
open Set Filter MeasureTheory Function
open scoped ContDiff Topology Interval

namespace SmoothLocal.Flow
open SmoothLocal.Geometry SmoothLocal.ODE SmoothLocal.Weighted

def initialSecondFlowDerivative (Y : ℝ → ℝ → ℝ) (p : ℝ × ℝ) : ℝ :=
  deriv (fun u => deriv (fun v => Y v p.1) u) p.2

def initialSecondForcing (q : Coord → ℝ) (Y : ℝ → ℝ → ℝ) (p : ℝ × ℝ) : ℝ :=
  ∫ r in 0..p.1, coordPartial 1 (coordPartial 1 q) (coordinatePoint r (Y p.2 r)) *
    deriv (fun v => Y v r) p.2

def initialThirdForcing (q : Coord → ℝ) (Y : ℝ → ℝ → ℝ) (p : ℝ × ℝ) : ℝ :=
  ∫ r in 0..p.1,
    coordPartial 1 (coordPartial 1 (coordPartial 1 q)) (coordinatePoint r (Y p.2 r)) *
      (deriv (fun v => Y v r) p.2) ^ 2 +
    coordPartial 1 (coordPartial 1 q) (coordinatePoint r (Y p.2 r)) *
      deriv (fun u => deriv (fun v => Y v r) u) p.2

section ActualFlow
variable {q : Coord → ℝ} {U : Set Coord} {Y : ℝ → ℝ → ℝ}
variable (hq : ContDiffOn ℝ ∞ q U) (hU : IsOpen U) (hSU : modelSquare ⊆ U)
variable (hY : ContinuousOn (uncurry Y) (Icc (-2 : ℝ) 2 ×ˢ Icc (-2 : ℝ) 2))
variable (hrange : ∀ s ∈ Icc (-2 : ℝ) 2, ∀ t ∈ Icc (-2 : ℝ) 2,
  Y s t ∈ Icc (-3 : ℝ) 3)
variable (hstart : ∀ s ∈ Icc (-2 : ℝ) 2, Y s 0 = s)
variable (hode : ∀ s ∈ Icc (-2 : ℝ) 2, ∀ t ∈ Icc (-2 : ℝ) 2,
  HasDerivWithinAt (Y s) (-q (coordinatePoint t (Y s t))) (Icc (-2 : ℝ) 2) t)
include hq hU hSU hY hrange hstart hode

theorem flowPullback_hasDerivAt_y {C : Coord → ℝ} (hC : ContDiffOn ℝ ∞ C U)
    {s t : ℝ} (hs : s ∈ Ioo (-2 : ℝ) 2) (ht : t ∈ Ioo (-2 : ℝ) 2) :
    HasDerivAt (fun u => C (coordinatePoint t (Y u t)))
      (coordPartial 1 C (coordinatePoint t (Y s t)) * deriv (fun u => Y u t) s) s := by
  have hB := flowPullback_contDiffOn hq hU hSU hY hrange hstart hode hC
  have hd : HasFDerivAt (fun p : ℝ × ℝ => C (flowCoordinateMap Y p))
      (fderiv ℝ (fun p : ℝ × ℝ => C (flowCoordinateMap Y p)) (t, s)) (t, s) :=
    ((hB.contDiffAt ((pairRectangle_isOpen 2 (-2) 2).mem_nhds ⟨ht, hs⟩)).differentiableAt
      (by simp)).hasFDerivAt
  have hh := hd.comp_hasDerivAt s ((hasDerivAt_const s t).prodMk (hasDerivAt_id s))
  change HasDerivAt (fun u => C (coordinatePoint t (Y u t)))
    (pairPartialY (fun p => C (flowCoordinateMap Y p)) (t, s)) s at hh
  rw [flowPullback_partial_y hq hU hSU hY hrange hstart hode hC ⟨ht, hs⟩] at hh
  exact hh

theorem initialSecondFlowDerivative_contDiffOn :
    ContDiffOn ℝ ∞ (initialSecondFlowDerivative Y) (pairRectangle 2 (-2) 2) := by
  have hV := initialFlowDerivative_contDiffOn hq hU hSU hY hrange hstart hode
  have hd : ContDiffOn ℝ ∞ (pairPartialY (initialFlowDerivative Y))
      (pairRectangle 2 (-2) 2) :=
    (hV.fderiv_of_isOpen (pairRectangle_isOpen 2 (-2) 2) (by simp)).clm_apply contDiffOn_const
  apply hd.congr
  intro p hp
  have hder := ((hV.contDiffAt ((pairRectangle_isOpen 2 (-2) 2).mem_nhds hp)).differentiableAt
    (by simp)).hasFDerivAt
  exact (hder.comp_hasDerivAt p.2
    ((hasDerivAt_const p.2 p.1).prodMk (hasDerivAt_id p.2))).deriv

theorem initialSecondForcing_hasDerivAt {s t : ℝ}
    (hs : s ∈ Ioo (-2 : ℝ) 2) (ht : t ∈ Ioo (-2 : ℝ) 2) :
    HasDerivAt (fun u => initialSecondForcing q Y (t, u))
      (initialThirdForcing q Y (t, s)) s := by
  let C (p : ℝ × ℝ) := coordPartial 1 (coordPartial 1 q) (flowCoordinateMap Y p) *
    initialFlowDerivative Y p
  have hqq := partial_contDiffOn (partial_contDiffOn hq hU 1) hU 1
  have hC : ContDiffOn ℝ ∞ C (pairRectangle 2 (-2) 2) :=
    (flowPullback_contDiffOn hq hU hSU hY hrange hstart hode hqq).mul
      (initialFlowDerivative_contDiffOn hq hU hSU hY hrange hstart hode)
  have hi := pairPrimitive_hasDerivAt_y (hC.of_le (by simp)) ht hs
  have heq : pairPrimitive (pairPartialY C) (t, s) = initialThirdForcing q Y (t, s) := by
    apply intervalIntegral.integral_congr
    intro r hr
    have hz : (0 : ℝ) ∈ Ioo (-2) 2 := by norm_num
    have hr' : r ∈ Ioo (-2 : ℝ) 2 :=
      ⟨(lt_min hz.1 ht.1).trans_le hr.1, hr.2.trans_lt (max_lt hz.2 ht.2)⟩
    have hqder := flowPullback_hasDerivAt_y hq hU hSU hY hrange hstart hode hqq hs hr'
    have hVder := (cap_flow_initial_second_hasDerivAt hq hU hSU hY hrange hstart hode hs hr').differentiableAt.hasDerivAt
    have hprod := hqder.mul hVder
    have hfd : HasFDerivAt C (fderiv ℝ C (r, s)) (r, s) :=
      ((hC.contDiffAt ((pairRectangle_isOpen 2 (-2) 2).mem_nhds ⟨hr', hs⟩)).differentiableAt
        (by simp)).hasFDerivAt
    have he := (hfd.comp_hasDerivAt s
      ((hasDerivAt_const s r).prodMk (hasDerivAt_id s))).unique hprod
    change pairPartialY C (r, s) = _ at he
    change pairPartialY C (r, s) = _
    rw [he]
    ring
  rw [heq] at hi
  exact hi

theorem cap_flow_initial_third_hasDerivAt {s t : ℝ}
    (hs : s ∈ Ioo (-2 : ℝ) 2) (ht : t ∈ Ioo (-2 : ℝ) 2) :
    HasDerivAt (fun u => initialSecondFlowDerivative Y (t, u))
      (-initialSecondFlowDerivative Y (t, s) * initialSecondForcing q Y (t, s) -
        initialFlowDerivative Y (t, s) * initialThirdForcing q Y (t, s)) s := by
  have hV : HasDerivAt (fun u => initialFlowDerivative Y (t, u))
      (initialSecondFlowDerivative Y (t, s)) s :=
    (cap_flow_initial_second_hasDerivAt hq hU hSU hY hrange hstart hode hs ht).differentiableAt.hasDerivAt
  have hI := initialSecondForcing_hasDerivAt hq hU hSU hY hrange hstart hode hs ht
  have hproduct : HasDerivAt
      (fun u => -initialFlowDerivative Y (t, u) * initialSecondForcing q Y (t, u))
      (-initialSecondFlowDerivative Y (t, s) * initialSecondForcing q Y (t, s) +
        -initialFlowDerivative Y (t, s) * initialThirdForcing q Y (t, s)) s := hV.neg.mul hI
  have he : (fun u => initialSecondFlowDerivative Y (t, u)) =ᶠ[𝓝 s]
      (fun u => -initialFlowDerivative Y (t, u) * initialSecondForcing q Y (t, u)) := by
    filter_upwards [isOpen_Ioo.mem_nhds hs] with u hu
    exact cap_flow_initial_second_formula hq hU hSU hY hrange hstart hode hu ht
  convert hproduct.congr_of_eventuallyEq he using 1
  first | rfl | ring

theorem cap_flow_initial_third_formula {s t : ℝ}
    (hs : s ∈ Ioo (-2 : ℝ) 2) (ht : t ∈ Ioo (-2 : ℝ) 2) :
    deriv (fun u => initialSecondFlowDerivative Y (t, u)) s =
      -initialSecondFlowDerivative Y (t, s) * initialSecondForcing q Y (t, s) -
        initialFlowDerivative Y (t, s) * initialThirdForcing q Y (t, s) :=
  (cap_flow_initial_third_hasDerivAt hq hU hSU hY hrange hstart hode hs ht).deriv

theorem initialThirdForcing_integrable_bound {M : ℝ} (hM : 0 ≤ M)
    (hMq : ∀ p ∈ modelSquare, |coordPartial 1 q p| ≤ M)
    (hMqq : ∀ p ∈ modelSquare, |coordPartial 1 (coordPartial 1 q) p| ≤ M)
    (hMqqq : ∀ p ∈ modelSquare, |coordPartial 1 (coordPartial 1 (coordPartial 1 q)) p| ≤ M)
    {s t : ℝ} (hs : s ∈ Ioo (-2 : ℝ) 2) (ht : t ∈ Ioo (-2 : ℝ) 2) :
    IntervalIntegrable (fun r =>
      coordPartial 1 (coordPartial 1 (coordPartial 1 q)) (coordinatePoint r (Y s r)) *
        (deriv (fun v => Y v r) s)^2 +
      coordPartial 1 (coordPartial 1 q) (coordinatePoint r (Y s r)) *
        deriv (fun u => deriv (fun v => Y v r) u) s) volume 0 t ∧
    |initialThirdForcing q Y (t, s)| ≤ (2 * M + 4 * M^2) * Real.exp (4 * M) := by
  let C (p : ℝ × ℝ) :=
    coordPartial 1 (coordPartial 1 (coordPartial 1 q)) (flowCoordinateMap Y p) * (initialFlowDerivative Y p)^2 +
    coordPartial 1 (coordPartial 1 q) (flowCoordinateMap Y p) * initialSecondFlowDerivative Y p
  have hqq := partial_contDiffOn (partial_contDiffOn hq hU 1) hU 1
  have hC : ContDiffOn ℝ ∞ C (pairRectangle 2 (-2) 2) :=
    ((flowPullback_contDiffOn hq hU hSU hY hrange hstart hode (partial_contDiffOn hqq hU 1)).mul
      ((initialFlowDerivative_contDiffOn hq hU hSU hY hrange hstart hode).pow 2)).add
      ((flowPullback_contDiffOn hq hU hSU hY hrange hstart hode hqq).mul
        (initialSecondFlowDerivative_contDiffOn hq hU hSU hY hrange hstart hode))
  have hc : ContinuousOn (fun r => C (r, s)) (Ioo (-2 : ℝ) 2) :=
    hC.continuousOn.comp (f := fun r => (r, s)) (by fun_prop) (fun r hr => ⟨hr, hs⟩)
  have hseg : uIcc (0 : ℝ) t ⊆ Ioo (-2 : ℝ) 2 := by
    intro r hr
    have hz : (0 : ℝ) ∈ Ioo (-2 : ℝ) 2 := by norm_num
    exact ⟨(lt_min hz.1 ht.1).trans_le hr.1, hr.2.trans_lt (max_lt hz.2 ht.2)⟩
  refine ⟨(hc.mono hseg).intervalIntegrable, ?_⟩
  have hbound (r : ℝ) (hr : r ∈ uIcc (0 : ℝ) t) :
      ‖C (r, s)‖ ≤ (M + 2 * M^2) * Real.exp (4 * M) := by
    have hr' := hseg hr
    have hp := flowCoordinateMap_mem_modelSquare (p := (r, s)) hq hU hSU hY hrange hstart hode ⟨hr', hs⟩
    have hV := (cap_flow_initial_deriv_bounds hq hU hSU hY hrange hstart hode hM hMq hs hr').2
    have hVpos := cap_flow_initial_deriv_pos hq hU hSU hY hrange hstart hode hs hr'
    have hVsq : |(deriv (fun v => Y v r) s)^2| ≤ Real.exp (4 * M) := by
      rw [abs_of_nonneg (sq_nonneg _)]
      calc
        _ ≤ (Real.exp (2 * M))^2 := pow_le_pow_left₀ hVpos.le hV 2
        _ = Real.exp (4 * M) := by rw [pow_two, ← Real.exp_add]; congr 1; ring
    have hW := cap_flow_initial_second_bound hq hU hSU hY hrange hstart hode hM hMq hMqq hs hr'
    rw [Real.norm_eq_abs]
    calc
      |C (r, s)| ≤
          |coordPartial 1 (coordPartial 1 (coordPartial 1 q)) (coordinatePoint r (Y s r))| *
            |(deriv (fun v => Y v r) s)^2| +
          |coordPartial 1 (coordPartial 1 q) (coordinatePoint r (Y s r))| *
            |deriv (fun u => deriv (fun v => Y v r) u) s| := by
        calc
          _ ≤ |coordPartial 1 (coordPartial 1 (coordPartial 1 q)) (coordinatePoint r (Y s r)) *
              (deriv (fun v => Y v r) s)^2| +
              |coordPartial 1 (coordPartial 1 q) (coordinatePoint r (Y s r)) *
                deriv (fun u => deriv (fun v => Y v r) u) s| := abs_add_le _ _
          _ = _ := by rw [abs_mul, abs_mul]
      _ ≤ M * Real.exp (4 * M) + M * (2 * M * Real.exp (4 * M)) :=
        add_le_add (mul_le_mul (hMqqq _ hp) hVsq (abs_nonneg _) hM)
          (mul_le_mul (hMqq _ hp) hW (abs_nonneg _) hM)
      _ = (M + 2 * M^2) * Real.exp (4 * M) := by ring
  have hi := intervalIntegral.norm_integral_le_of_norm_le_const
    (a := 0) (b := t) (C := (M + 2 * M^2) * Real.exp (4 * M)) (f := fun r => C (r, s))
    (fun r hr => hbound r (uIoc_subset_uIcc hr))
  have ht2 : |t| ≤ 2 := (abs_lt.mpr ht).le
  calc
    _ ≤ ((M + 2 * M^2) * Real.exp (4 * M)) * |t| := by
      simpa only [Real.norm_eq_abs, sub_zero, initialThirdForcing, C,
        flowCoordinateMap, initialFlowDerivative, initialSecondFlowDerivative] using hi
    _ ≤ ((M + 2 * M^2) * Real.exp (4 * M)) * 2 := mul_le_mul_of_nonneg_left ht2
      (mul_nonneg (by positivity) (Real.exp_pos _).le)
    _ = (2 * M + 4 * M^2) * Real.exp (4 * M) := by ring

theorem cap_flow_initial_third_bound {M : ℝ} (hM : 0 ≤ M)
    (hMq : ∀ p ∈ modelSquare, |coordPartial 1 q p| ≤ M)
    (hMqq : ∀ p ∈ modelSquare, |coordPartial 1 (coordPartial 1 q) p| ≤ M)
    (hMqqq : ∀ p ∈ modelSquare, |coordPartial 1 (coordPartial 1 (coordPartial 1 q)) p| ≤ M)
    {s t : ℝ} (hs : s ∈ Ioo (-2 : ℝ) 2) (ht : t ∈ Ioo (-2 : ℝ) 2) :
    |deriv (fun u => initialSecondFlowDerivative Y (t, u)) s| ≤
      (2 * M + 8 * M^2) * Real.exp (6 * M) := by
  rw [cap_flow_initial_third_formula hq hU hSU hY hrange hstart hode hs ht]
  have hW := cap_flow_initial_second_bound hq hU hSU hY hrange hstart hode hM hMq hMqq hs ht
  have hI := (flow_initial_second_integral_bound hq hU hSU hY hrange hstart hode hM hMq hMqq hs ht).2
  have hJ := (initialThirdForcing_integrable_bound hq hU hSU hY hrange hstart hode hM hMq hMqq hMqqq hs ht).2
  have hV : |initialFlowDerivative Y (t, s)| ≤ Real.exp (2 * M) := by
    unfold initialFlowDerivative
    rw [abs_of_pos (cap_flow_initial_deriv_pos hq hU hSU hY hrange hstart hode hs ht)]
    exact (cap_flow_initial_deriv_bounds hq hU hSU hY hrange hstart hode hM hMq hs ht).2
  calc
    _ ≤ |initialSecondFlowDerivative Y (t, s)| * |initialSecondForcing q Y (t, s)| +
        |initialFlowDerivative Y (t, s)| * |initialThirdForcing q Y (t, s)| := by
      simpa only [abs_mul, abs_neg] using
        abs_sub (-(initialSecondFlowDerivative Y (t, s)) * initialSecondForcing q Y (t, s))
          (initialFlowDerivative Y (t, s) * initialThirdForcing q Y (t, s))
    _ ≤ (2 * M * Real.exp (4 * M)) * (2 * M * Real.exp (2 * M)) +
        Real.exp (2 * M) * ((2 * M + 4 * M^2) * Real.exp (4 * M)) :=
      add_le_add (mul_le_mul hW hI (abs_nonneg _) (by positivity))
        (mul_le_mul hV hJ (abs_nonneg _) (Real.exp_pos _).le)
    _ = (2 * M + 8 * M^2) * (Real.exp (2 * M) * Real.exp (4 * M)) := by ring
    _ = (2 * M + 8 * M^2) * Real.exp (6 * M) := by
      rw [← Real.exp_add]
      congr 2
      ring

end ActualFlow
end SmoothLocal.Flow

end

end OAI