math / data /lean /OAI /Probability /CriticalPercolation /GraphGeometry /ExpectedResidualAlt.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
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