Download data/lean/OAI/Analysis/BiholderTransport/Calculus/HopfGradient.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 7.56 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/BiholderTransport/Calculus/HopfGradient.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/BiholderTransport/Calculus/HopfGradient.lean
-
curl -L -o HopfGradient.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/BiholderTransport/Calculus/HopfGradient.lean
7.56 kB
| import Mathlib | |
| import OAI.Analysis.BiholderTransport.Contact.HopfSupports | |
| namespace OAI | |
| noncomputable section | |
| open Set Filter Manifold Bundle Metric | |
| open scoped Topology ContDiff NNReal | |
| namespace WeakMTWTransport | |
| variable {n : β} {M : Type*} [MetricSpace M] [CompactSpace M] [Nonempty M] | |
| [ChartedSpace (Model n) M] [IsManifold π(β,Model n) β M] | |
| [RiemannianBundle (fun x : M => TangentSpace π(β,Model n) x)] | |
| [IsContMDiffRiemannianBundle π(β,Model n) β (Model n) | |
| (fun x : M => TangentSpace π(β,Model n) x)] | |
| [IsRiemannianManifold π(β,Model n) M] | |
| omit [CompactSpace M] [Nonempty M] in | |
| lemma cost_divided_triangle_two_times (x y z : M) {s t : β} (hs : 0<s) (ht : 0<t) : | |
| cost x z/(s+t) β€ cost x y/s+cost y z/t := by | |
| have hst : 0<s+t := add_pos hs ht | |
| have ha : 0<s/(s+t) := div_pos hs hst | |
| have ha1 : s/(s+t)<1 := (div_lt_one hst).mpr (lt_add_of_pos_right s ht) | |
| have H := div_le_div_of_nonneg_right (divided_cost_triangle x y z ha ha1) hst.le | |
| calc | |
| _ β€ _ := H | |
| _ = _ := by | |
| have he : 1-s/(s+t)=t/(s+t) := by field_simp; ring | |
| rw [he] | |
| field_simp | |
| omit [CompactSpace M] [Nonempty M] | |
| [RiemannianBundle (fun x : M => TangentSpace π(β,Model n) x)] | |
| [IsContMDiffRiemannianBundle π(β,Model n) β (Model n) | |
| (fun x : M => TangentSpace π(β,Model n) x)] | |
| [IsRiemannianManifold π(β,Model n) M] in | |
| lemma mdifferentiableAt_of_chart_differentiable {f : M β β} {x : M} | |
| (hd : DifferentiableAt β (fun y => f ((extChartAt π(β,Model n) x).symm y)) | |
| (extChartAt π(β,Model n) x x)) : | |
| MDifferentiableAt π(β,Model n) π(β,β) f x := by | |
| have H := hd.hasFDerivAt.hasMFDerivAt.comp x | |
| (mdifferentiableAt_extChartAt (I := π(β,Model n)) | |
| (show xβ(chartAt (Model n) x).source from mem_chart_source _ _)).hasMFDerivAt | |
| apply (H.congr_of_eventuallyEq ?_).mdifferentiableAt | |
| filter_upwards [extChartAt_source_mem_nhds (I := π(β,Model n)) x] with y hy | |
| simp only [Function.comp_apply,(extChartAt π(β,Model n) x).left_inv hy] | |
| lemma WeakMTW.mdifferentiable_hopfLax (hmtw : WeakMTW (n := n) (M := M)) | |
| {u v : M β β} (hu : Continuous u) (hv : Continuous v) (hdual : IsCostDualPair u v) | |
| {t : β} (ht : 0<t) (ht1 : t<1) : | |
| MDifferentiable π(β,Model n) π(β,β) (hopfLax t u) := by | |
| intro z | |
| obtain β¨B,hB,r,hr,_,Hβ© := hmtw.uniform_hopfLax_C11 z | |
| apply mdifferentiableAt_of_chart_differentiable | |
| exact (H t ht ht1 u v hu hv hdual).1 _ (mem_ball_self hr) | |
| lemma hopfLax_derivative_of_minimizer {u : M β β} (hu : Continuous u) | |
| {x : M} {p : TangentSpace π(β,Model n) x} (hp : pβminimizingVectors x) | |
| {t : β} (ht : 0<t) (ht1 : tβ€1) | |
| (heq : hopfLax t u (sprayFlow t (β¨x,pβ© : TangentBundle π(β,Model n) M)).1 = | |
| u x+cost x (sprayFlow t (β¨x,pβ© : TangentBundle π(β,Model n) M)).1/t) | |
| (hd : MDifferentiableAt π(β,Model n) π(β,β) (hopfLax t u) | |
| (sprayFlow t (β¨x,pβ© : TangentBundle π(β,Model n) M)).1) : | |
| HasMFDerivAt π(β,Model n) π(β,β) (hopfLax t u) | |
| (sprayFlow t (β¨x,pβ© : TangentBundle π(β,Model n) M)).1 | |
| (innerSL β (sprayFlow t (β¨x,pβ© : TangentBundle π(β,Model n) M)).2) := by | |
| let w : TangentBundle π(β,Model n) M := β¨x,pβ© | |
| let z := sprayFlow t w | |
| obtain β¨Ξ΅,hΞ΅,hΞ΅t,_,_,HΞ΅β© := exists_two_short_legs x p ht | |
| (show t<t+1 by linarith) zero_lt_one | |
| have hshort := (Filter.Eventually.self_of_nhds HΞ΅).2.2.2 | |
| let a := (sprayFlow (t-Ξ΅) w).1 | |
| let G : M β β := fun y => u x+cost x a/(t-Ξ΅)+cost a y/Ξ΅ | |
| have hG : HasMFDerivAt π(β,Model n) π(β,β) G z.1 (innerSL β z.2) := by | |
| have H := (hasMFDerivAt_const (I := π(β,Model n)) (I' := π(β,β)) | |
| (u x+cost x a/(t-Ξ΅)) z.1).add (hshort.const_smul Ξ΅β»ΒΉ) | |
| have heD : 0+Ξ΅β»ΒΉ β’ innerSL β (Ξ΅ β’ (sprayFlow t (β¨x,pβ© : TangentBundle π(β,Model n) M)).2) = | |
| innerSL β z.2 := by | |
| ext v | |
| simp only [zero_add,_root_.smul_apply,smul_eq_mul,innerSL_apply_apply, | |
| real_inner_smul_left] | |
| dsimp [z,w] | |
| field_simp | |
| replace H := H.congr_mfderiv heD | |
| have heG : G = ((fun _ => u x+cost x a/(t-Ξ΅)) + | |
| Ξ΅β»ΒΉ β’ fun y => dist (sprayFlow (t-Ξ΅) (β¨x,pβ© : TangentBundle π(β,Model n) M)).1 y^2/2) := by | |
| funext y | |
| dsimp [G,cost,a,w] | |
| ring | |
| rw [heG] | |
| exact H | |
| have hmin : dist x z.1=t*βpβ := by | |
| dsimp [z,w] | |
| rw [βriemannianExp_smul,minimizingVectors_smul hp ht.le ht1,norm_smul, | |
| Real.norm_eq_abs,abs_of_pos ht] | |
| have hleft : dist x a=(t-Ξ΅)*βpβ := | |
| sprayFlow_minimizing_prefix w (sub_pos.mpr hΞ΅t).le (by linarith) hmin | |
| have hright : dist a z.1=Ξ΅*βpβ := by | |
| have H := sprayFlow_minimizing_subinterval w (sub_pos.mpr hΞ΅t).le (by linarith) hmin | |
| simpa only [sub_sub_cancel] using H | |
| have hcontact : hopfLax t u z.1=G z.1 := by | |
| rw [heq] | |
| dsimp [G,cost] | |
| rw [hmin,hleft,hright] | |
| field_simp | |
| ring | |
| have hle : β y, hopfLax t u yβ€G y := by | |
| intro y | |
| have H := cost_divided_triangle_two_times x a y (sub_pos.mpr hΞ΅t) hΞ΅ | |
| rw [sub_add_cancel] at H | |
| exact (hopfLax_le hu t y x).trans (by dsimp [G]; linarith) | |
| exact hd.hasMFDerivAt.congr_mfderiv | |
| ((upper_contact_mfderiv hd hG.mdifferentiableAt (Filter.Eventually.of_forall hle) hcontact).trans hG.mfderiv) | |
| def riemannianGradient (f : M β β) (x : M) : TangentSpace π(β,Model n) x := by | |
| letI : FiniteDimensional β (TangentSpace π(β,Model n) x) := | |
| inferInstanceAs (FiniteDimensional β (Model n)) | |
| exact (InnerProductSpace.toDual β (TangentSpace π(β,Model n) x)).symm | |
| (mfderiv π(β,Model n) π(β,β) f x) | |
| omit [CompactSpace M] [Nonempty M] | |
| [IsContMDiffRiemannianBundle π(β,Model n) β (Model n) | |
| (fun x : M => TangentSpace π(β,Model n) x)] | |
| [IsRiemannianManifold π(β,Model n) M] in | |
| lemma riemannianGradient_eq_of_derivative {f : M β β} {x : M} | |
| {v : TangentSpace π(β,Model n) x} | |
| (h : HasMFDerivAt π(β,Model n) π(β,β) f x (innerSL β v)) : | |
| riemannianGradient (n := n) f x=v := by | |
| let : FiniteDimensional β (TangentSpace π(β,Model n) x) := | |
| inferInstanceAs (FiniteDimensional β (Model n)) | |
| rw [riemannianGradient,h.mfderiv] | |
| exact (InnerProductSpace.toDual β (TangentSpace π(β,Model n) x)).symm_apply_apply v | |
| lemma WeakMTW.hopfLax_backward_flow (hmtw : WeakMTW (n := n) (M := M)) | |
| {v : M β β} (hv : Continuous v) {t : β} (ht : 0<t) (ht1 : t<1) | |
| (q : subgradientGraph (n := n) (cTransform v)) : | |
| sprayFlow (-t) | |
| (β¨graphProjection (cTransform v) t q, | |
| riemannianGradient (hopfLax t (cTransform v)) (graphProjection (cTransform v) t q)β© : | |
| TangentBundle π(β,Model n) M) = q.1 := by | |
| have hdual : IsCostDualPair (cTransform v) (cTransform (cTransform v)) := | |
| β¨(cTransform_triple hv).symm,rflβ© | |
| have hu := continuous_cTransform hv | |
| have hp := (hmtw.global_support hv q.2).1 | |
| have hbase : graphProjection (cTransform v) t q=(sprayFlow t q.1).1 := | |
| riemannianExp_smul _ _ _ | |
| have hd := hmtw.mdifferentiable_hopfLax hu (continuous_cTransform hu) hdual ht ht1 | |
| have hval := hmtw.hopfLax_graph_value hv ht ht1 q | |
| rw [hbase] at hval | |
| have hder := hopfLax_derivative_of_minimizer hu hp ht ht1.le hval (hd _) | |
| rw [hbase,riemannianGradient_eq_of_derivative hder] | |
| change sprayFlow (-t) (sprayFlow t q.1)=q.1 | |
| rw [βsprayFlow_add,neg_add_cancel,sprayFlow_zero] | |
| end WeakMTWTransport | |
| end | |
| end OAI | |