Counting finite functions with a small image
ProvedPvsNP.LowImageFunctions.card_functions_of_small_imagecombinatoricscomplexity-theoryformal-verification
For finite sets I and A and a nonnegative integer k ≤ |I|, the number of functions from I to A that use at most k distinct values is at most binomial(|I|,k) · |A|^k · k^(|I|−k).
Preamble
import Mathlib
Formal statement
theorem PvsNP.LowImageFunctions.card_functions_of_small_image
{I A : Type} [Fintype I] [Fintype A] [DecidableEq I] [DecidableEq A]
(k : ℕ) (room : k ≤ Fintype.card I) :
Nat.card {f : I → A // ((Finset.univ : Finset I).image f).card ≤ k} ≤
(Fintype.card I).choose k * ((Fintype.card A)^k * k^(Fintype.card I-k)) := by sorrySource
Direct finite counting by representatives and pointers. This gives a small-image bound for a limited-independence address schedule.