Fast Orthogonal Vectors gives fast sparse -SAT on the word RAM
ProvedWordRAM.Conjectures.ov_to_sparse_satOV speedups give sparse -SAT speedups. Let , and . Suppose that Orthogonal Vectors with vectors per side and dimension can be decided by a word-RAM algorithm in steps, where for (that is, ). Then -CNF formulas with variables and at most clauses can be decided in steps, where
That is,
This is the time-bounded form of Williams's Theorem 5.1, restricted to linear-size formulas so that the dimension is logarithmic in the number of vectors. Williams's statement gives exponent from an OV exponent , which with is . The exponent used here is weaker, which leaves room for the cost of building the instance and simulating the OV solver.
import Definitions.Def_WordRAM_SETHOV_Reduction open WordRAM.Conjectures
theorem WordRAM.Conjectures.ov_to_sparse_sat (q : Nat) (hq : 2 ≤ q) (k : Nat) (hk : 3 ≤ k)
(density : Nat) (hdensity : 1 ≤ density) (fastOV : HasFastOV (2 * density) q) :
HasFastSparseSAT k density (4 * q) := by sorryRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Statement. For all natural numbers (the code calls density) with
if holds, then holds. Neither nor anything else about SAT appears in the hypothesis: the same OV hypothesis (with dimension factor and improvement parameter ) is assumed for every . The theorem is a pure implication between these two existence statements. It says nothing if no algorithm satisfies . Nothing in the statement links the SAT algorithm it concludes exists to the OV algorithm it assumes. The imported file also defines a split-and-list SAT-to-OV construction (half, toOV, and related functions), but the statement does not refer to any of it.
The machine (multiplication word RAM). A word width is a positive integer, and a word is a -bit vector, i.e. an integer in . Memory is an infinite array . A machine state consists of the memory, a program counter , a flag and a tick counter (the tick counter plays no role here).
An algorithm consists of two parts:
- a finite list of source instructions, the same list for every input and every width;
- a constant .
At width , each source instruction compiles to one machine instruction. Immediate literals become . Addresses are either direct (cell ) or indirect (the cell whose index is the numeric value stored in cell ). The instructions are:
- copy a source operand into a destination cell;
- binary operations, all taken mod : , (wrapping), , left shift , right shift (zero fill), bitwise AND and bitwise OR;
- bitwise NOT;
- load word width, which writes the word (which equals ) into a cell. This is the only "native constant".
- unconditional jump to an absolute instruction index;
- conditional branch on unsigned , or between two operands; it goes to the target if the test holds and to otherwise;
- halt.
Every executed instruction other than a jump or a taken branch increments . Halt sets to true. A single step behaves as follows:
- It is undefined if the state is already halted.
- It is undefined if is not a valid index into the program; this is a stuck state, not a halt.
- Otherwise it executes the instruction at index .
means that exactly consecutive defined steps lead from to .
Word width used. For an input list of naturals and a parameter ("extra bits"), let
where is the length of the list. The width is
Initial state. Cell holds . For , cell holds (every entry is , so it fits without truncation). All other cells hold . Also and the machine is not halted. Loading the input is free; only executed instructions are counted.
. Let . There must be a state such that all of the following hold:
- the program of compiled at width performs exactly defined steps from the initial state on and ends in ;
- is halted;
- cell of holds or ;
- cell of holds if and only if the proposition is true.
A step from a halted state is undefined, so in such a run the -th step is the halt instruction itself and no earlier step halts. Hence , and is exactly the number of instructions executed, counting the final halt. The run is deterministic, so is determined by and .
OV instances and the hypothesis , with . An OV instance consists of a count , a dimension , and two families and of vectors in . Duplicates are allowed. Two vectors are orthogonal if no coordinate is in both. The instance "has an orthogonal pair" if some is orthogonal to some with .
Its encoding is the list
Each bit is one entry, or , so the list has length .
Let , which equals for . states the following. There exist an algorithm and naturals and such that, for every OV instance with
there is a with both of the following:
- \mathrm{DecidesIn}(a, \mathrm{enc}(v), 0, t, \text{"v has an orthogonal pair"}), so the extra bits are and ;
- if then
There is no truncated subtraction here because ; over the reals the bound is equivalent to . The bound is required for every valid instance with . Correct halting is required for every valid instance, including those with . Dimension is allowed. Instances with , or with dimension above the bound, are not constrained. In the theorem, .
SAT instances and the conclusion , with . A SAT instance consists of a number of variables and a list of clauses. Each clause is a list of literals, and a literal is a pair (index , polarity). Under an assignment , a positive literal evaluates to and a negative one to .
- Satisfiable means that some makes every clause in the list contain a literal that evaluates to true. An empty clause makes the instance unsatisfiable. An empty clause list is satisfiable, even when .
- -CNF means that every clause has at most literals. Empty clauses, repeated literals, repeated clauses, and complementary literals within a clause are all allowed.
- Sparsity: the number of clauses (the length of the list, repetitions counted) satisfies . When this forces .
The encoding is
For each clause in order, the list contains its length followed by the pair (variable index, polarity bit) for each of its literals, with polarity for positive and for negative. The encoded length is .
states the following. There exist an algorithm and naturals , and (chosen after and before the instance) such that, for every SAT instance that is -CNF and has , there is a with both of the following:
- \mathrm{DecidesIn}(a, \mathrm{enc}(f), n, t, \text{"f is satisfiable"}). The extra bits equal the number of variables, so the word width is
- if then
The exponent is unrestricted. Correct halting is required for all such , including those with .
With , the subtraction is not truncated. The concluded bound reads
which over the reals is equivalent to .
Confirmed by the mission captain (proposal self-audit).