introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
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