File size: 3,466 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
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