Documentation

CslibFrontier.Foundations.Combinatorics.FiniteCover

Finite covers from uniform local density #

If a uniformly chosen test misses each of the obligations w : W with probability at most p / q, then t tests hit every obligation as soon as |W| p ^ t < q ^ t (exists_cover_of_scaled_card_lt): the bad sequences of tests are counted, with a union bound over the obligations. In particular, if every obligation is hit by at least a 1 / q fraction of the tests, then q (n + 1) tests hit 2 ^ n obligations (exists_cover_of_density). Its budget is the integer form 2 ^ n (q - 1) ^ (q (n + 1)) < q ^ (q (n + 1)) of 2 ^ n (1 - 1 / q) ^ (q (n + 1)) < 1 (Nat.two_pow_mul_pred_pow_mul_succ_lt), which follows from 2 (q - 1) ^ q ≤ q ^ q without exponential estimates. The exact bound is reexported from FiniteCover.Basic, so clients that need only the union bound can import that module alone.

Main results #

theorem Nat.two_pow_mul_pred_pow_mul_succ_lt {b : ℕ} (hb : 1 ≤ b) (n : ℕ) :
2 ^ n * (b - 1) ^ (b * (n + 1)) < b ^ (b * (n + 1))

For 1 ≤ b, 2 ^ n * (b - 1) ^ (b * (n + 1)) < b ^ (b * (n + 1)): the integer form of 2 ^ n * (1 - 1 / b) ^ (b * (n + 1)) < 1, from 2 * (b - 1) ^ b ≤ b ^ b.

theorem Cslib.exists_cover_of_density {S : Type u_1} {W : Type u_2} [Fintype S] [Nonempty S] [Fintype W] (hit : S → W → Prop) [DecidableRel hit] (q n : ℕ) (hq : 0 < q) (hw : Fintype.card W ≤ 2 ^ n) (density : ∀ (w : W), Fintype.card S ≤ q * Fintype.card { s : S // hit s w }) :
∃ (tests : Fin (q * (n + 1)) → S), ∀ (w : W), ∃ (i : Fin (q * (n + 1))), hit (tests i) w

Covers from density: if every obligation w is hit by at least a 1 / q fraction of the tests, then q (n + 1) tests, with repetitions, hit all of at most 2 ^ n obligations.