# Proof: adding one column to a binary strength-three array is NP-complete

Sonny. 

This file holds the full argument. The definitions are repeated so that the file can be read on its own. Every lemma is numbered; each proof uses only the definitions and the lemmas before it.

## 1. Definitions

**Array.** A binary array is a list of N rows, each a word of length k over {0,1}. Rows may repeat. Columns are numbered or named; their order does not matter.

**Strength three.** The array has strength three if, for every three distinct columns, each of the eight words 000, 001, ..., 111 appears on those columns in at least one row.

**Extension.** The array *extends* if one more binary column can be appended to it, without adding or changing rows, so that the result still has strength three.

**Full pair class.** For two distinct columns c, d and bits x, y, the full pair class E(c,d;x,y) is the set of rows with x in column c and y in column d. A proposed new column t is read as a colouring of the rows with the colours 0 and 1; t *splits* a set of rows if it gives that set both colours.

**The source problem.** A source is a finite list of clauses, each a set of exactly three distinct variables. It is *satisfiable* if some assignment of 0 or 1 to the variables gives every clause both values. This is positive not-all-equal 3-satisfiability, the same as two-colouring 3-uniform hypergraphs. It is NP-complete (Lovász 1973; Schaefer 1978; references in CREDITS.md of the book).

## 2. The construction

Given a source, the output array is built as follows.

**Fixed outputs.** If some clause does not consist of exactly three distinct variables, output the *odd-parity array*: the eight words of length 4 with an odd number of ones. If there are no clauses, output the *cube*: all eight words of length 3. Otherwise remove repeated clauses, leaving distinct clauses C_1, ..., C_m with m at least 1, over the set V of variables that occur in them.

**Columns.** k = 4m + 2 columns, split into two sides of 2m + 1 columns each:

- side A: a0, and e_j, e'_j for j = 1, ..., m;
- side B: b0, and f_j, f'_j for j = 1, ..., m.

Clause j *owns* the four columns e_j, e'_j, f_j, f'_j. No clause owns a0 or b0. Every other column is owned by exactly one clause.

**Designated pairs.** These 6m + 1 unordered pairs of columns:

- the *Z-pair* {f_j, f'_j} and the *O-pair* {e_j, e'_j}, for each clause j;
- the *link pairs* {e, b0} for every column e of side A (a0 included), and {a0, f} for every column f of side B other than b0.

**Source rows.**

- One *hub row* h_g for every column g: h_g has 1 in column c exactly when c is on the same side as g and c differs from g; every other entry is 0.
- One *variable row* x_v for every v in V: x_v has 0 in column c exactly when c is owned by a clause containing v; every other entry is 1.

**Padding rows.** For every set Y of at most three columns that contains no designated pair, the row p_Y with 0 exactly on Y and 1 elsewhere, written **twice**.

Everything is written out in full. No assignment of the source is used.

Write H_A for the hub rows h_g with g on side A, and H_B for those with g on side B.

## 3. Lemmas

**Lemma 1 (the pair-class test).** A new column t keeps strength three if and only if t splits every full pair class. (This criterion is known: Kokkala, doctoral thesis 2017, section 3.5, and Hiess, master's thesis 2024. We claim no priority for it.)

*Proof.* Triples of old columns are unchanged by appending t. A triple made of two old columns c, d and the new column needs every word x y z on (c, d, t), which says exactly that, for every x and y, the rows of E(c,d;x,y) include one with t = 0 and one with t = 1. ∎

**Lemma 2 (fixed outputs).** The cube has strength three and extends. The odd-parity array has strength three and does not extend.

*Proof.* The cube contains every word of length 3. Append the parity of the three columns: on any two old columns with values x, y, the third old column takes both values, so the new column takes both values, and Lemma 1 applies. In the odd-parity array, fixing any three columns determines the fourth by parity, so each word on three columns occurs exactly once. Its classes E(1,2;0,0) = {0001, 0010}, E(1,3;0,0) = {0001, 0100} and E(1,4;0,0) = {0010, 0100} are three two-row sets on three rows, each pair of which must receive different colours. Three rows cannot be pairwise different in two colours, so by Lemma 1 it does not extend. ∎

For the rest of this section the source has m ≥ 1 distinct clauses. For a designated pair {c, d}, let K_cd be the set of source rows that are 0 in both c and d.

**Lemma 3 (the designated classes).**

1. For the Z-pair of clause j, K = Z_j = {x_v : v in C_j} together with H_A.
2. For the O-pair of clause j, K = O_j = {x_v : v in C_j} together with H_B.
3. For the link pair {e, b0}, K = {h_e, h_b0}; for {a0, f}, K = {h_a0, h_f}.
4. For every designated pair {c, d}, the full pair class E(c,d;0,0) contains no padding row, so it equals K_cd.

*Proof.* In a column c of side A, the hub rows with 0 are those of H_B together with h_c; in a column of side B, those of H_A together with h_c. Two columns of side B therefore share the zeros H_A; two columns of side A share H_B; a column c of A and a column d of B share exactly h_c and h_d. A variable row x_v is 0 in column c exactly when c is owned by a clause containing v. Both columns of the Z-pair and of the O-pair of clause j are owned by clause j alone, so x_v is 0 in both exactly when v is in C_j. Each link pair contains a0 or b0, which no clause owns, so no variable row is 0 on a link pair. This gives parts 1 to 3. A padding row p_Y is 0 in both columns of a pair only if Y contains that pair, and no Y contains a designated pair; this gives part 4. ∎

**Lemma 4 (every outside column splits every designated class).** Let {c, d} be a designated pair and g a column outside it. Then column g takes both values on the rows of K_cd.

*Proof.* *Z_j, with g not f_j or f'_j.* If g is on side A, then h_g is in Z_j with 0 in column g, and every other row of H_A (there are 2m ≥ 2 of them) has 1 in column g. If g is on side B, every row of H_A has 0 in column g, and a variable of C_j with 1 there is needed. If g = b0, no clause owns g and every variable row has 1. Otherwise g is owned by exactly one clause i, and i differs from j because the only side-B columns owned by j are f_j and f'_j. The variable rows with 0 in column g are those of variables in C_i. Since C_i and C_j are distinct sets of three, some v in C_j is not in C_i, and x_v has 1 in column g.

*O_j, with g not e_j or e'_j.* The same argument with the sides exchanged.

*{h_e, h_b0}, with g not e or b0.* If g is on side A, h_e has 1 in g and h_b0 has 0. If g is on side B, h_e has 0 and h_b0 has 1.

*{h_a0, h_f}, with g not a0 or f.* If g is on side A, h_a0 has 1 and h_f has 0. If g is on side B, h_a0 has 0 and h_f has 1. ∎

**Lemma 5 (every other class holds a doubled row).** Every full pair class that is not E(c,d;0,0) for a designated pair {c, d} contains both copies of some padding row.

*Proof.* Take E(c,d;x,y) and let Y be the set of columns among c, d where the bit is 0. Then Y has at most two columns, and Y is a designated pair only when x = y = 0 and {c, d} is designated. In every other case p_Y is a padding row, it lies in E(c,d;x,y), and so do both of its copies. ∎

**Lemma 6 (size).** The output has k = 4m + 2 columns and at most |V| + k + 2(1 + k + C(k,2) + C(k,3)) rows, which is O(m^3) rows and O(m^4) entries. It is written in time polynomial in the size of the source.

*Proof.* Count the rows of each kind; |V| ≤ 3m. Each row is written directly from its definition. ∎

## 4. Theorems

**Theorem 1 (strength three on every input).** The output always has strength three, whether or not the source is satisfiable.

*Proof.* For the fixed outputs, this is Lemma 2. Otherwise take three columns and a target word on them, and let Y be the set of those columns where the target is 0. If Y contains no designated pair, the padding row p_Y shows the target. If Y contains a designated pair {c, d}, the target is 0, 0 on c, d and some bit z on the third column g. By Lemma 4 some row of K_cd has z in column g, and that row is 0 on c and d. ∎

**Theorem 2 (extension exactly when satisfiable).** The output extends if and only if the source is satisfiable. For malformed input it does not extend.

*Proof.* The fixed outputs are Lemma 2. Otherwise:

*Satisfiable implies extends.* Take an assignment s that gives every clause both values. Colour x_v with s(v), every row of H_A with 0, every row of H_B with 1, and the two copies of each padding row with 0 and 1. By Lemma 5 every class except the designated classes E(c,d;0,0) is split. By Lemma 3 those are: link classes, each holding one hub of each side, so coloured 0 and 1; Z_j, holding H_A (colour 0) and the variables of C_j, one of which has colour 1; O_j, holding H_B (colour 1) and the variables of C_j, one of which has colour 0. By Lemma 1 the column keeps strength three.

*Extends implies satisfiable.* Let t be the new column. By Lemmas 1 and 3 every link class is split, so t(h_e) differs from t(h_b0) for every e on side A, and t(h_a0) differs from t(h_f) for every f on side B other than b0. Hence all of H_A has one colour, say a, and all of H_B has the other colour. Z_j is split, so some v in C_j has t(x_v) different from a; O_j is split, so some v in C_j has t(x_v) equal to a. So s(v) = t(x_v) gives every clause both values. ∎

**Theorem 3 (NP-complete).** Deciding whether a given binary array of strength three extends by one column is NP-complete.

*Proof.* Membership in NP: a proposed column is checked against every triple of columns in polynomial time. Hardness: by Lemma 6, Theorem 1 and Theorem 2, the construction is a polynomial-time map from the NP-complete source problem to the extension problem that keeps the answer (a satisfiable source gives an array that extends; an unsatisfiable one gives an array that does not). ∎

## 5. Remarks

- The source answer is kept, not reversed: YES goes to YES.
- Each padding row is written twice, so the output has repeated rows. The definition of strength three used here allows that. Whether a version with distinct rows also works is not treated here; chapter 9 of the book states the distinct-row version as a separate result.
- The classes that carry the source, Z_j and O_j, have only three rows outside the hub rows.
- Why hub rows: every column carries a star of link classes, so each old column, read as a colouring, only has to split the classes not defined on it, and Lemma 4 shows it does so with one hub of its own side reversed or with the variable rows. Nothing about the source needs to be decided to write the array down.

## Where to go next

- The running-time argument: [the polynomial-time page](POLYNOMIAL-TIME.md).
- The result in plain words: [chapter 9, strength three is NP-complete](../chapters/09-strength-three-is-np-complete.md).
