1 · Theory
For a specific NP language (HAMPATH), walk through the four clause families that build φx.
Four clause families
φcell: each cell has exactly one symbol/state.
φstart: row 0 = start config on (G, π).
φaccept: some row contains qaccept.
φmove: every 2×3 window matches δ.
2 · Animated demo · auto-plays · loops
3 · Pitfalls
- The four families are not independent. Each constrains different aspects; the conjunction is the whole formula. Missing one breaks correctness.
- φcell uses both "at least one" and "at most one" clauses. The disjunction says the cell has some symbol; the pairwise-not-both clauses prevent multiple symbols at once.
- Variables are indexed by (row, col, symbol). O(nk) rows × O(nk) cols × O(1) symbols = O(n2k) variables.
4 · Q&A defence notes
Q1. Why is φcell needed?
Without it, SAT variables could "claim" a cell holds multiple symbols simultaneously, which is meaningless as a TM tape state. φcell enforces exactly-one-symbol per cell.
Q2. How big is the formula?
O(n2k) clauses for a TM running in time nk. Polynomial in input size.
Q3. Why is this a polynomial reduction?
The formula is constructed by a procedure whose running time is polynomial in |x|. So if SAT were in P, every NP language would be too — proving SAT is NP-complete.
Q4. How does the 2×3 window encode the transition?
The window has 2 rows (consecutive configurations) and 3 columns (the head's cell plus neighbours). For each transition δ in M, the legal 2×3 patterns are enumerated; φmove says every window matches one of them.
5 · Where to read more
Sipser: Theorem 7.37 (Cook–Levin). Lecture notes: Module 5 slide 3. Companion problems: P25 (Cook-Levin tableau), P22 (SAT).