import Mathlib import OAI.Probability.CriticalPercolation.Criticality.FavoredFinite import OAI.Probability.CriticalPercolation.GraphGeometry.EllipseExit import OAI.Probability.CriticalPercolation.GraphGeometry.GraphBalls namespace OAI section section noncomputable section open Set Function MeasureTheory ProbabilityTheory Filter open scoped Classical Topology ENNReal namespace CriticalPercolation.BondGraph variable {V E : Type*} (G : BondGraph V E) def seedInfiniteEvent (A : Set V) : Set (Set E) := {ω | ∃ a∈A, (G.cluster ω a).Infinite} lemma seedInfiniteEvent_measurable [Countable V] [Countable E] (A : Set V) : MeasurableSet (G.seedInfiniteEvent A) := by have he : G.seedInfiniteEvent A=⋃ a∈A, {ω : Set E | (G.cluster ω a).Infinite} := by ext ω; simp [seedInfiniteEvent] rw [he] exact MeasurableSet.iUnion fun a => MeasurableSet.iUnion fun _ => G.measurableSet_infiniteEvent a lemma seedInfiniteEvent_mono {A B : Set V} (hAB : A⊆B) : G.seedInfiniteEvent A⊆G.seedInfiniteEvent B := by rintro ω ⟨a,ha,hi⟩ exact ⟨a,hAB ha,hi⟩ theorem exists_seed_infinite_probability [Countable V] [Countable E] (hc : G.fullGraph.Connected) (o : V) (q : E → unitInterval) (hone : BernoulliProduct.law q G.percolates=1) (eps : ℝ) (heps : 0 G.seedInfiniteEvent (G.vertexBall o n) have hmono : Monotone A := fun _ _ h => G.seedInfiniteEvent_mono (G.vertexBall_mono o h) have heq : (⋃ n, A n)=G.percolates := by ext ω constructor · intro h obtain ⟨n,a,_ha,hi⟩ := Set.mem_iUnion.mp h exact ⟨a,hi⟩ · rintro ⟨a,hi⟩ obtain ⟨n,hn⟩ := G.reachable_mem_vertexBall (hc o a) exact Set.mem_iUnion.mpr ⟨n,a,hn,hi⟩ have ht := tendsto_measure_iUnion_atTop (μ := BernoulliProduct.law q) hmono rw [heq,hone] at ht have hreal := (ENNReal.tendsto_toReal (by simp : (1 : ℝ≥0∞)≠⊤)).comp ht have hnear : ∀ᶠ n in atTop, 1-eps<(BernoulliProduct.law q).real (A n) := hreal.eventually (lt_mem_nhds (by simpa using heps : 1-eps G.infinite_cluster_ellipseExit Psi A zeta D hD hDz hPsi hseed S hcover hi hω have hprob := ENNReal.toReal_mono (measure_ne_top _ _) (measure_mono_ae hsub) exact BernoulliProduct.exists_favored_finite q (fun c => G.ellipseExit Psi A zeta c) S (fun c _ => G.ellipseExit_upper Psi A zeta c) (fun c _ => G.ellipseExit_finiteWitness Psi A zeta c) a ha (hi.trans_le hprob) end CriticalPercolation.BondGraph end end end end OAI