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

Complexity classes along special cases

Lax434175.ComplexityClasses · concepts/Lax434175/ComplexityClasses.lean · lax-434175

proven

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

    Theorem

    The classes are those of the word RAM, for parameterized problems on words: a set of admissible words, the yes-instances among them, and a parameter.

    • P: one program decides the problem in polynomial time on its admissible words.
    • NP-hard: every language in NP, written as words of zeros and ones, reduces to the problem in polynomial time on admissible words.
    • FPT, W[t] and hardness for a class are those of the registered W-hierarchy (lax-496464).
    • XP: one program decides the problem within (∣x∣+2)f(k)(|x|+2)^{f(k)} instructions for a computable ff, where ∣x∣|x| is the bit size of the word and kk its parameter.
    • para-NP-hard: the problem restricted to the words of parameter at most some kk is NP-hard.

    A problem AA refines a problem BB if every admissible word of AA is one of BB, with the same answer and the same parameter.

    Theorem. If AA refines BB, then BB in P, FPT or XP puts AA there, and AA NP-hard, para-NP-hard or hard for a class of parameterized problems makes BB so.

    Theorem. For a coding of a family of scheduling problems with sound fields, the problem of a field-wise special case ss of tt refines that of tt, for every parameter of the kernel instance and every invariant parameter of a constraint field.

    Concept map
    21 concepts
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A
    Evidence

    Lean source view on GitHub

    1import Lax434930.NondeterministicPolynomialTime
    2import Lax496464.WH_B4_Hierarchies
    3import Lax434175.WordProblems
    4
    5/-!
    6---
    7title: Complexity classes along special cases
    8type: theorem
    9---
    10The classes are those of the word RAM, for parameterized problems on words: a
    11set of admissible words, the yes-instances among them, and a parameter.
    12
    13- **P**: one program decides the problem in polynomial time on its
    14 admissible words.
    15- **NP-hard**: every language in NP, written as words of zeros and ones,
    16 reduces to the problem in polynomial time on admissible words.
    17- **FPT**, **W[t]** and hardness for a class are those of the registered
    18 W-hierarchy (lax-496464).
    19- **XP**: one program decides the problem within (∣x∣+2)f(k)(|x|+2)^{f(k)}
    20 instructions for a computable ff, where ∣x∣|x| is the bit size of the word
    21 and kk its parameter.
    22- **para-NP-hard**: the problem restricted to the words of parameter at most
    23 some kk is NP-hard.
    24
    25A problem AA refines a problem BB if every admissible word of AA is one of
    26BB, with the same answer and the same parameter.
    27
    28**Theorem.** If AA refines BB, then BB in P, FPT or XP puts AA there,
    29and AA NP-hard, para-NP-hard or hard for a class of parameterized problems
    30makes BB so.
    31
    32**Theorem.** For a coding of a family of scheduling problems with sound
    33fields, the problem of a field-wise special case ss of tt refines that of
    34tt, for every parameter of the kernel instance and every invariant parameter
    35of a constraint field.
    36-/
    37
    38namespace Lax434175.ComplexityClasses
    39open Lax434175.Kernels Lax434175.Modules Lax434175.Assembly
    40open Lax434175.Parameters Lax434175.WordProblems
    41open Lax808846.Ram Lax759944.BinaryWordEncoding Lax759944.RamPolytime
    42open Lax434930.PolynomialTime Lax434930.NondeterministicPolynomialTime
    43open Lax496464.WH_A1_FptTime Lax496464.WH_A2_FptReductions
    44open Lax888481.ParameterizedComplexity (Problem)
    45
    46/-- The answer a deciding program writes. -/
    47noncomputable def answer (P : Problem) (x : List ℕ) : List ℕ :=
    48 open Classical in if P.Yes x then [1] else [0]
    49
    50/-- `P` is in **P**. -/
    51def InP (P : Problem) : Prop := PolyTimeOn P.Domain (answer P)
    52
    53/-- `P` reduces to `Q` in polynomial time on the admissible words of `P`. -/
    54def PolyReduces (P Q : Problem) : Prop := ∃ R, IsReduction P Q R ∧ PolyTimeOn P.Domain R
    55
    56/-- A language of bit strings as a problem on words of zeros and ones. -/
    57def ofLanguage (A : Language) : Problem where
    58 Domain := {x | ∀ v ∈ x, v < 2}
    59 Yes x := x.map (fun v => decide (v = 1)) ∈ A
    60 param _ := 0
    61
    62/-- `P` is **NP-hard**. -/
    63def NPHard (P : Problem) : Prop := ∀ A ∈ NP, PolyReduces (ofLanguage A) P
    64
    65/-- On every admissible word, one program computes `F` within
    66`(bitSize x + 2) ^ f (κ x)` instructions, for a computable `f`. -/
    67def XPTimeOn (D : Set (List ℕ)) (κ : List ℕ → ℕ) (F : List ℕ → List ℕ) : Prop :=
    68 ∃ (p : Program) (f : ℕ → ℕ), Computable f ∧ ∀ x ∈ D,
    69 FitsInWords ((bitSize x + 2) ^ f (κ x)) ((x.length :: x) ++ F x) ∧
    70 ∀ w : ℕ, (bitSize x + 2) ^ f (κ x) ≤ w →
    71 ∃ t ≤ (bitSize x + 2) ^ f (κ x), RunsTo w p (x.length :: x) (F x) t
    72
    73/-- **XP**. -/
    74def XP : Set Problem := {P | IsParameterized P ∧ XPTimeOn P.Domain P.param (answer P)}
    75
    76/-- The words of parameter at most `k`. -/
    77def slice (P : Problem) (k : ℕ) : Problem where
    78 Domain := {x | x ∈ P.Domain ∧ P.param x ≤ k}
    79 Yes := P.Yes
    80 param := P.param
    81
    82/-- `P` is **para-NP-hard**. -/
    83def ParaNPHard (P : Problem) : Prop := ∃ k, NPHard (slice P k)
    84
    85/-- `A` refines `B`. -/
    86structure Refines (A B : Problem) : Prop where
    87 domain : A.Domain ⊆ B.Domain
    88 yes : ∀ x ∈ A.Domain, (A.Yes x ↔ B.Yes x)
    89 param : ∀ x ∈ A.Domain, A.param x = B.param x
    90
    91variable {A B : Problem}
    92
    93axiom inP_of_refines : Refines A B → InP B → InP A
    94axiom fpt_of_refines : Refines A B → B ∈ FPT → A ∈ FPT
    95axiom xp_of_refines : Refines A B → B ∈ XP → A ∈ XP
    96axiom npHard_of_refines : Refines A B → NPHard A → NPHard B
    97axiom paraNPHard_of_refines : Refines A B → ParaNPHard A → ParaNPHard B
    98axiom hard_of_refines (𝒞 : Set Problem) : Refines A B → Hard 𝒞 A → Hard 𝒞 B
    99
    100variable {K : Kernel} {F : Family K}
    101
    102axiom refines_of_le_kernel (C : Coding F) (hF : F.Sound) {s t : Spec F} (h : s.le t)
    103 (κ : K.Inst → ℕ) :
    104 Refines (wordProblem C s (ofKernel F κ s)) (wordProblem C t (ofKernel F κ t))
    105
    106axiom refines_of_le_field (C : Coding F) (hF : F.Sound) {s t : Spec F} (h : s.le t)
    107 (i : F.ModuleName) (κ : FieldParameter (F.module i)) (hκ : κ.Invariant) :
    108 Refines (wordProblem C s (ofField F i κ s)) (wordProblem C t (ofField F i κ t))
    109
    110end Lax434175.ComplexityClasses
    111
    Show ProofShow ProofShow ProofShow ProofShow ProofShow ProofShow ProofShow Proof

    Discussion

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

    Loading discussion…