Download data/lean/OAI/Probability/CriticalPercolation/ProductMeasure/ExpectClosedFlip.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 2.56 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CriticalPercolation/ProductMeasure/ExpectClosedFlip.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/CriticalPercolation/ProductMeasure/ExpectClosedFlip.lean
-
curl -L -o ExpectClosedFlip.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CriticalPercolation/ProductMeasure/ExpectClosedFlip.lean
2.56 kB
| import Mathlib | |
| import OAI.Probability.CriticalPercolation.ProductMeasure.Delta | |
| namespace OAI | |
| section | |
| section | |
| open Set MeasureTheory ProbabilityTheory | |
| open Set | |
| open scoped BigOperators | |
| open scoped Classical | |
| namespace CriticalPercolation.FiniteProduct | |
| open scoped Classical | |
| variable {E : Type*} [Fintype E] | |
| lemma expect_closed_flip (w : E β Prop β β) (hw : β e, β b, w e b = 1) | |
| (e : E) {p : β} (hp : p β Set.Ioo 0 1) | |
| (h0 : w e False = 1-p) (h1 : w e True = p) (f : Set E β β) : | |
| expect w (fun Ο => if Β¬Ο e then p*f (Function.update Ο e True) else 0) = | |
| expect w (fun Ο => if Ο e then (1-p)*f Ο else 0) := by | |
| have he0 : w e False β 0 := by rw [h0]; linarith [hp.2] | |
| have he1 : w e True β 0 := by rw [h1]; exact hp.1.ne' | |
| have he := expect_pin_transport w hw e False True he0 he1 f | |
| have hc : expect w (fun Ο => if Β¬Ο e then p*f (Function.update Ο e True) else 0) = | |
| w e False * expect (pin w e False) (fun Ο => p*f (Function.update Ο e True)) := by | |
| convert expect_prop_mask_pin w e False (fun Ο => p*f (Function.update Ο e True)) using 1 | |
| congr 1 | |
| funext Ο | |
| by_cases hb : Ο e <;> simp [hb] | |
| have ho : expect w (fun Ο => if Ο e then (1-p)*f Ο else 0) = | |
| w e True * expect (pin w e True) (fun Ο => (1-p)*f Ο) := by | |
| convert expect_prop_mask_pin w e True (fun Ο => (1-p)*f Ο) using 1 | |
| congr 1 | |
| funext Ο | |
| by_cases hb : Ο e <;> simp [hb] | |
| erw [hc,ho,expect_const_mul,expect_const_mul,h0,h1,he] | |
| ring | |
| lemma expect_closed_flip_decidable [d : DecidableEq E] | |
| (w : E β Prop β β) (hw : β e, β b, w e b = 1) | |
| (e : E) {p : β} (hp : p β Set.Ioo 0 1) | |
| (h0 : w e False = 1-p) (h1 : w e True = p) (f : Set E β β) : | |
| expect w (fun Ο => if Β¬Ο e then p*f (Function.update Ο e True) else 0) = | |
| expect w (fun Ο => if Ο e then (1-p)*f Ο else 0) := by | |
| have hup (Ο : Set E) : | |
| @Function.update E (fun _ => Prop) (fun a b => Classical.propDecidable (a=b)) Ο e True = | |
| Function.update Ο e True := by | |
| have hd : (fun a b => Classical.propDecidable (a=b)) = d := Subsingleton.elim _ _ | |
| exact congrArg (fun d' : DecidableEq E => | |
| @Function.update E (fun _ => Prop) d' Ο e True) hd | |
| have h := expect_closed_flip w hw e hp h0 h1 f | |
| convert h using 1 | |
| congr 1 | |
| funext Ο | |
| by_cases hc : Ο e | |
| Β· simp only [hc,not_true_eq_false,ite_false] | |
| Β· simp only [hc,not_false_eq_true,ite_true] | |
| exact congrArg (fun Ο : Set E => p*f Ο) (hup Ο).symm | |
| end CriticalPercolation.FiniteProduct | |
| end | |
| end | |
| end OAI | |