Download data/lean/OAI/Geometry/IsometricImmersion/Flows/FlowSecondVariation.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 10.8 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/IsometricImmersion/Flows/FlowSecondVariation.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Geometry/IsometricImmersion/Flows/FlowSecondVariation.lean
-
curl -L -o FlowSecondVariation.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/IsometricImmersion/Flows/FlowSecondVariation.lean
10.8 kB
| import OAI.Geometry.IsometricImmersion.Flows.FlowBounds | |
| 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 initialFlowDerivative (Y : β β β β β) (p : β Γ β) : β := | |
| deriv (fun s => Y s p.1) 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 flowCoordinateMap_mem_modelSquare {p : β Γ β} | |
| (hp : p β pairRectangle 2 (-2) 2) : flowCoordinateMap Y p β modelSquare := by | |
| have hF := cap_flow_joint_contDiffOn hq hU hSU hY hrange hstart hode | |
| have hbound : Y p.2 p.1 β Icc (-3 : β) 3 := by | |
| apply isClosed_Icc.mem_of_tendsto | |
| (hF.contDiffAt ((pairRectangle_isOpen 2 (-2) 2).mem_nhds hp)).continuousAt | |
| filter_upwards [(pairRectangle_isOpen 2 (-2) 2).mem_nhds hp] with point hpoint | |
| exact hrange point.2 β¨hpoint.2.1.le, hpoint.2.2.leβ© | |
| point.1 β¨hpoint.1.1.le, hpoint.1.2.leβ© | |
| exact coordinatePoint_mem_modelSquare β¨by linarith [hp.1.1], by linarith [hp.1.2]β© | |
| hbound | |
| theorem flowPullback_contDiffOn {C : Coord β β} (hC : ContDiffOn β β C U) : | |
| ContDiffOn β β (fun p => C (flowCoordinateMap Y p)) (pairRectangle 2 (-2) 2) := by | |
| have hF := cap_flow_joint_contDiffOn hq hU hSU hY hrange hstart hode | |
| have hT : ContDiffOn β β (flowCoordinateMap Y) (pairRectangle 2 (-2) 2) := | |
| (contDiffOn_fst.smul contDiffOn_const).add (hF.smul contDiffOn_const) | |
| exact hC.comp hT (fun p hp => hSU | |
| (flowCoordinateMap_mem_modelSquare hq hU hSU hY hrange hstart hode hp)) | |
| theorem initialFlowDerivative_eq_pairPartialY {p : β Γ β} | |
| (hp : p β pairRectangle 2 (-2) 2) : | |
| initialFlowDerivative Y p = pairPartialY (fun v : β Γ β => Y v.2 v.1) p := by | |
| have hF := cap_flow_joint_contDiffOn hq hU hSU hY hrange hstart hode | |
| have hd := ((hF.contDiffAt ((pairRectangle_isOpen 2 (-2) 2).mem_nhds hp)).differentiableAt | |
| (by simp)).hasFDerivAt | |
| exact (hd.comp_hasDerivAt p.2 ((hasDerivAt_const p.2 p.1).prodMk (hasDerivAt_id p.2))).deriv | |
| theorem initialFlowDerivative_contDiffOn : | |
| ContDiffOn β β (initialFlowDerivative Y) (pairRectangle 2 (-2) 2) := by | |
| have hF := cap_flow_joint_contDiffOn hq hU hSU hY hrange hstart hode | |
| have hd : ContDiffOn β β (pairPartialY (fun v : β Γ β => Y v.2 v.1)) | |
| (pairRectangle 2 (-2) 2) := | |
| (hF.fderiv_of_isOpen (pairRectangle_isOpen 2 (-2) 2) (by simp)).clm_apply contDiffOn_const | |
| exact hd.congr (fun p hp => initialFlowDerivative_eq_pairPartialY | |
| hq hU hSU hY hrange hstart hode hp) | |
| theorem flowPullback_partial_y {C : Coord β β} (hC : ContDiffOn β β C U) | |
| {p : β Γ β} (hp : p β pairRectangle 2 (-2) 2) : | |
| pairPartialY (fun v => C (flowCoordinateMap Y v)) p = | |
| coordPartial 1 C (flowCoordinateMap Y p) * initialFlowDerivative Y p := by | |
| have hsY : HasDerivAt (fun s => Y s p.1) (initialFlowDerivative Y p) p.2 := | |
| (cap_flow_hasDerivAt_initial hq hU hSU hY hrange hstart hode hp.2 hp.1).differentiableAt.hasDerivAt | |
| have hsT : HasDerivAt (fun s => flowCoordinateMap Y (p.1, s)) | |
| (initialFlowDerivative Y p β’ Pi.single 1 (1 : β)) p.2 := by | |
| convert | |
| ((hasDerivAt_const p.2 p.1).smul_const (Pi.single 0 (1 : β) : Coord)).add | |
| (hsY.smul_const (Pi.single 1 (1 : β) : Coord)) using 1 <;> | |
| first | rfl | simp | |
| have hmem := hSU (flowCoordinateMap_mem_modelSquare hq hU hSU hY hrange hstart hode hp) | |
| have hdC := ((hC.contDiffAt (hU.mem_nhds hmem)).differentiableAt (by simp)).hasFDerivAt | |
| have hchain : HasDerivAt (fun s => C (flowCoordinateMap Y (p.1, s))) | |
| (coordPartial 1 C (flowCoordinateMap Y p) * initialFlowDerivative Y p) p.2 := by | |
| convert hdC.comp_hasDerivAt p.2 hsT using 1 <;> | |
| first | rfl | simp only [map_smul, smul_eq_mul, coordPartial, mul_comm] | |
| have hB := flowPullback_contDiffOn hq hU hSU hY hrange hstart hode hC | |
| have hdB : HasFDerivAt (fun v : β Γ β => C (flowCoordinateMap Y v)) | |
| (fderiv β (fun v : β Γ β => C (flowCoordinateMap Y v)) p) p := | |
| ((hB.contDiffAt ((pairRectangle_isOpen 2 (-2) 2).mem_nhds hp)).differentiableAt | |
| (by simp)).hasFDerivAt | |
| have hpair : HasDerivAt (fun s => C (flowCoordinateMap Y (p.1, s))) | |
| (pairPartialY (fun v => C (flowCoordinateMap Y v)) p) p.2 := by | |
| convert hdB.comp_hasDerivAt p.2 | |
| ((hasDerivAt_const p.2 p.1).prodMk (hasDerivAt_id p.2)) using 1 <;> rfl | |
| exact hpair.unique hchain | |
| theorem cap_flow_initial_second_hasDerivAt {s t : β} | |
| (hs : s β Ioo (-2 : β) 2) (ht : t β Ioo (-2 : β) 2) : | |
| HasDerivAt (fun u => deriv (fun v => Y v t) u) | |
| (-deriv (fun v => Y v t) s * | |
| (β« r in 0..t, coordPartial 1 (coordPartial 1 q) (coordinatePoint r (Y s r)) * | |
| deriv (fun v => Y v r) s)) s := by | |
| let B (p : β Γ β) := coordPartial 1 q (flowCoordinateMap Y p) | |
| have hB : ContDiffOn β β B (pairRectangle 2 (-2) 2) := | |
| flowPullback_contDiffOn hq hU hSU hY hrange hstart hode (partial_contDiffOn hq hU 1) | |
| have hI := pairPrimitive_hasDerivAt_y (hB.of_le (by simp)) ht hs | |
| have hdiag : pairPrimitive (pairPartialY B) (t, s) = | |
| β« r in 0..t, coordPartial 1 (coordPartial 1 q) (coordinatePoint r (Y s r)) * | |
| deriv (fun v => Y v r) s := by | |
| apply intervalIntegral.integral_congr | |
| intro r hr | |
| have hr' : r β Ioo (-2 : β) 2 := by | |
| 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)β© | |
| exact flowPullback_partial_y hq hU hSU hY hrange hstart hode | |
| (partial_contDiffOn hq hU 1) β¨hr', hsβ© | |
| have hV : HasDerivAt (fun u => Real.exp (-pairPrimitive B (t, u))) | |
| (Real.exp (-pairPrimitive B (t, s)) * -pairPrimitive (pairPartialY B) (t, s)) s := hI.neg.exp | |
| have he : (fun u => deriv (fun v => Y v t) u) =αΆ [π s] | |
| (fun u => Real.exp (-pairPrimitive B (t, u))) := by | |
| filter_upwards [isOpen_Ioo.mem_nhds hs] with u hu | |
| exact (cap_flow_hasDerivAt_initial hq hU hSU hY hrange hstart hode hu ht).deriv | |
| have hVs : Real.exp (-pairPrimitive B (t, s)) = deriv (fun v => Y v t) s := | |
| (cap_flow_hasDerivAt_initial hq hU hSU hY hrange hstart hode hs ht).deriv.symm | |
| rw [hdiag, hVs] at hV | |
| convert hV.congr_of_eventuallyEq he using 1 | |
| first | rfl | ring | |
| theorem cap_flow_initial_second_formula {s t : β} | |
| (hs : s β Ioo (-2 : β) 2) (ht : t β Ioo (-2 : β) 2) : | |
| deriv (fun u => deriv (fun v => Y v t) u) s = | |
| -deriv (fun v => Y v t) s * | |
| (β« r in 0..t, coordPartial 1 (coordPartial 1 q) (coordinatePoint r (Y s r)) * | |
| deriv (fun v => Y v r) s) := | |
| (cap_flow_initial_second_hasDerivAt hq hU hSU hY hrange hstart hode hs ht).deriv | |
| theorem flow_initial_second_integral_bound {M : β} (hM : 0 β€ M) | |
| (hMq : β p β modelSquare, |coordPartial 1 q p| β€ M) | |
| (hMqq : β p β modelSquare, |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 q) (coordinatePoint r (Y s r)) * | |
| deriv (fun v => Y v r) s) volume 0 t β§ | |
| |β« r in 0..t, coordPartial 1 (coordPartial 1 q) (coordinatePoint r (Y s r)) * | |
| deriv (fun v => Y v r) s| β€ 2 * M * Real.exp (2 * M) := by | |
| let C (p : β Γ β) := coordPartial 1 (coordPartial 1 q) (flowCoordinateMap Y p) * initialFlowDerivative Y p | |
| have hC : ContDiffOn β β C (pairRectangle 2 (-2) 2) := | |
| (flowPullback_contDiffOn hq hU hSU hY hrange hstart hode | |
| (partial_contDiffOn (partial_contDiffOn hq hU 1) hU 1)).mul | |
| (initialFlowDerivative_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) : | |
| βcoordPartial 1 (coordPartial 1 q) (coordinatePoint r (Y s r)) * deriv (fun v => Y v r) sβ β€ | |
| M * Real.exp (2 * M) := by | |
| have hr' := hseg hr | |
| have hys := cap_flow_initial_deriv_bounds hq hU hSU hY hrange hstart hode hM hMq hs hr' | |
| have hpos := cap_flow_initial_deriv_pos hq hU hSU hY hrange hstart hode hs hr' | |
| rw [Real.norm_eq_abs, abs_mul, abs_of_pos hpos] | |
| exact mul_le_mul (hMqq _ (flowCoordinateMap_mem_modelSquare (p := (r, s)) hq hU hSU hY hrange hstart hode | |
| β¨hr', hsβ©)) hys.2 hpos.le hM | |
| have hi := intervalIntegral.norm_integral_le_of_norm_le_const | |
| (a := 0) (b := t) (C := M * Real.exp (2 * M)) | |
| (fun r hr => hbound r (uIoc_subset_uIcc hr)) | |
| have ht2 : |t| β€ 2 := (abs_lt.mpr ht).le | |
| calc | |
| _ β€ (M * Real.exp (2 * M)) * |t| := by simpa only [Real.norm_eq_abs, sub_zero] using hi | |
| _ β€ (M * Real.exp (2 * M)) * 2 := mul_le_mul_of_nonneg_left ht2 | |
| (mul_nonneg hM (Real.exp_pos _).le) | |
| _ = 2 * M * Real.exp (2 * M) := by ring | |
| theorem cap_flow_initial_second_bound {M : β} (hM : 0 β€ M) | |
| (hMq : β p β modelSquare, |coordPartial 1 q p| β€ M) | |
| (hMqq : β p β modelSquare, |coordPartial 1 (coordPartial 1 q) p| β€ M) | |
| {s t : β} (hs : s β Ioo (-2 : β) 2) (ht : t β Ioo (-2 : β) 2) : | |
| |deriv (fun u => deriv (fun v => Y v t) u) s| β€ 2 * M * Real.exp (4 * M) := by | |
| rw [cap_flow_initial_second_formula hq hU hSU hY hrange hstart hode hs ht, abs_mul, | |
| abs_neg, abs_of_pos (cap_flow_initial_deriv_pos hq hU hSU hY hrange hstart hode hs ht)] | |
| calc | |
| _ β€ Real.exp (2 * M) * (2 * M * Real.exp (2 * M)) := | |
| mul_le_mul (cap_flow_initial_deriv_bounds hq hU hSU hY hrange hstart hode hM hMq hs ht).2 | |
| (flow_initial_second_integral_bound hq hU hSU hY hrange hstart hode hM hMq hMqq hs ht).2 | |
| (abs_nonneg _) (Real.exp_pos _).le | |
| _ = (2 * M) * (Real.exp (2 * M) * Real.exp (2 * M)) := by ring | |
| _ = 2 * M * Real.exp (4 * M) := by | |
| rw [β Real.exp_add] | |
| congr 2 | |
| ring | |
| end ActualFlow | |
| end SmoothLocal.Flow | |
| end | |
| end OAI | |