introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
5.14 kB
import Mathlib
import OAI.Probability.CriticalPercolation.Exploration.IncidenceDegree
import OAI.Probability.CriticalPercolation.Exploration.IncidenceIdentity
import OAI.Probability.CriticalPercolation.Exploration.QueryBand
import OAI.Probability.CriticalPercolation.Exploration.QueryNormalized
import OAI.Probability.CriticalPercolation.Modular.CappedDiscrepancy
namespace OAI
section
section
noncomputable section
open Set
open scoped Classical
namespace CriticalPercolation
open FiniteProduct
namespace BondGraph
variable {V E : Type*} [Fintype V] [Fintype E] (G : BondGraph V E)
omit [Fintype V] in
lemma clusterDiscrepancy_eq_centered (p : ℝ) (hp : pβ‰ 0) (Ο‰ : Set E) (v : V) :
G.clusterDiscrepancy p Ο‰ v = -(IncidenceSearch.tree G v).centeredSum p Ο‰ / p := by
rw [IncidenceSearch.tree_centered,clusterDiscrepancy,← Finset.sum_neg_distrib,Finset.sum_div]
apply Finset.sum_congr rfl
intro e _
change (if e∈G.incidentEdges (G.cluster Ο‰ v) then
(if eβˆˆΟ‰ then -(1-p)/p else 1) else 0) =
-(if e∈G.incidentEdges (G.cluster Ο‰ v) then (if eβˆˆΟ‰ then 1-p else -p) else 0)/p
by_cases he : e∈G.incidentEdges (G.cluster Ο‰ v)
Β· by_cases hΟ‰ : eβˆˆΟ‰ <;> simp [he,hΟ‰,hp]
Β· simp [he]
lemma root_discrepancy_bound (p : ℝ) (hp : p ∈ Set.Ioo 0 1)
(w : E β†’ Prop β†’ ℝ) (hw : βˆ€ e, βˆ‘ b, w e b=1) (hn : βˆ€ e b, 0≀w e b)
(hf : LazyDFS.Fresh w p βˆ…) (D : β„•) (hDpos : 1≀D)
(hD : βˆ€ v, (G.incidentEdges {v}).toFinset.card ≀ D) (K : β„•) (v : V) :
expect w (fun Ο‰ => G.rootMass (cappedMass (4^K)) Ο‰ v * |G.clusterDiscrepancy p Ο‰ v|) ≀
(D:ℝ)/p*(6/(2:ℝ)^K) := by
let t := IncidenceSearch.tree G v
have hwel : βˆ€ Ο‰ : Set E, G.rootMass (cappedMass (4^K)) Ο‰ v * |G.clusterDiscrepancy p Ο‰ v| ≀
(D:ℝ)/p * (|t.centeredSum p Ο‰| * min (1/(4:ℝ)^K) (1/(t.queryCount Ο‰ : ℝ))) := by
intro Ο‰
rw [G.clusterDiscrepancy_eq_centered p hp.1.ne' Ο‰ v,abs_div,abs_neg,abs_of_pos hp.1]
change G.rootMass (cappedMass (4^K)) Ο‰ v * (|t.centeredSum p Ο‰|/p) ≀ _
by_cases hT : t.queryCount Ο‰ = 0
Β· rw [t.centeredSum_eq_zero_of_count Ο‰ hT p]
simp
Β· have hTD : t.queryCount Ο‰ ≀ D*G.clusterSize Ο‰ v := by
rw [IncidenceSearch.tree_count]
simpa only [clusterSize,mul_comm] using G.incident_card_le (G.cluster Ο‰ v) D hD
have hh := G.capped_root_le_normalized (4^K) (t.queryCount Ο‰) D
(by positivity) (Nat.pos_of_ne_zero hT) hDpos Ο‰ v hTD
have hh' : G.rootMass (cappedMass (4^K)) Ο‰ v ≀ (D:ℝ)*
min (1/(4:ℝ)^K) (1/(t.queryCount Ο‰ : ℝ)) := by
simpa only [Nat.cast_pow,Nat.cast_ofNat] using hh
calc
_ ≀ ((D:ℝ)*min (1/(4:ℝ)^K) (1/(t.queryCount Ο‰ : ℝ))) *
(|t.centeredSum p Ο‰|/p) := mul_le_mul_of_nonneg_right hh'
(div_nonneg (abs_nonneg _) hp.1.le)
_ = _ := by ring
calc
_ ≀ expect w (fun Ο‰ => (D:ℝ)/p *
(|t.centeredSum p Ο‰| * min (1/(4:ℝ)^K) (1/(t.queryCount Ο‰ : ℝ)))) := by
exact expect_mono hn (fun Ο‰ => hwel Ο‰)
_ = (D:ℝ)/p * expect w (fun Ο‰ =>
|t.centeredSum p Ο‰| * min (1/(4:ℝ)^K) (1/(t.queryCount Ο‰ : ℝ))) := expect_const_mul _ _ _
_ ≀ _ := mul_le_mul_of_nonneg_left
(t.normalized_centered_bound βˆ… (IncidenceSearch.tree_valid G v) p
⟨hp.1.le,hp.2.le⟩ w hw hn hf K) (div_nonneg (Nat.cast_nonneg D) hp.1.le)
theorem finite_averaged_adjacent (p : ℝ) (hp : p ∈ Set.Ioo 0 1)
(w : E β†’ Prop β†’ ℝ) (hw : βˆ€ e, βˆ‘ b, w e b=1) (hn : βˆ€ e b, 0≀w e b)
(h0 : βˆ€ e, w e False=1-p) (h1 : βˆ€ e, w e True=p)
(D : β„•) (hDpos : 1≀D) (hD : βˆ€ v, (G.incidentEdges {v}).toFinset.card ≀ D)
(x y : E β†’ V) (he : βˆ€ e, G.ends e = s(x e,y e)) (K : β„•) :
(βˆ‘ e, prob w (BinaryLaw.endpointEvent G (x e) (y e) (4^K))) ≀
(Fintype.card V : ℝ)*((D:ℝ)/p*(6/(2:ℝ)^K)) := by
have hf : LazyDFS.Fresh w p βˆ… := fun e _ => ⟨h0 e,h1 e⟩
calc
_ ≀ βˆ‘ e, expect w (fun Ο‰ => G.edgeDiscrepancy (cappedMass (4^K)) p Ο‰ e) := by
apply Finset.sum_le_sum
intro e _
exact G.endpoint_prob_le_discrepancy p hp w hw hn e (x e) (y e) (he e)
(h0 e) (h1 e) (4^K) (by positivity)
_ = expect w (fun Ο‰ => βˆ‘ v, G.rootMass (cappedMass (4^K)) Ο‰ v * G.clusterDiscrepancy p Ο‰ v) := by
erw [← expect_sum]
congr 1
funext Ο‰
exact G.sum_edgeDiscrepancy _ p Ο‰
_ ≀ expect w (fun Ο‰ => βˆ‘ v, G.rootMass (cappedMass (4^K)) Ο‰ v * |G.clusterDiscrepancy p Ο‰ v|) := by
apply expect_mono hn
intro Ο‰
apply Finset.sum_le_sum
intro v _
apply mul_le_mul_of_nonneg_left (le_abs_self _)
exact div_nonneg (cappedMass_nonneg _ _) (Nat.cast_nonneg _)
_ = βˆ‘ v, expect w (fun Ο‰ => G.rootMass (cappedMass (4^K)) Ο‰ v * |G.clusterDiscrepancy p Ο‰ v|) := by
erw [expect_sum]
_ ≀ βˆ‘ _v : V, (D:ℝ)/p*(6/(2:ℝ)^K) := by
exact Finset.sum_le_sum (fun v _ => G.root_discrepancy_bound p hp w hw hn hf D hDpos hD K v)
_ = _ := by simp
end BondGraph
end CriticalPercolation
end
end
end
end OAI