Download data/lean/OAI/Probability/GaussianReplacement/CriticalGeometry.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 21.8 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/GaussianReplacement/CriticalGeometry.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/GaussianReplacement/CriticalGeometry.lean
-
curl -L -o CriticalGeometry.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/GaussianReplacement/CriticalGeometry.lean
21.8 kB
| import OAI.Probability.GaussianReplacement.ConditionalInfo | |
| namespace OAI | |
| open MeasureTheory ProbabilityTheory Set Filter | |
| open scoped ENNReal NNReal RealInnerProductSpace Topology | |
| noncomputable section | |
| namespace CurrentProjection | |
| open InnerProductSpace | |
| open InformationTheory | |
| def CriticalComparisonMain : Prop := | |
| β (K : β) (dβ : β), 0 < K β§ β (d : β), dβ β€ d β | |
| β (W : Type) [MeasurableSpace W] [Countable W] [MeasurableSingletonClass W], | |
| β (P : Measure ((Sphere dΓW)ΓRows (d/10) d)) [IsProbabilityMeasure P], | |
| (P.map swapLast).fst = (uniformSphere d).prod (gaussianRows (d/10) d) β | |
| shannonEntropy (P.map swapLast).snd β€ ENNReal.ofReal ((d:β)^2) β | |
| exposedInformation (P.fst.prod (gaussianRows (d/10+(d/2-d/10)) d)) β€ | |
| exposedInformation (alignedExperiment (r:=d/2-d/10) P) + ENNReal.ofReal (K*d) | |
| def criticalRadius (j : β) : β := 2 * (1/2:β)^j | |
| lemma criticalRadius_pos (j : β) : 0 < criticalRadius j := by | |
| unfold criticalRadius | |
| positivity | |
| lemma criticalRadius_le_two (j : β) : criticalRadius j β€ 2 := by | |
| unfold criticalRadius | |
| nlinarith [pow_le_oneβ (by norm_num : (0:β) β€ 1/2) (by norm_num : (1/2:β) β€ 1) (n:=j)] | |
| lemma criticalRadius_tendsto : Tendsto criticalRadius atTop (π 0) := by | |
| change Tendsto (fun j => 2 * (1/2:β)^j) atTop (π 0) | |
| simpa only [mul_zero] using (tendsto_pow_atTop_nhds_zero_of_lt_one | |
| (by norm_num : (0:β) β€ 1/2) (by norm_num : (1/2:β) < 1)).const_mul 2 | |
| def ballRatio {d : β} (F : Measure (Sphere d)) (β : β) (s : Sphere d) (j : β) : β := | |
| (F {x | dist (x:Vector d) (s:Vector d) β€ criticalRadius j}).toReal / criticalRadius j ^ β | |
| lemma sphere_dist_le_two {d : β} (s t : Sphere d) : dist (s:Vector d) (t:Vector d) β€ 2 := by | |
| have hs : β(s:Vector d)β = 1 := by simp | |
| have ht : β(t:Vector d)β = 1 := by simp | |
| calc | |
| _ β€ dist (s:Vector d) 0 + dist (0:Vector d) t := dist_triangle _ _ _ | |
| _ = 2 := by simp only [dist_zero_right,dist_zero_left,hs,ht]; norm_num | |
| lemma ballRatio_zero {d : β} (F : Measure (Sphere d)) [IsProbabilityMeasure F] | |
| (β : β) (s : Sphere d) : ballRatio F β s 0 = (2:β)β»ΒΉ ^ β := by | |
| have he : {x : Sphere d | dist (x:Vector d) (s:Vector d) β€ criticalRadius 0} = univ := by | |
| ext x | |
| simp [criticalRadius, sphere_dist_le_two x s] | |
| unfold ballRatio | |
| rw [he] | |
| simp [criticalRadius,one_div] | |
| lemma ballRatio_nonneg {d : β} (F : Measure (Sphere d)) (β : β) (s : Sphere d) (j : β) : | |
| 0 β€ ballRatio F β s j := div_nonneg ENNReal.toReal_nonneg (pow_pos (criticalRadius_pos j) _).le | |
| lemma measurable_ballRatio {d : β} (F : Measure (Sphere d)) [SFinite F] (β j : β) : | |
| Measurable (fun s => ballRatio F β s j) := by | |
| have hm : MeasurableSet {p : Sphere d Γ Sphere d | | |
| dist (p.2:Vector d) (p.1:Vector d) β€ criticalRadius j} := | |
| measurableSet_le (by fun_prop) measurable_const | |
| exact (measurable_measure_prodMk_left hm).ennreal_toReal.div_const _ | |
| lemma ballRatio_le_growth {d n β : β} (F : Measure (Sphere d)) [IsFiniteMeasure F] | |
| (D : β) (hD : 0 β€ D) (hF : LocalGrowth F n D) (hβ : β β€ n) | |
| (s : Sphere d) (j : β) : ballRatio F β s j β€ D * criticalRadius j^(n-β) := by | |
| have hr := criticalRadius_pos j | |
| have hb : (F {x | dist (x:Vector d) (s:Vector d) β€ criticalRadius j}).toReal β€ | |
| D * criticalRadius j^n := by | |
| simpa only [ENNReal.toReal_ofReal (mul_nonneg hD (pow_nonneg hr.le _))] using | |
| ENNReal.toReal_mono ENNReal.ofReal_ne_top (hF s (criticalRadius j) hr) | |
| apply (div_le_iffβ (pow_pos hr β)).mpr | |
| calc | |
| _ β€ D * criticalRadius j^n := hb | |
| _ = _ := by rw [mul_assoc, β pow_add, Nat.sub_add_cancel hβ] | |
| lemma ballRatio_tendsto_zero {d n β : β} (F : Measure (Sphere d)) [IsFiniteMeasure F] | |
| (D : β) (hD : 0 β€ D) (hF : LocalGrowth F n D) (hβ : β < n) (s : Sphere d) : | |
| Tendsto (ballRatio F β s) atTop (π 0) := by | |
| have ht : Tendsto (fun j => D * criticalRadius j^(n-β)) atTop (π 0) := by | |
| simpa [Nat.ne_of_gt (Nat.sub_pos_of_lt hβ)] using (criticalRadius_tendsto.pow (n-β)).const_mul D | |
| exact squeeze_zero (ballRatio_nonneg F β s) (ballRatio_le_growth F D hD hF hβ.le s) ht | |
| lemma exists_max_of_tendsto_zero (f : β β β) (hf : Tendsto f atTop (π 0)) | |
| (h0 : 0 < f 0) : β j, β i, f i β€ f j := by | |
| obtain β¨N,hNβ© := eventually_atTop.mp (hf.eventually (gt_mem_nhds h0)) | |
| obtain β¨j,hj,hmaxβ© := (Finset.range (N+1)).exists_max_image f (by simp) | |
| refine β¨j,fun i => ?_β© | |
| by_cases hi : i < N+1 | |
| Β· exact hmax _ (Finset.mem_range.mpr hi) | |
| Β· exact (hN i (by omega)).le.trans (hmax 0 (by simp)) | |
| lemma ballRatio_has_max {d n β : β} (F : Measure (Sphere d)) [IsProbabilityMeasure F] | |
| (D : β) (hD : 0 β€ D) (hF : LocalGrowth F n D) (hβ : β < n) (s : Sphere d) : | |
| β j, β i, ballRatio F β s i β€ ballRatio F β s j := by | |
| apply exists_max_of_tendsto_zero _ (ballRatio_tendsto_zero F D hD hF hβ s) | |
| rw [ballRatio_zero] | |
| positivity | |
| def criticalIndex {d : β} (F : Measure (Sphere d)) (β : β) (s : Sphere d) : β := by | |
| classical | |
| exact if h : β j, β i, ballRatio F β s i β€ ballRatio F β s j then Nat.find h else 0 | |
| def criticalMass {d : β} (F : Measure (Sphere d)) (β : β) (s : Sphere d) : β := | |
| ballRatio F β s (criticalIndex F β s) | |
| def criticalLevel {d : β} (F : Measure (Sphere d)) (β : β) (s : Sphere d) : β€ := | |
| βReal.log (criticalMass F β s)β | |
| lemma criticalIndex_max {d n β : β} (F : Measure (Sphere d)) [IsProbabilityMeasure F] | |
| (D : β) (hD : 0 β€ D) (hF : LocalGrowth F n D) (hβ : β < n) (s : Sphere d) (i : β) : | |
| ballRatio F β s i β€ criticalMass F β s := by | |
| classical | |
| have hm := ballRatio_has_max F D hD hF hβ s | |
| simp only [criticalMass,criticalIndex,dite_eq_left hm] | |
| exact Nat.find_spec hm i | |
| lemma criticalIndex_least {d n β : β} (F : Measure (Sphere d)) [IsProbabilityMeasure F] | |
| (D : β) (hD : 0 β€ D) (hF : LocalGrowth F n D) (hβ : β < n) (s : Sphere d) | |
| (j : β) (hj : β i, ballRatio F β s i β€ ballRatio F β s j) : criticalIndex F β s β€ j := by | |
| classical | |
| have hm := ballRatio_has_max F D hD hF hβ s | |
| simp only [criticalIndex,dite_eq_left hm] | |
| exact Nat.find_min' hm hj | |
| lemma measurable_criticalIndex {d : β} (F : Measure (Sphere d)) [SFinite F] (β : β) : | |
| Measurable (criticalIndex F β) := by | |
| classical | |
| have hp (j : β) : MeasurableSet {s | β i, ballRatio F β s i β€ ballRatio F β s j} := by | |
| simp only [Set.ofPred_forall] | |
| exact MeasurableSet.iInter (fun i => measurableSet_le (measurable_ballRatio F β i) (measurable_ballRatio F β j)) | |
| have he : MeasurableSet {s | β j, β i, ballRatio F β s i β€ ballRatio F β s j} := by | |
| simp only [Set.ofPred_exists] | |
| exact MeasurableSet.iUnion hp | |
| apply measurable_to_countable' | |
| intro j | |
| change MeasurableSet {s | criticalIndex F β s = j} | |
| by_cases hj : j = 0 | |
| Β· subst j | |
| have hset : {s | criticalIndex F β s = 0} = | |
| {s | β i, ballRatio F β s i β€ ballRatio F β s 0} βͺ | |
| {s | Β¬ β j, β i, ballRatio F β s i β€ ballRatio F β s j} := by | |
| ext s | |
| simp only [criticalIndex,mem_ofPred_eq,mem_union] | |
| split_ifs with h | |
| Β· simp [Nat.find_eq_zero,h] | |
| Β· simp [h] | |
| rw [hset] | |
| exact (hp 0).union he.compl | |
| Β· have hset : {s | criticalIndex F β s = j} = | |
| {s | β i, ballRatio F β s i β€ ballRatio F β s j} β© | |
| β k < j, {s | Β¬ β i, ballRatio F β s i β€ ballRatio F β s k} := by | |
| ext s | |
| simp only [criticalIndex,mem_ofPred_eq,mem_inter_iff,mem_iInter] | |
| split_ifs with h | |
| Β· exact Nat.find_eq_iff h | |
| Β· simp only [eq_comm (a:=0),hj,false_iff,not_and] | |
| intro hs | |
| exact False.elim (h β¨j,hsβ©) | |
| rw [hset] | |
| exact (hp j).inter (MeasurableSet.iInter (fun k => MeasurableSet.iInter (fun _ => (hp k).compl))) | |
| lemma measurable_criticalMass {d : β} (F : Measure (Sphere d)) [SFinite F] (β : β) : | |
| Measurable (criticalMass F β) := by | |
| have hm : Measurable (fun p : Sphere d Γ β => ballRatio F β p.1 p.2) := | |
| measurable_from_prod_countable_left (measurable_ballRatio F β) | |
| have hpair : Measurable (fun s : Sphere d => (s,criticalIndex F β s)) := | |
| measurable_id.prodMk (measurable_criticalIndex F β) | |
| have hcomp := hm.comp hpair | |
| change Measurable (fun s => ballRatio F β s (criticalIndex F β s)) | |
| exact hcomp | |
| lemma measurable_criticalLevel {d : β} (F : Measure (Sphere d)) [SFinite F] (β : β) : | |
| Measurable (criticalLevel F β) := (measurable_criticalMass F β).log.ceil | |
| lemma criticalMass_pos {d n β : β} (F : Measure (Sphere d)) [IsProbabilityMeasure F] | |
| (D : β) (hD : 0 β€ D) (hF : LocalGrowth F n D) (hβ : β < n) (s : Sphere d) : | |
| 0 < criticalMass F β s := by | |
| have hm := criticalIndex_max F D hD hF hβ s 0 | |
| rw [ballRatio_zero] at hm | |
| exact lt_of_lt_of_le (by positivity) hm | |
| lemma criticalMass_log_bounds {d n β : β} (F : Measure (Sphere d)) [IsProbabilityMeasure F] | |
| (D : β) (hD : 0 < D) (hF : LocalGrowth F n D) (hβ : β < n) (s : Sphere d) : | |
| -(β:β)*Real.log 2 β€ Real.log (criticalMass F β s) β§ | |
| Real.log (criticalMass F β s) β€ Real.log D + (n-β:β)*Real.log 2 := by | |
| have hp := criticalMass_pos F D hD.le hF hβ s | |
| constructor | |
| Β· have hm := criticalIndex_max F D hD.le hF hβ s 0 | |
| rw [ballRatio_zero] at hm | |
| have h := Real.log_le_log (by positivity : (0:β)<(2:β)β»ΒΉ^β) hm | |
| simpa only [Real.log_pow,Real.log_inv,mul_neg,neg_mul] using h | |
| Β· have hg := ballRatio_le_growth F D hD.le hF hβ.le s (criticalIndex F β s) | |
| have hb : criticalMass F β s β€ D * 2^(n-β) := hg.trans | |
| (mul_le_mul_of_nonneg_left (pow_le_pow_leftβ (criticalRadius_pos _).le (criticalRadius_le_two _) _) hD.le) | |
| simpa only [Real.log_mul hD.ne' (by positivity : (2:β)^(n-β) β 0),Real.log_pow] using Real.log_le_log hp hb | |
| lemma criticalLevel_bounds {d n β : β} (F : Measure (Sphere d)) [IsProbabilityMeasure F] | |
| (D : β) (hD : 1 β€ D) (hF : LocalGrowth F n D) (hβ : β < n) (s : Sphere d) : | |
| -(β:β) β€ (criticalLevel F β s : β) β§ | |
| (criticalLevel F β s : β) β€ Real.log D + n + 1 := by | |
| obtain β¨hlo,hupβ© := criticalMass_log_bounds F D (lt_of_lt_of_le zero_lt_one hD) hF hβ s | |
| have hc := Int.le_ceil (Real.log (criticalMass F β s)) | |
| have hc' := Int.ceil_lt_add_one (Real.log (criticalMass F β s)) | |
| have hl2 : Real.log 2 β€ 1 := by linarith [Real.log_two_lt_d9] | |
| have hn : ((n-β:β):β) β€ n := by exact_mod_cast Nat.sub_le n β | |
| change -(β:β) β€ (βReal.log (criticalMass F β s)β:β) β§ _ | |
| constructor | |
| Β· nlinarith [Nat.cast_nonneg (Ξ±:=β) β] | |
| Β· change (βReal.log (criticalMass F β s)β:β) β€ _ | |
| nlinarith [Nat.cast_nonneg (Ξ±:=β) (n-β)] | |
| lemma criticalIndex_bound {d n β : β} (F : Measure (Sphere d)) [IsProbabilityMeasure F] | |
| (D : β) (hD : 1 β€ D) (hF : LocalGrowth F n D) (hβ : β < n) (s : Sphere d) : | |
| (criticalIndex F β s : β) β€ n + 1 + 2 * Real.log D := by | |
| have hp := criticalMass_pos F D (by linarith) hF hβ s | |
| have hlo := (criticalMass_log_bounds F D (by linarith) hF hβ s).1 | |
| have hg := ballRatio_le_growth F D (by linarith) hF hβ.le s (criticalIndex F β s) | |
| have hu := Real.log_le_log hp hg | |
| have hd0 : D β 0 := by linarith | |
| have hj := criticalRadius_pos (criticalIndex F β s) | |
| rw [Real.log_mul hd0 (pow_ne_zero _ hj.ne'),Real.log_pow] at hu | |
| have hr : Real.log (criticalRadius (criticalIndex F β s)) = | |
| (1-(criticalIndex F β s:β))*Real.log 2 := by | |
| rw [criticalRadius,Real.log_mul (by norm_num) (by positivity),Real.log_pow] | |
| simp only [one_div, Real.log_inv] | |
| ring | |
| rw [hr] at hu | |
| have hj0 : 0 β€ (criticalIndex F β s:β) := Nat.cast_nonneg _ | |
| have hn1 : (1:β) β€ (n-β:β) := by exact_mod_cast (Nat.sub_pos_of_lt hβ) | |
| have hn : ((n-β:β):β) = n - β := by exact_mod_cast (Nat.cast_sub hβ.le : ((n-β:β):β) = n-β) | |
| have hl2lo : (1/2:β) β€ Real.log 2 := by linarith [Real.log_two_gt_d9] | |
| have hl2hi : Real.log 2 β€ 1 := by linarith [Real.log_two_lt_d9] | |
| have hlD := Real.log_nonneg hD | |
| have hh : (criticalIndex F β s:β) * ((n-β:β):β) * Real.log 2 β€ Real.log D + n*Real.log 2 := by | |
| nlinarith | |
| have ha : (criticalIndex F β s:β) * Real.log 2 β€ | |
| (criticalIndex F β s:β) * ((n-β:β):β) * Real.log 2 := by | |
| exact mul_le_mul_of_nonneg_right (by nlinarith) (by linarith) | |
| by_cases hjn : (criticalIndex F β s:β) β€ n | |
| Β· linarith | |
| Β· have ht := mul_nonneg (show 0 β€ (criticalIndex F β s:β)-n by linarith) | |
| (show 0 β€ Real.log 2-1/2 by linarith) | |
| nlinarith | |
| def criticalClass {d : β} (F : Measure (Sphere d)) (β j : β) (q : β€) : Set (Sphere d) := | |
| {s | criticalIndex F β s = j β§ criticalLevel F β s = q} | |
| lemma measurableSet_criticalClass {d : β} (F : Measure (Sphere d)) [SFinite F] | |
| (β j : β) (q : β€) : MeasurableSet (criticalClass F β j q) := | |
| (measurableSet_eq_fun (measurable_criticalIndex F β) measurable_const).inter | |
| (measurableSet_eq_fun (measurable_criticalLevel F β) measurable_const) | |
| lemma criticalClass_mass_upper {d n β j : β} (F : Measure (Sphere d)) [IsProbabilityMeasure F] | |
| (D : β) (hD : 0 β€ D) (hF : LocalGrowth F n D) (hβ : β < n) | |
| {q : β€} {s : Sphere d} (hs : s β criticalClass F β j q) (i : β) : | |
| F {x | dist (x:Vector d) (s:Vector d) β€ criticalRadius i} β€ | |
| ENNReal.ofReal (Real.exp q * criticalRadius i^β) := by | |
| have hp := criticalMass_pos F D hD hF hβ s | |
| have hq : Real.log (criticalMass F β s) β€ q := by | |
| have hh := Int.le_ceil (Real.log (criticalMass F β s)) | |
| change Real.log (criticalMass F β s) β€ (criticalLevel F β s:β) at hh | |
| rwa [hs.2] at hh | |
| have hb := (criticalIndex_max F D hD hF hβ s i).trans ((Real.log_le_iff_le_exp hp).mp hq) | |
| have hb' := (div_le_iffβ (pow_pos (criticalRadius_pos i) β)).mp hb | |
| rw [β ENNReal.ofReal_toReal (measure_ne_top F _)] | |
| exact ENNReal.ofReal_le_ofReal hb' | |
| lemma criticalClass_mass_lower {d n β j : β} (F : Measure (Sphere d)) [IsProbabilityMeasure F] | |
| (D : β) (hD : 0 β€ D) (hF : LocalGrowth F n D) (hβ : β < n) | |
| {q : β€} {s : Sphere d} (hs : s β criticalClass F β j q) : | |
| ENNReal.ofReal (Real.exp ((q:β)-1) * criticalRadius j^β) β€ | |
| F {x | dist (x:Vector d) (s:Vector d) β€ criticalRadius j} := by | |
| have hp := criticalMass_pos F D hD hF hβ s | |
| have hq : (q:β)-1 β€ Real.log (criticalMass F β s) := by | |
| have hh := Int.ceil_lt_add_one (Real.log (criticalMass F β s)) | |
| change (criticalLevel F β s:β) < _ at hh | |
| rw [hs.2] at hh | |
| linarith | |
| have hb := (Real.le_log_iff_exp_le hp).mp hq | |
| unfold criticalMass at hb | |
| rw [hs.1] at hb | |
| have hb' := (le_div_iffβ (pow_pos (criticalRadius_pos j) β)).mp hb | |
| rw [β ENNReal.ofReal_toReal (measure_ne_top F _)] | |
| exact ENNReal.ofReal_le_ofReal hb' | |
| lemma exists_criticalRadius {t : β} (ht : 0 < t) (ht1 : t β€ 1) : | |
| β j, 2*t β€ criticalRadius j β§ criticalRadius j β€ 4*t := by | |
| obtain β¨j,hlo,hhiβ© := exists_nat_pow_near_of_lt_one ht ht1 | |
| (by norm_num : (0:β) < 1/2) (by norm_num : (1/2:β) < 1) | |
| refine β¨j,?_,?_β© | |
| Β· unfold criticalRadius | |
| linarith | |
| Β· rw [pow_succ] at hlo | |
| unfold criticalRadius | |
| linarith | |
| lemma criticalClass_restrict_growth {d n β j : β} (F : Measure (Sphere d)) [IsProbabilityMeasure F] | |
| (D : β) (hD : 0 β€ D) (hF : LocalGrowth F n D) (hβ : β < n) (q : β€) : | |
| LocalGrowth (F.restrict (criticalClass F β j q)) β ((4:β)^β * Real.exp q) := by | |
| intro z t ht | |
| let A := criticalClass F β j q | |
| let b := {x : Sphere d | dist (x:Vector d) z β€ t} | |
| have hB : MeasurableSet b := measurableSet_le (by fun_prop) measurable_const | |
| by_cases hzero : (F.restrict A) b = 0 | |
| Β· change (F.restrict A) b β€ _ | |
| simp [hzero] | |
| have hm : F (b β© A) β 0 := by rwa [Measure.restrict_apply hB] at hzero | |
| obtain β¨s,hsb,hsAβ© := nonempty_of_measure_ne_zero hm | |
| obtain β¨i,hiB,hiRβ© : β i, b β {x | dist (x:Vector d) (s:Vector d) β€ criticalRadius i} β§ criticalRadius i β€ 4*t := by | |
| by_cases ht1 : t β€ 1 | |
| Β· obtain β¨i,hlo,hhiβ© := exists_criticalRadius ht ht1 | |
| refine β¨i,?_,hhiβ© | |
| intro x hx | |
| calc | |
| dist (x:Vector d) s β€ dist (x:Vector d) z + dist z (s:Vector d) := dist_triangle _ _ _ | |
| _ β€ t+t := add_le_add hx (by simpa only [b, Set.mem_ofPred_eq, dist_comm] using hsb) | |
| _ β€ criticalRadius i := by linarith | |
| Β· refine β¨0,fun x _ => ?_,?_β© | |
| Β· simpa [criticalRadius] using sphere_dist_le_two x s | |
| Β· simp only [criticalRadius,pow_zero,mul_one] | |
| linarith | |
| calc | |
| (F.restrict A) b β€ F b := (Measure.restrict_le_self : F.restrict A β€ F) b | |
| _ β€ F {x | dist (x:Vector d) (s:Vector d) β€ criticalRadius i} := measure_mono hiB | |
| _ β€ ENNReal.ofReal (Real.exp q * criticalRadius i^β) := | |
| criticalClass_mass_upper F D hD hF hβ hsA i | |
| _ β€ ENNReal.ofReal (((4:β)^β * Real.exp q) * t^β) := by | |
| apply ENNReal.ofReal_le_ofReal | |
| calc | |
| _ β€ Real.exp q * (4*t)^β := mul_le_mul_of_nonneg_left | |
| (pow_le_pow_leftβ (criticalRadius_pos i).le hiR β) (Real.exp_pos _).le | |
| _ = _ := by rw [mul_pow]; ring | |
| def criticalPosterior {d : β} (F : Measure (Sphere d)) (β j : β) (q : β€) : Measure (Sphere d) := | |
| (F (criticalClass F β j q))β»ΒΉ β’ F.restrict (criticalClass F β j q) | |
| lemma criticalPosterior_growth {d n β j : β} (F : Measure (Sphere d)) [IsProbabilityMeasure F] | |
| (D : β) (hD : 0 β€ D) (hF : LocalGrowth F n D) (hβ : β < n) (q : β€) | |
| (hΞ· : 0 < F (criticalClass F β j q)) : | |
| LocalGrowth (criticalPosterior F β j q) β | |
| ((4:β)^β * Real.exp q / (F (criticalClass F β j q)).toReal) := by | |
| have hΞ·t := measure_ne_top F (criticalClass F β j q) | |
| have hΞ·r : 0 < (F (criticalClass F β j q)).toReal := ENNReal.toReal_pos hΞ·.ne' hΞ·t | |
| intro z t ht | |
| change (F (criticalClass F β j q))β»ΒΉ * (F.restrict (criticalClass F β j q)) _ β€ _ | |
| apply (mul_le_mul' le_rfl (criticalClass_restrict_growth F D hD hF hβ q z t ht)).trans_eq | |
| have hei : (F (criticalClass F β j q))β»ΒΉ = | |
| ENNReal.ofReal (((F (criticalClass F β j q)).toReal)β»ΒΉ) := by | |
| rw [ENNReal.ofReal_inv_of_pos hΞ·r, ENNReal.ofReal_toReal hΞ·t] | |
| rw [hei, β ENNReal.ofReal_mul (inv_nonneg.mpr hΞ·r.le)] | |
| congr 1 | |
| ring | |
| lemma criticalClass_packing {d n β j : β} (F : Measure (Sphere d)) [IsProbabilityMeasure F] | |
| (D : β) (hD : 0 β€ D) (hF : LocalGrowth F n D) (hβ : β < n) (q : β€) | |
| (s : Finset (Sphere d)) (hs : β x β s, x β criticalClass F β j q) | |
| (hsep : β x β s, β y β s, x β y β 2 * criticalRadius j < dist x y) : | |
| (s.card:β) β€ Real.exp (1-(q:β)) / criticalRadius j^β := by | |
| let a := Real.exp ((q:β)-1) * criticalRadius j^β | |
| have ha : 0 < a := mul_pos (Real.exp_pos _) (pow_pos (criticalRadius_pos j) _) | |
| let b := fun x : Sphere d => {y : Sphere d | dist (y:Vector d) (x:Vector d) β€ criticalRadius j} | |
| have hm (x : Sphere d) : MeasurableSet (b x) := measurableSet_le (by fun_prop) measurable_const | |
| have hd : (s:Set (Sphere d)).PairwiseDisjoint b := by | |
| intro x hx y hy hxy | |
| apply Set.disjoint_left.mpr | |
| intro z hzx hzy | |
| have hz : dist x y β€ 2*criticalRadius j := by | |
| change dist (x:Vector d) (y:Vector d) β€ 2*criticalRadius j | |
| calc | |
| _ β€ dist (x:Vector d) (z:Vector d) + dist (z:Vector d) (y:Vector d) := dist_triangle _ _ _ | |
| _ β€ criticalRadius j + criticalRadius j := add_le_add | |
| (by simpa only [b, Set.mem_ofPred_eq, dist_comm] using hzx) hzy | |
| _ = _ := by ring | |
| exact (hsep x hx y hy hxy).not_ge hz | |
| have hb : (s.card:ββ₯0β) * ENNReal.ofReal a β€ 1 := by | |
| calc | |
| _ = β x β s, ENNReal.ofReal a := by simp | |
| _ β€ β x β s, F (b x) := Finset.sum_le_sum (fun x hx => criticalClass_mass_lower F D hD hF hβ (hs x hx)) | |
| _ = F (β x β s, b x) := (measure_biUnion_finset hd (fun x _ => hm x)).symm | |
| _ β€ F Set.univ := measure_mono (Set.subset_univ _) | |
| _ = 1 := measure_univ | |
| have hr : (s.card:β)*a β€ 1 := by | |
| have hb' : ((s.card:ββ₯0β) * ENNReal.ofReal a).toReal β€ 1 := | |
| ENNReal.toReal_le_of_le_ofReal (by norm_num : (0:β) β€ 1) (by simpa using hb) | |
| simpa only [ENNReal.toReal_mul,ENNReal.toReal_natCast,ENNReal.toReal_ofReal ha.le] using hb' | |
| have he : 1/a = Real.exp (1-(q:β)) / criticalRadius j^β := by | |
| dsimp only [a] | |
| rw [show (1-(q:β)) = -((q:β)-1) by ring, Real.exp_neg] | |
| field_simp [ne_of_gt (Real.exp_pos ((q:β)-1)),ne_of_gt (pow_pos (criticalRadius_pos j) β)] | |
| exact ((le_div_iffβ ha).mpr hr).trans_eq he | |
| lemma criticalClass_cover {d n β j : β} (F : Measure (Sphere d)) [IsProbabilityMeasure F] | |
| (D : β) (hD : 0 β€ D) (hF : LocalGrowth F n D) (hβ : β < n) (q : β€) : | |
| β s : Finset (Sphere d), (β x β s, x β criticalClass F β j q) β§ | |
| (s.card:β) β€ Real.exp (1-(q:β)) / criticalRadius j^β β§ | |
| β x β criticalClass F β j q, β y β s, dist x y β€ 2*criticalRadius j := by | |
| let N := βReal.exp (1-(q:β)) / criticalRadius j^βββ | |
| obtain β¨s,hs,hsep,hcovβ© := exists_net_of_finite_packing_bound (criticalClass F β j q) | |
| (mul_nonneg (by norm_num) (criticalRadius_pos j).le) N | |
| (fun s hs hsep => Nat.le_floor (criticalClass_packing F D hD hF hβ q s hs hsep)) | |
| exact β¨s,hs,criticalClass_packing F D hD hF hβ q s hs hsep,hcovβ© | |
| end CurrentProjection | |
| end | |
| end OAI | |