Parameterized Problems on a Word RAM
Lax117284.ParameterizedComplexity · concepts/Lax117284/ParameterizedComplexity.lean · lax-117284
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural 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 of parameter , within instructions for a constant and a function of the parameter alone: the running time is a function of the parameter times a polynomial in the length.
Concept map
Lean source view on GitHub
| 1 | import Lax808846.RamComputes |
| 2 | |
| 3 | /-! |
| 4 | --- |
| 5 | title: Parameterized Problems on a Word RAM |
| 6 | type: definition |
| 7 | --- |
| 8 | A *parameterized problem* is a set of admissible input words, a yes-instance predicate on |
| 9 | them, and a parameter read off the word. It is *fixed-parameter tractable* if one word RAM |
| 10 | program decides it, on every admissible word of parameter , within |
| 11 | instructions for a constant and a function of the parameter |
| 12 | alone: the running time is a function of the parameter times a polynomial in the length. |
| 13 | |
| 14 | # Formalization Notes |
| 15 | |
| 16 | The parameter is a function of the input word rather than something carried alongside it. |
| 17 | This is what lets one program serve every parameter: a program that must be told the |
| 18 | parameter from outside would be a family of programs, one per parameter, and could hide |
| 19 | unbounded advice in its literals. The quantifier order says so — the program and the |
| 20 | constant come before the instance, the parameter and the word length. A parameter that is a |
| 21 | structural property of the encoded object, such as the treewidth of a graph read off the |
| 22 | word, is a function of the word all the same, and no computability of that function is |
| 23 | required or used. |
| 24 | |
| 25 | `Fits` is the fitting condition, stated as an explicit inequality against rather than |
| 26 | through logarithms. It says of each entry of a word that , which at |
| 27 | once makes every entry a genuine word and leaves polynomial room in the length, the usual |
| 28 | word RAM assumption of a word of at least bits: the memory a polynomial-time |
| 29 | algorithm addresses is a polynomial in the length, and a table of size , such as the |
| 30 | adjacency matrix of a graph read off the word, must fit. Entries are not bounded by the length |
| 31 | in general: a due date may be any number at all, so quantifying over the entries is what |
| 32 | makes a claim about them honest instead of silently assuming they are small. |
| 33 | |
| 34 | The bound is , elementary rather than asymptotic, with the making it |
| 35 | meaningful on the empty word. The length enters through a polynomial, the usual form of |
| 36 | fixed-parameter tractability, and not linearly: a linear bound would be strictly stronger than |
| 37 | the notion the source uses, and would not hold for the algorithms the source cites, such as |
| 38 | Lenstra's, whose dependence on the length is polynomial and not linear (nor for an algorithm that |
| 39 | first 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 |
| 40 | fixed program's running time rather than defining it, so no computability requirement on |
| 41 | `g` is needed or intended. |
| 42 | |
| 43 | An *fpt-reduction* from `P` to `Q` is a map `f` on words, computed by one program within |
| 44 | instructions, that sends admissible words to admissible words, preserves the |
| 45 | answer, and raises the parameter by at most a function of the old parameter. The program is |
| 46 | required to run on the admissible words that fit *and whose image fits*: the image of a word may |
| 47 | be exponentially longer than the word (a parameter-sized table), and a machine whose word length is |
| 48 | only logarithmic in the input cannot address it, exactly as a decision procedure is only required to |
| 49 | run on the words that fit. This is the notion that splits a fixed-parameter tractability proof into |
| 50 | a reduction, proved here, and a cited algorithm for the target problem. |
| 51 | -/ |
| 52 | |
| 53 | namespace Lax117284.ParameterizedComplexity |
| 54 | |
| 55 | open Lax808846.Ram Lax808846.RamComputes |
| 56 | |
| 57 | /-- A parameterized problem: the words that encode an instance, which of them are |
| 58 | yes-instances, and the parameter each one carries. -/ |
| 59 | structure 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`. -/ |
| 69 | def Fits (c w : ℕ) (x : List ℕ) : Prop := ∀ v ∈ x, c * (x.length + v + 1) ^ c ≤ 2 ^ w |
| 70 | |
| 71 | open Classical in |
| 72 | /-- At every word length, the program decides `P` on every admissible word that fits, |
| 73 | within `c * g k * (|x| + 1) ^ c` instructions, where `k` is the word's parameter. It writes `1` |
| 74 | for a yes-instance and `0` for a no-instance. -/ |
| 75 | def 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. -/ |
| 83 | def 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, |
| 87 | and raising the parameter to at most `h k`. -/ |
| 88 | structure 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`. -/ |
| 103 | def 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 | |
| 109 | end 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.
is the fitting condition, stated as an explicit inequality against rather than through logarithms. It says of each entry of a word that , 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 bits: the memory a polynomial-time algorithm addresses is a polynomial in the length, and a table of size , 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 , elementary rather than asymptotic, with the 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). is an arbitrary function of the parameter: it bounds a fixed program's running time rather than defining it, so no computability requirement on is needed or intended.
An fpt-reduction from to is a map on words, computed by one program within 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.
0 comments