Download data/lean/OAI/Geometry/IsometricImmersion/Flows/FlowExistence.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.56 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/IsometricImmersion/Flows/FlowExistence.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Geometry/IsometricImmersion/Flows/FlowExistence.lean
-
curl -L -o FlowExistence.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/IsometricImmersion/Flows/FlowExistence.lean
6.56 kB
| import OAI.Geometry.IsometricImmersion.Energy.WeightPrimitive | |
| import Mathlib.Analysis.ODE.ExistUnique | |
| import Mathlib.Analysis.Calculus.MeanValue | |
| namespace OAI | |
| noncomputable section | |
| open Set Metric Filter Function | |
| open scoped ContDiff Topology NNReal | |
| namespace SmoothLocal.Flow | |
| open SmoothLocal.Geometry SmoothLocal.ODE SmoothLocal.Weighted | |
| def modelSquare : Set Coord := Icc (fun _ => (-3 : β)) (fun _ => (3 : β)) | |
| theorem modelSquare_isCompact : IsCompact modelSquare := isCompact_Icc | |
| theorem coordinatePoint_mem_modelSquare {t y : β} | |
| (ht : t β Icc (-3 : β) 3) (hy : y β Icc (-3 : β) 3) : | |
| coordinatePoint t y β modelSquare := by | |
| simp only [mem_Icc] at ht hy | |
| constructor <;> intro i <;> fin_cases i <;> simp [coordinatePoint] <;> tauto | |
| def flowField (q : Coord β β) (t y : β) : β := -q (coordinatePoint t y) | |
| variable {q : Coord β β} {U : Set Coord} | |
| theorem flowField_hasDerivAt_y (hq : ContDiffOn β β q U) (hU : IsOpen U) | |
| {t y : β} (hp : coordinatePoint t y β U) : | |
| HasDerivAt (flowField q t) (-coordPartial 1 q (coordinatePoint t y)) y := by | |
| have hd := (hq.contDiffAt (hU.mem_nhds hp)).differentiableAt (by simp) | |
| exact (hd.hasFDerivAt.comp_hasDerivAt y (coordinatePoint_hasDerivAt_y t y)).neg | |
| theorem exists_flowField_lipschitz (hq : ContDiffOn β β q U) (hU : IsOpen U) | |
| (hSU : modelSquare β U) : | |
| β L : ββ₯0, β t β Icc (-2 : β) 2, | |
| LipschitzOnWith L (flowField q t) (closedBall (0 : β) 3) := by | |
| have hc : ContinuousOn (coordPartial 1 q) modelSquare := | |
| (partial_contDiffOn hq hU 1).continuousOn.mono hSU | |
| obtain β¨M, hMβ© := modelSquare_isCompact.exists_bound_of_continuousOn hc | |
| let L : ββ₯0 := β¨max M 0, le_max_right _ _β© | |
| refine β¨L, ?_β© | |
| intro t ht | |
| have hmem (y : β) (hy : y β closedBall (0 : β) 3) : | |
| coordinatePoint t y β modelSquare := by | |
| have hy' : |y| β€ 3 := by simpa only [mem_closedBall, Real.dist_eq, sub_zero] using hy | |
| exact coordinatePoint_mem_modelSquare β¨by linarith [ht.1], by linarith [ht.2]β© (abs_le.mp hy') | |
| apply (convex_closedBall (0 : β) 3).lipschitzOnWith_of_nnnorm_hasDerivWithin_le | |
| (fun y hy => (flowField_hasDerivAt_y hq hU (hSU (hmem y hy))).hasDerivWithinAt) | |
| intro y hy | |
| change β-coordPartial 1 q (coordinatePoint t y)β β€ max M 0 | |
| rw [norm_neg] | |
| exact (hM _ (hmem y hy)).trans (le_max_left _ _) | |
| theorem exists_cap_picard (hq : ContDiffOn β β q U) (hU : IsOpen U) | |
| (hSU : modelSquare β U) (hsmall : β p β modelSquare, |q p| β€ (1 : β) / 100) : | |
| β L : ββ₯0, IsPicardLindelof (flowField q) | |
| (β¨0, by norm_numβ© : Icc (-2 : β) 2) 0 3 2 (1 / 100) L := by | |
| obtain β¨L, hLβ© := exists_flowField_lipschitz hq hU hSU | |
| refine β¨L, hL, ?_, ?_, ?_β© | |
| Β· intro y hy | |
| have hy' : |y| β€ 3 := by simpa only [mem_closedBall, Real.dist_eq, sub_zero, | |
| NNReal.coe_ofNat] using hy | |
| exact hq.continuousOn.neg.comp (by unfold coordinatePoint; fun_prop) | |
| (fun t ht => hSU (coordinatePoint_mem_modelSquare | |
| β¨by linarith [ht.1], by linarith [ht.2]β© (abs_le.mp hy'))) | |
| Β· intro t ht y hy | |
| have hy' : |y| β€ 3 := by simpa only [mem_closedBall, Real.dist_eq, sub_zero, | |
| NNReal.coe_ofNat] using hy | |
| have hm := coordinatePoint_mem_modelSquare (t := t) (y := y) | |
| β¨by linarith [ht.1], by linarith [ht.2]β© (abs_le.mp hy') | |
| simpa only [flowField, norm_neg, Real.norm_eq_abs, NNReal.coe_div, | |
| NNReal.coe_one, NNReal.coe_ofNat] using hsmall _ hm | |
| Β· norm_num | |
| theorem exists_cap_trajectory (hq : ContDiffOn β β q U) (hU : IsOpen U) | |
| (hSU : modelSquare β U) (hsmall : β p β modelSquare, |q p| β€ (1 : β) / 100) | |
| (s : β) (hs : s β Icc (-2 : β) 2) : | |
| β y : β β β, y 0 = s β§ ContDiffOn β β y (Icc (-2 : β) 2) β§ | |
| (β t β Icc (-2 : β) 2, | |
| HasDerivWithinAt y (-q (coordinatePoint t (y t))) (Icc (-2 : β) 2) t) β§ | |
| (β t β Icc (-2 : β) 2, |y t - s| β€ (1 : β) / 100 * |t|) β§ | |
| (β t β Icc (-2 : β) 2, |y t - s| β€ (1 : β) / 50) β§ | |
| (β t β Icc (-2 : β) 2, y t β closedBall (0 : β) 3) := by | |
| obtain β¨L, hPLβ© := exists_cap_picard hq hU hSU hsmall | |
| have hsball : s β closedBall (0 : β) (β(2 : ββ₯0)) := by | |
| simpa only [mem_closedBall, Real.dist_eq, sub_zero, NNReal.coe_ofNat] using abs_le.mpr hs | |
| have hz : (0 : β) β Icc (-2 : β) 2 := by norm_num | |
| obtain β¨alpha, halphaβ© := ODE.FunSpace.exists_isFixedPt_next hPL hsball | |
| have hinit : alpha.compProj 0 = s := by | |
| rw [ODE.FunSpace.compProj_of_mem hz, β halpha] | |
| exact ODE.FunSpace.next_applyβ hPL hsball alpha | |
| have hderiv (t : β) (ht : t β Icc (-2 : β) 2) : | |
| HasDerivWithinAt alpha.compProj (flowField q t (alpha.compProj t)) | |
| (Icc (-2 : β) 2) t := by | |
| apply ODE.hasDerivWithinAt_picard_Icc (show (0 : β) β Icc (-2 : β) 2 by norm_num) | |
| hPL.continuousOn_uncurry alpha.continuous_compProj.continuousOn | |
| (fun _ _ => alpha.compProj_mem_closedBall hPL.mul_max_le) s ht |>.congr_of_mem _ ht | |
| intro t' ht' | |
| nth_rw 1 [β halpha] | |
| rw [ODE.FunSpace.compProj_of_mem ht'] | |
| exact ODE.FunSpace.next_apply hPL hsball alpha (t := β¨t', ht'β©) | |
| have hrange (t : β) : alpha.compProj t β closedBall (0 : β) 3 := | |
| alpha.compProj_mem_closedBall hPL.mul_max_le | |
| have hdispl (t : β) (ht : t β Icc (-2 : β) 2) : | |
| |alpha.compProj t - s| β€ (1 : β) / 100 * |t| := by | |
| have hh := alpha.lipschitzWith.dist_le_mul β¨t, htβ© | |
| (β¨0, by norm_numβ© : Icc (-2 : β) 2) | |
| have ha0 : alpha β¨0, hzβ© = s := by | |
| simpa only [ODE.FunSpace.compProj_of_mem hz] using hinit | |
| rw [β ODE.FunSpace.compProj_of_mem ht, ha0] at hh | |
| simpa only [Subtype.dist_eq, Real.dist_eq, sub_zero, NNReal.coe_div, | |
| NNReal.coe_one, NNReal.coe_ofNat] using hh | |
| have hfield : ContDiffOn β β (uncurry (flowField q)) | |
| (Icc (-2 : β) 2 ΓΛ’ closedBall (0 : β) 3) := by | |
| apply hq.neg.comp (by unfold coordinatePoint; fun_prop) | |
| intro p hp | |
| have hy' : |p.2| β€ 3 := by | |
| simpa only [mem_closedBall, Real.dist_eq, sub_zero] using hp.2 | |
| exact hSU (coordinatePoint_mem_modelSquare | |
| β¨by linarith [hp.1.1], by linarith [hp.1.2]β© (abs_le.mp hy')) | |
| refine β¨alpha.compProj, hinit, | |
| ODE.contDiffOn_enat_Icc_of_hasDerivWithinAt hfield hderiv (fun t _ => hrange t), | |
| hderiv, hdispl, ?_, fun t _ => hrange tβ© | |
| intro t ht | |
| have hdt := hdispl t ht | |
| have ht2 := abs_le.mpr ht | |
| nlinarith | |
| end SmoothLocal.Flow | |
| end | |
| end OAI | |