Download data/lean/OAI/Probability/CriticalPercolation/Gluing/FreshTrial.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 5.59 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CriticalPercolation/Gluing/FreshTrial.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/CriticalPercolation/Gluing/FreshTrial.lean
-
curl -L -o FreshTrial.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CriticalPercolation/Gluing/FreshTrial.lean
5.59 kB
| import Mathlib | |
| import OAI.Probability.CriticalPercolation.ProductMeasure.ProductConditioning | |
| namespace OAI | |
| section | |
| section | |
| noncomputable section | |
| open Set MeasureTheory ProbabilityTheory | |
| open scoped Classical ENNReal | |
| namespace CriticalPercolation.BernoulliProduct | |
| variable {E : Type*} | |
| def allOpen (F : Set E) : Set (Set E) := {Ο | FβΟ} | |
| lemma measurable_allOpen_block [Countable E] (F : Set E) : | |
| MeasurableSet[blockSigma F] (allOpen F) := by | |
| have he : allOpen F=β e : F, {Ο : Set E | (e:E)βΟ} := by | |
| ext Ο | |
| simp only [allOpen,Set.mem_ofPred_eq,Set.mem_iInter] | |
| exact β¨fun h e => h e.property,fun h e he => h β¨e,heβ©β© | |
| rw [he] | |
| apply MeasurableSet.iInter | |
| intro e | |
| have hm : MeasurableSet[coordinateSigma (e:E)] {Ο : Set E | (e:E)βΟ} := | |
| β¨{True},MeasurableSet.singleton _,by ext Ο; simpβ© | |
| exact (le_iSup_of_le (e:E) (le_iSup_of_le e.property le_rfl) : | |
| coordinateSigma (e:E)β€blockSigma F) _ hm | |
| lemma allOpen_inter_lower_le [Countable E] (q : E β unitInterval) (F : Set E) | |
| (B : Set (Set E)) (hB : MeasurableSet B) (hBl : IsLowerSet B) : | |
| (law q).real (allOpen Fβ©B)β€(law q).real (allOpen F)*(law q).real B := by | |
| let C := forceOn F Set.univ β»ΒΉ' B | |
| have hmC : MeasurableSet[blockSigma FαΆ] C := hB.preimage (measurable_forceOn_block F _) | |
| have hi := ((independent_blocks q F).indepSet_of_measurableSet | |
| (measurable_allOpen_block F) hmC).measure_inter_eq_mul | |
| have he : allOpen Fβ©B=allOpen Fβ©C := by | |
| ext Ο | |
| by_cases hΟ : FβΟ | |
| Β· have hf : forceOn F Set.univ Ο=Ο := by | |
| ext e | |
| by_cases he : eβF | |
| Β· simp only [mem_forceOn,ite_eq_left he,Set.mem_univ,true_iff] | |
| exact hΟ he | |
| Β· simp only [mem_forceOn,ite_eq_right he] | |
| simp only [Set.mem_inter_iff,allOpen,Set.mem_ofPred_eq,hΟ,true_and,C,Set.mem_preimage,hf] | |
| Β· simp only [Set.mem_inter_iff,allOpen,Set.mem_ofPred_eq,hΟ,false_and] | |
| have hsub : CβB := by | |
| intro Ο hΟ | |
| apply hBl _ hΟ | |
| intro e he | |
| by_cases heF : eβF <;> simp [heF,he] | |
| have hr : (law q).real (allOpen Fβ©B)=(law q).real (allOpen F)*(law q).real C := by | |
| simp only [measureReal_def,he,hi,ENNReal.toReal_mul] | |
| rw [hr] | |
| exact mul_le_mul_of_nonneg_left (measureReal_mono hsub) measureReal_nonneg | |
| lemma integrable_blockProbability_real (q : E β unitInterval) (S : Set E) | |
| (A : Set (Set E)) (hA : MeasurableSet A) : | |
| Integrable (fun Ο => (blockProbability q S A Ο).toReal) (law q) := by | |
| have hm := (measurable_blockProbability q S A hA).mono (blockSigma_le S) le_rfl | |
| apply (integrable_const (1:β)).mono' hm.ennreal_toReal.aestronglyMeasurable | |
| filter_upwards [] with Ο | |
| rw [Real.norm_eq_abs,abs_of_nonneg ENNReal.toReal_nonneg] | |
| exact ENNReal.toReal_mono (by simp) (blockProbability_le_one q S A Ο) | |
| lemma integral_blockProbability_real (q : E β unitInterval) (S : Set E) | |
| (A : Set (Set E)) (hA : MeasurableSet A) : | |
| (β« Ο, (blockProbability q S A Ο).toReal βlaw q)=(law q).real A := by | |
| have hm := (measurable_blockProbability q S A hA).mono (blockSigma_le S) le_rfl | |
| rw [integral_toReal hm.aemeasurable (ae_of_all _ (fun Ο => | |
| (blockProbability_le_one q S A Ο).trans_lt ENNReal.one_lt_top)), | |
| lintegral_blockProbability q S A hA] | |
| rfl | |
| theorem good_trial_bound [Countable E] (q : E β unitInterval) (S F : Set E) | |
| (A : Set (Set E)) (hA : MeasurableSet A) (hAu : IsUpperSet A) | |
| (Ξ· lam : β) (hlam : 0<lam) (hmean : 1-Ξ·β€(law q).real A) : | |
| (law q).real (allOpen Fβ©{Ο | (blockProbability q S A Ο).toReal<1-lam})β€ | |
| (law q).real (allOpen F)*Ξ·/lam := by | |
| let g : Set E β β := fun Ο => (blockProbability q S A Ο).toReal | |
| let B : Set (Set E) := {Ο | g Ο<1-lam} | |
| have hg : Measurable g := | |
| ((measurable_blockProbability q S A hA).mono (blockSigma_le S) le_rfl).ennreal_toReal | |
| have hgi : Integrable g (law q) := integrable_blockProbability_real q S A hA | |
| have hg1 : β Ο, g Οβ€1 := fun Ο => | |
| ENNReal.toReal_mono (by simp) (blockProbability_le_one q S A Ο) | |
| have hgm : Monotone g := by | |
| intro Ο Ο h | |
| exact ENNReal.toReal_mono (ne_of_lt ((blockProbability_le_one q S A Ο).trans_lt | |
| ENNReal.one_lt_top)) (blockProbability_monotone q S A hAu h) | |
| have hBm : MeasurableSet B := measurableSet_lt hg measurable_const | |
| have hBl : IsLowerSet B := fun _ _ h hB => (hgm h).trans_lt hB | |
| have hmark : lam*(law q).real Bβ€Ξ· := by | |
| have hcomp : Integrable (fun Ο => lam*B.indicator (1 : Set E β β) Ο) (law q) := | |
| ((integrable_const (1:β)).indicator hBm).const_mul lam | |
| have hd : Integrable (fun Ο => 1-g Ο) (law q) := (integrable_const 1).sub hgi | |
| have hi := integral_mono hcomp hd (fun Ο => by | |
| by_cases hΟ : ΟβB | |
| Β· rw [Set.indicator_of_mem hΟ] | |
| have hh : g Ο<1-lam := hΟ | |
| dsimp only [Pi.one_apply] | |
| linarith | |
| Β· rw [Set.indicator_of_notMem hΟ,mul_zero] | |
| exact sub_nonneg.mpr (hg1 Ο)) | |
| rw [integral_const_mul,integral_indicator_one hBm,integral_sub (integrable_const 1) hgi, | |
| integral_const,probReal_univ,smul_eq_mul,one_mul] at hi | |
| have he := integral_blockProbability_real q S A hA | |
| change (β« Ο, g Ο βlaw q)=(law q).real A at he | |
| rw [he] at hi | |
| linarith | |
| have hh := allOpen_inter_lower_le q F B hBm hBl | |
| have hb : (law q).real Bβ€Ξ·/lam := (le_div_iffβ hlam).mpr (by nlinarith [hmark]) | |
| exact hh.trans (by simpa only [mul_div_assoc] using | |
| mul_le_mul_of_nonneg_left hb (show 0β€(law q).real (allOpen F) from measureReal_nonneg)) | |
| end CriticalPercolation.BernoulliProduct | |
| end | |
| end | |
| end | |
| end OAI | |