Parameterized problems and fpt-reductions on a word RAM
Lax470956.ParameterizedComplexity · concepts/Lax470956/ParameterizedComplexity.lean · lax-470956
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.
An fpt-reduction from to is a map on words that sends admissible words to admissible words, preserves and reflects yes-instances, raises the parameter by at most a function of it, and is computed by one word RAM program within the same kind of bound. Fpt-reductions compose, and together with gives .
Concept map
Lean source view on GitHub
| 1 | import Lax808846.RamComputes |
| 2 | |
| 3 | /-! |
| 4 | --- |
| 5 | title: Parameterized problems and fpt-reductions 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 |
| 10 | RAM program decides it, on every admissible word of parameter , within |
| 11 | instructions for a constant and a function of the parameter |
| 12 | alone. |
| 13 | |
| 14 | An *fpt-reduction* from to is a map on words that sends admissible words to |
| 15 | admissible words, preserves and reflects yes-instances, raises the parameter by at most a |
| 16 | function of it, and is computed by one word RAM program within the same kind of bound. |
| 17 | Fpt-reductions compose, and together with |
| 18 | gives . |
| 19 | |
| 20 | # Formalization notes |
| 21 | |
| 22 | The parameter is read off the input word, and the program is fixed before it: the |
| 23 | quantifier order puts the program and the constant before the instance, the parameter and |
| 24 | the word length. This is the uniformity of the definition. A definition that let the |
| 25 | program be chosen after would describe a family of programs, one per parameter, which |
| 26 | could hide unbounded advice in its literals. |
| 27 | |
| 28 | `Fits` is the fitting condition, stated as an explicit inequality against `2 ^ w` rather |
| 29 | than through logarithms. It says of each entry of a word that , |
| 30 | which makes every entry a word and leaves room for the constant multiple |
| 31 | of the length that bounds the addresses and the step count. Entries are not bounded by |
| 32 | the length in general: a parameter, a weight or a deadline may be any number at all, so |
| 33 | the claim quantifies over the entries instead of assuming they are small. |
| 34 | |
| 35 | A reduction's *output* has to fit as well. A machine at word length reduces what it |
| 36 | writes modulo , so a word whose image does not fit is one the program cannot emit; |
| 37 | the admissible set therefore constrains the image too. Like every fitting condition here |
| 38 | this restricts the inputs rather than appearing as a hypothesis: as a hypothesis it would |
| 39 | be empty, since no word length accommodates every encoding of a fixed instance at once. |
| 40 | |
| 41 | The bound is `c * g k * (x.length + 1)`, elementary rather than asymptotic, with the |
| 42 | `+ 1` making it meaningful on the empty word. Its dependence on the length is linear, |
| 43 | where the usual definition of FPT allows , so both notions defined here |
| 44 | are the stricter ones: a problem that is fixed-parameter tractable in this sense is so in |
| 45 | the usual sense, and a reduction that meets this bound is an fpt-reduction in the usual |
| 46 | sense. A membership and a hardness proved against these definitions therefore imply their |
| 47 | standard forms. Nothing weaker is defined because nothing weaker is needed — the dynamic |
| 48 | program of Theorem 3 and the reduction of Theorem 1 both run within a linear bound. |
| 49 | |
| 50 | `g` is an arbitrary function of the parameter: it bounds a fixed program's running time |
| 51 | rather than defining it, so no computability requirement on `g` is needed or intended. |
| 52 | Some presentations of FPT require to be computable; the definition here does not, and |
| 53 | the that Theorem 3 supplies is a closed-form expression in the parameter, so that |
| 54 | theorem meets the definitions that require it as well. |
| 55 | |
| 56 | Only the timed notions are defined. Plain computability is the special case in which the |
| 57 | bound is unconstrained, and is not what any statement of this submission needs. |
| 58 | -/ |
| 59 | |
| 60 | namespace Lax470956.ParameterizedComplexity |
| 61 | |
| 62 | open Lax808846.Ram Lax808846.RamComputes |
| 63 | |
| 64 | /-- A parameterized problem: the words that encode an instance, which of them are |
| 65 | yes-instances, and the parameter each one carries. -/ |
| 66 | structure Problem where |
| 67 | /-- The words that encode an instance. A program may do anything on the others. -/ |
| 68 | Domain : Set (List ℕ) |
| 69 | /-- The yes-instances. -/ |
| 70 | Yes : List ℕ → Prop |
| 71 | /-- The parameter, read off the word. -/ |
| 72 | param : List ℕ → ℕ |
| 73 | |
| 74 | /-- The word `x` fits at word length `w`, with room for `c` times its length: every |
| 75 | entry `v` of `x` satisfies `c * (x.length + v + 1) ≤ 2 ^ w`. -/ |
| 76 | def Fits (c w : ℕ) (x : List ℕ) : Prop := ∀ v ∈ x, c * (x.length + v + 1) ≤ 2 ^ w |
| 77 | |
| 78 | open Classical in |
| 79 | /-- At every word length, the program decides `P` on every admissible word that fits, |
| 80 | within `c * g k * (|x| + 1)` instructions, where `k` is the word's parameter. It writes |
| 81 | `1` for a yes-instance and `0` for a no-instance. -/ |
| 82 | def Decides (P : Problem) (prog : Program) (c : ℕ) (g : ℕ → ℕ) : Prop := |
| 83 | ∀ w : ℕ, ComputesInTime w prog |
| 84 | {x | x ∈ P.Domain ∧ Fits c w x} |
| 85 | (fun x => if P.Yes x then [1] else [0]) |
| 86 | (fun x => c * g (P.param x) * (x.length + 1)) |
| 87 | |
| 88 | /-- `P` is **fixed-parameter tractable**: one program and one constant decide it within |
| 89 | `c * g k * (|x| + 1)` instructions, for some function `g` of the parameter alone. -/ |
| 90 | def FPT (P : Problem) : Prop := ∃ (prog : Program) (c : ℕ) (g : ℕ → ℕ), Decides P prog c g |
| 91 | |
| 92 | /-- The map `f` is an fpt-reduction from `P` to `Q`, computed by `prog` within |
| 93 | `c * g k * (|x| + 1)` instructions and raising the parameter by at most `h`. -/ |
| 94 | structure IsFptReduction (P Q : Problem) (f : List ℕ → List ℕ) (prog : Program) |
| 95 | (c : ℕ) (g h : ℕ → ℕ) : Prop where |
| 96 | /-- The image of an admissible word is admissible. -/ |
| 97 | maps_domain : ∀ x ∈ P.Domain, f x ∈ Q.Domain |
| 98 | /-- Yes-instances go to yes-instances, and no-instances to no-instances. -/ |
| 99 | correct : ∀ x ∈ P.Domain, (P.Yes x ↔ Q.Yes (f x)) |
| 100 | /-- The new parameter is bounded by a function of the old one alone. -/ |
| 101 | param_le : ∀ x ∈ P.Domain, Q.param (f x) ≤ h (P.param x) |
| 102 | /-- At every word length, the program computes `f` on every admissible word that fits |
| 103 | and whose image fits, within the stated bound. -/ |
| 104 | time : ∀ w : ℕ, ComputesInTime w prog |
| 105 | {x | x ∈ P.Domain ∧ Fits c w x ∧ Fits c w (f x)} |
| 106 | f (fun x => c * g (P.param x) * (x.length + 1)) |
| 107 | |
| 108 | /-- `P` **fpt-reduces** to `Q`. -/ |
| 109 | def FptReduces (P Q : Problem) : Prop := |
| 110 | ∃ (f : List ℕ → List ℕ) (prog : Program) (c : ℕ) (g h : ℕ → ℕ), |
| 111 | IsFptReduction P Q f prog c g h |
| 112 | |
| 113 | @[inherit_doc] infix:50 " ≤fpt " => FptReduces |
| 114 | |
| 115 | end Lax470956.ParameterizedComplexity |
| 116 |
Formalization notes
The parameter is read off the input word, and the program is fixed before it: the quantifier order puts the program and the constant before the instance, the parameter and the word length. This is the uniformity of the definition. A definition that let the program be chosen after would describe a family of programs, one per parameter, which could hide unbounded advice in its literals.
is the fitting condition, stated as an explicit inequality against rather than through logarithms. It says of each entry of a word that , which makes every entry a word and leaves room for the constant multiple of the length that bounds the addresses and the step count. Entries are not bounded by the length in general: a parameter, a weight or a deadline may be any number at all, so the claim quantifies over the entries instead of assuming they are small.
A reduction's output has to fit as well. A machine at word length reduces what it writes modulo , so a word whose image does not fit is one the program cannot emit; the admissible set therefore constrains the image too. Like every fitting condition here this restricts the inputs rather than appearing as a hypothesis: as a hypothesis it would be empty, since no word length accommodates every encoding of a fixed instance at once.
The bound is , elementary rather than asymptotic, with the making it meaningful on the empty word. Its dependence on the length is linear, where the usual definition of FPT allows , so both notions defined here are the stricter ones: a problem that is fixed-parameter tractable in this sense is so in the usual sense, and a reduction that meets this bound is an fpt-reduction in the usual sense. A membership and a hardness proved against these definitions therefore imply their standard forms. Nothing weaker is defined because nothing weaker is needed — the dynamic program of Theorem 3 and the reduction of Theorem 1 both run within a linear bound.
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. Some presentations of FPT require to be computable; the definition here does not, and the that Theorem 3 supplies is a closed-form expression in the parameter, so that theorem meets the definitions that require it as well.
Only the timed notions are defined. Plain computability is the special case in which the bound is unconstrained, and is not what any statement of this submission needs.
Builds on
From Mathlib
none
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments