Documentation

CslibFrontier.Foundations.Combinatorics.LittlewoodOfford

Erdős–Littlewood–Offord anti-concentration inequality #

This module formalizes Erdős's Sperner-antichain proof of the Littlewood–Offord anti-concentration inequality for Boolean linear forms ∑ i : ι, a i * (w i).toNat, together with the real central binomial upper bound (m.choose (m / 2) : ℝ) ≤ 2 ^ m / √(m + 1) and the reciprocal square-root rank sum bound ∑ i ∈ S, 1 / √(#{j ∈ S | |a i| ≤ |a j|}) ≤ 2 * √(#S) used in the Kane–Williams random restriction lemmas for linear threshold functions (Milestone 3 of #2347).

The primary source is [Erd45], Theorem 1, printed p. 898: for n real coefficients of absolute value at least one, at most n.choose (n / 2) sign sums lie in an open interval of length two. For δ > 0, put ε i = 2 * (w i).toNat - 1 and x i = a i / δ; then ∑ i, ε i * x i = (2 * ∑ i, a i * (w i).toNat - ∑ i, a i) / δ. Thus an open interval of width δ for Boolean sums corresponds to an open interval of length two for sign sums. The Lean statement uses the more general condition that every pair of accepted sums differs by less than δ, proved by the same Sperner argument. This includes half-open intervals [t, t + δ): each pair has distance less than δ, although their diameter is δ. Subset versions fix the complementary coordinates and count the resulting fibers.

References #

Central binomial upper bound over ℝ #

Over ℝ, (m.choose (m / 2) : ℝ) ≤ (2 : ℝ) ^ m / Real.sqrt (m + 1) for all m : ℕ.

Erdős–Littlewood–Offord anti-concentration via Sperner's theorem #

noncomputable def Cslib.Combinatorics.LittlewoodOfford.signNormalizedSetEquiv {ι : Type u_1} [Fintype ι] [DecidableEq ι] (a : ι → ℝ) :
(ι → Bool) ≃ Finset ι

Sign-normalized subset equivalence (ι → Bool) ≃ Finset ι sending w to the set of coordinates i where w i aligns with the sign of a i (w i = decide (0 ≤ a i)).

theorem Cslib.Combinatorics.LittlewoodOfford.sum_bool_eq_neg_sum_add_sum_abs {ι : Type u_1} [Fintype ι] [DecidableEq ι] (a : ι → ℝ) (w : ι → Bool) :
∑ i : ι, a i * ↑(w i).toNat = (∑ i : ι, if a i < 0 then a i else 0) + ∑ i ∈ (signNormalizedSetEquiv a) w, |a i|

Under signNormalizedSetEquiv a, the Boolean linear form ∑ i, a i * (w i).toNat decomposes into (∑ i with a i < 0, a i) + ∑ i ∈ signNormalizedSetEquiv a w, |a i|.

theorem Cslib.Combinatorics.LittlewoodOfford.card_filter_sum_bool_le_choose_of_forall_le_abs {ι : Type u_1} [Fintype ι] [DecidableEq ι] (a : ι → ℝ) {δ : ℝ} (P : ℝ → Prop) [DecidablePred P] (hδ : ∀ (i : ι), δ ≤ |a i|) (hP : ∀ (x y : ℝ), P x → P y → |x - y| < δ) :
{w : ι → Bool | P (∑ i : ι, a i * ↑(w i).toNat)}.card ≤ (Fintype.card ι).choose (Fintype.card ι / 2)

Full-support Erdős–Littlewood–Offord inequality: if |a i| ≥ δ for all i : ι and P has the property that every pair of its points differs by less than δ (∀ x y, P x → P y → |x - y| < δ), then at most (Fintype.card ι).choose (Fintype.card ι / 2) Boolean vectors w : ι → Bool satisfy P (∑ i, a i * (w i).toNat).

theorem Cslib.Combinatorics.LittlewoodOfford.card_filter_sum_bool_le_of_subset {ι : Type u_1} [Fintype ι] [DecidableEq ι] (a : ι → ℝ) (S : Finset ι) {δ : ℝ} (P : ℝ → Prop) [DecidablePred P] (hδ : ∀ i ∈ S, δ ≤ |a i|) (hP : ∀ (x y : ℝ), P x → P y → |x - y| < δ) :
{w : ι → Bool | P (∑ i : ι, a i * ↑(w i).toNat)}.card ≤ 2 ^ (Fintype.card ι - S.card) * S.card.choose (S.card / 2)

Erdős–Littlewood–Offord inequality on a subset S : Finset ι: if |a i| ≥ δ for all i ∈ S and every pair of points satisfying P differs by less than δ, then at most 2 ^ (Fintype.card ι - #S) * (#S).choose (#S / 2) Boolean vectors w : ι → Bool satisfy P (∑ i, a i * (w i).toNat).

theorem Cslib.Combinatorics.LittlewoodOfford.card_filter_sum_bool_le_two_pow_div_sqrt {ι : Type u_1} [Fintype ι] [DecidableEq ι] (a : ι → ℝ) (S : Finset ι) {δ : ℝ} (P : ℝ → Prop) [DecidablePred P] (hδ : ∀ i ∈ S, δ ≤ |a i|) (hP : ∀ (x y : ℝ), P x → P y → |x - y| < δ) :
↑{w : ι → Bool | P (∑ i : ι, a i * ↑(w i).toNat)}.card ≤ 2 ^ Fintype.card ι / √(↑S.card + 1)

Quantitative Erdős–Littlewood–Offord bound over ℝ: if |a i| ≥ δ for all i ∈ S and every pair of points satisfying P differs by less than δ, then (#{w : ι → Bool | P (∑ i, a i * (w i).toNat)} : ℝ) ≤ (2 : ℝ) ^ Fintype.card ι / Real.sqrt (#S + 1).

theorem Cslib.Combinatorics.LittlewoodOfford.card_filter_sum_bool_Ico_le_two_pow_div_sqrt {ι : Type u_1} [Fintype ι] [DecidableEq ι] (a : ι → ℝ) (S : Finset ι) (c : ℝ) {δ : ℝ} (hδ : ∀ i ∈ S, δ ≤ |a i|) :
↑{w : ι → Bool | c ≤ ∑ i : ι, a i * ↑(w i).toNat ∧ ∑ i : ι, a i * ↑(w i).toNat < c + δ}.card ≤ 2 ^ Fintype.card ι / √(↑S.card + 1)

Half-open interval Littlewood–Offord bound: for any half-open interval [c, c + δ) with |a i| ≥ δ for all i ∈ S, (#{w : ι → Bool | c ≤ ∑ i, a i * (w i).toNat ∧ ∑ i, a i * (w i).toNat < c + δ} : ℝ) ≤ (2 : ℝ) ^ Fintype.card ι / Real.sqrt (#S + 1).

theorem Cslib.Combinatorics.LittlewoodOfford.card_filter_Ico_sum_le {α : Type u_1} {ι : Type u_2} [Fintype α] (g : α → ℝ) (T : Finset ι) (δ M : ι → ℝ) (hM : ∀ i ∈ T, ∀ (c : ℝ), ↑{x : α | c ≤ g x ∧ g x < c + δ i}.card ≤ M i) (c₀ : ℝ) :
↑{x : α | c₀ - ∑ i ∈ T, δ i ≤ g x ∧ g x < c₀}.card ≤ ∑ i ∈ T, M i

Covering a half-open interval [c₀ - ∑ i ∈ T, δ i, c₀) by #T half-open subintervals of lengths δ i: if every half-open interval [c, c + δ i) for i ∈ T contains at most M i elements of univ : Finset α, then [c₀ - ∑ i ∈ T, δ i, c₀) contains at most ∑ i ∈ T, M i elements.

Reciprocal square-root rank sum bound #

For every n ≥ 1, 1 / Real.sqrt n + 2 * Real.sqrt (n - 1 : ℕ) ≤ 2 * Real.sqrt n.

theorem Cslib.Combinatorics.LittlewoodOfford.sum_one_div_sqrt_card_ge_le {ι : Type u_1} (S : Finset ι) (a : ι → ℝ) :
∑ i ∈ S, 1 / √↑{j ∈ S | |a i| ≤ |a j|}.card ≤ 2 * √↑S.card

Reciprocal square-root rank sum bound: for any finite set S : Finset ι and weights a : ι → ℝ, summing 1 / √(#{j ∈ S | |a i| ≤ |a j|}) over i ∈ S is at most 2 * √(#S).

Block-partition live sets and marginal frequencies #

theorem Cslib.Combinatorics.LittlewoodOfford.card_filter_eval_eq {κ : Type u_1} {τ : Type u_2} [Fintype κ] [DecidableEq κ] [Fintype τ] [DecidableEq τ] (j₀ : κ) (t₀ : τ) :
{σ : κ → τ | σ j₀ = t₀}.card * Fintype.card τ = Fintype.card (κ → τ)

For any coordinate j₀ : κ and target value t₀ : τ, the number of functions σ : κ → τ with σ j₀ = t₀ times Fintype.card τ equals Fintype.card (κ → τ).

theorem Cslib.Combinatorics.LittlewoodOfford.card_filter_eval_eq_and_eval_eq {κ : Type u_1} {τ : Type u_2} [Fintype κ] [DecidableEq κ] [Fintype τ] [DecidableEq τ] {j₁ j₂ : κ} (hne : j₁ ≠ j₂) (t₁ t₂ : τ) :
{σ : κ → τ | σ j₁ = t₁ ∧ σ j₂ = t₂}.card * Fintype.card τ ^ 2 = Fintype.card (κ → τ)

For any distinct coordinates j₁ ≠ j₂ in κ and target values t₁, t₂ : τ, the number of functions σ : κ → τ with σ j₁ = t₁ ∧ σ j₂ = t₂ times (Fintype.card τ) ^ 2 equals Fintype.card (κ → τ).

def Cslib.Combinatorics.LittlewoodOfford.blockLiveSet {κ : Type u_1} {τ : Type u_2} {ι : Type u_3} [Fintype κ] [DecidableEq ι] (blockVar : κ → τ → ι) (σ : κ → τ) :

The live coordinate set {blockVar j (σ j) | j : κ} obtained by selecting one element σ j : τ from each block j : κ.

@[simp]
theorem Cslib.Combinatorics.LittlewoodOfford.mem_blockLiveSet {κ : Type u_1} {τ : Type u_2} {ι : Type u_3} [Fintype κ] [DecidableEq ι] (blockVar : κ → τ → ι) (σ : κ → τ) (i : ι) :
i ∈ blockLiveSet blockVar σ ↔ ∃ (j : κ), blockVar j (σ j) = i
theorem Cslib.Combinatorics.LittlewoodOfford.card_mem_blockLiveSet_le {κ : Type u_1} {τ : Type u_2} {ι : Type u_3} [Fintype κ] [DecidableEq κ] [Fintype τ] [DecidableEq ι] (blockVar : κ → τ → ι) (hinj : ∀ (j₁ : κ) (t₁ : τ) (j₂ : κ) (t₂ : τ), blockVar j₁ t₁ = blockVar j₂ t₂ → j₁ = j₂ ∧ t₁ = t₂) (i : ι) :
↑{σ : κ → τ | i ∈ blockLiveSet blockVar σ}.card ≤ 1 / ↑(Fintype.card τ) * ↑(Fintype.card (κ → τ))

When blockVar : κ → τ → ι is injective across blocks and slots, each coordinate i : ι belongs to blockLiveSet blockVar σ for at most (1 / |τ|) * |κ → τ| choices of σ : κ → τ.

theorem Cslib.Combinatorics.LittlewoodOfford.card_mem_and_mem_blockLiveSet_le {κ : Type u_1} {τ : Type u_2} {ι : Type u_3} [Fintype κ] [DecidableEq κ] [Fintype τ] [DecidableEq ι] (blockVar : κ → τ → ι) (hinj : ∀ (j₁ : κ) (t₁ : τ) (j₂ : κ) (t₂ : τ), blockVar j₁ t₁ = blockVar j₂ t₂ → j₁ = j₂ ∧ t₁ = t₂) {i₁ i₂ : ι} (hne : i₁ ≠ i₂) :
↑{σ : κ → τ | i₁ ∈ blockLiveSet blockVar σ ∧ i₂ ∈ blockLiveSet blockVar σ}.card ≤ (1 / ↑(Fintype.card τ)) ^ 2 * ↑(Fintype.card (κ → τ))

When blockVar : κ → τ → ι is injective across blocks and slots, any two distinct coordinates i₁ ≠ i₂ jointly belong to blockLiveSet blockVar σ for at most (1 / |τ|) ^ 2 * |κ → τ| choices of σ : κ → τ.