math / data /lean /OAI /Probability /CriticalPercolation /Modular /ClusterTransportSums.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
7.47 kB
import Mathlib
import OAI.Probability.CriticalPercolation.Modular.ClusterTransportGeometry
namespace OAI
section
noncomputable section
open Set MeasureTheory Filter
open scoped Classical BigOperators Topology
namespace CriticalPercolation.FiniteClusters
variable {V E : Type*} (G : BondGraph V E)
def weight (r s : β„•) (Ο‰ : Set E) (v : V) : ℝ :=
if small G r Ο‰ v then mass G s Ο‰ v else 0
def transport (r s : β„•) (p : ℝ) (Ο‰ : Set E) (v : V) (e : E) : ℝ :=
if e ∈ G.incidentEdges (G.cluster Ο‰ v) then weight G r s Ο‰ v * coefficient p Ο‰ e else 0
def clusterWeight (r s : β„•) (Ο‰ : Set E) (v : V) : ℝ :=
if small G r Ο‰ v then cappedMass s (size G Ο‰ v) else 0
def truncatedEdgeMass (r s : β„•) (Ο‰ : Set E) (e : E) : ℝ :=
clusterWeight G r s Ο‰ (G.ends e).out.1 +
if (G.openGraph Ο‰).Reachable (G.ends e).out.1 (G.ends e).out.2 then 0
else clusterWeight G r s Ο‰ (G.ends e).out.2
lemma weight_reachable (r s : β„•) {Ο‰ : Set E} {u v : V}
(h : (G.openGraph Ο‰).Reachable u v) : weight G r s Ο‰ u = weight G r s Ο‰ v := by
rw [weight,weight,small_reachable G r h,mass_eq_of_reachable G s h]
lemma weight_nonneg (r s : β„•) (Ο‰ : Set E) (v : V) : 0 ≀ weight G r s Ο‰ v := by
unfold weight
split_ifs
Β· exact mass_nonneg G s Ο‰ v
Β· rfl
lemma clusterWeight_nonneg (r s : β„•) (Ο‰ : Set E) (v : V) : 0 ≀ clusterWeight G r s Ο‰ v := by
unfold clusterWeight
split_ifs
Β· exact cappedMass_nonneg _ _
Β· rfl
lemma clusterWeight_le (r s : β„•) (Ο‰ : Set E) (v : V) :
clusterWeight G r s Ο‰ v ≀ cappedMass s (size G Ο‰ v) := by
unfold clusterWeight
split_ifs
Β· rfl
Β· exact cappedMass_nonneg _ _
lemma weighted_cluster_summable (hl : G.LocallyFinite) (r s : β„•) (Ο‰ : Set E) (x : V) :
Summable (fun u => if u ∈ G.cluster Ο‰ x then weight G r s Ο‰ u else 0) := by
by_cases hs : small G r Ο‰ x
Β· apply summable_of_ne_finset_zero (s := (small_finite G hl hs).toFinset)
intro u hu
simpa only [Set.Finite.mem_toFinset,not_false_eq_true] using
(ite_eq_right (show u βˆ‰ G.cluster Ο‰ x from fun h => hu ((small_finite G hl hs).mem_toFinset.mpr h)) :
(if u ∈ G.cluster Ο‰ x then weight G r s Ο‰ u else 0) = 0)
Β· have hz : (fun u => if u ∈ G.cluster Ο‰ x then weight G r s Ο‰ u else 0) = 0 := by
funext u
by_cases hu : u ∈ G.cluster Ο‰ x
Β· rw [ite_eq_left hu,← weight_reachable G r s hu,weight,ite_eq_right hs]
rfl
Β· simp [hu]
rw [hz]
exact summable_zero
lemma tsum_weighted_cluster (hl : G.LocallyFinite) (r s : β„•) (Ο‰ : Set E) (x : V) :
(βˆ‘' u, if u ∈ G.cluster Ο‰ x then weight G r s Ο‰ u else 0) = clusterWeight G r s Ο‰ x := by
by_cases hs : small G r Ο‰ x
Β· have hC := small_finite G hl hs
have hpos : 0 < size G Ο‰ x := (Set.ncard_pos hC).mpr ⟨x,SimpleGraph.Reachable.refl x⟩
rw [tsum_eq_sum (s := hC.toFinset) (fun u hu => ite_eq_right (fun h => hu (hC.mem_toFinset.mpr h)))]
calc
_ = βˆ‘ _u ∈ hC.toFinset, mass G s Ο‰ x := by
apply Finset.sum_congr rfl
intro u hu
rw [ite_eq_left (hC.mem_toFinset.mp hu),← weight_reachable G r s (hC.mem_toFinset.mp hu),weight,ite_eq_left hs]
_ = _ := by
rw [Finset.sum_const,nsmul_eq_mul,← Set.ncard_eq_toFinset_card _ hC]
change (size G Ο‰ x : ℝ) * (cappedMass s (size G Ο‰ x) / size G Ο‰ x) = _
rw [mul_div_cancelβ‚€ _ (Nat.cast_ne_zero.mpr hpos.ne')]
exact (ite_eq_left hs).symm
Β· rw [clusterWeight,ite_eq_right hs]
calc
_ = βˆ‘' _u : V, (0:ℝ) := by
apply tsum_congr
intro u
by_cases hu : u ∈ G.cluster Ο‰ x
Β· rw [ite_eq_left hu,← weight_reachable G r s hu,weight,ite_eq_right hs]
Β· rw [ite_eq_right hu]
_ = 0 := tsum_zero
lemma transport_sum_out (r s : β„•) (p : ℝ) (Ο‰ : Set E) (u : V) :
(βˆ‘' e, transport G r s p Ο‰ u e) = if small G r Ο‰ u then rootDiscrepancy G s p Ο‰ u else 0 := by
have hf : (fun e => transport G r s p Ο‰ u e) =
(fun e => weight G r s Ο‰ u * (if e ∈ G.incidentEdges (G.cluster Ο‰ u) then coefficient p Ο‰ e else 0)) := by
funext e
unfold transport
split_ifs <;> simp
rw [hf,tsum_mul_left]
unfold weight rootDiscrepancy rootSum
split_ifs <;> simp
lemma transport_sum_in (hl : G.LocallyFinite) (r s : β„•) (p : ℝ) (Ο‰ : Set E) (e : E) :
(βˆ‘' u, transport G r s p Ο‰ u e) = coefficient p Ο‰ e * truncatedEdgeMass G r s Ο‰ e := by
let x := (G.ends e).out.1
let y := (G.ends e).out.2
have hi (u : V) : e ∈ G.incidentEdges (G.cluster Ο‰ u) ↔
u ∈ G.cluster Ο‰ x βˆͺ G.cluster Ο‰ y := by
exact Set.ext_iff.mp (incidentRoots G Ο‰ e) u
by_cases hxy : (G.openGraph Ο‰).Reachable x y
Β· have heq := G.cluster_eq_of_reachable hxy
have hf : (fun u => transport G r s p Ο‰ u e) =
fun u => coefficient p Ο‰ e * (if u ∈ G.cluster Ο‰ x then weight G r s Ο‰ u else 0) := by
funext u
unfold transport
rw [hi,← heq,Set.union_self]
split_ifs <;> ring
rw [hf,tsum_mul_left,tsum_weighted_cluster G hl]
simp only [truncatedEdgeMass,show (G.openGraph Ο‰).Reachable (G.ends e).out.1 (G.ends e).out.2 from hxy,ite_true,add_zero]
rfl
Β· have hd := G.cluster_disjoint_of_not_reachable hxy
have hf : (fun u => transport G r s p Ο‰ u e) = fun u => coefficient p Ο‰ e *
((if u ∈ G.cluster Ο‰ x then weight G r s Ο‰ u else 0) +
(if u ∈ G.cluster Ο‰ y then weight G r s Ο‰ u else 0)) := by
funext u
unfold transport
rw [hi]
by_cases hx : u ∈ G.cluster Ο‰ x
Β· have hy : u βˆ‰ G.cluster Ο‰ y := fun hy => Set.disjoint_left.mp hd hx hy
simp only [hx,hy,Set.mem_union,true_or,ite_true,ite_false,add_zero]
ring
Β· by_cases hy : u ∈ G.cluster Ο‰ y
Β· simp only [hx,hy,Set.mem_union,or_true,ite_true,ite_false,zero_add]; ring
Β· simp only [hx,hy,Set.mem_union,or_false,ite_false,add_zero,mul_zero]
rw [hf,tsum_mul_left,(weighted_cluster_summable G hl r s Ο‰ x).tsum_add
(weighted_cluster_summable G hl r s Ο‰ y),tsum_weighted_cluster G hl,tsum_weighted_cluster G hl]
simp only [truncatedEdgeMass,show Β¬(G.openGraph Ο‰).Reachable (G.ends e).out.1 (G.ends e).out.2 from hxy,ite_false]
rfl
lemma truncatedEdgeMass_nonneg (r s : β„•) (Ο‰ : Set E) (e : E) :
0 ≀ truncatedEdgeMass G r s Ο‰ e := by
unfold truncatedEdgeMass
split_ifs
Β· simpa using clusterWeight_nonneg G r s Ο‰ (G.ends e).out.1
Β· exact add_nonneg (clusterWeight_nonneg G r s Ο‰ _) (clusterWeight_nonneg G r s Ο‰ _)
lemma truncatedEdgeMass_le (r s : β„•) (Ο‰ : Set E) (e : E) :
truncatedEdgeMass G r s Ο‰ e ≀ edgeMass G s Ο‰ e := by
unfold truncatedEdgeMass edgeMass
split_ifs
Β· simpa using clusterWeight_le G r s Ο‰ (G.ends e).out.1
Β· exact add_le_add (clusterWeight_le G r s Ο‰ _) (clusterWeight_le G r s Ο‰ _)
lemma transport_sum_in_bound (hl : G.LocallyFinite) (r s : β„•) {p : ℝ}
(hp : p ∈ Ioo 0 1) (Ο‰ : Set E) (e : E) :
|βˆ‘' u, transport G r s p Ο‰ u e| ≀ 2/p := by
rw [transport_sum_in G hl,abs_mul,abs_of_nonneg (truncatedEdgeMass_nonneg G r s Ο‰ e)]
calc
_ ≀ (1/p)*2 := mul_le_mul (coefficient_abs_le hp Ο‰ e)
((truncatedEdgeMass_le G r s Ο‰ e).trans (edgeMass_le_two G s Ο‰ e))
(truncatedEdgeMass_nonneg G r s Ο‰ e) (div_nonneg zero_le_one hp.1.le)
_ = _ := by ring
end CriticalPercolation.FiniteClusters
end
end
end OAI