Documentation

Complexitylib.Classes.NP.Reduction

Polynomial-time many-one reductions and NP-completeness #

This file defines polynomial-time many-one (Karp) reductions L ≤ₚ L' and the derived notions NPHard and NPComplete, following Arora–Barak (Definitions 2.7, 2.8).

A reduction L ≤ₚ L' is a polynomial-time computable function f (i.e. f ∈ FP) such that x ∈ L ↔ f x ∈ L'. A language is NP-hard when every language in NP reduces to it, and NP-complete when it is additionally a member of NP.

The headline application is SAT.NPComplete_language (Cook–Levin), in Complexitylib/SAT/CookLevin.lean.

Polynomial-time many-one reduction. MapReducesPoly L L' (written L ≤ₚ L') holds when there is a polynomial-time computable function f (f ∈ FP) with x ∈ L ↔ f x ∈ L' for every input x.

Equations
Instances For

    Polynomial-time many-one reduction. MapReducesPoly L L' (written L ≤ₚ L') holds when there is a polynomial-time computable function f (f ∈ FP) with x ∈ L ↔ f x ∈ L' for every input x.

    Equations
    Instances For

      NP-hardness. L is NP-hard when every language in NP reduces to L in polynomial time.

      Equations
      Instances For

        NP-completeness. L is NP-complete when it is in NP and NP-hard.

        Equations
        Instances For