Today I attempt to prove that P ⊆ co-NP.
----------------------------------------------------------------------
SOLUTION:
Let's start by remembering that a language L ∈ P iff "There exists an algorithm A that decides L in polynomial-time"
------------------------
Also remember that a language L is decided by an algorithm A if:
( x ∈ L -> A(x) = 1 && x ∉ L -> A(x) = 0)
meaning if for every x in the language L the algorithm A evaluates to 1 when applied to x, and for every x not in L the algorithm A evaluates to 0 when applied to x.
------------------------
A language is decided in polynomial time if there exists an algorithm A that decides the language in polynomial-time.
Hence, for any language L such that L ∈ P, there exists a polynomial-time algorithm A such that ( x ∈ L -> A(x) = 1 && x ∉ L -> A(x) = 0).
From that, I derive that for any language L such that L ∈ P and an algorithm A that decides L in polynomial-time, there is an algorithm A' defined as:
A'(x) = 1 if A(x) = 0
and
A'(x) = 0 if A(x) = 1
such that A' decides the language compL which is the complement of L.
------------------------
Also observe that if L ∈ P then L ∈ NP because if there is an algorithm A that decides L in polynomial-time, it is easy to convert A into a two argument verification algorithm V(x,y) that simply ignores any certificate y and verifies L in polynomial-time by returning A(x).
-------------------------
"co-NP is the set of languages L such that compL ∈ NP."
Since for any language L ∈ P, there is a polynomial-time algorithm A that decides L, and a verification algorithm V as V(x,y) = A(x) that verifies L in polynomial time, then we can say that for any language L ∈ P, we have a polynomial-time two-argument algorithm V as
V(x,y) = 1 if A(x) = 0
and
V(x,y) = 0 if A(x) = 1
that verifies compL.
Hence compL ∈ NP for every L ∈ P, which proves that P ⊆ co-NP because the complement of each language in P is verifiable in polynomial-time.
QED?
No comments:
Post a Comment