The classes P, NP and coNP
Bitstring encodings
ClassBitstring encodings#✓fully proved
A canonical bitstring encoding of a type \(\alpha\) consists of an encoding map from \(\alpha\) to finite lists of booleans and a partial decoding map from finite lists of booleans to \(\alpha\), such that decoding the encoding of any \(a \in \alpha\) succeeds and returns \(a\).
class BitstringEncoding α extends Computability.Encoding α Bool
Sources
- a class version of Mathlib's
Computability.Encodingspecialized to the alphabetBool, inlined from FormalConjectures (absent from Mathlib).
Used by 318
k) is NP-hard · The decision problem CONNECTED DOMINATING SET · DENSEST k-SUBGRAPH as a decision problem · DOMINATING SET as a decision problem · The EDGE DOMINATING SET decision problem · EFFICIENT DOMINATION (PERFECT CODE) as a decision problem · FEEDBACK ARC SET as a decision problem · FEEDBACK VERTEX SET as a decision problem · INDEPENDENT DOMINATING SET as a decision problem · The MAXIMUM INDUCED MATCHING decision problem · The MINIMUM FILL-IN (CHORDAL COMPLETION) problem · ODD CYCLE TRANSVERSAL as a decision problem · ROMAN DOMINATION as a decision problem · The decision problem TOTAL DOMINATING SET · 0-1 integer programming feasibility as a decision problem · 3-PARTITION as a decision problem · The bin packing decision problem · Exact-cardinality subset sum as a decision problem · The KNAPSACK decision problem · MULTIPLE KNAPSACK as a decision problem · The MULTIWAY NUMBER PARTITION decision problem · NUMERICAL 3-DIMENSIONAL MATCHING as a decision problem · Padding reduction has linear output length · SUBSET-SUM to PARTITION map is polynomial-time · PARTITION to SUBSET-SUM map is polynomial-time · PARTITION doubling pass is polynomial-time · Binary-coded PARTITION decision problem · Binary PARTITION decider is correct on canonical encodings · Binary-coded PARTITION is in NP · Program of the raw-input SUBSET-SUM to PARTITION machine · Encoded reduction from SUBSET-SUM to PARTITION · Correctness of the encoded SUBSET-SUM to PARTITION reduction · Encoded SUBSET-SUM to PARTITION map has linear output length · Encoded reduction from PARTITION to SUBSET-SUM · Correctness of the encoded PARTITION to SUBSET-SUM reduction · Quadratic run of the raw-input SUBSET-SUM to PARTITION machine · Quadratic run of the padding machine on canonical instances · Raw-input PARTITION membership machine runs in quadratic time · Canonical PARTITION membership transducer runs in quadratic time · Polynomial-time reduction from SUBSET-SUM to PARTITION · Bitlength of a PARTITION sum is at most the encoded length · PARTITION membership instance has linear bitlength · The STRIP PACKING decision problem · SUBSET PRODUCT as a decision problem · The VERTEX-COVER to SUBSET-SUM reduction is polynomial-time · SUBSET-SUM is in NP · SUBSET-SUM is NP-hard · Unbounded knapsack as a decision problem · The asymmetric traveling salesperson decision problem · Capacitated vehicle routing as a decision problem · DEGREE-CONSTRAINED SPANNING TREE as a decision problem · The directed Hamiltonian cycle decision problem · HAMPATH is in NP · HAMPATH is NP-hard · SAT ≤ HAMPATH is polynomial-time · INDUCED SUBGRAPH ISOMORPHISM as a decision problem · The decision problem LONGEST CYCLE · The LONGEST PATH decision problem · MAXIMUM COMMON INDUCED SUBGRAPH as a decision problem · The decision problem MAXIMUM LEAF SPANNING TREE · MINIMUM EQUIVALENT DIGRAPH as a decision problem · DIRECTED PATH COVER as a decision problem · The STEINER TREE decision problem · SUBGRAPH ISOMORPHISM as a decision problem · Symmetric TSP as a decision problem · HAMILTONIAN CYCLE (UNDIRECTED) as a decision problem · HAMILTONIAN PATH (UNDIRECTED) as a decision problem · DIRECTED DISJOINT PATHS as a decision problem · The 1-in-3-SAT decision problem · 3-SAT with bounded occurrences as a decision problem · Emitter reductions out of SAT are polynomial-time · The SAT-to-3SAT reduction is polynomial-time · Transitivity of polynomial-time many-one reductions · SAT reduces to 3SAT · The BETWEENNESS decision problem · Binary constraint satisfaction as a decision problem · The CIRCUIT SAT decision problem · MAXIMUM 2-SATISFIABILITY as a decision problem · MAXIMUM SATISFIABILITY as a decision problem · The MINIMUM 2-SATISFIABILITY decision problem · The MINIMUM ONES 3-SAT decision problem · MONOTONE 3-SAT as a decision problem · NOT-ALL-EQUAL 3-SAT as a decision problem · Job sequencing with deadlines, processing times and profits as a decision problem · The PARALLEL MACHINES WITH DEADLINES decision problem · The precedence-constrained multiprocessor scheduling decision problem · Resource-constrained project scheduling as a decision problem · Single-machine scheduling with release times and deadlines as a decision problem · The 3-machine flow shop scheduling decision problem · The TOTAL TARDINESS decision problem · SINGLE-MACHINE WEIGHTED COMPLETION WITH PRECEDENCE as a decision problem · The weighted number of tardy jobs decision problem · 3-DIMENSIONAL MATCHING as a decision problem · EXACT COVER BY 3-SETS as a decision problem · EXACT COVER as a decision problem · The FACILITY LOCATION decision problem · The generalized assignment decision problem · The MAXIMUM COVERAGE decision problem · Maximum n-times coverage decision problem · The MINIMUM TEST SET decision problem · Generalized nonmetric k-center as a decision problem · The k-MEDIAN decision problem · QUADRATIC ASSIGNMENT as a decision problem · The SET COVER decision problem · The SET PACKING decision problem · The SET SPLITTING decision problem · The Akari decision problem · The CLOSEST STRING decision problem · LATIN SQUARE COMPLETION as a decision problem · The LONGEST COMMON SUBSEQUENCE decision problem · Minesweeper consistency as a decision problem · The NONOGRAM decision problem · The SHORTEST COMMON SUPERSEQUENCE decision problem · SUDOKU as a decision problem · Membership in APX · Hastad: optimal inapproximability of MAX-3SAT · Value of a MAX-3SAT assignment · L-reductions · The MAX-3SAT objective · MAXSNP problems · NPO problems · Dinur's gap amplification and alphabet reduction · 2-SAT as a decision problem · The primality decision problem · The marking algorithm is polynomial-time · PATH ∈ P · Decision version of hypergraph \(k\)-cut · Integer linear-programming feasibility in fixed dimension · Rational linear-program feasibility · General matching decision problem · Max-flow decision problem · Perfect matching in uniform hypergraphs with a codegree condition · Undirected s-t connectivity as a decision problem · Easy on average · Key pair produced by a key generator · Eavesdropping advantage against a public-key scheme · One-way functions exist · Public-key encryption exists · Samplable distributions · Public-coin interactive proofs · Directed graph isomorphism as a decision problem · Directed graph non-isomorphism as a decision problem · No-instances of the 2-local Hamiltonian problem · Yes-instances of the 2-local Hamiltonian problem · Polynomial-time reduction between promise problems · QMA for promise problems · SAT with a unary variable count as a decision problem · UniqueSAT with a unary variable count as a decision problem · Valiant-Vazirani: SAT reduces to UniqueSAT · Polynomial-time functions are closed under composition · P is closed under polynomial-time preimages · Decider host · Reduction host, canonical form · Verifier host, canonical formBitstring Encoding
DefinitionEncoding function of a bitstring encoding#✓fully proved
For a type \(\alpha\) with a canonical bitstring encoding, the bitstring encoding of \(a \in \alpha\) is the finite list of booleans that this encoding assigns to \(a\).
def bitEncode [BitstringEncoding α] (a : α) : List Bool := toEncoding.encode a
class BitstringEncoding α extends Computability.Encoding α Bool
MathlibExt/Computability/Complexity.lean:48
Uses 1 · Used by 310
k) is NP-hard · The decision problem CONNECTED DOMINATING SET · DENSEST k-SUBGRAPH as a decision problem · DOMINATING SET as a decision problem · The EDGE DOMINATING SET decision problem · EFFICIENT DOMINATION (PERFECT CODE) as a decision problem · FEEDBACK ARC SET as a decision problem · FEEDBACK VERTEX SET as a decision problem · INDEPENDENT DOMINATING SET as a decision problem · The MAXIMUM INDUCED MATCHING decision problem · The MINIMUM FILL-IN (CHORDAL COMPLETION) problem · ODD CYCLE TRANSVERSAL as a decision problem · ROMAN DOMINATION as a decision problem · The decision problem TOTAL DOMINATING SET · 0-1 integer programming feasibility as a decision problem · 3-PARTITION as a decision problem · The bin packing decision problem · Exact-cardinality subset sum as a decision problem · The KNAPSACK decision problem · MULTIPLE KNAPSACK as a decision problem · The MULTIWAY NUMBER PARTITION decision problem · NUMERICAL 3-DIMENSIONAL MATCHING as a decision problem · Padding reduction has linear output length · SUBSET-SUM to PARTITION map is polynomial-time · PARTITION to SUBSET-SUM map is polynomial-time · PARTITION doubling pass is polynomial-time · Binary-coded PARTITION decision problem · Binary PARTITION decider is correct on canonical encodings · Binary-coded PARTITION is in NP · Program of the raw-input SUBSET-SUM to PARTITION machine · Encoded reduction from SUBSET-SUM to PARTITION · Correctness of the encoded SUBSET-SUM to PARTITION reduction · Encoded SUBSET-SUM to PARTITION map has linear output length · Encoded reduction from PARTITION to SUBSET-SUM · Correctness of the encoded PARTITION to SUBSET-SUM reduction · Quadratic run of the raw-input SUBSET-SUM to PARTITION machine · Quadratic run of the padding machine on canonical instances · Raw-input PARTITION membership machine runs in quadratic time · Canonical PARTITION membership transducer runs in quadratic time · Polynomial-time reduction from SUBSET-SUM to PARTITION · Bitlength of a PARTITION sum is at most the encoded length · PARTITION membership instance has linear bitlength · The STRIP PACKING decision problem · SUBSET PRODUCT as a decision problem · The VERTEX-COVER to SUBSET-SUM reduction is polynomial-time · SUBSET-SUM is in NP · SUBSET-SUM is NP-hard · Unbounded knapsack as a decision problem · The asymmetric traveling salesperson decision problem · Capacitated vehicle routing as a decision problem · DEGREE-CONSTRAINED SPANNING TREE as a decision problem · The directed Hamiltonian cycle decision problem · HAMPATH is in NP · HAMPATH is NP-hard · SAT ≤ HAMPATH is polynomial-time · INDUCED SUBGRAPH ISOMORPHISM as a decision problem · The decision problem LONGEST CYCLE · The LONGEST PATH decision problem · MAXIMUM COMMON INDUCED SUBGRAPH as a decision problem · The decision problem MAXIMUM LEAF SPANNING TREE · MINIMUM EQUIVALENT DIGRAPH as a decision problem · DIRECTED PATH COVER as a decision problem · The STEINER TREE decision problem · SUBGRAPH ISOMORPHISM as a decision problem · Symmetric TSP as a decision problem · HAMILTONIAN CYCLE (UNDIRECTED) as a decision problem · HAMILTONIAN PATH (UNDIRECTED) as a decision problem · DIRECTED DISJOINT PATHS as a decision problem · The 1-in-3-SAT decision problem · 3-SAT with bounded occurrences as a decision problem · Emitter reductions out of SAT are polynomial-time · The SAT-to-3SAT reduction is polynomial-time · Transitivity of polynomial-time many-one reductions · SAT reduces to 3SAT · The BETWEENNESS decision problem · Binary constraint satisfaction as a decision problem · The CIRCUIT SAT decision problem · MAXIMUM 2-SATISFIABILITY as a decision problem · MAXIMUM SATISFIABILITY as a decision problem · The MINIMUM 2-SATISFIABILITY decision problem · The MINIMUM ONES 3-SAT decision problem · MONOTONE 3-SAT as a decision problem · NOT-ALL-EQUAL 3-SAT as a decision problem · Job sequencing with deadlines, processing times and profits as a decision problem · The PARALLEL MACHINES WITH DEADLINES decision problem · The precedence-constrained multiprocessor scheduling decision problem · Resource-constrained project scheduling as a decision problem · Single-machine scheduling with release times and deadlines as a decision problem · The 3-machine flow shop scheduling decision problem · The TOTAL TARDINESS decision problem · SINGLE-MACHINE WEIGHTED COMPLETION WITH PRECEDENCE as a decision problem · The weighted number of tardy jobs decision problem · 3-DIMENSIONAL MATCHING as a decision problem · EXACT COVER BY 3-SETS as a decision problem · EXACT COVER as a decision problem · The FACILITY LOCATION decision problem · The generalized assignment decision problem · The MAXIMUM COVERAGE decision problem · Maximum n-times coverage decision problem · The MINIMUM TEST SET decision problem · Generalized nonmetric k-center as a decision problem · The k-MEDIAN decision problem · QUADRATIC ASSIGNMENT as a decision problem · The SET COVER decision problem · The SET PACKING decision problem · The SET SPLITTING decision problem · The Akari decision problem · The CLOSEST STRING decision problem · LATIN SQUARE COMPLETION as a decision problem · The LONGEST COMMON SUBSEQUENCE decision problem · Minesweeper consistency as a decision problem · The NONOGRAM decision problem · The SHORTEST COMMON SUPERSEQUENCE decision problem · SUDOKU as a decision problem · Membership in APX · Hastad: optimal inapproximability of MAX-3SAT · Value of a MAX-3SAT assignment · L-reductions · The MAX-3SAT objective · MAXSNP problems · NPO problems · Dinur's gap amplification and alphabet reduction · 2-SAT as a decision problem · The marking algorithm is polynomial-time · PATH ∈ P · Decision version of hypergraph \(k\)-cut · Integer linear-programming feasibility in fixed dimension · Rational linear-program feasibility · General matching decision problem · Max-flow decision problem · Perfect matching in uniform hypergraphs with a codegree condition · Undirected s-t connectivity as a decision problem · Easy on average · Key pair produced by a key generator · Eavesdropping advantage against a public-key scheme · One-way functions exist · Public-key encryption exists · Samplable distributions · Public-coin interactive proofs · Directed graph isomorphism as a decision problem · Directed graph non-isomorphism as a decision problem · No-instances of the 2-local Hamiltonian problem · Yes-instances of the 2-local Hamiltonian problem · Polynomial-time reduction between promise problems · QMA for promise problems · SAT with a unary variable count as a decision problem · UniqueSAT with a unary variable count as a decision problem · Valiant-Vazirani: SAT reduces to UniqueSAT · P is closed under polynomial-time preimages · Decider host · Reduction host, canonical form · Verifier host, canonical formDefinitionDecoding function of a bitstring encoding#✓fully proved
For a type \(\alpha\) with a canonical bitstring encoding, bitstring decoding is the decoding function of that encoding: it sends each finite list of booleans either to an element of \(\alpha\) or to failure.
def bitDecode [BitstringEncoding α] (l : List Bool) : Option α := toEncoding.decode l
class BitstringEncoding α extends Computability.Encoding α Bool
MathlibExt/Computability/Complexity.lean:48
Uses 1 · Used by 312
k) is NP-hard · The decision problem CONNECTED DOMINATING SET · DENSEST k-SUBGRAPH as a decision problem · DOMINATING SET as a decision problem · The EDGE DOMINATING SET decision problem · EFFICIENT DOMINATION (PERFECT CODE) as a decision problem · FEEDBACK ARC SET as a decision problem · FEEDBACK VERTEX SET as a decision problem · INDEPENDENT DOMINATING SET as a decision problem · The MAXIMUM INDUCED MATCHING decision problem · The MINIMUM FILL-IN (CHORDAL COMPLETION) problem · ODD CYCLE TRANSVERSAL as a decision problem · ROMAN DOMINATION as a decision problem · The decision problem TOTAL DOMINATING SET · 0-1 integer programming feasibility as a decision problem · 3-PARTITION as a decision problem · The bin packing decision problem · Exact-cardinality subset sum as a decision problem · The KNAPSACK decision problem · MULTIPLE KNAPSACK as a decision problem · The MULTIWAY NUMBER PARTITION decision problem · NUMERICAL 3-DIMENSIONAL MATCHING as a decision problem · Padding reduction has linear output length · SUBSET-SUM to PARTITION map is polynomial-time · PARTITION to SUBSET-SUM map is polynomial-time · PARTITION doubling pass is polynomial-time · Binary-coded PARTITION decision problem · Binary PARTITION decider is correct on canonical encodings · Binary-coded PARTITION is in NP · Program of the raw-input SUBSET-SUM to PARTITION machine · Encoded reduction from SUBSET-SUM to PARTITION · Correctness of the encoded SUBSET-SUM to PARTITION reduction · Encoded SUBSET-SUM to PARTITION map has linear output length · Encoded reduction from PARTITION to SUBSET-SUM · Correctness of the encoded PARTITION to SUBSET-SUM reduction · Quadratic run of the raw-input SUBSET-SUM to PARTITION machine · Quadratic run of the padding machine on canonical instances · Raw-input PARTITION membership machine runs in quadratic time · Canonical PARTITION membership transducer runs in quadratic time · Polynomial-time reduction from SUBSET-SUM to PARTITION · Bitlength of a PARTITION sum is at most the encoded length · PARTITION membership instance has linear bitlength · The STRIP PACKING decision problem · SUBSET PRODUCT as a decision problem · The VERTEX-COVER to SUBSET-SUM reduction is polynomial-time · SUBSET-SUM is in NP · SUBSET-SUM is NP-hard · Unbounded knapsack as a decision problem · The asymmetric traveling salesperson decision problem · Capacitated vehicle routing as a decision problem · DEGREE-CONSTRAINED SPANNING TREE as a decision problem · The directed Hamiltonian cycle decision problem · HAMPATH is in NP · HAMPATH is NP-hard · SAT ≤ HAMPATH is polynomial-time · INDUCED SUBGRAPH ISOMORPHISM as a decision problem · The decision problem LONGEST CYCLE · The LONGEST PATH decision problem · MAXIMUM COMMON INDUCED SUBGRAPH as a decision problem · The decision problem MAXIMUM LEAF SPANNING TREE · MINIMUM EQUIVALENT DIGRAPH as a decision problem · DIRECTED PATH COVER as a decision problem · The STEINER TREE decision problem · SUBGRAPH ISOMORPHISM as a decision problem · Symmetric TSP as a decision problem · HAMILTONIAN CYCLE (UNDIRECTED) as a decision problem · HAMILTONIAN PATH (UNDIRECTED) as a decision problem · DIRECTED DISJOINT PATHS as a decision problem · The 1-in-3-SAT decision problem · 3-SAT with bounded occurrences as a decision problem · Emitter reductions out of SAT are polynomial-time · The SAT-to-3SAT reduction is polynomial-time · Transitivity of polynomial-time many-one reductions · SAT reduces to 3SAT · The BETWEENNESS decision problem · Binary constraint satisfaction as a decision problem · The CIRCUIT SAT decision problem · MAXIMUM 2-SATISFIABILITY as a decision problem · MAXIMUM SATISFIABILITY as a decision problem · The MINIMUM 2-SATISFIABILITY decision problem · The MINIMUM ONES 3-SAT decision problem · MONOTONE 3-SAT as a decision problem · NOT-ALL-EQUAL 3-SAT as a decision problem · Job sequencing with deadlines, processing times and profits as a decision problem · The PARALLEL MACHINES WITH DEADLINES decision problem · The precedence-constrained multiprocessor scheduling decision problem · Resource-constrained project scheduling as a decision problem · Single-machine scheduling with release times and deadlines as a decision problem · The 3-machine flow shop scheduling decision problem · The TOTAL TARDINESS decision problem · SINGLE-MACHINE WEIGHTED COMPLETION WITH PRECEDENCE as a decision problem · The weighted number of tardy jobs decision problem · 3-DIMENSIONAL MATCHING as a decision problem · EXACT COVER BY 3-SETS as a decision problem · EXACT COVER as a decision problem · The FACILITY LOCATION decision problem · The generalized assignment decision problem · The MAXIMUM COVERAGE decision problem · Maximum n-times coverage decision problem · The MINIMUM TEST SET decision problem · Generalized nonmetric k-center as a decision problem · The k-MEDIAN decision problem · QUADRATIC ASSIGNMENT as a decision problem · The SET COVER decision problem · The SET PACKING decision problem · The SET SPLITTING decision problem · The Akari decision problem · The CLOSEST STRING decision problem · LATIN SQUARE COMPLETION as a decision problem · The LONGEST COMMON SUBSEQUENCE decision problem · Minesweeper consistency as a decision problem · The NONOGRAM decision problem · The SHORTEST COMMON SUPERSEQUENCE decision problem · SUDOKU as a decision problem · Membership in APX · Hastad: optimal inapproximability of MAX-3SAT · Value of a MAX-3SAT assignment · L-reductions · The MAX-3SAT objective · MAXSNP problems · NPO problems · Dinur's gap amplification and alphabet reduction · 2-SAT as a decision problem · The primality decision problem · The marking algorithm is polynomial-time · PATH ∈ P · Decision version of hypergraph \(k\)-cut · Integer linear-programming feasibility in fixed dimension · Rational linear-program feasibility · General matching decision problem · Max-flow decision problem · Perfect matching in uniform hypergraphs with a codegree condition · Undirected s-t connectivity as a decision problem · Easy on average · Key pair produced by a key generator · Eavesdropping advantage against a public-key scheme · One-way functions exist · Public-key encryption exists · Samplable distributions · Public-coin interactive proofs · Directed graph isomorphism as a decision problem · Directed graph non-isomorphism as a decision problem · No-instances of the 2-local Hamiltonian problem · Yes-instances of the 2-local Hamiltonian problem · Polynomial-time reduction between promise problems · QMA for promise problems · SAT with a unary variable count as a decision problem · UniqueSAT with a unary variable count as a decision problem · Valiant-Vazirani: SAT reduces to UniqueSAT · P is closed under polynomial-time preimages · Decider host · Reduction host, canonical form · Verifier host, canonical formTheoremDecoding inverts bitstring encoding#✓fully proved
Let \(\alpha\) be a type with a canonical bitstring encoding. For every \(a \in \alpha\), decoding the bitstring encoding of \(a\) succeeds and returns \(a\).
@[simp]
theorem bitDecode_bitEncode [BitstringEncoding α] (a : α) :
bitDecode (bitEncode a) = some a
class BitstringEncoding α extends Computability.Encoding α Bool
MathlibExt/Computability/Complexity.lean:48
def bitDecode [BitstringEncoding α] (l : List Bool) : Option α := toEncoding.decode l
MathlibExt/Computability/Complexity.lean:58
def bitEncode [BitstringEncoding α] (a : α) : List Bool := toEncoding.encode a
MathlibExt/Computability/Complexity.lean:55
Uses 3 · Used by 309
k) is NP-hard · The decision problem CONNECTED DOMINATING SET · DENSEST k-SUBGRAPH as a decision problem · DOMINATING SET as a decision problem · The EDGE DOMINATING SET decision problem · EFFICIENT DOMINATION (PERFECT CODE) as a decision problem · FEEDBACK ARC SET as a decision problem · FEEDBACK VERTEX SET as a decision problem · INDEPENDENT DOMINATING SET as a decision problem · The MAXIMUM INDUCED MATCHING decision problem · The MINIMUM FILL-IN (CHORDAL COMPLETION) problem · ODD CYCLE TRANSVERSAL as a decision problem · ROMAN DOMINATION as a decision problem · The decision problem TOTAL DOMINATING SET · 0-1 integer programming feasibility as a decision problem · 3-PARTITION as a decision problem · The bin packing decision problem · Exact-cardinality subset sum as a decision problem · The KNAPSACK decision problem · MULTIPLE KNAPSACK as a decision problem · The MULTIWAY NUMBER PARTITION decision problem · NUMERICAL 3-DIMENSIONAL MATCHING as a decision problem · Padding reduction has linear output length · SUBSET-SUM to PARTITION map is polynomial-time · PARTITION to SUBSET-SUM map is polynomial-time · PARTITION doubling pass is polynomial-time · Binary-coded PARTITION decision problem · Binary PARTITION decider is correct on canonical encodings · Binary-coded PARTITION is in NP · Program of the raw-input SUBSET-SUM to PARTITION machine · Encoded reduction from SUBSET-SUM to PARTITION · Correctness of the encoded SUBSET-SUM to PARTITION reduction · Encoded SUBSET-SUM to PARTITION map has linear output length · Encoded reduction from PARTITION to SUBSET-SUM · Correctness of the encoded PARTITION to SUBSET-SUM reduction · Quadratic run of the raw-input SUBSET-SUM to PARTITION machine · Quadratic run of the padding machine on canonical instances · Raw-input PARTITION membership machine runs in quadratic time · Canonical PARTITION membership transducer runs in quadratic time · Polynomial-time reduction from SUBSET-SUM to PARTITION · Bitlength of a PARTITION sum is at most the encoded length · PARTITION membership instance has linear bitlength · The STRIP PACKING decision problem · SUBSET PRODUCT as a decision problem · The VERTEX-COVER to SUBSET-SUM reduction is polynomial-time · SUBSET-SUM is in NP · SUBSET-SUM is NP-hard · Unbounded knapsack as a decision problem · The asymmetric traveling salesperson decision problem · Capacitated vehicle routing as a decision problem · DEGREE-CONSTRAINED SPANNING TREE as a decision problem · The directed Hamiltonian cycle decision problem · HAMPATH is in NP · HAMPATH is NP-hard · SAT ≤ HAMPATH is polynomial-time · INDUCED SUBGRAPH ISOMORPHISM as a decision problem · The decision problem LONGEST CYCLE · The LONGEST PATH decision problem · MAXIMUM COMMON INDUCED SUBGRAPH as a decision problem · The decision problem MAXIMUM LEAF SPANNING TREE · MINIMUM EQUIVALENT DIGRAPH as a decision problem · DIRECTED PATH COVER as a decision problem · The STEINER TREE decision problem · SUBGRAPH ISOMORPHISM as a decision problem · Symmetric TSP as a decision problem · HAMILTONIAN CYCLE (UNDIRECTED) as a decision problem · HAMILTONIAN PATH (UNDIRECTED) as a decision problem · DIRECTED DISJOINT PATHS as a decision problem · The 1-in-3-SAT decision problem · 3-SAT with bounded occurrences as a decision problem · Emitter reductions out of SAT are polynomial-time · The SAT-to-3SAT reduction is polynomial-time · Transitivity of polynomial-time many-one reductions · SAT reduces to 3SAT · The BETWEENNESS decision problem · Binary constraint satisfaction as a decision problem · The CIRCUIT SAT decision problem · MAXIMUM 2-SATISFIABILITY as a decision problem · MAXIMUM SATISFIABILITY as a decision problem · The MINIMUM 2-SATISFIABILITY decision problem · The MINIMUM ONES 3-SAT decision problem · MONOTONE 3-SAT as a decision problem · NOT-ALL-EQUAL 3-SAT as a decision problem · Job sequencing with deadlines, processing times and profits as a decision problem · The PARALLEL MACHINES WITH DEADLINES decision problem · The precedence-constrained multiprocessor scheduling decision problem · Resource-constrained project scheduling as a decision problem · Single-machine scheduling with release times and deadlines as a decision problem · The 3-machine flow shop scheduling decision problem · The TOTAL TARDINESS decision problem · SINGLE-MACHINE WEIGHTED COMPLETION WITH PRECEDENCE as a decision problem · The weighted number of tardy jobs decision problem · 3-DIMENSIONAL MATCHING as a decision problem · EXACT COVER BY 3-SETS as a decision problem · EXACT COVER as a decision problem · The FACILITY LOCATION decision problem · The generalized assignment decision problem · The MAXIMUM COVERAGE decision problem · Maximum n-times coverage decision problem · The MINIMUM TEST SET decision problem · Generalized nonmetric k-center as a decision problem · The k-MEDIAN decision problem · QUADRATIC ASSIGNMENT as a decision problem · The SET COVER decision problem · The SET PACKING decision problem · The SET SPLITTING decision problem · The Akari decision problem · The CLOSEST STRING decision problem · LATIN SQUARE COMPLETION as a decision problem · The LONGEST COMMON SUBSEQUENCE decision problem · Minesweeper consistency as a decision problem · The NONOGRAM decision problem · The SHORTEST COMMON SUPERSEQUENCE decision problem · SUDOKU as a decision problem · Membership in APX · Hastad: optimal inapproximability of MAX-3SAT · Value of a MAX-3SAT assignment · L-reductions · The MAX-3SAT objective · MAXSNP problems · NPO problems · Dinur's gap amplification and alphabet reduction · 2-SAT as a decision problem · The marking algorithm is polynomial-time · PATH ∈ P · Decision version of hypergraph \(k\)-cut · Integer linear-programming feasibility in fixed dimension · Rational linear-program feasibility · General matching decision problem · Max-flow decision problem · Perfect matching in uniform hypergraphs with a codegree condition · Undirected s-t connectivity as a decision problem · Easy on average · Key pair produced by a key generator · Eavesdropping advantage against a public-key scheme · One-way functions exist · Public-key encryption exists · Samplable distributions · Public-coin interactive proofs · Directed graph isomorphism as a decision problem · Directed graph non-isomorphism as a decision problem · No-instances of the 2-local Hamiltonian problem · Yes-instances of the 2-local Hamiltonian problem · Polynomial-time reduction between promise problems · QMA for promise problems · SAT with a unary variable count as a decision problem · UniqueSAT with a unary variable count as a decision problem · Valiant-Vazirani: SAT reduces to UniqueSAT · P is closed under polynomial-time preimages · Decider host · Reduction host, canonical form · Verifier host, canonical formDefinitionSelf-delimiting form of a bitstring#✓fully proved
The self-delimiting form of a bitstring \((b_1, \dots, b_n)\) is \((\mathrm{true}, b_1, \dots, \mathrm{true}, b_n, \mathrm{false})\): each bit is preceded by \(\mathrm{true}\) and the block is terminated by \(\mathrm{false}\). In particular the empty bitstring becomes \((\mathrm{false})\).
Used by 367
k) is NP-hard · The decision problem CONNECTED DOMINATING SET · DENSEST k-SUBGRAPH as a decision problem · DOMINATING SET as a decision problem · The EDGE DOMINATING SET decision problem · EFFICIENT DOMINATION (PERFECT CODE) as a decision problem · FEEDBACK ARC SET as a decision problem · FEEDBACK VERTEX SET as a decision problem · INDEPENDENT DOMINATING SET as a decision problem · The MAXIMUM INDUCED MATCHING decision problem · The MINIMUM FILL-IN (CHORDAL COMPLETION) problem · ODD CYCLE TRANSVERSAL as a decision problem · ROMAN DOMINATION as a decision problem · The decision problem TOTAL DOMINATING SET · 0-1 integer programming feasibility as a decision problem · 3-PARTITION as a decision problem · The bin packing decision problem · Exact-cardinality subset sum as a decision problem · The KNAPSACK decision problem · MULTIPLE KNAPSACK as a decision problem · The MULTIWAY NUMBER PARTITION decision problem · NUMERICAL 3-DIMENSIONAL MATCHING as a decision problem · Padding reduction has linear output length · SUBSET-SUM to PARTITION map is polynomial-time · PARTITION to SUBSET-SUM map is polynomial-time · PARTITION doubling pass is polynomial-time · Binary-coded PARTITION decision problem · Binary PARTITION decider is correct on canonical encodings · Binary-coded PARTITION is in NP · Program of the raw-input SUBSET-SUM to PARTITION machine · Encoded reduction from SUBSET-SUM to PARTITION · Correctness of the encoded SUBSET-SUM to PARTITION reduction · Encoded SUBSET-SUM to PARTITION map has linear output length · Encoded reduction from PARTITION to SUBSET-SUM · Correctness of the encoded PARTITION to SUBSET-SUM reduction · Quadratic run of the raw-input SUBSET-SUM to PARTITION machine · Quadratic run of the padding machine on canonical instances · Raw-input PARTITION membership machine runs in quadratic time · Canonical PARTITION membership transducer runs in quadratic time · Polynomial-time reduction from SUBSET-SUM to PARTITION · Bitlength of a PARTITION sum is at most the encoded length · PARTITION membership instance has linear bitlength · Doubling pass maps a number block to the block of its double · Doubling pass doubles every number in a list · The STRIP PACKING decision problem · SUBSET PRODUCT as a decision problem · Bit-string encoding of SUBSET-SUM instances · The fixed no-instance of SUBSET-SUM · Delimiting a bit list that ends in true · Subset-sum emitter: one vertex number · Run of the vertex-number phase of the subset-sum emitter · Decoding a SUBSET-SUM instance inverts its encoding · Run of the VERTEX-COVER to SUBSET-SUM machine · SUBSET-SUM is characterized by its verifier · Run of the target-output phase of the subset-sum emitter · The verifier rejects a chosen block that ends in false · Adding a canonical chosen block · Skipping a number block · Reading the target block · The VERTEX-COVER to SUBSET-SUM reduction is polynomial-time · Bit length of the sum is at most the input length · The summing loop of the SUBSET-SUM verifier · Framed input of two natural numbers · The SUBSET-SUM verifier machine · Binary addition of framed numbers in quadratic time · SUBSET-SUM is in NP · SUBSET-SUM is NP-hard · SUBSET-SUM verifier computes the mask-selected sum · Embedded SUBSET-SUM summing component reaches the mapped label · Unbounded knapsack as a decision problem · The asymmetric traveling salesperson decision problem · Capacitated vehicle routing as a decision problem · DEGREE-CONSTRAINED SPANNING TREE as a decision problem · The directed Hamiltonian cycle decision problem · HAMPATH is in NP · HAMPATH is NP-hard · SAT ≤ HAMPATH is polynomial-time · INDUCED SUBGRAPH ISOMORPHISM as a decision problem · The decision problem LONGEST CYCLE · The LONGEST PATH decision problem · MAXIMUM COMMON INDUCED SUBGRAPH as a decision problem · The decision problem MAXIMUM LEAF SPANNING TREE · MINIMUM EQUIVALENT DIGRAPH as a decision problem · DIRECTED PATH COVER as a decision problem · The STEINER TREE decision problem · SUBGRAPH ISOMORPHISM as a decision problem · Symmetric TSP as a decision problem · HAMILTONIAN CYCLE (UNDIRECTED) as a decision problem · HAMILTONIAN PATH (UNDIRECTED) as a decision problem · DIRECTED DISJOINT PATHS as a decision problem · The 1-in-3-SAT decision problem · 3-SAT with bounded occurrences as a decision problem · Code of a fresh literal · Code of a renamed literal · Emitter reductions out of SAT are polynomial-time · The SAT-to-3SAT reduction is polynomial-time · Transitivity of polynomial-time many-one reductions · Correctness of the SAT-to-3SAT reduction on bit strings · SAT reduces to 3SAT · The BETWEENNESS decision problem · Binary constraint satisfaction as a decision problem · The CIRCUIT SAT decision problem · MAXIMUM 2-SATISFIABILITY as a decision problem · MAXIMUM SATISFIABILITY as a decision problem · The MINIMUM 2-SATISFIABILITY decision problem · The MINIMUM ONES 3-SAT decision problem · MONOTONE 3-SAT as a decision problem · NOT-ALL-EQUAL 3-SAT as a decision problem · Job sequencing with deadlines, processing times and profits as a decision problem · The PARALLEL MACHINES WITH DEADLINES decision problem · The precedence-constrained multiprocessor scheduling decision problem · Resource-constrained project scheduling as a decision problem · Single-machine scheduling with release times and deadlines as a decision problem · The 3-machine flow shop scheduling decision problem · The TOTAL TARDINESS decision problem · SINGLE-MACHINE WEIGHTED COMPLETION WITH PRECEDENCE as a decision problem · The weighted number of tardy jobs decision problem · 3-DIMENSIONAL MATCHING as a decision problem · EXACT COVER BY 3-SETS as a decision problem · EXACT COVER as a decision problem · The FACILITY LOCATION decision problem · The generalized assignment decision problem · The MAXIMUM COVERAGE decision problem · Maximum n-times coverage decision problem · The MINIMUM TEST SET decision problem · Generalized nonmetric k-center as a decision problem · The k-MEDIAN decision problem · QUADRATIC ASSIGNMENT as a decision problem · The SET COVER decision problem · The SET PACKING decision problem · The SET SPLITTING decision problem · The Akari decision problem · The CLOSEST STRING decision problem · LATIN SQUARE COMPLETION as a decision problem · The LONGEST COMMON SUBSEQUENCE decision problem · Minesweeper consistency as a decision problem · The NONOGRAM decision problem · The SHORTEST COMMON SUPERSEQUENCE decision problem · SUDOKU as a decision problem · Membership in APX · Hastad: optimal inapproximability of MAX-3SAT · Value of a MAX-3SAT assignment · L-reductions · The MAX-3SAT objective · MAXSNP problems · NPO problems · Dinur's gap amplification and alphabet reduction · 2-SAT as a decision problem · The marking algorithm is polynomial-time · PATH ∈ P · Decision version of hypergraph \(k\)-cut · Integer linear-programming feasibility in fixed dimension · Rational linear-program feasibility · General matching decision problem · Max-flow decision problem · Perfect matching in uniform hypergraphs with a codegree condition · Undirected s-t connectivity as a decision problem · Easy on average · Key pair produced by a key generator · Eavesdropping advantage against a public-key scheme · One-way functions exist · Public-key encryption exists · Samplable distributions · Public-coin interactive proofs · Directed graph isomorphism as a decision problem · Directed graph non-isomorphism as a decision problem · No-instances of the 2-local Hamiltonian problem · Yes-instances of the 2-local Hamiltonian problem · Polynomial-time reduction between promise problems · QMA for promise problems · SAT with a unary variable count as a decision problem · UniqueSAT with a unary variable count as a decision problem · Valiant-Vazirani: SAT reduces to UniqueSAT · P is closed under polynomial-time preimages · Decider host · Reduction host, canonical form · Verifier host, canonical formDefinitionParsing one self-delimiting block#✓fully proved
Write booleans as bits, with true as \(1\) and false as \(0\). Reading a list of bits from the front, a \(0\) ends the block, and a \(1\) followed by a bit \(b\) contributes \(b\) to the payload. The result is the payload together with the rest of the list after the terminating \(0\). Parsing fails if the list runs out before a terminating \(0\) is read.
def undelimit : List Bool → Option (List Bool × List Bool)
| false :: rest => some ([], rest)
| true :: b :: input => (undelimit input).map fun p => (b :: p.1, p.2)
| _ => none
Used by 338
k) is NP-hard · The decision problem CONNECTED DOMINATING SET · DENSEST k-SUBGRAPH as a decision problem · DOMINATING SET as a decision problem · The EDGE DOMINATING SET decision problem · EFFICIENT DOMINATION (PERFECT CODE) as a decision problem · FEEDBACK ARC SET as a decision problem · FEEDBACK VERTEX SET as a decision problem · INDEPENDENT DOMINATING SET as a decision problem · The MAXIMUM INDUCED MATCHING decision problem · The MINIMUM FILL-IN (CHORDAL COMPLETION) problem · ODD CYCLE TRANSVERSAL as a decision problem · ROMAN DOMINATION as a decision problem · The decision problem TOTAL DOMINATING SET · 0-1 integer programming feasibility as a decision problem · 3-PARTITION as a decision problem · The bin packing decision problem · Exact-cardinality subset sum as a decision problem · The KNAPSACK decision problem · MULTIPLE KNAPSACK as a decision problem · The MULTIWAY NUMBER PARTITION decision problem · NUMERICAL 3-DIMENSIONAL MATCHING as a decision problem · Padding reduction has linear output length · SUBSET-SUM to PARTITION map is polynomial-time · PARTITION to SUBSET-SUM map is polynomial-time · PARTITION doubling pass is polynomial-time · Binary-coded PARTITION decision problem · Binary PARTITION decider is correct on canonical encodings · Binary-coded PARTITION is in NP · Program of the raw-input SUBSET-SUM to PARTITION machine · Encoded reduction from SUBSET-SUM to PARTITION · Correctness of the encoded SUBSET-SUM to PARTITION reduction · Encoded SUBSET-SUM to PARTITION map has linear output length · Encoded reduction from PARTITION to SUBSET-SUM · Correctness of the encoded PARTITION to SUBSET-SUM reduction · Quadratic run of the raw-input SUBSET-SUM to PARTITION machine · Quadratic run of the padding machine on canonical instances · Raw-input PARTITION membership machine runs in quadratic time · Canonical PARTITION membership transducer runs in quadratic time · Polynomial-time reduction from SUBSET-SUM to PARTITION · Bitlength of a PARTITION sum is at most the encoded length · PARTITION membership instance has linear bitlength · The STRIP PACKING decision problem · SUBSET PRODUCT as a decision problem · The fixed no-instance of SUBSET-SUM · Decoding a SUBSET-SUM instance inverts its encoding · The verifier rejects an unterminated chosen block · The verifier rejects an unterminated skipped block · The verifier rejects an unterminated target block · The VERTEX-COVER to SUBSET-SUM reduction is polynomial-time · The summing loop of the SUBSET-SUM verifier · The SUBSET-SUM verifier machine · SUBSET-SUM is in NP · SUBSET-SUM is NP-hard · SUBSET-SUM verifier computes the mask-selected sum · Unbounded knapsack as a decision problem · The asymmetric traveling salesperson decision problem · Capacitated vehicle routing as a decision problem · DEGREE-CONSTRAINED SPANNING TREE as a decision problem · The directed Hamiltonian cycle decision problem · HAMPATH is in NP · HAMPATH is NP-hard · SAT ≤ HAMPATH is polynomial-time · INDUCED SUBGRAPH ISOMORPHISM as a decision problem · The decision problem LONGEST CYCLE · The LONGEST PATH decision problem · MAXIMUM COMMON INDUCED SUBGRAPH as a decision problem · The decision problem MAXIMUM LEAF SPANNING TREE · MINIMUM EQUIVALENT DIGRAPH as a decision problem · DIRECTED PATH COVER as a decision problem · The STEINER TREE decision problem · SUBGRAPH ISOMORPHISM as a decision problem · Symmetric TSP as a decision problem · HAMILTONIAN CYCLE (UNDIRECTED) as a decision problem · HAMILTONIAN PATH (UNDIRECTED) as a decision problem · DIRECTED DISJOINT PATHS as a decision problem · The 1-in-3-SAT decision problem · 3-SAT with bounded occurrences as a decision problem · Emitter reductions out of SAT are polynomial-time · The SAT-to-3SAT reduction is polynomial-time · Transitivity of polynomial-time many-one reductions · Correctness of the SAT-to-3SAT reduction on bit strings · SAT reduces to 3SAT · The BETWEENNESS decision problem · Binary constraint satisfaction as a decision problem · The CIRCUIT SAT decision problem · MAXIMUM 2-SATISFIABILITY as a decision problem · MAXIMUM SATISFIABILITY as a decision problem · The MINIMUM 2-SATISFIABILITY decision problem · The MINIMUM ONES 3-SAT decision problem · MONOTONE 3-SAT as a decision problem · NOT-ALL-EQUAL 3-SAT as a decision problem · Job sequencing with deadlines, processing times and profits as a decision problem · The PARALLEL MACHINES WITH DEADLINES decision problem · The precedence-constrained multiprocessor scheduling decision problem · Resource-constrained project scheduling as a decision problem · Single-machine scheduling with release times and deadlines as a decision problem · The 3-machine flow shop scheduling decision problem · The TOTAL TARDINESS decision problem · SINGLE-MACHINE WEIGHTED COMPLETION WITH PRECEDENCE as a decision problem · The weighted number of tardy jobs decision problem · 3-DIMENSIONAL MATCHING as a decision problem · EXACT COVER BY 3-SETS as a decision problem · EXACT COVER as a decision problem · The FACILITY LOCATION decision problem · The generalized assignment decision problem · The MAXIMUM COVERAGE decision problem · Maximum n-times coverage decision problem · The MINIMUM TEST SET decision problem · Generalized nonmetric k-center as a decision problem · The k-MEDIAN decision problem · QUADRATIC ASSIGNMENT as a decision problem · The SET COVER decision problem · The SET PACKING decision problem · The SET SPLITTING decision problem · The Akari decision problem · The CLOSEST STRING decision problem · LATIN SQUARE COMPLETION as a decision problem · The LONGEST COMMON SUBSEQUENCE decision problem · Minesweeper consistency as a decision problem · The NONOGRAM decision problem · The SHORTEST COMMON SUPERSEQUENCE decision problem · SUDOKU as a decision problem · Membership in APX · Hastad: optimal inapproximability of MAX-3SAT · Value of a MAX-3SAT assignment · L-reductions · The MAX-3SAT objective · MAXSNP problems · NPO problems · Dinur's gap amplification and alphabet reduction · 2-SAT as a decision problem · The marking algorithm is polynomial-time · PATH ∈ P · Decision version of hypergraph \(k\)-cut · Integer linear-programming feasibility in fixed dimension · Rational linear-program feasibility · General matching decision problem · Max-flow decision problem · Perfect matching in uniform hypergraphs with a codegree condition · Undirected s-t connectivity as a decision problem · Easy on average · Key pair produced by a key generator · Eavesdropping advantage against a public-key scheme · One-way functions exist · Public-key encryption exists · Samplable distributions · Public-coin interactive proofs · Directed graph isomorphism as a decision problem · Directed graph non-isomorphism as a decision problem · No-instances of the 2-local Hamiltonian problem · Yes-instances of the 2-local Hamiltonian problem · Polynomial-time reduction between promise problems · QMA for promise problems · SAT with a unary variable count as a decision problem · UniqueSAT with a unary variable count as a decision problem · Valiant-Vazirani: SAT reduces to UniqueSAT · P is closed under polynomial-time preimages · Decider host · Reduction host, canonical form · Verifier host, canonical formDefinitionBounded parsing of self-delimiting blocks#✓fully proved
Given a bound \(n\) and a list of booleans \(s\), the parse returns the empty list of payloads if \(s\) is empty. If \(s\) is nonempty and \(n = 0\) it fails. If \(s\) is nonempty and \(n = m + 1\), it parses one self-delimiting block from the front of \(s\), then parses the remaining list with bound \(m\), and returns the first payload followed by the payloads of the rest. It fails if either step fails. So the parse succeeds exactly when \(s\) is the concatenation of at most \(n\) self-delimiting blocks, and it returns their payloads in order.
def undelimitBlocksAux : ℕ → List Bool → Option (List (List Bool))
| _, [] => some []
| 0, _ :: _ => none
| fuel + 1, input =>
(undelimit input).bind fun p => (undelimitBlocksAux fuel p.2).map (p.1 :: ·)
def undelimit : List Bool → Option (List Bool × List Bool)
| false :: rest => some ([], rest)
| true :: b :: input => (undelimit input).map fun p => (b :: p.1, p.2)
| _ => none
MathlibExt/Computability/Complexity.lean:74
Uses 1 · Used by 304
k) is NP-hard · The decision problem CONNECTED DOMINATING SET · DENSEST k-SUBGRAPH as a decision problem · DOMINATING SET as a decision problem · The EDGE DOMINATING SET decision problem · EFFICIENT DOMINATION (PERFECT CODE) as a decision problem · FEEDBACK ARC SET as a decision problem · FEEDBACK VERTEX SET as a decision problem · INDEPENDENT DOMINATING SET as a decision problem · The MAXIMUM INDUCED MATCHING decision problem · The MINIMUM FILL-IN (CHORDAL COMPLETION) problem · ODD CYCLE TRANSVERSAL as a decision problem · ROMAN DOMINATION as a decision problem · The decision problem TOTAL DOMINATING SET · 0-1 integer programming feasibility as a decision problem · 3-PARTITION as a decision problem · The bin packing decision problem · Exact-cardinality subset sum as a decision problem · The KNAPSACK decision problem · MULTIPLE KNAPSACK as a decision problem · The MULTIWAY NUMBER PARTITION decision problem · NUMERICAL 3-DIMENSIONAL MATCHING as a decision problem · Padding reduction has linear output length · SUBSET-SUM to PARTITION map is polynomial-time · PARTITION to SUBSET-SUM map is polynomial-time · PARTITION doubling pass is polynomial-time · Binary-coded PARTITION decision problem · Binary PARTITION decider is correct on canonical encodings · Binary-coded PARTITION is in NP · Program of the raw-input SUBSET-SUM to PARTITION machine · Encoded reduction from SUBSET-SUM to PARTITION · Correctness of the encoded SUBSET-SUM to PARTITION reduction · Encoded SUBSET-SUM to PARTITION map has linear output length · Encoded reduction from PARTITION to SUBSET-SUM · Correctness of the encoded PARTITION to SUBSET-SUM reduction · Quadratic run of the raw-input SUBSET-SUM to PARTITION machine · Quadratic run of the padding machine on canonical instances · Raw-input PARTITION membership machine runs in quadratic time · Canonical PARTITION membership transducer runs in quadratic time · Polynomial-time reduction from SUBSET-SUM to PARTITION · Bitlength of a PARTITION sum is at most the encoded length · PARTITION membership instance has linear bitlength · The STRIP PACKING decision problem · SUBSET PRODUCT as a decision problem · The VERTEX-COVER to SUBSET-SUM reduction is polynomial-time · SUBSET-SUM is in NP · SUBSET-SUM is NP-hard · Unbounded knapsack as a decision problem · The asymmetric traveling salesperson decision problem · Capacitated vehicle routing as a decision problem · DEGREE-CONSTRAINED SPANNING TREE as a decision problem · The directed Hamiltonian cycle decision problem · HAMPATH is in NP · HAMPATH is NP-hard · SAT ≤ HAMPATH is polynomial-time · INDUCED SUBGRAPH ISOMORPHISM as a decision problem · The decision problem LONGEST CYCLE · The LONGEST PATH decision problem · MAXIMUM COMMON INDUCED SUBGRAPH as a decision problem · The decision problem MAXIMUM LEAF SPANNING TREE · MINIMUM EQUIVALENT DIGRAPH as a decision problem · DIRECTED PATH COVER as a decision problem · The STEINER TREE decision problem · SUBGRAPH ISOMORPHISM as a decision problem · Symmetric TSP as a decision problem · HAMILTONIAN CYCLE (UNDIRECTED) as a decision problem · HAMILTONIAN PATH (UNDIRECTED) as a decision problem · DIRECTED DISJOINT PATHS as a decision problem · The 1-in-3-SAT decision problem · 3-SAT with bounded occurrences as a decision problem · Emitter reductions out of SAT are polynomial-time · The SAT-to-3SAT reduction is polynomial-time · Transitivity of polynomial-time many-one reductions · SAT reduces to 3SAT · The BETWEENNESS decision problem · Binary constraint satisfaction as a decision problem · The CIRCUIT SAT decision problem · MAXIMUM 2-SATISFIABILITY as a decision problem · MAXIMUM SATISFIABILITY as a decision problem · The MINIMUM 2-SATISFIABILITY decision problem · The MINIMUM ONES 3-SAT decision problem · MONOTONE 3-SAT as a decision problem · NOT-ALL-EQUAL 3-SAT as a decision problem · Job sequencing with deadlines, processing times and profits as a decision problem · The PARALLEL MACHINES WITH DEADLINES decision problem · The precedence-constrained multiprocessor scheduling decision problem · Resource-constrained project scheduling as a decision problem · Single-machine scheduling with release times and deadlines as a decision problem · The 3-machine flow shop scheduling decision problem · The TOTAL TARDINESS decision problem · SINGLE-MACHINE WEIGHTED COMPLETION WITH PRECEDENCE as a decision problem · The weighted number of tardy jobs decision problem · 3-DIMENSIONAL MATCHING as a decision problem · EXACT COVER BY 3-SETS as a decision problem · EXACT COVER as a decision problem · The FACILITY LOCATION decision problem · The generalized assignment decision problem · The MAXIMUM COVERAGE decision problem · Maximum n-times coverage decision problem · The MINIMUM TEST SET decision problem · Generalized nonmetric k-center as a decision problem · The k-MEDIAN decision problem · QUADRATIC ASSIGNMENT as a decision problem · The SET COVER decision problem · The SET PACKING decision problem · The SET SPLITTING decision problem · The Akari decision problem · The CLOSEST STRING decision problem · LATIN SQUARE COMPLETION as a decision problem · The LONGEST COMMON SUBSEQUENCE decision problem · Minesweeper consistency as a decision problem · The NONOGRAM decision problem · The SHORTEST COMMON SUPERSEQUENCE decision problem · SUDOKU as a decision problem · Membership in APX · Hastad: optimal inapproximability of MAX-3SAT · Value of a MAX-3SAT assignment · L-reductions · The MAX-3SAT objective · MAXSNP problems · NPO problems · Dinur's gap amplification and alphabet reduction · 2-SAT as a decision problem · The marking algorithm is polynomial-time · PATH ∈ P · Decision version of hypergraph \(k\)-cut · Integer linear-programming feasibility in fixed dimension · Rational linear-program feasibility · General matching decision problem · Max-flow decision problem · Perfect matching in uniform hypergraphs with a codegree condition · Undirected s-t connectivity as a decision problem · Easy on average · Key pair produced by a key generator · Eavesdropping advantage against a public-key scheme · One-way functions exist · Public-key encryption exists · Samplable distributions · Public-coin interactive proofs · Directed graph isomorphism as a decision problem · Directed graph non-isomorphism as a decision problem · No-instances of the 2-local Hamiltonian problem · Yes-instances of the 2-local Hamiltonian problem · Polynomial-time reduction between promise problems · QMA for promise problems · SAT with a unary variable count as a decision problem · UniqueSAT with a unary variable count as a decision problem · Valiant-Vazirani: SAT reduces to UniqueSAT · P is closed under polynomial-time preimages · Decider host · Reduction host, canonical form · Verifier host, canonical formDefinitionParsing a list of booleans into self-delimiting blocks#✓fully proved
Given a list of booleans \(s\), this repeatedly parses one self-delimiting block from the front of \(s\) until \(s\) is used up, allowing at most as many blocks as the length of \(s\), and returns the list of payloads in order. It fails if some block fails to parse. The bound never binds, since every block uses at least one bit. So the parse succeeds exactly when \(s\) is a concatenation of self-delimiting blocks.
def undelimitBlocks (input : List Bool) : Option (List (List Bool)) :=
undelimitBlocksAux input.length input
def undelimitBlocksAux : ℕ → List Bool → Option (List (List Bool))
| _, [] => some []
| 0, _ :: _ => none
| fuel + 1, input =>
(undelimit input).bind fun p => (undelimitBlocksAux fuel p.2).map (p.1 :: ·)
MathlibExt/Computability/Complexity.lean:95
Uses 1 · Used by 301
k) is NP-hard · The decision problem CONNECTED DOMINATING SET · DENSEST k-SUBGRAPH as a decision problem · DOMINATING SET as a decision problem · The EDGE DOMINATING SET decision problem · EFFICIENT DOMINATION (PERFECT CODE) as a decision problem · FEEDBACK ARC SET as a decision problem · FEEDBACK VERTEX SET as a decision problem · INDEPENDENT DOMINATING SET as a decision problem · The MAXIMUM INDUCED MATCHING decision problem · The MINIMUM FILL-IN (CHORDAL COMPLETION) problem · ODD CYCLE TRANSVERSAL as a decision problem · ROMAN DOMINATION as a decision problem · The decision problem TOTAL DOMINATING SET · 0-1 integer programming feasibility as a decision problem · 3-PARTITION as a decision problem · The bin packing decision problem · Exact-cardinality subset sum as a decision problem · The KNAPSACK decision problem · MULTIPLE KNAPSACK as a decision problem · The MULTIWAY NUMBER PARTITION decision problem · NUMERICAL 3-DIMENSIONAL MATCHING as a decision problem · Padding reduction has linear output length · SUBSET-SUM to PARTITION map is polynomial-time · PARTITION to SUBSET-SUM map is polynomial-time · PARTITION doubling pass is polynomial-time · Binary-coded PARTITION decision problem · Binary PARTITION decider is correct on canonical encodings · Binary-coded PARTITION is in NP · Program of the raw-input SUBSET-SUM to PARTITION machine · Encoded reduction from SUBSET-SUM to PARTITION · Correctness of the encoded SUBSET-SUM to PARTITION reduction · Encoded SUBSET-SUM to PARTITION map has linear output length · Encoded reduction from PARTITION to SUBSET-SUM · Correctness of the encoded PARTITION to SUBSET-SUM reduction · Quadratic run of the raw-input SUBSET-SUM to PARTITION machine · Quadratic run of the padding machine on canonical instances · Raw-input PARTITION membership machine runs in quadratic time · Canonical PARTITION membership transducer runs in quadratic time · Polynomial-time reduction from SUBSET-SUM to PARTITION · Bitlength of a PARTITION sum is at most the encoded length · PARTITION membership instance has linear bitlength · The STRIP PACKING decision problem · SUBSET PRODUCT as a decision problem · The VERTEX-COVER to SUBSET-SUM reduction is polynomial-time · SUBSET-SUM is in NP · SUBSET-SUM is NP-hard · Unbounded knapsack as a decision problem · The asymmetric traveling salesperson decision problem · Capacitated vehicle routing as a decision problem · DEGREE-CONSTRAINED SPANNING TREE as a decision problem · The directed Hamiltonian cycle decision problem · HAMPATH is in NP · HAMPATH is NP-hard · SAT ≤ HAMPATH is polynomial-time · INDUCED SUBGRAPH ISOMORPHISM as a decision problem · The decision problem LONGEST CYCLE · The LONGEST PATH decision problem · MAXIMUM COMMON INDUCED SUBGRAPH as a decision problem · The decision problem MAXIMUM LEAF SPANNING TREE · MINIMUM EQUIVALENT DIGRAPH as a decision problem · DIRECTED PATH COVER as a decision problem · The STEINER TREE decision problem · SUBGRAPH ISOMORPHISM as a decision problem · Symmetric TSP as a decision problem · HAMILTONIAN CYCLE (UNDIRECTED) as a decision problem · HAMILTONIAN PATH (UNDIRECTED) as a decision problem · DIRECTED DISJOINT PATHS as a decision problem · The 1-in-3-SAT decision problem · 3-SAT with bounded occurrences as a decision problem · Emitter reductions out of SAT are polynomial-time · The SAT-to-3SAT reduction is polynomial-time · Transitivity of polynomial-time many-one reductions · SAT reduces to 3SAT · The BETWEENNESS decision problem · Binary constraint satisfaction as a decision problem · The CIRCUIT SAT decision problem · MAXIMUM 2-SATISFIABILITY as a decision problem · MAXIMUM SATISFIABILITY as a decision problem · The MINIMUM 2-SATISFIABILITY decision problem · The MINIMUM ONES 3-SAT decision problem · MONOTONE 3-SAT as a decision problem · NOT-ALL-EQUAL 3-SAT as a decision problem · Job sequencing with deadlines, processing times and profits as a decision problem · The PARALLEL MACHINES WITH DEADLINES decision problem · The precedence-constrained multiprocessor scheduling decision problem · Resource-constrained project scheduling as a decision problem · Single-machine scheduling with release times and deadlines as a decision problem · The 3-machine flow shop scheduling decision problem · The TOTAL TARDINESS decision problem · SINGLE-MACHINE WEIGHTED COMPLETION WITH PRECEDENCE as a decision problem · The weighted number of tardy jobs decision problem · 3-DIMENSIONAL MATCHING as a decision problem · EXACT COVER BY 3-SETS as a decision problem · EXACT COVER as a decision problem · The FACILITY LOCATION decision problem · The generalized assignment decision problem · The MAXIMUM COVERAGE decision problem · Maximum n-times coverage decision problem · The MINIMUM TEST SET decision problem · Generalized nonmetric k-center as a decision problem · The k-MEDIAN decision problem · QUADRATIC ASSIGNMENT as a decision problem · The SET COVER decision problem · The SET PACKING decision problem · The SET SPLITTING decision problem · The Akari decision problem · The CLOSEST STRING decision problem · LATIN SQUARE COMPLETION as a decision problem · The LONGEST COMMON SUBSEQUENCE decision problem · Minesweeper consistency as a decision problem · The NONOGRAM decision problem · The SHORTEST COMMON SUPERSEQUENCE decision problem · SUDOKU as a decision problem · Membership in APX · Hastad: optimal inapproximability of MAX-3SAT · Value of a MAX-3SAT assignment · L-reductions · The MAX-3SAT objective · MAXSNP problems · NPO problems · Dinur's gap amplification and alphabet reduction · 2-SAT as a decision problem · The marking algorithm is polynomial-time · PATH ∈ P · Decision version of hypergraph \(k\)-cut · Integer linear-programming feasibility in fixed dimension · Rational linear-program feasibility · General matching decision problem · Max-flow decision problem · Perfect matching in uniform hypergraphs with a codegree condition · Undirected s-t connectivity as a decision problem · Easy on average · Key pair produced by a key generator · Eavesdropping advantage against a public-key scheme · One-way functions exist · Public-key encryption exists · Samplable distributions · Public-coin interactive proofs · Directed graph isomorphism as a decision problem · Directed graph non-isomorphism as a decision problem · No-instances of the 2-local Hamiltonian problem · Yes-instances of the 2-local Hamiltonian problem · Polynomial-time reduction between promise problems · QMA for promise problems · SAT with a unary variable count as a decision problem · UniqueSAT with a unary variable count as a decision problem · Valiant-Vazirani: SAT reduces to UniqueSAT · P is closed under polynomial-time preimages · Decider host · Reduction host, canonical form · Verifier host, canonical formComplexity Theory
AbbreviationDecision problems#✓fully proved
A decision problem is a function from finite lists of booleans (bitstrings) to booleans.
Sources
- inlined from FormalConjectures (absent from Mathlib).
Used by 439
k) is in NP · VERTEX-COVER (exact size k) is NP-complete · VERTEX-COVER (exact size k) is NP-hard · The decision problem CONNECTED DOMINATING SET · CONNECTED DOMINATING SET is NP-complete · DENSEST k-SUBGRAPH as a decision problem · DENSEST k-SUBGRAPH is NP-complete · DOMINATING SET as a decision problem · DOMINATING SET is NP-complete · The EDGE DOMINATING SET decision problem · EDGE DOMINATING SET is NP-complete · EFFICIENT DOMINATION (PERFECT CODE) as a decision problem · EFFICIENT DOMINATION (PERFECT CODE) is NP-complete · FEEDBACK ARC SET as a decision problem · FEEDBACK ARC SET is NP-complete · FEEDBACK VERTEX SET as a decision problem · FEEDBACK VERTEX SET is NP-complete · INDEPENDENT DOMINATING SET as a decision problem · INDEPENDENT DOMINATING SET is NP-complete · The MAXIMUM INDUCED MATCHING decision problem · MAXIMUM INDUCED MATCHING is NP-complete · The MINIMUM FILL-IN (CHORDAL COMPLETION) problem · MINIMUM FILL-IN (CHORDAL COMPLETION) is NP-complete · ODD CYCLE TRANSVERSAL as a decision problem · ODD CYCLE TRANSVERSAL is NP-complete · ROMAN DOMINATION as a decision problem · ROMAN DOMINATION is NP-complete · The decision problem TOTAL DOMINATING SET · TOTAL DOMINATING SET is NP-complete · 0-1 INTEGER PROGRAMMING FEASIBILITY is NP-complete · 0-1 integer programming feasibility as a decision problem · 3-PARTITION as a decision problem · 3-PARTITION is NP-complete · The bin packing decision problem · BIN PACKING is NP-complete · Exact-cardinality subset sum as a decision problem · EXACT-CARDINALITY SUBSET SUM is NP-complete · The KNAPSACK decision problem · KNAPSACK is NP-complete · MULTIPLE KNAPSACK as a decision problem · MULTIPLE KNAPSACK is NP-complete · The MULTIWAY NUMBER PARTITION decision problem · MULTIWAY NUMBER PARTITION is NP-complete · NUMERICAL 3-DIMENSIONAL MATCHING is NP-complete · NUMERICAL 3-DIMENSIONAL MATCHING as a decision problem · Binary-coded PARTITION decision problem · Binary-coded PARTITION is in NP · PARTITION is NP-complete · The STRIP PACKING decision problem · STRIP PACKING is NP-complete · SUBSET PRODUCT as a decision problem · SUBSET PRODUCT is NP-complete · The SUBSET-SUM problem · SUBSET-SUM is in NP · SUBSET-SUM is NP-complete · SUBSET-SUM is NP-hard · Unbounded knapsack as a decision problem · UNBOUNDED KNAPSACK is NP-complete · The asymmetric traveling salesperson decision problem · TRAVELING SALESPERSON (ASYMMETRIC) is NP-complete · Capacitated vehicle routing as a decision problem · CAPACITATED VEHICLE ROUTING is NP-complete · DEGREE-CONSTRAINED SPANNING TREE as a decision problem · DEGREE-CONSTRAINED SPANNING TREE is NP-complete · The directed Hamiltonian cycle decision problem · HAMILTONIAN CYCLE (DIRECTED) is NP-complete · The HAMPATH problem · HAMPATH is in NP · HAMPATH is NP-complete · HAMPATH is NP-hard · INDUCED SUBGRAPH ISOMORPHISM as a decision problem · INDUCED SUBGRAPH ISOMORPHISM is NP-complete · The decision problem LONGEST CYCLE · LONGEST CYCLE is NP-complete · The LONGEST PATH decision problem · LONGEST PATH is NP-complete · MAXIMUM COMMON INDUCED SUBGRAPH as a decision problem · MAXIMUM COMMON INDUCED SUBGRAPH is NP-complete · The decision problem MAXIMUM LEAF SPANNING TREE · MAXIMUM LEAF SPANNING TREE is NP-complete · MINIMUM EQUIVALENT DIGRAPH as a decision problem · MINIMUM EQUIVALENT DIGRAPH is NP-complete · DIRECTED PATH COVER as a decision problem · DIRECTED PATH COVER is NP-complete · The STEINER TREE decision problem · STEINER TREE is NP-complete · SUBGRAPH ISOMORPHISM as a decision problem · SUBGRAPH ISOMORPHISM is NP-complete · Symmetric TSP as a decision problem · TRAVELING SALESPERSON (SYMMETRIC) is NP-complete · HAMILTONIAN CYCLE (UNDIRECTED) as a decision problem · HAMILTONIAN CYCLE (UNDIRECTED) is NP-complete · HAMILTONIAN PATH (UNDIRECTED) as a decision problem · HAMILTONIAN PATH (UNDIRECTED) is NP-complete · DIRECTED DISJOINT PATHS as a decision problem · DIRECTED DISJOINT PATHS is NP-complete · The 1-in-3-SAT decision problem · 1-IN-3-SAT is NP-complete · 3-SAT with bounded occurrences as a decision problem · 3-SAT WITH BOUNDED OCCURRENCES is NP-complete · NP-hardness transfers along reductions · Transitivity of polynomial-time many-one reductions · The 3SAT decision problem · 3SAT is NP-complete · 3SAT is NP-hard · The BETWEENNESS decision problem · BETWEENNESS is NP-complete · Binary constraint satisfaction as a decision problem · BINARY CONSTRAINT SATISFACTION is NP-complete · The CIRCUIT SAT decision problem · CIRCUIT SAT is NP-complete · MAXIMUM 2-SATISFIABILITY as a decision problem · MAXIMUM 2-SATISFIABILITY is NP-complete · MAXIMUM SATISFIABILITY as a decision problem · MAXIMUM SATISFIABILITY is NP-complete · The MINIMUM 2-SATISFIABILITY decision problem · MINIMUM 2-SATISFIABILITY is NP-complete · The MINIMUM ONES 3-SAT decision problem · MINIMUM ONES 3-SAT is NP-complete · MONOTONE 3-SAT as a decision problem · MONOTONE 3-SAT is NP-complete · NOT-ALL-EQUAL 3-SAT as a decision problem · NOT-ALL-EQUAL 3-SAT is NP-complete · Job sequencing with deadlines, processing times and profits as a decision problem · JOB SEQUENCING WITH DEADLINES, PROCESSING TIMES, AND PROFITS is NP-complete · The PARALLEL MACHINES WITH DEADLINES decision problem · PARALLEL MACHINES WITH DEADLINES is NP-complete · The precedence-constrained multiprocessor scheduling decision problem · PRECEDENCE-CONSTRAINED MULTIPROCESSOR SCHEDULING is NP-complete · Resource-constrained project scheduling as a decision problem · RESOURCE-CONSTRAINED PROJECT SCHEDULING is NP-complete · Single-machine scheduling with release times and deadlines as a decision problem · SINGLE-MACHINE SCHEDULING WITH RELEASE TIMES AND DEADLINES is NP-complete · The 3-machine flow shop scheduling decision problem · 3-MACHINE FLOW SHOP SCHEDULING is NP-complete · The TOTAL TARDINESS decision problem · TOTAL TARDINESS is NP-complete · SINGLE-MACHINE WEIGHTED COMPLETION WITH PRECEDENCE as a decision problem · SINGLE-MACHINE WEIGHTED COMPLETION WITH PRECEDENCE is NP-complete · The weighted number of tardy jobs decision problem · WEIGHTED NUMBER OF TARDY JOBS is NP-complete · 3-DIMENSIONAL MATCHING as a decision problem · 3-DIMENSIONAL MATCHING is NP-complete · EXACT COVER BY 3-SETS as a decision problem · EXACT COVER BY 3-SETS is NP-complete · EXACT COVER as a decision problem · EXACT COVER is NP-complete · The FACILITY LOCATION decision problem · FACILITY LOCATION is NP-complete · The generalized assignment decision problem · GENERALIZED ASSIGNMENT is NP-complete · The MAXIMUM COVERAGE decision problem · MAXIMUM COVERAGE is NP-complete · Maximum n-times coverage decision problem · MAXIMUM n-TIMES COVERAGE is NP-complete · The MINIMUM TEST SET decision problem · MINIMUM TEST SET is NP-complete · Generalized nonmetric k-center as a decision problem · k-CENTER (GENERALIZED, NONMETRIC) is NP-complete · The k-MEDIAN decision problem · k-MEDIAN (GENERALIZED, NONMETRIC) is NP-complete · QUADRATIC ASSIGNMENT as a decision problem · QUADRATIC ASSIGNMENT is NP-complete · The SET COVER decision problem · SET COVER is NP-complete · The SET PACKING decision problem · SET PACKING is NP-complete · The SET SPLITTING decision problem · SET SPLITTING is NP-complete · The Akari decision problem · AKARI (LIGHT UP) is NP-complete · The CLOSEST STRING decision problem · CLOSEST STRING is NP-complete · LATIN SQUARE COMPLETION as a decision problem · LATIN SQUARE COMPLETION is NP-complete · The LONGEST COMMON SUBSEQUENCE decision problem · LONGEST COMMON SUBSEQUENCE is NP-complete · Minesweeper consistency as a decision problem · MINESWEEPER CONSISTENCY is NP-complete · The NONOGRAM decision problem · NONOGRAM is NP-complete · The SHORTEST COMMON SUPERSEQUENCE decision problem · SHORTEST COMMON SUPERSEQUENCE is NP-complete · SUDOKU as a decision problem · SUDOKU is NP-complete · The PCP theorem: NP = PCP(O(log n), O(1)) · 2-SAT as a decision problem · 2-SAT is in P · The primality decision problem · PRIMES is in P · The PATH problem · PATH ∈ P · Decision version of hypergraph \(k\)-cut · The EGRES question on hypergraph \(k\)-cut for fixed \(k\) · Integer linear-programming feasibility in fixed dimension · Integer linear programming in fixed dimension is in P (Lenstra) · Rational linear-program feasibility · Linear programming is in P (Khachiyan) · General matching decision problem · General matching is in P (Edmonds' blossom algorithm) · Max-flow decision problem · Max flow is in P (Edmonds-Karp) · Ruciński's question on perfect matchings in dense hypergraphs · Perfect matching in uniform hypergraphs with a codegree condition · Undirected s-t connectivity as a decision problem · Undirected ST-connectivity is in L (Reingold) · Easy on average · Hard on average · Heuristica · Impagliazzo's five worlds · Pessiland · Nisan-Wigderson: exponential hardness in E derandomizes BPP · Adleman's theorem: BPP is contained in P/poly · AM is contained in \(\Pi_2^p\) (Babai) · MA is contained in AM · MA is contained in PH · BPP is contained in PSPACE · RP is contained in BPP · RP is contained in NP · BQP is contained in PP · BQP is contained in PSPACE · Public-coin interactive proofs · Directed graph isomorphism as a decision problem · Graph isomorphism is in NP and coAM · Directed graph non-isomorphism as a decision problem · Graph non-isomorphism is in AM · Sipser-Gács-Lautemann: BPP is in \(\Sigma_2^p\) and \(\Pi_2^p\) · SAT with a unary variable count as a decision problem · UniqueSAT with a unary variable count as a decision problem · P is closed under polynomial-time preimagesAbbreviationComplexity classes#✓fully proved
A complexity class is a set of decision problems.
abbrev DecisionComplexityClass := Set DecisionProblem
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
Sources
- inlined from FormalConjectures (absent from Mathlib).
Uses 1 · Used by 275
k) is in NP · VERTEX-COVER (exact size k) is NP-complete · VERTEX-COVER (exact size k) is NP-hard · CONNECTED DOMINATING SET is NP-complete · DENSEST k-SUBGRAPH is NP-complete · DOMINATING SET is NP-complete · EDGE DOMINATING SET is NP-complete · EFFICIENT DOMINATION (PERFECT CODE) is NP-complete · FEEDBACK ARC SET is NP-complete · FEEDBACK VERTEX SET is NP-complete · INDEPENDENT DOMINATING SET is NP-complete · MAXIMUM INDUCED MATCHING is NP-complete · MINIMUM FILL-IN (CHORDAL COMPLETION) is NP-complete · ODD CYCLE TRANSVERSAL is NP-complete · ROMAN DOMINATION is NP-complete · TOTAL DOMINATING SET is NP-complete · 0-1 INTEGER PROGRAMMING FEASIBILITY is NP-complete · 3-PARTITION is NP-complete · BIN PACKING is NP-complete · EXACT-CARDINALITY SUBSET SUM is NP-complete · KNAPSACK is NP-complete · MULTIPLE KNAPSACK is NP-complete · MULTIWAY NUMBER PARTITION is NP-complete · NUMERICAL 3-DIMENSIONAL MATCHING is NP-complete · Binary-coded PARTITION is in NP · PARTITION is NP-complete · STRIP PACKING is NP-complete · SUBSET PRODUCT is NP-complete · SUBSET-SUM is in NP · SUBSET-SUM is NP-complete · SUBSET-SUM is NP-hard · UNBOUNDED KNAPSACK is NP-complete · TRAVELING SALESPERSON (ASYMMETRIC) is NP-complete · CAPACITATED VEHICLE ROUTING is NP-complete · DEGREE-CONSTRAINED SPANNING TREE is NP-complete · HAMILTONIAN CYCLE (DIRECTED) is NP-complete · HAMPATH is in NP · HAMPATH is NP-complete · HAMPATH is NP-hard · INDUCED SUBGRAPH ISOMORPHISM is NP-complete · LONGEST CYCLE is NP-complete · LONGEST PATH is NP-complete · MAXIMUM COMMON INDUCED SUBGRAPH is NP-complete · MAXIMUM LEAF SPANNING TREE is NP-complete · MINIMUM EQUIVALENT DIGRAPH is NP-complete · DIRECTED PATH COVER is NP-complete · STEINER TREE is NP-complete · SUBGRAPH ISOMORPHISM is NP-complete · TRAVELING SALESPERSON (SYMMETRIC) is NP-complete · HAMILTONIAN CYCLE (UNDIRECTED) is NP-complete · HAMILTONIAN PATH (UNDIRECTED) is NP-complete · DIRECTED DISJOINT PATHS is NP-complete · 1-IN-3-SAT is NP-complete · 3-SAT WITH BOUNDED OCCURRENCES is NP-complete · NP-hardness transfers along reductions · 3SAT is NP-complete · 3SAT is NP-hard · BETWEENNESS is NP-complete · BINARY CONSTRAINT SATISFACTION is NP-complete · CIRCUIT SAT is NP-complete · MAXIMUM 2-SATISFIABILITY is NP-complete · MAXIMUM SATISFIABILITY is NP-complete · MINIMUM 2-SATISFIABILITY is NP-complete · MINIMUM ONES 3-SAT is NP-complete · MONOTONE 3-SAT is NP-complete · NOT-ALL-EQUAL 3-SAT is NP-complete · JOB SEQUENCING WITH DEADLINES, PROCESSING TIMES, AND PROFITS is NP-complete · PARALLEL MACHINES WITH DEADLINES is NP-complete · PRECEDENCE-CONSTRAINED MULTIPROCESSOR SCHEDULING is NP-complete · RESOURCE-CONSTRAINED PROJECT SCHEDULING is NP-complete · SINGLE-MACHINE SCHEDULING WITH RELEASE TIMES AND DEADLINES is NP-complete · 3-MACHINE FLOW SHOP SCHEDULING is NP-complete · TOTAL TARDINESS is NP-complete · SINGLE-MACHINE WEIGHTED COMPLETION WITH PRECEDENCE is NP-complete · WEIGHTED NUMBER OF TARDY JOBS is NP-complete · 3-DIMENSIONAL MATCHING is NP-complete · EXACT COVER BY 3-SETS is NP-complete · EXACT COVER is NP-complete · FACILITY LOCATION is NP-complete · GENERALIZED ASSIGNMENT is NP-complete · MAXIMUM COVERAGE is NP-complete · MAXIMUM n-TIMES COVERAGE is NP-complete · MINIMUM TEST SET is NP-complete · k-CENTER (GENERALIZED, NONMETRIC) is NP-complete · k-MEDIAN (GENERALIZED, NONMETRIC) is NP-complete · QUADRATIC ASSIGNMENT is NP-complete · SET COVER is NP-complete · SET PACKING is NP-complete · SET SPLITTING is NP-complete · AKARI (LIGHT UP) is NP-complete · CLOSEST STRING is NP-complete · LATIN SQUARE COMPLETION is NP-complete · LONGEST COMMON SUBSEQUENCE is NP-complete · MINESWEEPER CONSISTENCY is NP-complete · NONOGRAM is NP-complete · SHORTEST COMMON SUPERSEQUENCE is NP-complete · SUDOKU is NP-complete · Hastad: optimal inapproximability of MAX-3SAT · MAX-CUT has no PTAS unless P = NP · The PCP theorem: NP = PCP(O(log n), O(1)) · 2-SAT is in P · PRIMES is in P · PATH ∈ P · The EGRES question on hypergraph \(k\)-cut for fixed \(k\) · Integer linear programming in fixed dimension is in P (Lenstra) · Linear programming is in P (Khachiyan) · General matching is in P (Edmonds' blossom algorithm) · Max flow is in P (Edmonds-Karp) · Ruciński's question on perfect matchings in dense hypergraphs · Undirected ST-connectivity is in L (Reingold) · Algorithmica · Heuristica · Impagliazzo's five worlds · Pessiland · Nisan-Wigderson: exponential hardness in E derandomizes BPP · One-way functions imply P ≠ NP · Adleman's theorem: BPP is contained in P/poly · AM is contained in \(\Pi_2^p\) (Babai) · MA is contained in AM · MA is contained in PH · BPP is contained in PSPACE · RP is contained in BPP · RP is contained in NP · BQP is contained in PP · BQP is contained in PSPACE · Goldwasser-Sipser: private coins add no power to interactive proofs · Public-coin interactive proofs · Graph isomorphism is in NP and coAM · Graph non-isomorphism is in AM · IP = PSPACE (Shamir) · Sipser-Gács-Lautemann: BPP is in \(\Sigma_2^p\) and \(\Pi_2^p\) · P is closed under polynomial-time preimagesDefinitionPolynomial-time computability under given encodings#✓fully proved
Let \(e_\alpha\) encode \(\alpha\) as words over an alphabet \(\Gamma_\alpha\) and \(e_\beta\) encode \(\beta\) as words over \(\Gamma_\beta\). A function \(f : \alpha \to \beta\) is polynomial-time computable with respect to \(e_\alpha\) and \(e_\beta\) when there are a multi-stack Turing machine with finitely many stacks, function labels and internal states and a finite input stack alphabet, identifications of its input and output stack alphabets with \(\Gamma_\alpha\) and \(\Gamma_\beta\), and a polynomial \(p\) with natural-number coefficients, such that for every \(a \in \alpha\) the machine, started at its main function in its initial state with \(e_\alpha(a)\) on its input stack and every other stack empty, halts within \(p(n)\) steps, where \(n\) is the length of \(e_\alpha(a)\), with \(e_\beta(f(a))\) on its output stack, every other stack empty and its internal state equal to its initial state.
def IsPolyTimeWithEncoding {α β Γα Γβ : Type} (ea : Encoding α Γα)
(eb : Encoding β Γβ) (f : α → β) :=
Nonempty (Turing.TM2ComputableInPolyTime ea.encode eb.encode f)
Sources
- inlined from FormalConjectures (absent from Mathlib).
DefinitionPolynomial-time computable functions#✓fully proved
Let \(\alpha\) and \(\beta\) be types with canonical bitstring encodings. A function \(f : \alpha \to \beta\) is polynomial-time computable when it is polynomial-time computable with respect to the canonical bitstring encodings of \(\alpha\) and \(\beta\).
def IsPolyTime {α β : Type} [BitstringEncoding α] [BitstringEncoding β]
(f : α → β) : Prop :=
IsPolyTimeWithEncoding (BitstringEncoding.toEncoding (α := α))
(BitstringEncoding.toEncoding (α := β)) f
class BitstringEncoding α extends Computability.Encoding α Bool
MathlibExt/Computability/Complexity.lean:48
def IsPolyTimeWithEncoding {α β Γα Γβ : Type} (ea : Encoding α Γα)
(eb : Encoding β Γβ) (f : α → β) :=
Nonempty (Turing.TM2ComputableInPolyTime ea.encode eb.encode f)
MathlibExt/Computability/Complexity.lean:179
Sources
- inlined from FormalConjectures (absent from Mathlib).
Uses 2 · Used by 103
k) is NP-hard · SUBSET-SUM to PARTITION map is polynomial-time · PARTITION to SUBSET-SUM map is polynomial-time · PARTITION doubling pass is polynomial-time · Binary-coded PARTITION is in NP · Polynomial-time reduction from SUBSET-SUM to PARTITION · The VERTEX-COVER to SUBSET-SUM reduction is polynomial-time · SUBSET-SUM is in NP · SUBSET-SUM is NP-hard · HAMPATH is in NP · HAMPATH is NP-hard · SAT ≤ HAMPATH is polynomial-time · Emitter reductions out of SAT are polynomial-time · The SAT-to-3SAT reduction is polynomial-time · Transitivity of polynomial-time many-one reductions · SAT reduces to 3SAT · Membership in APX · Hastad: optimal inapproximability of MAX-3SAT · L-reductions · MAXSNP problems · NPO problems · Dinur's gap amplification and alphabet reduction · The marking algorithm is polynomial-time · PATH ∈ P · Easy on average · One-way functions exist · Public-key encryption exists · Samplable distributions · Public-coin interactive proofs · Polynomial-time reduction between promise problems · QMA for promise problems · Valiant-Vazirani: SAT reduces to UniqueSAT · Polynomial-time functions are closed under composition · P is closed under polynomial-time preimages · Decider host · Reduction host, canonical form · Verifier host, canonical formDefinitionThe complexity class P#✓fully proved
P is the set of decision problems (functions from lists of booleans to booleans) that are computable in polynomial time by a deterministic multi-stack Turing machine, with respect to the canonical bitstring encodings of inputs and outputs.
def P : DecisionComplexityClass :=
{ L | IsPolyTime L }
abbrev DecisionComplexityClass := Set DecisionProblem
MathlibExt/Computability/Complexity.lean:174
def IsPolyTime {α β : Type} [BitstringEncoding α] [BitstringEncoding β]
(f : α → β) : Prop :=
IsPolyTimeWithEncoding (BitstringEncoding.toEncoding (α := α))
(BitstringEncoding.toEncoding (α := β)) f
MathlibExt/Computability/Complexity.lean:186
Uses 11 · Used by 32
DefinitionThe complexity class NP#✓fully proved
NP is the set of decision problems \(L\) (functions from lists of booleans to booleans) for which there exist a polynomial \(p\) with natural-number coefficients and a polynomial-time computable function \(R\) from pairs of lists of booleans to booleans such that, for every list of booleans \(x\), \(L(x)\) is true if and only if there is a list of booleans \(w\) whose length is at most \(p\) evaluated at the length of \(x\) and for which \(R(x, w)\) is true.
Polynomial time is measured with respect to the canonical bitstring encodings.
def NP : DecisionComplexityClass :=
{ L | ∃ (p : Polynomial ℕ), ∃ R : (List Bool × List Bool) → Bool,
IsPolyTime R ∧
∀ x, L x ↔ ∃ w : List Bool, w.length ≤ p.eval x.length ∧ R (x, w) }
abbrev DecisionComplexityClass := Set DecisionProblem
MathlibExt/Computability/Complexity.lean:174
def IsPolyTime {α β : Type} [BitstringEncoding α] [BitstringEncoding β]
(f : α → β) : Prop :=
IsPolyTimeWithEncoding (BitstringEncoding.toEncoding (α := α))
(BitstringEncoding.toEncoding (α := β)) f
MathlibExt/Computability/Complexity.lean:186
Uses 11 · Used by 159
k) is in NP · VERTEX-COVER (exact size k) is NP-complete · VERTEX-COVER (exact size k) is NP-hard · CONNECTED DOMINATING SET is NP-complete · DENSEST k-SUBGRAPH is NP-complete · DOMINATING SET is NP-complete · EDGE DOMINATING SET is NP-complete · EFFICIENT DOMINATION (PERFECT CODE) is NP-complete · FEEDBACK ARC SET is NP-complete · FEEDBACK VERTEX SET is NP-complete · INDEPENDENT DOMINATING SET is NP-complete · MAXIMUM INDUCED MATCHING is NP-complete · MINIMUM FILL-IN (CHORDAL COMPLETION) is NP-complete · ODD CYCLE TRANSVERSAL is NP-complete · ROMAN DOMINATION is NP-complete · TOTAL DOMINATING SET is NP-complete · 0-1 INTEGER PROGRAMMING FEASIBILITY is NP-complete · 3-PARTITION is NP-complete · BIN PACKING is NP-complete · EXACT-CARDINALITY SUBSET SUM is NP-complete · KNAPSACK is NP-complete · MULTIPLE KNAPSACK is NP-complete · MULTIWAY NUMBER PARTITION is NP-complete · NUMERICAL 3-DIMENSIONAL MATCHING is NP-complete · Binary-coded PARTITION is in NP · PARTITION is NP-complete · STRIP PACKING is NP-complete · SUBSET PRODUCT is NP-complete · SUBSET-SUM is in NP · SUBSET-SUM is NP-complete · SUBSET-SUM is NP-hard · UNBOUNDED KNAPSACK is NP-complete · TRAVELING SALESPERSON (ASYMMETRIC) is NP-complete · CAPACITATED VEHICLE ROUTING is NP-complete · DEGREE-CONSTRAINED SPANNING TREE is NP-complete · HAMILTONIAN CYCLE (DIRECTED) is NP-complete · HAMPATH is in NP · HAMPATH is NP-complete · HAMPATH is NP-hard · INDUCED SUBGRAPH ISOMORPHISM is NP-complete · LONGEST CYCLE is NP-complete · LONGEST PATH is NP-complete · MAXIMUM COMMON INDUCED SUBGRAPH is NP-complete · MAXIMUM LEAF SPANNING TREE is NP-complete · MINIMUM EQUIVALENT DIGRAPH is NP-complete · DIRECTED PATH COVER is NP-complete · STEINER TREE is NP-complete · SUBGRAPH ISOMORPHISM is NP-complete · TRAVELING SALESPERSON (SYMMETRIC) is NP-complete · HAMILTONIAN CYCLE (UNDIRECTED) is NP-complete · HAMILTONIAN PATH (UNDIRECTED) is NP-complete · DIRECTED DISJOINT PATHS is NP-complete · 1-IN-3-SAT is NP-complete · 3-SAT WITH BOUNDED OCCURRENCES is NP-complete · NP-hardness transfers along reductions · 3SAT is NP-complete · 3SAT is NP-hard · BETWEENNESS is NP-complete · BINARY CONSTRAINT SATISFACTION is NP-complete · CIRCUIT SAT is NP-complete · MAXIMUM 2-SATISFIABILITY is NP-complete · MAXIMUM SATISFIABILITY is NP-complete · MINIMUM 2-SATISFIABILITY is NP-complete · MINIMUM ONES 3-SAT is NP-complete · MONOTONE 3-SAT is NP-complete · NOT-ALL-EQUAL 3-SAT is NP-complete · JOB SEQUENCING WITH DEADLINES, PROCESSING TIMES, AND PROFITS is NP-complete · PARALLEL MACHINES WITH DEADLINES is NP-complete · PRECEDENCE-CONSTRAINED MULTIPROCESSOR SCHEDULING is NP-complete · RESOURCE-CONSTRAINED PROJECT SCHEDULING is NP-complete · SINGLE-MACHINE SCHEDULING WITH RELEASE TIMES AND DEADLINES is NP-complete · 3-MACHINE FLOW SHOP SCHEDULING is NP-complete · TOTAL TARDINESS is NP-complete · SINGLE-MACHINE WEIGHTED COMPLETION WITH PRECEDENCE is NP-complete · WEIGHTED NUMBER OF TARDY JOBS is NP-complete · 3-DIMENSIONAL MATCHING is NP-complete · EXACT COVER BY 3-SETS is NP-complete · EXACT COVER is NP-complete · FACILITY LOCATION is NP-complete · GENERALIZED ASSIGNMENT is NP-complete · MAXIMUM COVERAGE is NP-complete · MAXIMUM n-TIMES COVERAGE is NP-complete · MINIMUM TEST SET is NP-complete · k-CENTER (GENERALIZED, NONMETRIC) is NP-complete · k-MEDIAN (GENERALIZED, NONMETRIC) is NP-complete · QUADRATIC ASSIGNMENT is NP-complete · SET COVER is NP-complete · SET PACKING is NP-complete · SET SPLITTING is NP-complete · AKARI (LIGHT UP) is NP-complete · CLOSEST STRING is NP-complete · LATIN SQUARE COMPLETION is NP-complete · LONGEST COMMON SUBSEQUENCE is NP-complete · MINESWEEPER CONSISTENCY is NP-complete · NONOGRAM is NP-complete · SHORTEST COMMON SUPERSEQUENCE is NP-complete · SUDOKU is NP-complete · Hastad: optimal inapproximability of MAX-3SAT · MAX-CUT has no PTAS unless P = NP · The PCP theorem: NP = PCP(O(log n), O(1)) · Algorithmica · Heuristica · Impagliazzo's five worlds · Pessiland · One-way functions imply P ≠ NP · RP is contained in NP · Graph isomorphism is in NP and coAMDefinitionThe class coNP#✓fully proved
The class coNP. coNP is the set of decision problems \(L\) whose complement, the decision problem that accepts exactly the bitstrings that \(L\) rejects, belongs to NP.
def coNP : DecisionComplexityClass :=
{ L | Lᶜ ∈ NP }
abbrev DecisionComplexityClass := Set DecisionProblem
MathlibExt/Computability/Complexity.lean:174
def NP : DecisionComplexityClass :=
{ L | ∃ (p : Polynomial ℕ), ∃ R : (List Bool × List Bool) → Bool,
IsPolyTime R ∧
∀ x, L x ↔ ∃ w : List Bool, w.length ≤ p.eval x.length ∧ R (x, w) }
MathlibExt/Computability/Complexity.lean:200
Sources
- inlined from FormalConjectures (absent from Mathlib).
Uses 3 · Used by 2
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.