# Proof that 4 SAT is NP complete

** 4-SAT Problem:** 4-SAT is a generalization of 3-SAT(k-SAT is SAT where each clause has k or fewer literals).

** Problem Statement:** Given a formula

*in Conjunctive Normal Form(CNF) composed of clauses, each of four literals, the problem is to identify whether there is a satisfying assignment for the formula*

**f***.*

**f**** Explanation:** An instance of the problem is an input specified to the problem. An instance of the 4-SAT problem is a CNF formula, and the task is to check whether there is a satisfying assignment for the formula. Since an NP-Complete is a problem which is both in

**NP**and

**NP-hard**, the proof for the statement that a problem is NP-Complete consists of two parts:

- The problem itself is in NP class.
- All other problems in NP class can be polynomial-time reducible to that.

(B is polynomial-time reducible to C is denoted as B ≤ P^{C})

If the 2nd condition is only satisfied then the problem is called **NP-Hard**.

But it is not possible to reduce every NP problem into another NP problem to show its NP-Completeness all the time. That is why if we want to show a problem is NP-Complete we just show that the problem is in NP and any NP-Complete problem is reducible to that then we are done, i.e., if B is NP-Complete and B ≤ ^{C}. For C in NP, then C is NP-Complete. Thus, it can be verified that the **4-SAT Problem** is NP-Complete using the following two propositions:

__4-SAT problem is in NP__:

If any problem is in NP, then, given a ‘certificate’, which is a solution to the problem and an instance of the problem(a formula, in this case), it can be verified(check whether the solution given is correct or not) that the certificate in polynomial time. This can be done in the following way:**f**

Given an assignment for the variables belonging to the formula, the assignment can be verified in linear time, if it satisfies the formula or not.**f**__4-SAT problem is NP-Hard__:

In order to prove that the 4-SAT problem is NP-Hard, deduce a reduction from a known NP-Hard problem to this problem. Deduce a reduction from which the 3-SAT problem can be reduced to the 4-SAT problem. For each clause of the**3-SAT**formula, for example, a literal**f****a**and its corresponding complement**a’**should be added to the formula. Let there be a clause**c**, such that**c = u V v’ V w**

To convert it in 4-SAT, we convert**c**to**c’**, such that,**c’ = (u V v’ V w V a) AND (u V v’ V w V a’)**.

After simulating this conversion, two properties hold :- If 3-SAT has a satisfiable assignment, which means, every clause evaluates to true for a specific set of literal values, then 4-SAT will also hold, because each clause-set is formed by a combination of a literal and its complement, whose value won’t make any difference.
- If 4-SAT is satisfiable for any
**(u V v V w V a)**and**(u V v V w V a’)**, then 3-SAT is also satisfiable because**a**and**a’**are complement, which indicates that the formula is satisfiable due to some other literal except a too.

Therefore, following the above propositions, the 4-SAT problem is **NP-Complete**.

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the **DSA Self Paced Course** at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer **Complete Interview Preparation Course****.**

In case you wish to attend **live classes **with experts, please refer **DSA Live Classes for Working Professionals **and **Competitive Programming Live for Students**.