Download data/lean/OAI/Probability/CriticalPercolation/Clusters/ClusterUpdate.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.57 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CriticalPercolation/Clusters/ClusterUpdate.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/CriticalPercolation/Clusters/ClusterUpdate.lean
-
curl -L -o ClusterUpdate.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CriticalPercolation/Clusters/ClusterUpdate.lean
4.57 kB
| import Mathlib | |
| import OAI.Probability.CriticalPercolation.Clusters.ComponentSelf | |
| import OAI.Probability.CriticalPercolation.Clusters.ExpectedCluster | |
| 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 | |
| variable {V E : Type*} [Fintype V] [Fintype E] (G : BondGraph V E) | |
| open scoped Classical | |
| noncomputable def clusterUpdate (w : E β Prop β β) (S : Set V) (s : V) | |
| (F : Set V β β) (U : Set V) : β := | |
| expect w (fun Ο => G.expectedCluster w s F (roots (delete (G.openGraph Ο) U) S)) | |
| omit [Fintype V] in | |
| lemma expectedCluster_antitone (w : E β Prop β β) (hpos : β e b, 0 β€ w e b) | |
| (s : V) {F : Set V β β} (hF : Monotone F) : | |
| Antitone (G.expectedCluster w s F) := by | |
| intro U U' hU | |
| exact expect_mono hpos fun Ο => hF (component_mono (delete_antitone _ hU) s) | |
| omit [Fintype V] in | |
| lemma clusterUpdate_monotone (w : E β Prop β β) (hpos : β e b, 0 β€ w e b) | |
| (S : Set V) (s : V) {F : Set V β β} (hF : Monotone F) : | |
| Monotone (G.clusterUpdate w S s F) := by | |
| intro U U' hU | |
| exact expect_mono hpos fun Ο => G.expectedCluster_antitone w hpos s hF | |
| (roots_mono (delete_antitone _ hU) S) | |
| omit [Fintype V] in | |
| lemma clusterUpdate_nonneg (w : E β Prop β β) (hpos : β e b, 0 β€ w e b) | |
| (S : Set V) (s : V) {F : Set V β β} (hF : β U, 0 β€ F U) (U : Set V) : | |
| 0 β€ G.clusterUpdate w S s F U := | |
| expect_nonneg hpos fun _ => expect_nonneg hpos fun _ => hF _ | |
| noncomputable def avoidedAverage (w : E β Prop β β) (S : Set V) (s : V) | |
| (F : Set V β β) : β := by | |
| classical | |
| exact expect w (fun Ο => if s β roots (G.openGraph Ο) S then | |
| F (component (G.openGraph Ο) s) else 0) | |
| lemma clusterUpdate_exposure (w : E β Prop β β) (hw : β e, β b, w e b = 1) | |
| (S : Set V) (s : V) (F g : Set V β β) : | |
| (expect w (fun Ο => if s β roots (G.openGraph Ο) S then | |
| g (component (G.openGraph Ο) s) * G.expectedCluster w s F (roots (G.openGraph Ο) S) | |
| else 0)) = | |
| G.avoidedAverage w S s (fun U => g U * G.clusterUpdate w S s F U) := by | |
| classical | |
| have h := G.finite_spatialMarkov w hw {s} β | |
| (fun U H => if Disjoint U S then g U * G.expectedCluster w s F (roots H S) else 0) | |
| simp only [delete_empty, roots_singleton] at h | |
| have hleft : (fun Ο : E β Prop => | |
| if Disjoint (component (G.openGraph Ο) s) S then | |
| g (component (G.openGraph Ο) s) * G.expectedCluster w s F | |
| (roots (delete (G.openGraph Ο) (component (G.openGraph Ο) s)) S) else 0) = | |
| (fun Ο => if s β roots (G.openGraph Ο) S then | |
| g (component (G.openGraph Ο) s) * G.expectedCluster w s F | |
| (roots (G.openGraph Ο) S) else 0) := by | |
| funext Ο | |
| rw [β not_mem_roots_iff_disjoint] | |
| split_ifs with hs | |
| Β· rfl | |
| Β· rw [roots_delete_component _ S s hs] | |
| rw [hleft] at h | |
| erw [h] | |
| unfold avoidedAverage | |
| congr 1 | |
| funext Ο | |
| rw [β not_mem_roots_iff_disjoint] | |
| split_ifs | |
| Β· rw [expect_zero] | |
| Β· rw [expect_const_mul] | |
| rfl | |
| lemma avoidedAverage_exposure (w : E β Prop β β) (hw : β e, β b, w e b = 1) | |
| (S : Set V) (s : V) (F : Set V β β) : | |
| G.avoidedAverage w S s F = | |
| expect w (fun Ο => if s β roots (G.openGraph Ο) S then | |
| G.expectedCluster w s F (roots (G.openGraph Ο) S) else 0) := by | |
| classical | |
| have h := G.finite_spatialMarkov w hw S β | |
| (fun W H => if s β W then F (component H s) else 0) | |
| simp only [delete_empty] at h | |
| have hleft : (fun Ο : E β Prop => if s β roots (G.openGraph Ο) S then | |
| F (component (delete (G.openGraph Ο) (roots (G.openGraph Ο) S)) s) else 0) = | |
| (fun Ο => if s β roots (G.openGraph Ο) S then F (component (G.openGraph Ο) s) else 0) := by | |
| funext Ο | |
| split_ifs with hs | |
| Β· rfl | |
| Β· rw [delete_roots_component _ S s hs] | |
| rw [hleft] at h | |
| change expect w _ = _ | |
| erw [h] | |
| congr 1 | |
| funext Ο | |
| split_ifs | |
| Β· rw [expect_zero] | |
| Β· rfl | |
| lemma clusterUpdate_stationary (w : E β Prop β β) (hw : β e, β b, w e b = 1) | |
| (S : Set V) (s : V) (F : Set V β β) : | |
| G.avoidedAverage w S s (G.clusterUpdate w S s F) = G.avoidedAverage w S s F := by | |
| have h := G.clusterUpdate_exposure w hw S s F (fun _ => 1) | |
| simp only [one_mul] at h | |
| exact h.symm.trans (G.avoidedAverage_exposure w hw S s F).symm | |
| end CriticalPercolation.BondGraph | |
| end | |
| end | |
| end OAI | |