File size: 5,248 Bytes
4a56cd6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
import Mathlib
import OAI.Probability.CriticalPercolation.Exploration.QueryBand
import OAI.Probability.CriticalPercolation.Exploration.IncidenceIdentity
import OAI.Probability.CriticalPercolation.Exploration.QueryNormalized
import OAI.Probability.CriticalPercolation.Modular.ClusterMassInfinite

namespace OAI

section
noncomputable section
open Set MeasureTheory
open scoped Classical BigOperators

namespace CriticalPercolation.FiniteClusters
open FiniteProduct

variable {V E : Type*} (G : BondGraph V E)

lemma size_pos {Ο‰ : Set E} {v : V} (hC : (G.cluster Ο‰ v).Finite) :
    0 < size G Ο‰ v := (Set.ncard_pos hC).mpr ⟨v,SimpleGraph.Reachable.refl v⟩

lemma mass_eq_min (s : β„•) (hs : 0<s) (Ο‰ : Set E) (v : V)
    (hC : (G.cluster Ο‰ v).Finite) :
    mass G s Ο‰ v = min (1/(s:ℝ)) (1/(size G Ο‰ v : ℝ)) := by
  have hm : (0:ℝ)<size G Ο‰ v := Nat.cast_pos.mpr (size_pos G hC)
  have hs' : (0:ℝ)<s := Nat.cast_pos.mpr hs
  unfold mass cappedMass
  by_cases hms : (size G Ο‰ v : ℝ)/s ≀ 1
  Β· rw [min_eq_left hms,min_eq_left]
    Β· field_simp
    Β· apply (div_le_div_iffβ‚€ hs' hm).mpr
      have hh := (div_le_one hs').mp hms
      simpa only [one_mul] using hh
  Β· have hh : (s:ℝ) ≀ size G Ο‰ v := (one_le_div hs').mp (le_of_lt (lt_of_not_ge hms))
    rw [min_eq_right (le_of_lt (lt_of_not_ge hms)),min_eq_right]
    apply (div_le_div_iffβ‚€ hm hs').mpr
    simpa only [one_mul] using hh

lemma mass_le_normalized (s T D : β„•) (hs : 0<s) (hT : 0<T) (hD : 1≀D)
    (Ο‰ : Set E) (v : V) (hC : (G.cluster Ο‰ v).Finite) (hTD : T ≀ D*size G Ο‰ v) :
    mass G s Ο‰ v ≀ (D:ℝ)*min (1/(s:ℝ)) (1/(T:ℝ)) := by
  rw [mass_eq_min G s hs Ο‰ v hC,mul_min_of_nonneg _ _ (Nat.cast_nonneg D)]
  apply le_min
  Β· exact (min_le_left _ _).trans
      (le_mul_of_one_le_left (by positivity) (Nat.one_le_cast.mpr hD))
  Β· apply (min_le_right _ _).trans
    rw [mul_one_div]
    apply (div_le_div_iffβ‚€ (Nat.cast_pos.mpr (size_pos G hC)) (Nat.cast_pos.mpr hT)).mpr
    simpa only [one_mul,Nat.cast_mul] using (Nat.cast_le.mpr hTD : (T:ℝ)≀(D*size G Ο‰ v : β„•))

variable [Fintype E]

lemma rootSum_eq_centered (p : ℝ) (hp : pβ‰ 0) (Ο‰ : Set E) (v : V) :
    rootSum G p Ο‰ v = -(IncidenceSearch.tree G v).centeredSum p Ο‰ / p := by
  rw [IncidenceSearch.tree_centered,rootSum,tsum_fintype,← Finset.sum_neg_distrib,Finset.sum_div]
  apply Finset.sum_congr rfl
  intro e _
  by_cases he : e∈G.incidentEdges (G.cluster Ο‰ v)
  Β· by_cases hΟ‰ : eβˆˆΟ‰ <;> simp [he,hΟ‰,hp,coefficient]
  Β· simp [he]

lemma finite_rootAbsolute_expect (p : ℝ) (hp : p ∈ 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}).ncard ≀ D) (K : β„•) (v : V) :
    expect w (fun Ο‰ => rootAbsolute G (4^K) p Ο‰ v) ≀ (D:ℝ)/p*(6/(2:ℝ)^K) := by
  let t := IncidenceSearch.tree G v
  have hwel (Ο‰ : Set E) : rootAbsolute G (4^K) p Ο‰ v ≀
      (D:ℝ)/p * (|t.centeredSum p Ο‰| * min (1/(4:ℝ)^K) (1/(t.queryCount Ο‰ : ℝ))) := by
    rw [rootAbsolute,rootSum_eq_centered G p hp.1.ne' Ο‰ v,abs_div,abs_neg,abs_of_pos hp.1]
    by_cases hT : t.queryCount Ο‰ = 0
    Β· rw [t.centeredSum_eq_zero_of_count Ο‰ hT p]
      simp
    Β· have hC := G.finite_cluster_of_finite_bonds (Set.toFinite Ο‰) v
      have hTD : t.queryCount Ο‰ ≀ D*size G Ο‰ v := by
        rw [IncidenceSearch.tree_count,← Set.ncard_eq_toFinset_card']
        simpa only [size,mul_comm] using G.incident_ncard_le _ hC D (fun w _ => hD w)
      have hh := mass_le_normalized G (4^K) (t.queryCount Ο‰) D
        (by positivity) (Nat.pos_of_ne_zero hT) hDpos Ο‰ v hC hTD
      have hh' : mass G (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 Ο‰ : ℝ)))) := expect_mono hn 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)

lemma finite_rootAbsolute_integral (p : unitInterval) (hp : (p:ℝ) ∈ Ioo 0 1)
    (D : β„•) (hDpos : 1≀D) (hD : βˆ€ v, (G.incidentEdges {v}).ncard ≀ D) (K : β„•) (v : V) :
    (∫ Ο‰, rootAbsolute G (4^K) p Ο‰ v βˆ‚G.law p) ≀ (D:ℝ)/p*(6/(2:ℝ)^K) := by
  rw [BondGraph.law,← BernoulliProduct.law_const,BernoulliProduct.integral_law_eq_expect]
  exact finite_rootAbsolute_expect G p hp _
    (fun _ => BernoulliProduct.bitWeight_sum p) (fun _ => BernoulliProduct.bitWeight_nonneg p)
    (fun _ _ => ⟨by simp [BernoulliProduct.bitWeight],by simp [BernoulliProduct.bitWeight]⟩)
    D hDpos hD K v

end CriticalPercolation.FiniteClusters
end
end

end OAI