Download data/lean/OAI/Geometry/Perimeter/Regularity/ContinuousWithinAtSurfaceGradientOfLocalLevel.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 24.1 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/Perimeter/Regularity/ContinuousWithinAtSurfaceGradientOfLocalLevel.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Geometry/Perimeter/Regularity/ContinuousWithinAtSurfaceGradientOfLocalLevel.lean
-
curl -L -o ContinuousWithinAtSurfaceGradientOfLocalLevel.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/Perimeter/Regularity/ContinuousWithinAtSurfaceGradientOfLocalLevel.lean
24.1 kB
| import OAI.Geometry.Perimeter.Regularity.ExistsDiameterCoverOfHausdorffZero | |
| namespace OAI | |
| noncomputable section | |
| open Set Filter MeasureTheory | |
| open scoped Topology ENNReal NNReal ContDiff | |
| open scoped Topology ENNReal NNReal | |
| namespace RPI.Boundary | |
| theorem continuousWithinAt_surfaceGradient_of_local_level {n : β} | |
| {S U : Set (Space n)} {f g : Space n β β} {x : Space n} | |
| (hU : IsOpen U) (hxU : x β U) (hxS : x β S) | |
| (hf : ContDiffOn β 1 f U) (hdf : β y β U, fderiv β f y β 0) | |
| (hlevel : β y β U, y β S β f y = 0) | |
| (hg : ContDiffAt β 1 g x) : | |
| ContinuousWithinAt (surfaceGradient S g) S x := by | |
| let F : Space n β Space n := fun y β¦ gradient g y - | |
| (inner β (gradient f y) (gradient g y) / βgradient f yβ ^ 2) β’ gradient f y | |
| have hformula : β y β S β© U, surfaceGradient S g y = F y := by | |
| intro y hy | |
| apply surfaceGradient_eq_level_formula (hf.contDiffAt (hU.mem_nhds hy.2)) (hdf y hy.2) | |
| filter_upwards [hU.mem_nhds hy.2] with z hz | |
| rw [(hlevel y hy.2).mp hy.1] | |
| exact hlevel z hz | |
| have hf' : ContinuousAt (gradient f) x := | |
| continuousAt_gradient_of_contDiffAt (hf.contDiffAt (hU.mem_nhds hxU)) | |
| have hg' : ContinuousAt (gradient g) x := continuousAt_gradient_of_contDiffAt hg | |
| have hgn : gradient f x β 0 := by | |
| intro he | |
| apply hdf x hxU | |
| rw [β toDual_gradient, he, map_zero] | |
| have hF : ContinuousAt F x := | |
| hg'.sub (((hf'.inner hg').div (hf'.norm.pow 2) | |
| (pow_ne_zero _ (norm_ne_zero_iff.mpr hgn))).smul hf') | |
| apply hF.continuousWithinAt.congr_of_eventuallyEq _ (hformula x β¨hxS, hxUβ©) | |
| filter_upwards [self_mem_nhdsWithin, | |
| mem_nhdsWithin_of_mem_nhds (hU.mem_nhds hxU)] with y hyS hyU | |
| exact hformula y β¨hyS, hyUβ© | |
| end RPI.Boundary | |
| end | |
| noncomputable section | |
| open Set Filter MeasureTheory | |
| open scoped Topology ENNReal NNReal ContDiff | |
| open scoped Topology ENNReal NNReal | |
| namespace RPI.Boundary | |
| theorem surfaceGradient_aestronglyMeasurable_of_regular_locus {n : β} (hn : 8 β€ n) | |
| {S Z : Set (Space n)} (hS : MeasurableSet S) (hZ : MeasurableSet Z) | |
| (hdim : dimH Z β€ (n - 8 : β)) | |
| (hreg : β x β S \ Z, β U : Set (Space n), IsOpen U β§ x β U β§ | |
| β f : Space n β β, ContDiffOn β 1 f U β§ | |
| (β y β U, fderiv β f y β 0) β§ | |
| (β y β U, y β S β f y = 0)) | |
| {g : Space n β β} (hg : ContDiff β 1 g) : | |
| AEStronglyMeasurable (surfaceGradient S g) (surfaceMeasure S) := by | |
| have hc : ContinuousOn (surfaceGradient S g) (S \ Z) := by | |
| intro x hx | |
| obtain β¨U, hU, hxU, f, hf, hdf, hlevelβ© := hreg x hx | |
| exact (continuousWithinAt_surfaceGradient_of_local_level hU hxU hx.1 hf hdf | |
| hlevel hg.contDiffAt).mono sdiff_subset | |
| have hs : βα΅ x βsurfaceMeasure S, x β S := ae_restrict_mem hS | |
| have hz : βα΅ x βsurfaceMeasure S, x β Z := by | |
| simpa only [ae_iff, not_not, Set.ofPred_mem_eq] using | |
| surfaceMeasure_zero_of_singular_dim hn S Z hdim | |
| have hregular : βα΅ x βsurfaceMeasure S, x β S \ Z := by | |
| filter_upwards [hs, hz] with x hx hzx | |
| exact β¨hx, hzxβ© | |
| have hmeas := hc.aestronglyMeasurable (ΞΌ := surfaceMeasure S) (hS.diff hZ) | |
| rwa [Measure.restrict_eq_self_of_ae_mem hregular] at hmeas | |
| end RPI.Boundary | |
| end | |
| noncomputable section | |
| open Set Filter MeasureTheory | |
| open scoped Topology ENNReal NNReal ContDiff | |
| open scoped Topology ENNReal NNReal | |
| namespace RPI.Boundary | |
| theorem exists_geometric_capacity_sequence {n : β} (hn : 8 β€ n) | |
| {S Z : Set (Space n)} (hS : IsClosed S) (V : Set (Space n)) | |
| (hZc : IsCompact Z) (hZd : dimH Z β€ (n - 8 : β)) | |
| (hreg : β x β S \ Z, β U : Set (Space n), IsOpen U β§ x β U β§ | |
| β f : Space n β β, ContDiffOn β 1 f U β§ | |
| (β y β U, fderiv β f y β 0) β§ | |
| (β y β U, y β S β f y = 0)) | |
| {A rβ : β} (hA : 0 < A) (hrβ : 0 < rβ) | |
| (hgrowth : β c β Z, β r : β, 0 < r β r < rβ β | |
| (surfaceMeasure S).restrict V (Metric.ball c r) β€ | |
| ENNReal.ofReal (A * r ^ (n - 1))) : | |
| β Ο : β β Space n β β, | |
| (β i, ContDiff β β (Ο i) β§ (β x, Ο i x β Icc (0 : β) 1) β§ | |
| (β U : Set (Space n), IsOpen U β§ Z β U β§ β x β U, Ο i x = 0) β§ | |
| MemLp (surfaceGradient S (Ο i)) 2 ((surfaceMeasure S).restrict V)) β§ | |
| (βα΅ x β(surfaceMeasure S).restrict V, | |
| Tendsto (fun i β¦ Ο i x) atTop (π 1)) β§ | |
| Tendsto (fun i β¦ vectorEnergy ((surfaceMeasure S).restrict V) | |
| (surfaceGradient S (Ο i))) atTop (π 0) := by | |
| apply exists_memLp_capacity_sequence hn S V Z hZc hZd _ hA hrβ hgrowth | |
| intro f hf | |
| exact (surfaceGradient_aestronglyMeasurable_of_regular_locus hn hS.measurableSet | |
| hZc.isClosed.measurableSet hZd hreg (hf.of_le (by norm_num))).mono_measure | |
| Measure.restrict_le_self | |
| end RPI.Boundary | |
| end | |
| noncomputable section | |
| open Set Filter MeasureTheory | |
| open scoped Topology ENNReal NNReal ContDiff | |
| open scoped Topology ENNReal NNReal | |
| namespace RPI | |
| theorem vectorEnergy_sub_tendsto_zero_of_toLp_tendsto | |
| {X V : Type*} [MeasurableSpace X] [NormedAddCommGroup V] [InnerProductSpace β V] | |
| {ΞΌ : Measure X} {F : β β X β V} {G : X β V} | |
| (hF : β i, MemLp (F i) 2 ΞΌ) (hG : MemLp G 2 ΞΌ) | |
| (ht : Tendsto (fun i β¦ (hF i).toLp (F i)) atTop (π (hG.toLp G))) : | |
| Tendsto (fun i β¦ vectorEnergy ΞΌ (fun x β¦ F i x - G x)) atTop (π 0) := by | |
| have he : (fun i β¦ vectorEnergy ΞΌ (fun x β¦ F i x - G x)) = | |
| (fun i β¦ β(hF i).toLp (F i) - hG.toLp Gββ ^ 2) := by | |
| funext i | |
| exact vectorEnergy_eq_enorm_toLp_sq ((hF i).sub hG) | |
| rw [he] | |
| simpa only [sub_self, enorm_zero, zero_pow (by decide : 2 β 0)] using | |
| (ENNReal.Tendsto.pow (ht.sub (tendsto_const_nhds (x := hG.toLp G))).enorm (n := 2)) | |
| namespace Boundary | |
| theorem exists_compact_energy_approximants_of_mem_sobolevGraph {n : β} | |
| (S V : Set (Space n)) (hV : Bornology.IsBounded V) (hVm : MeasurableSet V) | |
| {h : Space n β β} {G : Space n β Space n} | |
| (hh : MemLp h 2 ((surfaceMeasure S).restrict V)) | |
| (hG : MemLp G 2 ((surfaceMeasure S).restrict V)) | |
| (hp : (hh.toLp h, hG.toLp G) β closure (smoothGradientGraph S V)) : | |
| β Ο : β β Space n β β, | |
| (β j, ContDiff β β (Ο j) β§ HasCompactSupport (Ο j)) β§ | |
| Tendsto (fun j β¦ β«β» x, ENNReal.ofReal (|Ο j x - h x| ^ 2) | |
| β(surfaceMeasure S).restrict V) atTop (π 0) β§ | |
| Tendsto (fun j β¦ β«β» x, ENNReal.ofReal | |
| (βsurfaceGradient S (Ο j) x - G xβ ^ 2) | |
| β(surfaceMeasure S).restrict V) atTop (π 0) := by | |
| obtain β¨Ο, hΟs, hΟ, hDΟ, hlimβ© := | |
| exists_compact_approximants_of_mem_sobolevGraph S V hV hVm hh hG hp | |
| refine β¨Ο, hΟs, ?_, ?_β© | |
| Β· simpa only [vectorEnergy, Real.norm_eq_abs] using | |
| vectorEnergy_sub_tendsto_zero_of_toLp_tendsto hΟ hh hlim.fst_nhds | |
| Β· exact vectorEnergy_sub_tendsto_zero_of_toLp_tendsto hDΟ hG hlim.snd_nhds | |
| end Boundary | |
| end RPI | |
| end | |
| noncomputable section | |
| open Set Filter MeasureTheory | |
| open scoped Topology ENNReal NNReal ContDiff | |
| open scoped Topology ENNReal NNReal | |
| open scoped ENNReal Topology ContDiff Pointwise | |
| namespace RPISingularHarnack | |
| abbrev Euc (n : β) := EuclideanSpace β (Fin n) | |
| def HasHalfspaceBlowup {n : β} (E : Set (Euc n)) (x v : Euc n) : Prop := | |
| βvβ = 1 β§ | |
| Tendsto (fun r : β => | |
| (r ^ n)β»ΒΉ * β« y in Metric.ball x r, | |
| |E.indicator (fun _ => (1 : β)) y - | |
| {z | inner β (z - x) v < 0}.indicator (fun _ => (1 : β)) y|) | |
| (π[>] (0 : β)) (π 0) | |
| def approximateNormal {n : β} (E : Set (Euc n)) (x : Euc n) : Euc n := by | |
| classical | |
| exact if h : β v, HasHalfspaceBlowup E x v then Classical.choose h else 0 | |
| def tangentialGradient {n : β} (E : Set (Euc n)) (Ο : Euc n β β) | |
| (x : Euc n) : Euc n := | |
| gradient Ο x - (inner β (gradient Ο x) (approximateNormal E x)) β’ | |
| approximateNormal E x | |
| theorem eventually_sublevel_membership {n : β} {E : Set (Euc n)} | |
| {f : Euc n β β} {x z : Euc n} {L : Euc n βL[β] β} | |
| (hd : HasFDerivAt f L x) (hx : f x = 0) | |
| (hlocal : βαΆ y in π x, y β E β f y < 0) (hz : L z β 0) : | |
| βαΆ r : β in π[>] 0, x + r β’ z β E β L z < 0 := by | |
| have hp : HasDerivAt (fun r : β β¦ x + r β’ z) z 0 := by | |
| simpa using ((hasDerivAt_id (0 : β)).smul_const z).const_add x | |
| have hc : HasDerivAt (fun r : β β¦ f (x + r β’ z)) (L z) 0 := by | |
| exact (show HasFDerivAt f L (x + (0 : β) β’ z) from by simpa using hd).comp_hasDerivAt 0 hp | |
| have ht : Tendsto (fun r : β β¦ rβ»ΒΉ * f (x + r β’ z)) (π[>] 0) (π (L z)) := by | |
| simpa [hx] using hc.tendsto_slope_zero_right | |
| have hm : βαΆ r : β in π[>] 0, x + r β’ z β E β f (x + r β’ z) < 0 := | |
| (show Tendsto (fun r : β β¦ x + r β’ z) (π[>] 0) (π x) from | |
| (show Tendsto (fun r : β β¦ x + r β’ z) (π 0) (π x) from by | |
| simpa [ContinuousAt] using hp.continuousAt).mono_left nhdsWithin_le_nhds).eventually hlocal | |
| rcases lt_or_gt_of_ne hz with hneg | hpos | |
| Β· filter_upwards [hm, ht.eventually (gt_mem_nhds hneg), self_mem_nhdsWithin] with r hm hr hpr | |
| have hfr : f (x + r β’ z) < 0 := by | |
| have hi : 0 < rβ»ΒΉ := inv_pos.mpr hpr | |
| nlinarith | |
| simp only [hm, hfr, hneg] | |
| Β· filter_upwards [hm, ht.eventually (lt_mem_nhds hpos), self_mem_nhdsWithin] with r hm hr hpr | |
| have hfr : 0 < f (x + r β’ z) := by | |
| have hi : 0 < rβ»ΒΉ := inv_pos.mpr hpr | |
| nlinarith | |
| simp only [hm, not_lt.mpr hfr.le, not_lt.mpr hpos.le] | |
| theorem normalized_ball_integral {n : β} (g : Euc n β β) (x : Euc n) | |
| {r : β} (hr : 0 < r) : | |
| (r ^ n)β»ΒΉ * β« y in Metric.ball x r, g y = | |
| β« z in Metric.ball (0 : Euc n) 1, g (x + r β’ z) := by | |
| have hc := Measure.integral_comp_smul_of_nonneg (volume : Measure (Euc n)) | |
| (fun y β¦ (Metric.ball x r).indicator g (x + y)) r (hR := hr.le) | |
| simp only [finrank_euclideanSpace, Fintype.card_fin, smul_eq_mul, | |
| integral_add_left_eq_self, integral_indicator measurableSet_ball] at hc | |
| rw [β hc, β integral_indicator measurableSet_ball] | |
| apply integral_congr_ae | |
| filter_upwards [] with z | |
| have hm : x + r β’ z β Metric.ball x r β z β Metric.ball (0 : Euc n) 1 := by | |
| simp only [Metric.mem_ball, dist_eq_norm, add_sub_cancel_left, | |
| sub_zero, norm_smul, Real.norm_eq_abs, abs_of_pos hr] | |
| constructor <;> intro h <;> nlinarith | |
| by_cases hz : z β Metric.ball (0 : Euc n) 1 | |
| Β· simp [hz, hm.mpr hz] | |
| Β· have hn : x + r β’ z β Metric.ball x r := fun h β¦ hz (hm.mp h) | |
| rw [Set.indicator_of_notMem hn, Set.indicator_of_notMem hz] | |
| theorem ae_linear_ne_zero {n : β} {L : Euc n βL[β] β} (hL : L β 0) : | |
| βα΅ z β(volume : Measure (Euc n)), L z β 0 := by | |
| have hk : L.ker β β€ := by | |
| intro hk | |
| apply hL | |
| ext z | |
| have hz : z β L.ker := hk βΈ Submodule.mem_top | |
| exact hz | |
| have hn : (volume : Measure (Euc n)) {z | L z = 0} = 0 := | |
| Measure.addHaar_submodule (volume : Measure (Euc n)) L.ker hk | |
| simpa only [ae_iff, not_not] using hn | |
| theorem halfspace_indicator_rescale {n : β} (x v z : Euc n) {r : β} (hr : 0 < r) : | |
| {y | inner β (y - x) v < 0}.indicator (fun _ β¦ (1 : β)) (x + r β’ z) = | |
| {y | inner β y v < 0}.indicator (fun _ β¦ (1 : β)) z := by | |
| have hm : inner β ((x + r β’ z) - x) v < 0 β inner β z v < 0 := by | |
| simp only [add_sub_cancel_left, real_inner_smul_left] | |
| constructor <;> intro h <;> nlinarith | |
| simp only [Set.indicator, Set.mem_ofPred_eq, hm] | |
| theorem hasHalfspaceBlowup_of_regular_sublevel {n : β} {E : Set (Euc n)} | |
| (hE : MeasurableSet E) {f : Euc n β β} {x v : Euc n} {L : Euc n βL[β] β} | |
| (hd : HasFDerivAt f L x) (hx : f x = 0) | |
| (hlocal : βαΆ y in π x, y β E β f y < 0) | |
| (hv : βvβ = 1) {a : β} (ha : 0 < a) | |
| (hL : β z, L z = a * inner β z v) : HasHalfspaceBlowup E x v := by | |
| have hLn : L β 0 := by | |
| intro he | |
| have hval := hL v | |
| simp only [he, zero_apply, real_inner_self_eq_norm_sq, hv, | |
| one_pow, mul_one] at hval | |
| linarith | |
| let H : Set (Euc n) := {z | inner β z v < 0} | |
| have hH : MeasurableSet H := | |
| (isOpen_lt (continuous_id.inner continuous_const) continuous_const).measurableSet | |
| let F : β β Euc n β β := fun r z β¦ | |
| |E.indicator (fun _ β¦ (1 : β)) (x + r β’ z) - H.indicator (fun _ β¦ (1 : β)) z| | |
| have hsign : β z, L z < 0 β inner β z v < 0 := by | |
| intro z | |
| rw [hL] | |
| constructor <;> intro h <;> nlinarith | |
| have hmeas : β r, AEStronglyMeasurable (F r) | |
| (volume.restrict (Metric.ball (0 : Euc n) 1)) := by | |
| intro r | |
| have he : Measurable (E.indicator (fun _ : Euc n β¦ (1 : β))) := | |
| measurable_const.indicator hE | |
| have hh : Measurable (H.indicator (fun _ : Euc n β¦ (1 : β))) := | |
| measurable_const.indicator hH | |
| have hm : Measurable (fun z : Euc n β¦ x + r β’ z) := | |
| measurable_const.add (measurable_id.const_smul r) | |
| exact ((he.comp hm).sub hh).abs.aestronglyMeasurable | |
| have hb : β r, βα΅ z βvolume.restrict (Metric.ball (0 : Euc n) 1), βF r zβ β€ 1 := by | |
| intro r | |
| filter_upwards [] with z | |
| by_cases he : x + r β’ z β E <;> by_cases hh : z β H <;> simp [F, he, hh] | |
| have ht : βα΅ z βvolume.restrict (Metric.ball (0 : Euc n) 1), | |
| Tendsto (fun r β¦ F r z) (π[>] (0 : β)) (π 0) := by | |
| filter_upwards [ae_restrict_of_ae (ae_linear_ne_zero hLn)] with z hz | |
| apply tendsto_const_nhds.congr' | |
| filter_upwards [eventually_sublevel_membership hd hx hlocal hz] with r hr | |
| have hmem : x + r β’ z β E β z β H := hr.trans (hsign z) | |
| by_cases he : x + r β’ z β E | |
| Β· simp [F, he, hmem.mp he] | |
| Β· have hhn : z β H := fun hh β¦ he (hmem.mpr hh) | |
| simp only [F, Set.indicator_of_notMem he, Set.indicator_of_notMem hhn, | |
| sub_self, abs_zero] | |
| have hi : Integrable (fun _ : Euc n β¦ (1 : β)) | |
| (volume.restrict (Metric.ball 0 1)) := integrableOn_const measure_ball_lt_top.ne | |
| have hconv := tendsto_integral_filter_of_dominated_convergence | |
| (fun _ : Euc n β¦ (1 : β)) (Eventually.of_forall hmeas) (Eventually.of_forall hb) hi ht | |
| refine β¨hv, ?_β© | |
| have heq : βαΆ r : β in π[>] 0, | |
| (r ^ n)β»ΒΉ * (β« y in Metric.ball x r, | |
| |E.indicator (fun _ β¦ (1 : β)) y - | |
| {z | inner β (z - x) v < 0}.indicator (fun _ β¦ (1 : β)) y|) = | |
| β« z in Metric.ball (0 : Euc n) 1, F r z := by | |
| filter_upwards [self_mem_nhdsWithin] with r hr | |
| rw [normalized_ball_integral _ x hr] | |
| apply integral_congr_ae | |
| filter_upwards [] with z | |
| simp only [halfspace_indicator_rescale x v z hr, F, H] | |
| exact (show Tendsto (fun r β¦ β« z in Metric.ball (0 : Euc n) 1, F r z) | |
| (π[>] (0 : β)) (π 0) from by simpa only [integral_zero] using hconv).congr' (Filter.EventuallyEq.symm heq) | |
| theorem hasHalfspaceBlowup_gradient {n : β} {E : Set (Euc n)} | |
| (hE : MeasurableSet E) {f : Euc n β β} {x : Euc n} | |
| (hd : DifferentiableAt β f x) (hx : f x = 0) (hdf : fderiv β f x β 0) | |
| (hlocal : βαΆ y in π x, y β E β f y < 0) : | |
| HasHalfspaceBlowup E x (βgradient f xββ»ΒΉ β’ gradient f x) := by | |
| have hg : gradient f x β 0 := by | |
| intro he | |
| apply hdf | |
| ext z | |
| rw [β inner_gradient_left, he, inner_zero_left] | |
| rfl | |
| have hng : 0 < βgradient f xβ := norm_pos_iff.mpr hg | |
| apply hasHalfspaceBlowup_of_regular_sublevel hE hd.hasFDerivAt hx hlocal | |
| (a := βgradient f xβ) | |
| Β· rw [norm_smul, Real.norm_of_nonneg (inv_nonneg.mpr hng.le), inv_mul_cancelβ hng.ne'] | |
| Β· exact hng | |
| Β· intro z | |
| rw [real_inner_smul_right, β inner_gradient_left, real_inner_comm] | |
| field_simp | |
| theorem halfspace_wedge_nonempty {n : β} {v w : Euc n} | |
| (hv : βvβ = 1) (hw : βwβ = 1) (hne : v β w) : | |
| (Metric.ball (0 : Euc n) 1 β© | |
| {z | inner β z v < 0} β© {z | 0 < inner β z w}).Nonempty := by | |
| have hdiff : 0 < βw - vβ := norm_pos_iff.mpr (sub_ne_zero.mpr hne.symm) | |
| have hinner : inner β w v < 1 := by | |
| have hs := norm_sub_sq_real w v | |
| rw [hv, hw] at hs | |
| nlinarith [sq_pos_of_pos hdiff] | |
| refine β¨(1 / 4 : β) β’ (w - v), β¨?_, ?_β©, ?_β© | |
| Β· rw [Metric.mem_ball, dist_zero_right, norm_smul] | |
| have hn : βw - vβ β€ 2 := (norm_sub_le w v).trans (by rw [hw, hv]; norm_num) | |
| norm_num | |
| linarith | |
| Β· simp only [Set.mem_ofPred_eq, real_inner_smul_left, inner_sub_left, | |
| real_inner_self_eq_norm_sq, hv] | |
| nlinarith | |
| Β· simp only [Set.mem_ofPred_eq, real_inner_smul_left, inner_sub_left, | |
| real_inner_self_eq_norm_sq, hw, real_inner_comm w v] | |
| nlinarith | |
| theorem eq_of_halfspace_indicator_ae {n : β} {v w : Euc n} | |
| (hv : βvβ = 1) (hw : βwβ = 1) | |
| (he : {z | inner β z v < 0}.indicator (fun _ β¦ (1 : β)) =α΅[ | |
| volume.restrict (Metric.ball (0 : Euc n) 1)] | |
| {z | inner β z w < 0}.indicator (fun _ β¦ (1 : β))) : v = w := by | |
| by_contra hne | |
| let U : Set (Euc n) := Metric.ball 0 1 β© {z | inner β z v < 0} β© {z | 0 < inner β z w} | |
| have hUo : IsOpen U := (Metric.isOpen_ball.inter | |
| (isOpen_lt (continuous_id.inner continuous_const) continuous_const)).inter | |
| (isOpen_lt continuous_const (continuous_id.inner continuous_const)) | |
| have hUp : 0 < (volume : Measure (Euc n)) U := | |
| hUo.measure_pos _ (halfspace_wedge_nonempty hv hw hne) | |
| have hUs : U β Metric.ball 0 1 := fun _ hz β¦ hz.1.1 | |
| have hUr : 0 < volume.restrict (Metric.ball (0 : Euc n) 1) U := by | |
| rwa [Measure.restrict_apply hUo.measurableSet, inter_eq_left.mpr hUs] | |
| obtain β¨z, hz, hzeβ© := Measure.exists_mem_of_measure_ne_zero_of_ae hUr.ne' (ae_restrict_of_ae he) | |
| have hzv : z β {y | inner β y v < 0} := hz.1.2 | |
| have hzwp : 0 < inner β z w := hz.2 | |
| have hzw : z β {y | inner β y w < 0} := not_lt.mpr hzwp.le | |
| simp only [Set.indicator_of_mem hzv, Set.indicator_of_notMem hzw, one_ne_zero] at hze | |
| theorem integrable_rescaled_indicator {n : β} {E : Set (Euc n)} (hE : MeasurableSet E) | |
| (x : Euc n) (r : β) : | |
| Integrable (fun z β¦ E.indicator (fun _ β¦ (1 : β)) (x + r β’ z)) | |
| (volume.restrict (Metric.ball (0 : Euc n) 1)) := by | |
| have hAff : Measurable (fun z : Euc n β¦ x + r β’ z) := | |
| measurable_const.add (measurable_id.const_smul r) | |
| have he : Measurable (E.indicator (fun _ : Euc n β¦ (1 : β))) := | |
| measurable_const.indicator hE | |
| apply (integrableOn_const measure_ball_lt_top.ne (C := (1 : β))).mono' | |
| (he.comp hAff).aestronglyMeasurable | |
| filter_upwards [] with z | |
| by_cases hz : x + r β’ z β E <;> simp [hz] | |
| theorem HasHalfspaceBlowup.tendstoInMeasure {n : β} {E : Set (Euc n)} | |
| (hE : MeasurableSet E) {x v : Euc n} (hv : HasHalfspaceBlowup E x v) : | |
| TendstoInMeasure (volume.restrict (Metric.ball (0 : Euc n) 1)) | |
| (fun r z β¦ E.indicator (fun _ β¦ (1 : β)) (x + r β’ z)) (π[>] (0 : β)) | |
| ({z | inner β z v < 0}.indicator (fun _ β¦ (1 : β))) := by | |
| let ΞΌ := (volume : Measure (Euc n)).restrict (Metric.ball 0 1) | |
| let Ο : β β Euc n β β := fun r z β¦ E.indicator (fun _ β¦ (1 : β)) (x + r β’ z) | |
| let H : Set (Euc n) := {z | inner β z v < 0} | |
| let Ο : Euc n β β := H.indicator (fun _ β¦ (1 : β)) | |
| have hH : MeasurableSet H := | |
| (isOpen_lt (continuous_id.inner continuous_const) continuous_const).measurableSet | |
| have hΟ : β r, Integrable (Ο r) ΞΌ := integrable_rescaled_indicator hE x | |
| have hΟ : Integrable Ο ΞΌ := | |
| (integrableOn_const measure_ball_lt_top.ne (C := (1 : β))).indicator hH | |
| have hconv : Tendsto (fun r β¦ β« z, |Ο r z - Ο z| βΞΌ) (π[>] (0 : β)) (π 0) := by | |
| apply hv.2.congr' | |
| filter_upwards [self_mem_nhdsWithin] with r hr | |
| rw [normalized_ball_integral _ x hr] | |
| apply integral_congr_ae | |
| filter_upwards [] with z | |
| simp only [Ο, Ο, H, halfspace_indicator_rescale x v z hr] | |
| apply tendstoInMeasure_of_tendsto_eLpNorm (p := 1) one_ne_zero | |
| have heq : (fun r β¦ eLpNorm (Ο r - Ο) 1 ΞΌ) = | |
| (fun r β¦ ENNReal.ofReal (β« z, |Ο r z - Ο z| βΞΌ)) := by | |
| funext r | |
| rw [eLpNorm_one_eq_lintegral_enorm ((hΟ r).sub hΟ).aestronglyMeasurable, | |
| β ofReal_integral_norm_eq_lintegral_enorm ((hΟ r).sub hΟ)] | |
| rfl | |
| change Tendsto (fun r β¦ eLpNorm (Ο r - Ο) 1 ΞΌ) _ _ | |
| rw [heq] | |
| simpa only [Function.comp_def, ENNReal.ofReal_zero] using | |
| ENNReal.continuous_ofReal.continuousAt.tendsto.comp hconv | |
| theorem HasHalfspaceBlowup.unique {n : β} {E : Set (Euc n)} (hE : MeasurableSet E) | |
| {x v w : Euc n} (hv : HasHalfspaceBlowup E x v) (hw : HasHalfspaceBlowup E x w) : | |
| v = w := by | |
| apply eq_of_halfspace_indicator_ae hv.1 hw.1 | |
| exact tendstoInMeasure_ae_unique (hv.tendstoInMeasure hE) (hw.tendstoInMeasure hE) | |
| theorem approximateNormal_eq_of_blowup {n : β} {E : Set (Euc n)} (hE : MeasurableSet E) | |
| {x v : Euc n} (hv : HasHalfspaceBlowup E x v) : approximateNormal E x = v := by | |
| have hex : β w, HasHalfspaceBlowup E x w := β¨v, hvβ© | |
| rw [approximateNormal, dite_eq_left hex] | |
| exact (Classical.choose_spec hex).unique hE hv | |
| theorem approximateNormal_eq_gradient {n : β} {E : Set (Euc n)} | |
| (hE : MeasurableSet E) {f : Euc n β β} {x : Euc n} | |
| (hd : DifferentiableAt β f x) (hx : f x = 0) (hdf : fderiv β f x β 0) | |
| (hlocal : βαΆ y in π x, y β E β f y < 0) : | |
| approximateNormal E x = βgradient f xββ»ΒΉ β’ gradient f x := | |
| approximateNormal_eq_of_blowup hE (hasHalfspaceBlowup_gradient hE hd hx hdf hlocal) | |
| end RPISingularHarnack | |
| end | |
| noncomputable section | |
| open Set Filter MeasureTheory | |
| open scoped Topology ENNReal NNReal ContDiff | |
| open scoped Topology ENNReal NNReal | |
| open scoped ENNReal Topology ContDiff Pointwise | |
| namespace RPI.Boundary | |
| theorem surfaceGradient_eq_tangentialGradient {n : β} {E S : Set (Space n)} | |
| (hE : MeasurableSet E) {f g : Space n β β} {x : Space n} | |
| (hf : ContDiffAt β 1 f x) (hfx : f x = 0) (hdf : fderiv β f x β 0) | |
| (hlevel : βαΆ y in π x, y β S β f y = 0) | |
| (hfilled : βαΆ y in π x, y β E β f y < 0) : | |
| surfaceGradient S g x = RPISingularHarnack.tangentialGradient E g x := by | |
| have hgrad : gradient f x β 0 := by | |
| intro he | |
| apply hdf | |
| rw [β toDual_gradient, he, map_zero] | |
| have hn : βgradient f xβ β 0 := norm_ne_zero_iff.mpr hgrad | |
| rw [surfaceGradient_eq_level_formula hf hdf (by simpa only [hfx] using hlevel), | |
| RPISingularHarnack.tangentialGradient, | |
| RPISingularHarnack.approximateNormal_eq_gradient hE | |
| (hf.differentiableAt (by norm_num)) hfx hdf hfilled, | |
| real_inner_smul_right, smul_smul, real_inner_comm (gradient f x) (gradient g x)] | |
| congr 2 | |
| field_simp | |
| end RPI.Boundary | |
| end | |
| noncomputable section | |
| open Set Filter MeasureTheory | |
| open scoped Topology ENNReal NNReal ContDiff | |
| open scoped Topology ENNReal NNReal | |
| open scoped ENNReal Topology ContDiff Pointwise | |
| namespace RPISingularHarnack | |
| def divergence {n : β} (V : Euc n β Euc n) (x : Euc n) : β := | |
| β i : Fin n, inner β ((EuclideanSpace.basisFun (Fin n) β) i) | |
| (fderiv β V x ((EuclideanSpace.basisFun (Fin n) β) i)) | |
| def perimeter {n : β} (E U : Set (Euc n)) : ββ₯0β := | |
| β¨ (V : Euc n β Euc n) (_ : ContDiff β β V) (_ : HasCompactSupport V) | |
| (_ : tsupport V β U) (_ : β x, βV xβ β€ 1), | |
| ENNReal.ofReal (β« x in E, divergence V x) | |
| def perimeterSupport {n : β} (E : Set (Euc n)) : Set (Euc n) := | |
| {x | β r : β, 0 < r β 0 < perimeter E (Metric.ball x r)} | |
| def IsLocallyPerimeterMinimizing {n : β} (E : Set (Euc n)) : Prop := | |
| MeasurableSet E β§ | |
| (β x (r : β), 0 < r β perimeter E (Metric.ball x r) < β€) β§ | |
| β x (r : β), 0 < r β β F : Set (Euc n), MeasurableSet F β | |
| IsCompact (closure (symmDiff E F)) β | |
| closure (symmDiff E F) β Metric.ball x r β | |
| perimeter E (Metric.ball x r) β€ perimeter F (Metric.ball x r) | |
| def IsCone {n : β} (E : Set (Euc n)) : Prop := | |
| β r : β, 0 < r β β x : Euc n, r β’ x β E β x β E | |
| end RPISingularHarnack | |
| end | |
| end OAI | |