Documentation

CslibFrontier.Computability.Complexity.Problems.Copositivity

CoNP-Completeness of Matrix Copositivity #

Testing whether an encoded symmetric rational matrix M is copositive—meaning x ⬝ᵥ M *ᵥ x ≥ 0 for all entrywise nonnegative vectors x—is coNP-complete, and testing non-copositivity is NP-complete. The completeness statements are credited to [MK87] (secondary search summaries indicate that [MK87] proves hardness by reducing from subset sum rather than Clique; the published text was not inspected). This library's Clique/Motzkin–Straus reduction (polyTimeReducible_Clique_NonCopositive), the row-list representation SymRatMatrix, binary encoding encSymRatMatrix, denominator-cleared verifier NonCopositive.check, and the KKT/Cramer bounded integer witness derivation are original to this formalization.

By Matrix.exists_nat_dotProduct_lt_zero_of_rat, a symmetric rational matrix fails to be copositive if and only if it admits a polynomially bit-bounded nonnegative integer vector p with p ⬝ᵥ M *ᵥ p < 0. A polynomial-time verifier clears denominators by multiplying by the product D of entry denominators and evaluates p ⬝ᵥ M_int *ᵥ p < 0, placing NonCopositive in NP and Copositive in coNP. In the reverse direction, the Motzkin–Straus copositivity characterization (SimpleGraph.exists_nonneg_dotProduct_copositiveCliqueMatrix_lt_zero_iff) gives a polynomial-time many-one reduction from Clique to NonCopositive.

Main definitions #

Main results #

References #

Symmetric rational matrix encoding #

@[reducible, inline]

Binary encoding of a rational matrix row list.

A square symmetric rational matrix represented by its list of rows.

theorem Cslib.Complexity.SymRatMatrix.ext {M₁ M₂ : SymRatMatrix} (h : M₁.rows = M₂.rows) :
M₁ = M₂
theorem Cslib.Complexity.SymRatMatrix.ext_iff {M₁ M₂ : SymRatMatrix} :
M₁ = M₂ ↔ M₁.rows = M₂.rows

Binary encoding of symmetric rational matrices via their row lists.

@[reducible, inline]

Binary encoding of (M, p) pairs for NonCopositive verification.

Interpret a SymRatMatrix as an n × n Matrix over ℚ, where n = M.rows.length.

The language of symmetric rational matrices that are copositive.

The language of symmetric rational matrices that are not copositive.

Copositivity of a SymRatMatrix over ℚ coincides with copositivity over ℝ.

NP verifier for non-copositivity #

Common denominator for all entries of a rational matrix M: the product of its denominators.

Integerized matrix obtained by multiplying each entry of M by M.commonDenom.

Polynomial-time verifier relation for NonCopositive: p has length M.rows.length and p ⬝ᵥ M.intRows *ᵥ p < 0.

Reduction from Clique to NonCopositive #

Entry (u, v) of the reduction matrix for (G, k).

Row list produced by the reduction from a Clique instance (G, k) to a symmetric rational matrix. For k ≥ 2 on a graph with nonempty vertex list, this is the Motzkin–Straus matrix (k - 2) J - (k - 1) A_G.

Polynomial-time many-one reduction mapping a Clique instance (G, k) to a symmetric rational matrix M such that (G, k) ∈ Clique ↔ M ∈ NonCopositive.

NonCopositive is NP-hard (proved here via Clique and Motzkin–Straus; [MK87] establishes completeness in the literature, reported via subset sum).

NonCopositive is NP-complete (completeness statement credited to [MK87]; library proof combines bounded integer witness verification with Clique/Motzkin–Straus).

Copositive is coNP-hard (proved here via Clique and Motzkin–Straus).

Copositive is coNP-complete (completeness statement credited to [MK87]; library proof uses NonCopositive membership and the Clique/Motzkin–Straus reduction).