Stat.Concentration.Poisson

Concentration inequalities for Poisson counts and processes, including self-normalized forms.

Self­Normalized 22 core · 21 supporting · 5 submodules Self-normalized concentration inequalities for Poisson observations. Empirical­Radius 6 core · 8 supporting · 1 submodule These bounds use the count-dependent radius H * (sqrt ((w/m) * δ) + δ).
Conditional­Product 3 core · 9 supporting The two count tables have separate product laws. ★ poissonTable_pilot_cell_indicators_independent

Conditioning a finite product of pilot and evaluation Poisson counts

The two count tables have separate product laws. Their product has an outer pilot integral and an inner evaluation integral. For each fixed pilot table, evaluation coordinates retain their Poisson marginals and independence, including after measurable coordinatewise transformations selected by that pilot table.

def poissonTableLaw reviewed
Causalean.Stat.Concentration.Poisson

Coordinate Poisson rates determine the joint law of a finite table of independent Poisson counts, given by the finite product of the coordinate laws.

Definition (Lean source)
ι :
Type*
rate :
ι → ℝ≥0
poissonTableLaw rate :
Measure (ι → ℕ)
infinitePi (fun i => poissonMeasure (rate i))
Causalean.Stat.Concentration.Poisson.poissonTableLaw · Causalean/Stat/Concentration/Poisson/ConditionalProduct.lean:22
def poissonTableCell reviewed
Causalean.Stat.Concentration.Poisson

A cell label and a flattened count table determine the four-count subtable for that cell, given by selecting its four coordinates.

Definition (Lean source)
J :
Type*
j :
J
table :
(J × Fin 4) → ℕ
poissonTableCell j table :
Fin 4 → ℕ
fun z => table (j, z)
Causalean.Stat.Concentration.Poisson.poissonTableCell · Causalean/Stat/Concentration/Poisson/ConditionalProduct.lean:108
theorem poissonTable_pilot_cell_indicators_independent reviewed
Causalean.Stat.Concentration.Poisson

Given evaluation-cell rates, a fixed pilot table, whole-cell pilot indicators, and evaluation-cell statistics that are measurable in the evaluation cell at that pilot table, the cell statistics, each set to zero when its pilot indicator fails and viewed as functions of the evaluation table, are mutually independent across cells under the evaluation-table Poisson law.

Formal statement
J :
Type*
evalRate :
J → Fin 4 → ℝ≥0
p :
(J × Fin 4) → ℕ
good :
J → (Fin 4 → ℕ) → Bool
φ :
J → (Fin 4 → ℕ) → (Fin 4 → ℕ) → ℝ
hφ :
∀ j, Measurable (φ j (poissonTableCell j p))
iIndepFun (fun j (e : (J × Fin 4) → ℕ) => if good j (poissonTableCell j p) then φ j (poissonTableCell j p) (poissonTableCell j e) else 0) (poissonTableLaw (fun iz : J × Fin 4 => evalRate iz.1 iz.2))
Proof (Lean source)
theorem poissonTable_pilot_cell_indicators_independent {J : Type*} [Fintype J] (evalRate : J → Fin 4 → ℝ≥0) (p : (J × Fin 4) → ℕ) (good : J → (Fin 4 → ℕ) → Bool) (φ : J → (Fin 4 → ℕ) → (Fin 4 → ℕ) → ℝ) (hφ : ∀ j, Measurable (φ j (poissonTableCell j p))) : iIndepFun (fun j (e : (J × Fin 4) → ℕ) => if good j (poissonTableCell j p) then φ j (poissonTableCell j p) (poissonTableCell j e) else 0) (poissonTableLaw (fun iz : J × Fin 4 => evalRate iz.1 iz.2)) := by apply poissonTable_pilot_cell_maps_independent evalRate p (fun j q w => if good j q then φ j q w else 0) intro j by_cases h : good j (poissonTableCell j p) <;> simp [h, hφ j]
Causalean.Stat.Concentration.Poisson.poissonTable_pilot_cell_indicators_independent · Causalean/Stat/Concentration/Poisson/ConditionalProduct.lean:135 · uses poissonTableCell , poissonTableLaw
9 supporting declarations (lemmas, instances)
Factorial­Polynomial 2 core · 7 supporting Exact first and mixed second moments of the normalized, centered falling-factorial lift. ★ poisson_factorialLift_mixed

Centered Poisson falling-factorial moments

Exact first and mixed second moments of the normalized, centered falling-factorial lift. The finite-coordinate product identities and an exponential second-moment envelope are built from the scalar identities. No research-specific pilot or cell model occurs here.

def factorialLift reviewed
Causalean.Stat.Concentration.Poisson

For a normalization m, a center z, a natural count N, and an order h, the normalized centered falling-factorial lift is the sum over t from 0 to h of the binomial coefficient h-choose-t times (−z)^(h−t) times the falling factorial N(N−1)⋯(N−t+1) divided by m^t; it is the expansion of (N/m − z)^h with each power N^t replaced by the falling factorial.

Definition (Lean source)
m z :
ℝ
N h :
ℕ
factorialLift m z N h :
ℝ
∑ t ∈ range (h + 1), (h.choose t : ℝ) * (-z) ^ (h - t) * (N.descFactorial t : ℝ) / m ^ t
Causalean.Stat.Concentration.Poisson.factorialLift · Causalean/Stat/Concentration/Poisson/FactorialPolynomial.lean:57
theorem poisson_factorialLift_mixed reviewed
Causalean.Stat.Concentration.Poisson

For a Poisson count with a given rate, a normalization m and a center z with m nonzero, and two orders h and t, the expected product of the order-h and order-t centered factorial lifts equals the sum over r from 0 to min(h, t) of h-choose-r times t-choose-r times r! times (rate/m²)^r times (rate/m − z)^(h+t−2r).

Formal statement
rate :
m z :
ℝ
hm :
m ≠ 0
h t :
ℕ
(∫ N : ℕ, factorialLift m z N h * factorialLift m z N t ∂poissonMeasure rate)
= ∑ r ∈ range (min h t + 1), (h.choose r : ℝ) * (t.choose r : ℝ) * (Nat.factorial r : ℝ) * ((rate : ℝ) / m ^ 2) ^ r * ((rate : ℝ) / m - z) ^ (h + t - 2 * r)
Proof (Lean source)
theorem poisson_factorialLift_mixed (rate : NNReal) (m z : ℝ) (hm : m ≠ 0) (h t : ℕ) : (∫ N : ℕ, factorialLift m z N h * factorialLift m z N t ∂poissonMeasure rate) = ∑ r ∈ range (min h t + 1), (h.choose r : ℝ) * (t.choose r : ℝ) * (Nat.factorial r : ℝ) * ((rate : ℝ) / m ^ 2) ^ r * ((rate : ℝ) / m - z) ^ (h + t - 2 * r) := by exact (poisson_factorialLift_mixed_expansion rate m z hm h t).trans (factorialLift_mixed_finite_identity ((rate : ℝ) / m) ((rate : ℝ) / m ^ 2) z h t)
Causalean.Stat.Concentration.Poisson.poisson_factorialLift_mixed · Causalean/Stat/Concentration/Poisson/FactorialPolynomial.lean:564 · uses factorialLift
7 supporting declarations (lemmas, instances)
  • poisson_descFactorial_moment theorem — The falling factorial of a Poisson count has mean equal to the corresponding power of its rate. A direct proof shifts the Poisson series by h and cancels factorials.
    rate :
    h :
    ℕ
    (∫ N : ℕ, (N.descFactorial h : ℝ) ∂poissonMeasure rate) = (rate : ℝ) ^ h
    Proof (Lean source)
    theorem poisson_descFactorial_moment (rate : NNReal) (h : ℕ) : (∫ N : ℕ, (N.descFactorial h : ℝ) ∂poissonMeasure rate) = (rate : ℝ) ^ h := by rw [integral_poissonMeasure] simp only [smul_eq_mul] let f : ℕ → ℝ := fun N => exp (-(rate : ℝ)) * (rate : ℝ) ^ N / (N.factorial : ℝ) * (N.descFactorial h : ℝ) have hshift : Summable (fun k => f (k + h)) := (summable_nat_add_iff h).mpr (summable_poisson_descFactorial rate h) have hprefix : ∑ k ∈ range h, f k = 0 := by apply Finset.sum_eq_zero intro k hk have hkh : k < h := Finset.mem_range.mp hk simp [f, Nat.descFactorial_eq_zero_iff_lt.mpr hkh] calc ∑' N, exp (-(rate : ℝ)) * (rate : ℝ) ^ N / ↑N.factorial * ↑(N.descFactorial h) = ∑' N, f N := by rfl _ = ∑ k ∈ range h, f k + ∑' k, f (k + h) := (hshift.sum_add_tsum_nat_add').symm _ = ∑' k, (((rate : ℝ) ^ h * exp (-(rate : ℝ))) * ((rate : ℝ) ^ k / (k.factorial : ℝ))) := by rw [hprefix, zero_add] congr 1 funext k exact poisson_descFactorial_shift rate h k _ = ((rate : ℝ) ^ h * exp (-(rate : ℝ))) * exp (rate : ℝ) := by rw [tsum_mul_left] simpa only [Real.exp_eq_exp_ℝ] using congrArg (fun z : ℝ => ((rate : ℝ) ^ h * exp (-(rate : ℝ))) * z) (NormedSpace.expSeries_div_hasSum_exp (rate : ℝ)).tsum_eq _ = (rate : ℝ) ^ h := by rw [mul_assoc, ← Real.exp_add] ring_nf simp
    Causalean.Stat.Concentration.Poisson.poisson_descFactorial_moment · Causalean/Stat/Concentration/Poisson/FactorialPolynomial.lean:65
  • descFactorial_mul theorem — The product of two falling factorials expands by their overlap count. This identity is purely combinatorial and also supplies the Poisson mixed second moment after integration.
    N h t :
    ℕ
    (N.descFactorial h : ℝ) * (N.descFactorial t : ℝ)
    = ∑ r ∈ range (min h t + 1), (h.choose r : ℝ) * (t.choose r : ℝ) * (Nat.factorial r : ℝ) * (N.descFactorial (h + t - r) : ℝ)
    Proof (Lean source)
    theorem descFactorial_mul (N h t : ℕ) : (N.descFactorial h : ℝ) * (N.descFactorial t : ℝ) = ∑ r ∈ range (min h t + 1), (h.choose r : ℝ) * (t.choose r : ℝ) * (Nat.factorial r : ℝ) * (N.descFactorial (h + t - r) : ℝ) := by have hp := congrArg (eval (N : ℤ)) (descPochhammer_mul_linearization h t) simp only [Polynomial.eval_mul, Polynomial.eval_finsetSum, Polynomial.eval_C, descPochhammer_eval_eq_descFactorial] at hp have hn : N.descFactorial h * N.descFactorial t = ∑ r ∈ range (min h t + 1), choose h r * choose t r * r.factorial * N.descFactorial (h + t - r) := by exact_mod_cast hp exact_mod_cast hn
    Causalean.Stat.Concentration.Poisson.descFactorial_mul · Causalean/Stat/Concentration/Poisson/FactorialPolynomial.lean:199
  • poisson_descFactorial_integrable theorem — Every falling factorial of a Poisson count is integrable. This is the integrability prerequisite for passing finite falling-factorial expansions through the integral.
    rate :
    h :
    ℕ
    Integrable (fun N : ℕ => (N.descFactorial h : ℝ)) (poissonMeasure rate)
    Proof (Lean source)
    theorem poisson_descFactorial_integrable (rate : NNReal) (h : ℕ) : Integrable (fun N : ℕ => (N.descFactorial h : ℝ)) (poissonMeasure rate) := by rw [integrable_poissonMeasure_iff] convert summable_poisson_descFactorial rate h using 1 ext N rw [Real.norm_eq_abs, abs_of_nonneg (by positivity)]
    Causalean.Stat.Concentration.Poisson.poisson_descFactorial_integrable · Causalean/Stat/Concentration/Poisson/FactorialPolynomial.lean:218
  • poisson_descFactorial_mixed theorem — The mixed raw falling-factorial moment is the overlap sum of powers of the Poisson rate. It follows by integrating descFactorial_mul term by term.
    rate :
    h t :
    ℕ
    (∫ N : ℕ, (N.descFactorial h : ℝ) * (N.descFactorial t : ℝ) ∂poissonMeasure rate)
    = ∑ r ∈ range (min h t + 1), (h.choose r : ℝ) * (t.choose r : ℝ) * (Nat.factorial r : ℝ) * (rate : ℝ) ^ (h + t - r)
    Proof (Lean source)
    theorem poisson_descFactorial_mixed (rate : NNReal) (h t : ℕ) : (∫ N : ℕ, (N.descFactorial h : ℝ) * (N.descFactorial t : ℝ) ∂poissonMeasure rate) = ∑ r ∈ range (min h t + 1), (h.choose r : ℝ) * (t.choose r : ℝ) * (Nat.factorial r : ℝ) * (rate : ℝ) ^ (h + t - r) := by calc (∫ N : ℕ, (N.descFactorial h : ℝ) * (N.descFactorial t : ℝ) ∂poissonMeasure rate) = ∫ N : ℕ, ∑ r ∈ range (min h t + 1), (h.choose r : ℝ) * (t.choose r : ℝ) * (Nat.factorial r : ℝ) * (N.descFactorial (h + t - r) : ℝ) ∂poissonMeasure rate := by congr 1 funext N exact descFactorial_mul N h t _ = ∑ r ∈ range (min h t + 1), (h.choose r : ℝ) * (t.choose r : ℝ) * (Nat.factorial r : ℝ) * (rate : ℝ) ^ (h + t - r) := by rw [integral_finsetSum] · apply Finset.sum_congr rfl intro r _ rw [integral_const_mul, poisson_descFactorial_moment] · intro r _ exact (poisson_descFactorial_integrable rate (h + t - r)).const_mul _
    Causalean.Stat.Concentration.Poisson.poisson_descFactorial_mixed · Causalean/Stat/Concentration/Poisson/FactorialPolynomial.lean:228
  • poisson_factorialLift_mean theorem — A normalized centered factorial lift under a Poisson law has expectation (rate/m-z)^h. This is the exact unbiasedness identity for one coordinate.
    rate :
    m z :
    ℝ
    h :
    ℕ
    (∫ N : ℕ, factorialLift m z N h ∂poissonMeasure rate) = ((rate : ℝ) / m - z) ^ h
    Proof (Lean source)
    theorem poisson_factorialLift_mean (rate : NNReal) (m z : ℝ) (h : ℕ) : (∫ N : ℕ, factorialLift m z N h ∂poissonMeasure rate) = ((rate : ℝ) / m - z) ^ h := by calc (∫ N : ℕ, factorialLift m z N h ∂poissonMeasure rate) = ∫ N : ℕ, ∑ t ∈ range (h + 1), ((h.choose t : ℝ) * (-z) ^ (h - t) / m ^ t) * (N.descFactorial t : ℝ) ∂poissonMeasure rate := by congr 1 funext N simp only [factorialLift] apply Finset.sum_congr rfl intro t _ ring _ = ∑ t ∈ range (h + 1), ((h.choose t : ℝ) * (-z) ^ (h - t) / m ^ t) * (rate : ℝ) ^ t := by rw [integral_finsetSum] · apply Finset.sum_congr rfl intro t _ rw [integral_const_mul, poisson_descFactorial_moment] · intro t _ exact (poisson_descFactorial_integrable rate t).const_mul _ _ = ((rate : ℝ) / m - z) ^ h := by rw [sub_eq_add_neg, add_pow] apply Finset.sum_congr rfl intro t _ rw [div_pow] ring
    Causalean.Stat.Concentration.Poisson.poisson_factorialLift_mean · Causalean/Stat/Concentration/Poisson/FactorialPolynomial.lean:256
  • factorialLift_mixed_finite_identity theorem — The two binomial shifts of a finite overlap polynomial regroup into overlap powers of x-z. This is the finite algebraic identity behind centered Poisson factorial mixed moments.
    x v z :
    ℝ
    h t :
    ℕ
    (∑ j ∈ range (h + 1), ∑ k ∈ range (t + 1), (h.choose j : ℝ) * (t.choose k : ℝ) * (-z) ^ (h - j + (t - k)) * (∑ r ∈ range (min j k + 1), (j.choose r : ℝ) * (k.choose r : ℝ) * (Nat.factorial r : ℝ) * v ^ r * x ^ (j + k - 2 * r)))
    = ∑ r ∈ range (min h t + 1), (h.choose r : ℝ) * (t.choose r : ℝ) * (Nat.factorial r : ℝ) * v ^ r * (x - z) ^ (h + t - 2 * r)
    Proof (Lean source)
    theorem factorialLift_mixed_finite_identity (x v z : ℝ) (h t : ℕ) : (∑ j ∈ range (h + 1), ∑ k ∈ range (t + 1), (h.choose j : ℝ) * (t.choose k : ℝ) * (-z) ^ (h - j + (t - k)) * (∑ r ∈ range (min j k + 1), (j.choose r : ℝ) * (k.choose r : ℝ) * (Nat.factorial r : ℝ) * v ^ r * x ^ (j + k - 2 * r))) = ∑ r ∈ range (min h t + 1), (h.choose r : ℝ) * (t.choose r : ℝ) * (Nat.factorial r : ℝ) * v ^ r * (x - z) ^ (h + t - 2 * r) := by let A : ℕ → ℕ → ℝ := fun r j => (h.choose j : ℝ) * (-z) ^ (h - j) * (j.choose r : ℝ) * x ^ (j - r) let B : ℕ → ℕ → ℝ := fun r k => (t.choose k : ℝ) * (-z) ^ (t - k) * (k.choose r : ℝ) * x ^ (k - r) have hfactor (j k r : ℕ) : (h.choose j : ℝ) * (t.choose k : ℝ) * (-z) ^ (h - j + (t - k)) * ((j.choose r : ℝ) * (k.choose r : ℝ) * (Nat.factorial r : ℝ) * v ^ r * x ^ (j + k - 2 * r)) = A r j * B r k * ((Nat.factorial r : ℝ) * v ^ r) := by by_cases hj : r ≤ j · by_cases hk : r ≤ k · have he : j + k - 2 * r = (j - r) + (k - r) := by omega rw [pow_add, he, pow_add] dsimp [A, B] ring · have hk' : k < r := by omega simp [B, Nat.choose_eq_zero_of_lt hk'] · have hj' : j < r := by omega simp [A, Nat.choose_eq_zero_of_lt hj'] have hextend (j k : ℕ) (hj : j ≤ h) (hk : k ≤ t) : (∑ r ∈ range (min j k + 1), (j.choose r : ℝ) * (k.choose r : ℝ) * (Nat.factorial r : ℝ) * v ^ r * x ^ (j + k - 2 * r)) = ∑ r ∈ range (min h t + 1), (j.choose r : ℝ) * (k.choose r : ℝ) * (Nat.factorial r : ℝ) * v ^ r * x ^ (j + k - 2 * r) := by apply Finset.sum_subset ?_ ?_ · intro r hr simp only [Finset.mem_range] at hr ⊢ have hm : min j k ≤ min h t := min_le_min hj hk omega · intro r hr hr' simp only [Finset.mem_range] at hr hr' have hlt : min j k < r := by omega rcases le_total j k with hle | hle · have : j < r := by simpa [Nat.min_eq_left hle] using hlt simp [Nat.choose_eq_zero_of_lt this] · have : k < r := by simpa [Nat.min_eq_right hle] using hlt simp [Nat.choose_eq_zero_of_lt this] calc (∑ j ∈ range (h + 1), ∑ k ∈ range (t + 1), (h.choose j : ℝ) * (t.choose k : ℝ) * (-z) ^ (h - j + (t - k)) * (∑ r ∈ range (min j k + 1), (j.choose r : ℝ) * (k.choose r : ℝ) * (Nat.factorial r : ℝ) * v ^ r * x ^ (j + k - 2 * r))) = ∑ j ∈ range (h + 1), ∑ k ∈ range (t + 1), ∑ r ∈ range (min h t + 1), A r j * B r k * ((Nat.factorial r : ℝ) * v ^ r) := by apply Finset.sum_congr rfl intro j hj apply Finset.sum_congr rfl intro k hk rw [hextend j k (by simpa using hj) (by simpa using hk)] rw [Finset.mul_sum] apply Finset.sum_congr rfl intro r hr exact hfactor j k r _ = ∑ r ∈ range (min h t + 1), ((∑ j ∈ range (h + 1), A r j) * (∑ k ∈ range (t + 1), B r k)) * ((Nat.factorial r : ℝ) * v ^ r) := by have hswap (j : ℕ) : (∑ k ∈ range (t + 1), ∑ r ∈ range (min h t + 1), A r j * B r k * ((Nat.factorial r : ℝ) * v ^ r)) = ∑ r ∈ range (min h t + 1), ∑ k ∈ range (t + 1), A r j * B r k * ((Nat.factorial r : ℝ) * v ^ r) := Finset.sum_comm simp_rw [hswap] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro r hr calc (∑ j ∈ range (h + 1), ∑ k ∈ range (t + 1), A r j * B r k * ((Nat.factorial r : ℝ) * v ^ r)) = (∑ j ∈ range (h + 1), ∑ k ∈ range (t + 1), A r j * B r k) * ((Nat.factorial r : ℝ) * v ^ r) := by rw [Finset.sum_mul] apply Finset.sum_congr rfl intro j hj rw [Finset.sum_mul] _ = _ := by rw [Finset.sum_mul_sum] _ = ∑ r ∈ range (min h t + 1), (h.choose r : ℝ) * (t.choose r : ℝ) * (Nat.factorial r : ℝ) * v ^ r * (x - z) ^ (h + t - 2 * r) := by apply Finset.sum_congr rfl intro r hr have hrh : r ≤ h := by have := Finset.mem_range.mp hr; omega have hrt : r ≤ t := by have := Finset.mem_range.mp hr; omega rw [show (∑ j ∈ range (h + 1), A r j) = (h.choose r : ℝ) * (x - z) ^ (h - r) from factorialLift_shift_sum x z h r hrh] rw [show (∑ k ∈ range (t + 1), B r k) = (t.choose r : ℝ) * (x - z) ^ (t - r) from factorialLift_shift_sum x z t r hrt] have he : h + t - 2 * r = (h - r) + (t - r) := by omega rw [he, pow_add] ring
    Causalean.Stat.Concentration.Poisson.factorialLift_mixed_finite_identity · Causalean/Stat/Concentration/Poisson/FactorialPolynomial.lean:324
  • poisson_factorialLift_mixed_expansion theorem — The Poisson mixed moment of two centered factorial lifts expands as a finite double binomial sum of raw falling-factorial overlap moments. The factors x=rate/m and v=rate/m² separate centering from Poisson variance.
    rate :
    m z :
    ℝ
    hm :
    m ≠ 0
    h t :
    ℕ
    (∫ N : ℕ, factorialLift m z N h * factorialLift m z N t ∂poissonMeasure rate)
    = ∑ j ∈ range (h + 1), ∑ k ∈ range (t + 1), (h.choose j : ℝ) * (t.choose k : ℝ) * (-z) ^ (h - j + (t - k)) * (∑ r ∈ range (min j k + 1), (j.choose r : ℝ) * (k.choose r : ℝ) * (Nat.factorial r : ℝ) * ((rate : ℝ) / m ^ 2) ^ r * ((rate : ℝ) / m) ^ (j + k - 2 * r))
    Proof (Lean source)
    theorem poisson_factorialLift_mixed_expansion (rate : NNReal) (m z : ℝ) (hm : m ≠ 0) (h t : ℕ) : (∫ N : ℕ, factorialLift m z N h * factorialLift m z N t ∂poissonMeasure rate) = ∑ j ∈ range (h + 1), ∑ k ∈ range (t + 1), (h.choose j : ℝ) * (t.choose k : ℝ) * (-z) ^ (h - j + (t - k)) * (∑ r ∈ range (min j k + 1), (j.choose r : ℝ) * (k.choose r : ℝ) * (Nat.factorial r : ℝ) * ((rate : ℝ) / m ^ 2) ^ r * ((rate : ℝ) / m) ^ (j + k - 2 * r)) := by have hraw (j k : ℕ) : Integrable (fun N : ℕ => (N.descFactorial j : ℝ) * (N.descFactorial k : ℝ)) (poissonMeasure rate) := by have h := integrable_finsetSum (range (min j k + 1)) (fun r _ => (poisson_descFactorial_integrable rate (j + k - r)).const_mul ((j.choose r : ℝ) * (k.choose r : ℝ) * (Nat.factorial r : ℝ))) have heq : (fun N : ℕ => (N.descFactorial j : ℝ) * (N.descFactorial k : ℝ)) = (fun N : ℕ => ∑ r ∈ range (min j k + 1), (j.choose r : ℝ) * (k.choose r : ℝ) * (Nat.factorial r : ℝ) * (N.descFactorial (j + k - r) : ℝ)) := by funext N exact descFactorial_mul N j k rw [heq] exact h have hnormalize (j k r : ℕ) (hr : r ≤ min j k) : (rate : ℝ) ^ (j + k - r) / (m ^ j * m ^ k) = ((rate : ℝ) / m ^ 2) ^ r * ((rate : ℝ) / m) ^ (j + k - 2 * r) := by have h₁ : j + k - r = r + (j + k - 2 * r) := by omega have h₂ : j + k = 2 * r + (j + k - 2 * r) := by omega calc (rate : ℝ) ^ (j + k - r) / (m ^ j * m ^ k) = (rate : ℝ) ^ r * (rate : ℝ) ^ (j + k - 2 * r) / (m ^ (2 * r) * m ^ (j + k - 2 * r)) := by have hden : m ^ j * m ^ k = m ^ (2 * r) * m ^ (j + k - 2 * r) := by calc m ^ j * m ^ k = m ^ (j + k) := (pow_add m j k).symm _ = m ^ (2 * r + (j + k - 2 * r)) := congrArg (fun n : ℕ => m ^ n) h₂ _ = _ := pow_add m (2 * r) (j + k - 2 * r) rw [h₁, pow_add, hden] _ = ((rate : ℝ) / m ^ 2) ^ r * ((rate : ℝ) / m) ^ (j + k - 2 * r) := by rw [div_pow, div_pow, pow_mul] field_simp [hm] calc (∫ N : ℕ, factorialLift m z N h * factorialLift m z N t ∂poissonMeasure rate) = ∫ N : ℕ, ∑ j ∈ range (h + 1), ∑ k ∈ range (t + 1), ((h.choose j : ℝ) * (t.choose k : ℝ) * (-z) ^ (h - j + (t - k)) / (m ^ j * m ^ k)) * ((N.descFactorial j : ℝ) * (N.descFactorial k : ℝ)) ∂poissonMeasure rate := by congr 1 funext N simp only [factorialLift, Finset.sum_mul_sum] apply Finset.sum_congr rfl intro j _ apply Finset.sum_congr rfl intro k _ rw [pow_add] ring _ = ∑ j ∈ range (h + 1), ∑ k ∈ range (t + 1), ((h.choose j : ℝ) * (t.choose k : ℝ) * (-z) ^ (h - j + (t - k)) / (m ^ j * m ^ k)) * (∑ r ∈ range (min j k + 1), (j.choose r : ℝ) * (k.choose r : ℝ) * (Nat.factorial r : ℝ) * (rate : ℝ) ^ (j + k - r)) := by rw [integral_finsetSum] · apply Finset.sum_congr rfl intro j _ rw [integral_finsetSum] · apply Finset.sum_congr rfl intro k _ rw [integral_const_mul, poisson_descFactorial_mixed] · intro k _ exact (hraw j k).const_mul _ · intro j _ exact integrable_finsetSum _ (fun k _ => (hraw j k).const_mul _) _ = ∑ j ∈ range (h + 1), ∑ k ∈ range (t + 1), (h.choose j : ℝ) * (t.choose k : ℝ) * (-z) ^ (h - j + (t - k)) * (∑ r ∈ range (min j k + 1), (j.choose r : ℝ) * (k.choose r : ℝ) * (Nat.factorial r : ℝ) * ((rate : ℝ) / m ^ 2) ^ r * ((rate : ℝ) / m) ^ (j + k - 2 * r)) := by apply Finset.sum_congr rfl intro j _ apply Finset.sum_congr rfl intro k _ rw [Finset.mul_sum, Finset.mul_sum] apply Finset.sum_congr rfl intro r hr have hr' : r ≤ min j k := by have := Finset.mem_range.mp hr omega calc _ = (h.choose j : ℝ) * (t.choose k : ℝ) * (-z) ^ (h - j + (t - k)) * ((j.choose r : ℝ) * (k.choose r : ℝ) * (Nat.factorial r : ℝ) * ((rate : ℝ) ^ (j + k - r) / (m ^ j * m ^ k))) := by ring _ = _ := by rw [hnormalize j k r hr']; ring
    Causalean.Stat.Concentration.Poisson.poisson_factorialLift_mixed_expansion · Causalean/Stat/Concentration/Poisson/FactorialPolynomial.lean:446
Conditional­Cell­Composition 1 core · 3 supporting A statistic may depend on all four pilot counts in a cell and all four evaluation counts in the same cell. ★ poissonTable_cell_nonneg_integral_le_of_sections

Joint pilot-cell and evaluation-cell statistics

A statistic may depend on all four pilot counts in a cell and all four evaluation counts in the same cell. This module derives joint measurability and product-law disintegration from measurable compositions and an integrable envelope.

theorem poissonTable_cell_nonneg_integral_le_of_sections reviewed
Causalean.Stat.Concentration.Poisson

Let a pilot table and an evaluation table of independent Poisson counts, four per cell, have pilot-cell rates and evaluation-cell rates, and be independent of each other. Fix a cell, a measurable yes/no indicator of that cell's four pilot counts, and a jointly measurable nonnegative statistic of that cell's four pilot counts and four evaluation counts, and consider the statistic set to zero when the indicator fails. If, for every fixed pilot table, this gated statistic is integrable over the evaluation table, and its evaluation-table expectation is at most a function of the pilot table that is integrable under the pilot law, then the joint expectation of the gated statistic over both tables is at most the pilot-table expectation of that bounding function.

Formal statement
J :
Type*
pilotRate evalRate :
J → Fin 4 → ℝ≥0
j :
J
good :
(Fin 4 → ℕ) → Bool
hgood :
φ :
(Fin 4 → ℕ) → (Fin 4 → ℕ) → ℝ
hφ :
hφ_nonneg :
∀ u v, 0 ≤ φ u v
hsection_int :
∀ p : (J × Fin 4) → ℕ,
Integrable (fun e : (J × Fin 4) → ℕ => if good (poissonTableCell j p) then φ (poissonTableCell j p) (poissonTableCell j e) else 0) (poissonTableLaw (fun iz : J × Fin 4 => evalRate iz.1 iz.2))
bound :
((J × Fin 4) → ℕ) → ℝ
hbound :
Integrable bound (poissonTableLaw (fun iz : J × Fin 4 => pilotRate iz.1 iz.2))
hsection_bound :
∀ p : (J × Fin 4) → ℕ,
(∫ e : (J × Fin 4) → ℕ, (if good (poissonTableCell j p) then φ (poissonTableCell j p) (poissonTableCell j e) else 0) ∂poissonTableLaw (fun iz : J × Fin 4 => evalRate iz.1 iz.2))
≤ bound p
(∫ pe, (if good (poissonTableCell j pe.1) then φ (poissonTableCell j pe.1) (poissonTableCell j pe.2) else 0) ∂(poissonTableLaw (fun iz : J × Fin 4 => pilotRate iz.1 iz.2)).prod (poissonTableLaw (fun iz : J × Fin 4 => evalRate iz.1 iz.2)))
≤ ∫ p, bound p ∂poissonTableLaw (fun iz : J × Fin 4 => pilotRate iz.1 iz.2)
Proof (Lean source)
-- Use `integrable_prod_iff` after proving the outer integral of the absolute -- value is dominated by `bound`; nonnegativity identifies that absolute value -- with the conditional integral already bounded by `hsection_bound`. theorem poissonTable_cell_nonneg_integral_le_of_sections {J : Type*} [Fintype J] (pilotRate evalRate : J → Fin 4 → ℝ≥0) (j : J) (good : (Fin 4 → ℕ) → Bool) (hgood : Measurable good) (φ : (Fin 4 → ℕ) → (Fin 4 → ℕ) → ℝ) (hφ : Measurable (uncurry φ)) (hφ_nonneg : ∀ u v, 0 ≤ φ u v) (hsection_int : ∀ p : (J × Fin 4) → ℕ, Integrable (fun e : (J × Fin 4) → ℕ => if good (poissonTableCell j p) then φ (poissonTableCell j p) (poissonTableCell j e) else 0) (poissonTableLaw (fun iz : J × Fin 4 => evalRate iz.1 iz.2))) (bound : ((J × Fin 4) → ℕ) → ℝ) (hbound : Integrable bound (poissonTableLaw (fun iz : J × Fin 4 => pilotRate iz.1 iz.2))) (hsection_bound : ∀ p : (J × Fin 4) → ℕ, (∫ e : (J × Fin 4) → ℕ, (if good (poissonTableCell j p) then φ (poissonTableCell j p) (poissonTableCell j e) else 0) ∂poissonTableLaw (fun iz : J × Fin 4 => evalRate iz.1 iz.2)) ≤ bound p) : (∫ pe, (if good (poissonTableCell j pe.1) then φ (poissonTableCell j pe.1) (poissonTableCell j pe.2) else 0) ∂(poissonTableLaw (fun iz : J × Fin 4 => pilotRate iz.1 iz.2)).prod (poissonTableLaw (fun iz : J × Fin 4 => evalRate iz.1 iz.2))) ≤ ∫ p, bound p ∂poissonTableLaw (fun iz : J × Fin 4 => pilotRate iz.1 iz.2) := by let f : (((J × Fin 4) → ℕ) × ((J × Fin 4) → ℕ)) → ℝ := fun pe => if good (poissonTableCell j pe.1) then φ (poissonTableCell j pe.1) (poissonTableCell j pe.2) else 0 have hf_meas : Measurable f := poissonTable_cell_indicator_measurable j good hgood φ hφ have hf_nonneg : ∀ pe, 0 ≤ f pe := by intro pe dsimp [f] split_ifs <;> simp [hφ_nonneg] have hnorm : (fun p => ∫ e, ‖f (p, e)‖ ∂poissonTableLaw (fun iz : J × Fin 4 => evalRate iz.1 iz.2)) = (fun p => ∫ e, f (p, e) ∂poissonTableLaw (fun iz : J × Fin 4 => evalRate iz.1 iz.2)) := by funext p congr 1 funext e exact Real.norm_eq_abs (f (p, e)) ▸ abs_of_nonneg (hf_nonneg (p, e)) have houter : Integrable (fun p => ∫ e, ‖f (p, e)‖ ∂poissonTableLaw (fun iz : J × Fin 4 => evalRate iz.1 iz.2)) (poissonTableLaw (fun iz : J × Fin 4 => pilotRate iz.1 iz.2)) := by haveI : IsProbabilityMeasure (poissonTableLaw (fun iz : J × Fin 4 => pilotRate iz.1 iz.2)) := by unfold poissonTableLaw infer_instance rw [hnorm] apply integrable_of_le_of_le (g₁ := fun _ => (0 : ℝ)) (g₂ := bound) · exact hf_meas.stronglyMeasurable.integral_prod_right'.aestronglyMeasurable · filter_upwards [] with p exact integral_nonneg (fun e => hf_nonneg (p, e)) · exact Filter.Eventually.of_forall hsection_bound · exact integrable_const 0 · exact hbound have hf_int : Integrable f ((poissonTableLaw (fun iz : J × Fin 4 => pilotRate iz.1 iz.2)).prod (poissonTableLaw (fun iz : J × Fin 4 => evalRate iz.1 iz.2))) := (integrable_prod_iff hf_meas.aestronglyMeasurable).mpr ⟨Filter.Eventually.of_forall hsection_int, houter⟩ change (∫ pe, f pe ∂(poissonTableLaw (fun iz : J × Fin 4 => pilotRate iz.1 iz.2)).prod (poissonTableLaw (fun iz : J × Fin 4 => evalRate iz.1 iz.2))) ≤ _ rw [integral_prod f hf_int] exact integral_mono hf_int.integral_prod_left hbound hsection_bound
Causalean.Stat.Concentration.Poisson.poissonTable_cell_nonneg_integral_le_of_sections · Causalean/Stat/Concentration/Poisson/ConditionalCellComposition.lean:116 · uses poissonTableCell , poissonTableLaw
3 supporting declarations (lemmas, instances)
Count­Vector­Series 1 core · 3 supporting Summation identities for vectors of independent Poisson counts. ★ tsum_le_one_of_le_poissonFactorial

Poisson count-vector series

Summation identities for vectors of independent Poisson counts. For finitely many coordinates with rates λᵢ ≥ 0, summing over all count vectors k = (kᵢ) in ℕ^I:

* poissonFactorial_countVector_tsum_one — Σ over k of Π over i of exp(−λᵢ) λᵢ^kᵢ / kᵢ! = 1, i.e. the product Poisson probability mass function has total mass one; * factorial_countVector_tsum_eq_exp_sum — Σ over k of Π over i of λᵢ^kᵢ / kᵢ! = exp(Σ λᵢ); * summable_poissonFactorial_countVector — the first series is summable, zero rates included; * tsum_le_one_of_le_poissonFactorial — a nonnegative function of the count vector that is dominated pointwise by the product Poisson mass function has total sum at most one.

lemma tsum_le_one_of_le_poissonFactorial reviewed
Causalean.Stat.Concentration.Poisson

For nonnegative coordinate rates, a nonnegative count-vector envelope that is pointwise dominated by the product Poisson factorial likelihood has total mass at most one. The result is the unit upper bound on the dominated envelope’s total mass.

Formal statement
I :
Type*
rate :
I → ℝ≥0
f :
(I → ℕ) → ℝ
hf :
∀ counts, 0 ≤ f counts
hdom :
∀ counts,
f counts
≤ ∏ i : I, exp (-(rate i : ℝ)) * (rate i : ℝ) ^ counts i / (counts i).factorial
(∑' counts, f counts) ≤ 1
Proof (Lean source)
lemma tsum_le_one_of_le_poissonFactorial {I : Type*} [Fintype I] (rate : I → ℝ≥0) (f : (I → ℕ) → ℝ) (hf : ∀ counts, 0 ≤ f counts) (hdom : ∀ counts, f counts ≤ ∏ i : I, exp (-(rate i : ℝ)) * (rate i : ℝ) ^ counts i / (counts i).factorial) : (∑' counts, f counts) ≤ 1 := by have hg := summable_poissonFactorial_countVector rate have hfSummable : Summable f := Summable.of_nonneg_of_le hf hdom hg calc (∑' counts, f counts) ≤ ∑' counts : I → ℕ, ∏ i : I, exp (-(rate i : ℝ)) * (rate i : ℝ) ^ counts i / (counts i).factorial := Summable.tsum_le_tsum hdom hfSummable hg _ = 1 := poissonFactorial_countVector_tsum_one rate
Causalean.Stat.Concentration.Poisson.tsum_le_one_of_le_poissonFactorial · Causalean/Stat/Concentration/Poisson/CountVectorSeries.lean:120
3 supporting declarations (lemmas, instances)
  • poissonFactorial_countVector_tsum_one lemma — For a finite coordinate type and nonnegative coordinate rates, the product Poisson factorial likelihood sums to one over all count vectors. The result is the unit-mass identity for the product Poisson factorial likelihood.
    I :
    Type*
    rate :
    I → ℝ≥0
    (∑' counts : I → ℕ, ∏ i : I, exp (-(rate i : ℝ)) * (rate i : ℝ) ^ counts i / (counts i).factorial)
    = 1
    Proof (Lean source)
    lemma poissonFactorial_countVector_tsum_one {I : Type*} [Fintype I] (rate : I → ℝ≥0) : (∑' counts : I → ℕ, ∏ i : I, exp (-(rate i : ℝ)) * (rate i : ℝ) ^ counts i / (counts i).factorial) = 1 := by let μ : Measure (I → ℕ) := Measure.pi (fun i => poissonMeasure (rate i)) letI : IsProbabilityMeasure μ := by unfold μ infer_instance rw [← probability_real_singleton_tsum μ] apply tsum_congr intro counts unfold μ rw [Measure.real_def, Measure.pi_singleton, ENNReal.toReal_prod] apply Finset.prod_congr rfl intro i _ rw [poissonMeasure_singleton, ENNReal.toReal_ofReal] positivity
    Causalean.Stat.Concentration.Poisson.poissonFactorial_countVector_tsum_one · Causalean/Stat/Concentration/Poisson/CountVectorSeries.lean:27
  • factorial_countVector_tsum_eq_exp_sum lemma — For a finite coordinate type and nonnegative coordinate rates, the sum of the factorial-normalized monomials over all count vectors equals the exponential of the total rate. The result is the exponential identity for the factorial-normalized count-vector series.
    I :
    Type*
    rate :
    I → ℝ≥0
    (∑' counts : I → ℕ, ∏ i : I, (rate i : ℝ) ^ counts i / (counts i).factorial)
    = exp (∑ i : I, (rate i : ℝ))
    Proof (Lean source)
    lemma factorial_countVector_tsum_eq_exp_sum {I : Type*} [Fintype I] (rate : I → ℝ≥0) : (∑' counts : I → ℕ, ∏ i : I, (rate i : ℝ) ^ counts i / (counts i).factorial) = exp (∑ i : I, (rate i : ℝ)) := by let S : ℝ := ∑ i : I, (rate i : ℝ) let raw : (I → ℕ) → ℝ := fun counts => ∏ i : I, (rate i : ℝ) ^ counts i / (counts i).factorial have hterm (counts : I → ℕ) : (∏ i : I, exp (-(rate i : ℝ)) * (rate i : ℝ) ^ counts i / (counts i).factorial) = exp (-S) * raw counts := by rw [show (∏ i : I, exp (-(rate i : ℝ)) * (rate i : ℝ) ^ counts i / (counts i).factorial) = ∏ i : I, exp (-(rate i : ℝ)) * ((rate i : ℝ) ^ counts i / (counts i).factorial) by apply Finset.prod_congr rfl intro i _ ring, Finset.prod_mul_distrib, ← Real.exp_sum] congr 1 unfold S rw [← Finset.sum_neg_distrib] have hnorm := poissonFactorial_countVector_tsum_one rate rw [show (∑' counts : I → ℕ, ∏ i : I, exp (-(rate i : ℝ)) * (rate i : ℝ) ^ counts i / (counts i).factorial) = ∑' counts, exp (-S) * raw counts by apply tsum_congr exact hterm, tsum_mul_left] at hnorm change (∑' counts, raw counts) = exp S calc (∑' counts, raw counts) = exp S * (exp (-S) * ∑' counts, raw counts) := by rw [← mul_assoc, ← Real.exp_add] simp _ = exp S := by rw [hnorm, mul_one]
    Causalean.Stat.Concentration.Poisson.factorial_countVector_tsum_eq_exp_sum · Causalean/Stat/Concentration/Poisson/CountVectorSeries.lean:50
  • summable_poissonFactorial_countVector lemma — For a finite coordinate type and nonnegative coordinate rates, the product Poisson factorial likelihood is summable over all count vectors, including zero-rate coordinates. The result is summability of the product Poisson factorial likelihood.
    I :
    Type*
    rate :
    I → ℝ≥0
    Summable fun counts : I → ℕ
    => ∏ i : I, exp (-(rate i : ℝ)) * (rate i : ℝ) ^ counts i / (counts i).factorial
    Proof (Lean source)
    lemma summable_poissonFactorial_countVector {I : Type*} [Fintype I] (rate : I → ℝ≥0) : Summable fun counts : I → ℕ => ∏ i : I, exp (-(rate i : ℝ)) * (rate i : ℝ) ^ counts i / (counts i).factorial := by let μ : Measure (I → ℕ) := Measure.pi (fun i => poissonMeasure (rate i)) letI : IsProbabilityMeasure μ := by unfold μ infer_instance have hm : Summable fun counts : I → ℕ => μ.real {counts} := by apply ENNReal.summable_toReal have h := MeasureTheory.Measure.tsum_indicator_apply_singleton μ (Set.univ : Set (I → ℕ)) MeasurableSet.univ simpa using h.trans_ne (measure_ne_top μ Set.univ) apply hm.congr intro counts unfold μ rw [Measure.real_def, Measure.pi_singleton, ENNReal.toReal_prod] apply Finset.prod_congr rfl intro i _ rw [poissonMeasure_singleton, ENNReal.toReal_ofReal] positivity
    Causalean.Stat.Concentration.Poisson.summable_poissonFactorial_countVector · Causalean/Stat/Concentration/Poisson/CountVectorSeries.lean:93
Factorial­Envelope 1 core · 0 supporting This module turns the exact scalar mixed-moment formula for centered Poisson falling-factorial lifts into the exponential square-moment envelope used by finite factorial-polynomial processes. ★ poisson_factorialLift_square_envelope

Exponential envelopes for centered Poisson factorial lifts

This module turns the exact scalar mixed-moment formula for centered Poisson falling-factorial lifts into the exponential square-moment envelope used by finite factorial-polynomial processes.

theorem poisson_factorialLift_square_envelope reviewed
Causalean.Stat.Concentration.Poisson

Let N be a Poisson count with a given rate, and let a normalization m, a center z, a radius R, and a scale L be real numbers with m, R, and L positive. If the normalized mean rate/m is within R of z and rate/(m² R²) is at most 1/L, then for every order h, the expected square of the order-h centered factorial lift of N divided by R^h is at most exp(h²/L).

Formal statement
rate :
m z R L :
ℝ
hm :
0 < m
hR :
0 < R
hL :
0 < L
hcenter :
|(rate : ℝ) / m - z| ≤ R
hvariance :
(rate : ℝ) / (m ^ 2 * R ^ 2) ≤ 1 / L
h :
ℕ
(∫ N : ℕ, (factorialLift m z N h / R ^ h) ^ 2 ∂poissonMeasure rate)
≤ exp ((h : ℝ) ^ 2 / L)
Proof (Lean source)
theorem poisson_factorialLift_square_envelope (rate : NNReal) (m z R L : ℝ) (hm : 0 < m) (hR : 0 < R) (hL : 0 < L) (hcenter : |(rate : ℝ) / m - z| ≤ R) (hvariance : (rate : ℝ) / (m ^ 2 * R ^ 2) ≤ 1 / L) (h : ℕ) : (∫ N : ℕ, (factorialLift m z N h / R ^ h) ^ 2 ∂poissonMeasure rate) ≤ exp ((h : ℝ) ^ 2 / L) := by have hR0 : R ≠ 0 := ne_of_gt hR have hm0 : m ≠ 0 := ne_of_gt hm let c : ℝ := (rate : ℝ) / m - z let v : ℝ := (rate : ℝ) / m ^ 2 let x : ℝ := (h : ℝ) ^ 2 / L have hc2 : c ^ 2 ≤ R ^ 2 := by simpa only [c, sq_abs] using (pow_le_pow_left₀ (abs_nonneg ((rate : ℝ) / m - z)) hcenter 2) have hc : c ^ 2 / R ^ 2 ≤ 1 := (div_le_one (pow_pos hR 2)).mpr hc2 have hc0 : 0 ≤ c ^ 2 / R ^ 2 := by positivity have hv0 : 0 ≤ v / R ^ 2 := by dsimp [v]; positivity have hv : v / R ^ 2 ≤ 1 / L := by have heq : v / R ^ 2 = (rate : ℝ) / (m ^ 2 * R ^ 2) := by dsimp [v] ring rw [heq] exact hvariance have hx0 : 0 ≤ x := by dsimp [x]; positivity have hfirst : (∫ N : ℕ, (factorialLift m z N h / R ^ h) ^ 2 ∂poissonMeasure rate) = ∑ r ∈ range (h + 1), ((h.choose r : ℝ) ^ 2 * (Nat.factorial r : ℝ) * (v / R ^ 2) ^ r * (c ^ 2 / R ^ 2) ^ (h - r)) := by have hp (N : ℕ) : (factorialLift m z N h / R ^ h) ^ 2 = (R ^ h)⁻¹ ^ 2 * (factorialLift m z N h * factorialLift m z N h) := by rw [div_pow] field_simp simp_rw [hp] rw [integral_const_mul, poisson_factorialLift_mixed rate m z hm0 h h, Nat.min_self, Finset.mul_sum] apply Finset.sum_congr rfl intro r hr have hrh : r ≤ h := by have := Finset.mem_range.mp hr; omega have hex : h + h - 2 * r = 2 * (h - r) := by omega change (R ^ h)⁻¹ ^ 2 * ((h.choose r : ℝ) * (h.choose r : ℝ) * (Nat.factorial r : ℝ) * v ^ r * c ^ (h + h - 2 * r)) = (h.choose r : ℝ) ^ 2 * (Nat.factorial r : ℝ) * (v / R ^ 2) ^ r * (c ^ 2 / R ^ 2) ^ (h - r) generalize v = w, c = y rw [hex, show y ^ (2 * (h - r)) = (y ^ 2) ^ (h - r) by rw [pow_mul]] rw [show R ^ h = R ^ r * R ^ (h - r) by rw [← pow_add, Nat.add_sub_of_le hrh]] rw [div_pow, div_pow] field_simp [hR0] ring rw [hfirst] calc (∑ r ∈ range (h + 1), (h.choose r : ℝ) ^ 2 * (Nat.factorial r : ℝ) * (v / R ^ 2) ^ r * (c ^ 2 / R ^ 2) ^ (h - r)) ≤ ∑ r ∈ range (h + 1), x ^ r / (Nat.factorial r : ℝ) := by apply Finset.sum_le_sum intro r hr have hfac : 0 < (Nat.factorial r : ℝ) := by positivity have hchoose : (h.choose r : ℝ) ≤ (h : ℝ) ^ r / (Nat.factorial r : ℝ) := Nat.choose_le_pow_div r h have hcoeff : (h.choose r : ℝ) ^ 2 * (Nat.factorial r : ℝ) ≤ (h : ℝ) ^ (2 * r) / (Nat.factorial r : ℝ) := by have hs := pow_le_pow_left₀ (Nat.cast_nonneg _) hchoose 2 calc (h.choose r : ℝ) ^ 2 * (Nat.factorial r : ℝ) ≤ ((h : ℝ) ^ r / (Nat.factorial r : ℝ)) ^ 2 * (Nat.factorial r : ℝ) := mul_le_mul_of_nonneg_right hs hfac.le _ = (h : ℝ) ^ (2 * r) / (Nat.factorial r : ℝ) := by rw [mul_comm 2 r, pow_mul, div_pow] field_simp have hc_pow := pow_le_pow_left₀ hc0 hc (h - r) have hv_pow := pow_le_pow_left₀ hv0 hv r have hnonneg : 0 ≤ (h.choose r : ℝ) ^ 2 * (Nat.factorial r : ℝ) := by positivity calc _ ≤ (h.choose r : ℝ) ^ 2 * (Nat.factorial r : ℝ) * (v / R ^ 2) ^ r := by have := mul_le_mul_of_nonneg_left hc_pow (mul_nonneg hnonneg (pow_nonneg hv0 r)) simpa only [one_pow, mul_one] using this _ ≤ (h.choose r : ℝ) ^ 2 * (Nat.factorial r : ℝ) * (1 / L) ^ r := by exact mul_le_mul_of_nonneg_left hv_pow hnonneg _ ≤ ((h : ℝ) ^ (2 * r) / (Nat.factorial r : ℝ)) * (1 / L) ^ r := mul_le_mul_of_nonneg_right hcoeff (pow_nonneg (by positivity) r) _ = x ^ r / (Nat.factorial r : ℝ) := by dsimp [x] rw [div_pow, one_pow, mul_comm 2 r, pow_mul] ring _ ≤ exp x := Real.sum_le_exp_of_nonneg hx0 (h + 1)
Causalean.Stat.Concentration.Poisson.poisson_factorialLift_square_envelope · Causalean/Stat/Concentration/Poisson/FactorialEnvelope.lean:20 · uses factorialLift
Factorial­Path 3 core · 0 supporting This module instantiates finite clipped-polynomial path estimates with four independent Poisson counts and normalized centered falling-factorial monomials of bounded coordinatewise degree. ★ fourPoissonFactorialPath_sq_bound

Four-coordinate clipped Poisson factorial paths

This module instantiates finite clipped-polynomial path estimates with four independent Poisson counts and normalized centered falling-factorial monomials of bounded coordinatewise degree.

def fourFactorialMonomial reviewed
Causalean.Stat.Concentration.Poisson

For four count coordinates, a normalization, centers and radii, a multi-degree with one degree per coordinate, and a sample point, the normalized four-coordinate factorial monomial is the product over the four coordinates of the centered factorial lift of that coordinate's count, of the coordinate's degree and with the coordinate's center, divided by the product of the radii raised to those degrees.

Definition (Lean source)
Ω :
Type*
D :
ℕ
W :
Fin 4 → Ω → ℕ
m :
ℝ
z R :
Fin 4 → ℝ
a :
Fin 4 → Fin (D + 1)
ω :
Ω
fourFactorialMonomial W m z R a ω :
ℝ
factorialProduct W m z (fun i => (a i : ℕ)) ω / ∏ i, (R i) ^ (a i : ℕ)
Causalean.Stat.Concentration.Poisson.fourFactorialMonomial · Causalean/Stat/Concentration/Poisson/FactorialPath.lean:23
def fourPoissonFactorialPath reviewed
Causalean.Stat.Concentration.Poisson

For coefficient paths indexed by multi-degrees, four count coordinates, a normalization, centers and radii, a clipping radius, and a sample point, the clipped four-coordinate factorial path is the continuous path whose value at each time is the sum over multi-degrees of the normalized factorial monomial at the sample point times the coefficient path at that time, clipped to the symmetric interval of the clipping radius.

Definition (Lean source)
Ω :
Type*
D :
ℕ
c :
(Fin 4 → Fin (D + 1)) → Path
W :
Fin 4 → Ω → ℕ
m :
ℝ
z R :
Fin 4 → ℝ
cap :
ℝ
ω :
Ω
fourPoissonFactorialPath c W m z R cap ω :
clippedFinitePath c (fun ω a => fourFactorialMonomial W m z R a ω) cap ω
Causalean.Stat.Concentration.Poisson.fourPoissonFactorialPath · Causalean/Stat/Concentration/Poisson/FactorialPath.lean:34 · uses Path
theorem fourPoissonFactorialPath_sq_bound reviewed
Causalean.Stat.Concentration.Poisson

Under a probability measure, take coefficient paths of bounded variation, indexed by multi-degrees with each degree at most D, four measurable, mutually independent counts with Poisson laws of given rates, a positive normalization m and a positive scale L, centers and positive radii such that each normalized mean rate/m is within its radius of its center and each rate/(m² R²) is at most 1/L, and a nonnegative clipping radius. Then the clipped four-coordinate factorial path is a measurable random path, has bounded variation at every sample point, is Bochner-integrable, has integrable squared supremum-plus-variation size, and its expected squared size is at most the sum of the squared sizes of the coefficient paths times (D + 1)^4 exp(4D²/L).

Formal statement
Ω :
D :
ℕ
c :
(Fin 4 → Fin (D + 1)) → Path
hcBV :
∀ a, eVariationOn (c a) univ < ⊤
W :
Fin 4 → Ω → ℕ
rate :
Fin 4 → NNReal
hWmeas :
∀ i, Measurable (W i)
hWlaw :
∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ
hWindep :
iIndepFun W μ
m L :
ℝ
hm :
0 < m
hL :
0 < L
z R :
Fin 4 → ℝ
hR :
∀ i, 0 < R i
hcenter :
∀ i, |(rate i : ℝ) / m - z i| ≤ R i
hvariance :
∀ i, (rate i : ℝ) / (m ^ 2 * (R i) ^ 2) ≤ 1 / L
cap :
ℝ
hcap :
0 ≤ cap
conclusion 1
conclusion 2
ω :
eVariationOn (fourPoissonFactorialPath c W m z R cap ω) univ < ⊤
conclusion 3
conclusion 4
Integrable (fun ω => (pathSize (fourPoissonFactorialPath c W m z R cap ω)) ^ 2) μ
conclusion 5
(∫ ω, (pathSize (fourPoissonFactorialPath c W m z R cap ω)) ^ 2 ∂μ)
≤ (∑ a, (pathSize (c a)) ^ 2) * ∑ _a : Fin 4 → Fin (D + 1), exp (4 * (D : ℝ) ^ 2 / L)
Proof (Lean source)
theorem fourPoissonFactorialPath_sq_bound {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] {D : ℕ} (c : (Fin 4 → Fin (D + 1)) → Path) (hcBV : ∀ a, eVariationOn (c a) univ < ⊤) (W : Fin 4 → Ω → ℕ) (rate : Fin 4 → NNReal) (hWmeas : ∀ i, Measurable (W i)) (hWlaw : ∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ) (hWindep : iIndepFun W μ) (m L : ℝ) (hm : 0 < m) (hL : 0 < L) (z R : Fin 4 → ℝ) (hR : ∀ i, 0 < R i) (hcenter : ∀ i, |(rate i : ℝ) / m - z i| ≤ R i) (hvariance : ∀ i, (rate i : ℝ) / (m ^ 2 * (R i) ^ 2) ≤ 1 / L) (cap : ℝ) (hcap : 0 ≤ cap) : Measurable (fourPoissonFactorialPath c W m z R cap) ∧ (∀ ω, eVariationOn (fourPoissonFactorialPath c W m z R cap ω) univ < ⊤) ∧ Integrable (fourPoissonFactorialPath c W m z R cap) μ ∧ Integrable (fun ω => (pathSize (fourPoissonFactorialPath c W m z R cap ω)) ^ 2) μ ∧ (∫ ω, (pathSize (fourPoissonFactorialPath c W m z R cap ω)) ^ 2 ∂μ) ≤ (∑ a, (pathSize (c a)) ^ 2) * ∑ _a : Fin 4 → Fin (D + 1), exp (4 * (D : ℝ) ^ 2 / L) := by let X (ω : Ω) (a : Fin 4 → Fin (D + 1)) : ℝ := fourFactorialMonomial W m z R a ω have hXmeas (a : Fin 4 → Fin (D + 1)) : Measurable (fun ω => X ω a) := by dsimp [X, fourFactorialMonomial, factorialProduct] apply Measurable.div_const apply Finset.measurable_prod intro i _ exact (Measurable.of_discrete : Measurable (fun N : ℕ => factorialLift m (z i) N (a i : ℕ))).comp (hWmeas i) have hraw (r : NNReal) (j k : ℕ) : Integrable (fun N : ℕ => (N.descFactorial j : ℝ) * (N.descFactorial k : ℝ)) (poissonMeasure r) := by have h := integrable_finsetSum (range (min j k + 1)) (fun t _ => (poisson_descFactorial_integrable r (j + k - t)).const_mul ((j.choose t : ℝ) * (k.choose t : ℝ) * (Nat.factorial t : ℝ))) have heq : (fun N : ℕ => (N.descFactorial j : ℝ) * (N.descFactorial k : ℝ)) = (fun N : ℕ => ∑ t ∈ range (min j k + 1), (j.choose t : ℝ) * (k.choose t : ℝ) * (Nat.factorial t : ℝ) * (N.descFactorial (j + k - t) : ℝ)) := by funext N exact descFactorial_mul N j k rw [heq] exact h have hlift (r : NNReal) (j : ℕ) (v : ℝ) : Integrable (fun N : ℕ => (factorialLift m v N j) ^ 2) (poissonMeasure r) := by have h := integrable_finsetSum (range (j + 1)) (fun p _ => integrable_finsetSum (range (j + 1)) (fun q _ => (hraw r p q).const_mul (((j.choose p : ℝ) * (-v) ^ (j - p) / m ^ p) * ((j.choose q : ℝ) * (-v) ^ (j - q) / m ^ q)))) have heq : (fun N : ℕ => (factorialLift m v N j) ^ 2) = (fun N : ℕ => ∑ p ∈ range (j + 1), ∑ q ∈ range (j + 1), (((j.choose p : ℝ) * (-v) ^ (j - p) / m ^ p) * ((j.choose q : ℝ) * (-v) ^ (j - q) / m ^ q)) * ((N.descFactorial p : ℝ) * (N.descFactorial q : ℝ))) := by funext N simp only [factorialLift, sq, Finset.sum_mul_sum] apply Finset.sum_congr rfl intro p _ apply Finset.sum_congr rfl intro q _ ring rw [heq] exact h have hXsq (a : Fin 4 → Fin (D + 1)) : Integrable (fun ω => (X ω a) ^ 2) μ := by let f (i : Fin 4) (N : ℕ) : ℝ := (factorialLift m (z i) N (a i : ℕ) / R i ^ (a i : ℕ)) ^ 2 have hf (i : Fin 4) : Integrable (f i) (poissonMeasure (rate i)) := by simpa only [f, div_pow] using (hlift (rate i) (a i : ℕ) (z i)).div_const ((R i ^ (a i : ℕ)) ^ 2) have hpi : Integrable (fun v : Fin 4 → ℕ => ∏ i, f i (v i)) (Measure.pi (fun i => poissonMeasure (rate i))) := Integrable.fintype_prod hf have hmap : μ.map (fun ω i => W i ω) = Measure.pi (fun i => poissonMeasure (rate i)) := by rw [hWindep.map_fun_eq_pi_map (fun i => (hWmeas i).aemeasurable)] congr 1 funext i exact (hWlaw i).map_eq have hcomp : Integrable (fun ω => ∏ i, f i (W i ω)) μ := by exact (hmap ▸ hpi).comp_measurable (measurable_pi_lambda _ hWmeas) convert hcomp using 1 funext ω simp only [X, fourFactorialMonomial, factorialProduct, f, ← Finset.prod_div_distrib, ← Finset.prod_pow] have hmeas : Measurable (fourPoissonFactorialPath c W m z R cap) := by let : BorelSpace Path := ⟨rfl⟩ exact measurable_clippedFinitePath c X hXmeas cap have hbv (ω : Ω) : eVariationOn (fourPoissonFactorialPath c W m z R cap ω) univ < ⊤ := by exact clippedFinitePath_bv c X cap hcBV ω have hsq := clippedFinitePath_sq_integral_le μ c X cap hcap hcBV hXmeas hXsq have hsize_meas : Measurable (fun ω => pathSize (fourPoissonFactorialPath c W m z R cap ω)) := by let : BorelSpace Path := ⟨rfl⟩ exact ((continuous_norm.measurable.comp hmeas).add (measurable_pathTV.comp hmeas)) have hsize_int : Integrable (fun ω => pathSize (fourPoissonFactorialPath c W m z R cap ω)) μ := by apply MeasureTheory.MemLp.integrable (q := 2) (by norm_num) exact (MeasureTheory.memLp_two_iff_integrable_sq hsize_meas.aestronglyMeasurable).2 hsq.1 have hpath_int : Integrable (fourPoissonFactorialPath c W m z R cap) μ := by let : BorelSpace Path := ⟨rfl⟩ apply Integrable.mono' hsize_int hmeas.aestronglyMeasurable filter_upwards [] with ω change ‖fourPoissonFactorialPath c W m z R cap ω‖ ≤ pathSize (fourPoissonFactorialPath c W m z R cap ω) unfold pathSize exact le_add_of_nonneg_right (pathTV_nonneg _) refine ⟨hmeas, hbv, hpath_int, hsq.1, ?_⟩ calc (∫ ω, (pathSize (fourPoissonFactorialPath c W m z R cap ω)) ^ 2 ∂μ) ≤ (∑ a, (pathSize (c a)) ^ 2) * ∑ a, (∫ ω, (X ω a) ^ 2 ∂μ) := hsq.2 _ ≤ (∑ a, (pathSize (c a)) ^ 2) * ∑ _a : Fin 4 → Fin (D + 1), exp (4 * (D : ℝ) ^ 2 / L) := by apply mul_le_mul_of_nonneg_left · apply Finset.sum_le_sum intro a _ exact factorialProduct_four_square_envelope μ W rate hWlaw hWindep m L hm hL z R hR hcenter hvariance (fun i => (a i : ℕ)) D (fun i => le_of_lt_succ (a i).isLt) · exact Finset.sum_nonneg (fun a _ => sq_nonneg _)
Factorial­Product 2 core · 2 supporting The scalar identities are transported to random counts with Poisson laws and multiplied across independent coordinates. ★ factorialProduct_four_square_envelope

Factorial products of finitely many independent Poisson coordinates

The scalar identities are transported to random counts with Poisson laws and multiplied across independent coordinates. The four-coordinate bound isolates the paper's exponential degree cost.

def factorialProduct reviewed
Causalean.Stat.Concentration.Poisson

For a finite family of count coordinates, a normalization, a center and an order for each coordinate, and a sample point, the factorial product is the product over coordinates of the centered factorial lift of that coordinate's count at the sample point, with that coordinate's center and order.

Definition (Lean source)
ι Ω :
Type*
W :
ι → Ω → ℕ
m :
ℝ
z :
ι → ℝ
h :
ι → ℕ
ω :
Ω
factorialProduct W m z h ω :
ℝ
∏ i, factorialLift m (z i) (W i ω) (h i)
Causalean.Stat.Concentration.Poisson.factorialProduct · Causalean/Stat/Concentration/Poisson/FactorialProduct.lean:21
theorem factorialProduct_four_square_envelope reviewed
Causalean.Stat.Concentration.Poisson

Under a probability measure, take four count coordinates with given rates that have Poisson laws of those rates and are mutually independent, a positive normalization m and a positive scale L, and centers and positive radii such that each normalized mean rate/m is within its radius of its center and each rate/(m² R²) is at most 1/L. For orders, one per coordinate, each at most D, the expected square of the factorial product divided by the product of the radii raised to the orders is at most exp(4D²/L).

Formal statement
Ω :
W :
Fin 4 → Ω → ℕ
rate :
Fin 4 → NNReal
hWlaw :
∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ
hWindep :
iIndepFun W μ
m L :
ℝ
hm :
0 < m
hL :
0 < L
z R :
Fin 4 → ℝ
hR :
∀ i, 0 < R i
hcenter :
∀ i, |(rate i : ℝ) / m - z i| ≤ R i
hvariance :
∀ i, (rate i : ℝ) / (m ^ 2 * (R i) ^ 2) ≤ 1 / L
h :
Fin 4 → ℕ
D :
ℕ
hdegree :
∀ i, h i ≤ D
(∫ ω, (factorialProduct W m z h ω / ∏ i, (R i) ^ (h i)) ^ 2 ∂μ)
≤ exp (4 * (D : ℝ) ^ 2 / L)
Proof (Lean source)
theorem factorialProduct_four_square_envelope {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (W : Fin 4 → Ω → ℕ) (rate : Fin 4 → NNReal) (hWlaw : ∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ) (hWindep : iIndepFun W μ) (m L : ℝ) (hm : 0 < m) (hL : 0 < L) (z R : Fin 4 → ℝ) (hR : ∀ i, 0 < R i) (hcenter : ∀ i, |(rate i : ℝ) / m - z i| ≤ R i) (hvariance : ∀ i, (rate i : ℝ) / (m ^ 2 * (R i) ^ 2) ≤ 1 / L) (h : Fin 4 → ℕ) (D : ℕ) (hdegree : ∀ i, h i ≤ D) : (∫ ω, (factorialProduct W m z h ω / ∏ i, (R i) ^ (h i)) ^ 2 ∂μ) ≤ exp (4 * (D : ℝ) ^ 2 / L) := by have hs : (∑ i : Fin 4, (h i : ℝ) ^ 2) ≤ 4 * (D : ℝ) ^ 2 := by calc (∑ i : Fin 4, (h i : ℝ) ^ 2) ≤ ∑ _i : Fin 4, (D : ℝ) ^ 2 := by apply Finset.sum_le_sum intro i _ have hi : (h i : ℝ) ≤ D := by exact_mod_cast hdegree i have hnonneg : 0 ≤ (h i : ℝ) := by positivity nlinarith _ = 4 * (D : ℝ) ^ 2 := by norm_num exact (factorialProduct_square_envelope μ W rate hWlaw hWindep m L hm hL z R hR hcenter hvariance h).trans (Real.exp_le_exp.mpr (div_le_div_of_nonneg_right hs (le_of_lt hL)))
Causalean.Stat.Concentration.Poisson.factorialProduct_four_square_envelope · Causalean/Stat/Concentration/Poisson/FactorialProduct.lean:108 · uses factorialProduct
2 supporting declarations (lemmas, instances)
  • factorialProduct_mean theorem — Independent Poisson coordinates make the expectation of a finite factorial product equal the product of coordinatewise powers of the mean minus the center.
    ι Ω :
    W :
    ι → Ω → ℕ
    rate :
    ι → NNReal
    hWlaw :
    ∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ
    hWindep :
    iIndepFun W μ
    m :
    ℝ
    z :
    ι → ℝ
    h :
    ι → ℕ
    (∫ ω, factorialProduct W m z h ω ∂μ) = ∏ i, ((rate i : ℝ) / m - z i) ^ (h i)
    Proof (Lean source)
    theorem factorialProduct_mean {ι Ω : Type*} [Fintype ι] [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (W : ι → Ω → ℕ) (rate : ι → NNReal) (hWlaw : ∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ) (hWindep : iIndepFun W μ) (m : ℝ) (z : ι → ℝ) (h : ι → ℕ) : (∫ ω, factorialProduct W m z h ω ∂μ) = ∏ i, ((rate i : ℝ) / m - z i) ^ (h i) := by change (∫ ω, ∏ i, factorialLift m (z i) (W i ω) (h i) ∂μ) = _ rw [hWindep.integral_fun_prod_comp (fun i => (hWlaw i).aemeasurable) (fun i => (Measurable.of_discrete : Measurable (fun N : ℕ => factorialLift m (z i) N (h i))).aestronglyMeasurable)] apply Finset.prod_congr rfl intro i _ rw [show (∫ ω, factorialLift m (z i) (W i ω) (h i) ∂μ) = ∫ N : ℕ, factorialLift m (z i) N (h i) ∂poissonMeasure (rate i) from by simpa only [Function.comp_apply] using (hWlaw i).integral_comp (f := fun N : ℕ => factorialLift m (z i) N (h i)) Measurable.of_discrete.aestronglyMeasurable] exact poisson_factorialLift_mean (rate i) m (z i) (h i)
    Causalean.Stat.Concentration.Poisson.factorialProduct_mean · Causalean/Stat/Concentration/Poisson/FactorialProduct.lean:29
  • factorialProduct_square_envelope theorem — Under independent Poisson coordinates, the normalized product's square moment is at most the exponential of the sum of coordinatewise squared degrees divided by L.
    ι Ω :
    W :
    ι → Ω → ℕ
    rate :
    ι → NNReal
    hWlaw :
    ∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ
    hWindep :
    iIndepFun W μ
    m L :
    ℝ
    hm :
    0 < m
    hL :
    0 < L
    z R :
    ι → ℝ
    hR :
    ∀ i, 0 < R i
    hcenter :
    ∀ i, |(rate i : ℝ) / m - z i| ≤ R i
    hvariance :
    ∀ i, (rate i : ℝ) / (m ^ 2 * (R i) ^ 2) ≤ 1 / L
    h :
    ι → ℕ
    (∫ ω, (factorialProduct W m z h ω / ∏ i, (R i) ^ (h i)) ^ 2 ∂μ)
    ≤ exp ((∑ i, ((h i : ℝ) ^ 2)) / L)
    Proof (Lean source)
    theorem factorialProduct_square_envelope {ι Ω : Type*} [Fintype ι] [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (W : ι → Ω → ℕ) (rate : ι → NNReal) (hWlaw : ∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ) (hWindep : iIndepFun W μ) (m L : ℝ) (hm : 0 < m) (hL : 0 < L) (z R : ι → ℝ) (hR : ∀ i, 0 < R i) (hcenter : ∀ i, |(rate i : ℝ) / m - z i| ≤ R i) (hvariance : ∀ i, (rate i : ℝ) / (m ^ 2 * (R i) ^ 2) ≤ 1 / L) (h : ι → ℕ) : (∫ ω, (factorialProduct W m z h ω / ∏ i, (R i) ^ (h i)) ^ 2 ∂μ) ≤ exp ((∑ i, ((h i : ℝ) ^ 2)) / L) := by have hfactor : (∫ ω, (factorialProduct W m z h ω / ∏ i, R i ^ h i) ^ 2 ∂μ) = ∏ i, ∫ ω, (factorialLift m (z i) (W i ω) (h i) / R i ^ h i) ^ 2 ∂μ := by have hp (ω : Ω) : (factorialProduct W m z h ω / ∏ i, R i ^ h i) ^ 2 = ∏ i, (factorialLift m (z i) (W i ω) (h i) / R i ^ h i) ^ 2 := by simp only [factorialProduct, ← Finset.prod_div_distrib, ← Finset.prod_pow] simp_rw [hp] exact hWindep.integral_fun_prod_comp (fun i => (hWlaw i).aemeasurable) (fun i => (Measurable.of_discrete : Measurable (fun N : ℕ => (factorialLift m (z i) N (h i) / R i ^ h i) ^ 2)).aestronglyMeasurable) rw [hfactor] calc (∏ i, ∫ ω, (factorialLift m (z i) (W i ω) (h i) / R i ^ h i) ^ 2 ∂μ) ≤ ∏ i, exp ((h i : ℝ) ^ 2 / L) := by apply Finset.prod_le_prod · intro i _ exact integral_nonneg (fun ω => sq_nonneg _) · intro i _ rw [show (∫ ω, (factorialLift m (z i) (W i ω) (h i) / R i ^ h i) ^ 2 ∂μ) = ∫ N : ℕ, (factorialLift m (z i) N (h i) / R i ^ h i) ^ 2 ∂poissonMeasure (rate i) from by simpa only [Function.comp_apply] using (hWlaw i).integral_comp (f := fun N : ℕ => (factorialLift m (z i) N (h i) / R i ^ h i) ^ 2) Measurable.of_discrete.aestronglyMeasurable] exact poisson_factorialLift_square_envelope (rate i) m (z i) (R i) L hm (hR i) hL (hcenter i) (hvariance i) (h i) _ = exp ((∑ i, (h i : ℝ) ^ 2) / L) := by rw [← Real.exp_sum] congr 1 rw [Finset.sum_div]
    Causalean.Stat.Concentration.Poisson.factorialProduct_square_envelope · Causalean/Stat/Concentration/Poisson/FactorialProduct.lean:56
Raw­Moments 1 core · 6 supporting Exact formula and a simple bound for the raw moments of a Poisson variable N with rate λ ≥ 0. ★ poisson_power_moment_le

Raw moments of Poisson counts

Exact formula and a simple bound for the raw moments of a Poisson variable N with rate λ ≥ 0. Writing an ordinary power as a combination of falling factorials with Stirling numbers of the second kind S(r, v), and using E[N(N−1)⋯(N−v+1)] = λ^v, gives E[N^r] = Σ over v ≤ r of S(r, v) λ^v (the Touchard polynomial), and hence E[N^r] ≤ (λ + r)^r.

Main results

* count_power_factorial_expansion, count_power_factorial_expansion_real — k^r = Σ over v ≤ r of S(r, v) · k(k−1)⋯(k−v+1). * stirlingSecond_le_choose_mul_pow — S(r, v) ≤ C(r, v) · R^(r−v) for v ≤ r ≤ R. * poisson_power_integrable — every power of a Poisson count is integrable. * poisson_power_moment_eq — E[N^r] = Σ over v ≤ r of S(r, v) λ^v. * poisson_power_moment_le — E[N^r] ≤ (λ + r)^r.

lemma poisson_power_moment_le reviewed
Causalean.Stat.Concentration.Poisson

For a Poisson rate and natural power, the raw moment is bounded by the sum of the rate and the order raised to that order. The result is the rate-plus-order upper bound on the raw Poisson moment.

Formal statement
rate :
r :
ℕ
(∫ k : ℕ, (k : ℝ) ^ r ∂poissonMeasure rate) ≤ ((rate : ℝ) + (r : ℝ)) ^ r
Proof (Lean source)
lemma poisson_power_moment_le (rate : NNReal) (r : ℕ) : (∫ k : ℕ, (k : ℝ) ^ r ∂poissonMeasure rate) ≤ ((rate : ℝ) + (r : ℝ)) ^ r := by rw [poisson_power_moment_eq, add_pow] apply Finset.sum_le_sum intro v hv have hvr : v ≤ r := by have := Finset.mem_range.mp hv; omega have hs : (Nat.stirlingSecond r v : ℝ) ≤ (r.choose v : ℝ) * (r : ℝ) ^ (r - v) := by exact_mod_cast stirlingSecond_le_choose_mul_pow (le_refl r) hvr have hh := mul_le_mul_of_nonneg_right hs (pow_nonneg rate.coe_nonneg v) convert hh using 1 ring
Causalean.Stat.Concentration.Poisson.poisson_power_moment_le · Causalean/Stat/Concentration/Poisson/RawMoments.lean:137
6 supporting declarations (lemmas, instances)
  • count_mul_descFactorial lemma — For a count and factorial order, multiplying a descending factorial by the count raises its order plus the stated lower-order correction, including when the factorial vanishes. The result is the count-times-descending-factorial recurrence.
    k v :
    ℕ
    k * k.descFactorial v = k.descFactorial (v + 1) + v * k.descFactorial v
    Proof (Lean source)
    lemma count_mul_descFactorial (k v : ℕ) : k * k.descFactorial v = k.descFactorial (v + 1) + v * k.descFactorial v := by by_cases h : v ≤ k · rw [Nat.descFactorial_succ] have hk : k = k - v + v := by omega calc k * k.descFactorial v = (k - v + v) * k.descFactorial v := congrArg (fun t => t * k.descFactorial v) hk _ = _ := by ring · rw [Nat.descFactorial_eq_zero_iff_lt.mpr (by omega : k < v), Nat.descFactorial_eq_zero_iff_lt.mpr (by omega : k < v + 1)] simp
    Causalean.Stat.Concentration.Poisson.count_mul_descFactorial · Causalean/Stat/Concentration/Poisson/RawMoments.lean:29
  • count_power_factorial_expansion lemma — For a count and power, the ordinary power is the finite Stirling-weighted sum of descending factorials. The result is the Stirling expansion of an ordinary count power.
    k r :
    ℕ
    k ^ r = ∑ v ∈ range (r + 1), stirlingSecond r v * k.descFactorial v
    Proof (Lean source)
    lemma count_power_factorial_expansion (k r : ℕ) : k ^ r = ∑ v ∈ range (r + 1), stirlingSecond r v * k.descFactorial v := by induction r with | zero => simp | succ r ih => rw [pow_succ', ih, Finset.mul_sum] simp_rw [show ∀ v, k * (stirlingSecond r v * k.descFactorial v) = stirlingSecond r v * k.descFactorial (v + 1) + v * stirlingSecond r v * k.descFactorial v by intro v rw [mul_left_comm k, count_mul_descFactorial] ring] rw [Finset.sum_add_distrib] have hb : (∑ v ∈ range (r + 1), v * stirlingSecond r v * k.descFactorial v) = ∑ v ∈ range (r + 1), (v + 1) * stirlingSecond r (v + 1) * k.descFactorial (v + 1) := by rw [Finset.sum_range_succ' (f := fun v => v * stirlingSecond r v * k.descFactorial v)] rw [Finset.sum_range_succ (f := fun v => (v + 1) * stirlingSecond r (v + 1) * k.descFactorial (v + 1))] simp [Nat.stirlingSecond_eq_zero_of_lt (lt_succ_self r)] rw [hb, Finset.sum_range_succ' (f := fun v => stirlingSecond (r + 1) v * k.descFactorial v)] simp only [Nat.stirlingSecond_succ_zero, zero_mul, add_zero, Nat.stirlingSecond_succ_succ, add_mul, Finset.sum_add_distrib] exact add_comm _ _
    Causalean.Stat.Concentration.Poisson.count_power_factorial_expansion · Causalean/Stat/Concentration/Poisson/RawMoments.lean:44
  • stirlingSecond_le_choose_mul_pow lemma — For orders with the smaller order bounded by the ambient order and the block count bounded by the smaller order, the second-kind Stirling number is bounded by the stated binomial-power expression. The result is the stated binomial-power upper bound on the Stirling number.
    r R v :
    ℕ
    hr :
    r ≤ R
    hv :
    v ≤ r
    stirlingSecond r v ≤ r.choose v * R ^ (r - v)
    Proof (Lean source)
    lemma stirlingSecond_le_choose_mul_pow {r R v : ℕ} (hr : r ≤ R) (hv : v ≤ r) : stirlingSecond r v ≤ r.choose v * R ^ (r - v) := by induction r generalizing v with | zero => have hv0 : v = 0 := by omega subst v simp | succ r ih => cases v with | zero => simp | succ v => by_cases ht : v + 1 = r + 1 · have ht' : v = r := by omega subst v simp [Nat.stirlingSecond_self] · have hv1 : v + 1 ≤ r := by omega have h1 := ih (by omega : r ≤ R) hv1 have h0 := ih (by omega : r ≤ R) (by omega : v ≤ r) have hR : v + 1 ≤ R := by omega have hterm : (v + 1) * stirlingSecond r (v + 1) ≤ r.choose (v + 1) * R ^ (r - v) := by calc _ ≤ R * (r.choose (v + 1) * R ^ (r - (v + 1))) := Nat.mul_le_mul hR h1 _ = _ := by rw [show r - v = (r - (v + 1)) + 1 by omega, pow_succ] ring rw [Nat.stirlingSecond_succ_succ, Nat.choose_succ_succ, show (r + 1) - (v + 1) = r - v by omega] nlinarith only [hterm, h0]
    Causalean.Stat.Concentration.Poisson.stirlingSecond_le_choose_mul_pow · Causalean/Stat/Concentration/Poisson/RawMoments.lean:75
  • count_power_factorial_expansion_real lemma — For a count and power, casting the count power to the reals preserves its finite Stirling expansion in descending factorials. The result is the real-valued Stirling expansion of a count power.
    k r :
    ℕ
    (k : ℝ) ^ r
    = ∑ v ∈ range (r + 1), (Nat.stirlingSecond r v : ℝ) * (k.descFactorial v : ℝ)
    Proof (Lean source)
    lemma count_power_factorial_expansion_real (k r : ℕ) : (k : ℝ) ^ r = ∑ v ∈ range (r + 1), (Nat.stirlingSecond r v : ℝ) * (k.descFactorial v : ℝ) := by exact_mod_cast count_power_factorial_expansion k r
    Causalean.Stat.Concentration.Poisson.count_power_factorial_expansion_real · Causalean/Stat/Concentration/Poisson/RawMoments.lean:110
  • poisson_power_integrable lemma — For a Poisson rate and natural power, the corresponding raw power of the count is integrable under the Poisson law. The result is integrability of the raw Poisson count power.
    rate :
    r :
    ℕ
    Integrable (fun k : ℕ => (k : ℝ) ^ r) (poissonMeasure rate)
    Proof (Lean source)
    lemma poisson_power_integrable (rate : NNReal) (r : ℕ) : Integrable (fun k : ℕ => (k : ℝ) ^ r) (poissonMeasure rate) := by simp_rw [count_power_factorial_expansion_real] exact integrable_finsetSum _ (fun v _ => (poisson_descFactorial_integrable rate v).const_mul _)
    Causalean.Stat.Concentration.Poisson.poisson_power_integrable · Causalean/Stat/Concentration/Poisson/RawMoments.lean:117
  • poisson_power_moment_eq lemma — For a Poisson rate and natural power, the raw moment equals the finite Stirling-weighted sum of powers of the rate. The result is the Stirling-weighted formula for the raw Poisson moment.
    rate :
    r :
    ℕ
    (∫ k : ℕ, (k : ℝ) ^ r ∂poissonMeasure rate)
    = ∑ v ∈ range (r + 1), (Nat.stirlingSecond r v : ℝ) * (rate : ℝ) ^ v
    Proof (Lean source)
    lemma poisson_power_moment_eq (rate : NNReal) (r : ℕ) : (∫ k : ℕ, (k : ℝ) ^ r ∂poissonMeasure rate) = ∑ v ∈ range (r + 1), (Nat.stirlingSecond r v : ℝ) * (rate : ℝ) ^ v := by simp_rw [count_power_factorial_expansion_real] rw [integral_finsetSum _ (fun v _ => (poisson_descFactorial_integrable rate v).const_mul _)] simp_rw [integral_const_mul, poisson_descFactorial_moment]
    Causalean.Stat.Concentration.Poisson.poisson_power_moment_eq · Causalean/Stat/Concentration/Poisson/RawMoments.lean:125
Threshold 3 core · 3 supporting This module derives fixed-fraction lower-tail and exponentially weighted upper-tail estimates for a scalar Poisson count from exact exponential moments and Chernoff inequalities. ★ poisson_upper_tail_mul_exp_le★ poisson_lower_tail_of_two_mul_le★ poisson_pilot_upper_tail

Scalar Poisson threshold bounds

This module derives fixed-fraction lower-tail and exponentially weighted upper-tail estimates for a scalar Poisson count from exact exponential moments and Chernoff inequalities.

lemma poisson_upper_tail_mul_exp_le reviewed
Causalean.Stat.Concentration.Poisson

For a Poisson law with nonnegative mean, a natural cutoff, and a real exponential weight, if the weight is nonnegative, the strict upper-tail probability times its exponential penalty is bounded by the logarithmic cutoff factor.

Formal statement
lambda :
k :
r :
hr :
0 ≤ r
(poissonMeasure lambda).real {w : Nat | k < w} * exp (-r * (lambda : Real))
≤ exp (-log (1 + r) * (k : Real))
Proof (Lean source)
lemma poisson_upper_tail_mul_exp_le (lambda : NNReal) (k : Nat) {r : Real} (hr : 0 ≤ r) : (poissonMeasure lambda).real {w : Nat | k < w} * exp (-r * (lambda : Real)) ≤ exp (-log (1 + r) * (k : Real)) := by let theta := log (1 + r) have hone : 0 < 1 + r := by linarith have htheta : 0 ≤ theta := by dsimp [theta] exact Real.log_nonneg (by linarith) have hchernoff := measure_ge_le_exp_mul_mgf (X := fun w : Nat ↦ (w : Real)) (μ := poissonMeasure lambda) (k : Real) htheta (integrable_exp_natCast_poisson lambda theta) rw [mgf_natCast_poisson] at hchernoff have hexp : exp theta = 1 + r := by dsimp [theta] exact Real.exp_log hone have hsubset : {w : Nat | k < w} ⊆ {w : Nat | (k : Real) ≤ (w : Real)} := by intro w hw exact_mod_cast (le_of_lt hw) have hprob : (poissonMeasure lambda).real {w : Nat | k < w} ≤ exp (-theta * (k : Real)) * exp ((lambda : Real) * r) := by calc _ ≤ (poissonMeasure lambda).real {w : Nat | (k : Real) ≤ (w : Real)} := MeasureTheory.measureReal_mono hsubset (measure_ne_top _ _) _ ≤ _ := by simpa [hexp] using hchernoff calc _ ≤ (exp (-theta * (k : Real)) * exp ((lambda : Real) * r)) * exp (-r * (lambda : Real)) := by gcongr _ = exp (-log (1 + r) * (k : Real)) := by dsimp [theta] rw [← Real.exp_add, ← Real.exp_add] congr 1 ring
Causalean.Stat.Concentration.Poisson.poisson_upper_tail_mul_exp_le · Causalean/Stat/Concentration/Poisson/Threshold.lean:63
lemma poisson_lower_tail_of_two_mul_le reviewed
Causalean.Stat.Concentration.Poisson

For a positive requested count and a Poisson mean at least twice that count, the probability of falling below the requested count is at most 8 / n. The result is the 8 / n Poisson lower-tail bound.

Formal statement
n :
ℕ
lambda :
ℝ≥0
hn :
1 ≤ n
hlambda :
(2 : ℝ) * n ≤ lambda
(poissonMeasure lambda (Iio n)).toReal ≤ 8 / (n : ℝ)
Proof (Lean source)
lemma poisson_lower_tail_of_two_mul_le (n : ℕ) (lambda : ℝ≥0) (hn : 1 ≤ n) (hlambda : (2 : ℝ) * n ≤ lambda) : (poissonMeasure lambda (Iio n)).toReal ≤ 8 / (n : ℝ) := by have hnR : (0 : ℝ) < n := by exact_mod_cast hn have hlambdaR : (2 : ℝ) * n ≤ (lambda : ℝ) := by exact hlambda have hlambdaPos : (0 : ℝ) < lambda := lt_of_lt_of_le (by positivity) hlambdaR have hsqrt : sqrt (2 * (lambda : ℝ) * ((n : ℝ) / 8)) ≤ (lambda : ℝ) / 2 := by rw [show 2 * (lambda : ℝ) * ((n : ℝ) / 8) = (lambda : ℝ) * (n : ℝ) / 4 by ring] apply (Real.sqrt_le_iff).2 constructor · positivity · nlinarith [mul_nonneg (show (0 : ℝ) ≤ lambda by positivity) (sub_nonneg.mpr (show (n : ℝ) ≤ lambda by linarith))] have hsubset : Iio n ⊆ {w : ℕ | (lambda : ℝ) - (w : ℝ) > sqrt (2 * (lambda : ℝ) * ((n : ℝ) / 8))} := by intro w hw have hwNat : w < n := hw have hwR : (w : ℝ) < n := by exact_mod_cast hwNat have : (lambda : ℝ) / 2 ≤ (lambda : ℝ) - (n : ℝ) := by linarith exact lt_of_le_of_lt hsqrt (lt_of_le_of_lt this (by linarith)) have hbern := poisson_lower_bernstein lambda (z := (n : ℝ) / 8) (by positivity) have hreal : (poissonMeasure lambda (Iio n)).toReal ≤ exp (-(n : ℝ) / 8) := by calc _ ≤ (ofReal (exp (-(n : ℝ) / 8))).toReal := ENNReal.toReal_mono ENNReal.ofReal_ne_top ((measure_mono hsubset).trans (by simpa [neg_div] using hbern)) _ = _ := ENNReal.toReal_ofReal (Real.exp_nonneg _) calc _ ≤ exp (-(n : ℝ) / 8) := hreal _ = 1 / exp ((n : ℝ) / 8) := by rw [show -(n : ℝ) / 8 = -((n : ℝ) / 8) by ring, Real.exp_neg, one_div] _ ≤ 1 / ((n : ℝ) / 8) := by apply one_div_le_one_div_of_le (by positivity) linarith [Real.add_one_le_exp ((n : ℝ) / 8)] _ = 8 / (n : ℝ) := by field_simp
Causalean.Stat.Concentration.Poisson.poisson_lower_tail_of_two_mul_le · Causalean/Stat/Concentration/Poisson/Threshold.lean:123
lemma poisson_pilot_upper_tail reviewed
Causalean.Stat.Concentration.Poisson

For a Poisson count with a given rate and a real threshold B, the probability that the count strictly exceeds B/4 is at most exp(3 · rate − B · log 4 / 4).

Formal statement
rate :
B :
ℝ
(poissonMeasure rate).real {k : ℕ | B / 4 < (k : ℝ)}
≤ exp (3 * (rate : ℝ) - B * log 4 / 4)
Proof (Lean source)
lemma poisson_pilot_upper_tail (rate : NNReal) (B : ℝ) : (poissonMeasure rate).real {k : ℕ | B / 4 < (k : ℝ)} ≤ exp (3 * (rate : ℝ) - B * log 4 / 4) := by let theta : ℝ := log 4 have htheta : 0 ≤ theta := by dsimp [theta] exact (Real.log_pos (by norm_num)).le have hchernoff := measure_ge_le_exp_mul_mgf (X := fun k : ℕ => (k : ℝ)) (μ := poissonMeasure rate) (B / 4) htheta (integrable_exp_natCast_poisson rate theta) rw [mgf_natCast_poisson] at hchernoff have hexp : exp theta = 4 := by dsimp [theta] rw [Real.exp_log (by norm_num : (0 : ℝ) < 4)] have hsubset : {k : ℕ | B / 4 < (k : ℝ)} ⊆ {k : ℕ | B / 4 ≤ (k : ℝ)} := by intro k hk change B / 4 < (k : ℝ) at hk change B / 4 ≤ (k : ℝ) exact hk.le calc (poissonMeasure rate).real {k : ℕ | B / 4 < (k : ℝ)} ≤ (poissonMeasure rate).real {k : ℕ | B / 4 ≤ (k : ℝ)} := measureReal_mono hsubset (measure_ne_top _ _) _ ≤ exp (-theta * (B / 4)) * exp ((rate : ℝ) * (exp theta - 1)) := hchernoff _ = exp (3 * (rate : ℝ) - B * log 4 / 4) := by rw [hexp, ← Real.exp_add] dsimp [theta] congr 1 ring
Causalean.Stat.Concentration.Poisson.poisson_pilot_upper_tail · Causalean/Stat/Concentration/Poisson/Threshold.lean:197
3 supporting declarations (lemmas, instances)
  • poisson_le_cutoff_of_cutoff_lt_quarter lemma — For a Poisson law with nonnegative mean and a natural cutoff, if the cutoff is below one quarter of the mean, the lower-tail probability is at most the exponential of minus one quarter of that mean.
    lambda :
    k :
    hk :
    (k : Real) < (lambda : Real) / 4
    poissonMeasure lambda {w : Nat | w ≤ k} ≤ ofReal (exp (-(lambda : Real) / 4))
    Proof (Lean source)
    lemma poisson_le_cutoff_of_cutoff_lt_quarter (lambda : NNReal) (k : Nat) (hk : (k : Real) < (lambda : Real) / 4) : poissonMeasure lambda {w : Nat | w ≤ k} ≤ ofReal (exp (-(lambda : Real) / 4)) := by have hlambda : 0 < (lambda : Real) := by have hk0 : 0 ≤ (k : Real) := Nat.cast_nonneg k linarith have hz : 0 ≤ (lambda : Real) / 4 := by positivity have hsqrt_sq : (sqrt (2 * (lambda : Real) * ((lambda : Real) / 4))) ^ 2 = (lambda : Real) ^ 2 / 2 := by rw [Real.sq_sqrt] · ring · positivity have hsqrt_lt : sqrt (2 * (lambda : Real) * ((lambda : Real) / 4)) < 3 * (lambda : Real) / 4 := by have hsqrt0 := Real.sqrt_nonneg (2 * (lambda : Real) * ((lambda : Real) / 4)) nlinarith [sq_nonneg ((lambda : Real) / 4)] have hsubset : {w : Nat | w ≤ k} ⊆ {w : Nat | (lambda : Real) - (w : Real) > sqrt (2 * (lambda : Real) * ((lambda : Real) / 4))} := by intro w hw change w ≤ k at hw have hwk : (w : Real) ≤ (k : Real) := by exact_mod_cast hw change (lambda : Real) - (w : Real) > _ linarith refine (measure_mono hsubset).trans ?_ simpa only [neg_div] using (poisson_lower_bernstein lambda hz)
    Causalean.Stat.Concentration.Poisson.poisson_le_cutoff_of_cutoff_lt_quarter · Causalean/Stat/Concentration/Poisson/Threshold.lean:26
  • exp_neg_log_mul_nat_eq_inv_pow lemma — For a real number and a natural exponent, if the real number is nonnegative, the exponential of the negative logarithmic multiple equals the reciprocal natural power.
    r :
    hr :
    0 ≤ r
    k :
    exp (-log (1 + r) * (k : Real)) = ((1 + r) ^ k)⁻¹
    Proof (Lean source)
    lemma exp_neg_log_mul_nat_eq_inv_pow {r : Real} (hr : 0 ≤ r) (k : Nat) : exp (-log (1 + r) * (k : Real)) = ((1 + r) ^ k)⁻¹ := by have hone : 0 < 1 + r := by linarith rw [show -log (1 + r) * (k : Real) = -((k : Real) * log (1 + r)) by ring, Real.exp_neg, Real.exp_nat_mul, Real.exp_log hone]
    Causalean.Stat.Concentration.Poisson.exp_neg_log_mul_nat_eq_inv_pow · Causalean/Stat/Concentration/Poisson/Threshold.lean:105
  • poisson_pilot_lower_tail lemma — For a Poisson rate and real threshold, the probability of the count being at most one quarter of the threshold obeys the stated exponential lower-tail bound. The result is the exponential Poisson lower-tail bound at one quarter of the threshold.
    rate :
    B :
    ℝ
    (poissonMeasure rate).real {k : ℕ | (k : ℝ) ≤ B / 4}
    ≤ exp (B * log 4 / 4 - 3 * (rate : ℝ) / 4)
    Proof (Lean source)
    lemma poisson_pilot_lower_tail (rate : NNReal) (B : ℝ) : (poissonMeasure rate).real {k : ℕ | (k : ℝ) ≤ B / 4} ≤ exp (B * log 4 / 4 - 3 * (rate : ℝ) / 4) := by let theta : ℝ := -log 4 have hlog : 0 < log (4 : ℝ) := Real.log_pos (by norm_num) have htheta : theta ≤ 0 := by dsimp [theta]; linarith have hchernoff := measure_le_le_exp_mul_mgf (X := fun k : ℕ => (k : ℝ)) (μ := poissonMeasure rate) (B / 4) htheta (integrable_exp_natCast_poisson rate theta) rw [mgf_natCast_poisson] at hchernoff have hexp : exp theta = 1 / 4 := by dsimp [theta] rw [Real.exp_neg, Real.exp_log (by norm_num : (0 : ℝ) < 4)] norm_num calc (poissonMeasure rate).real {k : ℕ | (k : ℝ) ≤ B / 4} ≤ exp (-theta * (B / 4)) * exp ((rate : ℝ) * (exp theta - 1)) := hchernoff _ = exp (B * log 4 / 4 - 3 * (rate : ℝ) / 4) := by rw [hexp, ← Real.exp_add] dsimp [theta] congr 1 ring
    Causalean.Stat.Concentration.Poisson.poisson_pilot_lower_tail · Causalean/Stat/Concentration/Poisson/Threshold.lean:168
Upper­Tail 1 core · 1 supporting The upper tail of a Poisson count with mean n/4 beyond the fixed cap n is bounded by a numerical exponential in n. ★ poisson_cap_path_risk_le

A Poisson cap at four times the mean

The upper tail of a Poisson count with mean n/4 beyond the fixed cap n is bounded by a numerical exponential in n.

theorem poisson_cap_path_risk_le reviewed
Causalean.Stat.Concentration.Poisson

Under a probability law, take a natural-number cap n, a random count that is Poisson with mean n/4, and a random continuous path together with a fixed target path whose supremum norm is at most one. Define the capped path to be the random path when the count is at most n and the zero path otherwise. If the squared supremum distances to the target of the random path and of the capped path are integrable, then the expected squared supremum distance of the capped path to the target is at most that of the random path plus exp(−n/2).

Formal statement
Ω :
n :
ℕ
M :
Ω → ℕ
hM :
HasLaw M (poissonMeasure ((n : ℝ≥0) / 4)) μ
Z :
Ω → Path
F :
hF :
‖F‖ ≤ 1
hZ :
Integrable (fun ω => ‖Z ω - F‖ ^ 2) μ
hcap :
Integrable (fun ω => ‖(if M ω ≤ n then Z ω else 0) - F‖ ^ 2) μ
(∫ ω, ‖(if M ω ≤ n then Z ω else 0) - F‖ ^ 2 ∂μ)
≤ (∫ ω, ‖Z ω - F‖ ^ 2 ∂μ) + exp (-(n : ℝ) / 2)
Proof (Lean source)
-- Split on `M ω ≤ n` pointwise. On overflow the capped loss is `‖F‖² ≤ 1`. -- Integrate the pointwise comparison and transfer overflow probability using -- `hM.measureReal_eq` and `poisson_quarter_mean_cap_tail`. theorem poisson_cap_path_risk_le {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (n : ℕ) (M : Ω → ℕ) (hM : HasLaw M (poissonMeasure ((n : ℝ≥0) / 4)) μ) (Z : Ω → Path) (F : Path) (hF : ‖F‖ ≤ 1) (hZ : Integrable (fun ω => ‖Z ω - F‖ ^ 2) μ) (hcap : Integrable (fun ω => ‖(if M ω ≤ n then Z ω else 0) - F‖ ^ 2) μ) : (∫ ω, ‖(if M ω ≤ n then Z ω else 0) - F‖ ^ 2 ∂μ) ≤ (∫ ω, ‖Z ω - F‖ ^ 2 ∂μ) + exp (-(n : ℝ) / 2) := by let s : Set Ω := {ω | n < M ω} have hs : NullMeasurableSet s μ := by exact hM.aemeasurable.nullMeasurableSet_preimage (show MeasurableSet {w : ℕ | n < w} by simpa only [Ioi] using measurableSet_Ioi) have hind : Integrable (s.indicator (fun _ => (1 : ℝ))) μ := (integrable_const 1).indicator₀ hs have hpoint (ω : Ω) : ‖(if M ω ≤ n then Z ω else 0) - F‖ ^ 2 ≤ ‖Z ω - F‖ ^ 2 + s.indicator (fun _ => (1 : ℝ)) ω := by by_cases h : M ω ≤ n · simp [h, s] · have hF2 : ‖F‖ ^ 2 ≤ (1 : ℝ) := by nlinarith [norm_nonneg F] have hz2 : 0 ≤ ‖Z ω - F‖ ^ 2 := sq_nonneg _ simp only [if_neg h, zero_sub, norm_neg] rw [Set.indicator_of_mem (show ω ∈ s by simpa [s] using Nat.lt_of_not_ge h)] nlinarith have hmain := integral_mono hcap (hZ.add hind) hpoint have hint : (∫ ω, s.indicator (fun _ => (1 : ℝ)) ω ∂μ) = μ.real s := by rw [integral_indicator₀ hs, setIntegral_const] simp change _ ≤ ∫ ω, ‖Z ω - F‖ ^ 2 + s.indicator (fun _ => (1 : ℝ)) ω ∂μ at hmain rw [integral_add hZ hind, hint] at hmain have htail := poisson_quarter_mean_cap_tail n have htailReal : (poissonMeasure ((n : ℝ≥0) / 4)).real {w : ℕ | n < w} ≤ exp (-(n : ℝ) / 2) := (ENNReal.le_ofReal_iff_toReal_le (measure_ne_top _ _) (Real.exp_nonneg _)).mp htail have hsprob : μ.real s = (poissonMeasure ((n : ℝ≥0) / 4)).real {w : ℕ | n < w} := by simpa [s] using hM.measureReal_eq (p := fun w : ℕ => n < w) (show MeasurableSet {w : ℕ | n < w} by simpa only [Ioi] using measurableSet_Ioi) rw [hsprob] at hmain exact hmain.trans (add_le_add_right htailReal _)
Causalean.Stat.Concentration.Poisson.poisson_cap_path_risk_le · Causalean/Stat/Concentration/Poisson/UpperTail.lean:55 · uses Path , Time
1 supporting declaration (lemmas, instances)
  • poisson_quarter_mean_cap_tail theorem — A natural cap gives an exponential upper bound for a Poisson count with one-quarter of that mean exceeding the cap.
    n :
    ℕ
    poissonMeasure ((n : ℝ≥0) / 4) {w : ℕ | n < w} ≤ ofReal (exp (-(n : ℝ) / 2))
    Proof (Lean source)
    -- Use `poisson_upper_tail_mul_exp_le` with r=3, then show -- `log 4 - 3/4 ≥ 1/2` and rearrange the positive exponential factor. theorem poisson_quarter_mean_cap_tail (n : ℕ) : poissonMeasure ((n : ℝ≥0) / 4) {w : ℕ | n < w} ≤ ofReal (exp (-(n : ℝ) / 2)) := by let p := (poissonMeasure ((n : ℝ≥0) / 4)).real {w : ℕ | n < w} have hchernoff := poisson_upper_tail_mul_exp_le ((n : ℝ≥0) / 4) n (r := 3) (by norm_num) have hlog : (5 / 4 : ℝ) ≤ log 4 := by rw [Real.log_four_eq] have := Real.log_two_gt_d9 linarith have hp : p ≤ exp (-(n : ℝ) / 2) := by have hn : 0 ≤ (n : ℝ) := Nat.cast_nonneg _ have hexp : 0 < exp (-(3 : ℝ) * ((n : ℝ) / 4)) := Real.exp_pos _ have hbound : p ≤ exp ((-log 4 + 3 / 4) * (n : ℝ)) := by apply le_of_mul_le_mul_right _ hexp calc p * exp (-3 * ((n : ℝ) / 4)) ≤ exp (-log 4 * (n : ℝ)) := by simpa [p, show (1 + 3 : ℝ) = 4 by norm_num, neg_mul] using hchernoff _ = exp ((-log 4 + 3 / 4) * (n : ℝ)) * exp (-3 * ((n : ℝ) / 4)) := by rw [← Real.exp_add] congr 1 ring calc p ≤ exp ((-log 4 + 3 / 4) * (n : ℝ)) := hbound _ ≤ exp (-(n : ℝ) / 2) := by apply Real.exp_le_exp.mpr nlinarith exact (ENNReal.le_ofReal_iff_toReal_le (measure_ne_top _ _) (Real.exp_nonneg _)).mpr hp
    Causalean.Stat.Concentration.Poisson.poisson_quarter_mean_cap_tail · Causalean/Stat/Concentration/Poisson/UpperTail.lean:21