Download data/lean/OAI/Geometry/IsometricImmersion/Energy/WeightPrimitive.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 14.6 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/IsometricImmersion/Energy/WeightPrimitive.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Geometry/IsometricImmersion/Energy/WeightPrimitive.lean
-
curl -L -o WeightPrimitive.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/IsometricImmersion/Energy/WeightPrimitive.lean
14.6 kB
| import OAI.Geometry.IsometricImmersion.Volterra.VolterraJointSmooth | |
| import OAI.Geometry.IsometricImmersion.Energy.WeightedMultiplier | |
| namespace OAI | |
| noncomputable section | |
| open Set Filter MeasureTheory | |
| open scoped ContDiff Topology Interval | |
| namespace SmoothLocal.Weighted | |
| open SmoothLocal.Geometry SmoothLocal.ODE | |
| def coordinateRectangle (R a b : β) : Set Coord := | |
| {p | p 0 β Ioo (-R) R β§ p 1 β Ioo a b} | |
| theorem coordinateRectangle_isOpen (R a b : β) : IsOpen (coordinateRectangle R a b) := by | |
| change IsOpen (((fun p : Coord => p 0) β»ΒΉ' Ioo (-R) R) β© | |
| ((fun p : Coord => p 1) β»ΒΉ' Ioo a b)) | |
| exact (isOpen_Ioo.preimage (continuous_apply 0)).inter | |
| (isOpen_Ioo.preimage (continuous_apply 1)) | |
| theorem point_mem_rectangle {R a b x y : β} | |
| (hx : x β Ioo (-R) R) (hy : y β Ioo a b) : | |
| coordinatePoint x y β coordinateRectangle R a b := by | |
| simpa [coordinateRectangle, coordinatePoint] using And.intro hx hy | |
| theorem point_eta (p : Coord) : coordinatePoint (p 0) (p 1) = p := by | |
| ext i | |
| fin_cases i <;> simp [coordinatePoint] | |
| theorem point_hasDerivAt_t (x y : β) : | |
| HasDerivAt (fun t => coordinatePoint t y) (Pi.single 0 (1 : β) : Coord) x := by | |
| simpa [coordinatePoint] using | |
| ((hasDerivAt_id x).smul_const (Pi.single 0 (1 : β) : Coord)).add_const | |
| (y β’ (Pi.single 1 (1 : β) : Coord)) | |
| def coordinatePrimitive (B : Coord β β) (p : Coord) : β := | |
| β« t in 0..p 0, B (coordinatePoint t (p 1)) | |
| variable {B : Coord β β} {R a b : β} | |
| theorem parameterDerivative_smooth_on_rectangle | |
| (hB : ContDiffOn β β B (coordinateRectangle R a b)) : | |
| β n, ContDiffOn β β (curvatureYDerivative B n) (coordinateRectangle R a b) := by | |
| intro n | |
| induction n with | |
| | zero => exact hB | |
| | succ n hn => exact partial_contDiffOn hn (coordinateRectangle_isOpen R a b) 1 | |
| theorem compact_t_mem_rectangle_interval {r : β} (hrR : r < R) (x : Icc (-r) r) : | |
| (x : β) β Ioo (-R) R := | |
| β¨(neg_lt_neg hrR).trans_le x.2.1, x.2.2.trans_lt hrRβ© | |
| theorem coefficientFamily_apply_on_rectangle | |
| (hB : ContDiffOn β β B (coordinateRectangle R a b)) | |
| (r : β) (hrR : r < R) {y : β} (hy : y β Ioo a b) (x : Icc (-r) r) : | |
| coordinateCurvatureFamily B r y x = B (coordinatePoint x y) := by | |
| have hc : Continuous (fun t : Icc (-r) r => B (coordinatePoint t y)) := | |
| hB.continuousOn.comp_continuous (by unfold coordinatePoint; fun_prop) | |
| (fun t => point_mem_rectangle (compact_t_mem_rectangle_interval hrR t) hy) | |
| unfold coordinateCurvatureFamily | |
| rw [ContinuousMap.mkD_of_continuous hc] | |
| rfl | |
| theorem coefficientFamily_contDiffOn_rectangle | |
| (hB : ContDiffOn β β B (coordinateRectangle R a b)) | |
| (r : β) (hrR : r < R) : | |
| ContDiffOn β β (coordinateCurvatureFamily B r) (Ioo a b) := by | |
| let H : β β β β Icc (-r) r β β := | |
| fun n y x => curvatureYDerivative B n (coordinatePoint x y) | |
| have hmem (y : β) (hy : y β Ioo a b) (x : Icc (-r) r) : | |
| coordinatePoint x y β coordinateRectangle R a b := | |
| point_mem_rectangle (compact_t_mem_rectangle_interval hrR x) hy | |
| have hjoint (n : β) : ContinuousOn (Function.uncurry (H n)) | |
| (Ioo a b ΓΛ’ (Set.univ : Set (Icc (-r) r))) := by | |
| have hmap : Continuous (fun p : β Γ Icc (-r) r => coordinatePoint p.2 p.1) := by | |
| unfold coordinatePoint | |
| fun_prop | |
| exact (parameterDerivative_smooth_on_rectangle hB n).continuousOn.comp | |
| hmap.continuousOn (fun p hp => hmem p.1 hp.1 p.2) | |
| have hderiv (n : β) (y : β) (hy : y β Ioo a b) (x : Icc (-r) r) : | |
| HasDerivAt (fun t => H n t x) (H (n + 1) y x) y := by | |
| have hd : DifferentiableAt β (curvatureYDerivative B n) (coordinatePoint x y) := | |
| ((parameterDerivative_smooth_on_rectangle hB n).contDiffAt | |
| ((coordinateRectangle_isOpen R a b).mem_nhds (hmem y hy x))).differentiableAt | |
| (by simp) | |
| exact hd.hasFDerivAt.comp_hasDerivAt y (coordinatePoint_hasDerivAt_y x y) | |
| exact smooth_curry_of_joint_derivative_sequence H hjoint hderiv 0 | |
| theorem coefficientFamily_jet_apply_on_rectangle | |
| (hB : ContDiffOn β β B (coordinateRectangle R a b)) | |
| (r : β) (hrR : r < R) (n : β) (x : Icc (-r) r) | |
| {y : β} (hy : y β Ioo a b) : | |
| iteratedDeriv n (coordinateCurvatureFamily B r) y x = | |
| curvatureYDerivative B n (coordinatePoint x y) := by | |
| have heval := iteratedDeriv_clm_comp (ContinuousMap.evalCLM β x) n | |
| ((coefficientFamily_contDiffOn_rectangle hB r hrR).contDiffAt | |
| (isOpen_Ioo.mem_nhds hy)) | |
| have hev : (fun t => coordinateCurvatureFamily B r t x) =αΆ [π y] | |
| (fun t => B (coordinatePoint x t)) := by | |
| filter_upwards [isOpen_Ioo.mem_nhds hy] with t ht | |
| exact coefficientFamily_apply_on_rectangle hB r hrR ht x | |
| have hdseq (j : β) (t : β) (ht : t β Ioo a b) : | |
| HasDerivAt (fun v => curvatureYDerivative B j (coordinatePoint x v)) | |
| (curvatureYDerivative B (j + 1) (coordinatePoint x t)) t := by | |
| have hmem : coordinatePoint x t β coordinateRectangle R a b := | |
| point_mem_rectangle (compact_t_mem_rectangle_interval hrR x) ht | |
| have hd : DifferentiableAt β (curvatureYDerivative B j) (coordinatePoint x t) := | |
| ((parameterDerivative_smooth_on_rectangle hB j).contDiffAt | |
| ((coordinateRectangle_isOpen R a b).mem_nhds hmem)).differentiableAt (by simp) | |
| exact hd.hasFDerivAt.comp_hasDerivAt t (coordinatePoint_hasDerivAt_y x t) | |
| have hseq := iteratedDeriv_eq_of_derivative_sequence isOpen_Ioo | |
| (fun j t => curvatureYDerivative B j (coordinatePoint x t)) hdseq n y hy | |
| calc | |
| iteratedDeriv n (coordinateCurvatureFamily B r) y x = | |
| iteratedDeriv n (fun t => coordinateCurvatureFamily B r t x) y := heval.symm | |
| _ = iteratedDeriv n (fun t => B (coordinatePoint x t)) y := hev.iteratedDeriv_eq n | |
| _ = curvatureYDerivative B n (coordinatePoint x y) := hseq | |
| theorem coefficientFamily_jet_contDiffOn_rectangle | |
| (hB : ContDiffOn β β B (coordinateRectangle R a b)) | |
| (r : β) (hr : 0 < r) (hrR : r < R) (n : β) : | |
| ContDiffOn β β (intervalFamilyJet r hr (coordinateCurvatureFamily B r) n) | |
| (Ioo (-r) r ΓΛ’ Ioo a b) := by | |
| have hmap : ContDiff β β (fun p : β Γ β => coordinatePoint p.1 p.2) := by | |
| unfold coordinatePoint | |
| fun_prop | |
| have hmem : MapsTo (fun p : β Γ β => coordinatePoint p.1 p.2) | |
| (Ioo (-r) r ΓΛ’ Ioo a b) (coordinateRectangle R a b) := by | |
| intro p hp | |
| exact point_mem_rectangle | |
| β¨(neg_lt_neg hrR).trans hp.1.1, hp.1.2.trans hrRβ© hp.2 | |
| have hc := (parameterDerivative_smooth_on_rectangle hB n).comp hmap.contDiffOn hmem | |
| apply hc.congr | |
| intro p hp | |
| unfold intervalFamilyJet | |
| rw [intervalExtension_apply_of_mem r hr _ β¨hp.1.1.le, hp.1.2.leβ©] | |
| exact coefficientFamily_jet_apply_on_rectangle hB r hrR n _ hp.2 | |
| theorem primitiveFamily_joint_smooth | |
| (r : β) (hr : 0 < r) {F : β β IntervalFunctions r} | |
| (hF : ContDiffOn β β F (Ioo a b)) | |
| (hFjets : β j, ContDiffOn β β (intervalFamilyJet r hr F j) | |
| (Ioo (-r) r ΓΛ’ Ioo a b)) : | |
| β j, ContDiffOn β β | |
| (intervalFamilyJet r hr (fun y => primitiveCLM r hr (F y)) j) | |
| (Ioo (-r) r ΓΛ’ Ioo a b) := by | |
| let P : β β IntervalFunctions r := fun y => primitiveCLM r hr (F y) | |
| let D : Set (β Γ β) := Ioo (-r) r ΓΛ’ Ioo a b | |
| have hD : IsOpen D := isOpen_Ioo.prod isOpen_Ioo | |
| have hP : ContDiffOn β β P (Ioo a b) := contDiffOn_const.clm_apply hF | |
| have hdx (j : β) (p : β Γ β) (hp : p β D) : | |
| HasDerivAt (fun x => intervalFamilyJet r hr P j (x, p.2)) | |
| (intervalFamilyJet r hr F j p) p.1 := by | |
| apply intervalFamilyJet_hasDerivAt_x_of_primitive r hr isOpen_Ioo hF 0 _ j hp.1 hp.2 | |
| intro y hy | |
| change primitiveCLM r hr (F y) = 0 + primitiveCLM r hr (F y) | |
| rw [zero_add] | |
| have hdy (j : β) (p : β Γ β) (hp : p β D) : | |
| HasDerivAt (fun y => intervalFamilyJet r hr P j (p.1, y)) | |
| (intervalFamilyJet r hr P (j + 1) p) p.2 := | |
| intervalFamilyJet_hasDerivAt_y r hr isOpen_Ioo hP j p.1 hp.2 | |
| have hnat : β n : β, β j, | |
| ContDiffOn β n (intervalFamilyJet r hr P j) D := by | |
| intro n | |
| induction n with | |
| | zero => | |
| intro j | |
| simpa only [Nat.cast_zero, contDiffOn_zero] using | |
| (intervalFamilyJet_continuousOn r hr isOpen_Ioo hP j).mono | |
| (fun p hp => β¨mem_univ p.1, hp.2β©) | |
| | succ n hn => | |
| intro j | |
| exact contDiffOn_succ_of_continuous_partials hD n | |
| (contDiffOn_infty.mp (hFjets j) n) (hn (j + 1)) (hdx j) (hdy j) | |
| intro j | |
| exact contDiffOn_infty.mpr (fun n => hnat n j) | |
| def clampedPrimitive (B : Coord β β) (r : β) (hr : 0 < r) (p : β Γ β) : β := | |
| intervalExtension r hr (primitiveCLM r hr (coordinateCurvatureFamily B r p.2)) p.1 | |
| theorem clampedPrimitive_contDiffOn | |
| (hB : ContDiffOn β β B (coordinateRectangle R a b)) | |
| (r : β) (hr : 0 < r) (hrR : r < R) : | |
| ContDiffOn β β (clampedPrimitive B r hr) (Ioo (-r) r ΓΛ’ Ioo a b) := by | |
| have h := primitiveFamily_joint_smooth r hr | |
| (coefficientFamily_contDiffOn_rectangle hB r hrR) | |
| (coefficientFamily_jet_contDiffOn_rectangle hB r hr hrR) 0 | |
| apply h.congr | |
| intro p hp | |
| simp only [intervalFamilyJet, iteratedDeriv_zero, clampedPrimitive] | |
| theorem clampedPrimitive_eq_integral | |
| (hB : ContDiffOn β β B (coordinateRectangle R a b)) | |
| (r : β) (hr : 0 < r) (hrR : r < R) | |
| {x y : β} (hx : x β Ioo (-r) r) (hy : y β Ioo a b) : | |
| clampedPrimitive B r hr (x, y) = β« t in 0..x, B (coordinatePoint t y) := by | |
| unfold clampedPrimitive | |
| rw [intervalExtension_apply_of_mem r hr _ β¨hx.1.le, hx.2.leβ©, primitiveCLM_apply] | |
| apply intervalIntegral.integral_congr | |
| intro t ht | |
| have hz : (0 : β) β Icc (-r) r := β¨by linarith, hr.leβ© | |
| have htmem : t β Icc (-r) r := uIcc_subset_Icc hz β¨hx.1.le, hx.2.leβ© ht | |
| rw [intervalExtension_apply_of_mem r hr _ htmem, | |
| coefficientFamily_apply_on_rectangle hB r hrR hy] | |
| theorem coordinatePrimitive_contDiffOn_inner | |
| (hB : ContDiffOn β β B (coordinateRectangle R a b)) | |
| (r : β) (hr : 0 < r) (hrR : r < R) : | |
| ContDiffOn β β (coordinatePrimitive B) (coordinateRectangle r a b) := by | |
| have hmap : ContDiff β β (fun p : Coord => (p 0, p 1)) := by fun_prop | |
| have hmem : MapsTo (fun p : Coord => (p 0, p 1)) (coordinateRectangle r a b) | |
| (Ioo (-r) r ΓΛ’ Ioo a b) := fun _ hp => hp | |
| have hc := (clampedPrimitive_contDiffOn hB r hr hrR).comp hmap.contDiffOn hmem | |
| apply hc.congr | |
| intro p hp | |
| exact (clampedPrimitive_eq_integral hB r hr hrR hp.1 hp.2).symm | |
| theorem coordinatePrimitive_contDiffOn | |
| (hB : ContDiffOn β β B (coordinateRectangle R a b)) : | |
| ContDiffOn β β (coordinatePrimitive B) (coordinateRectangle R a b) := by | |
| intro p hp | |
| obtain β¨r, hpr, hrRβ© := exists_between (abs_lt.mpr hp.1) | |
| have hr : 0 < r := (abs_nonneg (p 0)).trans_lt hpr | |
| have hpmem : p β coordinateRectangle r a b := β¨abs_lt.mp hpr, hp.2β© | |
| exact ((coordinatePrimitive_contDiffOn_inner hB r hr hrR).contDiffAt | |
| ((coordinateRectangle_isOpen r a b).mem_nhds hpmem)).contDiffWithinAt | |
| theorem coordinatePrimitive_initial (B : Coord β β) (y : β) : | |
| coordinatePrimitive B (coordinatePoint 0 y) = 0 := by | |
| simp [coordinatePrimitive, coordinatePoint] | |
| theorem coordinatePrimitive_partial_t | |
| (hB : ContDiffOn β β B (coordinateRectangle R a b)) | |
| (hR : 0 < R) {p : Coord} (hp : p β coordinateRectangle R a b) : | |
| coordPartial 0 (coordinatePrimitive B) p = B p := by | |
| have hslice : ContinuousOn (fun t => B (coordinatePoint t (p 1))) (Ioo (-R) R) := | |
| hB.continuousOn.comp (by unfold coordinatePoint; fun_prop) | |
| (fun t ht => point_mem_rectangle ht hp.2) | |
| have hz : (0 : β) β Ioo (-R) R := β¨by linarith, hRβ© | |
| have hseg : uIcc 0 (p 0) β Ioo (-R) R := by | |
| intro t ht | |
| exact β¨lt_of_lt_of_le (lt_min hz.1 hp.1.1) ht.1, | |
| lt_of_le_of_lt ht.2 (max_lt hz.2 hp.1.2)β© | |
| have hftc := intervalIntegral.integral_hasDerivAt_right | |
| (hslice.mono hseg).intervalIntegrable | |
| (ContinuousOn.stronglyMeasurableAtFilter isOpen_Ioo hslice (p 0) hp.1) | |
| (hslice.continuousAt (isOpen_Ioo.mem_nhds hp.1)) | |
| have hftc' : HasDerivAt (fun t => coordinatePrimitive B (coordinatePoint t (p 1))) | |
| (B p) (p 0) := by | |
| rw [point_eta] at hftc | |
| simpa [coordinatePrimitive, coordinatePoint] using hftc | |
| have hd : DifferentiableAt β (coordinatePrimitive B) (coordinatePoint (p 0) (p 1)) := by | |
| rw [point_eta] | |
| exact ((coordinatePrimitive_contDiffOn hB).contDiffAt | |
| ((coordinateRectangle_isOpen R a b).mem_nhds hp)).differentiableAt (by simp) | |
| have hchain := hd.hasFDerivAt.comp_hasDerivAt (p 0) (point_hasDerivAt_t (p 0) (p 1)) | |
| have hcoord : HasDerivAt (fun t => coordinatePrimitive B (coordinatePoint t (p 1))) | |
| (coordPartial 0 (coordinatePrimitive B) p) (p 0) := by | |
| simpa only [point_eta, Function.comp_def, coordPartial] using hchain | |
| exact hcoord.unique hftc' | |
| theorem primitive_directedM_partial_t | |
| (hB : ContDiffOn β β B (coordinateRectangle R a b)) (hR : 0 < R) | |
| {p : Coord} (hp : p β coordinateRectangle R a b) (edge lambda : β) : | |
| coordPartial 0 (directedM edge lambda (coordinatePrimitive B)) p = | |
| B p * directedM edge lambda (coordinatePrimitive B) p := by | |
| have hI : DifferentiableAt β (coordinatePrimitive B) p := | |
| ((coordinatePrimitive_contDiffOn hB).contDiffAt | |
| ((coordinateRectangle_isOpen R a b).mem_nhds hp)).differentiableAt (by simp) | |
| rw [directedM_partial, directedWeight_partial_t edge lambda hI, | |
| coordinatePrimitive_partial_t hB hR hp] | |
| simp only [directedM] | |
| ring | |
| theorem primitive_directedJ | |
| (hB : ContDiffOn β β B (coordinateRectangle R a b)) (hR : 0 < R) | |
| {p : Coord} (hp : p β coordinateRectangle R a b) | |
| (A C : Coord β β) (hA : DifferentiableAt β A p) | |
| (edge lambda epsilon : β) (hd : edgeDistance edge p β 0) : | |
| multiplierJ A B C (directedM edge lambda (coordinatePrimitive B)) | |
| (directedN edge lambda epsilon (coordinatePrimitive B)) p = | |
| directedWeight edge lambda (coordinatePrimitive B) p * | |
| (epsilon * p 0 * (C p - coordPartial 1 A p + | |
| A p * (weightH0 edge lambda p - coordPartial 1 (coordinatePrimitive B) p))) := by | |
| have hI : DifferentiableAt β (coordinatePrimitive B) p := | |
| ((coordinatePrimitive_contDiffOn hB).contDiffAt | |
| ((coordinateRectangle_isOpen R a b).mem_nhds hp)).differentiableAt (by simp) | |
| have he := (directed_coefficients A B C edge lambda epsilon hA hI hd).2.2 | |
| rw [coordinatePrimitive_partial_t hB hR hp] at he | |
| simpa only [sub_self, zero_add] using he | |
| end SmoothLocal.Weighted | |
| end | |
| end OAI | |