# Statement
> [!important] Lemma
> [[k-satisfiability problem (k-SAT problem)|3-SAT]] is [[NP-Complete|NP-complete]].
# Proof
We already know [[k-satisfiability problem (k-SAT problem)|3-SAT]] is in [[Nondeterministic Polynomial time (NP)|NP]], as shown in [[k-SAT is in NP]].
So, we need to demonstrate that [[k-satisfiability problem (k-SAT problem)|3-SAT]] is [[NP-hard]]. This will be done by establishing a [[Many-one reduction (problem)|many-one reduction]] to the [[Satisfiability problem (SAT problem)|SAT problem]], which is [[NP-Complete|NP-complete]] (see [[SAT is NP-complete]]). Specifically, we will show the following:
A [[Satisfiability problem (SAT problem)|SAT problem]] instance can be transformed into a [[k-satisfiability problem (k-SAT problem)|3-SAT]] problem instance in polynomial time.
The solution to the [[k-satisfiability problem (k-SAT problem)|3-SAT]] problem can be used to solve the [[Satisfiability problem (SAT problem)|SAT problem]].
A solution for the [[k-satisfiability problem (k-SAT problem)|3-SAT]] problem exists if and only if a solution for the [[Satisfiability problem (SAT problem)|SAT problem]] exists.
Let $f$ be a [[Conjunctive normal form (CNF)|CNF]] formula using $n$ variables with $m$ clauses. Our goal is to construct $f'$, a [[Conjunctive normal form (CNF)|CNF]] formula that falls under [[k-satisfiability problem (k-SAT problem)|3-SAT]].
For each clause $C$ in $f$, we proceed as follows:
If the clause contains 3 or fewer literals, we keep the formula unchanged, letting $C' = C$.
Otherwise, we apply [[3-SAT is NP-complete#Clause reduction|clause reduction]] to obtain $C'$.
Then, we add $C'$ to $f'$.
Since every clause in $f'$ has at most 3 literals, $f'$ belongs to [[k-satisfiability problem (k-SAT problem)|3-SAT]].
The [[3-SAT is NP-complete#Clause reduction|clause reduction]] process takes $O(n)$ time, as each clause can be at most $n$ literals long. Applying [[3-SAT is NP-complete#Clause reduction|clause reduction]] up to $m$ times, the reduction is done in $O(nm)$, a polynomial time.
We then solve $f'$ using [[k-satisfiability problem (k-SAT problem)|3-SAT]]. If no solution is found, we conclude the same for the original; otherwise, we use the solution for the original $n$ variables. This step takes $O(1)$ time.
From [[3-SAT is NP-complete#Claim 1|Claim 1]], each clause $C$ of $f$ is satisfiable if and only if its [[3-SAT is NP-complete#Clause reduction|clause reduction]] $C'$ is satisfiable. Therefore, since $f'$ consists of [[3-SAT is NP-complete#Clause reduction|clause reductions]] of $f