Download data/lean/OAI/Probability/PosteriorReplicas/Geometry/SphereTubeQuantitative.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.52 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/PosteriorReplicas/Geometry/SphereTubeQuantitative.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/PosteriorReplicas/Geometry/SphereTubeQuantitative.lean
-
curl -L -o SphereTubeQuantitative.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/PosteriorReplicas/Geometry/SphereTubeQuantitative.lean
4.52 kB
| import OAI.Probability.PosteriorReplicas.Gaussian.GaussianGramMoment | |
| namespace OAI | |
| open MeasureTheory ProbabilityTheory Set Matrix InnerProductSpace Metric EuclideanGeometry Filter | |
| open scoped ENNReal NNReal RealInnerProductSpace Topology | |
| noncomputable section | |
| namespace PosteriorReplicas | |
| lemma sphereLaw_closedBall {d : β} [NeZero d] (z : Vec d) {r : β} (hr : 0 < r) : | |
| sphereLaw d (closedBall z r) β€ ENNReal.ofReal ((3:β)*4^d) * ENNReal.ofReal (r^(d-1)) := by | |
| simpa only [sphereLaw, PosteriorRegression.ambientSphereLaw, PosteriorRegression.sphereLaw, | |
| finrank_euclideanSpace_fin] using | |
| PosteriorRegression.ambientSphereLaw_closedBall z hr (d-1) (by simp) | |
| lemma sphereLaw_support_unit {d : β} : (sphereLaw d).support β closedBall 0 1 := by | |
| exact (PosteriorRegression.ambientSphereLaw_support (E := Vec d)).trans sphere_subset_closedBall | |
| lemma sphere_affine_tube_quantitative {d k : β} [NeZero d] | |
| (L : AffineSubspace β (Vec d)) [Nonempty L] | |
| (hd : Module.finrank β L.direction + k β€ d-1) {r : β} (hr : 0 < r) (hr1 : r β€ 1) : | |
| sphereLaw d {x | Metric.infDist x L β€ r} β€ ENNReal.ofReal ((72:β)^d) * ENNReal.ofReal (r^k) := by | |
| classical | |
| obtain β¨s,hcard,hcoverβ© := PosteriorRegression.exists_affine_tube_cover L hr hr1 | |
| let c : L.direction β Vec d := fun y => (y : Vec d) + (orthogonalProjection L 0 : Vec d) | |
| have hsub : {x | Metric.infDist x L β€ r} β€α΅[sphereLaw d] | |
| β y β s, closedBall (c y) (2*r) := by | |
| filter_upwards [(sphereLaw d).support_mem_ae] with x hx | |
| intro hdist | |
| have hxunit : βxβ β€ 1 := by simpa using sphereLaw_support_unit hx | |
| obtain β¨y,hy,hyxβ© := hcover x hxunit hdist | |
| exact mem_iUnionβ.mpr β¨y,hy,hyxβ© | |
| let a := Module.finrank β L.direction | |
| have hd0 : 1 β€ d := NeZero.one_le | |
| have ha : a β€ d := by dsimp [a]; omega | |
| have hpow : (3/r)^a * ((3:β)*4^d) * (2*r)^(d-1) β€ (72:β)^d*r^k := by | |
| have hcan : (3/r)^a * ((3:β)*4^d) * (2*r)^(d-1) = | |
| (3*4^d*3^a*2^(d-1)) * r^(d-1-a) := by | |
| have hdim : d-1 = a+(d-1-a) := by dsimp [a]; omega | |
| nth_rw 1 [hdim] | |
| rw [mul_pow, div_pow, pow_add] | |
| field_simp | |
| rw [hdim, pow_add] | |
| simp only [Nat.add_sub_cancel_left] | |
| ring | |
| rw [hcan] | |
| have hc : (3:β)*4^d*3^a*2^(d-1) β€ (72:β)^d := by | |
| have h3 : (3:β) β€ 3^d := by simpa using pow_le_pow_rightβ (by norm_num : (1:β) β€ 3) hd0 | |
| have h3a : (3:β)^a β€ 3^d := pow_le_pow_rightβ (by norm_num) ha | |
| have h2 : (2:β)^(d-1) β€ 2^d := pow_le_pow_rightβ (by norm_num) (Nat.sub_le _ _) | |
| calc | |
| _ β€ 3^d*4^d*3^d*2^d := by gcongr | |
| _ = (72:β)^d := by simp only [β mul_pow]; congr 1; norm_num | |
| apply mul_le_mul hc ?_ (by positivity) (by positivity) | |
| exact pow_le_pow_of_le_one hr.le hr1 (by dsimp [a]; omega) | |
| calc | |
| _ β€ sphereLaw d (β y β s, closedBall (c y) (2*r)) := measure_mono_ae hsub | |
| _ β€ β y β s, sphereLaw d (closedBall (c y) (2*r)) := measure_biUnion_finset_le _ _ | |
| _ β€ β _y β s, ENNReal.ofReal ((3:β)*4^d)*ENNReal.ofReal ((2*r)^(d-1)) := by | |
| exact Finset.sum_le_sum (fun y _ => sphereLaw_closedBall (c y) (by positivity)) | |
| _ = (s.card : ββ₯0β) * (ENNReal.ofReal ((3:β)*4^d)*ENNReal.ofReal ((2*r)^(d-1))) := by simp | |
| _ β€ ENNReal.ofReal ((3/r)^a) * (ENNReal.ofReal ((3:β)*4^d)*ENNReal.ofReal ((2*r)^(d-1))) := by | |
| gcongr | |
| exact_mod_cast ENNReal.ofReal_le_ofReal hcard | |
| _ β€ _ := by | |
| rw [β ENNReal.ofReal_mul (by positivity), β ENNReal.ofReal_mul (by positivity), | |
| β ENNReal.ofReal_mul (by positivity)] | |
| apply ENNReal.ofReal_le_ofReal | |
| nlinarith [hpow] | |
| lemma spherical_tilt_affine_tube {d k : β} [NeZero d] | |
| {f : Vec d β ββ₯0β} {M : ββ₯0β} (hfM : β x, f x β€ M) | |
| (L : AffineSubspace β (Vec d)) [Nonempty L] | |
| (hd : Module.finrank β L.direction+k β€ d-1) {r : β} (hr : 0 < r) (hr1 : r β€ 1) : | |
| (sphereLaw d).withDensity f {x | Metric.infDist x L β€ r} β€ | |
| (M*ENNReal.ofReal ((72:β)^d)) * ENNReal.ofReal (r^k) := by | |
| rw [withDensity_apply _ (measurableSet_le (Metric.continuous_infDist_pt _).measurable measurable_const)] | |
| calc | |
| _ β€ β«β» _x in {x | Metric.infDist x L β€ r}, M βsphereLaw d := lintegral_mono hfM | |
| _ = M * sphereLaw d {x | Metric.infDist x L β€ r} := by simp | |
| _ β€ _ := by | |
| rw [mul_assoc] | |
| exact mul_le_mul' le_rfl (sphere_affine_tube_quantitative L hd hr hr1) | |
| end PosteriorReplicas | |
| end | |
| end OAI | |