Counting supports consisting of at most a fixed number of intervals
ProvedPvsNP.interval_union_support_countcombinatoricscomplexity-theoryformal-verification
On a line of a fixed finite length, the number of supports that are unions of at most r half-open intervals is at most (1+(length+1)^2)^r.
Preamble
import Mathlib.SetTheory.Cardinal.NatCard set_option autoImplicit false
Formal statement
theorem PvsNP.interval_union_support_count (positions slots : ℕ) :
Nat.card {support : Finset (Fin positions) //
∃ endpoints : Fin slots → Option (Fin (positions + 1) × Fin (positions + 1)),
∀ i : Fin positions, i ∈ support ↔
∃ j a b, endpoints j = some (a, b) ∧ a.val ≤ i.val ∧ i.val < b.val} ≤
(1 + (positions + 1) ^ 2) ^ slots := by sorrySource
Original interval-budget argument for iterated one-head replay.