Draft — mutable and not usable as a dependency; its citation marks the draft state.

Lax434930.NondeterministicPolynomialTime

The complexity class NP

concepts/Lax434930/NondeterministicPolynomialTime.lean · lax-434930

definition

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Concept map

    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A

    Definition

    A binary language AA belongs to NP\mathrm{NP} if there are a verifier language VPV\in\mathrm{P} and a polynomial pN[X]p\in\mathbb{N}[X] such that xAx\in A precisely when some binary certificate yy with yp(x)|y|\le p(|x|) satisfies x,yV\langle x,y\rangle\in V. The verifier is a single deterministic polynomial-time decider on the explicit pair encoding, and its running time is polynomial in the combined input and certificate lengths. The certificate bound depends only on the original input length. This is the standard certificate definition of NP.

    Lean source view on GitHub

    1import Lax434930.Certificates
    2
    3/-!
    4---
    5title: The complexity class NP
    6type: definition
    7---
    8A binary language AA belongs to NP\mathrm{NP} if there are a verifier
    9language VPV\in\mathrm{P} and a polynomial pN[X]p\in\mathbb{N}[X] such that
    10xAx\in A precisely when some binary certificate yy with yp(x)|y|\le p(|x|)
    11satisfies x,yV\langle x,y\rangle\in V.
    12The verifier is a single deterministic polynomial-time decider on the
    13explicit pair encoding, and its running time is polynomial in the combined
    14input and certificate lengths. The certificate bound depends only on the
    15original input length. This is the standard certificate definition of NP.
    16-/
    17
    18namespace Lax434930.NondeterministicPolynomialTime
    19
    20open PolynomialTime Certificates
    21
    22/-- Languages with polynomially bounded, polynomial-time verifiable certificates. -/
    23def NP : Set Language :=
    24 {A | ∃ V : Language, V ∈ P ∧ ∃ p : Polynomial ℕ, ∀ x : Word,
    25 x ∈ A ↔ ∃ y : Word, y.length ≤ p.eval x.length ∧ pair x y ∈ V}
    26
    27end Lax434930.NondeterministicPolynomialTime
    28

    From Mathlib

    none

    Community review

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above; your ORCID profile must share a public name.

    0 comments

    Loading discussion…