Download data/lean/OAI/Geometry/IntegralFillings/Optimality/BallStokes.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 7.83 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/IntegralFillings/Optimality/BallStokes.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Geometry/IntegralFillings/Optimality/BallStokes.lean
-
curl -L -o BallStokes.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/IntegralFillings/Optimality/BallStokes.lean
7.83 kB
| import Mathlib | |
| import OAI.Geometry.IntegralFillings.Slicing.NormalRestriction | |
| import OAI.Geometry.IntegralFillings.Optimality.BallCurrent | |
| namespace OAI | |
| section | |
| open Set Filter MeasureTheory | |
| open scoped Topology ENNReal NNReal | |
| namespace SharpIntegralFillings.Optimality | |
| open SmoothCutoff | |
| noncomputable def radiusFunction (d : β) (x : UnitBall d) : β := -βx.valβ | |
| lemma radiusFunction_lipschitz (d : β) : LipschitzWith 1 (radiusFunction d) := by | |
| apply LipschitzWith.of_dist_le_mul | |
| intro x y | |
| simp only [radiusFunction, NNReal.coe_one, one_mul, dist_neg_neg, Real.dist_eq, | |
| Subtype.dist_eq] | |
| rw [dist_eq_norm] | |
| exact abs_norm_sub_norm_le x.val y.val | |
| lemma radiusFunction_boundedLip (d : β) : BoundedLip (radiusFunction d) := by | |
| refine β¨β¨1, radiusFunction_lipschitz dβ©, 1, ?_β© | |
| intro x | |
| simpa only [radiusFunction, abs_neg, abs_of_nonneg (norm_nonneg _), | |
| Metric.mem_closedBall, dist_zero_right] using x.property | |
| noncomputable def radialProfile {d : β} (a : ββ₯0) (t : β) (z : Euc d) : β := | |
| profile a t (-βzβ) | |
| lemma radialProfile_contDiff {d : β} {a : ββ₯0} {t : β} | |
| (ha : 1 < (a:β) * (-t)) : ContDiff β 1 (radialProfile (d := d) a t) := by | |
| apply contDiff_iff_contDiffAt.mpr | |
| intro x | |
| by_cases hx : x = 0 | |
| Β· subst x | |
| have hc : Continuous (fun z : Euc d => (a:β) * (-βzβ - t)) := by fun_prop | |
| have he : radialProfile (d := d) a t =αΆ [π 0] fun _ => 1 := by | |
| have ha' : 1 < (a:β) * (-β(0 : Euc d)β - t) := by simpa using ha | |
| filter_upwards [hc.continuousAt.eventually (eventually_gt_nhds ha')] with z hz | |
| exact Real.smoothTransition.one_of_one_le hz.le | |
| exact contDiffAt_const.congr_of_eventuallyEq he | |
| Β· exact Real.smoothTransition.contDiff.contDiffAt.comp x | |
| (contDiffAt_const.mul ((contDiffAt_id.norm β hx).neg.sub contDiffAt_const)) | |
| lemma radialProfile_compact {d : β} (a : ββ₯0) (t : β) : | |
| HasCompactSupport (radialProfile (d := d) a t) := by | |
| apply HasCompactSupport.intro (isCompact_closedBall (0 : Euc d) (-t)) | |
| intro x hx | |
| apply profile_zero | |
| have hh : -t < βxβ := by simpa only [Metric.mem_closedBall, dist_zero_right, not_le] using hx | |
| linarith | |
| lemma radialProfile_zero_outside {d : β} (a : ββ₯0) {t : β} (ht : -1 < t) | |
| {x : Euc d} (hx : x β Metric.ball 0 1) : radialProfile a t x = 0 := by | |
| apply profile_zero | |
| have hh : 1 β€ βxβ := by simpa only [Metric.mem_ball, dist_zero_right, not_lt] using hx | |
| linarith | |
| lemma radialProfile_fderiv_zero_outside {d : β} (a : ββ₯0) {t : β} (ht : -1 < t) | |
| {x : Euc d} (hx : x β Metric.ball 0 1) : fderiv β (radialProfile a t) x = 0 := by | |
| have hh : 1 β€ βxβ := by simpa only [Metric.mem_ball, dist_zero_right, not_lt] using hx | |
| have he : radialProfile a t =αΆ [π x] fun _ => 0 := by | |
| have hc : Continuous (fun y : Euc d => -βyβ) := continuous_norm.neg | |
| have hx' : -βxβ < t := by linarith | |
| filter_upwards [hc.continuousAt.eventually_lt_const hx'] with y hy | |
| exact profile_zero a hy.le | |
| simpa using he.fderiv_eq (π := β) | |
| lemma ballChart_param_lipschitz (d : β) : LipschitzWith 1 (ballChart d).param := by | |
| apply LipschitzWith.of_dist_le_mul | |
| intro x y | |
| simp only [NNReal.coe_one, one_mul] | |
| rfl | |
| lemma ballChart_scalar_extension {d : β} {f : UnitBall d β β} {K : ββ₯0} | |
| (hf : LipschitzWith K f) : | |
| β F : Euc d β β, LipschitzWith K F β§ EqOn ((ballChart d).scalar f) F (ballChart d).domain := by | |
| have hs : LipschitzOnWith K ((ballChart d).scalar f) (ballChart d).domain := by | |
| simpa using (ballChart d).scalar_lipschitzOn (ballChart_param_lipschitz d) hf | |
| exact hs.extend_real | |
| lemma ballChart_action_extensions {d : β} {b : UnitBall d β β} | |
| {Ο : Fin d β UnitBall d β β} {B : Euc d β β} {P : Fin d β Euc d β β} | |
| {K : Fin d β ββ₯0} (hab : Admissible b Ο) (hP : β i, LipschitzWith (K i) (P i)) | |
| (hb : EqOn ((ballChart d).scalar b) B (ballChart d).domain) | |
| (hΟ : β i, EqOn ((ballChart d).scalar (Ο i)) (P i) (ballChart d).domain) : | |
| (ballChart d).action b Ο = β« z in Metric.ball 0 1, | |
| B z * coordinateJacobian P (fun j => EuclideanSpace.single j 1) z := by | |
| rw [IntegerChart.action, ite_eq_left hab] | |
| apply integral_congr_ae | |
| filter_upwards [(ballChart d).ae_jacobian_eq_extensions hP hΟ, | |
| ae_restrict_mem (ballChart d).borel] with z hj hz | |
| change (1:β€) * ((ballChart d).scalar b z) * _ = _ | |
| rw [Int.cast_one, one_mul, hb hz, hj] | |
| congr 1 | |
| rw [coordinateJacobian, β Matrix.det_transpose] | |
| rfl | |
| lemma radialProfile_lipschitz {d : β} (a : ββ₯0) (t : β) : | |
| β K : ββ₯0, LipschitzWith K (radialProfile (d := d) a t) := by | |
| obtain β¨C, hCβ© := exists_profile_bounds | |
| have hn : LipschitzWith 1 (fun z : Euc d => -βzβ) := by | |
| apply LipschitzWith.of_dist_le_mul | |
| intro x y | |
| simp only [NNReal.coe_one, one_mul, dist_neg_neg, Real.dist_eq] | |
| rw [dist_eq_norm] | |
| exact abs_norm_sub_norm_le x y | |
| exact β¨C*a*1, (hC a t).1.comp hnβ© | |
| lemma ballChart_local_stokes {k : β} {a : ββ₯0} {t : β} (ht : -1 < t) | |
| (ha : 1 < (a:β) * (-t)) {b : UnitBall (k+1) β β} | |
| {Ο : Fin k β UnitBall (k+1) β β} (hab : Admissible b Ο) : | |
| (ballChart (k+1)).action (profile a t β radiusFunction (k+1)) (Matrix.vecCons b Ο) = | |
| -(ballChart (k+1)).action b (Matrix.vecCons (profile a t β radiusFunction (k+1)) Ο) := by | |
| let C := ballChart (k+1) | |
| let f := radialProfile (d := k+1) a t | |
| obtain β¨K, hKβ© := hab.1.1 | |
| obtain β¨B, hB, hBeβ© := ballChart_scalar_extension hK | |
| choose L hL using hab.2 | |
| choose P hP hPe using fun i => ballChart_scalar_extension (hL i) | |
| obtain β¨J,hJβ© := radialProfile_lipschitz (d := k+1) a t | |
| have hprof := Slicing.profile_comp_boundedLip (radiusFunction_boundedLip (k+1)) a t | |
| have hfe : EqOn (C.scalar (profile a t β radiusFunction (k+1))) f C.domain := by | |
| intro z hz | |
| rw [C.scalar_eq hz] | |
| rfl | |
| have hleft : C.action (profile a t β radiusFunction (k+1)) (Matrix.vecCons b Ο) = | |
| β« z in Metric.ball 0 1, f z * coordinateJacobian (Fin.cons B P) | |
| (fun j => EuclideanSpace.single j 1) z := by | |
| apply ballChart_action_extensions (K := Fin.cons K L) | |
| (Foundations.admissible_vecCons hprof hab.1.1 hab.2) | |
| Β· intro i | |
| exact Fin.cases hB (fun j => hP j) i | |
| Β· exact hfe | |
| Β· intro i | |
| exact Fin.cases hBe (fun j => hPe j) i | |
| have hright : C.action b (Matrix.vecCons (profile a t β radiusFunction (k+1)) Ο) = | |
| β« z in Metric.ball 0 1, B z * coordinateJacobian (Fin.cons f P) | |
| (fun j => EuclideanSpace.single j 1) z := by | |
| apply ballChart_action_extensions (K := Fin.cons J L) | |
| (Foundations.admissible_vecCons hab.1 hprof.1 hab.2) | |
| Β· intro i | |
| exact Fin.cases hJ (fun j => hP j) i | |
| Β· exact hBe | |
| Β· intro i | |
| exact Fin.cases hfe (fun j => hPe j) i | |
| rw [hleft, hright] | |
| rw [setIntegral_eq_integral_of_forall_compl_eq_zero (fun z hz => ?_)] | |
| Β· rw [setIntegral_eq_integral_of_forall_compl_eq_zero (fun z hz => ?_)] | |
| Β· have hPu : β i, LipschitzWith (β j, L j) (P i) := fun i => | |
| (hP i).weaken (Finset.single_le_sum (fun j _ => zero_le) (Finset.mem_univ i)) | |
| exact integral_coordinateJacobian_cons volume (radialProfile_contDiff ha) | |
| (radialProfile_compact a t) hB hPu (fun j => EuclideanSpace.single j 1) | |
| Β· have hdf : fderiv β f z = 0 := radialProfile_fderiv_zero_outside a ht hz | |
| have hdet : coordinateJacobian (Fin.cons f P) (fun j => EuclideanSpace.single j 1) z = 0 := by | |
| apply Matrix.det_eq_zero_of_column_eq_zero 0 | |
| intro i | |
| change fderiv β f z _ = 0 | |
| rw [hdf] | |
| rfl | |
| rw [hdet, mul_zero] | |
| Β· rw [show f z = 0 from radialProfile_zero_outside a ht hz, zero_mul] | |
| end SharpIntegralFillings.Optimality | |
| end | |
| end OAI | |