The exact circuit size of [x₁+⋯+x₆ ≡ 1 (mod 3)] is 13
Knuth's "tantalizingly close" open cell of his mod-3 conjecture (TAOCP 7.2.2.2, answer to exercise 480) is closed, and the machinery that closed it also settles a cell at seven inputs. Every claim on this page comes with a certificate a stranger can re-check.
Scope, first. This is not progress on P vs NP. It is one exact value at the finite base of the circuit-lower-bound programme: the minimum number of binary gates (any of the 16 two-input operations) for one explicit 6-input function.
The conjecture and what is now known
Let MOD3,r on n inputs be the Boolean function [x₁+⋯+x_n ≡ r (mod 3)], and C(f) the least number of two-input gates in a circuit computing f (circuits over the full binary basis; Knuth's "Boolean chains"). Knuth computed C for n ≤ 5 and for (n, r) = (6, 0), conjectured C(MOD3,r on n) = 3n − 5 − [(n+r) ≡ 0 mod 3], and wrote that n = 6, r ≠ 0 "lies tantalizingly close to the limits of today's solvers [and] is still unknown." Kulikov, Pechenev and Slezkin (MFCS 2022) proved the conjectured value as an upper bound for all n.
| cell | value | status | evidence |
|---|---|---|---|
| n = 3, 4, 5 (all r) | 3,4,4 · 7,7,6 · 10,9,10 | Knuth, reproduced | two independent SAT encodings, DRAT-checked; n = 4 also by exhaustive enumeration (Knuth's Table 1 reproduced exactly) |
| n = 6, r = 0 | 12 | Knuth, reproduced | Biere's 12-gate chain verified in Lean; no 11-gate chain (DRAT) |
| n = 6, r = 1, 2 | 13 | new · machine-verified | 13-gate chains verified in the Lean 4 kernel; no 12-gate chain: 18 760 cubes, each DRAT-checked, cover DRAT-checked |
| n = 7, r = 2 | 15 | new · machine-verified | 15-gate chain (KPS blocks) verified in Lean; no 14-gate chain (DRAT, 0.4 s once the n = 6 values are known) |
| n = 7, r = 0, 1 | 15 or 16 | open | lower bound 15 (DRAT); 16-gate chains verified in Lean; conjectured 16; refutation at 15 is a multi-day compute job, running |
A 13-gate circuit
One of the two certified chains (found by the SAT search; the other is assembled from KPS's blocks). Each line is a gate; the 4-bit code is the operation's truth table on (0,0),(0,1),(1,0),(1,1). The Lean file defines this list, evaluates it on all 64 inputs by kernel decide, and also proves that a corrupted copy is rejected.
x7 = x1 0110 x2 (xor) x14 = x10 0110 x13 (xor) x8 = x2 0110 x3 (xor) x15 = x5 0001 x14 (and) x9 = x3 0110 x7 (xor) x16 = x5 0110 x14 (xor) x10 = x7 0111 x8 (or) x17 = x12 0110 x15 (xor) x11 = x4 0110 x9 (xor) x18 = x6 0110 x16 (xor) x12 = x10 0010 x11 (x and not y) x19 = x17 0100 x18 (not x and y) x13 = x4 0010 x12 (x and not y) output: x19 = [x1+…+x6 ≡ 1 (mod 3)]
How the lower bound was proved
The encoding is Knuth's own CNF (answers 477–478, after Kojevnikov–Kulikov–Yaroslavtsev); the generator reproduces his published variable and clause counts exactly. What made the 12-gate case tractable was letting the mathematics lead, then certifying:
- Symmetry breaking (proved as one lemma): operand pairs in colex order, inputs first used in order, no reapplication, every gate used, output last.
- Gate elimination as clauses. Substituting x_j := 1 into an s-gate circuit for MOD3,1 on 6 inputs deletes every gate reading x_j and leaves a circuit for MOD3,0 on 5 inputs (cost 10, Knuth — re-proved here with DRAT), so every input has fanout ≤ s − 10. Generalised: for each substitution the set of provably deleted gates is counted in CNF and bounded by s − (cost of the residue). All residue costs are themselves machine-checked at n = 4, 5, so the induction is certified at every level.
- Pair substitution. x_a := x_b leaves the function h = [2x_b + Σrest ≡ 1 (mod 3)] on 5 inputs; we proved C(h) = 10 (chain; UNSAT at 9 by 264 checked cubes with a checked cover). This pins an XOR of two inputs to fanout 1 and collapsed the hard region of the search from ~2 CPU-hours per cube to under a second.
- Cube-and-conquer on the first four gates: 18 760 cubes (six refined one step deeper), cadical per cube with a DRAT proof checked by drat-trim; the cover "F ∧ ¬cube₁ ∧ … ∧ ¬cube_N" refuted and checked.
Files
| file | what it is |
|---|---|
| paper.pdf | four-page write-up (statement, method, lemmas, results, calibration) |
| README.md | the full record: claims R1–R14 with certificates, lemma proofs, dependency tree, failed approaches, reproduction commands |
| mod3-circuit-size-certificates.tar.gz | code, Lean files, chain certificates, every run's verdict table (cube lists, per-cube drat-trim verdicts, leaf set, cover record), logs, hashes — everything needed to re-run verify_all.sh. CNF and DRAT files are regenerated by the code. |
| SHA256SUMS | 0dbf635c022540a7c4b4f7d1cad4dadf24aead1c2592a7f05e6eaebed101277a |
How to check it yourself
Trusted base: the Lean 4 kernel for the circuits; drat-trim for the refutations; a ~150-line encoder plus four elementary lemmas written out in the README. After unpacking the archive (directory mod3-circuit-size-certificates/; needs Python 3, Lean 4.9 via elan, cadical, drat-trim for re-running searches):
python3 code/verify_chain.py results/sat-mod3-1-6-s13.chain # independent 90-line checker ~/.elan/bin/lean lean/SatMod3_1_6_s13.lean # kernel decide, ~3 s, with negative control bash code/verify_all.sh # whole certificate chain: ALL CHECKS PASSED python3 code/cnc.py cover results/cnf/gp_6_1_s12.cnf results/cnf/gp_6_1_s12.leaves # re-run the cover proof
What is new and what is quoted
New and checkable: C(MOD3,1 on 6) = C(MOD3,2 on 6) = 13; C(MOD3,2 on 7) = 15; C(h) = 10; the certificate chain. Quoted: the encoding (Knuth; KKY 2009), the upper-bound constructions (Kulikov–Pechenev–Slezkin), all anchor values (Knuth), cube-and-conquer (Heule–Kullmann–Biere), drat-trim. Elementary: the four lemmas — classical gate elimination turned into exact clause groups over machine-checked residue costs. Novelty caveat: checked against Knuth's Vol 4B errata (through April 2026), his news page, KPS 2022 and 2025–26 follow-ups; a web search is not a literature guarantee. The much-reported 2026 "Knuth conjecture solved by AI" is a different problem (Claude's Cycles, Hamiltonian decompositions of directed tori).
Failed approaches, kept
The plain Knuth encoding projected ~40 hours for 11 gates alone; the fanout bound alone still left days of work at 12 gates; solver presets looked decisive on one cell and hurt on the next (run-to-run variance is large; only many cubes average it out); refining cubes without the pair lemma was break-even. Two in-flight runs were lost to a pkill -f that matched its own shell. All recorded in the README.
How to cite
mod3-circuit-size (2026). The exact circuit size of [x1+...+x6 = 1 (mod 3)] is 13: closing the n = 6 case of Knuth's mod-3 conjecture, with machine-checked certificates. Results note, version 1.0, 23 August 2026. https://mod3-circuit-size.pages.dev/ — certificate archive sha256 0dbf635c022540a7c4b4f7d1cad4dadf24aead1c2592a7f05e6eaebed101277a
Computation: 32-core machine, cadical 2.1.3, kissat 4.0.3, drat-trim, Lean 4.9.0; 2026-08-22/23. Proof files of the cube runs are not retained (terabytes); per-cube verdicts are recorded and any cube can be regenerated and re-checked from the code.