math / data /lean /OAI /Probability /CriticalPercolation /Gluing /FiniteJointGluing.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
4.02 kB
import Mathlib
import OAI.Probability.CriticalPercolation.Clusters.HitValue
import OAI.Probability.CriticalPercolation.Gluing.FiniteJointGluingStrict
import OAI.Probability.CriticalPercolation.ProductMeasure.ContinuousExpectWeights
namespace OAI
section
section
open scoped BigOperators
open Set MeasureTheory ProbabilityTheory
namespace CriticalPercolation.BondGraph
open CriticalPercolation.FiniteProduct CriticalPercolation.ClusterDeletion
open CriticalPercolation.ClusterColumns
open scoped Classical
variable {V E : Type*} [Fintype V] [Fintype E] (G : BondGraph V E)
lemma finite_joint_gluing (w : E β†’ Prop β†’ ℝ)
(hw : βˆ€ e, βˆ‘ b, w e b = 1) (hpos : βˆ€ e b, 0 ≀ w e b)
(o : V) (A T : Set V) (a : ℝ)
(ha : βˆ€ v ∈ A, a ≀ expect w
(fun Ο‰ => hitValue T (component (G.openGraph Ο‰) v))) :
expect w (fun Ο‰ => hitValue A (component (G.openGraph Ο‰) o)) * a ≀
expect w (fun Ο‰ => jointHitValue A T (component (G.openGraph Ο‰) o)) := by
classical
let w' : ℝ β†’ E β†’ Prop β†’ ℝ := fun t e b => (1-t) * w e b + if b then 0 else t
have hzero : w' 0 = w := by funext e b; simp [w']
have hcont : Continuous w' := by
apply continuous_pi
intro e
apply continuous_pi
intro b
dsimp only [w']
split_ifs <;> fun_prop
let err : ℝ β†’ ℝ := fun t => βˆ‘ v : V,
|expect (w' t) (fun Ο‰ => hitValue T (component (G.openGraph Ο‰) v)) -
expect w (fun Ο‰ => hitValue T (component (G.openGraph Ο‰) v))|
have herr : Continuous err := by
apply continuous_finsetSum
intro v _
exact (((continuous_expect_weights _).comp hcont).sub continuous_const).abs
have herr0 : err 0 = 0 := by simp [err, hzero]
have hbound (t : ℝ) (ht : 0 < t) (ht1 : t ≀ 1) :
expect (w' t) (fun Ο‰ => hitValue A (component (G.openGraph Ο‰) o)) * (a-err t) ≀
expect (w' t) (fun Ο‰ => jointHitValue A T (component (G.openGraph Ο‰) o)) := by
apply G.finite_joint_gluing_strict
Β· intro e
have hs := hw e
simp only [Fintype.sum_Prop] at hs ⊒
dsimp only [w']
rw [ite_eq_left True.intro, ite_eq_right (by trivial : Β¬ False)]
nlinarith
Β· intro e b
have hm := mul_nonneg (sub_nonneg.mpr ht1) (hpos e b)
dsimp only [w']
apply add_nonneg hm
split_ifs <;> linarith
Β· intro e
have hm := mul_nonneg (sub_nonneg.mpr ht1) (hpos e False)
dsimp only [w']
rw [ite_eq_right (by trivial : Β¬ False)]
exact add_pos_of_nonneg_of_pos hm ht
Β· intro v hv
have hsingle :
|expect (w' t) (fun Ο‰ => hitValue T (component (G.openGraph Ο‰) v)) -
expect w (fun Ο‰ => hitValue T (component (G.openGraph Ο‰) v))| ≀ err t := by
dsimp only [err]
exact Finset.single_le_sum (f := fun u : V =>
|expect (w' t) (fun Ο‰ => hitValue T (component (G.openGraph Ο‰) u)) -
expect w (fun Ο‰ => hitValue T (component (G.openGraph Ο‰) u))|)
(fun _ _ => abs_nonneg _) (Finset.mem_univ v)
have hneg := (abs_le.mp hsingle).1
linarith [ha v hv]
have ht : Filter.Tendsto (fun n : β„• => 1 / ((n : ℝ)+1)) Filter.atTop (nhds 0) :=
tendsto_one_div_add_atTop_nhds_zero_nat
have hL := ((((continuous_expect_weights
(fun Ο‰ => hitValue A (component (G.openGraph Ο‰) o))).comp hcont).mul
((continuous_const (y := a)).sub herr)).tendsto 0).comp ht
have hR := (((continuous_expect_weights
(fun Ο‰ => jointHitValue A T (component (G.openGraph Ο‰) o))).comp hcont).tendsto 0).comp ht
have hh := le_of_tendsto_of_tendsto hL hR (Filter.Eventually.of_forall (fun n : β„• =>
hbound (1/((n : ℝ)+1)) (by positivity) (by
apply (div_le_one (by positivity : (0 : ℝ) < n+1)).mpr
have hn := Nat.cast_nonneg (Ξ± := ℝ) n
linarith)))
simpa only [Pi.mul_apply, Pi.sub_apply, Function.comp_apply, hzero, herr0, sub_zero] using hh
end CriticalPercolation.BondGraph
open Set MeasureTheory ProbabilityTheory
open scoped Classical ENNReal
end
end
end OAI