File size: 2,190 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | 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
|