introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
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