Minimum test set
AbbreviationMinimum test set instance#✓fully proved
An instance of MINIMUM TEST SET is a triple \((n, C, K)\) of a natural number \(n\) (the number of elements), a finite list \(C\) of finite lists of natural numbers (the tests) and a natural number \(K\) (the bound).
DefinitionWell-formed minimum test set instance#✓fully proved
An instance \((n, C, K)\) of MINIMUM TEST SET is well formed when every test in the list \(C\) is a list of numbers below \(n\) without repeated entries, so that each test lists a subset of \(\{0, \dots, n-1\}\), each element once.
def WellFormed (i : MinimumTestSetInstance) : Prop :=
∀ s ∈ i.2.1, s.Nodup ∧ ∀ x ∈ s, x < i.1
abbrev MinimumTestSetInstance := ℕ × List (List ℕ) × ℕ
WantedExt/Complexity/NPComplete/MinimumTestSetWanted.lean:46
Uses 1 · Used by 1
DefinitionFeasible minimum test set instance#✓fully proved
An instance \((n, C, K)\) of MINIMUM TEST SET is feasible when some sublist \(T\) of \(C\) (obtained by deleting entries of \(C\)) has length at most \(K\) and distinguishes every pair: for all distinct \(a, b < n\) some test in \(T\) contains exactly one of \(a\) and \(b\).
def MinimumTestSetFeasible
(i : MinimumTestSetInstance) : Prop :=
∃ T : List (List ℕ), T.Sublist i.2.1 ∧ T.length ≤ i.2.2 ∧
∀ a < i.1, ∀ b < i.1, a ≠ b →
∃ s ∈ T, (a ∈ s ∧ b ∉ s) ∨ (a ∉ s ∧ b ∈ s)
abbrev MinimumTestSetInstance := ℕ × List (List ℕ) × ℕ
WantedExt/Complexity/NPComplete/MinimumTestSetWanted.lean:46
Uses 1 · Used by 1
DefinitionThe MINIMUM TEST SET decision problem#✓fully proved
It accepts a bitstring \(x\) exactly when \(x\) decodes, under the canonical bitstring encoding, to a triple \((n, C, K)\) of a natural number \(n\), a list \(C\) of lists of natural numbers (the tests) and a natural number \(K\) with the following properties: every test is a list of numbers below \(n\) without repeated entries, and some sublist \(T\) of \(C\), obtained by deleting entries of \(C\), has length at most \(K\) and distinguishes every pair, that is, for all distinct \(a, b < n\) some test in \(T\) contains exactly one of \(a\) and \(b\). Bitstrings that do not decode are rejected.
noncomputable def minimumTestSetDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := MinimumTestSetInstance) x with
| some i => decide (WellFormed i ∧ MinimumTestSetFeasible i)
| none => false
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
def bitDecode [BitstringEncoding α] (l : List Bool) : Option α := toEncoding.decode l
MathlibExt/Computability/Complexity.lean:58
abbrev MinimumTestSetInstance := ℕ × List (List ℕ) × ℕ
WantedExt/Complexity/NPComplete/MinimumTestSetWanted.lean:46
def WellFormed (i : MinimumTestSetInstance) : Prop :=
∀ s ∈ i.2.1, s.Nodup ∧ ∀ x ∈ s, x < i.1
WantedExt/Complexity/NPComplete/MinimumTestSetWanted.lean:49
def MinimumTestSetFeasible
(i : MinimumTestSetInstance) : Prop :=
∃ T : List (List ℕ), T.Sublist i.2.1 ∧ T.length ≤ i.2.2 ∧
∀ a < i.1, ∀ b < i.1, a ≠ b →
∃ s ∈ T, (a ∈ s ∧ b ∉ s) ∨ (a ∉ s ∧ b ∈ s)
WantedExt/Complexity/NPComplete/MinimumTestSetWanted.lean:53
Uses 12 · Used by 1
TheoremMINIMUM TEST SET is NP-complete#●ready to prove
The MINIMUM TEST SET decision problem lies in NP, and every decision problem in NP has a polynomial-time many-one reduction to it.
public theorem_wanted minimumTestSet_npComplete :
minimumTestSetDec ∈ MetaMathlibExt.ComplexityTheory.NP ∧
∀ L : MetaMathlibExt.ComplexityTheory.DecisionProblem,
L ∈ MetaMathlibExt.ComplexityTheory.NP →
Cslib.CookLevin.PolyManyOneRed L minimumTestSetDec
noncomputable def minimumTestSetDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := MinimumTestSetInstance) x with
| some i => decide (WellFormed i ∧ MinimumTestSetFeasible i)
| none => false
WantedExt/Complexity/NPComplete/MinimumTestSetWanted.lean:61
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
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
def PolyManyOneRed (L₁ L₂ : MetaMathlibExt.ComplexityTheory.DecisionProblem) : Prop :=
∃ reduce : List Bool → List Bool,
MetaMathlibExt.ComplexityTheory.IsPolyTime reduce ∧ ∀ x, L₁ x = L₂ (reduce x)
CSLibExt/Computability/CookLevin.lean:396
Sources
- M. R. Garey and D. S. Johnson, Computers and Intractability (1979), MINIMUM TEST COLLECTION; A. De Bonis, L. Gargano, and U. Vaccaro, "Generalized framework for test set problems" (1997).
Uses 5
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.