Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

A polynomial-time word function on inputs padded by 2κ2^{\kappa}2κ symbols gives one machine with step bound C⋅2Cκ(∣x∣+1)CC\cdot 2^{C\kappa}(|x|+1)^{C}C⋅2Cκ(∣x∣+1)C

Proved
FptBridge.fpt_of_poly

by shosonoda · Nov 27, 2026 · Mathlib 0df444a (Lean v4.33.1)

algorithmscomplexity-theorycomputabilityfixed-parameter-tractabilitypolynomial-time

Setting. 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 ggg 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 xxx, halts with exactly the word yyy on its output stack after at most ttt steps.

Statement. Let the instances aaa of a problem be encoded as Boolean words ea(a)\mathrm{ea}(a)ea(a), and let κ(a)∈N\kappa(a)\in\mathbb Nκ(a)∈N be a parameter of the instances. Assume:

  1. the parameter can be read off the input word in polynomial time: kf is an Automatic.Poly function from words to numbers with kf(ea(a))=κ(a)\mathrm{kf}(\mathrm{ea}(a))=\kappa(a)kf(ea(a))=κ(a) for every aaa;
  2. f is an Automatic.Poly function 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;
  3. for every instance aaa, f(ea(a), u2κ(a))=out(a)f\bigl(\mathrm{ea}(a),\,u^{2^{\kappa(a)}}\bigr)=\mathrm{out}(a)f(ea(a),u2κ(a))=out(a), where umu^{m}um is the list of mmm units.

Then there are a constant CCC and one machine MMM, the same for all instances, such that for every instance aaa the machine started on the plain word ea(a)\mathrm{ea}(a)ea(a) halts with the plain word out(a)\mathrm{out}(a)out(a) within C⋅2Cκ(a)⋅(∣ea(a)∣+1)CC\cdot 2^{C\kappa(a)}\cdot(|\mathrm{ea}(a)|+1)^{C}C⋅2Cκ(a)⋅(∣ea(a)∣+1)C 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 2κ2^{\kappa}2κ as fuel for its loops; no machine is built by hand.

Remarks. The values of fff matter only at the padding of length exactly 2κ(a)2^{\kappa(a)}2κ(a), and the values of kf only on the words ea(a)\mathrm{ea}(a)ea(a); 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 2O(κ)⋅∣x∣O(1)2^{O(\kappa)}\cdot|x|^{O(1)}2O(κ)⋅∣x∣O(1) are covered; another dependence on a parameter kkk is obtained by taking for κ\kappaκ a function of kkk. The data ea\mathrm{ea}ea, κ\kappaκ, out\mathrm{out}out only index the instances: the statement is equivalent to its case where instances are words and ea\mathrm{ea}ea is the identity.

Preamble
import Mathlib
import Definitions.Def_QuantumMaxCutFiniteNumericRuntime
import Definitions.Def_HMBinPacking_OutputsWithin
Formal statement
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
Source
Infrastructure lemma, not taken from a paper. It is stated on the Boolean-stack runtime `Definitions.Def_QuantumMaxCutFiniteNumericRuntime` and was first used in the accepted proofs of `SingleExpBisect.Main.lemma_3_11`, `lemma_5_1`, `theorem_1_1` and `theorem_1_2` (S. Kumabe, arXiv:2611.05982, machine statements).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me