Documentation

CslibFrontier.Foundations.Combinatorics.Hypergeometric.Miss

Random subsets rarely miss a fixed set #

For a set U of u elements of an n-element set s, the ℓ-subsets of s disjoint from U are the ℓ-subsets of s \ U (card_filter_disjoint_powersetCard), so a uniformly random ℓ-subset misses U with probability C(n - u, ℓ) / C(n, ℓ). The library's Nat.choose_mul_pow_le bounds this by (1 - u / n) ^ ℓ, and hence by exp (-u ℓ / n) (choose_sub_le_choose_mul_exp). This is the zero tail of the hypergeometric distribution of #(U ∩ J) studied in CslibFrontier.Foundations.Combinatorics.Hypergeometric.

Main results #

theorem Cslib.choose_sub_le_choose_mul_exp {n u : ℕ} (hu : u ≤ n) (ℓ : ℕ) :
↑((n - u).choose ℓ) ≤ ↑(n.choose ℓ) * Real.exp (-(↑u * ↑ℓ / ↑n))

Missing a set, exponential form: C(n - u, ℓ) ≤ C(n, ℓ) exp (-u ℓ / n), for u ≤ n.

theorem Cslib.card_filter_disjoint_powersetCard {α : Type u_1} [DecidableEq α] {s U : Finset α} (hU : U ⊆ s) (ℓ : ℕ) :
{J ∈ Finset.powersetCard ℓ s | Disjoint U J}.card = (s.card - U.card).choose ℓ

The ℓ-subsets of s that miss U ⊆ s are the ℓ-subsets of s \ U.

theorem Cslib.card_filter_disjoint_powersetCard_le {α : Type u_1} [DecidableEq α] {s U : Finset α} (hU : U ⊆ s) (ℓ : ℕ) :
↑{J ∈ Finset.powersetCard ℓ s | Disjoint U J}.card ≤ ↑(Finset.powersetCard ℓ s).card * Real.exp (-(↑U.card * ↑ℓ / ↑s.card))

Few subsets miss a fixed set: at most a exp (-#U ℓ / #s) fraction of the ℓ-subsets of s are disjoint from U ⊆ s.