Download data/lean/OAI/Probability/CriticalPercolation/GraphGeometry/ExpectedResidualAlt.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.21 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CriticalPercolation/GraphGeometry/ExpectedResidualAlt.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/CriticalPercolation/GraphGeometry/ExpectedResidualAlt.lean
-
curl -L -o ExpectedResidualAlt.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CriticalPercolation/GraphGeometry/ExpectedResidualAlt.lean
4.21 kB
| import Mathlib | |
| import OAI.Probability.CriticalPercolation.Clusters.ExpectedCluster | |
| import OAI.Probability.CriticalPercolation.Clusters.ComponentSelf | |
| import OAI.Probability.CriticalPercolation.ProductMeasure.Distribution | |
| namespace OAI | |
| section | |
| section | |
| open Set MeasureTheory ProbabilityTheory | |
| open scoped BigOperators | |
| namespace CriticalPercolation.BondGraph | |
| open CriticalPercolation.FiniteProduct CriticalPercolation.ClusterDeletion | |
| open scoped Classical | |
| variable {V E : Type*} [Fintype V] [Fintype E] (G : BondGraph V E) | |
| lemma expectedResidual_alt (w : E β Prop β β) (hw : β e, β b, w e b = 1) | |
| (S : Set V) (s : V) (F : Set V β β) (U : Set V) : | |
| G.expectedResidual w S s F U = | |
| expect w (fun Ο => if s β roots (delete (G.openGraph Ο) U) S then | |
| G.expectedCluster w s F (roots (delete (G.openGraph Ο) U) S) - | |
| F (component (delete (G.openGraph Ο) U) s) else 0) := by | |
| have h := G.finite_spatialMarkov w hw S U | |
| (fun W H => if s β W then G.expectedCluster w s F W - | |
| F (component (delete H U) s) else 0) | |
| have hdel : β H W, delete (delete H W) U = delete H (W βͺ U) := by | |
| intro H W | |
| rw [delete_delete, Set.union_comm] | |
| simp_rw [hdel] at h | |
| have hleft : (fun Ο : E β Prop => if s β roots (delete (G.openGraph Ο) U) S then | |
| G.expectedCluster w s F (roots (delete (G.openGraph Ο) U) S) - | |
| F (component (delete (G.openGraph Ο) (roots (delete (G.openGraph Ο) U) S βͺ U)) s) | |
| else 0) = | |
| (fun Ο => if s β roots (delete (G.openGraph Ο) U) S then | |
| G.expectedCluster w s F (roots (delete (G.openGraph Ο) U) S) - | |
| F (component (delete (G.openGraph Ο) U) s) else 0) := by | |
| funext Ο | |
| split_ifs with hs | |
| Β· rfl | |
| Β· rw [delete_roots_union_component _ S U s hs] | |
| rw [hleft] at h | |
| erw [h] | |
| unfold expectedResidual | |
| congr 1 | |
| funext Ο | |
| split_ifs | |
| Β· rw [expect_zero] | |
| Β· rw [expect_sub, expect_const w hw] | |
| rfl | |
| lemma later_cluster_residual (w : E β Prop β β) (hw : β e, β b, w e b = 1) | |
| (S : Set V) (s t : V) (F g : Set V β β) (Q : Set V β Prop) | |
| (hQ : β U, Q U β Disjoint U S β§ s β U) : | |
| (expect w (fun Ο => if Q (component (G.openGraph Ο) t) then | |
| if s β roots (G.openGraph Ο) S then | |
| g (component (G.openGraph Ο) t) * | |
| (G.expectedCluster w s F (roots (G.openGraph Ο) S) - | |
| F (component (G.openGraph Ο) s)) else 0 else 0)) = | |
| expect w (fun Ο => if Q (component (G.openGraph Ο) t) then | |
| g (component (G.openGraph Ο) t) * | |
| G.expectedResidual w S s F (component (G.openGraph Ο) t) else 0) := by | |
| have h := G.finite_spatialMarkov w hw {t} β | |
| (fun U H => if Q U then if s β roots H S then | |
| g U * (G.expectedCluster w s F (roots H S) - F (component H s)) else 0 else 0) | |
| simp only [delete_empty, roots_singleton] at h | |
| have hleft : (fun Ο : E β Prop => if Q (component (G.openGraph Ο) t) then | |
| if s β roots (delete (G.openGraph Ο) (component (G.openGraph Ο) t)) S then | |
| g (component (G.openGraph Ο) t) * | |
| (G.expectedCluster w s F (roots (delete (G.openGraph Ο) (component (G.openGraph Ο) t)) S) - | |
| F (component (delete (G.openGraph Ο) (component (G.openGraph Ο) t)) s)) | |
| else 0 else 0) = | |
| (fun Ο => if Q (component (G.openGraph Ο) t) then | |
| if s β roots (G.openGraph Ο) S then | |
| g (component (G.openGraph Ο) t) * | |
| (G.expectedCluster w s F (roots (G.openGraph Ο) S) - F (component (G.openGraph Ο) s)) | |
| else 0 else 0) := by | |
| funext Ο | |
| by_cases hq : Q (component (G.openGraph Ο) t) | |
| Β· simp only [ite_eq_left hq] | |
| obtain β¨hd, hsβ© := hQ _ hq | |
| rw [roots_delete_component _ S t ((not_mem_roots_iff_disjoint _ S t).mpr hd), component_delete_component _ t s hs] | |
| Β· simp only [ite_eq_right hq] | |
| rw [hleft] at h | |
| erw [h] | |
| congr 1 | |
| funext Ο | |
| by_cases hq : Q (component (G.openGraph Ο) t) | |
| Β· simp only [ite_eq_left hq] | |
| rw [G.expectedResidual_alt w hw] | |
| rw [β expect_const_mul] | |
| congr 1 | |
| funext Ο' | |
| split_ifs <;> simp | |
| Β· simp only [ite_eq_right hq, expect_zero] | |
| end CriticalPercolation.BondGraph | |
| end | |
| end | |
| end OAI | |