Documentation

Dynamics.Concentration

Hoeffding and Bernstein bounds on finite product spaces #

Concentration for a sum ∑ i, Y i (ω i) of independent coordinates, where ω : Fin n → γ is drawn uniformly (so the coordinates ω i are independent uniform draws from the finite type γ). As everywhere in this library the probability of an event is the average of its indicator, and independence is avg_prod_pi; no measure theory is used.

Scalar inequalities #

theorem Dynamics.exp_le_one_add_add_sq_div {x : ℝ} (hx3 : x < 3) :
Real.exp x ≤ 1 + x + x ^ 2 / (2 * (1 - x / 3))

e^x ≤ 1 + x + x² / (2(1 - x/3)) for every x < 3.

theorem Dynamics.exp_le_bernstein {y u : ℝ} (hyu : y ≤ u) (hu3 : u < 3) :
Real.exp y ≤ 1 + y + y ^ 2 / (2 * (1 - u / 3))

The Bernstein scalar inequality: for y ≤ u < 3, e^y ≤ 1 + y + y² / (2(1 - u/3)).

theorem Dynamics.one_sub_add_mul_exp_le {p : ℝ} (hp0 : 0 ≤ p) (hp1 : p ≤ 1) (t : ℝ) :
1 - p + p * Real.exp t ≤ Real.exp (p * t + t ^ 2 / 8)

Hoeffding's lemma for a Bernoulli variable: for p ∈ [0,1] and every real t, 1 - p + p eᵗ ≤ exp(p t + t²/8).

Tail bounds for sums of independent coordinates #

theorem Dynamics.avg_tail_le_of_mgf {n : ℕ} {γ : Type u_1} [Fintype γ] (X : (Fin n → γ) → ℝ) {t : ℝ} (ht : 0 ≤ t) (k : ℝ) :
(avg fun (ω : Fin n → γ) => if k ≤ X ω then 1 else 0) ≤ (avg fun (ω : Fin n → γ) => Real.exp (t * X ω)) * Real.exp (-(t * k))

Markov's inequality applied to exp (t (X - k)): an exponential-moment bound turns into a tail bound.

theorem Dynamics.avg_exp_sum {n : ℕ} {γ : Type u_1} [Fintype γ] (Y : Fin n → γ → ℝ) (t : ℝ) :
(avg fun (ω : Fin n → γ) => Real.exp (t * ∑ i : Fin n, Y i (ω i))) = ∏ i : Fin n, avg fun (y : γ) => Real.exp (t * Y i y)

The exponential moment of a sum of independent coordinates factors.

theorem Dynamics.avg_hoeffding {n : ℕ} {γ : Type u_1} [Fintype γ] [Nonempty γ] (Y : Fin n → γ → ℝ) (hY : ∀ (i : Fin n) (x : γ), Y i x = 0 ∨ Y i x = 1) {lam : ℝ} (hlam : 0 ≤ lam) :
(avg fun (ω : Fin n → γ) => if ∑ i : Fin n, avg (Y i) + lam ≤ ∑ i : Fin n, Y i (ω i) then 1 else 0) ≤ Real.exp (-(2 * lam ^ 2 / ↑n))

Hoeffding's inequality for independent {0,1}-valued coordinates: P(X ≥ 𝔼X + λ) ≤ exp(-2λ²/n).

noncomputable def Dynamics.variance {γ : Type u_1} [Fintype γ] (f : γ → ℝ) :

The variance of a coordinate, 𝔼[(Y - 𝔼Y)²].

Equations
Instances For
    theorem Dynamics.variance_nonneg {γ : Type u_1} [Fintype γ] (f : γ → ℝ) :
    theorem Dynamics.variance_le_avg_sq {γ : Type u_1} [Fintype γ] [Nonempty γ] (f : γ → ℝ) :
    variance f ≤ avg fun (y : γ) => f y ^ 2

    The variance is at most the second moment.

    theorem Dynamics.avg_bernstein {n : ℕ} {γ : Type u_1} [Fintype γ] [Nonempty γ] (Y : Fin n → γ → ℝ) {b σ2 lam : ℝ} (hb : 0 < b) (hYb : ∀ (i : Fin n) (x : γ), Y i x - avg (Y i) ≤ b) (hσ : ∑ i : Fin n, variance (Y i) ≤ σ2) (hσ0 : 0 < σ2) (hlam : 0 ≤ lam) :
    (avg fun (ω : Fin n → γ) => if ∑ i : Fin n, avg (Y i) + lam ≤ ∑ i : Fin n, Y i (ω i) then 1 else 0) ≤ Real.exp (-(lam ^ 2 / (2 * σ2 * (1 + b * lam / (3 * σ2)))))

    Bernstein's inequality (Dubhashi–Panconesi): if every coordinate satisfies Yᵢ - 𝔼Yᵢ ≤ b and σ² is at least the variance of X = ∑ᵢ Yᵢ, then P(X ≥ 𝔼X + λ) ≤ exp(-λ² / (2σ²(1 + bλ/(3σ²)))).