A polynomial-time word function on inputs padded by symbols gives one machine with step bound
ProvedFptBridge.fpt_of_polySetting. Automatic.Poly is the polynomial-time calculus of the Boolean-stack runtime in Definitions.Def_QuantumMaxCutFiniteNumericRuntime: Automatic.Poly g says that some PolyProgram (a finite multi-stack machine with Boolean stacks, together with a polynomial) computes on the canonical codes enc of its arguments, halting on every argument within the polynomial evaluated at the length of the code of the argument. HMBinPacking.OutputsWithin M x y t says that the multi-stack Turing machine M (Mathlib's Turing.TM2ComputableAux Bool Bool), started on the word , halts with exactly the word on its output stack after at most steps.
Statement. Let the instances of a problem be encoded as Boolean words , and let be a parameter of the instances. Assume:
- the parameter can be read off the input word in polynomial time:
kfis anAutomatic.Polyfunction from words to numbers with for every ; fis anAutomatic.Polyfunction on pairs (word, list of units), so it runs in time polynomial in the length of the word plus the length of the list, on every such pair;- for every instance , , where is the list of units.
Then there are a constant and one machine , the same for all instances, such that for every instance the machine started on the plain word halts with the plain word within steps.
Use. A statement of the form "some machine solves the problem within an FPT step bound" reduces to exhibiting a polynomial-time function that may use a unary list of length as fuel for its loops; no machine is built by hand.
Remarks. The values of matter only at the padding of length exactly , and the values of kf only on the words ; both must nevertheless be polynomial-time on all their arguments. The step bound is in the length of the input word; a bound in another size measure follows when the length of the word is bounded in the same form. Only bounds of the shape are covered; another dependence on a parameter is obtained by taking for a function of . The data , , only index the instances: the statement is equivalent to its case where instances are words and is the identity.
import Mathlib import Definitions.Def_QuantumMaxCutFiniteNumericRuntime import Definitions.Def_HMBinPacking_OutputsWithin
namespace FptBridge
open OAI.MetricKMedian.Binary OAI.MetricKMedian.Binary.Automatic
/-- **From a polynomial-time function on padded inputs to a machine with an FPT step bound.**
If the parameter `κ` can be read off the input word in polynomial time (`kf`), and `f` is
polynomial-time on pairs (word, unary list) and maps the input word with a padding of exactly
`2 ^ κ` units to the required output, then one multi-stack Turing machine, started on the input
word alone, writes the output within `C * 2 ^ (C * κ) * (|input| + 1) ^ C` steps. -/
theorem fpt_of_poly {α : Type} (ea : α → List Bool) (κ : α → ℕ) (out : α → List Bool)
(kf : List Bool → ℕ) (hk : Automatic.Poly kf) (hkf : ∀ a, kf (ea a) = κ a)
(f : List Bool × List Unit → List Bool) (hf : Automatic.Poly f)
(hfa : ∀ a, f (ea a, List.replicate (2 ^ κ a) ()) = out a) :
∃ C : ℕ, ∃ M : Turing.TM2ComputableAux Bool Bool, ∀ a,
HMBinPacking.OutputsWithin M (ea a) (out a)
(C * 2 ^ (C * κ a) * ((ea a).length + 1) ^ C) := by sorry
end FptBridge