math / data /lean /OAI /Probability /CriticalPercolation /Clusters /ExpectedCluster.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
3.53 kB
import Mathlib
import OAI.Probability.CriticalPercolation.GraphGeometry.VertexBall
import OAI.Probability.CriticalPercolation.ProductMeasure.Density
namespace OAI
section
section
open Set MeasureTheory ProbabilityTheory
open scoped BigOperators
open Set
namespace CriticalPercolation.BondGraph
open CriticalPercolation.FiniteProduct CriticalPercolation.ClusterDeletion
variable {V E : Type*} [Fintype V] [Fintype E] (G : BondGraph V E)
lemma finite_spatialMarkov (w : E β†’ Prop β†’ ℝ) (hw : βˆ€ e, βˆ‘ b, w e b = 1)
(S U : Set V) (F : Set V β†’ SimpleGraph V β†’ ℝ) :
expect w (fun Ο‰ =>
F (roots (delete (G.openGraph Ο‰) U) S)
(delete (G.openGraph Ο‰) (roots (delete (G.openGraph Ο‰) U) S))) =
expect w (fun Ο‰ => expect w (fun Ο‰' =>
F (roots (delete (G.openGraph Ο‰) U) S)
(delete (G.openGraph Ο‰') (roots (delete (G.openGraph Ο‰) U) S)))) := by
classical
refine expect_exposure w hw
(fun Ο‰ => roots (delete (G.openGraph Ο‰) U) S) G.incidentEdges
(G.dependsOn_exact_deleted_roots S U)
(fun W Ο‰ => F W (delete (G.openGraph Ο‰) W)) ?_
intro W ω ω' hω
exact congrArg (F W) (G.delete_openGraph_dependsOn W hω)
noncomputable def expectedCluster (w : E β†’ Prop β†’ ℝ) (s : V)
(F : Set V β†’ ℝ) (W : Set V) : ℝ :=
expect w (fun Ο‰ => F (component (delete (G.openGraph Ο‰) W) s))
noncomputable def expectedResidual (w : E β†’ Prop β†’ ℝ) (S : Set V) (s : V)
(F : Set V β†’ ℝ) (U : Set V) : ℝ := by
classical
exact expect w (fun Ο‰ =>
if s βˆ‰ roots (delete (G.openGraph Ο‰) U) S then
G.expectedCluster w s F (roots (delete (G.openGraph Ο‰) U) S) -
G.expectedCluster w s F (roots (delete (G.openGraph Ο‰) U) S βˆͺ U)
else 0)
lemma expectedResidual_eq (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 Ο‰ => residual (G.openGraph Ο‰) S s F U) := by
classical
have h := G.finite_spatialMarkov w hw S U
(fun W H => if s βˆ‰ W then F (component H s) - F (component (delete H U) s) else 0)
have hu : βˆ€ H W, delete (delete H W) U = delete H (W βˆͺ U) := by
intro H W
rw [delete_delete, Set.union_comm]
simp_rw [hu] at h
change _ = expect w (fun Ο‰ => if s βˆ‰ roots (delete (G.openGraph Ο‰) U) S then
F (component (delete (G.openGraph Ο‰) (roots (delete (G.openGraph Ο‰) U) S)) s) -
F (component (delete (G.openGraph Ο‰) (roots (delete (G.openGraph Ο‰) U) S βˆͺ U)) s)
else 0)
rw [h]
unfold expectedResidual
congr 1
funext Ο‰
split_ifs
Β· rw [expect_const w hw]
Β· rw [expect_sub]
rfl
lemma expectedResidual_nonneg (w : E β†’ Prop β†’ ℝ)
(hw : βˆ€ e, βˆ‘ b, w e b = 1) (hpos : βˆ€ e b, 0 ≀ w e b)
(S : Set V) (s : V) {F : Set V β†’ ℝ} (hF : Monotone F) (U : Set V) :
0 ≀ G.expectedResidual w S s F U := by
rw [expectedResidual_eq G w hw, ← expect_const w hw 0]
exact expect_mono hpos fun Ο‰ => residual_nonneg (G.openGraph Ο‰) S s hF U
lemma expectedResidual_monotone (w : E β†’ Prop β†’ ℝ)
(hw : βˆ€ e, βˆ‘ b, w e b = 1) (hpos : βˆ€ e b, 0 ≀ w e b)
(S : Set V) (s : V) {F : Set V β†’ ℝ} (hF : Monotone F) :
Monotone (G.expectedResidual w S s F) := by
intro U U' hUU'
rw [expectedResidual_eq G w hw, expectedResidual_eq G w hw]
exact expect_mono hpos fun Ο‰ => residual_monotone (G.openGraph Ο‰) S s hF hUU'
end CriticalPercolation.BondGraph
open scoped BigOperators
end
end
end OAI