File size: 7,865 Bytes
f205175
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
import Mathlib
import OAI.Probability.CriticalPercolation.Gluing.FreshCollar
import OAI.Probability.CriticalPercolation.Gluing.SourceGraph

namespace OAI

section
section
noncomputable section
open Set Function MeasureTheory ProbabilityTheory
open scoped Classical BigOperators ENNReal

namespace CriticalPercolation.BondGraph
open BernoulliProduct

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

omit [Countable V] [Countable E] in
lemma withSource_edge_cases (A : Set V) (e : E⊕A) (v w : Option V)
    (he : (G.withSource A).ends e=s(v,w)) :
    (∃ b x y, e=Sum.inl b ∧ v=some x ∧ w=some y ∧ G.ends b=s(x,y)) ∨
    (∃ a : A, e=Sum.inr a ∧ ((v=none ∧ w=some a.val) ∨ (w=none ∧ v=some a.val))) := by
  cases e with
  | inl e =>
    obtain ⟨⟨x,y⟩,hxy⟩ := Sym2.mk_surjective (G.ends e)
    change s(x,y)=G.ends e at hxy
    have hh : s(some x,some y)=s(v,w) := by simpa [withSource,← hxy] using he
    rcases Sym2.eq_iff.mp hh with hh|hh
    · exact Or.inl ⟨e,x,y,rfl,hh.1.symm,hh.2.symm,hxy.symm⟩
    · exact Or.inl ⟨e,y,x,rfl,hh.2.symm,hh.1.symm,by simpa only [Sym2.eq_swap] using hxy.symm⟩
  | inr a =>
    right
    refine ⟨a,rfl,?_⟩
    have hh : s(none,some a.val)=s(v,w) := he
    rcases Sym2.eq_iff.mp hh with hh|hh
    · exact Or.inl ⟨hh.1.symm,hh.2.symm⟩
    · exact Or.inr ⟨hh.1.symm,hh.2.symm⟩

theorem withSource_transfer_from_geometry (hlocal : G.LocallyFinite)
    (A Input T : Set V) (hA : A.Finite) (q : (E⊕A) → unitInterval)
    (π : V → ℤ) (H : ℤ) (J : Finset ℤ) (hJ : J.Nonempty)
    (hH : ∀ j∈J, j<H) (hAlevel : ∀ a∈A, H ≤ π a)
    (hInput : ∀ j∈J, ∀ v∈Input, π v<j)
    (hcross : ∀ j∈J, ∀ e v w, G.ends e=s(v,w) → j ≤ π v → π w<j → π v=j)
    (p : unitInterval) (hp : (p : ℝ)<1)
    (hq : ∀ j∈J, ∀ e v w, G.ends e=s(v,w) → π v=j → π w<j → (q (Sum.inl e) : ℝ) ≤ p)
    (D k M N : ℕ) (hD : ∀ j∈J, ∀ v, π v=j → (G.incidentEdges {v}).ncard ≤ D)
    (hM : 0 < M) (hk : M*N ≤ k)
    (C : V → V → Prop) (hrefl : ∀ v, C v v) (hsymm : ∀ {v w}, C v w → C w v)
    (hfinite : ∀ v, {w | C v w}.Finite) (hbound : ∀ v, {w | C v w}.ncard ≤ M)
    (F : ℤ → V → Set E) (B : ℤ → V → Set V)
    (hF : ∀ j∈J, ∀ v, F j v ⊆ (G.inducedEdges {w | j ≤ π w})ᶜ)
    (hconnect : ∀ j∈J, ∀ v, π v=j → ∀ b∈B j v, (G.openGraph (F j v)).Reachable v b)
    (hdis : ∀ j∈J, ∀ v w, ¬C v w → Disjoint (F j v) (F j w))
    (s₀ K η lam : ℝ) (hK : 0 ≤ K) (hη : 0 ≤ η) (hlam : 0 < lam)
    (hs : ∀ j∈J, ∀ v, π v=j → s₀ ≤ (BernoulliProduct.law (fun e => q (Sum.inl e))).real (allOpen (F j v)))
    (hN : K ≤ N*s₀)
    (hmean : ∀ j∈J, ∀ v, π v=j →
      1-η ≤ (BernoulliProduct.law (fun e => q (Sum.inl e))).real (G.seedHitEvent (B j v) T)) :
    (BernoulliProduct.law q).real ((G.withSource A).hitEvent none (some '' Input)\
      (G.withSource A).hitEvent none (some '' T)) ≤
      1/((J.card : ℝ)*(1-(p : ℝ))^(D*k))+Real.exp (-K)+(K+1)*η/lam+lam := by
  let π' : Option V → ℤ := Option.elim' H π
  let C' : Option V → Option V → Prop := fun v w => match v,w with
    | none,none => True
    | some v,some w => C v w
    | _,_ => False
  let F' : ℤ → Option V → Set (E⊕A) := fun j => Option.elim' ∅ (fun v => Sum.inl '' F j v)
  let B' : ℤ → Option V → Set (Option V) := fun j => Option.elim' ∅ (fun v => some '' B j v)
  have hvA (j : ℤ) (hj : j∈J) (v : V) (hv : π v=j) : v∉A := by
    intro hva
    have := hAlevel v hva
    have := hH j hj
    omega
  have hcross' (j : ℤ) (hj : j∈J) (e : E⊕A) (v w : Option V)
      (he : (G.withSource A).ends e=s(v,w)) (hv : j ≤ π' v) (hw : π' w<j) : π' v=j := by
    rcases G.withSource_edge_cases A e v w he with ⟨b,x,y,rfl,rfl,rfl,hb⟩|⟨a,rfl,hh⟩
    · exact hcross j hj b x y hb hv hw
    · obtain hh|hh := hh
      · obtain ⟨rfl,rfl⟩ := hh
        have := hAlevel a a.property
        have := hH j hj
        change π a<j at hw
        omega
      · obtain ⟨rfl,rfl⟩ := hh
        change H<j at hw
        have := hH j hj
        omega
  have hs' (j : ℤ) (hj : j∈J) (v : V) (hv : π v=j) :
      s₀ ≤ (BernoulliProduct.law q).real (allOpen (Sum.inl '' F j v)) := by
    have hm : Measurable (fun ω : Set (E⊕A) => Sum.inl ⁻¹' ω : Set (E⊕A) → Set E) :=
      Measurable.of_eval (fun edge => measurable_set_mem (Sum.inl edge))
    have lawproj := BernoulliProduct.law_map_preimage q Sum.inl Sum.inl_injective
    have heq : allOpen (Sum.inl '' F j v)=(fun ω : Set (E⊕A) => Sum.inl ⁻¹' ω) ⁻¹' allOpen (F j v) := by
      ext ω
      simp only [allOpen,mem_ofPred_eq,mem_preimage]
      exact Set.image_subset_iff
    rw [heq,measureReal_def,← Measure.map_apply hm ((blockSigma_le _) _ (measurable_allOpen_block (F j v))),lawproj]
    exact hs j hj v hv
  apply (G.withSource A).fresh_collar_transfer_from_geometry (G.withSource_local hlocal hA)
    q π' none (some '' Input) (some '' T) J hJ (fun j hj => (hH j hj).le)
    (by rintro j hj _ ⟨v,hv,rfl⟩; exact hInput j hj v hv) hcross' p hp
    (by
      intro j hj e v w he hv hw
      rcases G.withSource_edge_cases A e v w he with ⟨b,x,y,rfl,rfl,rfl,hb⟩|⟨a,rfl,hh⟩
      · exact hq j hj b x y hb hv hw
      · obtain hh|hh := hh
        · obtain ⟨rfl,rfl⟩ := hh
          change H=j at hv
          have := hH j hj
          omega
        · obtain ⟨rfl,rfl⟩ := hh
          change H<j at hw
          have := hH j hj
          omega)
    D k M N
    (by
      intro j hj v hv
      cases v with
      | none => have := hH j hj; change H=j at hv; omega
      | some v =>
        rw [G.withSource_incident A (hvA j hj v hv),Set.ncard_image_of_injective _ Sum.inl_injective]
        exact hD j hj v hv)
    hM hk C'
    (by intro v; cases v; trivial; exact hrefl _)
    (by intro v w h; cases v <;> cases w <;> simp_all only [C'])
    (by
      intro v
      cases v with
      | none =>
        have he : {w | C' none w}={none} := by ext w; cases w <;> simp [C']
        rw [he]
        exact Set.finite_singleton _
      | some v =>
        have he : {w | C' (some v) w}=some '' {w | C v w} := by ext w; cases w <;> simp [C']
        rw [he]
        exact (hfinite v).image _)
    (by
      intro v
      cases v with
      | none =>
        have he : {w | C' none w}={none} := by ext w; cases w <;> simp [C']
        rw [he,Set.ncard_singleton]
        omega
      | some v =>
        have he : {w | C' (some v) w}=some '' {w | C v w} := by ext w; cases w <;> simp [C']
        rw [he,Set.ncard_image_of_injective _ (Option.some_injective V)]
        exact hbound v)
    F' B'
    (by
      intro j hj v
      cases v with
      | none => exact Set.empty_subset _
      | some v =>
        rintro e ⟨b,hb,rfl⟩ he
        apply hF j hj v hb
        intro z hz
        exact he (some z) (by simpa [withSource] using hz))
    (by
      intro j hj v hv b hb
      cases v with
      | none => have := hH j hj; change H=j at hv; omega
      | some v =>
        obtain ⟨z,hz,rfl⟩ := hb
        exact G.withSource_trial_reachable A (F j v) (hconnect j hj v hv z hz))
    (by
      intro j hj v w h
      cases v <;> cases w
      · simp [F']
      · simp [F']
      · simp [F']
      · exact Set.disjoint_image_of_injective Sum.inl_injective (hdis j hj _ _ h))
    s₀ K η lam hK hη hlam
    (by
      intro j hj v hv
      cases v with
      | none => have := hH j hj; change H=j at hv; omega
      | some v => exact hs' j hj v hv)
    hN
    (by
      intro j hj v hv
      cases v with
      | none => have := hH j hj; change H=j at hv; omega
      | some v => exact (hmean j hj v hv).trans (G.withSource_seedHit A (B j v) T q))

end CriticalPercolation.BondGraph
end
end
end

end OAI