Counting tables with at most m changed positions
ProvedPvsNP.SparsePatchUniverse.card_sparse_patch_universecombinatoricscomplexity-theoryformal-verification
Let I and A be finite sets and fix a table from I to A. Among all tables from I to A, the number that differ from the fixed table at at most m positions is at most (1 + |I| · |A|)^m. A symbol in A can itself be a whole block of bits.
Preamble
import Mathlib set_option autoImplicit false
Formal statement
theorem PvsNP.SparsePatchUniverse.card_sparse_patch_universe {Index Symbol : Type} [DecidableEq Index] [Fintype Index] [Fintype Symbol]
[DecidableEq Symbol] (base : Index → Symbol) (m : ℕ) :
Nat.card {table : Index → Symbol //
(Finset.univ.filter (fun i => table i ≠ base i)).card ≤ m} ≤
(Fintype.card Index * Fintype.card Symbol + 1)^m := by sorrySource
A fixed-length positional edit code for the ambient input set used in randomized local replay.