Stat.Concentration.PoissonSelfNormalized
Self-normalized Poisson concentration: measurable deviation scales, explicit Chernoff tails, scalar weighted moments, finite independent-coordinate aggregation, and normalized exposure-scale corollaries.
Basic 7 core · 7 supporting This module defines the deviation, random radius, deterministic local scale, and bad event used by the quantitative Poisson moment bounds. ★ integrable_radius
Self-normalized Poisson deviations: basic definitions
This module defines the deviation, random radius, deterministic local scale,
and bad event used by the quantitative Poisson moment bounds. The Poisson
parameter is an NNReal, so nonnegativity is encoded in its type. The logarithmic level
and the multiplier are unrestricted reals: the definitions here and in the companion modules
are literal formulas, and a negative level makes the square roots zero by convention, so radii,
scores and bad events are meaningful only in the regime the theorems assume (level at least one,
positive multiplier).
Given a nonnegative mean and a natural-valued count, the absolute deviation of the count from its mean is their absolute difference.
Definition (Lean source)
Given a logarithmic level and a natural-valued count, the self-normalizing random radius is the square root of count times level, plus the level.
Definition (Lean source)
Given a nonnegative Poisson mean and a logarithmic level, the deterministic local scale is the square root of mean times level, plus the level.
Definition (Lean source)
Given a multiplier and logarithmic level and a nonnegative Poisson mean, the self-normalized bad event contains counts whose absolute deviation exceeds one quarter of the multiplier times their random radius.
The universal self-normalization multiplier is 1024.
Definition (Lean source)
The pre-aggregation exponential decay rate is 40.
Definition (Lean source)
Under a Poisson law with a nonnegative mean, the self-normalizing radius at a nonnegative logarithmic level is integrable.
Formal statement
Proof (Lean source)
7 supporting declarations (lemmas, instances)
-
universalH_postheorem — The universal self-normalization multiplier is strictly positive.conclusion0 < universalHProof (Lean source)
theorem universalH_pos : 0 < universalH := by norm_num [universalH] -
forty_le_scalarDecaytheorem — The scalar exponential decay rate is at least forty, and hence is positive.conclusion(40 : ℝ) ≤ scalarDecayProof (Lean source)
theorem forty_le_scalarDecay : (40 : ℝ) ≤ scalarDecay := by norm_num [scalarDecay] -
measurable_deviationtheorem — The absolute-deviation function for a nonnegative mean is measurable.Proof (Lean source)
@[fun_prop] theorem measurable_deviation (lambda : ℝ≥0) : Measurable (deviation lambda) := by fun_prop -
measurable_radiustheorem — The self-normalizing radius at a fixed logarithmic level is measurable.Proof (Lean source)
-
measurableSet_badEventtheorem — Given a multiplier and logarithmic level and a nonnegative Poisson mean, the self-normalized bad event is measurable.Proof (Lean source)
theorem measurableSet_badEvent (H L : ℝ) (lambda : ℝ≥0) : MeasurableSet (badEvent H L lambda) := by exact measurableSet_lt (measurable_const.mul (measurable_radius L)) (measurable_deviation lambda) -
integrable_deviationtheorem — The absolute deviation under the Poisson law with a nonnegative mean is integrable.Proof (Lean source)
theorem integrable_deviation (lambda : ℝ≥0) : Integrable (deviation lambda) (poissonMeasure lambda) := by change Integrable (fun w : ℕ => |(w : ℝ) - (lambda : ℝ)|) _ simpa only [Pi.sub_apply, Real.norm_eq_abs] using ((integrable_natCast_poisson lambda).sub (integrable_const _)).norm -
poissonMeasure_zero_aetheorem — Under a zero-mean Poisson law, the count is almost surely zero.conclusion(fun w : ℕ => w) =ᵐ[poissonMeasure 0] 0Proof (Lean source)
theorem poissonMeasure_zero_ae : (fun w : ℕ => w) =ᵐ[poissonMeasure 0] 0 := by rw [EventuallyEq, ae_iff] change poissonMeasure 0 {a : ℕ | a ≠ 0} = 0 have hcomp : poissonMeasure 0 ({0}ᶜ) = 0 := by rw [measure_compl (MeasurableSet.singleton 0) (measure_ne_top _ _), poissonMeasure_singleton] norm_num rw [show {a : ℕ | a ≠ 0} = {0}ᶜ by ext; simp] exact hcomp
Product 4 core · 2 supporting This module aggregates self-normalized Poisson scores without losing the local scale determined by the sum of the coordinate means. ★ independent_poisson_badAny_moment
Finite independent-product aggregation
This module aggregates self-normalized Poisson scores without losing the local scale determined by the sum of the coordinate means. Constants may depend on the fixed cardinality cap and moment order, but not on the means or level.
Given a finite coordinate index and sample space, natural-valued coordinate counts, a multiplier and logarithmic level, and nonnegative coordinate means, the aggregate bad event occurs when at least one coordinate lies in its self-normalized bad event.
Given a finite coordinate index and sample space, natural-valued coordinate counts, a multiplier and logarithmic level, nonnegative coordinate means, and a sample point, the aggregate score is the sum of all coordinate deviation-plus-radius scores.
Definition (Lean source)
Given a coordinate-cardinality cap and a moment order, the finite-product moment constant is a fixed power of ten depending only on those two quantities.
Definition (Lean source)
On a measurable sample space with a finite coordinate index, let a probability law carry natural-valued coordinate counts with nonnegative coordinate means. If the counts are measurable, each count has its stated Poisson law, and the counts are mutually independent, then under a fixed coordinate-cardinality cap, for moment order one, two, or four and a logarithmic level of at least one, the aggregate score moment on the union of bad coordinates decays exponentially while retaining the local scale determined by the sum of the means.
Formal statement
Proof (Lean source)
2 supporting declarations (lemmas, instances)
-
productMomentConstant_postheorem — For a coordinate-cardinality cap and moment order, the finite-product moment constant is strictly positive.Proof (Lean source)
theorem productMomentConstant_pos (r t : ℕ) : 0 < productMomentConstant r t := by exact pow_pos (by norm_num) _ -
independent_poisson_badAny_moment_fourtheorem — On a measurable sample space, let a probability law carry four natural-valued coordinate counts with nonnegative coordinate means. If the counts are measurable, each count has its stated Poisson law, and the counts are mutually independent, then for moment order one, two, or four and a logarithmic level of at least one, the four-coordinate aggregate score moment on the union of bad coordinates has the corresponding exponentially decaying local scale bound.hypothesesΩ :Type*μ :W :Fin 4 → Ω → ℕlambda :Fin 4 → ℝ≥0hWmeas :∀ i, Measurable (W i)hWlaw :∀ i, HasLaw (W i) (poissonMeasure (lambda i)) μhWindep :iIndepFun W μt :ℕht :t = 1 ∨ t = 2 ∨ t = 4L :ℝhL :1 ≤ Lconclusion∫ ω, (badAny W universalH L lambda).indicator (fun ω => (aggregateScore W universalH L lambda ω) ^ t) ω ∂μProof (Lean source)
-- Apply `independent_poisson_badAny_moment` with `r = 4`; the cardinality side -- condition is `Fintype.card_fin 4`. theorem independent_poisson_badAny_moment_four {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (W : Fin 4 → Ω → ℕ) (lambda : Fin 4 → ℝ≥0) (hWmeas : ∀ i, Measurable (W i)) (hWlaw : ∀ i, HasLaw (W i) (poissonMeasure (lambda i)) μ) (hWindep : iIndepFun W μ) {t : ℕ} (ht : t = 1 ∨ t = 2 ∨ t = 4) {L : ℝ} (hL : 1 ≤ L) : ∫ ω, (badAny W universalH L lambda).indicator (fun ω => (aggregateScore W universalH L lambda ω) ^ t) ω ∂μ ≤ productMomentConstant 4 t * exp (-20 * L) * (sqrt ((∑ i, (lambda i : ℝ)) * L) + L) ^ t := by exact independent_poisson_badAny_moment μ W lambda hWmeas hWlaw hWindep (r := 4) (by simp) ht hL
Chernoff 2 core · 7 supporting This module records the exact centered moment-generating function and derives the two-sided Bernstein deviation inequality, including the zero-mean case. ★ poisson_abs_bernstein★ poisson_quarter_overflow_le_exp
Exponential moments and Bernstein tails for a Poisson count
This module records the exact centered moment-generating function and derives the two-sided Bernstein deviation inequality, including the zero-mean case. It also isolates the deterministic comparison which turns a sufficiently large self-normalized failure into a remote Bernstein-tail event.
For a Poisson law with a nonnegative mean and a nonnegative deviation level, the probability that the absolute deviation exceeds the Bernstein threshold is at most twice the exponential of minus that level, including when the mean is zero.
Formal statement
Proof (Lean source)
For a positive sample size, a Poisson count with mean one quarter of that size overshoots the sample size with probability at most exp (-n/8).
Formal statement
Proof (Lean source)
7 supporting declarations (lemmas, instances)
-
integrable_exp_centered_poissontheorem — Under a Poisson law with a nonnegative mean, the exponential of its centered count at a real tilt is integrable.hypotheseslambda :ℝ≥0theta :ℝconclusionProof (Lean source)
theorem integrable_exp_centered_poisson (lambda : ℝ≥0) (theta : ℝ) : Integrable (fun w : ℕ => exp (theta * ((w : ℝ) - (lambda : ℝ)))) (poissonMeasure lambda) := by rw [integrable_poissonMeasure_iff] have hs := Real.summable_pow_div_factorial ((lambda : ℝ) * exp theta) apply (hs.mul_left (exp (-(lambda : ℝ)) * exp (-(theta * (lambda : ℝ))))).congr intro w rw [Real.norm_eq_abs, abs_of_pos (Real.exp_pos _)] rw [show exp (theta * ((w : ℝ) - (lambda : ℝ))) = (exp theta) ^ w * exp (-(theta * (lambda : ℝ))) by calc exp (theta * ((w : ℝ) - (lambda : ℝ))) = exp ((w : ℝ) * theta - theta * (lambda : ℝ)) := by congr 1; ring _ = exp ((w : ℝ) * theta) / exp (theta * (lambda : ℝ)) := Real.exp_sub _ _ _ = (exp theta) ^ w * exp (-(theta * (lambda : ℝ))) := by rw [Real.exp_nat_mul, Real.exp_neg] ring] ring -
integral_exp_centered_poissontheorem — For a Poisson law with a nonnegative mean and a real tilt, the centered moment-generating function equals the exponential of the mean times the exponential remainder.hypotheseslambda :ℝ≥0theta :ℝProof (Lean source)
theorem integral_exp_centered_poisson (lambda : ℝ≥0) (theta : ℝ) : ∫ w : ℕ, exp (theta * ((w : ℝ) - (lambda : ℝ))) ∂poissonMeasure lambda = exp ((lambda : ℝ) * (exp theta - 1 - theta)) := by rw [integral_poissonMeasure] simp only [smul_eq_mul] calc ∑' w : ℕ, exp (-(lambda : ℝ)) * (lambda : ℝ) ^ w / factorial w * exp (theta * ((w : ℝ) - (lambda : ℝ))) = (exp (-(lambda : ℝ)) * exp (-(theta * (lambda : ℝ)))) * ∑' w : ℕ, (((lambda : ℝ) * exp theta) ^ w / factorial w) := by rw [← tsum_mul_left] apply tsum_congr intro w rw [show exp (theta * ((w : ℝ) - (lambda : ℝ))) = (exp theta) ^ w * exp (-(theta * (lambda : ℝ))) by calc exp (theta * ((w : ℝ) - (lambda : ℝ))) = exp ((w : ℝ) * theta - theta * (lambda : ℝ)) := by congr 1; ring _ = exp ((w : ℝ) * theta) / exp (theta * (lambda : ℝ)) := Real.exp_sub _ _ _ = (exp theta) ^ w * exp (-(theta * (lambda : ℝ))) := by rw [Real.exp_nat_mul, Real.exp_neg] ring] ring _ = (exp (-(lambda : ℝ)) * exp (-(theta * (lambda : ℝ)))) * exp ((lambda : ℝ) * exp theta) := by have hseries := (NormedSpace.expSeries_div_hasSum_exp ((lambda : ℝ) * exp theta)).tsum_eq rw [← Real.exp_eq_exp_ℝ] at hseries rw [hseries] _ = exp ((lambda : ℝ) * (exp theta - 1 - theta)) := by rw [← Real.exp_add, ← Real.exp_add] congr 1 ring -
poisson_upper_bernsteintheorem — For a Poisson law with a nonnegative mean and a nonnegative deviation level, the probability of exceeding the upper Bernstein threshold is at most the exponential of minus that level.hypotheseslambda :ℝ≥0z :ℝhz :0 ≤ zconclusionpoissonMeasure lambda {w : ℕ | (w : ℝ) - (lambda : ℝ) > sqrt (2 * (lambda : ℝ) * z) + 2 * z}Proof (Lean source)
-- Proof strategy: split `lambda = 0`; otherwise apply -- `measure_ge_le_exp_mul_mgf` to the centered count at the Bennett tilt -- `log (1 + x / lambda)`, where -- `x = sqrt (2 * lambda * z) + 2 * z`. Rewrite the MGF with -- `integral_exp_centered_poisson`, use -- `Real.le_log_one_add_of_nonneg` to lower-bound the Bennett exponent by -- `x^2 / (2 * lambda + x)`, and finish from the defining value of `x`. -- Convert the resulting `Measure.real` inequality back to `ENNReal` with -- `ENNReal.ofReal_measureReal`; the strict event is first included in the -- corresponding weak half-line. theorem poisson_upper_bernstein (lambda : ℝ≥0) {z : ℝ} (hz : 0 ≤ z) : poissonMeasure lambda {w : ℕ | (w : ℝ) - (lambda : ℝ) > sqrt (2 * (lambda : ℝ) * z) + 2 * z} ≤ ofReal (exp (-z)) := by by_cases hlambda : lambda = 0 · subst lambda have hnull : poissonMeasure 0 {w : ℕ | w ≠ 0} = 0 := by simpa only [Pi.zero_apply] using (ae_iff.mp poissonMeasure_zero_ae) have hsubset : {w : ℕ | (w : ℝ) - (0 : ℝ) > sqrt (2 * (0 : ℝ) * z) + 2 * z} ⊆ {w : ℕ | w ≠ 0} := by intro w hw hzero subst w simp only [Set.mem_ofPred_eq, cast_zero, sub_zero, mul_zero, zero_mul, Real.sqrt_zero, zero_add] at hw linarith change poissonMeasure 0 {w : ℕ | (w : ℝ) - (0 : ℝ) > sqrt (2 * (0 : ℝ) * z) + 2 * z} ≤ _ rw [measure_mono_null hsubset hnull] exact bot_le · have hlambda_pos : 0 < (lambda : ℝ) := by exact_mod_cast (pos_iff_ne_zero.mpr hlambda) let x : ℝ := sqrt (2 * (lambda : ℝ) * z) + 2 * z let theta : ℝ := log (1 + x / (lambda : ℝ)) have hx_nonneg : 0 ≤ x := by dsimp [x] positivity have htheta_nonneg : 0 ≤ theta := by dsimp [theta] exact Real.log_nonneg (by have := div_nonneg hx_nonneg hlambda_pos.le linarith) have hden_pos : 0 < 2 * (lambda : ℝ) + x := by positivity have hsqrt_sq : (sqrt (2 * (lambda : ℝ) * z)) ^ 2 = 2 * (lambda : ℝ) * z := by rw [Real.sq_sqrt] positivity have hz_frac : z ≤ x ^ 2 / (2 * (lambda : ℝ) + x) := by rw [le_div_iff₀ hden_pos] dsimp [x] nlinarith [Real.sqrt_nonneg (2 * (lambda : ℝ) * z)] have hlog : 2 * (x / (lambda : ℝ)) / (x / (lambda : ℝ) + 2) ≤ theta := by dsimp [theta] exact Real.le_log_one_add_of_nonneg (div_nonneg hx_nonneg hlambda_pos.le) have hfrac_bennett : x ^ 2 / (2 * (lambda : ℝ) + x) ≤ ((lambda : ℝ) + x) * theta - x := by have hscale : ((lambda : ℝ) + x) * (2 * (x / (lambda : ℝ)) / (x / (lambda : ℝ) + 2)) - x = x ^ 2 / (2 * (lambda : ℝ) + x) := by field_simp ring rw [← hscale] gcongr have hmgf : mgf (fun w : ℕ => (w : ℝ) - (lambda : ℝ)) (poissonMeasure lambda) theta = exp ((lambda : ℝ) * (exp theta - 1 - theta)) := by exact integral_exp_centered_poisson lambda theta have hexp_theta : exp theta = 1 + x / (lambda : ℝ) := by dsimp [theta] rw [Real.exp_log] positivity have hchernoff := measure_ge_le_exp_mul_mgf (X := fun w : ℕ => (w : ℝ) - (lambda : ℝ)) (μ := poissonMeasure lambda) x htheta_nonneg (integrable_exp_centered_poisson lambda theta) rw [hmgf] at hchernoff have hreal : (poissonMeasure lambda).real {w : ℕ | x ≤ (w : ℝ) - (lambda : ℝ)} ≤ exp (-z) := by refine hchernoff.trans ?_ rw [← Real.exp_add] apply Real.exp_le_exp.mpr rw [hexp_theta] have hidentity : -theta * x + (lambda : ℝ) * (1 + x / (lambda : ℝ) - 1 - theta) = -(((lambda : ℝ) + x) * theta - x) := by field_simp ring rw [hidentity] linarith [hz_frac.trans hfrac_bennett] have hsubset : {w : ℕ | (w : ℝ) - (lambda : ℝ) > sqrt (2 * (lambda : ℝ) * z) + 2 * z} ⊆ {w : ℕ | x ≤ (w : ℝ) - (lambda : ℝ)} := by intro w hw change (w : ℝ) - (lambda : ℝ) > x at hw change x ≤ (w : ℝ) - (lambda : ℝ) exact hw.le calc poissonMeasure lambda {w : ℕ | (w : ℝ) - (lambda : ℝ) > sqrt (2 * (lambda : ℝ) * z) + 2 * z} ≤ poissonMeasure lambda {w : ℕ | x ≤ (w : ℝ) - (lambda : ℝ)} := measure_mono hsubset _ = ofReal ((poissonMeasure lambda).real {w : ℕ | x ≤ (w : ℝ) - (lambda : ℝ)}) := by symm exact ofReal_measureReal (measure_ne_top _ _) _ ≤ ofReal (exp (-z)) := ENNReal.ofReal_le_ofReal hreal -
poisson_lower_bernsteintheorem — For a Poisson law with a nonnegative mean and a nonnegative deviation level, the probability of exceeding the lower Gaussian threshold is at most the exponential of minus that level.hypotheseslambda :ℝ≥0z :ℝhz :0 ≤ zconclusionpoissonMeasure lambda {w : ℕ | (lambda : ℝ) - (w : ℝ) > sqrt (2 * (lambda : ℝ) * z)}Proof (Lean source)
-- Proof strategy: split the zero-mean and zero-threshold cases, and note that -- the event is empty when `sqrt (2 * lambda * z) ≥ lambda`. Otherwise put -- `x = sqrt (2 * lambda * z)` and apply -- `measure_le_le_exp_mul_mgf` to the centered count at tilt `-x / lambda`. -- The elementary estimate -- `exp (-u) - 1 + u ≤ u^2 / 2` for `u ≥ 0` turns the exact MGF into -- `exp (-x^2 / (2 * lambda)) = exp (-z)`. One convenient proof of that -- estimate uses `Real.quadratic_le_exp_of_nonneg`, `Real.exp_neg`, and the -- identity `(1-u+u^2/2)*(1+u+u^2/2) = 1+u^4/4`. theorem poisson_lower_bernstein (lambda : ℝ≥0) {z : ℝ} (hz : 0 ≤ z) : poissonMeasure lambda {w : ℕ | (lambda : ℝ) - (w : ℝ) > sqrt (2 * (lambda : ℝ) * z)} ≤ ofReal (exp (-z)) := by by_cases hlambda : lambda = 0 · subst lambda have hempty : {w : ℕ | (0 : ℝ) - (w : ℝ) > sqrt (2 * (0 : ℝ) * z)} = ∅ := by ext w simp only [Set.mem_ofPred_eq, Set.mem_empty_iff_false, iff_false] intro hw have hw_nonneg : 0 ≤ (w : ℝ) := Nat.cast_nonneg w have hsqrt_nonneg := Real.sqrt_nonneg (2 * (0 : ℝ) * z) linarith change poissonMeasure 0 {w : ℕ | (0 : ℝ) - (w : ℝ) > sqrt (2 * (0 : ℝ) * z)} ≤ _ rw [hempty, measure_empty] exact bot_le · have hlambda_pos : 0 < (lambda : ℝ) := by exact_mod_cast (pos_iff_ne_zero.mpr hlambda) by_cases hz_zero : z = 0 · subst z calc poissonMeasure lambda {w : ℕ | (lambda : ℝ) - (w : ℝ) > sqrt (2 * (lambda : ℝ) * 0)} ≤ poissonMeasure lambda univ := measure_mono (Set.subset_univ _) _ = ofReal (exp (-(0 : ℝ))) := by simp · have hz_pos : 0 < z := lt_of_le_of_ne hz (Ne.symm hz_zero) let x : ℝ := sqrt (2 * (lambda : ℝ) * z) have hx_nonneg : 0 ≤ x := Real.sqrt_nonneg _ have hx_pos : 0 < x := by dsimp [x] positivity have hx_sq : x ^ 2 = 2 * (lambda : ℝ) * z := by dsimp [x] rw [Real.sq_sqrt] positivity by_cases hx_large : (lambda : ℝ) ≤ x · have hempty : {w : ℕ | (lambda : ℝ) - (w : ℝ) > sqrt (2 * (lambda : ℝ) * z)} = ∅ := by ext w simp only [Set.mem_ofPred_eq, Set.mem_empty_iff_false, iff_false] intro hw change (lambda : ℝ) - (w : ℝ) > x at hw have hw_nonneg : 0 ≤ (w : ℝ) := Nat.cast_nonneg w linarith rw [hempty, measure_empty] exact bot_le · have hx_lt : x < (lambda : ℝ) := lt_of_not_ge hx_large let u : ℝ := x / (lambda : ℝ) let theta : ℝ := -u have hu_nonneg : 0 ≤ u := div_nonneg hx_nonneg hlambda_pos.le have htheta_nonpos : theta ≤ 0 := by dsimp [theta] exact neg_nonpos.mpr hu_nonneg have hexp_quad : exp (-u) - 1 + u ≤ u ^ 2 / 2 := by have hquad := Real.quadratic_le_exp_of_nonneg hu_nonneg have hright_nonneg : 0 ≤ 1 - u + u ^ 2 / 2 := by nlinarith [sq_nonneg (u - 1)] have hprod : 1 ≤ (1 + u + u ^ 2 / 2) * (1 - u + u ^ 2 / 2) := by calc (1 : ℝ) ≤ 1 + u ^ 4 / 4 := le_add_of_nonneg_right (div_nonneg (by positivity) (by norm_num)) _ = (1 + u + u ^ 2 / 2) * (1 - u + u ^ 2 / 2) := by ring have hinv : (exp u)⁻¹ ≤ 1 - u + u ^ 2 / 2 := by rw [inv_eq_one_div, div_le_iff₀ (Real.exp_pos u)] calc (1 : ℝ) ≤ (1 + u + u ^ 2 / 2) * (1 - u + u ^ 2 / 2) := hprod _ ≤ exp u * (1 - u + u ^ 2 / 2) := mul_le_mul_of_nonneg_right hquad hright_nonneg _ = (1 - u + u ^ 2 / 2) * exp u := by ring rw [Real.exp_neg] linarith have hmgf : mgf (fun w : ℕ => (w : ℝ) - (lambda : ℝ)) (poissonMeasure lambda) theta = exp ((lambda : ℝ) * (exp theta - 1 - theta)) := by exact integral_exp_centered_poisson lambda theta have hchernoff := measure_le_le_exp_mul_mgf (X := fun w : ℕ => (w : ℝ) - (lambda : ℝ)) (μ := poissonMeasure lambda) (-x) htheta_nonpos (integrable_exp_centered_poisson lambda theta) rw [hmgf] at hchernoff have hreal : (poissonMeasure lambda).real {w : ℕ | (w : ℝ) - (lambda : ℝ) ≤ -x} ≤ exp (-z) := by refine hchernoff.trans ?_ rw [← Real.exp_add] apply Real.exp_le_exp.mpr have htheta_eq : theta = -(x / (lambda : ℝ)) := rfl rw [htheta_eq] have hquad_scaled : (lambda : ℝ) * (exp (-(x / (lambda : ℝ))) - 1 + x / (lambda : ℝ)) ≤ x ^ 2 / (2 * (lambda : ℝ)) := by have := mul_le_mul_of_nonneg_left hexp_quad hlambda_pos.le dsimp [u] at this calc (lambda : ℝ) * (exp (-(x / (lambda : ℝ))) - 1 + x / (lambda : ℝ)) ≤ (lambda : ℝ) * ((x / (lambda : ℝ)) ^ 2 / 2) := this _ = x ^ 2 / (2 * (lambda : ℝ)) := by field_simp [ne_of_gt hlambda_pos] have hidentity : -(-(x / (lambda : ℝ))) * -x + (lambda : ℝ) * (exp (-(x / (lambda : ℝ))) - 1 - (-(x / (lambda : ℝ)))) = -(x ^ 2 / (lambda : ℝ)) + (lambda : ℝ) * (exp (-(x / (lambda : ℝ))) - 1 + x / (lambda : ℝ)) := by field_simp ring rw [hidentity] have hz_identity : x ^ 2 / (2 * (lambda : ℝ)) = z := by rw [hx_sq] field_simp rw [hz_identity] at hquad_scaled have hxdiv : x ^ 2 / (lambda : ℝ) = 2 * z := by rw [hx_sq] field_simp rw [hxdiv] linarith have hsubset : {w : ℕ | (lambda : ℝ) - (w : ℝ) > sqrt (2 * (lambda : ℝ) * z)} ⊆ {w : ℕ | (w : ℝ) - (lambda : ℝ) ≤ -x} := by intro w hw simp only [Set.mem_ofPred_eq] at hw ⊢ change (lambda : ℝ) - (w : ℝ) > x at hw linarith calc poissonMeasure lambda {w : ℕ | (lambda : ℝ) - (w : ℝ) > sqrt (2 * (lambda : ℝ) * z)} ≤ poissonMeasure lambda {w : ℕ | (w : ℝ) - (lambda : ℝ) ≤ -x} := measure_mono hsubset _ = ofReal ((poissonMeasure lambda).real {w : ℕ | (w : ℝ) - (lambda : ℝ) ≤ -x}) := by symm exact ofReal_measureReal (measure_ne_top _ _) _ ≤ ofReal (exp (-z)) := ENNReal.ofReal_le_ofReal hreal -
badEvent_subset_remote_bernsteintheorem — For a Poisson law with a nonnegative mean and a logarithmic level of at least one, the universal self-normalized bad event is contained in the Bernstein event at forty times that level.hypotheseslambda :ℝ≥0L :ℝhL :1 ≤ LconclusionbadEvent universalH L lambda ⊆ {w : ℕ | deviation lambda w > sqrt (2 * (lambda : ℝ) * (scalarDecay * L)) + 2 * (scalarDecay * L)}Proof (Lean source)
-- Proof strategy: contrapose and put `d = deviation lambda w`. From -- `lambda ≤ w + d`, monotonicity and subadditivity of `sqrt` turn the remote -- Bernstein threshold into -- `sqrt 80 * sqrt (w * L) + sqrt (80 * d * L) + 80 * L`. -- Young's inequality `sqrt (80 * d * L) ≤ d / 2 + 40 * L` then gives -- `d ≤ 2 * sqrt 80 * sqrt (w * L) + 240 * L`, which is at most -- `256 * (sqrt (w * L) + L) = (universalH / 4) * radius L w`. -- The former value `universalH = 512` is invalid: `L = 1`, `w = 0`, and -- `lambda = 129` is a counterexample. theorem badEvent_subset_remote_bernstein (lambda : ℝ≥0) {L : ℝ} (hL : 1 ≤ L) : badEvent universalH L lambda ⊆ {w : ℕ | deviation lambda w > sqrt (2 * (lambda : ℝ) * (scalarDecay * L)) + 2 * (scalarDecay * L)} := by intro w hw simp only [Set.mem_ofPred_eq] at hw ⊢ change deviation lambda w > (1024 / 4) * (sqrt ((w : ℝ) * L) + L) at hw have hconst : (1024 : ℝ) / 4 = 256 := by norm_num rw [hconst] at hw by_contra hnot change ¬ deviation lambda w > sqrt (2 * (lambda : ℝ) * (40 * L)) + 2 * (40 * L) at hnot have hupper : deviation lambda w ≤ sqrt (2 * (lambda : ℝ) * (40 * L)) + 80 * L := by nlinarith [le_of_not_gt hnot] have hL0 : 0 ≤ L := by linarith have hw0 : 0 ≤ (w : ℝ) := Nat.cast_nonneg w have hlambda0 : 0 ≤ (lambda : ℝ) := lambda.coe_nonneg have hd0 : 0 ≤ deviation lambda w := by simp [deviation] have hs0 : 0 ≤ sqrt ((w : ℝ) * L) := Real.sqrt_nonneg _ have hq0 : 0 ≤ sqrt (2 * (lambda : ℝ) * (40 * L)) := Real.sqrt_nonneg _ have hs_sq : (sqrt ((w : ℝ) * L)) ^ 2 = (w : ℝ) * L := by rw [Real.sq_sqrt] positivity have hq_sq : (sqrt (2 * (lambda : ℝ) * (40 * L))) ^ 2 = 2 * (lambda : ℝ) * (40 * L) := by rw [Real.sq_sqrt] positivity have hlambda_le : (lambda : ℝ) ≤ (w : ℝ) + deviation lambda w := by simp only [deviation] nlinarith [neg_le_abs ((w : ℝ) - (lambda : ℝ))] have hdiff0 : 0 ≤ deviation lambda w - 80 * L := by nlinarith have hsquare : (deviation lambda w - 80 * L) ^ 2 ≤ (sqrt (2 * (lambda : ℝ) * (40 * L))) ^ 2 := by nlinarith nlinarith -
poisson_badEvent_probabilitytheorem — For a Poisson law with a nonnegative mean and a logarithmic level of at least one, the universal self-normalized bad event has probability at most twice the exponential of minus forty times that level.hypotheseslambda :ℝ≥0L :ℝhL :1 ≤ LconclusionProof (Lean source)
-- Apply `measure_mono` to `badEvent_subset_remote_bernstein`, then invoke -- `poisson_abs_bernstein` at `z = scalarDecay * L`; `hL` makes this level -- nonnegative and the threshold is definitionally the same after unfolding. theorem poisson_badEvent_probability (lambda : ℝ≥0) {L : ℝ} (hL : 1 ≤ L) : poissonMeasure lambda (badEvent universalH L lambda) ≤ 2 * ofReal (exp (-(scalarDecay * L))) := by calc poissonMeasure lambda (badEvent universalH L lambda) ≤ poissonMeasure lambda {w : ℕ | deviation lambda w > sqrt (2 * (lambda : ℝ) * (scalarDecay * L)) + 2 * (scalarDecay * L)} := measure_mono (badEvent_subset_remote_bernstein lambda hL) _ ≤ 2 * ofReal (exp (-(scalarDecay * L))) := by apply poisson_abs_bernstein lambda have hL0 : 0 ≤ L := by linarith exact mul_nonneg (le_trans (by norm_num) forty_le_scalarDecay) hL0 -
poisson_quarter_overflow_le_invtheorem — For a positive sample size, a Poisson count with mean one quarter of that size overshoots the sample size with probability at most 8 / n.Proof (Lean source)
theorem poisson_quarter_overflow_le_inv (n : ℕ) (hn : 0 < n) : (poissonMeasure ((n : ℝ≥0) / 4)).real (Ioi n) ≤ 8 / (n : ℝ) := by have hnR : 0 < (n : ℝ) := by exact_mod_cast hn have hx : 0 < (n : ℝ) / 8 := by positivity have hexp : (n : ℝ) / 8 ≤ exp ((n : ℝ) / 8) := by linarith [Real.add_one_le_exp ((n : ℝ) / 8)] calc (poissonMeasure ((n : ℝ≥0) / 4)).real (Ioi n) ≤ exp (-(n : ℝ) / 8) := poisson_quarter_overflow_le_exp n hn _ = 1 / exp ((n : ℝ) / 8) := by rw [show -(n : ℝ) / 8 = -((n : ℝ) / 8) by ring, Real.exp_neg, one_div] _ ≤ 1 / ((n : ℝ) / 8) := one_div_le_one_div_of_le hx hexp _ = 8 / (n : ℝ) := by field_simp
Moments 4 core · 4 supporting This module integrates the Poisson tail estimate. ★ poisson_weighted_bad_moment
Scalar weighted and unconditioned Poisson moments
This module integrates the Poisson tail estimate. It supplies first, second, and fourth moments at the local scale and their exponentially truncated counterparts on the universal self-normalized bad event.
Given a moment order, the uniform scalar bad-event moment constant is a fixed power of ten large enough for all orders through four.
Definition (Lean source)
Given a moment order, the uniform unconditioned scalar moment constant is a fixed power of ten large enough for all orders through four.
Definition (Lean source)
Given a radius multiplier and logarithmic level, a nonnegative Poisson mean, and a natural-valued count, the scalar deviation-plus-radius score adds the absolute deviation to the multiplied self-normalizing radius.
Under a Poisson law with a nonnegative mean, at a logarithmic level of at least one, each moment order one, two, or four has its universal score truncated to the bad event bounded by an exponentially decaying multiple of the matching local-scale power.
Formal statement
Proof (Lean source)
4 supporting declarations (lemmas, instances)
-
scalarBadMomentConstant_postheorem — For a moment order, the scalar bad-event moment constant is strictly positive.Proof (Lean source)
theorem scalarBadMomentConstant_pos (t : ℕ) : 0 < scalarBadMomentConstant t := by exact pow_pos (by norm_num) _ -
scalarMomentConstant_postheorem — For a moment order, the unconditioned scalar moment constant is strictly positive.Proof (Lean source)
theorem scalarMomentConstant_pos (t : ℕ) : 0 < scalarMomentConstant t := by exact pow_pos (by norm_num) _ -
integrable_score_powtheorem — Under a Poisson law with a nonnegative mean, at a logarithmic level of at least one, every moment order through four gives an integrable power of the universal score.hypotheseslambda :ℝ≥0L :ℝhL :1 ≤ Lt :ℕht :t ≤ 4conclusionProof (Lean source)
-- Reduce `score` to a polynomial envelope in the count: for `L ≥ 1`, -- `sqrt (w*L) ≤ w*L + 1`, so every power through four is bounded by a -- constant multiple of `(w+1)^4`. After `integrable_poissonMeasure_iff`, -- summability follows from `Real.summable_pow_div_factorial` after shifting -- the series finitely many times (as in `integrable_natCast_poisson`). theorem integrable_score_pow (lambda : ℝ≥0) {L : ℝ} (hL : 1 ≤ L) {t : ℕ} (ht : t ≤ 4) : Integrable (fun w : ℕ => (score universalH L lambda w) ^ t) (poissonMeasure lambda) := by exact integrable_score_pow_aux lambda hL t -
poisson_score_momenttheorem — Under a Poisson law with a nonnegative mean, at a logarithmic level of at least one, every moment order through four has its universal score moment bounded by a constant times the matching local-scale power.hypotheseslambda :ℝ≥0L :ℝhL :1 ≤ Lt :ℕht :t ≤ 4conclusion∫ w : ℕ, (score universalH L lambda w) ^ t ∂poissonMeasure lambda≤ scalarMomentConstant t * (localScale lambda L) ^ tProof (Lean source)
-- Split at a constant Bernstein level and use the same integer-shell sum as -- above without the initial `40*L` offset. Equivalently use Mathlib's -- layer-cake formula after deriving a tail bound for `score/localScale`. -- Treat `t = 0,1,2,3,4` explicitly; `localScale ≥ L ≥ 1` absorbs constants. theorem poisson_score_moment (lambda : ℝ≥0) {L : ℝ} (hL : 1 ≤ L) {t : ℕ} (ht : t ≤ 4) : ∫ w : ℕ, (score universalH L lambda w) ^ t ∂poissonMeasure lambda ≤ scalarMomentConstant t * (localScale lambda L) ^ t := by simpa only [scalarMomentConstant] using poisson_score_moment_aux lambda hL (le_trans ht (by norm_num))
Scaling 5 core · 1 supporting This module divides counts with means m q_i by a positive exposure m. ★ independent_poisson_normalized_badAny_moment
Normalized finite-product Poisson bounds
This module divides counts with means m q_i by a positive exposure m. The definitions
accept any nonnegative exposure; at zero exposure the divisions are zero by convention and the
normalized quantities lose their meaning, so the theorems assume positive exposure.
The resulting bound retains the local normalized scale
sqrt ((sum_i q_i) L / m) + L / m.
Given a nonnegative exposure, a nonnegative intensity, and a natural-valued count, the normalized deviation is the absolute difference between count divided by exposure and intensity.
Definition (Lean source)
Given a nonnegative exposure, a logarithmic level, and a natural-valued count, the normalized self-normalizing radius is the square root of normalized count times normalized level, plus normalized level.
Definition (Lean source)
Given a finite coordinate index and sample space, natural-valued coordinate counts, a multiplier and logarithmic level, a nonnegative exposure, and nonnegative coordinate intensities, the normalized aggregate bad event occurs when at least one coordinate exceeds its normalized self-normalized threshold.
Definition (Lean source)
Given a finite coordinate index and sample space, natural-valued coordinate counts, a multiplier and logarithmic level, a nonnegative exposure, nonnegative coordinate intensities, and a sample point, the normalized aggregate score sums the normalized deviation-plus-radius scores across coordinates.
Definition (Lean source)
On a measurable sample space with a finite coordinate index, let a probability law carry natural-valued coordinate counts with nonnegative coordinate intensities and a strictly positive exposure. If the counts are measurable, each count is Poisson with mean exposure times intensity, and the counts are mutually independent, then under a fixed coordinate-cardinality cap, for moment order one, two, or four and a logarithmic level of at least one, the normalized aggregate score moment on the union of bad coordinates decays exponentially at the local scale determined by total intensity and exposure.
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
independent_poisson_normalized_badAny_moment_fourtheorem — On a measurable sample space, let a probability law carry four natural-valued coordinate counts with nonnegative coordinate intensities and a strictly positive exposure. If the counts are measurable, each count is Poisson with mean exposure times intensity, and the counts are mutually independent, then for moment order one, two, or four and a logarithmic level of at least one, the normalized four-coordinate bad-event moment has the corresponding exponentially decaying local-scale bound.hypothesesΩ :Type*μ :W :Fin 4 → Ω → ℕq :Fin 4 → ℝ≥0m :ℝ≥0hm :0 < mhWmeas :∀ i, Measurable (W i)hWlaw :∀ i, HasLaw (W i) (poissonMeasure (m * q i)) μhWindep :iIndepFun W μt :ℕht :t = 1 ∨ t = 2 ∨ t = 4L :ℝhL :1 ≤ Lconclusion∫ ω, (normalizedBadAny W universalH L m q).indicator (fun ω => (normalizedAggregateScore W universalH L m q ω) ^ t) ω ∂μ≤ productMomentConstant 4 t * exp (-20 * L) * (sqrt (((∑ i, (q i : ℝ)) * L) / (m : ℝ)) + L / (m : ℝ)) ^ tProof (Lean source)
-- Apply the general normalized theorem with `r = 4`. theorem independent_poisson_normalized_badAny_moment_four {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (W : Fin 4 → Ω → ℕ) (q : Fin 4 → ℝ≥0) (m : ℝ≥0) (hm : 0 < m) (hWmeas : ∀ i, Measurable (W i)) (hWlaw : ∀ i, HasLaw (W i) (poissonMeasure (m * q i)) μ) (hWindep : iIndepFun W μ) {t : ℕ} (ht : t = 1 ∨ t = 2 ∨ t = 4) {L : ℝ} (hL : 1 ≤ L) : ∫ ω, (normalizedBadAny W universalH L m q).indicator (fun ω => (normalizedAggregateScore W universalH L m q ω) ^ t) ω ∂μ ≤ productMomentConstant 4 t * exp (-20 * L) * (sqrt (((∑ i, (q i : ℝ)) * L) / (m : ℝ)) + L / (m : ℝ)) ^ t := by exact independent_poisson_normalized_badAny_moment μ W q m hm hWmeas hWlaw hWindep (r := 4) (by simp) ht hL