introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
7.68 kB
import Mathlib
import OAI.Probability.CriticalPercolation.Clusters.ClusterUpdate
import OAI.Probability.CriticalPercolation.Clusters.Earlier
import OAI.Probability.CriticalPercolation.GraphGeometry.ExpectedResidualAlt
namespace OAI
section
section
open Set MeasureTheory ProbabilityTheory
open scoped BigOperators
namespace CriticalPercolation.BondGraph
open CriticalPercolation.FiniteProduct CriticalPercolation.ClusterDeletion
open CriticalPercolation.ClusterColumns
open scoped Classical
variable {V E : Type*} [Fintype V] [Fintype E] (G : BondGraph V E)
lemma avoided_drift_zero (w : E β†’ Prop β†’ ℝ) (hw : βˆ€ e, βˆ‘ b, w e b = 1)
(S : Set V) (s : V) (F b : Set V β†’ ℝ) :
expect w (fun Ο‰ => if s βˆ‰ roots (G.openGraph Ο‰) S then
b (roots (G.openGraph Ο‰) S) * (F (component (G.openGraph Ο‰) s) -
G.expectedCluster w s F (roots (G.openGraph Ο‰) S)) else 0) = 0 := by
have h := G.finite_spatialMarkov w hw S βˆ…
(fun W H => if s βˆ‰ W then b W * (F (component H s) - G.expectedCluster w s F W) else 0)
simp only [delete_empty] at h
have hleft : (fun Ο‰ : E β†’ Prop => if s βˆ‰ roots (G.openGraph Ο‰) S then
b (roots (G.openGraph Ο‰) S) * (F (component (delete (G.openGraph Ο‰) (roots (G.openGraph Ο‰) S)) s) -
G.expectedCluster w s F (roots (G.openGraph Ο‰) S)) else 0) =
(fun Ο‰ => if s βˆ‰ roots (G.openGraph Ο‰) S then
b (roots (G.openGraph Ο‰) S) * (F (component (G.openGraph Ο‰) s) -
G.expectedCluster w s F (roots (G.openGraph Ο‰) S)) else 0) := by
funext Ο‰
split_ifs with hs
Β· rfl
Β· rw [delete_roots_component _ S s hs]
rw [hleft] at h
erw [h]
have hz : βˆ€ W : Set V, expect w (fun Ο‰ => if s βˆ‰ W then
b W * (F (component (delete (G.openGraph Ο‰) W) s) - G.expectedCluster w s F W)
else 0) = 0 := by
intro W
split_ifs
Β· exact expect_zero w
Β· rw [expect_const_mul, expect_sub, expect_const w hw]
change b W * (G.expectedCluster w s F W - G.expectedCluster w s F W) = 0
ring
simp only [hz, expect_zero]
noncomputable def column {n : β„•} (w : E β†’ Prop β†’ ℝ) (x : Fin n β†’ V)
(k : Fin n) (F : Set V β†’ ℝ) (i : Fin n) : ℝ :=
expect w (fun Ο‰ => select (G.openGraph Ο‰) x k i * F (component (G.openGraph Ο‰) (x k)))
omit [Fintype V] in
lemma column_as_avoidedAverage {n : β„•} (w : E β†’ Prop β†’ ℝ) (x : Fin n β†’ V)
(k : Fin n) (F : Set V β†’ ℝ) (i : Fin n) :
G.column w x k F i = G.avoidedAverage w (earlier x k) (x k)
(fun U => (if x i ∈ U then 1 else 0) * F U) := by
unfold column avoidedAverage select first
congr 1
funext Ο‰
split_ifs <;> simp_all
lemma column_update {n : β„•} (w : E β†’ Prop β†’ ℝ) (hw : βˆ€ e, βˆ‘ b, w e b = 1)
(x : Fin n β†’ V) (k : Fin n) (F : Set V β†’ ℝ) (i : Fin n) :
G.column w x k (G.clusterUpdate w (earlier x k) (x k) F) i =
expect w (fun Ο‰ => select (G.openGraph Ο‰) x k i *
G.expectedCluster w (x k) F (roots (G.openGraph Ο‰) (earlier x k))) := by
rw [G.column_as_avoidedAverage]
rw [← G.clusterUpdate_exposure w hw]
congr 1
funext Ο‰
simp only [select, first]
split_ifs <;> simp_all
lemma column_later_residual {n : β„•} (w : E β†’ Prop β†’ ℝ) (hw : βˆ€ e, βˆ‘ b, w e b = 1)
(x : Fin n β†’ V) {k l : Fin n} (hkl : k < l) (F : Set V β†’ ℝ) (i : Fin n) :
G.column w x l (G.expectedResidual w (earlier x k) (x k) F) i =
expect w (fun Ο‰ => if first (G.openGraph Ο‰) x k then
select (G.openGraph Ο‰) x l i *
(G.expectedCluster w (x k) F (roots (G.openGraph Ο‰) (earlier x k)) -
F (component (G.openGraph Ο‰) (x k))) else 0) := by
have h := G.later_cluster_residual w hw (earlier x k) (x k) (x l) F
(fun U => if x i ∈ U then 1 else 0) (fun U => Disjoint U (earlier x l))
(fun U hU => ⟨hU.mono_right (earlier_mono x hkl.le),
fun hs => (Set.disjoint_left.mp hU) hs ⟨k, hkl, rfl⟩⟩)
have hc : (fun Ο‰ : E β†’ Prop => if Disjoint (component (G.openGraph Ο‰) (x l)) (earlier x l) then
(if x i ∈ component (G.openGraph Ο‰) (x l) then 1 else 0) *
G.expectedResidual w (earlier x k) (x k) F (component (G.openGraph Ο‰) (x l)) else 0) =
(fun Ο‰ => select (G.openGraph Ο‰) x l i *
G.expectedResidual w (earlier x k) (x k) F (component (G.openGraph Ο‰) (x l))) := by
funext Ο‰
simp only [select, first, not_mem_roots_iff_disjoint]
split_ifs <;> simp_all
rw [hc] at h
unfold column
erw [← h]
congr 1
funext Ο‰
simp only [select, first, not_mem_roots_iff_disjoint]
split_ifs <;> simp_all
lemma column_decomposition {n : β„•} (w : E β†’ Prop β†’ ℝ) (hw : βˆ€ e, βˆ‘ b, w e b = 1)
(x : Fin n β†’ V) (k : Fin n) (F : Set V β†’ ℝ) (i : Fin n) :
G.column w x k F i =
G.column w x k (G.clusterUpdate w (earlier x k) (x k) F) i +
βˆ‘ l, if k < l then G.column w x l (G.expectedResidual w (earlier x k) (x k) F) i else 0 := by
have hzero := G.avoided_drift_zero w hw (earlier x k) (x k) F
(fun W => if x i βˆ‰ W then 1 else 0)
have hpoint : (fun Ο‰ : E β†’ Prop => if x k βˆ‰ roots (G.openGraph Ο‰) (earlier x k) then
(if x i βˆ‰ roots (G.openGraph Ο‰) (earlier x k) then (1 : ℝ) else 0) *
(F (component (G.openGraph Ο‰) (x k)) -
G.expectedCluster w (x k) F (roots (G.openGraph Ο‰) (earlier x k))) else 0) =
(fun Ο‰ => select (G.openGraph Ο‰) x k i *
(F (component (G.openGraph Ο‰) (x k)) -
G.expectedCluster w (x k) F (roots (G.openGraph Ο‰) (earlier x k))) -
βˆ‘ l, if k < l then if first (G.openGraph Ο‰) x k then
select (G.openGraph Ο‰) x l i *
(G.expectedCluster w (x k) F (roots (G.openGraph Ο‰) (earlier x k)) -
F (component (G.openGraph Ο‰) (x k))) else 0 else 0) := by
funext Ο‰
by_cases hk : first (G.openGraph Ο‰) x k
Β· simp only [show x k βˆ‰ roots (G.openGraph Ο‰) (earlier x k) from hk,
not_false_eq_true, ite_true]
rw [select_truncation]
simp only [hk, ite_true]
have hsum : βˆ€ a : ℝ,
(βˆ‘ l, if k < l then select (G.openGraph Ο‰) x l i * a else 0) =
(βˆ‘ l, if k < l then select (G.openGraph Ο‰) x l i else 0) * a := by
intro a
rw [Finset.sum_mul]
apply Finset.sum_congr rfl
intro l _
split_ifs <;> simp
rw [hsum]
ring
Β· have hk' : Β¬ (x k βˆ‰ roots (G.openGraph Ο‰) (earlier x k)) := hk
simp [hk', hk, select]
rw [hpoint] at hzero
erw [expect_sub, expect_sum] at hzero
have hlater : (βˆ‘ l, expect w (fun Ο‰ => if k < l then if first (G.openGraph Ο‰) x k then
select (G.openGraph Ο‰) x l i *
(G.expectedCluster w (x k) F (roots (G.openGraph Ο‰) (earlier x k)) -
F (component (G.openGraph Ο‰) (x k))) else 0 else 0)) =
βˆ‘ l, if k < l then G.column w x l (G.expectedResidual w (earlier x k) (x k) F) i else 0 := by
apply Finset.sum_congr rfl
intro l _
by_cases hkl : k < l
Β· simp only [hkl, ite_true]
exact (G.column_later_residual w hw x hkl F i).symm
Β· simp only [hkl, ite_false, expect_zero]
erw [hlater] at hzero
have hdiff : G.column w x k F i -
G.column w x k (G.clusterUpdate w (earlier x k) (x k) F) i =
expect w (fun Ο‰ => select (G.openGraph Ο‰) x k i *
(F (component (G.openGraph Ο‰) (x k)) -
G.expectedCluster w (x k) F (roots (G.openGraph Ο‰) (earlier x k)))) := by
rw [G.column_update w hw]
unfold column
erw [← expect_sub]
congr 1
funext Ο‰
ring
exact sub_eq_iff_eq_add'.mp (hdiff.trans (sub_eq_zero.mp hzero))
end CriticalPercolation.BondGraph
end
end
end OAI