Download data/lean/OAI/Analysis/DiskMaximal/Refinement.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 39.6 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/DiskMaximal/Refinement.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/DiskMaximal/Refinement.lean
-
curl -L -o Refinement.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/DiskMaximal/Refinement.lean
39.6 kB
| import OAI.Analysis.DiskMaximal.Marks | |
| namespace OAI | |
| open MeasureTheory Set | |
| open scoped ENNReal NNReal Topology ContDiff | |
| open scoped RealInnerProductSpace | |
| open MeasureTheory Set Filter | |
| open scoped Topology ENNReal | |
| open scoped Real RealInnerProductSpace | |
| open MeasureTheory Set Filter | |
| open scoped Topology RealInnerProductSpace ContDiff | |
| open MeasureTheory Set Filter | |
| open scoped Topology Interval NNReal | |
| open MeasureTheory Set Filter | |
| open scoped Topology NNReal Real | |
| open MeasureTheory Set Metric | |
| open scoped ENNReal NNReal Topology | |
| open MeasureTheory Set | |
| open scoped ENNReal NNReal | |
| open MeasureTheory Set | |
| open scoped ENNReal NNReal | |
| open MeasureTheory Set | |
| open scoped ENNReal NNReal Topology | |
| open MeasureTheory Set Metric | |
| open scoped ENNReal NNReal | |
| open MeasureTheory Set | |
| open scoped ENNReal NNReal | |
| open Finset | |
| open scoped RealInnerProductSpace | |
| open MeasureTheory Set Metric | |
| open scoped ENNReal NNReal Topology | |
| open MeasureTheory Set | |
| open scoped ENNReal NNReal RealInnerProductSpace | |
| open MeasureTheory Set | |
| open scoped ENNReal NNReal Topology | |
| open MeasureTheory Set Metric | |
| open scoped ENNReal NNReal RealInnerProductSpace | |
| open scoped RealInnerProductSpace | |
| open scoped RealInnerProductSpace | |
| open scoped ContDiff | |
| open Finset | |
| noncomputable section | |
| namespace LabelSwitches | |
| /-- Whether a switch has occurred since the most recent exceptional level. -/ | |
| def active (bad sw : β β Bool) : β β Bool | |
| | 0 => false | |
| | n+1 => if bad n then false else active bad sw n || sw n | |
| def count (p : β β Bool) (n : β) : β := β i β range n, if p i then 1 else 0 | |
| lemma active_witness (bad sw : β β Bool) (n : β) (h : active bad sw n = true) : | |
| β i < n, sw i = true β§ β j, i β€ j β j < n β bad j = false := by | |
| induction n with | |
| | zero => simp [active] at h | |
| | succ n ih => | |
| by_cases hb : bad n = true | |
| Β· simp [active,hb] at h | |
| Β· have hb' : bad n = false := by cases hbn : bad n <;> simp_all | |
| simp only [active,hb',Bool.false_eq_true,βreduceIte,Bool.or_eq_true] at h | |
| rcases h with h | h | |
| Β· obtain β¨i,hi,hs,hnβ© := ih h | |
| refine β¨i,Nat.lt_succ_of_lt hi,hs,?_β© | |
| intro j hij hj | |
| by_cases hjn : j < n | |
| Β· exact hn j hij hjn | |
| Β· have : j = n := by omega | |
| simpa [this] using hb' | |
| Β· refine β¨n,Nat.lt_succ_self n,h,?_β© | |
| intro j hj hj' | |
| have : j=n := by omega | |
| simpa [this] using hb' | |
| theorem count_le (bad sw : β β Bool) (n : β) | |
| (hsep : β i j, i < j β j < n β sw i = true β sw j = true β | |
| β k, i β€ k β§ k β€ j β§ bad k = true) : | |
| count sw n β€ 1+2*count bad n := by | |
| have hns (j : β) (hj : j < n) (ha : active bad sw j = true) (hb : bad j = false) : | |
| sw j = false := by | |
| obtain β¨i,hi,hs,hb0β© := active_witness bad sw j ha | |
| cases hv : sw j with | |
| | false => rfl | |
| | true => | |
| obtain β¨k,hik,hkj,hbkβ© := hsep i j hi hj hs hv | |
| by_cases hkj' : k < j | |
| Β· have := hb0 k hik hkj' | |
| simp_all | |
| Β· have : k=j := by omega | |
| simp_all | |
| have aux : β m β€ n, count sw m β€ 2*count bad m + if active bad sw m then 1 else 0 := by | |
| intro m hm | |
| induction m with | |
| | zero => simp [count,active] | |
| | succ m ih => | |
| have ih' := ih (Nat.le_trans (Nat.le_succ m) hm) | |
| have hstep := hns m (by omega) | |
| simp only [count,sum_range_succ] at ih' β’ | |
| simp only [active] | |
| by_cases hb : bad m = true <;> by_cases hs : sw m = true <;> | |
| by_cases ha : active bad sw m = true <;> simp_all <;> omega | |
| have h := aux n le_rfl | |
| split_ifs at h <;> omega | |
| /-- Quantitative energy version. The exceptional set is the union of marks | |
| and levels with energy exceeding c. This includes an arbitrary birth offset. -/ | |
| theorem count_energy (mark sw : β β Bool) (E : β β β) (n : β) {c : β} | |
| (hc : 0 < c) (hE : β i < n, 0 β€ E i) | |
| (hsep : β i j, i < j β j < n β sw i = true β sw j = true β | |
| β k, i β€ k β§ k β€ j β§ (mark k = true β¨ c < E k)) : | |
| ((count sw n : β) : β) β€ 1+2*((count mark n : β) : β)+(2/c)*β i β range n, E i := by | |
| let bad : β β Bool := fun i => decide (mark i = true β¨ c < E i) | |
| have hb := count_le bad sw n (by | |
| intro i j hij hj hi hj' | |
| obtain β¨k,hik,hkj,hkβ© := hsep i j hij hj hi hj' | |
| exact β¨k,hik,hkj,by simpa [bad] using hkβ©) | |
| have henergy : ((count bad n : β) : β) β€ ((count mark n : β) : β)+(1/c)*β i β range n, E i := by | |
| simp only [count,Nat.cast_sum,Nat.cast_ite,Nat.cast_one,Nat.cast_zero,mul_sum,β sum_add_distrib] | |
| apply sum_le_sum | |
| intro i hi | |
| have hi' : i < n := mem_range.mp hi | |
| have he := hE i hi' | |
| have hec : 0 β€ (1/c)*E i := mul_nonneg (by positivity) he | |
| by_cases hm : mark i = true | |
| Β· simp only [bad,hm,true_or,decide_true,βreduceIte] | |
| linarith | |
| Β· by_cases hce : c < E i | |
| Β· have he1 : 1 β€ (1/c)*E i := by | |
| rw [one_div,mul_comm,β div_eq_mul_inv,le_div_iffβ hc] | |
| simpa using hce.le | |
| simpa [bad,hm,hce] using he1 | |
| Β· simpa [bad,hm,hce] using hec | |
| have hb' : ((count sw n : β) : β) β€ 1+2*((count bad n : β) : β) := by exact_mod_cast hb | |
| calc | |
| _ β€ 1+2*(((count mark n : β) : β)+(1/c)*β i β range n, E i) := by linarith | |
| _ = _ := by ring | |
| end LabelSwitches | |
| open MeasureTheory Set Metric Filter | |
| open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology | |
| namespace PlanePotential | |
| /-- The global segment kernel vanishes off the region on which the actual | |
| finite density decomposition is valid. -/ | |
| lemma green_eq_zero_of_outside {Ο : β β β} {R X : β} | |
| (hs : β z, Ο z β 0 β βzβ β€ R) (hRX : R β€ X) {x y : β} | |
| (hx : βxβ β€ X) (hy : X < βyβ) : green Ο x y = 0 := by | |
| have hz (t : β) (ht : t β Ioc (0:β) 1) : Ο (x+tβ»ΒΉ β’ (y-x)) = 0 := by | |
| by_contra hh | |
| have hw := hs _ hh | |
| have heq : y = (1-t) β’ x+t β’ (x+tβ»ΒΉ β’ (y-x)) := by | |
| rw [smul_add,smul_smul,mul_inv_cancelβ ht.1.ne',one_smul] | |
| module | |
| have hn := norm_add_le ((1-t) β’ x) (t β’ (x+tβ»ΒΉ β’ (y-x))) | |
| rw [β heq,norm_smul,norm_smul,Real.norm_eq_abs,Real.norm_eq_abs, | |
| abs_of_nonneg (sub_nonneg.mpr ht.2),abs_of_pos ht.1] at hn | |
| have hle := add_le_add (mul_le_mul_of_nonneg_left hx (sub_nonneg.mpr ht.2)) | |
| (mul_le_mul_of_nonneg_left (hw.trans hRX) ht.1.le) | |
| nlinarith | |
| have hi : greenScalar Ο x y = 0 := by | |
| unfold greenScalar | |
| apply setIntegral_eq_zero_of_forall_eq_zero | |
| intro t ht | |
| simp only [hz t ht,zero_mul] | |
| simp only [green,hi,neg_zero,zero_smul] | |
| lemma green_gradient_representation {Ο g : β β β} (hΟ : Continuous Ο) | |
| (hΟc : HasCompactSupport Ο) (hg : ContDiff β 1 g) {D : β} | |
| (hD : β y, βfderiv β g yβ β€ D) (hΟ1 : β« z, Ο z = 1) (x : β) : | |
| (β« y, βͺgreen Ο x y,gradient g yβ«) = g x-β« z, Ο z*g z := by | |
| simpa only [inner_gradient_right,RCLike.conj_to_real] using | |
| green_representation hΟ hΟc hg hD hΟ1 x | |
| theorem green_finite_decomposition {ΞΉ : Type*} [Fintype ΞΉ] | |
| {Ο g : β β β} (hΟ : Continuous Ο) (hΟc : HasCompactSupport Ο) | |
| (hg : ContDiff β 1 g) {D R X Y B : β} | |
| (hD : β y, βfderiv β g yβ β€ D) (hΟ1 : β« z, Ο z = 1) | |
| (hΟs : β z, Ο z β 0 β βzβ β€ R) (hΟB : β z, |Ο z| β€ B) | |
| (hRX : R β€ X) (hM : 0 < R+X) (hB : 0 β€ B) (hXY : 0 < X+Y) | |
| (Ξ² : ΞΉ β β β β) (hΞ² : β i, Integrable (Ξ² i)) | |
| (hΞ²s : β i y, Ξ² i y β 0 β βyβ β€ Y) | |
| (hdecomp : βα΅ y, βyβ β€ X β gradient g y = β i, Ξ² i y) : | |
| βα΅ x βvolume.restrict {x : β | βxβ β€ X}, | |
| g x-β« z, Ο z*g z = β i, β« y, βͺgreen Ο x y,Ξ² i yβ« := by | |
| have hall := ae_all_iff.mpr (fun i => green_ae_integrable hΟ.measurable hΟs hΟB hM hB hXY | |
| (hΞ² i) (hΞ²s i)) | |
| filter_upwards [hall,ae_restrict_mem (measurableSet_le measurable_norm measurable_const)] with x hi hx | |
| rw [β green_gradient_representation hΟ hΟc hg hD hΟ1 x,β integral_finsetSum _ (fun i _ => hi i)] | |
| apply integral_congr_ae | |
| filter_upwards [hdecomp] with y hy | |
| by_cases hyX : βyβ β€ X | |
| Β· rw [hy hyX,inner_sum] | |
| Β· rw [green_eq_zero_of_outside hΟs hRX hx (lt_of_not_ge hyX)] | |
| simp | |
| /-- The complete finite Minkowski step, after genuine kernel insertion. -/ | |
| theorem green_decomposition_norm {ΞΉ : Type*} [Fintype ΞΉ] | |
| {Ο g : β β β} (hΟ : Continuous Ο) (hΟc : HasCompactSupport Ο) | |
| (hg : ContDiff β 1 g) {D R X Y B : β} | |
| (hD : β y, βfderiv β g yβ β€ D) (hΟ1 : β« z, Ο z = 1) | |
| (hΟs : β z, Ο z β 0 β βzβ β€ R) (hΟB : β z, |Ο z| β€ B) | |
| (hRX : R β€ X) (hM : 0 < R+X) (hB : 0 β€ B) (hXY : 0 < X+Y) | |
| (Ξ² : ΞΉ β β β β) (hΞ² : β i, Integrable (Ξ² i)) | |
| (hΞ²s : β i y, Ξ² i y β 0 β βyβ β€ Y) | |
| (hdecomp : βα΅ y, βyβ β€ X β gradient g y = β i, Ξ² i y) : | |
| eLpNorm (fun x => g x-β« z, Ο z*g z) (3/2) (volume.restrict {x : β | βxβ β€ X}) β€ | |
| β i, eLpNorm (fun x => β« y, βͺgreen Ο x y,Ξ² i yβ«) (3/2) | |
| (volume.restrict {x : β | βxβ β€ X}) := by | |
| let ΞΌ := volume.restrict {x : β | βxβ β€ X} | |
| let F : ΞΉ β β β β := fun i x => β« y, βͺgreen Ο x y,Ξ² i yβ« | |
| have hmeas : β i, AEStronglyMeasurable (F i) ΞΌ := fun i => | |
| potential_aestronglyMeasurable _ (green_measurable Ο hΟ.measurable) (hΞ² i) | |
| have heq : (fun x => g x-β« z, Ο z*g z) =α΅[ΞΌ] fun x => β i, F i x := | |
| green_finite_decomposition hΟ hΟc hg hD hΟ1 hΟs hΟB hRX hM hB hXY Ξ² hΞ² hΞ²s hdecomp | |
| have hsum : eLpNorm (β i, F i) (3/2) ΞΌ β€ β i, eLpNorm (F i) (3/2) ΞΌ := | |
| eLpNorm_sum_le (by | |
| rw [ENNReal.le_div_iff_mul_le (by norm_num) (by norm_num)] | |
| norm_num) | |
| rw [eLpNorm_congr_ae heq] | |
| have hfun : (β i, F i) = fun x => β i, F i x := by ext x; simp | |
| rw [hfun] at hsum | |
| exact hsum | |
| end PlanePotential | |
| namespace RadiusEnvelope | |
| variable {E : Type*} | |
| /-- The signed envelope over the entire compact real-radius interval. -/ | |
| def envelope (u : β β E β β) (a b : β) (x : E) : β := | |
| sSup ((fun r => u r x) '' Icc a b) | |
| lemma attains {u : β β E β β} {a b : β} (hab : a β€ b) (x : E) | |
| (hc : ContinuousOn (fun r => u r x) (Icc a b)) : | |
| β r β Icc a b, envelope u a b x = u r x β§ β t β Icc a b, u t x β€ u r x := by | |
| obtain β¨r,hr,hmβ© := isCompact_Icc.exists_isMaxOn (Set.nonempty_Icc.mpr hab) hc | |
| refine β¨r,hr,?_,hmβ© | |
| apply le_antisymm | |
| Β· apply csSup_le ((Set.nonempty_Icc.mpr hab).image _) | |
| rintro _ β¨t,ht,rflβ© | |
| exact hm ht | |
| Β· apply le_csSup (isCompact_Icc.image_of_continuousOn hc).bddAbove | |
| exact mem_image_of_mem _ hr | |
| lemma le_envelope {u : β β E β β} {a b r : β} (hr : r β Icc a b) (x : E) | |
| (hc : ContinuousOn (fun r => u r x) (Icc a b)) : u r x β€ envelope u a b x := by | |
| obtain β¨t,ht,he,hmβ© := attains (hr.1.trans hr.2) x hc | |
| rw [he] | |
| exact hm r hr | |
| lemma lipschitz [NormedAddCommGroup E] {u : β β E β β} {a b : β} {L : ββ₯0} (hab : a β€ b) | |
| (hc : β x, ContinuousOn (fun r => u r x) (Icc a b)) | |
| (hL : β r β Icc a b, LipschitzWith L (u r)) : | |
| LipschitzWith L (envelope u a b) := by | |
| rw [lipschitzWith_iff_dist_le_mul] | |
| intro x y | |
| obtain β¨r,hr,her,hmrβ© := attains hab x (hc x) | |
| obtain β¨t,ht,het,hmtβ© := attains hab y (hc y) | |
| rw [Real.dist_eq,abs_le] | |
| constructor | |
| Β· have h := (hL t ht).dist_le_mul x y | |
| rw [Real.dist_eq] at h | |
| rw [het] | |
| have hx := le_envelope ht x (hc x) | |
| have ha := (abs_le.mp h).1 | |
| linarith | |
| Β· have h := (hL r hr).dist_le_mul x y | |
| rw [Real.dist_eq] at h | |
| rw [her] | |
| have hy := le_envelope hr y (hc y) | |
| have ha := (abs_le.mp h).2 | |
| linarith | |
| lemma zero_of_all_zero {u : β β E β β} {a b : β} (hab : a β€ b) {x : E} | |
| (hc : ContinuousOn (fun r => u r x) (Icc a b)) | |
| (hz : β r β Icc a b, u r x = 0) : envelope u a b x = 0 := by | |
| obtain β¨r,hr,he,_β© := attains hab x hc | |
| exact he.trans (hz r hr) | |
| /-- Differentiable touching holds for every attaining radius; no derivative of | |
| an argmax selector is taken. -/ | |
| theorem fderiv_touching [NormedAddCommGroup E] [NormedSpace β E] {u : β β E β β} {a b r : β} {x : E} | |
| (hr : r β Icc a b) (hc : β y, ContinuousOn (fun t => u t y) (Icc a b)) | |
| (he : envelope u a b x = u r x) | |
| (hd : DifferentiableAt β (envelope u a b) x) (hu : DifferentiableAt β (u r) x) : | |
| fderiv β (envelope u a b) x = fderiv β (u r) x := by | |
| have hm : IsLocalMin (fun y => envelope u a b y-u r y) x := by | |
| apply IsMinOn.isLocalMin (s := univ) _ univ_mem | |
| intro y _ | |
| change envelope u a b x-u r x β€ envelope u a b y-u r y | |
| rw [he,sub_self] | |
| exact sub_nonneg.mpr (le_envelope hr y (hc y)) | |
| have hz := hm.hasFDerivAt_eq_zero (hd.hasFDerivAt.sub hu.hasFDerivAt) | |
| exact sub_eq_zero.mp hz | |
| end RadiusEnvelope | |
| namespace DiskMoments | |
| lemma signedAverage_lipschitz {g : β β β} {L : ββ₯0} (hg : LipschitzWith L g) | |
| {t : β} (ht : 0 < t) : LipschitzWith L (fun x => signedAverage g x t) := by | |
| rw [lipschitzWith_iff_dist_le_mul] | |
| intro x y | |
| rw [signedAverage_fixedDomain g x ht,signedAverage_fixedDomain g y ht,Real.dist_eq, | |
| β sub_div,abs_div,abs_of_pos Real.pi_pos] | |
| have hxi : IntegrableOn (fun z : β => g (x+t β’ z)) (Metric.ball 0 1) := | |
| (ContinuousOn.integrableOn_compact (isCompact_closedBall 0 1) | |
| (hg.continuous.comp (by fun_prop)).continuousOn).mono_set Metric.ball_subset_closedBall | |
| have hyi : IntegrableOn (fun z : β => g (y+t β’ z)) (Metric.ball 0 1) := | |
| (ContinuousOn.integrableOn_compact (isCompact_closedBall 0 1) | |
| (hg.continuous.comp (by fun_prop)).continuousOn).mono_set Metric.ball_subset_closedBall | |
| rw [β integral_sub hxi hyi] | |
| have : IsFiniteMeasure (volume.restrict (Metric.ball (0:β) 1)) := | |
| β¨by simpβ© | |
| have hi := norm_integral_le_of_norm_le_const (ΞΌ := volume.restrict (Metric.ball (0:β) 1)) | |
| (C := (L:β)*dist x y) (f := fun z : β => g (x+t β’ z)-g (y+t β’ z)) (by | |
| filter_upwards with z | |
| simpa only [Real.norm_eq_abs,β Real.dist_eq,dist_add_right] using hg.dist_le_mul (x+t β’ z) (y+t β’ z)) | |
| have hv : (volume.restrict (Metric.ball (0:β) 1)).real univ = Real.pi := by | |
| simp [measureReal_def,Complex.volume_ball] | |
| rw [hv,Real.norm_eq_abs] at hi | |
| exact (div_le_iffβ Real.pi_pos).mpr hi | |
| lemma signedAverage_radius_continuousOn {g : β β β} (hg : ContDiff β 1 g) | |
| (x : β) {a b : β} (ha : 0 < a) : | |
| ContinuousOn (fun t => signedAverage g x t) (Icc a b) := by | |
| intro t ht | |
| exact (hasDerivAt_signedAverage hg x (ha.trans_le ht.1)).continuousAt.continuousWithinAt | |
| lemma hasFDerivAt_signedAverage {g : β β β} (hg : ContDiff β 1 g) {D : β} | |
| (hD : β y, βfderiv β g yβ β€ D) (x : β) {t : β} (ht : 0 < t) : | |
| HasFDerivAt (fun x => signedAverage g x t) | |
| ((1/Real.pi) β’ β« z in Metric.ball 0 1, fderiv β g (x+t β’ z)) x := by | |
| let F : β β β β β := fun x z => g (x+t β’ z) | |
| have hFi : IntegrableOn (F x) (Metric.ball 0 1) := | |
| (ContinuousOn.integrableOn_compact (isCompact_closedBall 0 1) | |
| (hg.continuous.comp (by fun_prop)).continuousOn).mono_set Metric.ball_subset_closedBall | |
| have hd := hasFDerivAt_integral_of_dominated_of_fderiv_le | |
| (ΞΌ := volume.restrict (Metric.ball (0:β) 1)) (F := F) | |
| (F' := fun x z => fderiv β g (x+t β’ z)) (bound := fun _ => D) | |
| (s := univ) (xβ := x) univ_mem | |
| (Eventually.of_forall (fun x => (hg.continuous.comp (by fun_prop)).aestronglyMeasurable)) | |
| hFi ((hg.continuous_fderiv one_ne_zero).comp (by fun_prop)).aestronglyMeasurable | |
| (ae_of_all _ (fun z x _ => hD (x+t β’ z))) (integrableOn_const (by finiteness)) | |
| (ae_of_all _ (fun z x _ => by | |
| simpa only [ContinuousLinearMap.comp_id,Function.comp_def,id_eq,F] using | |
| (hg.differentiable one_ne_zero (x+t β’ z)).hasFDerivAt.comp x ((hasFDerivAt_id x).add_const (t β’ z)))) | |
| convert! hd.const_mul (1/Real.pi) using 1 | |
| Β· funext y | |
| simpa only [F,div_eq_mul_inv,one_div,mul_comm,mul_one] using signedAverage_fixedDomain g y ht | |
| /-- Actual signed run envelopes: locally differentiable almost everywhere, over | |
| all radii in their compact interval. -/ | |
| theorem run_envelope_lipschitz {g : β β β} (hg : ContDiff β 1 g) | |
| (hgc : HasCompactSupport g) {a b : β} (ha : 0 < a) (hab : a β€ b) : | |
| β L : ββ₯0, LipschitzWith L (RadiusEnvelope.envelope (fun r x => signedAverage g x r) a b) := by | |
| obtain β¨L,hLβ© := hg.lipschitzWith_of_hasCompactSupport hgc one_ne_zero | |
| exact β¨L,RadiusEnvelope.lipschitz hab (fun x => signedAverage_radius_continuousOn hg x ha) | |
| (fun r hr => signedAverage_lipschitz hL (ha.trans_le hr.1))β© | |
| end DiskMoments | |
| namespace DiskMoments | |
| lemma signedAverage_eq_zero_of_outside {g : β β β} {R : β} | |
| (hs : β y, g y β 0 β βyβ β€ R) {x : β} {t : β} (hx : R+t β€ βxβ) : | |
| signedAverage g x t = 0 := by | |
| unfold signedAverage | |
| have hz : (β« y in Metric.ball x t, g y) = 0 := by | |
| apply setIntegral_eq_zero_of_forall_eq_zero | |
| intro y hy | |
| by_contra hny | |
| have hn := hs y hny | |
| have hd : βx-yβ < t := by simpa only [Metric.mem_ball,dist_eq_norm,norm_sub_rev] using hy | |
| have hh : βxβ β€ βx-yβ+βyβ := by simpa only [sub_add_cancel] using norm_add_le (x-y) y | |
| linarith | |
| rw [hz,zero_div] | |
| /-- Every radius in the run is retained, but a common compact spatial support | |
| still exists. -/ | |
| theorem run_envelope_hasCompactSupport {g : β β β} (hg : ContDiff β 1 g) | |
| (hgc : HasCompactSupport g) {a b : β} (ha : 0 < a) (hab : a β€ b) : | |
| HasCompactSupport (RadiusEnvelope.envelope (fun r x => signedAverage g x r) a b) := by | |
| obtain β¨R,hRβ© := hgc.isBounded.subset_closedBall (0:β) | |
| have hs : β y, g y β 0 β βyβ β€ R := by | |
| intro y hy | |
| simpa only [Metric.mem_closedBall,dist_zero_right] using hR (subset_tsupport g hy) | |
| apply IsCompact.of_isClosed_subset (isCompact_closedBall (0:β) (R+b)) isClosed_closure | |
| apply closure_minimal _ Metric.isClosed_closedBall | |
| intro x hx | |
| rw [Metric.mem_closedBall,dist_zero_right] | |
| by_contra hn | |
| have hz : RadiusEnvelope.envelope (fun r x => signedAverage g x r) a b x = 0 := by | |
| apply RadiusEnvelope.zero_of_all_zero hab (signedAverage_radius_continuousOn hg x ha) | |
| intro r hr | |
| exact signedAverage_eq_zero_of_outside hs (by linarith [hr.2]) | |
| exact hx hz | |
| /-- AE differentiability and universal touching of actual run gradients. -/ | |
| theorem run_envelope_ae_touching {g : β β β} (hg : ContDiff β 1 g) | |
| (hgc : HasCompactSupport g) {a b : β} (ha : 0 < a) (hab : a β€ b) : | |
| βα΅ x, β r β Icc a b, | |
| RadiusEnvelope.envelope (fun r x => signedAverage g x r) a b x = signedAverage g x r β | |
| fderiv β (RadiusEnvelope.envelope (fun r x => signedAverage g x r) a b) x = | |
| (1/Real.pi) β’ β« z in Metric.ball 0 1, fderiv β g (x+r β’ z) := by | |
| obtain β¨L,hLβ© := run_envelope_lipschitz hg hgc ha hab | |
| obtain β¨K,hKβ© := hg.lipschitzWith_of_hasCompactSupport hgc one_ne_zero | |
| filter_upwards [hL.ae_differentiableAt] with x hx | |
| intro r hr he | |
| have hd := hasFDerivAt_signedAverage hg (fun y => norm_fderiv_le_of_lipschitz β hK) x | |
| (ha.trans_le hr.1) | |
| exact (RadiusEnvelope.fderiv_touching hr (fun y => signedAverage_radius_continuousOn hg y ha) | |
| he hx hd.differentiableAt).trans hd.fderiv | |
| end DiskMoments | |
| namespace DyadicHats | |
| def point (r : β) (p : β€ Γ β€) : β := β¨r*p.1,r*p.2β© | |
| def boxNorm (x : β) : β := max |x.re| |x.im| | |
| lemma boxNorm_nonneg (x : β) : 0 β€ boxNorm x := le_trans (abs_nonneg _) (le_max_left _ _) | |
| lemma boxNorm_le_norm (x : β) : boxNorm x β€ βxβ := | |
| max_le (Complex.abs_re_le_norm _) (Complex.abs_im_le_norm _) | |
| lemma norm_le_two_boxNorm (x : β) : βxβ β€ 2*boxNorm x := by | |
| have h := Complex.norm_le_abs_re_add_abs_im x | |
| have hr : |x.re| β€ boxNorm x := le_max_left _ _ | |
| have hi : |x.im| β€ boxNorm x := le_max_right _ _ | |
| linarith | |
| lemma boxNorm_add_le (x y : β) : boxNorm (x+y) β€ boxNorm x+boxNorm y := by | |
| apply max_le | |
| Β· exact (abs_add_le _ _).trans (add_le_add (le_max_left _ _) (le_max_left _ _)) | |
| Β· exact (abs_add_le _ _).trans (add_le_add (le_max_right _ _) (le_max_right _ _)) | |
| lemma boxNorm_neg (x : β) : boxNorm (-x) = boxNorm x := by simp [boxNorm] | |
| lemma boxNorm_sub_comm (x y : β) : boxNorm (x-y) = boxNorm (y-x) := by | |
| rw [β neg_sub y x,boxNorm_neg] | |
| lemma hat_pos_iff {r : β} (hr : 0 < r) (p : β€ Γ β€) (x : β) : | |
| 0 < hat r p x β boxNorm (x-point r p) < r := by | |
| have hp : 0 < hat r p x β 0 < tent (x.re/r-p.1) β§ 0 < tent (x.im/r-p.2) := by | |
| constructor | |
| Β· intro h | |
| exact β¨pos_of_mul_pos_left h (tent_nonneg _),pos_of_mul_pos_right h (tent_nonneg _)β© | |
| Β· intro h | |
| exact mul_pos h.1 h.2 | |
| rw [hp,tent_pos_iff,tent_pos_iff] | |
| have hr0 : r β 0 := ne_of_gt hr | |
| have h1 : x.re/r-p.1 = (x.re-r*p.1)/r := by field_simp | |
| have h2 : x.im/r-p.2 = (x.im-r*p.2)/r := by field_simp | |
| rw [h1,h2,abs_div,abs_div,abs_of_pos hr,div_lt_one hr,div_lt_one hr] | |
| simp only [boxNorm,Complex.sub_re,Complex.sub_im,point,max_lt_iff] | |
| lemma hat_ne_zero_iff {r : β} (hr : 0 < r) (p : β€ Γ β€) (x : β) : | |
| hat r p x β 0 β boxNorm (x-point r p) < r := by | |
| constructor | |
| Β· intro h | |
| exact (hat_pos_iff hr p x).mp (lt_of_le_of_ne (hat_nonneg r p x) (Ne.symm h)) | |
| Β· intro h | |
| exact ne_of_gt ((hat_pos_iff hr p x).mpr h) | |
| lemma support_hat_subset {r : β} (hr : 0 < r) (p : β€ Γ β€) : | |
| Function.support (hat r p) β Metric.closedBall (point r p) (2*r) := by | |
| intro x hx | |
| rw [Metric.mem_closedBall,dist_eq_norm] | |
| exact (norm_le_two_boxNorm _).trans (mul_le_mul_of_nonneg_left ((hat_ne_zero_iff hr p x).mp hx).le (by norm_num)) | |
| lemma hasCompactSupport_hat {r : β} (hr : 0 < r) (p : β€ Γ β€) : | |
| HasCompactSupport (hat r p) := by | |
| apply IsCompact.of_isClosed_subset (isCompact_closedBall (point r p) (2*r)) isClosed_closure | |
| exact closure_minimal (support_hat_subset hr p) Metric.isClosed_closedBall | |
| /-- Globally uniform spatial Lipschitz bound for the literal bilinear hats. -/ | |
| lemma lipschitz_hat {r : β} (hr : 0 < r) (p : β€ Γ β€) : | |
| LipschitzWith (Real.toNNReal (2/r)) (hat r p) := by | |
| rw [lipschitzWith_iff_dist_le_mul] | |
| intro x y | |
| let a := tent (x.re/r-p.1) | |
| let b := tent (x.im/r-p.2) | |
| let c := tent (y.re/r-p.1) | |
| let d := tent (y.im/r-p.2) | |
| have h1 : |a-c| β€ βx-yβ/r := by | |
| have h := lipschitz_tent.dist_le_mul (x.re/r-p.1) (y.re/r-p.1) | |
| simp only [Real.dist_eq,NNReal.coe_one,one_mul,sub_sub_sub_cancel_right,β sub_div, | |
| abs_div,abs_of_pos hr] at h | |
| exact h.trans (div_le_div_of_nonneg_right (Complex.abs_re_le_norm (x-y)) hr.le) | |
| have h2 : |b-d| β€ βx-yβ/r := by | |
| have h := lipschitz_tent.dist_le_mul (x.im/r-p.2) (y.im/r-p.2) | |
| simp only [Real.dist_eq,NNReal.coe_one,one_mul,sub_sub_sub_cancel_right,β sub_div, | |
| abs_div,abs_of_pos hr] at h | |
| exact h.trans (div_le_div_of_nonneg_right (Complex.abs_im_le_norm (x-y)) hr.le) | |
| have hab : |a*b-c*d| β€ |a-c|+|b-d| := by | |
| calc | |
| _ = |(a-c)*b+c*(b-d)| := by congr 1; ring | |
| _ β€ |(a-c)*b|+|c*(b-d)| := abs_add_le _ _ | |
| _ = |a-c| *b+c*|b-d| := by rw [abs_mul,abs_mul,abs_of_nonneg (tent_nonneg _),abs_of_nonneg (tent_nonneg _)] | |
| _ β€ |a-c| *1+1*|b-d| := add_le_add | |
| (mul_le_mul_of_nonneg_left (tent_le_one _) (abs_nonneg _)) | |
| (mul_le_mul_of_nonneg_right (tent_le_one _) (abs_nonneg _)) | |
| _ = _ := by ring | |
| change |a*b-c*d| β€ _ | |
| rw [Real.coe_toNNReal (2/r) (by positivity),dist_eq_norm] | |
| calc | |
| _ β€ βx-yβ/r+βx-yβ/r := hab.trans (add_le_add h1 h2) | |
| _ = _ := by ring | |
| lemma step_locality {p q : β€ Γ β€} (hpq : 0 < step p q) {r : β} (hr : 0 < r) : | |
| boxNorm (point (r/2) q-point r p) β€ r/2 := by | |
| have h1 : |(q.1:β)/2-p.1| < 1 := (tent_pos_iff _).mp | |
| (pos_of_mul_pos_left hpq (tent_nonneg _)) | |
| have h2 : |(q.2:β)/2-p.2| < 1 := (tent_pos_iff _).mp | |
| (pos_of_mul_pos_right hpq (tent_nonneg _)) | |
| have hbound (j k : β€) (h : |(j:β)/2-k| < 1) : |(j:β)/2-k| β€ 1/2 := by | |
| have habs := abs_lt.mp h | |
| have hlow : 2*k-1 β€ j := by | |
| have : (2*k-2:β) < j := by linarith | |
| have : 2*k-2 < j := by exact_mod_cast this | |
| omega | |
| have hhigh : j β€ 2*k+1 := by | |
| have : (j:β) < 2*k+2 := by linarith | |
| have : j < 2*k+2 := by exact_mod_cast this | |
| omega | |
| have hlo : (2:β)*k-1 β€ j := by exact_mod_cast hlow | |
| have hhi : (j:β) β€ 2*k+1 := by exact_mod_cast hhigh | |
| rw [abs_le] | |
| constructor <;> linarith | |
| have h1' := hbound q.1 p.1 h1 | |
| have h2' := hbound q.2 p.2 h2 | |
| change max |r/2*q.1-r*p.1| |r/2*q.2-r*p.2| β€ r/2 | |
| have hm (j k : β€) (h : |(j:β)/2-k| β€ 1/2) : |r/2*j-r*k| β€ r/2 := by | |
| rw [show r/2*j-r*k = r*((j:β)/2-k) by ring,abs_mul,abs_of_pos hr] | |
| nlinarith | |
| exact max_le (hm _ _ h1') (hm _ _ h2') | |
| end DyadicHats | |
| namespace DyadicHats | |
| open scoped BigOperators | |
| /-- Literal nine-child support of an adjacent dyadic refinement row. -/ | |
| def children (p : β€ Γ β€) : Finset (β€ Γ β€) := | |
| (Finset.Icc (2*p.1-1) (2*p.1+1)).product (Finset.Icc (2*p.2-1) (2*p.2+1)) | |
| lemma tent_half_zero {j k : β€} (h : j β Finset.Icc (2*k-1) (2*k+1)) : | |
| tent ((j:β)/2-k) = 0 := by | |
| have ht : j-2*k β Finset.Icc (-1) 1 := by | |
| simp only [Finset.mem_Icc] at * | |
| omega | |
| convert tent_half_integer ht using 1 | |
| push_cast | |
| congr 1 | |
| ring | |
| lemma step_zero_of_not_child {p q : β€ Γ β€} (hq : q β children p) : step p q = 0 := by | |
| have hq' : Β¬(q.1 β Finset.Icc (2*p.1-1) (2*p.1+1) β§ q.2 β Finset.Icc (2*p.2-1) (2*p.2+1)) := by | |
| exact fun hn => hq (Finset.mem_product.mpr hn) | |
| rw [not_and_or] at hq' | |
| rcases hq' with hq | hq | |
| Β· rw [step,tent_half_zero hq,zero_mul] | |
| Β· rw [step,tent_half_zero hq,mul_zero] | |
| lemma hat_refine_finite (r : β) (p : β€ Γ β€) (x : β) : | |
| hat (2*r) p x = β q β children p, step p q*hat r q x := by | |
| rw [hat_refine,tsum_eq_sum (s := children p)] | |
| intro q hq | |
| rw [step_zero_of_not_child hq,zero_mul] | |
| /-- The vector mass of the actual density, not an abstract additive tree. -/ | |
| def vectorMass (h : β β β) (r : β) (p : β€ Γ β€) : β := β« y, hat r p y β’ h y | |
| def scalarMass (h : β β β) (r : β) (p : β€ Γ β€) : β := βvectorMass h r pβ | |
| lemma integrable_hat_smul {h : β β β} (hh : Integrable h) (r : β) (p : β€ Γ β€) : | |
| Integrable (fun y => hat r p y β’ h y) := by | |
| apply hh.bdd_smul 1 (continuous_hat r p).aestronglyMeasurable | |
| filter_upwards with y | |
| simpa only [Real.norm_eq_abs,abs_of_nonneg (hat_nonneg r p y)] using hat_le_one r p y | |
| lemma vectorMass_refine {h : β β β} (hh : Integrable h) (r : β) (p : β€ Γ β€) : | |
| vectorMass h (2*r) p = β q β children p, step p q β’ vectorMass h r q := by | |
| unfold vectorMass | |
| simp_rw [hat_refine_finite,Finset.sum_smul,mul_smul] | |
| rw [integral_finsetSum] | |
| Β· apply Finset.sum_congr rfl | |
| intro q hq | |
| exact integral_smul _ _ | |
| Β· intro q hq | |
| exact (integrable_hat_smul hh r q).smul _ | |
| lemma scalarMass_le_integral {h : β β β} (r : β) (p : β€ Γ β€) : | |
| scalarMass h r p β€ β« y, hat r p y * βh yβ := by | |
| unfold scalarMass vectorMass | |
| simpa only [norm_smul,Real.norm_eq_abs,abs_of_nonneg (hat_nonneg _ _ _)] using | |
| norm_integral_le_integral_norm (fun y => hat r p y β’ h y) | |
| /-- Any finite set of roots carries at most the total L1 density, uniformly | |
| in the scale. This proves the full-grid mass budget once finite support is used. -/ | |
| lemma sum_scalarMass_le {h : β β β} (hh : Integrable h) (r : β) (S : Finset (β€ Γ β€)) : | |
| β p β S, scalarMass h r p β€ β« y, βh yβ := by | |
| have hi (p : β€ Γ β€) : Integrable (fun y => hat r p y * βh yβ) := by | |
| simpa only [norm_smul,Real.norm_eq_abs,abs_of_nonneg (hat_nonneg _ _ _)] using | |
| (integrable_hat_smul hh r p).norm | |
| calc | |
| _ β€ β p β S, β« y, hat r p y * βh yβ := Finset.sum_le_sum (fun p _ => scalarMass_le_integral r p) | |
| _ = β« y, β p β S, hat r p y * βh yβ := (integral_finsetSum _ (fun p _ => hi p)).symm | |
| _ β€ β« y, βh yβ := by | |
| apply integral_mono (integrable_finsetSum _ (fun p _ => hi p)) hh.norm | |
| intro y | |
| change (β p β S, hat r p y * βh yβ) β€ βh yβ | |
| rw [β Finset.sum_mul] | |
| have hs := Summable.sum_le_tsum S (fun p _ => hat_nonneg r p y) (summable_hat r y) | |
| rw [tsum_hat] at hs | |
| simpa only [one_mul] using mul_le_mul_of_nonneg_right hs (norm_nonneg (h y)) | |
| lemma scalarMass_refine_le {h : β β β} (hh : Integrable h) (r : β) (p : β€ Γ β€) : | |
| scalarMass h (2*r) p β€ β q β children p, step p q*scalarMass h r q := by | |
| unfold scalarMass | |
| rw [vectorMass_refine hh] | |
| simpa only [norm_smul,Real.norm_eq_abs,abs_of_nonneg (step_nonneg _ _)] using | |
| norm_sum_le (children p) (fun q => step p q β’ vectorMass h r q) | |
| /-- A finite index set that contains every hat meeting a fixed bounded region. -/ | |
| def boundedIndices (r R : β) : Finset (β€ Γ β€) := | |
| (Finset.Icc (-βR/r+1β) βR/r+1β).product (Finset.Icc (-βR/r+1β) βR/r+1β) | |
| lemma mem_boundedIndices {r R : β} (hr : 0 < r) {x : β} (hx : βxβ β€ R) | |
| {p : β€ Γ β€} (hp : hat r p x β 0) : p β boundedIndices r R := by | |
| have hpos : 0 < hat r p x := lt_of_le_of_ne (hat_nonneg r p x) (Ne.symm hp) | |
| have h1 := (tent_pos_iff _).mp (pos_of_mul_pos_left hpos (tent_nonneg _)) | |
| have h2 := (tent_pos_iff _).mp (pos_of_mul_pos_right hpos (tent_nonneg _)) | |
| have hbound (a : β) (j : β€) (ha : |a| β€ R) (hj : |a/r-j| < 1) : | |
| j β Finset.Icc (-βR/r+1β) βR/r+1β := by | |
| have hq : |a/r| β€ R/r := by rw [abs_div,abs_of_pos hr]; exact div_le_div_of_nonneg_right ha hr.le | |
| have hja : |(j:β)| β€ R/r+1 := by | |
| calc | |
| _ = |a/r-(a/r-j)| := by congr 1; ring | |
| _ β€ |a/r|+|a/r-j| := abs_sub _ _ | |
| _ β€ R/r+1 := add_le_add hq hj.le | |
| have hlo := (abs_le.mp hja).1 | |
| have hhi := (abs_le.mp hja).2 | |
| have hc := Int.le_ceil (R/r+1) | |
| simp only [Finset.mem_Icc] | |
| constructor | |
| Β· have : (-(βR/r+1β:β)) β€ j := by linarith | |
| exact_mod_cast this | |
| Β· have : (j:β) β€ βR/r+1β := hhi.trans hc | |
| exact_mod_cast this | |
| exact Finset.mem_product.mpr β¨hbound x.re p.1 ((Complex.abs_re_le_norm x).trans hx) h1, | |
| hbound x.im p.2 ((Complex.abs_im_le_norm x).trans hx) h2β© | |
| lemma vectorMass_zero_of_not_index {h : β β β} {r R : β} (hr : 0 < r) | |
| (hs : β y, h y β 0 β βyβ β€ R) {p : β€ Γ β€} (hp : p β boundedIndices r R) : | |
| vectorMass h r p = 0 := by | |
| apply integral_eq_zero_of_ae | |
| filter_upwards with y | |
| by_cases hy : h y = 0 | |
| Β· simp only [hy,smul_zero,Pi.zero_apply] | |
| Β· have hh : hat r p y = 0 := by | |
| by_contra hn | |
| exact hp (mem_boundedIndices hr (hs y hy) hn) | |
| simp only [hh,zero_smul,Pi.zero_apply] | |
| /-- Compactly supported actual densities have finitely many nonzero vector | |
| masses at each positive scale. -/ | |
| lemma finite_vectorMass_support {h : β β β} (hc : HasCompactSupport h) {r : β} (hr : 0 < r) : | |
| (Function.support (vectorMass h r)).Finite := by | |
| obtain β¨R,hRβ© := hc.isBounded.subset_closedBall (0:β) | |
| apply (boundedIndices r R).finite_toSet.subset | |
| intro p hp | |
| by_contra hn | |
| exact hp (vectorMass_zero_of_not_index hr (fun y hy => by | |
| simpa only [Metric.mem_closedBall,dist_zero_right] using hR (subset_tsupport h hy)) hn) | |
| end DyadicHats | |
| open MeasureTheory MeasureTheory.Measure Set Filter | |
| open scoped ENNReal NNReal Topology RealInnerProductSpace ContDiff | |
| noncomputable section | |
| namespace LipschitzWith | |
| open scoped _root_.LipschitzWith | |
| variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E] | |
| [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] | |
| {ΞΌ : Measure E} [IsAddHaarMeasure ΞΌ] {f g : E β β} {L K : ββ₯0} | |
| /-- Genuine integration by parts for Lipschitz weights and compact Lipschitz | |
| potentials. Differentiability is required only almost everywhere, and follows | |
| from Rademacher rather than being a new premise. -/ | |
| theorem integral_fderiv_mul_eq_neg (hf : LipschitzWith L f) (hg : LipschitzWith K g) | |
| (hgc : HasCompactSupport g) (v : E) : | |
| (β« x, fderiv β f x v * g x βΞΌ) = -β« x, fderiv β g x v * f x βΞΌ := by | |
| have h1 : (fun x => fderiv β f x v*g x) =α΅[ΞΌ] fun x => lineDeriv β f x v*g x := by | |
| filter_upwards [hf.ae_differentiableAt (ΞΌ := ΞΌ)] with x hx | |
| rw [hx.lineDeriv_eq_fderiv] | |
| have h2 : (fun x => lineDeriv β g x (-v)*f x) =α΅[ΞΌ] fun x => -(fderiv β g x v*f x) := by | |
| filter_upwards [hg.ae_differentiableAt (ΞΌ := ΞΌ)] with x hx | |
| rw [hx.lineDeriv_eq_fderiv,map_neg,neg_mul] | |
| rw [integral_congr_ae h1,hf.integral_lineDeriv_mul_eq hg hgc v,integral_congr_ae h2,integral_neg] | |
| /-- The total gradient version obtained from Riesz and measurable fderiv is | |
| locally integrable, including on the nondifferentiability set. -/ | |
| theorem locallyIntegrable_gradient (hf : LipschitzWith L f) : | |
| LocallyIntegrable (gradient f) ΞΌ := by | |
| have hm : AEStronglyMeasurable (gradient f) ΞΌ := | |
| ((InnerProductSpace.toDual β E).symm.continuous.measurable.comp | |
| (measurable_fderiv β f)).aestronglyMeasurable | |
| have hb : β x, βgradient f xβ β€ (L:β) := by | |
| intro x | |
| simpa only [gradient,(InnerProductSpace.toDual β E).symm.norm_map] using | |
| (norm_fderiv_le_of_lipschitz β hf : βfderiv β f xβ β€ (L:β)) | |
| exact (memLp_top_of_bound hm (L:β) (ae_of_all _ hb)).locallyIntegrable le_top | |
| theorem integrable_gradient (hf : LipschitzWith L f) (hc : HasCompactSupport f) : | |
| Integrable (gradient f) ΞΌ := by | |
| have hs : HasCompactSupport (gradient f) := | |
| (hc.fderiv β).comp_left (map_zero (InnerProductSpace.toDual β E).symm) | |
| exact (integrableOn_iff_integrable_of_support_subset (subset_tsupport (gradient f))).mp | |
| ((_root_.OAI.LipschitzWith.locallyIntegrable_gradient (ΞΌ := ΞΌ) hf).integrableOn_isCompact hs) | |
| theorem integral_mul_fderiv_eq_neg (hf : LipschitzWith L f) (hg : LipschitzWith K g) | |
| (hgc : HasCompactSupport g) (v : E) : | |
| (β« x, f x * fderiv β g x v βΞΌ) = -β« x, inner β (gradient f x) v * g x βΞΌ := by | |
| simp only [gradient,InnerProductSpace.toDual_symm_apply] | |
| have h := _root_.OAI.LipschitzWith.integral_fderiv_mul_eq_neg (ΞΌ := ΞΌ) hf hg hgc v | |
| rw [show (fun x => f x * fderiv β g x v) = (fun x => fderiv β g x v * f x) by | |
| funext x; exact mul_comm _ _] | |
| linarith | |
| end LipschitzWith | |
| open MeasureTheory Set Metric Filter Finset | |
| open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology | |
| namespace DyadicHats | |
| def indexBox (N : β) : Finset (β€ Γ β€) := | |
| (Finset.Icc (-(N:β€)) N).product (Finset.Icc (-(N:β€)) N) | |
| abbrev Grid (N : β) := {p : β€ Γ β€ // p β indexBox N} | |
| lemma parent_in_box {N : β} {p q : β€ Γ β€} (hq : q β indexBox N) (hpq : step p q β 0) : | |
| p β indexBox N := by | |
| have hq1 : -(N:β€) β€ q.1 β§ q.1 β€ N := Finset.mem_Icc.mp (Finset.mem_product.mp hq).1 | |
| have hq2 : -(N:β€) β€ q.2 β§ q.2 β€ N := Finset.mem_Icc.mp (Finset.mem_product.mp hq).2 | |
| have hh : 0 < step p q := lt_of_le_of_ne (step_nonneg p q) (Ne.symm hpq) | |
| have h1 := (tent_pos_iff _).mp (pos_of_mul_pos_left hh (tent_nonneg _)) | |
| have h2 := (tent_pos_iff _).mp (pos_of_mul_pos_right hh (tent_nonneg _)) | |
| have hbound (j k : β€) (hk : -(N:β€) β€ k β§ k β€ N) (ha : |(k:β)/2-j| < 1) : | |
| j β Finset.Icc (-(N:β€)) N := by | |
| have hlo : -(N:β) β€ k := by exact_mod_cast hk.1 | |
| have hhi : (k:β) β€ N := by exact_mod_cast hk.2 | |
| have hj := abs_lt.mp ha | |
| simp only [Finset.mem_Icc] | |
| constructor | |
| Β· by_contra hn | |
| have : j β€ -(N:β€)-1 := by omega | |
| have : (j:β) β€ -(N:β)-1 := by exact_mod_cast this | |
| nlinarith [Nat.cast_nonneg (Ξ± := β) N] | |
| Β· by_contra hn | |
| have : (N:β€)+1 β€ j := by omega | |
| have : (N:β)+1 β€ j := by exact_mod_cast this | |
| nlinarith [Nat.cast_nonneg (Ξ± := β) N] | |
| exact Finset.mem_product.mpr β¨hbound _ _ hq1 h1,hbound _ _ hq2 h2β© | |
| /-- Restriction to a finite box retains the exact column normalization of the | |
| positive dyadic refinement matrix; it does not normalize its rows. -/ | |
| lemma grid_step_column (N : β) (q : Grid N) : (β p : Grid N, step p q) = 1 := by | |
| have he := step_column q.val | |
| rw [tsum_eq_sum (s := indexBox N)] at he | |
| Β· exact (Finset.sum_coe_sort (indexBox N) (fun p => step p q)).trans he | |
| Β· intro p hp | |
| by_contra hn | |
| exact hp (parent_in_box q.property hn) | |
| lemma mem_indexBox_of_le {N : β} {r R : β} (hr : 0 < r) | |
| (hN : R/r+1 β€ (N:β)) {x : β} (hx : βxβ β€ R) {p : β€ Γ β€} (hp : hat r p x β 0) : | |
| p β indexBox N := by | |
| have hm := mem_boundedIndices hr hx hp | |
| have hc : βR/r+1β β€ (N:β€) := Int.ceil_le.mpr (by simpa only [Int.cast_natCast] using hN) | |
| have h1 := Finset.mem_Icc.mp (Finset.mem_product.mp hm).1 | |
| have h2 := Finset.mem_Icc.mp (Finset.mem_product.mp hm).2 | |
| apply Finset.mem_product.mpr | |
| constructor <;> apply Finset.mem_Icc.mpr <;> constructor <;> omega | |
| lemma hat_mul_zero_outside {N : β} {r R : β} (hr : 0 < r) | |
| (hN : R/r+1 β€ (N:β)) {h : β β β} (hs : β y, h y β 0 β βyβ β€ R) | |
| {p : β€ Γ β€} (hp : p β indexBox N) (x : β) : hat r p x*h x = 0 := by | |
| by_cases hx : h x = 0 | |
| Β· rw [hx,mul_zero] | |
| Β· have ht : hat r p x = 0 := by | |
| by_contra hn | |
| exact hp (mem_indexBox_of_le hr hN (hs x hx) hn) | |
| rw [ht,zero_mul] | |
| lemma density_partition_grid {N : β} {r R : β} (hr : 0 < r) | |
| (hN : R/r+1 β€ (N:β)) {h : β β β} (hs : β y, h y β 0 β βyβ β€ R) (x : β) : | |
| (β p : Grid N, hat r p x*h x) = h x := by | |
| have he : (β' p : β€ Γ β€, hat r p x*h x) = β p β indexBox N, hat r p x*h x := | |
| tsum_eq_sum (fun p hp => hat_mul_zero_outside hr hN hs hp x) | |
| rw [Finset.sum_coe_sort (indexBox N) (fun p => hat r p x*h x),β he, | |
| tsum_mul_right,tsum_hat,one_mul] | |
| lemma density_refine_grid {N : β} {r R : β} (hr : 0 < r) | |
| (hN : R/r+1 β€ (N:β)) {h : β β β} (hs : β y, h y β 0 β βyβ β€ R) | |
| (p : Grid N) (x : β) : | |
| hat (2*r) p x*h x = β q : Grid N, step p q*(hat r q x*h x) := by | |
| rw [hat_refine,β tsum_mul_right,tsum_eq_sum (s := indexBox N)] | |
| Β· rw [Finset.sum_coe_sort (indexBox N) (fun q => step p q*(hat r q x*h x))] | |
| apply Finset.sum_congr rfl | |
| intro q hq | |
| ring | |
| Β· intro q hq | |
| rw [mul_assoc,hat_mul_zero_outside hr hN hs hq x,mul_zero] | |
| lemma integrable_hat_mul {h : β β β} (hh : Integrable h) (r : β) (p : β€ Γ β€) : | |
| Integrable (fun y => hat r p y*h y) := by | |
| exact hh.bdd_smul 1 (continuous_hat r p).aestronglyMeasurable | |
| (ae_of_all _ (fun y => by | |
| simpa only [Real.norm_eq_abs,abs_of_nonneg (hat_nonneg r p y)] using hat_le_one r p y)) | |
| def scale (r : β) (k : β) : β := (2:β)^k*r | |
| lemma scale_pos {r : β} (hr : 0 < r) (k : β) : 0 < scale r k := by unfold scale; positivity | |
| lemma scale_succ (r : β) (k : β) : scale r (k+1) = 2*scale r k := by | |
| unfold scale | |
| rw [pow_succ] | |
| ring | |
| lemma le_scale {r : β} (hr : 0 β€ r) (k : β) : r β€ scale r k := by | |
| have hp : (1:β) β€ 2^k := one_le_powβ (by norm_num) | |
| simpa only [one_mul,scale] using mul_le_mul_of_nonneg_right hp hr | |
| lemma scale_index_bound {N : β} {r R : β} (hr : 0 < r) (hR : 0 β€ R) | |
| (hN : R/r+1 β€ (N:β)) (k : β) : R/scale r k+1 β€ (N:β) := by | |
| have hd : R / scale r k β€ R / r := div_le_div_of_nonneg_left hR hr (le_scale hr.le k) | |
| linarith | |
| end DyadicHats | |
| end | |
| end | |
| end OAI | |