clause splitting with a fresh variable

SAT ≤p 3SAT

SAT≤p3SAT\mathrm{SAT}\le_p\mathrm{3SAT}, hence 3SAT\mathrm{3SAT} is NP-complete.

The construction

The splitting step (Algorithm 1). On a CNF formula φ\varphi:

  1. If φ\varphi is already 3CNF — return it.
  2. Otherwise let C=ℓ1∨ℓ2∨⋯∨ℓkC=\ell_1\vee\ell_2\vee\dots\vee\ell_k be the first clause with k>3k>3 literals. Define C′=ℓ1∨ℓ2∨z,C′′=ℓ3∨⋯∨ℓk∨zˉ,C'=\ell_1\vee\ell_2\vee z,\qquad C''=\ell_3\vee\dots\vee\ell_k\vee\bar z, where zz is a fresh variable not occurring in φ\varphi.
  3. Return φ^\hat\varphi, obtained from φ\varphi by replacing CC with C′∧C′′C'\wedge C''.

The reduction. While φ\varphi is not 3CNF, run the splitting step, choosing a new auxiliary variable each time; finally return φ\varphi. An input that is not a valid CNF encoding is replaced by a fixed unsatisfiable 3CNF formula, e.g. (y)∧(yˉ)(y)\wedge(\bar y).

Termination. A clause of length k>3k>3 is replaced by clauses of lengths 33 and k−1k-1, and clauses of length ≤3\le3 never change. So the quantity ∑∣C∣>3(∣C∣−3)\sum_{|C|>3}(|C|-3) drops by exactly 11 per iteration and is a non-negative integer — the loop halts, and in the output every clause has length ≤3\le3.

Visualization

Guided construction

SAT → 3SAT

Step 1 of 6
Source clause(a ∨ b ∨ c ∨ d ∨ e)
SAT to 3SAT by clause splittingA five-literal clause is replaced by three overlapping triples linked by two fresh variables.Source clause
Fresh variableOutput triple

Correctness — both directions

SAT ∈ ⟹ 3SAT ∈

It suffices to prove the single-step lemma — φ\varphi satisfiable   ⟺  \iff φ^\hat\varphi satisfiable — and then chain it by induction.

Suppose φ\varphi is satisfiable, with satisfying assignment vv. In particular vv satisfies C=ℓ1∨⋯∨ℓkC=\ell_1\vee\dots\vee\ell_k, so some tt has v(ℓt)=1v(\ell_t)=1. Extend vv to zz:

  • if t∈{1,2}t\in\{1,2\} — set v(z)=0v(z)=0. Then C′=ℓ1∨ℓ2∨zC'=\ell_1\vee\ell_2\vee z is satisfied by ℓt\ell_t, and C′′C'' is satisfied by zˉ\bar z.
  • otherwise t≥3t\ge3 — set v(z)=1v(z)=1. Then C′C' is satisfied by zz, and C′′C'' by ℓt\ell_t.

The other clauses are unchanged and do not contain zz, so they stay satisfied. Hence φ^\hat\varphi is satisfiable.

3SAT ∈ ⟹ SAT ∈

Suppose φ^\hat\varphi is satisfiable, with satisfying assignment vv. Restrict vv to the variables of φ\varphi (forget the value it gave zz) and check that it satisfies φ\varphi.

Every clause of φ\varphi other than CC appears unchanged in φ^\hat\varphi and does not contain zz, so it is satisfied. That leaves CC. Split on v(z)v(z):

  • if v(z)=1v(z)=1: the clause C′′=ℓ3∨⋯∨ℓk∨zˉC''=\ell_3\vee\dots\vee\ell_k\vee\bar z is satisfied while zˉ\bar z evaluates to 00, so some t≥3t\ge3 has v(ℓt)=1v(\ell_t)=1. That literal occurs in CC, so CC is satisfied.
  • if v(z)=0v(z)=0: the clause C′=ℓ1∨ℓ2∨zC'=\ell_1\vee\ell_2\vee z is satisfied while zz evaluates to 00, so v(ℓ1)=1v(\ell_1)=1 or v(ℓ2)=1v(\ell_2)=1. Again a literal of CC, so CC is satisfied.

Either way vv satisfies CC, hence all of φ\varphi.

Since the lemma holds at every step, induction along φ0=φ,φ1,…,φm\varphi_0=\varphi,\varphi_1,\dots,\varphi_m (the output) gives φ\varphi satisfiable   ⟺  \iff φm\varphi_m satisfiable — that is, ⟨φ⟩∈SAT  ⟺  ⟨φm⟩∈3SAT\langle\varphi\rangle\in\mathrm{SAT}\iff\langle\varphi_m\rangle\in\mathrm{3SAT}.

Cost of the reduction

TimeO(|φ|²)
SpaceO(|φ|)
Output sizeO(|φ|) symbols, O(|φ| log |φ|) bits

The number of iterations is exactly ∑∣C∣>3(∣C∣−3)≤L≤∣φ∣\sum_{|C|>3}(|C|-3)\le L\le|\varphi|, where LL counts literal occurrences. Each iteration adds exactly 22 literal occurrences, so Lfinal≤L+2L=3LL_{\text{final}}\le L+2L=3L — the formula does not blow up, it stays linear. A single iteration costs O(∣φ∣)O(|\varphi|) (scan and copy), for O(∣φ∣2)O(|\varphi|^2) overall.

At the bit level: the reduction adds up to LL new variables and an index costs O(log⁡L)O(\log L) bits, so the output is O(∣φ∣log⁡∣φ∣)O(|\varphi|\log|\varphi|) bits — still polynomial.

What it buys

With Cook–Levin (SAT\mathrm{SAT} is NP-hard) and transitivity of ≤p\le_p: every A∈NPA\in\mathrm{NP} satisfies A≤pSAT≤p3SATA\le_p\mathrm{SAT}\le_p\mathrm{3SAT}, so 3SAT\mathrm{3SAT} is NP-complete. From here on nearly every reduction in the course starts at 3SAT\mathrm{3SAT} rather than SAT\mathrm{SAT} — the rigid three-literals-per-clause shape is far easier to copy into graphs and sets.

Pitfalls

  • C′∧C′′C'\wedge C'' is not equivalent to CC. It is only equisatisfiable: a satisfying vv for CC extends to zz so as to satisfy both, and conversely. Logical equivalence fails — an assignment giving 11 to ℓ1\ell_1 and 11 to zz satisfies CC but not C′∧C′′C'\wedge C''.

  • zz must be fresh at every iteration. Reusing the same zz ties two different clauses through one variable, and extending the assignment in the forward direction may then demand z=0z=0 and z=1z=1 at once.

  • Do not split CC by distributivity. Turning a long CNF into a logically equivalent 3CNF blows the formula up exponentially. The auxiliary variable buys linear size at exactly the price of dropping logical equivalence.

The chain

Where this was read from

  • Lesson 8משפט 6: SAT≤p3SAT\mathrm{SAT} \le_p \mathrm{3SAT}
  • Guided exercisesat-to-3sat-clause-splitting
  • 2024 '1 מועד 1One clause of 6 literals — how many literals and how many variables the output holds.