Stat.Concentration.Poisson­Self­Normalized

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).

def deviation reviewed
Causalean.Stat.Concentration.PoissonSelfNormalized

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)
lambda :
ℝ≥0
w :
deviation lambda w :
|(w : ℝ) - (lambda : ℝ)|
Causalean.Stat.Concentration.PoissonSelfNormalized.deviation · Causalean/Stat/Concentration/PoissonSelfNormalized/Basic.lean:21
def radius reviewed
Causalean.Stat.Concentration.PoissonSelfNormalized

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)
L :
w :
radius L w :
sqrt ((w : ℝ) * L) + L
Causalean.Stat.Concentration.PoissonSelfNormalized.radius · Causalean/Stat/Concentration/PoissonSelfNormalized/Basic.lean:26
def localScale reviewed
Causalean.Stat.Concentration.PoissonSelfNormalized

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)
lambda :
ℝ≥0
L :
localScale lambda L :
sqrt ((lambda : ℝ) * L) + L
Causalean.Stat.Concentration.PoissonSelfNormalized.localScale · Causalean/Stat/Concentration/PoissonSelfNormalized/Basic.lean:31
def badEvent reviewed
Causalean.Stat.Concentration.PoissonSelfNormalized

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.

Definition (Lean source)
H L :
lambda :
ℝ≥0
badEvent H L lambda :
Set
{w | deviation lambda w > (H / 4) * radius L w}
Causalean.Stat.Concentration.PoissonSelfNormalized.badEvent · Causalean/Stat/Concentration/PoissonSelfNormalized/Basic.lean:36
def universalH reviewed
Causalean.Stat.Concentration.PoissonSelfNormalized

The universal self-normalization multiplier is 1024.

Definition (Lean source)
universalH :
1024
Causalean.Stat.Concentration.PoissonSelfNormalized.universalH · Causalean/Stat/Concentration/PoissonSelfNormalized/Basic.lean:42
def scalarDecay reviewed
Causalean.Stat.Concentration.PoissonSelfNormalized

The pre-aggregation exponential decay rate is 40.

Definition (Lean source)
scalarDecay :
40
Causalean.Stat.Concentration.PoissonSelfNormalized.scalarDecay · Causalean/Stat/Concentration/PoissonSelfNormalized/Basic.lean:45
theorem integrable_radius reviewed
Causalean.Stat.Concentration.PoissonSelfNormalized

Under a Poisson law with a nonnegative mean, the self-normalizing radius at a nonnegative logarithmic level is integrable.

Formal statement
lambda :
ℝ≥0
L :
hL :
0 ≤ L
Proof (Lean source)
theorem integrable_radius (lambda : ℝ≥0) (L : ℝ) (hL : 0 ≤ L) : Integrable (radius L) (poissonMeasure lambda) := by have hlin : Integrable (fun w : ℕ => (w : ℝ) * L) (poissonMeasure lambda) := (integrable_natCast_poisson lambda).mul_const L have hc : Integrable (fun _ : ℕ => (1 + L : ℝ)) (poissonMeasure lambda) := integrable_const _ have hg := hlin.add hc refine hg.mono' (measurable_radius L).aestronglyMeasurable (Filter.Eventually.of_forall fun w => ?_) have hx : 0 ≤ (w : ℝ) * L := mul_nonneg (Nat.cast_nonneg _) hL have hsqrt : sqrt ((w : ℝ) * L) ≤ (w : ℝ) * L + 1 := by have hs := Real.sq_sqrt hx have hsq := sq_nonneg (sqrt ((w : ℝ) * L) - 1) nlinarith change ‖Real.sqrt ((w : ℝ) * L) + L‖ ≤ (w : ℝ) * L + (1 + L) rw [Real.norm_eq_abs, abs_of_nonneg] · linarith · exact add_nonneg (Real.sqrt_nonneg _) hL
Causalean.Stat.Concentration.PoissonSelfNormalized.integrable_radius · Causalean/Stat/Concentration/PoissonSelfNormalized/Basic.lean:94 · uses radius
7 supporting declarations (lemmas, instances)
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.

def badAny reviewed
Causalean.Stat.Concentration.PoissonSelfNormalized

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.

Definition (Lean source)
ι Ω :
Type*
W :
ι → Ω → ℕ
H L :
lambda :
ι → ℝ≥0
badAny W H L lambda :
Set Ω
{ω | ∃ i, W i ω ∈ badEvent H L (lambda i)}
Causalean.Stat.Concentration.PoissonSelfNormalized.badAny · Causalean/Stat/Concentration/PoissonSelfNormalized/Product.lean:18
def aggregateScore reviewed
Causalean.Stat.Concentration.PoissonSelfNormalized

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)
ι Ω :
Type*
W :
ι → Ω → ℕ
H L :
lambda :
ι → ℝ≥0
ω :
Ω
aggregateScore W H L lambda ω :
∑ i, score H L (lambda i) (W i ω)
Causalean.Stat.Concentration.PoissonSelfNormalized.aggregateScore · Causalean/Stat/Concentration/PoissonSelfNormalized/Product.lean:26
def productMomentConstant reviewed
Causalean.Stat.Concentration.PoissonSelfNormalized

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)
r t :
productMomentConstant r t :
10 ^ (16 * (r + 1) * (t + 1))
Causalean.Stat.Concentration.PoissonSelfNormalized.productMomentConstant · Causalean/Stat/Concentration/PoissonSelfNormalized/Product.lean:34
theorem independent_poisson_badAny_moment reviewed
Causalean.Stat.Concentration.PoissonSelfNormalized

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
ι Ω :
W :
ι → Ω → ℕ
lambda :
ι → ℝ≥0
hWmeas :
∀ i, Measurable (W i)
hWlaw :
∀ i, HasLaw (W i) (poissonMeasure (lambda i)) μ
hWindep :
iIndepFun W μ
r t :
hcard :
card ι ≤ r
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 r t * exp (-20 * L) * (sqrt ((∑ i, (lambda i : ℝ)) * L) + L) ^ t
Proof (Lean source)
-- Proof route: dominate `1_{BadAny}` by the sum of coordinate bad-event -- indicators and use `pow_sum_le_card_mul_sum_pow` on the nonnegative scores. -- This reduces the integral to terms `E[score_i^t 1_{Bad_j}]`. For `i = j`, -- transfer `poisson_weighted_bad_moment` through `HasLaw.integral_comp`. For -- `i != j`, use `hWindep.indepFun` (followed by measurable composition) and -- `IndepFun.integral_mul` to factor the term into an untruncated score moment -- and a bad-event probability. Transfer `poisson_score_moment` and -- `poisson_badEvent_probability_eighty` through the coordinate laws. Finally -- bound `sum_i localScale (lambda i) L` by a cardinality-dependent multiple of -- `sqrt ((sum_i lambda_i) * L) + L` using Cauchy--Schwarz for the square-root -- sum, and absorb all powers of `r` and scalar constants into -- `productMomentConstant`. Split off the empty-index/r=0 case before using -- positive cardinality inequalities, and eliminate the three values of `t` -- from `ht` explicitly. theorem independent_poisson_badAny_moment {ι Ω : Type*} [Fintype ι] [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (W : ι → Ω → ℕ) (lambda : ι → ℝ≥0) (hWmeas : ∀ i, Measurable (W i)) (hWlaw : ∀ i, HasLaw (W i) (poissonMeasure (lambda i)) μ) (hWindep : iIndepFun W μ) {r t : ℕ} (hcard : Fintype.card ι ≤ r) (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 r t * exp (-20 * L) * (sqrt ((∑ i, (lambda i : ℝ)) * L) + L) ^ t := by classical by_cases hι : Nonempty ι · letI := hι have ht4 : t ≤ 4 := by rcases ht with rfl | rfl | rfl <;> norm_num let K : ℝ := scalarBadMomentConstant t + 2 * scalarMomentConstant t let A : ℝ := sqrt ((∑ i, (lambda i : ℝ)) * L) + L let n : ℝ := Fintype.card ι let F : ι → ι → Ω → ℝ := fun j i ω => (badEvent universalH L (lambda j)).indicator (fun _ => (score universalH L (lambda i) (W i ω)) ^ t) (W j ω) have hn0 : 0 ≤ n := by dsimp [n]; positivity have hn1 : 1 ≤ n := by dsimp [n] exact_mod_cast Fintype.card_pos have hK0 : 0 ≤ K := by dsimp [K] exact add_nonneg (scalarBadMomentConstant_pos t).le (mul_nonneg (by norm_num) (scalarMomentConstant_pos t).le) have hA0 : 0 ≤ A := by dsimp [A] exact add_nonneg (Real.sqrt_nonneg _) (by linarith) have hscore0 (i : ι) (ω : Ω) : 0 ≤ score universalH L (lambda i) (W i ω) := score_nonneg_product (lambda i) hL (W i ω) have hF0 (j i : ι) (ω : Ω) : 0 ≤ F j i ω := by dsimp [F] by_cases hω : W j ω ∈ badEvent universalH L (lambda j) · simp [hω, pow_nonneg (hscore0 i ω) t] · simp [hω] have hFint (j i : ι) : Integrable (F j i) μ := by have hi := (integrable_score_pow_comp μ (W i) (lambda i) (hWlaw i) hL ht4).indicator ((measurableSet_badEvent universalH L (lambda j)).preimage (hWmeas j)) change Integrable ((W j ⁻¹' badEvent universalH L (lambda j)).indicator (fun ω => (score universalH L (lambda i) (W i ω)) ^ t)) μ at hi have heq : F j i = (W j ⁻¹' badEvent universalH L (lambda j)).indicator (fun ω => (score universalH L (lambda i) (W i ω)) ^ t) := by funext ω by_cases hω : W j ω ∈ badEvent universalH L (lambda j) <;> simp [F, hω] rw [heq] exact hi have haggregate_pow (ω : Ω) : (aggregateScore W universalH L lambda ω) ^ t ≤ n ^ (t - 1) * ∑ i, (score universalH L (lambda i) (W i ω)) ^ t := by unfold aggregateScore rcases ht with rfl | rfl | rfl · simpa [n] using (pow_sum_le_card_mul_sum_pow (s := (Finset.univ : Finset ι)) (f := fun i => score universalH L (lambda i) (W i ω)) (fun i _ => hscore0 i ω) 0) · simpa [n] using (pow_sum_le_card_mul_sum_pow (s := (Finset.univ : Finset ι)) (f := fun i => score universalH L (lambda i) (W i ω)) (fun i _ => hscore0 i ω) 1) · simpa [n] using (pow_sum_le_card_mul_sum_pow (s := (Finset.univ : Finset ι)) (f := fun i => score universalH L (lambda i) (W i ω)) (fun i _ => hscore0 i ω) 3) have hpoint (ω : Ω) : (badAny W universalH L lambda).indicator (fun ω => (aggregateScore W universalH L lambda ω) ^ t) ω ≤ n ^ (t - 1) * ∑ j, ∑ i, F j i ω := by by_cases hbad : ω ∈ badAny W universalH L lambda · rw [Set.indicator_of_mem hbad] rcases hbad with ⟨j, hj⟩ have hselected : ∑ i, (score universalH L (lambda i) (W i ω)) ^ t = ∑ i, F j i ω := by apply Finset.sum_congr rfl intro i _ simp [F, hj] have hinner : ∑ i, (score universalH L (lambda i) (W i ω)) ^ t ≤ ∑ j, ∑ i, F j i ω := by rw [hselected] exact Finset.single_le_sum (fun k _ => sum_nonneg fun i _ => hF0 k i ω) (Finset.mem_univ j) exact haggregate_pow ω |>.trans (mul_le_mul_of_nonneg_left hinner (pow_nonneg hn0 _)) · rw [Set.indicator_of_notMem hbad] exact mul_nonneg (pow_nonneg hn0 _) (sum_nonneg fun j _ => sum_nonneg fun i _ => hF0 j i ω) have hlhs0 : 0 ≤ᵐ[μ] fun ω => (badAny W universalH L lambda).indicator (fun ω => (aggregateScore W universalH L lambda ω) ^ t) ω := by filter_upwards [] with ω by_cases hbad : ω ∈ badAny W universalH L lambda · rw [Set.indicator_of_mem hbad] apply pow_nonneg unfold aggregateScore exact sum_nonneg fun i _ => hscore0 i ω · simp [hbad] have hsumInt : Integrable (fun ω => ∑ j, ∑ i, F j i ω) μ := integrable_finsetSum _ fun j _ => integrable_finsetSum _ fun i _ => hFint j i have hdomInt : Integrable (fun ω => n ^ (t - 1) * ∑ j, ∑ i, F j i ω) μ := hsumInt.const_mul _ have hintegral : ∫ ω, (badAny W universalH L lambda).indicator (fun ω => (aggregateScore W universalH L lambda ω) ^ t) ω ∂μ ≤ n ^ (t - 1) * ∑ j, ∑ i, ∫ ω, F j i ω ∂μ := by calc _ ≤ ∫ ω, n ^ (t - 1) * ∑ j, ∑ i, F j i ω ∂μ := integral_mono_of_nonneg hlhs0 hdomInt (Filter.Eventually.of_forall hpoint) _ = n ^ (t - 1) * ∫ ω, ∑ j, ∑ i, F j i ω ∂μ := integral_const_mul _ _ _ = n ^ (t - 1) * ∑ j, ∫ ω, ∑ i, F j i ω ∂μ := by congr 1 exact integral_finsetSum Finset.univ fun j _ => integrable_finsetSum _ fun i _ => hFint j i _ = n ^ (t - 1) * ∑ j, ∑ i, ∫ ω, F j i ω ∂μ := by congr 1 apply Finset.sum_congr rfl intro j _ exact integral_finsetSum Finset.univ fun i _ => hFint j i have hcross (j i : ι) : ∫ ω, F j i ω ∂μ ≤ K * exp (-(40 * L)) * (localScale (lambda i) L) ^ t := by exact coordinate_cross_moment μ W lambda hWmeas hWlaw hWindep hL ht i j have hcrossSum : ∑ j, ∑ i, ∫ ω, F j i ω ∂μ ≤ n * (K * exp (-(40 * L)) * ∑ i, (localScale (lambda i) L) ^ t) := by calc _ ≤ ∑ _j : ι, ∑ i, K * exp (-(40 * L)) * (localScale (lambda i) L) ^ t := by exact Finset.sum_le_sum fun j _ => Finset.sum_le_sum fun i _ => hcross j i _ = n * (K * exp (-(40 * L)) * ∑ i, (localScale (lambda i) L) ^ t) := by simp [n, Finset.mul_sum] have hpowSum := sum_localScale_pow_le_card_mul_pow_sum lambda hL t have hscale := sum_localScale_le_card_mul lambda hL have hscalePow : (∑ i, localScale (lambda i) L) ^ t ≤ (n * A) ^ t := by exact pow_le_pow_left₀ (sum_nonneg fun i _ => by unfold localScale positivity) (by simpa [n, A] using hscale) t have hncard : n ≤ (r : ℝ) := by dsimp [n] exact_mod_cast hcard have hcoeff : n ^ (2 * t + 1) * K ≤ productMomentConstant r t := by calc n ^ (2 * t + 1) * K ≤ (r : ℝ) ^ (2 * t + 1) * K := by exact mul_le_mul_of_nonneg_right (pow_le_pow_left₀ hn0 hncard _) hK0 _ ≤ productMomentConstant r t := product_coefficient_bound calc ∫ ω, (badAny W universalH L lambda).indicator (fun ω => (aggregateScore W universalH L lambda ω) ^ t) ω ∂μ ≤ n ^ (t - 1) * ∑ j, ∑ i, ∫ ω, F j i ω ∂μ := hintegral _ ≤ n ^ (t - 1) * (n * (K * exp (-(40 * L)) * ∑ i, (localScale (lambda i) L) ^ t)) := mul_le_mul_of_nonneg_left hcrossSum (pow_nonneg hn0 _) _ ≤ n ^ (t - 1) * (n * (K * exp (-(40 * L)) * (n * (∑ i, localScale (lambda i) L) ^ t))) := by gcongr _ ≤ n ^ (t - 1) * (n * (K * exp (-(40 * L)) * (n * (n * A) ^ t))) := by gcongr _ = (n ^ (2 * t + 1) * K) * exp (-(40 * L)) * A ^ t := by rcases ht with rfl | rfl | rfl <;> ring _ ≤ productMomentConstant r t * exp (-(40 * L)) * A ^ t := by gcongr _ ≤ productMomentConstant r t * exp (-20 * L) * A ^ t := by apply mul_le_mul_of_nonneg_right · exact mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr (by nlinarith)) (productMomentConstant_pos r t).le · exact pow_nonneg hA0 t _ = productMomentConstant r t * exp (-20 * L) * (sqrt ((∑ i, (lambda i : ℝ)) * L) + L) ^ t := rfl · letI : IsEmpty ι := not_nonempty_iff.mp hι simp [badAny, aggregateScore] exact mul_nonneg (mul_nonneg (productMomentConstant_pos r t).le (Real.exp_nonneg _)) (pow_nonneg (by linarith) t)
Causalean.Stat.Concentration.PoissonSelfNormalized.independent_poisson_badAny_moment · Causalean/Stat/Concentration/PoissonSelfNormalized/Product.lean:306 · uses aggregateScore , badAny , productMomentConstant , universalH
2 supporting declarations (lemmas, instances)
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.

theorem poisson_abs_bernstein reviewed
Causalean.Stat.Concentration.PoissonSelfNormalized

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
lambda :
ℝ≥0
z :
hz :
0 ≤ z
poissonMeasure lambda {w : ℕ | deviation lambda w > sqrt (2 * (lambda : ℝ) * z) + 2 * z}
≤ 2 * ofReal (exp (-z))
Proof (Lean source)
-- Proof strategy: rewrite `deviation`, split the absolute-value event into -- upper and lower deviations, apply `measure_union_le`, and use the preceding -- one-sided bounds. The lower event with the larger displayed threshold is -- contained in the lower Bernstein event with threshold `sqrt (2 lambda z)`. theorem poisson_abs_bernstein (lambda : ℝ≥0) {z : ℝ} (hz : 0 ≤ z) : poissonMeasure lambda {w : ℕ | deviation lambda w > sqrt (2 * (lambda : ℝ) * z) + 2 * z} ≤ 2 * ofReal (exp (-z)) := by let s : ℝ := sqrt (2 * (lambda : ℝ) * z) let T : ℝ := s + 2 * z have hs_nonneg : 0 ≤ s := Real.sqrt_nonneg _ have hT_nonneg : 0 ≤ T := by dsimp [T] positivity have hsubset : {w : ℕ | deviation lambda w > sqrt (2 * (lambda : ℝ) * z) + 2 * z} ⊆ {w : ℕ | (w : ℝ) - (lambda : ℝ) > sqrt (2 * (lambda : ℝ) * z) + 2 * z} ∪ {w : ℕ | (lambda : ℝ) - (w : ℝ) > sqrt (2 * (lambda : ℝ) * z)} := by intro w hw simp only [Set.mem_ofPred_eq, Set.mem_union] at hw ⊢ change |(w : ℝ) - (lambda : ℝ)| > T at hw by_cases hu : (w : ℝ) - (lambda : ℝ) > T · left exact hu · right change (lambda : ℝ) - (w : ℝ) > s by_contra hl have hl' : (lambda : ℝ) - (w : ℝ) ≤ s := le_of_not_gt hl have hu' : (w : ℝ) - (lambda : ℝ) ≤ T := le_of_not_gt hu have hlower : -T ≤ (w : ℝ) - (lambda : ℝ) := by dsimp [T] linarith have habs : |(w : ℝ) - (lambda : ℝ)| ≤ T := (abs_le.mpr ⟨hlower, hu'⟩) linarith calc poissonMeasure lambda {w : ℕ | deviation lambda w > sqrt (2 * (lambda : ℝ) * z) + 2 * z} ≤ poissonMeasure lambda ({w : ℕ | (w : ℝ) - (lambda : ℝ) > sqrt (2 * (lambda : ℝ) * z) + 2 * z} ∪ {w : ℕ | (lambda : ℝ) - (w : ℝ) > sqrt (2 * (lambda : ℝ) * z)}) := measure_mono hsubset _ ≤ poissonMeasure lambda {w : ℕ | (w : ℝ) - (lambda : ℝ) > sqrt (2 * (lambda : ℝ) * z) + 2 * z} + poissonMeasure lambda {w : ℕ | (lambda : ℝ) - (w : ℝ) > sqrt (2 * (lambda : ℝ) * z)} := measure_union_le _ _ _ ≤ ofReal (exp (-z)) + ofReal (exp (-z)) := add_le_add (poisson_upper_bernstein lambda hz) (poisson_lower_bernstein lambda hz) _ = 2 * ofReal (exp (-z)) := by ring
Causalean.Stat.Concentration.PoissonSelfNormalized.poisson_abs_bernstein · Causalean/Stat/Concentration/PoissonSelfNormalized/Chernoff.lean:361 · uses deviation
theorem poisson_quarter_overflow_le_exp reviewed
Causalean.Stat.Concentration.PoissonSelfNormalized

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
n :
hn :
0 < n
(poissonMeasure ((n : ℝ≥0) / 4)).real (Ioi n) ≤ exp (-(n : ℝ) / 8)
Proof (Lean source)
theorem poisson_quarter_overflow_le_exp (n : ℕ) (hn : 0 < n) : (poissonMeasure ((n : ℝ≥0) / 4)).real (Ioi n) ≤ exp (-(n : ℝ) / 8) := by have hnR : 0 < (n : ℝ) := by exact_mod_cast hn have hsqrt : sqrt (2 * (((n : ℝ≥0) / 4 : ℝ≥0) : ℝ) * ((n : ℝ) / 8)) = (n : ℝ) / 4 := by rw [show 2 * (((n : ℝ≥0) / 4 : ℝ≥0) : ℝ) * ((n : ℝ) / 8) = ((n : ℝ) / 4) ^ 2 by norm_num; ring] rw [Real.sqrt_sq_eq_abs, abs_of_nonneg] positivity have hsubset : Ioi n ⊆ {w : ℕ | (w : ℝ) - (((n : ℝ≥0) / 4 : ℝ≥0) : ℝ) > sqrt (2 * (((n : ℝ≥0) / 4 : ℝ≥0) : ℝ) * ((n : ℝ) / 8)) + 2 * ((n : ℝ) / 8)} := by intro w hw simp only [Set.mem_Ioi] at hw ⊢ have hwR : (n : ℝ) < (w : ℝ) := by exact_mod_cast hw rw [hsqrt] norm_num nlinarith have hbern := poisson_upper_bernstein ((n : ℝ≥0) / 4) (z := (n : ℝ) / 8) (by positivity) have hmono : poissonMeasure ((n : ℝ≥0) / 4) (Ioi n) ≤ poissonMeasure ((n : ℝ≥0) / 4) {w : ℕ | (w : ℝ) - (((n : ℝ≥0) / 4 : ℝ≥0) : ℝ) > sqrt (2 * (((n : ℝ≥0) / 4 : ℝ≥0) : ℝ) * ((n : ℝ) / 8)) + 2 * ((n : ℝ) / 8)} := measure_mono hsubset simpa only [Measure.real_def, ENNReal.toReal_ofReal (Real.exp_pos _).le, neg_div] using ENNReal.toReal_mono ENNReal.ofReal_ne_top (hmono.trans hbern)
Causalean.Stat.Concentration.PoissonSelfNormalized.poisson_quarter_overflow_le_exp · Causalean/Stat/Concentration/PoissonSelfNormalized/Chernoff.lean:514
7 supporting declarations (lemmas, instances)
  • integrable_exp_centered_poisson theorem — Under a Poisson law with a nonnegative mean, the exponential of its centered count at a real tilt is integrable.
    lambda :
    ℝ≥0
    theta :
    Integrable (fun w : ℕ => exp (theta * ((w : ℝ) - (lambda : ℝ)))) (poissonMeasure lambda)
    Proof (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
    Causalean.Stat.Concentration.PoissonSelfNormalized.integrable_exp_centered_poisson · Causalean/Stat/Concentration/PoissonSelfNormalized/Chernoff.lean:18
  • integral_exp_centered_poisson theorem — 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.
    lambda :
    ℝ≥0
    theta :
    ∫ w : ℕ, exp (theta * ((w : ℝ) - (lambda : ℝ))) ∂poissonMeasure lambda
    = exp ((lambda : ℝ) * (exp theta - 1 - theta))
    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
    Causalean.Stat.Concentration.PoissonSelfNormalized.integral_exp_centered_poisson · Causalean/Stat/Concentration/PoissonSelfNormalized/Chernoff.lean:42
  • poisson_upper_bernstein theorem — 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.
    lambda :
    ℝ≥0
    z :
    hz :
    0 ≤ z
    poissonMeasure lambda {w : ℕ | (w : ℝ) - (lambda : ℝ) > sqrt (2 * (lambda : ℝ) * z) + 2 * z}
    ofReal (exp (-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
    Causalean.Stat.Concentration.PoissonSelfNormalized.poisson_upper_bernstein · Causalean/Stat/Concentration/PoissonSelfNormalized/Chernoff.lean:80
  • poisson_lower_bernstein theorem — 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.
    lambda :
    ℝ≥0
    z :
    hz :
    0 ≤ z
    poissonMeasure lambda {w : ℕ | (lambda : ℝ) - (w : ℝ) > sqrt (2 * (lambda : ℝ) * z)}
    ofReal (exp (-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
    Causalean.Stat.Concentration.PoissonSelfNormalized.poisson_lower_bernstein · Causalean/Stat/Concentration/PoissonSelfNormalized/Chernoff.lean:200
  • badEvent_subset_remote_bernstein theorem — 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.
    lambda :
    ℝ≥0
    L :
    hL :
    1 ≤ L
    badEvent 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
    Causalean.Stat.Concentration.PoissonSelfNormalized.badEvent_subset_remote_bernstein · Causalean/Stat/Concentration/PoissonSelfNormalized/Chernoff.lean:423
  • poisson_badEvent_probability theorem — 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.
    lambda :
    ℝ≥0
    L :
    hL :
    1 ≤ L
    ≤ 2 * ofReal (exp (-(scalarDecay * L)))
    Proof (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
    Causalean.Stat.Concentration.PoissonSelfNormalized.poisson_badEvent_probability · Causalean/Stat/Concentration/PoissonSelfNormalized/Chernoff.lean:482
  • poisson_quarter_overflow_le_inv theorem — 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.
    n :
    hn :
    0 < n
    (poissonMeasure ((n : ℝ≥0) / 4)).real (Ioi n) ≤ 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
    Causalean.Stat.Concentration.PoissonSelfNormalized.poisson_quarter_overflow_le_inv · Causalean/Stat/Concentration/PoissonSelfNormalized/Chernoff.lean:551
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.

def scalarBadMomentConstant reviewed
Causalean.Stat.Concentration.PoissonSelfNormalized

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)
t :
scalarBadMomentConstant t :
10 ^ (8 * t + 8)
Causalean.Stat.Concentration.PoissonSelfNormalized.scalarBadMomentConstant · Causalean/Stat/Concentration/PoissonSelfNormalized/Moments.lean:18
def scalarMomentConstant reviewed
Causalean.Stat.Concentration.PoissonSelfNormalized

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)
t :
scalarMomentConstant t :
10 ^ (4 * t + 4)
Causalean.Stat.Concentration.PoissonSelfNormalized.scalarMomentConstant · Causalean/Stat/Concentration/PoissonSelfNormalized/Moments.lean:22
def score reviewed
Causalean.Stat.Concentration.PoissonSelfNormalized

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.

Definition (Lean source)
H L :
lambda :
ℝ≥0
w :
score H L lambda w :
deviation lambda w + H * radius L w
Causalean.Stat.Concentration.PoissonSelfNormalized.score · Causalean/Stat/Concentration/PoissonSelfNormalized/Moments.lean:35
theorem poisson_weighted_bad_moment reviewed
Causalean.Stat.Concentration.PoissonSelfNormalized

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
lambda :
ℝ≥0
L :
hL :
1 ≤ L
t :
ht :
t = 1 ∨ t = 2 ∨ t = 4
∫ w : ℕ, (badEvent universalH L lambda).indicator (fun w => (score universalH L lambda w) ^ t) w ∂poissonMeasure lambda
scalarBadMomentConstant t * exp (-(scalarDecay * L)) * (localScale lambda L) ^ t
Proof (Lean source)
-- A convenient discrete-tail route is to partition by integer Bernstein -- levels `z = 40*L+n`. On each shell, the deterministic inequalities used -- in `badEvent_subset_remote_bernstein` bound `score^t` by a fixed multiple -- of `(localScale + n)^t`; `poisson_abs_bernstein` bounds the shell by -- `2*exp (-(40*L+n))`. Sum the resulting degree-at-most-four polynomial -- times geometric series, absorb its `L^t` factor into `localScale^t` -- (`localScale ≥ L`), and discharge the three allowed values of `t` -- separately. The very large declared constant leaves ample slack. theorem poisson_weighted_bad_moment (lambda : ℝ≥0) {L : ℝ} (hL : 1 ≤ L) {t : ℕ} (ht : t = 1 ∨ t = 2 ∨ t = 4) : ∫ w : ℕ, (badEvent universalH L lambda).indicator (fun w => (score universalH L lambda w) ^ t) w ∂poissonMeasure lambda ≤ scalarBadMomentConstant t * exp (-(scalarDecay * L)) * (localScale lambda L) ^ t := by let B := badEvent universalH L lambda let S := localScale lambda L let X : ℕ → ℝ := fun w => (score universalH L lambda w) ^ t let a : ℝ := exp (-(40 * L)) * (S ^ t)⁻¹ have hS : 0 < S := lt_of_lt_of_le zero_lt_one (localScale_one_le lambda hL) have ha : 0 < a := by positivity have ht8 : 2 * t ≤ 8 := by rcases ht with rfl | rfl | rfl <;> norm_num have hX : Integrable X (poissonMeasure lambda) := by exact integrable_score_pow_aux lambda hL t have hXsq : Integrable (fun w => (X w) ^ 2) (poissonMeasure lambda) := by simpa only [X, ← pow_mul, mul_comm] using integrable_score_pow_aux lambda hL (2 * t) have hB : MeasurableSet B := by exact measurableSet_badEvent universalH L lambda have hprobReal : (poissonMeasure lambda).real B ≤ 2 * exp (-(80 * L)) := by have hp := poisson_badEvent_probability_eighty lambda hL have hto := (ENNReal.toReal_le_toReal (by finiteness) (by finiteness)).mpr hp simpa [B, measureReal_def, ENNReal.toReal_mul, Real.exp_nonneg] using hto have hmoment : ∫ w : ℕ, (X w) ^ 2 ∂poissonMeasure lambda ≤ 10 ^ (8 * t + 4) * S ^ (2 * t) := by have heq : 4 * (2 * t) + 4 = 8 * t + 4 := by omega rw [← heq] simpa only [X, S, pow_two, ← pow_add, two_mul] using poisson_score_moment_aux lambda hL ht8 have hyoung (w : ℕ) : B.indicator X w ≤ (a * (X w) ^ 2 + a⁻¹ * B.indicator (fun _ => (1 : ℝ)) w) / 2 := by by_cases hw : w ∈ B · rw [Set.indicator_of_mem hw, Set.indicator_of_mem hw] have hsquare := sq_nonneg (a * X w - 1) have ha0 : a ≠ 0 := ne_of_gt ha field_simp [ha0] nlinarith · simp [Set.indicator_of_notMem hw] positivity have hleft : Integrable (B.indicator X) (poissonMeasure lambda) := hX.indicator hB have hright : Integrable (fun w => (a * (X w) ^ 2 + a⁻¹ * B.indicator (fun _ => (1 : ℝ)) w) / 2) (poissonMeasure lambda) := by apply Integrable.div_const apply Integrable.add · exact hXsq.const_mul a · exact (integrable_const (1 : ℝ)).indicator hB |>.const_mul a⁻¹ have hintegral : ∫ w : ℕ, B.indicator X w ∂poissonMeasure lambda ≤ (a * ∫ w : ℕ, (X w) ^ 2 ∂poissonMeasure lambda + a⁻¹ * (poissonMeasure lambda).real B) / 2 := by calc ∫ w : ℕ, B.indicator X w ∂poissonMeasure lambda ≤ ∫ w : ℕ, (a * (X w) ^ 2 + a⁻¹ * B.indicator (fun _ => (1 : ℝ)) w) / 2 ∂poissonMeasure lambda := integral_mono hleft hright hyoung _ = (a * ∫ w : ℕ, (X w) ^ 2 ∂poissonMeasure lambda + a⁻¹ * (poissonMeasure lambda).real B) / 2 := by rw [integral_div, integral_add, integral_const_mul, integral_const_mul, integral_indicator_const (1 : ℝ) hB] simp · exact hXsq.const_mul a · exact (integrable_const (1 : ℝ)).indicator hB |>.const_mul a⁻¹ have hterm1 : a * ∫ w : ℕ, (X w) ^ 2 ∂poissonMeasure lambda ≤ 10 ^ (8 * t + 4) * exp (-(40 * L)) * S ^ t := by calc a * ∫ w : ℕ, (X w) ^ 2 ∂poissonMeasure lambda ≤ a * (10 ^ (8 * t + 4) * S ^ (2 * t)) := mul_le_mul_of_nonneg_left hmoment ha.le _ = 10 ^ (8 * t + 4) * exp (-(40 * L)) * S ^ t := by dsimp [a] rw [pow_mul] field_simp ring have hterm2 : a⁻¹ * (poissonMeasure lambda).real B ≤ 2 * exp (-(40 * L)) * S ^ t := by calc a⁻¹ * (poissonMeasure lambda).real B ≤ a⁻¹ * (2 * exp (-(80 * L))) := mul_le_mul_of_nonneg_left hprobReal (inv_nonneg.mpr ha.le) _ = 2 * exp (-(40 * L)) * S ^ t := by dsimp [a] rw [mul_inv_rev, inv_inv, ← Real.exp_neg] field_simp [Real.exp_ne_zero, ne_of_gt hS] rw [← Real.exp_add] ring_nf calc ∫ w : ℕ, (badEvent universalH L lambda).indicator (fun w => (score universalH L lambda w) ^ t) w ∂poissonMeasure lambda = ∫ w : ℕ, B.indicator X w ∂poissonMeasure lambda := by rfl _ ≤ (a * ∫ w : ℕ, (X w) ^ 2 ∂poissonMeasure lambda + a⁻¹ * (poissonMeasure lambda).real B) / 2 := hintegral _ ≤ (10 ^ (8 * t + 4) * exp (-(40 * L)) * S ^ t + 2 * exp (-(40 * L)) * S ^ t) / 2 := by gcongr _ ≤ scalarBadMomentConstant t * exp (-(scalarDecay * L)) * (localScale lambda L) ^ t := by dsimp [scalarBadMomentConstant, scalarDecay, S] have hcoeff : (10 ^ (8 * t + 4) + 2 : ℝ) / 2 ≤ 10 ^ (8 * t + 8) := by rcases ht with rfl | rfl | rfl <;> norm_num calc (10 ^ (8 * t + 4) * exp (-(40 * L)) * localScale lambda L ^ t + 2 * exp (-(40 * L)) * localScale lambda L ^ t) / 2 = ((10 ^ (8 * t + 4) + 2 : ℝ) / 2) * (exp (-(40 * L)) * localScale lambda L ^ t) := by ring _ ≤ 10 ^ (8 * t + 8) * (exp (-(40 * L)) * localScale lambda L ^ t) := mul_le_mul_of_nonneg_right hcoeff (by positivity) _ = 10 ^ (8 * t + 8) * exp (-(40 * L)) * localScale lambda L ^ t := by ring
4 supporting declarations (lemmas, instances)
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.

def normalizedDeviation reviewed
Causalean.Stat.Concentration.PoissonSelfNormalized

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)
m :
ℝ≥0
q :
ℝ≥0
w :
normalizedDeviation m q w :
|(w : ℝ) / (m : ℝ) - (q : ℝ)|
Causalean.Stat.Concentration.PoissonSelfNormalized.normalizedDeviation · Causalean/Stat/Concentration/PoissonSelfNormalized/Scaling.lean:18
def normalizedRadius reviewed
Causalean.Stat.Concentration.PoissonSelfNormalized

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)
m :
ℝ≥0
L :
w :
normalizedRadius m L w :
sqrt (((w : ℝ) / (m : ℝ)) * (L / (m : ℝ))) + L / (m : ℝ)
Causalean.Stat.Concentration.PoissonSelfNormalized.normalizedRadius · Causalean/Stat/Concentration/PoissonSelfNormalized/Scaling.lean:24
def normalizedBadAny reviewed
Causalean.Stat.Concentration.PoissonSelfNormalized

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)
ι Ω :
Type*
W :
ι → Ω → ℕ
H L :
m :
ℝ≥0
q :
ι → ℝ≥0
normalizedBadAny W H L m q :
Set Ω
{ω | ∃ i, normalizedDeviation m (q i) (W i ω) > (H / 4) * normalizedRadius m L (W i ω)}
Causalean.Stat.Concentration.PoissonSelfNormalized.normalizedBadAny · Causalean/Stat/Concentration/PoissonSelfNormalized/Scaling.lean:30
def normalizedAggregateScore reviewed
Causalean.Stat.Concentration.PoissonSelfNormalized

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)
ι Ω :
Type*
W :
ι → Ω → ℕ
H L :
m :
ℝ≥0
q :
ι → ℝ≥0
ω :
Ω
normalizedAggregateScore W H L m q ω :
∑ i, (normalizedDeviation m (q i) (W i ω) + H * normalizedRadius m L (W i ω))
Causalean.Stat.Concentration.PoissonSelfNormalized.normalizedAggregateScore · Causalean/Stat/Concentration/PoissonSelfNormalized/Scaling.lean:39
theorem independent_poisson_normalized_badAny_moment reviewed
Causalean.Stat.Concentration.PoissonSelfNormalized

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
ι Ω :
W :
ι → Ω → ℕ
q :
ι → ℝ≥0
m :
ℝ≥0
hm :
0 < m
hWmeas :
∀ i, Measurable (W i)
hWlaw :
∀ i, HasLaw (W i) (poissonMeasure (m * q i)) μ
hWindep :
iIndepFun W μ
r t :
hcard :
card ι ≤ r
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 r t * exp (-20 * L) * (sqrt (((∑ i, (q i : ℝ)) * L) / (m : ℝ)) + L / (m : ℝ)) ^ t
Proof (Lean source)
-- Proof route after `Product` is closed: for `m > 0`, prove pointwise -- `normalizedDeviation m q w = deviation (m*q) w / m` and -- `normalizedRadius m L w = radius L w / m` (use `Real.sqrt_div` and -- `Real.sqrt_sq_eq_abs`). Hence the normalized bad set is the unnormalized -- bad set at mean `m*q`, and the aggregate score is the corresponding score -- divided by `m`. Apply `independent_poisson_badAny_moment`, pull the positive -- constant `m^(-t)` through the indicator and integral, rewrite -- `sum_i (m*q_i)` as `m * sum_i q_i`, and identify the divided local scale -- with `sqrt (((sum_i q_i) * L) / m) + L/m`. theorem independent_poisson_normalized_badAny_moment {ι Ω : Type*} [Fintype ι] [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (W : ι → Ω → ℕ) (q : ι → ℝ≥0) (m : ℝ≥0) (hm : 0 < m) (hWmeas : ∀ i, Measurable (W i)) (hWlaw : ∀ i, HasLaw (W i) (poissonMeasure (m * q i)) μ) (hWindep : iIndepFun W μ) {r t : ℕ} (hcard : card ι ≤ r) (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 r t * exp (-20 * L) * (sqrt (((∑ i, (q i : ℝ)) * L) / (m : ℝ)) + L / (m : ℝ)) ^ t := by classical have hmR : 0 < (m : ℝ) := NNReal.coe_pos.mpr hm let lambda : ι → ℝ≥0 := fun i => m * q i have hbad : normalizedBadAny W universalH L m q = badAny W universalH L lambda := by ext ω simp only [normalizedBadAny, badAny, Set.mem_ofPred_eq] apply exists_congr intro i rw [normalizedDeviation_eq_div m (q i) hm, normalizedRadius_eq_div m hm] change deviation (lambda i) (W i ω) / (m : ℝ) > (universalH / 4) * (radius L (W i ω) / (m : ℝ)) ↔ _ rw [show (universalH / 4) * (radius L (W i ω) / (m : ℝ)) = ((universalH / 4) * radius L (W i ω)) / (m : ℝ) by ring] exact div_lt_div_iff_of_pos_right hmR have hagg (ω : Ω) : normalizedAggregateScore W universalH L m q ω = aggregateScore W universalH L lambda ω / (m : ℝ) := by unfold normalizedAggregateScore aggregateScore rw [Finset.sum_div] apply Finset.sum_congr rfl intro i _ rw [normalizedDeviation_eq_div m (q i) hm, normalizedRadius_eq_div m hm] change deviation (lambda i) (W i ω) / (m : ℝ) + universalH * (radius L (W i ω) / (m : ℝ)) = score universalH L (lambda i) (W i ω) / (m : ℝ) unfold score ring have hind (ω : Ω) : (badAny W universalH L lambda).indicator (fun ω => (normalizedAggregateScore W universalH L m q ω) ^ t) ω = (badAny W universalH L lambda).indicator (fun ω => (aggregateScore W universalH L lambda ω) ^ t) ω / (m : ℝ) ^ t := by by_cases hω : ω ∈ badAny W universalH L lambda <;> simp [hω, hagg, div_pow] have hlhs : (∫ ω, (normalizedBadAny W universalH L m q).indicator (fun ω => (normalizedAggregateScore W universalH L m q ω) ^ t) ω ∂μ) = (∫ ω, (badAny W universalH L lambda).indicator (fun ω => (aggregateScore W universalH L lambda ω) ^ t) ω ∂μ) / (m : ℝ) ^ t := by rw [hbad, ← integral_div] exact integral_congr_ae (Filter.Eventually.of_forall hind) have hprod := independent_poisson_badAny_moment μ W lambda hWmeas (by simpa [lambda] using hWlaw) hWindep hcard ht hL have hdiv := (div_le_div_iff_of_pos_right (pow_pos hmR t)).2 hprod rw [hlhs] calc (∫ ω, (badAny W universalH L lambda).indicator (fun ω => (aggregateScore W universalH L lambda ω) ^ t) ω ∂μ) / (m : ℝ) ^ t ≤ (productMomentConstant r t * exp (-20 * L) * (sqrt ((∑ i, (lambda i : ℝ)) * L) + L) ^ t) / (m : ℝ) ^ t := hdiv _ = productMomentConstant r t * exp (-20 * L) * (sqrt (((∑ i, (q i : ℝ)) * L) / (m : ℝ)) + L / (m : ℝ)) ^ t := by have hsum : ∑ i, (lambda i : ℝ) = (m : ℝ) * ∑ i, (q i : ℝ) := by simp [lambda, Finset.mul_sum] rw [hsum] have hq0 : 0 ≤ ∑ i, (q i : ℝ) := sum_nonneg fun i _ => (q i).coe_nonneg have hL0 : 0 ≤ L := by linarith have hsqrt : sqrt (((m : ℝ) * (∑ i, (q i : ℝ))) * L) / (m : ℝ) = sqrt (((∑ i, (q i : ℝ)) * L) / (m : ℝ)) := by symm calc sqrt (((∑ i, (q i : ℝ)) * L) / (m : ℝ)) = sqrt ((((m : ℝ) * (∑ i, (q i : ℝ))) * L) / ((m : ℝ) ^ 2)) := by congr 1 field_simp _ = sqrt (((m : ℝ) * (∑ i, (q i : ℝ))) * L) / sqrt ((m : ℝ) ^ 2) := by rw [Real.sqrt_div] positivity _ = sqrt (((m : ℝ) * (∑ i, (q i : ℝ))) * L) / (m : ℝ) := by rw [Real.sqrt_sq_eq_abs, abs_of_pos hmR] have hscale : (sqrt (((m : ℝ) * (∑ i, (q i : ℝ))) * L) + L) / (m : ℝ) = sqrt (((∑ i, (q i : ℝ)) * L) / (m : ℝ)) + L / (m : ℝ) := by rw [add_div, hsqrt] calc productMomentConstant r t * exp (-20 * L) * (sqrt (((m : ℝ) * ∑ i, (q i : ℝ)) * L) + L) ^ t / (m : ℝ) ^ t = productMomentConstant r t * exp (-20 * L) * ((sqrt (((m : ℝ) * ∑ i, (q i : ℝ)) * L) + L) / (m : ℝ)) ^ t := by rw [div_pow]; ring _ = _ := by rw [hscale]
Causalean.Stat.Concentration.PoissonSelfNormalized.independent_poisson_normalized_badAny_moment · Causalean/Stat/Concentration/PoissonSelfNormalized/Scaling.lean:81 · uses normalizedAggregateScore , normalizedBadAny , productMomentConstant , universalH
1 supporting declaration (lemmas, instances)