Download data/lean/OAI/Probability/CriticalPercolation/Modular/ClusterMassInfinite.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 7.54 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CriticalPercolation/Modular/ClusterMassInfinite.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/CriticalPercolation/Modular/ClusterMassInfinite.lean
-
curl -L -o ClusterMassInfinite.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CriticalPercolation/Modular/ClusterMassInfinite.lean
7.54 kB
| import Mathlib | |
| import OAI.Probability.CriticalPercolation.ProductMeasure.LevelContactMeasurability | |
| import OAI.Probability.CriticalPercolation.Modular.CappedDiscrepancy | |
| 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 size (Ο : Set E) (v : V) : β := (G.cluster Ο v).ncard | |
| def mass (s : β) (Ο : Set E) (v : V) : β := cappedMass s (size G Ο v) / size G Ο v | |
| def coefficient (p : β) (Ο : Set E) (e : E) : β := if e β Ο then -(1-p)/p else 1 | |
| def rootSum (p : β) (Ο : Set E) (v : V) : β := | |
| β' e, if e β G.incidentEdges (G.cluster Ο v) then coefficient p Ο e else 0 | |
| def rootDiscrepancy (s : β) (p : β) (Ο : Set E) (v : V) : β := | |
| mass G s Ο v * rootSum G p Ο v | |
| def rootAbsolute (s : β) (p : β) (Ο : Set E) (v : V) : β := | |
| mass G s Ο v * |rootSum G p Ο v| | |
| def edgeMass (s : β) (Ο : Set E) (e : E) : β := | |
| cappedMass s (size G Ο (G.ends e).out.1) + | |
| if (G.openGraph Ο).Reachable (G.ends e).out.1 (G.ends e).out.2 then 0 | |
| else cappedMass s (size G Ο (G.ends e).out.2) | |
| def edgeDiscrepancy (s : β) (p : β) (Ο : Set E) (e : E) : β := | |
| coefficient p Ο e * edgeMass G s Ο e | |
| lemma size_eq_of_reachable {Ο : Set E} {u v : V} | |
| (h : (G.openGraph Ο).Reachable u v) : size G Ο u = size G Ο v := by | |
| unfold size | |
| rw [G.cluster_eq_of_reachable h] | |
| lemma mass_eq_of_reachable (s : β) {Ο : Set E} {u v : V} | |
| (h : (G.openGraph Ο).Reachable u v) : mass G s Ο u = mass G s Ο v := by | |
| unfold mass | |
| rw [size_eq_of_reachable G h] | |
| lemma mass_nonneg (s : β) (Ο : Set E) (v : V) : 0 β€ mass G s Ο v := | |
| div_nonneg (cappedMass_nonneg _ _) (Nat.cast_nonneg _) | |
| lemma cappedMass_le_one (s n : β) : cappedMass s n β€ 1 := min_le_right _ _ | |
| lemma mass_mul_size_le_one (s : β) (Ο : Set E) (v : V) : | |
| mass G s Ο v * size G Ο v β€ 1 := by | |
| by_cases h : size G Ο v = 0 | |
| Β· simp [mass,h] | |
| Β· rw [mass,div_mul_cancelβ _ (Nat.cast_ne_zero.mpr h)] | |
| exact cappedMass_le_one _ _ | |
| lemma mass_eq_zero_of_infinite (s : β) {Ο : Set E} {v : V} | |
| (h : (G.cluster Ο v).Infinite) : mass G s Ο v = 0 := by | |
| simp [mass,size,h.ncard] | |
| lemma coefficient_abs_le {p : β} (hp : p β Ioo (0:β) 1) (Ο : Set E) (e : E) : | |
| |coefficient p Ο e| β€ 1/p := by | |
| unfold coefficient | |
| split_ifs | |
| Β· rw [abs_div,abs_neg,abs_of_nonneg (sub_nonneg.mpr hp.2.le),abs_of_pos hp.1] | |
| exact div_le_div_of_nonneg_right (by linarith [hp.1]) hp.1.le | |
| Β· rw [abs_one] | |
| exact (le_div_iffβ hp.1).mpr (by linarith [hp.2]) | |
| lemma rootAbsolute_nonneg (s : β) (p : β) (Ο : Set E) (v : V) : | |
| 0 β€ rootAbsolute G s p Ο v := mul_nonneg (mass_nonneg G s Ο v) (abs_nonneg _) | |
| lemma abs_rootDiscrepancy (s : β) (p : β) (Ο : Set E) (v : V) : | |
| |rootDiscrepancy G s p Ο v| = rootAbsolute G s p Ο v := by | |
| rw [rootDiscrepancy,abs_mul,abs_of_nonneg (mass_nonneg G s Ο v)] | |
| rfl | |
| lemma rootAbsolute_bound (hl : G.LocallyFinite) (D : β) | |
| (hD : β v, (G.incidentEdges {v}).ncard β€ D) | |
| (s : β) {p : β} (hp : p β Ioo (0:β) 1) (Ο : Set E) (v : V) : | |
| rootAbsolute G s p Ο v β€ D/p := by | |
| by_cases hC : (G.cluster Ο v).Finite | |
| Β· have hI := G.finite_incident hl hC | |
| have hsum : |rootSum G p Ο v| β€ (G.incidentEdges (G.cluster Ο v)).ncard / p := by | |
| rw [rootSum,tsum_eq_sum (s := hI.toFinset) (fun e he => by | |
| simp only [hI.mem_toFinset] at he | |
| simp only [he,ite_false])] | |
| calc | |
| _ β€ β eβhI.toFinset, |if e β G.incidentEdges (G.cluster Ο v) then coefficient p Ο e else 0| := | |
| Finset.abs_sum_le_sum_abs _ _ | |
| _ = β eβhI.toFinset, |coefficient p Ο e| := by | |
| apply Finset.sum_congr rfl | |
| intro e he | |
| rw [ite_eq_left (hI.mem_toFinset.mp he)] | |
| _ β€ β _eβhI.toFinset, 1/p := Finset.sum_le_sum (fun e _ => coefficient_abs_le hp Ο e) | |
| _ = _ := by rw [Finset.sum_const,nsmul_eq_mul,Set.ncard_eq_toFinset_card _ hI]; ring | |
| calc | |
| _ β€ mass G s Ο v * ((G.incidentEdges (G.cluster Ο v)).ncard / p) := | |
| mul_le_mul_of_nonneg_left hsum (mass_nonneg G s Ο v) | |
| _ β€ mass G s Ο v * ((size G Ο v : β)*D/p) := | |
| mul_le_mul_of_nonneg_left (div_le_div_of_nonneg_right | |
| (by exact_mod_cast G.incident_ncard_le _ hC D (fun w _ => hD w)) hp.1.le) | |
| (mass_nonneg G s Ο v) | |
| _ = (mass G s Ο v * size G Ο v)*(D/p) := by ring | |
| _ β€ 1*(D/p) := mul_le_mul_of_nonneg_right (mass_mul_size_le_one G s Ο v) (div_nonneg (Nat.cast_nonneg _) hp.1.le) | |
| _ = _ := one_mul _ | |
| Β· rw [rootAbsolute,mass_eq_zero_of_infinite G s hC,zero_mul] | |
| exact div_nonneg (Nat.cast_nonneg _) hp.1.le | |
| lemma edgeMass_nonneg (s : β) (Ο : Set E) (e : E) : 0 β€ edgeMass G s Ο e := by | |
| unfold edgeMass | |
| split_ifs | |
| Β· simpa using cappedMass_nonneg s (size G Ο (G.ends e).out.1) | |
| Β· exact add_nonneg (cappedMass_nonneg _ _) (cappedMass_nonneg _ _) | |
| lemma edgeMass_le_two (s : β) (Ο : Set E) (e : E) : edgeMass G s Ο e β€ 2 := by | |
| unfold edgeMass | |
| have h1 := cappedMass_le_one s (size G Ο (G.ends e).out.1) | |
| have h2 := cappedMass_le_one s (size G Ο (G.ends e).out.2) | |
| split_ifs <;> linarith | |
| lemma edgeDiscrepancy_abs_le (s : β) {p : β} (hp : p β Ioo (0:β) 1) | |
| (Ο : Set E) (e : E) : |edgeDiscrepancy G s p Ο e| β€ 2/p := by | |
| rw [edgeDiscrepancy,abs_mul,abs_of_nonneg (edgeMass_nonneg G s Ο e)] | |
| calc | |
| _ β€ (1/p)*2 := mul_le_mul (coefficient_abs_le hp Ο e) (edgeMass_le_two G s Ο e) | |
| (edgeMass_nonneg G s Ο e) (div_nonneg zero_le_one hp.1.le) | |
| _ = _ := by ring | |
| variable [Countable V] [Countable E] | |
| lemma measurable_size (v : V) : Measurable (fun Ο => size G Ο v) := | |
| measurable_ncard.comp (G.measurable_cluster v) | |
| lemma measurable_mass (s : β) (v : V) : Measurable (fun Ο => mass G s Ο v) := by | |
| exact ((measurable_of_countable (fun n : β => cappedMass s n / (n:β))).comp | |
| (measurable_size G v)) | |
| omit [Countable E] in | |
| lemma measurable_coefficient (p : β) (e : E) : Measurable (fun Ο => coefficient p Ο e) := | |
| measurable_const.ite (measurable_set_mem e).setOf measurable_const | |
| lemma measurable_incidentCluster (v : V) (e : E) : | |
| MeasurableSet {Ο : Set E | e β G.incidentEdges (G.cluster Ο v)} := by | |
| apply (Measurable.exists (fun w => (G.measurable_reachable v w).and measurable_const)).setOf | |
| lemma measurable_rootSum (p : β) (v : V) : Measurable (fun Ο => rootSum G p Ο v) := by | |
| exact Measurable.tsum (fun e => (measurable_coefficient p e).ite | |
| (measurable_incidentCluster G v e) measurable_const) | |
| lemma measurable_rootAbsolute (s : β) (p : β) (v : V) : | |
| Measurable (fun Ο => rootAbsolute G s p Ο v) := | |
| (measurable_mass G s v).mul (measurable_rootSum G p v).abs | |
| lemma measurable_rootDiscrepancy (s : β) (p : β) (v : V) : | |
| Measurable (fun Ο => rootDiscrepancy G s p Ο v) := | |
| (measurable_mass G s v).mul (measurable_rootSum G p v) | |
| lemma measurable_edgeMass (s : β) (e : E) : Measurable (fun Ο => edgeMass G s Ο e) := by | |
| have hm (v : V) := (measurable_of_countable (cappedMass s)).comp (measurable_size G v) | |
| exact (hm _).add (measurable_const.ite (G.measurable_reachable _ _).setOf (hm _)) | |
| lemma measurable_edgeDiscrepancy (s : β) (p : β) (e : E) : | |
| Measurable (fun Ο => edgeDiscrepancy G s p Ο e) := | |
| (measurable_coefficient p e).mul (measurable_edgeMass G s e) | |
| end CriticalPercolation.FiniteClusters | |
| end | |
| end | |
| end OAI | |