Download data/lean/OAI/Probability/CriticalPercolation/ProductMeasure/Delta.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 5.33 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CriticalPercolation/ProductMeasure/Delta.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/CriticalPercolation/ProductMeasure/Delta.lean
-
curl -L -o Delta.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CriticalPercolation/ProductMeasure/Delta.lean
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 | |