Download data/lean/OAI/Probability/CriticalPercolation/ProductMeasure/Prob.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.47 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CriticalPercolation/ProductMeasure/Prob.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/CriticalPercolation/ProductMeasure/Prob.lean
-
curl -L -o Prob.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CriticalPercolation/ProductMeasure/Prob.lean
3.47 kB
| import Mathlib | |
| import OAI.Probability.CriticalPercolation.ProductMeasure.ExpectMulReal | |
| namespace OAI | |
| section | |
| section | |
| open Set MeasureTheory ProbabilityTheory | |
| open Set | |
| open scoped BigOperators | |
| namespace CriticalPercolation.FiniteProduct | |
| open scoped Classical | |
| variable {E : Type*} [Fintype E] | |
| noncomputable def prob (w : E β Prop β β) (P : Set E β Prop) : β := | |
| expect w (fun Ο => if P Ο then 1 else 0) | |
| lemma prob_nonneg (w : E β Prop β β) (hp : β e b, 0 β€ w e b) (P : Set E β Prop) : | |
| 0 β€ prob w P := expect_nonneg hp (fun _ => by split_ifs <;> norm_num) | |
| lemma prob_mono (w : E β Prop β β) (hp : β e b, 0 β€ w e b) | |
| {P Q : Set E β Prop} (h : β Ο, P Ο β Q Ο) : prob w P β€ prob w Q := by | |
| apply expect_mono hp | |
| intro Ο | |
| by_cases hP : P Ο <;> by_cases hQ : Q Ο <;> simp [hP, hQ] | |
| exact (hQ (h Ο hP)).elim | |
| lemma prob_split (w : E β Prop β β) (P Q : Set E β Prop) : | |
| prob w P = prob w (fun Ο => P Ο β§ Q Ο) + prob w (fun Ο => P Ο β§ Β¬Q Ο) := by | |
| unfold prob | |
| rw [β expect_add] | |
| congr 1 | |
| funext Ο | |
| by_cases hp : P Ο <;> by_cases hq : Q Ο <;> simp [hp, hq] | |
| lemma prob_congr (w : E β Prop β β) {P Q : Set E β Prop} | |
| (h : β Ο, P Ο β Q Ο) : prob w P = prob w Q := by | |
| congr 1 | |
| funext Ο | |
| exact propext (h Ο) | |
| lemma indicator_mask (P Q : Prop) : | |
| (if P then (if Q then (1 : β) else 0) else 0) = if P β§ Q then 1 else 0 := by | |
| by_cases hP : P <;> by_cases hQ : Q <;> simp [hP, hQ] | |
| lemma indicator_mask_mul (P Q R : Prop) : | |
| (if P then (if Q then (1 : β) else 0)*(if R then 1 else 0) else 0) = | |
| if P β§ Q β§ R then 1 else 0 := by | |
| by_cases hP : P <;> by_cases hQ : Q <;> by_cases hR : R <;> simp [hP, hQ, hR] | |
| lemma indicator_antitone {X : Type*} [Preorder X] {P : X β Prop} | |
| (h : β β¦x yβ¦, x β€ y β P y β P x) : | |
| Antitone (fun x => if P x then (1 : β) else 0) := by | |
| intro x y hxy | |
| by_cases hx : P x <;> by_cases hy : P y <;> simp [hx, hy] | |
| exact (hx (h hxy hy)).elim | |
| lemma indicator_monotone {X : Type*} [Preorder X] {P : X β Prop} | |
| (h : β β¦x yβ¦, x β€ y β P x β P y) : | |
| Monotone (fun x => if P x then (1 : β) else 0) := by | |
| intro x y hxy | |
| by_cases hx : P x <;> by_cases hy : P y <;> simp [hx, hy] | |
| exact (hy (h hxy hx)).elim | |
| lemma expect_mul_ge_antitone (w : E β Prop β β) (hw : β e, β b, w e b = 1) | |
| (hp : β e b, 0 β€ w e b) (f g : (E β Prop) β β) | |
| (hf : Antitone f) (hg : Antitone g) : | |
| expect w f * expect w g β€ expect w (fun Ο => f Ο*g Ο) := by | |
| have hh := expect_mul_ge_real w hw hp (fun Ο => -f Ο) (fun Ο => -g Ο) hf.neg hg.neg | |
| have hn (f : (E β Prop) β β) : expect w (fun Ο => -f Ο) = -expect w f := by | |
| simp [expect, Finset.sum_neg_distrib] | |
| simpa only [hn, neg_mul_neg] using hh | |
| lemma prob_harris_decreasing (w : E β Prop β β) (hw : β e, β b, w e b = 1) | |
| (hp : β e b, 0 β€ w e b) (P Q : Set E β Prop) | |
| (hP : β β¦Ο Ο'β¦, Ο β€ Ο' β P Ο' β P Ο) | |
| (hQ : β β¦Ο Ο'β¦, Ο β€ Ο' β Q Ο' β Q Ο) : | |
| prob w P * prob w Q β€ prob w (fun Ο => P Ο β§ Q Ο) := by | |
| have hh := expect_mul_ge_antitone w hw hp _ _ (indicator_antitone hP) (indicator_antitone hQ) | |
| change expect w _ * expect w _ β€ _ | |
| refine hh.trans_eq ?_ | |
| apply congrArg (expect w) | |
| funext Ο | |
| by_cases hP : P Ο <;> by_cases hQ : Q Ο <;> simp [hP, hQ] | |
| end CriticalPercolation.FiniteProduct | |
| end | |
| end | |
| end OAI | |