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 #
Cslib.card_filter_disjoint_powersetCard: theℓ-subsets ofsthat missU.Cslib.choose_sub_le_choose_mul_exp:C(n - u, ℓ) ≤ C(n, ℓ) exp (-u ℓ / n).Cslib.card_filter_disjoint_powersetCard_le: fewℓ-subsets ofsmissU.
theorem Cslib.card_filter_disjoint_powersetCard {α : Type u_1} [DecidableEq α] {s U : Finset α} (hU : U ⊆ s) (ℓ : ℕ) :
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) (ℓ : ℕ) :
Few subsets miss a fixed set: at most a exp (-#U ℓ / #s) fraction of the ℓ-subsets of
s are disjoint from U ⊆ s.