How statement and proof provenance work
The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.
- Literature-sourced: the exact statement appears in a cited source; only wording and notation differ.
- AI-adapted: a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
- AI-generated: a genuinely novel statement formulated by AI, with no source for the claim itself.
These labels describe origin, not correctness: citations and verification chips remain separate evidence.
P, NP, coNP, and Polynomial Reductions
1 · Prerequisites
- Construction of the Natural Numbers
- Countability and Uncountability
- Finite Counting, Factorials and Binomial Coefficients
- Formal Languages, Encodings, and Decision Problems
- Linear Recurrences and Rational Generating Functions
- Relations, Functions, and Quotients
- Resource Bounds and Machine Invariance
- The ZFC Axioms and the Basic Set Constructions
- Turing Machines, Configurations, and Computation
2 · Summary
This page fixes the basic complexity classes and the reduction language that later completeness proofs rely on. It defines , the verifier form of , and , proves that the verifier and nondeterministic formulations of agree, and then isolates polynomial-time many-one reductions as the comparison tool that transfers class membership backward along efficient encodings.
The second half turns that framework into the standard complexity consequences: the meaning of NP-hardness and NP-completeness, the consequence that an NP-complete language in would collapse and , the self-reducibility of SAT at the search-versus-decision level, and the elementary containment picture . The two false statements close by separating the class names from common slogans that overclaim what is actually proved.
3 · Logical flowchart
4 · Definitions, theorems and proofs
The class P
Definition
The class P is
Thus a language belongs to exactly when some deterministic Turing machine decides it in time bounded by a polynomial in the input length.
Remarks
-
The exponent may depend on the language, but it is fixed for the chosen decider.
-
On this page, the underlying machine model is the deterministic multitape model from The classes DTIME, NTIME, DSPACE, and NSPACE.
Polynomial-time verifiers with polynomially bounded certificates
Definition
Fix the binary pairing for binary words . Let be a language. A polynomial-time verifier with polynomially bounded certificates for consists of:
- a binary relation whose paired language belongs to , and
- a polynomial such that
Any such is called a certificate or witness for .
Remarks
-
The verifier checks a paired instance in polynomial time, while the polynomial bounds how long a successful certificate ever needs to be.
-
Allowing the empty certificate is legitimate; that corresponds to the case .
The class NP via polynomial-time verifiers
Definition
The class NP is the set of languages that admit a polynomial-time verifier with polynomially bounded certificates in the sense of Polynomial-time verifiers with polynomially bounded certificates.
Remarks
-
This is the verifier definition of NP. The equivalent nondeterministic machine definition is proved next.
-
Every statement on this page about complements of NP-languages is taken inside the same ambient space .
The verifier and nondeterministic definitions of NP agree
Statement
For a language , the following are equivalent:
- in the verifier sense of The class NP via polynomial-time verifiers.
- There exists such that .
Facts & Assumptions
Given: A language .
means that has a polynomial-time verifier with polynomially bounded certificates, by The class NP via polynomial-time verifiers.
means that some nondeterministic Turing machine accepts exactly the words of and every branch halts within steps, by The classes DTIME, NTIME, DSPACE, and NSPACE.
A machine that fully reads every input of length needs at least linear time, by Any machine that fully reads every input of length n needs at least linear time.
Proof
Assume item 1. By [L1], choose a verifier relation and a polynomial certificate bound . Let be a deterministic polynomial-time decider for the paired language . Build a nondeterministic machine that, on input , first guesses a binary word of length at most and then runs on , accepting exactly when accepts. Because every branch chooses at most guessed bits and then performs one polynomial-time deterministic verification, every branch halts within polynomial time. Since exactly when some certificate makes , the machine accepts exactly the words of . Thus item 2 holds.
Assume item 2. By [L2], fix a nondeterministic machine and an exponent such that every branch on inputs of length halts within steps for some constant . Let be the maximum number of available nondeterministic choices in any one local configuration of , and choose an integer with . An accepting branch is then determined by a finite sequence of at most choice numbers from . Encode that sequence as the binary word where each is the -bit binary expansion of . The initial unary header recovers , and then the decoder reads exactly consecutive blocks of length , so this branch description is effectively decodable.
Define a deterministic verifier for as follows. On input , first decode by reading its unary header and then the declared number of -bit choice blocks; reject malformed encodings. Next simulate on while forcing those choices in order, reject if the certificate requests a nonexistent choice or ends before acceptance, and accept exactly when the forced run ends in an accepting state after consuming the full encoded branch description. Step 1.2 guarantees that yields some accepting-branch certificate, and any accepting certificate describes a genuine accepting branch. The certificate length is polynomial in because it has one unary header bit per simulated choice and each choice uses the fixed block length , with at most choices. The verifier runtime is therefore polynomial in because it only decodes and replays that many steps of . Therefore item 1 holds by [L1].
Steps 1.1 and 2.1 prove both directions, so the verifier and nondeterministic definitions of NP agree. The lower bound in [L3] is compatible with these polynomial bounds: reading the whole input and certificate is already only linear in their lengths.
The class coNP
Definition
The class coNP is
Remarks
-
The complement is taken inside the same ambient language space .
-
Saying that is therefore equivalent to saying that nonmembership in has polynomially checkable certificates.
Statement
Every language in belongs to both and .
Facts & Assumptions
Given: A language in .
means that some deterministic Turing machine decides in polynomial time, by The class P.
means that has a polynomial-time verifier with polynomially bounded certificates, by The class NP via polynomial-time verifiers and Polynomial-time verifiers with polynomially bounded certificates.
means that the complement of belongs to , by The class coNP.
Proof
By [L1], choose a polynomial-time decider for . Use the empty certificate and define the verifier relation by exactly when accepts , with no other certificates allowed. Then the paired language for is decidable in polynomial time by running on the first component and checking that the second component is empty. Thus [L2] gives .
Swap the accepting and rejecting halting states of to obtain a polynomial-time decider for the complement . Repeating step 1.1 with the same empty-certificate idea shows that the complement belongs to . Therefore [L3] gives .
Steps 1.1 and 2.1 show that every language in lies in .
Polynomial-time many-one reductions
Definition
Let and be languages over finite alphabets. A polynomial-time many-one reduction from to is a total function such that:
- is computable by a deterministic Turing machine in polynomial time, and
- for every ,
When such an exists, write
Remarks
-
"Many-one" means that the source instance is transformed once into a single target instance.
-
This is not the same notion as an oracle or Turing reduction, where later queries may depend on earlier answers.
Polynomial-time many-one reductions compose
Statement
If and , then .
Facts & Assumptions
Given: Languages with witnessed by a total map and witnessed by a total map , in the sense of Polynomial-time many-one reductions.
A polynomial-time many-one reduction is a total polynomial-time function preserving membership in both directions, by Polynomial-time many-one reductions.
Proof
Define . Because both and are total by [L1], the composite is also total.
For every source word , [L1] gives . So .
The function runs in polynomial time and can output only polynomially many symbols, so the length of is polynomially bounded in . Running on that output therefore still takes polynomial time in . Hence is a polynomial-time many-one reduction from to .
Polynomial-time many-one reductions transfer P-, NP-, and coNP-membership
Statement
Let and suppose that .
- If , then .
- If , then .
- If , then .
Facts & Assumptions
Given: Binary languages and a fixed total polynomial-time map witnessing .
A polynomial-time many-one reduction is a total polynomial-time membership-preserving map, by Polynomial-time many-one reductions.
Composites of polynomial-time many-one reductions are again polynomial-time many-one reductions, by Polynomial-time many-one reductions compose.
is the class of polynomial-time decidable languages, by The class P.
is the class of languages with polynomial-time verifiers and polynomially bounded certificates, by The class NP via polynomial-time verifiers and Polynomial-time verifiers with polynomially bounded certificates.
consists of complements of NP-languages, by The class coNP.
Proof
Assume , and let be a polynomial-time decider for from [L3]. On input , compute the fixed map and then run on that output. By [L1], the answer is correct because iff , and the whole procedure is polynomial-time because both stages are. Thus .
Assume . By [L4], choose a verifier relation and polynomial certificate bound for . Using the fixed reduction map , define a verifier for by declaring that is accepted exactly when . The output length is polynomial in , so the bound is still polynomial in . Correctness follows from . Therefore .
Assume . Then by [L5]. The fixed reduction map also witnesses , because . Applying step 1.2 to the reduction gives , and then [L5] yields . The composition principle [L2] guarantees that chaining such transfers remains inside the same reduction class.
Steps 1.1, 1.2, and 2.1 prove the three transfer clauses.
NP-hard and NP-complete languages
Definition
Let be a language.
- is NP-hard when for every language one has .
- is NP-complete when is NP-hard and .
Remarks
-
NP-hardness is a lower-bound comparison class, not a membership class.
-
NP-completeness depends on the chosen reduction notion; on this page that notion is many-one polynomial-time reducibility.
An NP-complete language in P forces
Statement
If some NP-complete language belongs to , then .
Facts & Assumptions
Given: An NP-complete language with .
NP-complete means both and every language in reduces to in polynomial time, by NP-hard and NP-complete languages.
Polynomial-time many-one reductions transfer -membership backward: if and , then , by Polynomial-time many-one reductions transfer P-, NP-, and coNP-membership.
Proof
Let be arbitrary. By [L1], because is NP-hard, there is a polynomial-time many-one reduction . Then [L2] and the hypothesis give .
Step 1.1 shows . By [L3], every language in also lies in , so . Therefore .
The search problem attached to an NP verifier
Definition
Let be a language in , witnessed by a verifier relation and a polynomial certificate bound as in Polynomial-time verifiers with polynomially bounded certificates. The search problem attached to is:
- input: a word ,
- output: any certificate such that and .
Equivalently, it asks not merely whether a witness exists, but to produce one.
Remarks
-
On inputs , no valid certificate exists, so the search problem has no required output there.
-
The output need not be unique; any witnessing certificate is acceptable.
SAT search polynomial-time Turing reduces to SAT decision
Statement
Let be the language of satisfiable Boolean formulas over finitely many variables, and let the associated search problem ask for a satisfying assignment of a satisfiable formula. Then there is a deterministic polynomial-time oracle algorithm that solves the search problem using queries to the decision language .
Facts & Assumptions
Given: A satisfiable Boolean formula and oracle access to the decision language .
The search version of an NP verifier asks for an explicit witness, not merely a yes/no answer, by The search problem attached to an NP verifier.
Polynomially bounded witnesses are the relevant certificate regime on this page, by Polynomial-time verifiers with polynomially bounded certificates.
Proof
Query the oracle on itself. If the answer is "no", halt and report that no satisfying assignment exists. If the answer is "yes", initialize the current residual formula to .
For , form the two residual formulas obtained from by substituting and . Query the oracle on the first one. If it is satisfiable, record and set equal to that first residual formula. Otherwise record and set equal to the second residual formula. At least one branch is satisfiable, because any satisfying assignment of gives one of the two values to .
By induction on , the maintained residual formula is satisfiable and is obtained from by fixing the first variables to the recorded values. After the final stage, every variable has been assigned, so the recorded bits form a satisfying assignment for . This is exactly the witness demanded in [L1].
The algorithm makes at most oracle calls, and each intermediate substitution and formula rewrite is polynomial in . Since the satisfying assignment itself has length , this stays within the polynomial witness regime of [L2]. Therefore SAT search polynomial-time Turing reduces to SAT decision.
The classes EXP and NEXP
Definition
The exponential-time classes are
Remarks
-
The exponent is fixed per language, just as in the definition of and .
-
The point is asymptotic growth: exponential time allows bounds of the form up to the usual multiplicative constants hidden in the class notation.
Statement
Let Then
Facts & Assumptions
Given: The classes , , and .
A language in has a polynomial-time verifier with polynomially bounded certificates, by The class NP via polynomial-time verifiers.
The class notation DSPACE records deterministic polynomial-space deciders, and DTIME records deterministic time-bounded deciders, by The classes DTIME, NTIME, DSPACE, and NSPACE.
Worst-case space counts visited tape cells and worst-case time counts executed steps, by Worst-case time and space complexity of a machine.
EXP is the union of the classes , by The classes EXP and NEXP.
A configuration records a machine state, head positions, and finite tape data, and tape contents have finite support, by Configurations of a deterministic one-tape Turing machine and Right-infinite tapes as finite-support functions.
Proof
To prove , let . By [L1], choose a verifier for with runtime bounded by a polynomial and certificate length bounded by a polynomial . A deterministic decider for can enumerate all certificates of length at most in lexicographic order, run the verifier on , and accept as soon as one certificate succeeds. It stores only the input , the current certificate , and the verifier workspace, so the total space used is polynomial in . Hence by [L2] and [L3].
To prove , let . Then by definition there exists and a deterministic machine deciding while using at most tape cells on inputs of length , for some constant . Fix such an input length . Because of [L5], a configuration of is determined by one of finitely many states, the head positions on the finitely many tapes, and the contents of at most visited cells. Therefore the total number of possible configurations is at most for a constant depending only on the fixed number of tapes.
Since is deterministic and halts on every input, it cannot visit the same configuration twice on one accepting or rejecting run: a repeated configuration would force an infinite loop from that point onward. So the running time on inputs of length is bounded by the number of reachable configurations from step 1.2, hence by . Enlarging the exponent if necessary, there exists with for all sufficiently large . Therefore by [L2] and [L4].
Steps 1.1 and 2.1 prove .
5 · Examples, counterexamples and false statements
FALSE: NP means not polynomial-time solvable
Statement
NP means "not polynomial-time solvable."
Facts & Assumptions
Given: The classes and .
NP is a language class defined by polynomially checkable certificates, by The class NP via polynomial-time verifiers.
Refutation
By [L1], any language already known to be in is automatically also in .
Step 1.1 contradicts the slogan in the statement: a polynomial-time solvable language can still belong to . By [L2], NP is about efficiently verifiable yes-certificates, not about being known outside polynomial time.
FALSE: NP-complete means proven not to lie in P
Statement
If a language is NP-complete, then it has already been proved not to belong to .
Facts & Assumptions
Given: An NP-complete language .
NP-complete means that lies in and every NP-language reduces to it, by NP-hard and NP-complete languages.
If an NP-complete language lies in , then , by An NP-complete language in P forces .
The question whether remains unsolved; the Clay Mathematics Institute lists P versus NP as an unsolved Millennium Prize Problem.
Refutation
The definition quoted in [L1] contains no clause asserting . It says only that is in and is hard for under the chosen reductions.
If had already been proved, then [L1] would give a language in and hence prove . But [F1] records that this question remains unsolved. Conversely, [L2] says that finding would prove . Thus NP-completeness does not mean that exclusion from has already been proved; it identifies the consequence either kind of resolution would have.
Sources
- Michael Sipser, MIT 18.404J Theory of Computation, Lecture 14: P and NP, SAT, Poly-time Reducibility
- Sanjeev Arora and Boaz Barak, Computational Complexity: A Modern Approach
- Stephen A. Cook, The Complexity of Theorem-Proving Procedures
- Michael Sipser, MIT 18.404J Theory of Computation, Lecture 17: Space Complexity, PSPACE, Savitch's Theorem
- P32: SAT self-reducibility
- Clay Mathematics Institute, P vs NP