Download data/lean/OAI/Probability/CriticalPercolation/Modular/HeavyDiscrepancy.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 7.69 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CriticalPercolation/Modular/HeavyDiscrepancy.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/CriticalPercolation/Modular/HeavyDiscrepancy.lean
-
curl -L -o HeavyDiscrepancy.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CriticalPercolation/Modular/HeavyDiscrepancy.lean
7.69 kB
| import Mathlib | |
| import OAI.Probability.CriticalPercolation.Modular.NormalizedDiscrepancy | |
| import OAI.Probability.CriticalPercolation.Modular.DiscrepancyTail | |
| import OAI.Probability.CriticalPercolation.Modular.HeavyThinning | |
| import OAI.Probability.CriticalPercolation.ProductMeasure.MonotoneBernoulli | |
| namespace OAI | |
| section | |
| noncomputable section | |
| open Set MeasureTheory Filter | |
| open scoped Classical ENNReal Topology BigOperators | |
| namespace CriticalPercolation | |
| lemma ennreal_tendsto_zero_of_uniform_tail (f g : β β ββ₯0β) (c b : β β ββ₯0β) | |
| (hc : β N, c Nβ β) (hg : Tendsto g atTop (π 0)) (hb : Tendsto b atTop (π 0)) | |
| (hle : β N n, f nβ€c N*g n+b N) : Tendsto f atTop (π 0) := by | |
| apply ENNReal.tendsto_nhds_zero.mpr | |
| intro Ξ΅ hΞ΅ | |
| have hh := ENNReal.half_pos hΞ΅.ne' | |
| obtain β¨N,hNβ© := (ENNReal.tendsto_nhds_zero.mp hb (Ξ΅/2) hh).exists | |
| have ht : Tendsto (fun n => c N*g n) atTop (π 0) := by | |
| simpa only [mul_zero] using ENNReal.Tendsto.const_mul hg (Or.inr (hc N)) | |
| filter_upwards [ENNReal.tendsto_nhds_zero.mp ht (Ξ΅/2) hh] with n hn | |
| exact (hle N n).trans ((add_le_add hn hN).trans_eq (ENNReal.add_halves Ξ΅)) | |
| namespace BondGraph | |
| open BernoulliProduct | |
| variable {V E : Type*} (G : BondGraph V E) [Countable V] [Countable E] | |
| omit [Countable V] [Countable E] in | |
| lemma clusterPeakRatio_ne_zero_of_mass_ne_top (hc : G.fullGraph.Connected) (hl : G.LocallyFinite) | |
| (Ο : Set E) (x : V) (hm : G.modularMass x (G.cluster Ο x)β β) : | |
| G.clusterPeakRatio Ο xβ 0 := by | |
| obtain β¨y,hyβ© := G.clusterPeaks_nonempty_of_mass_ne_top hc hl Ο x hm | |
| rw [G.clusterPeakRatio_eq_inv_mass hc hl Ο x y hm hy] | |
| exact ENNReal.inv_ne_zero.mpr (fun he => hm ((G.modularMass_eq_top_change_base hc hl x y _).mpr he)) | |
| omit [Countable V] [Countable E] in | |
| lemma normalizedDiscrepancy_le_ratio_add_tail (hc : G.fullGraph.Connected) (hl : G.LocallyFinite) | |
| (D K : β) (hD : β v, (G.incidentEdges {v}).ncardβ€D) | |
| (hK : β v, (G.vertexBall v 1).ncardβ€K) (p : unitInterval) (T : ββ₯0β) | |
| (Ο : Set E) (x : V) : | |
| G.normalizedAbsoluteDiscrepancy p Ο x β€ | |
| (D*(2*K) : β)*T*G.clusterPeakRatio Ο x + G.discrepancyVolumeTail p T Ο x := by | |
| by_cases ht : Tβ€G.normalizedClusterVolume Ο x | |
| Β· rw [discrepancyVolumeTail,ite_eq_left ht] | |
| exact le_add_left le_rfl | |
| Β· by_cases hm : G.modularMass x (G.cluster Ο x)=β | |
| Β· simp only [normalizedAbsoluteDiscrepancy,hm,ENNReal.div_top,zero_le] | |
| Β· have hr := G.clusterPeakRatio_ne_zero_of_mass_ne_top hc hl Ο x hm | |
| have hr' := ne_top_of_le_ne_top ENNReal.one_ne_top (G.clusterPeakRatio_le_one hc hl Ο x) | |
| have hv : G.normalizedClusterVolume Ο x*G.clusterPeakRatio Ο x=1 := by | |
| rw [normalizedClusterVolume,ite_eq_right hr,ENNReal.inv_mul_cancel hr hr'] | |
| have hone : 1β€T*G.clusterPeakRatio Ο x := by | |
| rw [βhv] | |
| exact mul_le_mul_left (le_of_not_ge ht) _ | |
| calc _ β€ ((D*(2*K) : β) : ββ₯0β) := G.normalizedAbsoluteDiscrepancy_le hc hl D K hD hK p p.property Ο x | |
| _ β€ (D*(2*K) : β)*T*G.clusterPeakRatio Ο x := by | |
| simpa only [mul_one,mul_assoc] using mul_le_mul_right hone ((D*(2*K) : β) : ββ₯0β) | |
| _ β€ _ := le_add_right le_rfl | |
| lemma expected_heavy_normalizedDiscrepancy_bound | |
| (hc : G.fullGraph.Connected) (hl : G.LocallyFinite) (hq : G.QuasiTransitive) | |
| (D K : β) (hD : β v, (G.incidentEdges {v}).ncardβ€D) | |
| (hK : β v, (G.vertexBall v 1).ncardβ€K) (p q : unitInterval) (N : β) | |
| (x : V) (hx : xβ(G.orbitRepresentatives hq).roots) : | |
| (β«β» u, if G.heavyFlag p u x then G.normalizedAbsoluteDiscrepancy q (atParameter q u) x else 0 βmarkLaw) β€ | |
| ((D*(2*K) : β)*ENNReal.ofReal ((16:β)^N)) * | |
| (β«β» u, if G.heavyFlag p u x then G.clusterPeakRatio (atParameter q u) x else 0 βmarkLaw) + | |
| (G.orbitRepresentatives hq).roots.card * | |
| ENNReal.ofReal (5*((D*(2*K)^2 : β)*16)^2*((G.orbitRepresentatives hq).roots.card : β)^3+1)* | |
| (ENNReal.ofReal (1/2:β))^N*2 := by | |
| let C : ββ₯0β := (D*(2*K) : β)*ENNReal.ofReal ((16:β)^N) | |
| let r := fun u => if G.heavyFlag p u x then G.clusterPeakRatio (atParameter q u) x else 0 | |
| have hm : Measurable r := ((G.measurable_clusterPeakRatio x).comp (measurable_atParameter q)).ite | |
| (G.measurable_heavyFlag p x).setOf measurable_const | |
| calc | |
| _ β€ β«β» u, C*r u+G.discrepancyVolumeTail q (ENNReal.ofReal ((16:β)^N)) (atParameter q u) x βmarkLaw := by | |
| apply lintegral_mono | |
| intro u | |
| by_cases h : G.heavyFlag p u x | |
| Β· simpa only [h,ite_true,r,C] using G.normalizedDiscrepancy_le_ratio_add_tail hc hl D K hD hK q | |
| (ENNReal.ofReal ((16:β)^N)) (atParameter q u) x | |
| Β· simp only [h,ite_false,zero_le] | |
| _ = C*(β«β» u, r u βmarkLaw) + (β«β» Ο, G.discrepancyVolumeTail q (ENNReal.ofReal ((16:β)^N)) Ο x βG.law q) := by | |
| rw [lintegral_add_left (show Measurable (fun u => C*r u) from measurable_const.mul hm), | |
| lintegral_const_mul'' C hm.aemeasurable] | |
| congr 1 | |
| rw [show G.law q=(markLaw (E := E)).map (atParameter q) from by simpa only [BondGraph.law, BernoulliProduct.law_const] using (markLaw_map_atParameter (E := E) q).symm, | |
| lintegral_map (G.measurable_discrepancyVolumeTail q _ x) (measurable_atParameter q)] | |
| _ β€ _ := add_le_add le_rfl (G.expected_discrepancyTail_bound hc hl hq D K hD hK q N x hx) | |
| theorem tendsto_expected_heavy_normalizedDiscrepancy | |
| (hc : G.fullGraph.Connected) (hl : G.LocallyFinite) (hq : G.QuasiTransitive) | |
| (D K : β) (hD : β v, (G.incidentEdges {v}).ncardβ€D) | |
| (hK : β v, (G.vertexBall v 1).ncardβ€K) | |
| (p : unitInterval) (q : β β unitInterval) (hmono : Monotone q) | |
| (hqp : β n, q nβ€p) (hlim : Tendsto q atTop (π p)) | |
| (x : V) (hx : xβ(G.orbitRepresentatives hq).roots) : | |
| Tendsto (fun n => β«β» u, if G.heavyFlag p u x then | |
| G.normalizedAbsoluteDiscrepancy (q n) (atParameter (q n) u) x else 0 βmarkLaw) atTop (π 0) := by | |
| let r := fun n => β«β» u, if G.heavyFlag p u x then G.clusterPeakRatio (atParameter (q n) u) x else 0 βmarkLaw | |
| have hr : Tendsto r atTop (π 0) := by | |
| apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds | |
| (G.tendsto_sum_expected_heavy_clusterPeakRatio hc hl hq p q hmono hqp hlim) | |
| Β· exact fun _ => zero_le | |
| Β· intro n | |
| exact Finset.single_le_sum (f := fun y => β«β» u, | |
| if G.heavyFlag p u y then G.clusterPeakRatio (atParameter (q n) u) y else 0 βmarkLaw) | |
| (fun _ _ => zero_le) hx | |
| apply ennreal_tendsto_zero_of_uniform_tail _ r | |
| (fun N => (D*(2*K) : β)*ENNReal.ofReal ((16:β)^N)) | |
| (fun N => (G.orbitRepresentatives hq).roots.card * | |
| ENNReal.ofReal (5*((D*(2*K)^2 : β)*16)^2*((G.orbitRepresentatives hq).roots.card : β)^3+1)* | |
| (ENNReal.ofReal (1/2:β))^N*2) | |
| Β· intro N | |
| exact ENNReal.mul_ne_top (ENNReal.natCast_ne_top _) ENNReal.ofReal_ne_top | |
| Β· exact hr | |
| Β· let A : ββ₯0β := (G.orbitRepresentatives hq).roots.card * | |
| ENNReal.ofReal (5*((D*(2*K)^2 : β)*16)^2*((G.orbitRepresentatives hq).roots.card : β)^3+1) | |
| have hA : Aβ β := ENNReal.mul_ne_top (ENNReal.natCast_ne_top _) ENNReal.ofReal_ne_top | |
| have ht := ENNReal.Tendsto.const_mul (a := A) (ENNReal.tendsto_pow_atTop_nhds_zero_of_lt_one | |
| (show ENNReal.ofReal (1/2:β)<1 by norm_num)) (Or.inr hA) | |
| simpa only [mul_zero,zero_mul] using ENNReal.Tendsto.mul_const ht (Or.inr (by norm_num : (2:ββ₯0β)β β)) | |
| Β· intro N n | |
| exact G.expected_heavy_normalizedDiscrepancy_bound hc hl hq D K hD hK p (q n) N x hx | |
| end BondGraph | |
| end CriticalPercolation | |
| end | |
| end | |
| end OAI | |