While this submission is a draft, it cannot be used by other submissions.

Parameterized Problems on a Word RAM

Lax117284.ParameterizedComplexity · concepts/Lax117284/ParameterizedComplexity.lean · lax-117284

definition

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Natural Language Statement

    Definition

    A parameterized problem is a set of admissible input words, a yes-instance predicate on them, and a parameter read off the word. It is fixed-parameter tractable if one word RAM program decides it, on every admissible word xx of parameter kk, within c g(k) (∣x∣+1)cc\,g(k)\,(|x|+1)^c instructions for a constant cc and a function gg of the parameter alone: the running time is a function of the parameter times a polynomial in the length.

    Concept map
    3 concepts; 2 descendants hidden
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A

    Lean source view on GitHub

    1import Lax808846.RamComputes
    2
    3/-!
    4---
    5title: Parameterized Problems on a Word RAM
    6type: definition
    7---
    8A *parameterized problem* is a set of admissible input words, a yes-instance predicate on
    9them, and a parameter read off the word. It is *fixed-parameter tractable* if one word RAM
    10program decides it, on every admissible word xx of parameter kk, within
    11c g(k) (∣x∣+1)cc\,g(k)\,(|x|+1)^c instructions for a constant cc and a function gg of the parameter
    12alone: the running time is a function of the parameter times a polynomial in the length.
    13
    14# Formalization Notes
    15
    16The parameter is a function of the input word rather than something carried alongside it.
    17This is what lets one program serve every parameter: a program that must be told the
    18parameter from outside would be a family of programs, one per parameter, and could hide
    19unbounded advice in its literals. The quantifier order says so — the program and the
    20constant come before the instance, the parameter and the word length. A parameter that is a
    21structural property of the encoded object, such as the treewidth of a graph read off the
    22word, is a function of the word all the same, and no computability of that function is
    23required or used.
    24
    25`Fits` is the fitting condition, stated as an explicit inequality against 2w2^w rather than
    26through logarithms. It says of each entry vv of a word that c(∣x∣+v+1)c≤2wc(|x|+v+1)^c \le 2^w, which at
    27once makes every entry a genuine word and leaves polynomial room in the length, the usual
    28word RAM assumption of a word of at least clog⁡∣x∣c\log|x| bits: the memory a polynomial-time
    29algorithm addresses is a polynomial in the length, and a table of size ∣x∣2|x|^2, such as the
    30adjacency matrix of a graph read off the word, must fit. Entries are not bounded by the length
    31in general: a due date may be any number at all, so quantifying over the entries is what
    32makes a claim about them honest instead of silently assuming they are small.
    33
    34The bound is c g(k) (∣x∣+1)cc\,g(k)\,(|x|+1)^c, elementary rather than asymptotic, with the +1+1 making it
    35meaningful on the empty word. The length enters through a polynomial, the usual form of
    36fixed-parameter tractability, and not linearly: a linear bound would be strictly stronger than
    37the notion the source uses, and would not hold for the algorithms the source cites, such as
    38Lenstra's, whose dependence on the length is polynomial and not linear (nor for an algorithm that
    39first builds a graph from the word, which takes more than linear time in the word). `g` is an arbitrary function of the parameter: it bounds a
    40fixed program's running time rather than defining it, so no computability requirement on
    41`g` is needed or intended.
    42
    43An *fpt-reduction* from `P` to `Q` is a map `f` on words, computed by one program within
    44c g(k) (∣x∣+1)cc\,g(k)\,(|x|+1)^c instructions, that sends admissible words to admissible words, preserves the
    45answer, and raises the parameter by at most a function of the old parameter. The program is
    46required to run on the admissible words that fit *and whose image fits*: the image of a word may
    47be exponentially longer than the word (a parameter-sized table), and a machine whose word length is
    48only logarithmic in the input cannot address it, exactly as a decision procedure is only required to
    49run on the words that fit. This is the notion that splits a fixed-parameter tractability proof into
    50a reduction, proved here, and a cited algorithm for the target problem.
    51-/
    52
    53namespace Lax117284.ParameterizedComplexity
    54
    55open Lax808846.Ram Lax808846.RamComputes
    56
    57/-- A parameterized problem: the words that encode an instance, which of them are
    58yes-instances, and the parameter each one carries. -/
    59structure Problem where
    60 /-- The words that encode an instance. A program may do anything on the others. -/
    61 Domain : Set (List ℕ)
    62 /-- The yes-instances. -/
    63 Yes : List ℕ → Prop
    64 /-- The parameter, a function of the word. -/
    65 param : List ℕ → ℕ
    66
    67/-- The word `x` fits at word length `w`, with room for `c` times its length: every entry
    68`v` of `x` satisfies `c * (x.length + v + 1) ^ c ≤ 2 ^ w`. -/
    69def Fits (c w : ℕ) (x : List ℕ) : Prop := ∀ v ∈ x, c * (x.length + v + 1) ^ c ≤ 2 ^ w
    70
    71open Classical in
    72/-- At every word length, the program decides `P` on every admissible word that fits,
    73within `c * g k * (|x| + 1) ^ c` instructions, where `k` is the word's parameter. It writes `1`
    74for a yes-instance and `0` for a no-instance. -/
    75def Decides (P : Problem) (prog : Program) (c : ℕ) (g : ℕ → ℕ) : Prop :=
    76 ∀ w : ℕ, ComputesInTime w prog
    77 {x | x ∈ P.Domain ∧ Fits c w x}
    78 (fun x => if P.Yes x then [1] else [0])
    79 (fun x => c * g (P.param x) * (x.length + 1) ^ c)
    80
    81/-- `P` is **fixed-parameter tractable**: one program and one constant decide it within
    82`c * g k * (|x| + 1) ^ c` instructions, for some function `g` of the parameter alone. -/
    83def FPT (P : Problem) : Prop := ∃ (prog : Program) (c : ℕ) (g : ℕ → ℕ), Decides P prog c g
    84
    85/-- The map `f` is an **fpt-reduction** from `P` to `Q`, computed by `prog` within
    86`c * g k * (|x| + 1) ^ c` instructions on the admissible words that fit and whose image fits,
    87and raising the parameter to at most `h k`. -/
    88structure IsFptReduction (P Q : Problem) (f : List ℕ → List ℕ) (prog : Program)
    89 (c : ℕ) (g h : ℕ → ℕ) : Prop where
    90 /-- The image of an admissible word is admissible. -/
    91 maps_domain : ∀ x ∈ P.Domain, f x ∈ Q.Domain
    92 /-- Yes-instances go to yes-instances, and no-instances to no-instances. -/
    93 correct : ∀ x ∈ P.Domain, (P.Yes x ↔ Q.Yes (f x))
    94 /-- The new parameter is bounded by a function of the old one alone. -/
    95 param_le : ∀ x ∈ P.Domain, Q.param (f x) ≤ h (P.param x)
    96 /-- At every word length, the program computes `f` on every admissible word that fits and
    97 whose image fits, within the stated bound. -/
    98 time : ∀ w : ℕ, ComputesInTime w prog
    99 {x | x ∈ P.Domain ∧ Fits c w x ∧ Fits c w (f x)}
    100 f (fun x => c * g (P.param x) * (x.length + 1) ^ c)
    101
    102/-- `P` **fpt-reduces** to `Q`. -/
    103def FptReduces (P Q : Problem) : Prop :=
    104 ∃ (f : List ℕ → List ℕ) (prog : Program) (c : ℕ) (g h : ℕ → ℕ),
    105 IsFptReduction P Q f prog c g h
    106
    107@[inherit_doc] infix:50 " ≤fpt " => FptReduces
    108
    109end Lax117284.ParameterizedComplexity
    110
    Formalization Notes

    The parameter is a function of the input word rather than something carried alongside it. This is what lets one program serve every parameter: a program that must be told the parameter from outside would be a family of programs, one per parameter, and could hide unbounded advice in its literals. The quantifier order says so — the program and the constant come before the instance, the parameter and the word length. A parameter that is a structural property of the encoded object, such as the treewidth of a graph read off the word, is a function of the word all the same, and no computability of that function is required or used.

    FitsFits is the fitting condition, stated as an explicit inequality against 2w2^w rather than through logarithms. It says of each entry vv of a word that c(∣x∣+v+1)c≤2wc(|x|+v+1)^c \le 2^w, which at once makes every entry a genuine word and leaves polynomial room in the length, the usual word RAM assumption of a word of at least clog⁡∣x∣c\log|x| bits: the memory a polynomial-time algorithm addresses is a polynomial in the length, and a table of size ∣x∣2|x|^2, such as the adjacency matrix of a graph read off the word, must fit. Entries are not bounded by the length in general: a due date may be any number at all, so quantifying over the entries is what makes a claim about them honest instead of silently assuming they are small.

    The bound is c g(k) (∣x∣+1)cc\,g(k)\,(|x|+1)^c, elementary rather than asymptotic, with the +1+1 making it meaningful on the empty word. The length enters through a polynomial, the usual form of fixed-parameter tractability, and not linearly: a linear bound would be strictly stronger than the notion the source uses, and would not hold for the algorithms the source cites, such as Lenstra's, whose dependence on the length is polynomial and not linear (nor for an algorithm that first builds a graph from the word, which takes more than linear time in the word). gg is an arbitrary function of the parameter: it bounds a fixed program's running time rather than defining it, so no computability requirement on gg is needed or intended.

    An fpt-reduction from PP to QQ is a map ff on words, computed by one program within c g(k) (∣x∣+1)cc\,g(k)\,(|x|+1)^c instructions, that sends admissible words to admissible words, preserves the answer, and raises the parameter by at most a function of the old parameter. The program is required to run on the admissible words that fit and whose image fits: the image of a word may be exponentially longer than the word (a parameter-sized table), and a machine whose word length is only logarithmic in the input cannot address it, exactly as a decision procedure is only required to run on the words that fit. This is the notion that splits a fixed-parameter tractability proof into a reduction, proved here, and a cited algorithm for the target problem.

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above.

    Loading discussion…