Download data/lean/OAI/Probability/CriticalPercolation/ProductMeasure/Distribution.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 2.19 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CriticalPercolation/ProductMeasure/Distribution.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/CriticalPercolation/ProductMeasure/Distribution.lean
-
curl -L -o Distribution.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CriticalPercolation/ProductMeasure/Distribution.lean
2.19 kB
| import Mathlib | |
| import OAI.Probability.CriticalPercolation.ProductMeasure.Density | |
| namespace OAI | |
| section | |
| section | |
| open Set MeasureTheory ProbabilityTheory | |
| open Set | |
| open scoped BigOperators | |
| namespace CriticalPercolation.FiniteProduct | |
| variable {E A : Type*} [Fintype E] [Fintype A] | |
| lemma expect_zero (w : E β A β β) : expect w (fun _ => 0) = 0 := by | |
| simp [expect] | |
| lemma expect_sum {J : Type*} [Fintype J] (w : E β A β β) | |
| (f : J β (E β A) β β) : | |
| expect w (fun Ο => β j, f j Ο) = β j, expect w (f j) := by | |
| classical | |
| simp only [expect, Finset.mul_sum] | |
| exact Finset.sum_comm | |
| lemma expect_nonneg {w : E β A β β} (hw : β e a, 0 β€ w e a) | |
| {f : (E β A) β β} (hf : β Ο, 0 β€ f Ο) : 0 β€ expect w f := by | |
| rw [β expect_zero w] | |
| exact expect_mono hw hf | |
| noncomputable def distribution {B : Type*} [DecidableEq B] | |
| (w : E β A β β) (Ο : (E β A) β B) (b : B) : β := | |
| expect w (fun Ο => if Ο Ο = b then 1 else 0) | |
| lemma expect_comp {B : Type*} [Fintype B] [DecidableEq B] | |
| (w : E β A β β) (Ο : (E β A) β B) (f : B β β) : | |
| expect w (fun Ο => f (Ο Ο)) = β b, distribution w Ο b * f b := by | |
| classical | |
| simp only [distribution, β expect_mul_const, β expect_sum] | |
| congr 1 | |
| funext Ο | |
| simp | |
| lemma distribution_nonneg {B : Type*} [DecidableEq B] | |
| {w : E β A β β} (hw : β e a, 0 β€ w e a) | |
| (Ο : (E β A) β B) (b : B) : 0 β€ distribution w Ο b := | |
| expect_nonneg hw fun _ => by split_ifs <;> norm_num | |
| lemma distribution_mass {B : Type*} [Fintype B] [DecidableEq B] | |
| (w : E β A β β) (hw : β e, β a, w e a = 1) | |
| (Ο : (E β A) β B) : β b, distribution w Ο b = 1 := by | |
| simpa only [mul_one] using (expect_comp w Ο (fun _ => 1)).symm.trans (expect_const w hw 1) | |
| end CriticalPercolation.FiniteProduct | |
| namespace CriticalPercolation.FiniteProduct | |
| variable {E A : Type*} [Fintype E] [Fintype A] | |
| lemma expect_const_mul (w : E β A β β) (c : β) (f : (E β A) β β) : | |
| expect w (fun Ο => c * f Ο) = c * expect w f := by | |
| simp only [mul_comm c] | |
| exact expect_mul_const w f c | |
| end CriticalPercolation.FiniteProduct | |
| end | |
| end | |
| end OAI | |