Download data/lean/OAI/Probability/FreeIsing/Estimates/BoundedAverageConcentration.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.66 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/FreeIsing/Estimates/BoundedAverageConcentration.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/FreeIsing/Estimates/BoundedAverageConcentration.lean
-
curl -L -o BoundedAverageConcentration.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/FreeIsing/Estimates/BoundedAverageConcentration.lean
6.66 kB
| import Mathlib | |
| namespace OAI | |
| noncomputable section | |
| open MeasureTheory ProbabilityTheory | |
| open scoped NNReal | |
| namespace Problem367 | |
| namespace BoundedAverageConcentration | |
| variable {Ξ© ΞΉ : Type*} [MeasurableSpace Ξ©] | |
| variable {ΞΌ : Measure Ξ©} [IsProbabilityMeasure ΞΌ] | |
| theorem measureReal_average_ge_le | |
| {X : ΞΉ β Ξ© β β} (h_indep : iIndepFun X ΞΌ) | |
| (s : Finset ΞΉ) (hs : s.Nonempty) {Ο : β} (hΟ : 0 β€ Ο) | |
| (h_meas : β i β s, AEMeasurable (X i) ΞΌ) | |
| (h_bdd : β i β s, βα΅ Ο βΞΌ, X i Ο β Set.Icc (0 : β) 1) | |
| (h_mean : β i β s, (β« Ο, X i Ο βΞΌ) β€ Ο / 2) : | |
| ΞΌ.real {Ο | Ο β€ (β i β s, X i Ο) / (s.card : β)} β€ | |
| Real.exp (-(s.card : β) * Ο ^ 2 / 2) := by | |
| classical | |
| have hcard : (0 : β) < s.card := by exact_mod_cast hs.card_pos | |
| have hcenter : iIndepFun (fun i Ο => X i Ο - β« x, X i x βΞΌ) ΞΌ := by | |
| exact h_indep.comp (fun i x => x - β« Ο, X i Ο βΞΌ) | |
| (fun _ => measurable_id.sub_const _) | |
| have hsub : β i β s, | |
| HasSubgaussianMGF (fun Ο => X i Ο - β« x, X i x βΞΌ) (1 / 4 : ββ₯0) ΞΌ := by | |
| intro i hi | |
| convert hasSubgaussianMGF_of_mem_Icc (h_meas i hi) (h_bdd i hi) using 1 | |
| norm_num | |
| have hsum_mean : (β i β s, β« x, X i x βΞΌ) β€ (s.card : β) * Ο / 2 := by | |
| calc | |
| (β i β s, β« x, X i x βΞΌ) β€ β _i β s, Ο / 2 := | |
| Finset.sum_le_sum h_mean | |
| _ = (s.card : β) * Ο / 2 := by simp [mul_div_assoc] | |
| have hsubset : {Ο | Ο β€ (β i β s, X i Ο) / (s.card : β)} β | |
| {Ο | (s.card : β) * Ο / 2 β€ β i β s, (X i Ο - β« x, X i x βΞΌ)} := by | |
| intro Ο hΟ | |
| have hw : Ο * (s.card : β) β€ β i β s, X i Ο := | |
| (le_div_iffβ hcard).mp hΟ | |
| simp only [Set.mem_ofPred_eq, Finset.sum_sub_distrib] | |
| nlinarith | |
| have hhoeff := HasSubgaussianMGF.measure_sum_ge_le_of_iIndepFun hcenter hsub | |
| (show 0 β€ (s.card : β) * Ο / 2 by positivity) | |
| have hexp : | |
| -((s.card : β) * Ο / 2) ^ 2 / | |
| (2 * ((β _i β s, (1 / 4 : ββ₯0) : ββ₯0) : β)) = | |
| -(s.card : β) * Ο ^ 2 / 2 := by | |
| simp only [Finset.sum_const, nsmul_eq_mul] | |
| push_cast | |
| field_simp [ne_of_gt hcard] | |
| ring | |
| exact (measureReal_mono hsubset).trans (hexp βΈ hhoeff) | |
| theorem measure_average_ge_le | |
| {X : ΞΉ β Ξ© β β} (h_indep : iIndepFun X ΞΌ) | |
| (s : Finset ΞΉ) (hs : s.Nonempty) {Ο : β} (hΟ : 0 β€ Ο) | |
| (h_meas : β i β s, AEMeasurable (X i) ΞΌ) | |
| (h_bdd : β i β s, βα΅ Ο βΞΌ, X i Ο β Set.Icc (0 : β) 1) | |
| (h_mean : β i β s, (β« Ο, X i Ο βΞΌ) β€ Ο / 2) : | |
| ΞΌ {Ο | Ο β€ (β i β s, X i Ο) / (s.card : β)} β€ | |
| ENNReal.ofReal (Real.exp (-(s.card : β) * Ο ^ 2 / 2)) := by | |
| rw [β ofReal_measureReal] | |
| exact ENNReal.ofReal_le_ofReal | |
| (measureReal_average_ge_le h_indep s hs hΟ h_meas h_bdd h_mean) | |
| theorem exponential_card_bound | |
| {N b β q : β} (hb : 0 < b) (hβ : 0 β€ β) | |
| (hq : q β€ Real.log b / 8) | |
| (hN : b ^ (β / 2 - 1) β€ N) : | |
| Real.exp (-N * (Real.exp (-q * β)) ^ 2 / 2) β€ | |
| Real.exp (-(b ^ (β / 4)) / (2 * b)) := by | |
| have hpow : 0 < b ^ (β / 2 - 1) := Real.rpow_pos_of_pos hb _ | |
| have hexp : Real.exp (-(Real.log b) * β / 4) β€ (Real.exp (-q * β)) ^ 2 := by | |
| rw [β Real.exp_nat_mul] | |
| apply Real.exp_le_exp.mpr | |
| nlinarith [mul_le_mul_of_nonneg_right hq hβ] | |
| have hprod : b ^ (β / 4) / b β€ N * (Real.exp (-q * β)) ^ 2 := by | |
| calc | |
| b ^ (β / 4) / b = | |
| b ^ (β / 2 - 1) * Real.exp (-(Real.log b) * β / 4) := by | |
| rw [Real.rpow_def_of_pos hb, Real.rpow_def_of_pos hb, | |
| β Real.exp_log hb, β Real.exp_sub, β Real.exp_add] | |
| simp only [Real.log_exp] | |
| congr 1 | |
| ring | |
| _ β€ N * (Real.exp (-q * β)) ^ 2 := | |
| mul_le_mul hN hexp (Real.exp_pos _).le (hpow.le.trans hN) | |
| apply Real.exp_le_exp.mpr | |
| have := div_le_div_of_nonneg_right hprod (show (0 : β) β€ 2 by norm_num) | |
| simpa [div_div, neg_div, mul_comm] using neg_le_neg this | |
| theorem measureReal_average_ge_le_double_exp | |
| {X : ΞΉ β Ξ© β β} (h_indep : iIndepFun X ΞΌ) | |
| (s : Finset ΞΉ) (hs : s.Nonempty) {b β q : β} | |
| (hb : 0 < b) (hβ : 0 β€ β) (hq : q β€ Real.log b / 8) | |
| (hcard : b ^ (β / 2 - 1) β€ (s.card : β)) | |
| (h_meas : β i β s, AEMeasurable (X i) ΞΌ) | |
| (h_bdd : β i β s, βα΅ Ο βΞΌ, X i Ο β Set.Icc (0 : β) 1) | |
| (h_mean : β i β s, (β« Ο, X i Ο βΞΌ) β€ Real.exp (-q * β) / 2) : | |
| ΞΌ.real {Ο | Real.exp (-q * β) β€ (β i β s, X i Ο) / (s.card : β)} β€ | |
| Real.exp (-(b ^ (β / 4)) / (2 * b)) := by | |
| exact (measureReal_average_ge_le h_indep s hs (Real.exp_pos _).le | |
| h_meas h_bdd h_mean).trans (exponential_card_bound hb hβ hq hcard) | |
| theorem measure_average_ge_le_of_kernel | |
| {Y : Type*} [MeasurableSpace Y] (Ξ½ : Measure Y) [IsProbabilityMeasure Ξ½] | |
| (ΞΊ : Kernel Y Ξ©) [IsMarkovKernel ΞΊ] | |
| {X : ΞΉ β Ξ© β β} (s : Finset ΞΉ) (hs : s.Nonempty) | |
| {Ο : β} (hΟ : 0 β€ Ο) | |
| (h_meas : β i β s, Measurable (X i)) | |
| (h_indep : βα΅ y βΞ½, iIndepFun X (ΞΊ y)) | |
| (h_bdd : βα΅ y βΞ½, β i β s, βα΅ Ο βΞΊ y, X i Ο β Set.Icc (0 : β) 1) | |
| (h_mean : βα΅ y βΞ½, β i β s, (β« Ο, X i Ο βΞΊ y) β€ Ο / 2) : | |
| (ΞΊ ββ Ξ½) {Ο | Ο β€ (β i β s, X i Ο) / (s.card : β)} β€ | |
| ENNReal.ofReal (Real.exp (-(s.card : β) * Ο ^ 2 / 2)) := by | |
| have hsum : Measurable (fun Ο => β i β s, X i Ο) := | |
| Finset.measurable_fun_sum s h_meas | |
| rw [Measure.bind_apply (measurableSet_le measurable_const (hsum.div_const _)) | |
| ΞΊ.aemeasurable] | |
| calc | |
| (β«β» y, ΞΊ y {Ο | Ο β€ (β i β s, X i Ο) / (s.card : β)} βΞ½) β€ | |
| β«β» _y, ENNReal.ofReal (Real.exp (-(s.card : β) * Ο ^ 2 / 2)) βΞ½ := by | |
| apply lintegral_mono_ae | |
| filter_upwards [h_indep, h_bdd, h_mean] with y hy_indep hy_bdd hy_mean | |
| exact measure_average_ge_le hy_indep s hs hΟ | |
| (fun i hi => (h_meas i hi).aemeasurable) hy_bdd hy_mean | |
| _ = ENNReal.ofReal (Real.exp (-(s.card : β) * Ο ^ 2 / 2)) := by simp | |
| theorem attenuation_le_half_threshold | |
| {c Ξ· x : β} (hx : 0 β€ x) (hΞ· : Ξ· β€ c / 4) | |
| (hlength : 4 * Real.log 2 β€ c * x) : | |
| Real.exp (-c * x / 2) β€ Real.exp (-Ξ· * x) / 2 := by | |
| apply (le_div_iffβ (show (0 : β) < 2 by norm_num)).mpr | |
| conv_lhs => rhs; rw [β Real.exp_log (show (0 : β) < 2 by norm_num)] | |
| rw [β Real.exp_add] | |
| apply Real.exp_le_exp.mpr | |
| nlinarith [mul_le_mul_of_nonneg_right hΞ· hx] | |
| end BoundedAverageConcentration | |
| end Problem367 | |
| end | |
| end OAI | |