introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
5.33 kB
import Mathlib
import OAI.Probability.CriticalPercolation.ProductMeasure.ProbOr
import OAI.Probability.CriticalPercolation.ProductMeasure.Potential
namespace OAI
section
section
open Set MeasureTheory ProbabilityTheory
open Set
open scoped BigOperators
open scoped Classical
namespace CriticalPercolation.FiniteProduct
variable {E A : Type*} [Fintype E] [Fintype A]
lemma expect_eval_indicator (w : E β†’ A β†’ ℝ) (hw : βˆ€ e, βˆ‘ a, w e a = 1)
(e : E) (b : A) : expect w (fun Ο‰ => if Ο‰ e = b then 1 else 0) = w e b := by
classical
have ht (Ο‰ : E β†’ A) : density w Ο‰ * (if Ο‰ e = b then 1 else 0) =
∏ j, w j (Ο‰ j) * (if j = e then if Ο‰ j = b then 1 else 0 else 1) := by
rw [Finset.prod_mul_distrib]
simp [density]
simp only [expect, ht]
rw [← Fintype.prod_sum (fun j a => w j a * (if j = e then if a = b then 1 else 0 else 1))]
have hs (j : E) : (βˆ‘ a, w j a * (if j = e then if a = b then 1 else 0 else 1)) =
if j = e then w e b else 1 := by
split_ifs with he
Β· subst j; simp
Β· simp [hw]
simp only [hs]
simp
end CriticalPercolation.FiniteProduct
namespace CriticalPercolation.FiniteProduct
open scoped Classical
variable {E A : Type*} [Fintype E] [Fintype A]
lemma expect_coordinate_mask (w : E β†’ A β†’ ℝ) (hw : βˆ€ e, βˆ‘ a, w e a = 1)
(e : E) (b : A) (f : (E β†’ A) β†’ ℝ) :
expect w (fun Ο‰ => if Ο‰ e = b then f Ο‰ else 0) =
w e b * expect w (fun Ο‰ => f (Function.update Ο‰ e b)) := by
have hid : (fun Ο‰ => if Ο‰ e = b then f Ο‰ else 0) =
(fun Ο‰ => (if Ο‰ e = b then (1:ℝ) else 0)*f (Function.update Ο‰ e b)) := by
funext Ο‰
split_ifs with h
Β· have hu : Function.update Ο‰ e b = Ο‰ := by rw [← h]; exact Function.update_eq_self _ _
simp [hu]
Β· simp
rw [hid]
have hI : DependsOn (fun Ο‰ : E β†’ A => if Ο‰ e = b then (1:ℝ) else 0) ({e} : Set E) := by
intro Ο‰ Ο‰' heq
dsimp only
rw [heq e (Set.mem_singleton e)]
have hF : DependsOn (fun Ο‰ => f (Function.update Ο‰ e b)) ({e} : Set E)ᢜ := by
intro Ο‰ Ο‰' heq
change f (Function.update Ο‰ e b) = f (Function.update Ο‰' e b)
congr 1
funext j
by_cases hj : j = e
Β· subst j; simp
Β· simp only [Function.update_of_ne hj]
exact heq j hj
rw [expect_indep w hw _ hI hF]
congr 1
exact expect_eval_indicator w hw e b
end CriticalPercolation.FiniteProduct
namespace CriticalPercolation.FiniteProduct
open scoped Classical
variable {E : Type*} [Fintype E]
lemma expect_pin_eq_force (w : E β†’ Prop β†’ ℝ) (hw : βˆ€ e, βˆ‘ b, w e b = 1)
(e : E) (b : Prop) (hb : w e b β‰  0) (f : (E β†’ Prop) β†’ ℝ) :
expect (pin w e b) f = expect w (fun Ο‰ => f (Function.update Ο‰ e b)) := by
apply mul_left_cancelβ‚€ hb
exact (expect_mask_pin w e b f).symm.trans (expect_coordinate_mask w hw e b f)
lemma expect_pin_transport (w : E β†’ Prop β†’ ℝ) (hw : βˆ€ e, βˆ‘ b, w e b = 1)
(e : E) (a b : Prop) (ha : w e a β‰  0) (hb : w e b β‰  0) (f : (E β†’ Prop) β†’ ℝ) :
expect (pin w e b) f = expect (pin w e a) (fun Ο‰ => f (Function.update Ο‰ e b)) := by
rw [expect_pin_eq_force w hw e b hb,expect_pin_eq_force w hw e a ha]
simp only [Function.update_idem]
lemma prob_congr_support (w : E β†’ Prop β†’ ℝ) (P Q : Set E β†’ Prop)
(h : βˆ€ Ο‰, density w Ο‰ β‰  0 β†’ (P Ο‰ ↔ Q Ο‰)) : prob w P = prob w Q := by
apply expect_congr_support
intro ω hω
rw [h ω hω]
lemma prob_pin_transport (w : E β†’ Prop β†’ ℝ) (hw : βˆ€ e, βˆ‘ b, w e b = 1)
(e : E) (a b : Prop) (ha : w e a β‰  0) (hb : w e b β‰  0) (P : Set E β†’ Prop) :
prob (pin w e b) P = prob (pin w e a) (fun Ο‰ => P (Function.update Ο‰ e b)) := by
exact expect_pin_transport w hw e a b ha hb (fun Ο‰ => if P Ο‰ then 1 else 0)
noncomputable def delta (w : E β†’ Prop β†’ ℝ) (F : Set E β†’ Prop) (e : E) : ℝ :=
prob (pin w e True) F - prob (pin w e False) F
def openPivot (F : Set E β†’ Prop) (e : E) (Ο‰ : Set E) : Prop :=
Ο‰ e ∧ F Ο‰ ∧ Β¬F (Function.update Ο‰ e False)
omit [Fintype E] in
lemma openPivot_force_true (F : Set E β†’ Prop) (e : E) (Ο‰ : Set E) :
openPivot F e (Function.update Ο‰ e True) ↔
F (Function.update Ο‰ e True) ∧ Β¬F (Function.update Ο‰ e False) := by
unfold openPivot
erw [Function.update_self,Function.update_idem]
simp only [true_and]
lemma delta_eq_pivotal (w : E β†’ Prop β†’ ℝ) (hw : βˆ€ e, βˆ‘ b, w e b = 1)
(e : E) (he0 : w e False β‰  0) (he1 : w e True β‰  0)
(F : Set E β†’ Prop) (hF : βˆ€ s t, s βŠ† t β†’ F s β†’ F t) :
delta w F e = prob (pin w e False)
(fun Ο‰ => F (Function.update Ο‰ e True) ∧ Β¬F Ο‰) := by
rw [delta,prob_pin_transport w hw e False True he0 he1]
have hh := prob_diff (pin w e False)
(fun Ο‰ => F (Function.update Ο‰ e True)) F
have he : prob (pin w e False) (fun Ο‰ => F (Function.update Ο‰ e True) ∧ F Ο‰) =
prob (pin w e False) F := by
apply prob_congr
intro Ο‰
constructor
Β· exact And.right
Β· intro h
refine ⟨hF _ _ ?_ h,h⟩
intro j hj
change Function.update (Ο‰ : Set E) e True j
by_cases hje : j = e
Β· subst j; erw [Function.update_self]; trivial
Β· erw [Function.update_of_ne hje]; exact hj
erw [he] at hh
exact hh.symm
end CriticalPercolation.FiniteProduct
end
end
end OAI