Split-and-list SAT-to-OV instance and sparse -SAT time bounds
DefinitionWordRAM_SETHOV_ReductionThe split-and-list SAT-to-OV construction and the sparse -SAT time predicate on the word RAM of Def_WordRAM_Conjectures.
Split-and-list instance. Let be a CNF formula with variables and clauses . Put . The left variables are with , and the remaining variables are right. A number is read as an assignment by bits:
- as a left assignment, bit of ;
- as a right assignment, bit of .
For each the left vector has iff no literal of on a left variable is made true by . The right vectors are defined in the same way using right variables. Then
an OV instance with vectors per side and dimension . For odd the top bit of a right index is unused, so right vectors repeat, which OV permits.
Sparse SAT. For natural numbers , is restricted to -CNF formulas with at most clauses. That is, there are an algorithm and constants , , such that, for every -CNF with , decides satisfiability of on its standard encoding with extra word bits in some steps, where
These are the objects of the two reduction steps in the classical proof that SETH implies the Orthogonal Vectors Conjecture.
Formalization Note Clause indices for are taken from the formula's clause list in order. The constants in may depend on , and but not on the formula.
import Definitions.Def_WordRAM_Conjectures
set_option autoImplicit true
/-!
The split-and-list SAT-to-OV construction and the sparse k-SAT time predicate
used by the SETH ⇒ OV milestones. Both are copied unchanged from the source
development (`WordRAM/SETHToOV.lean`); proof-only helpers are omitted.
-/
namespace WordRAM.Conjectures
namespace Reduction
/-- Both lists use ceil(n/2) bits. For odd n, one unused bit on the right
duplicates vectors; OV permits duplicates. This also covers n = 0. -/
def half (n : Nat) : Nat := (n + 1) / 2
def onLeft (n : Nat) (i : Fin n) : Bool := decide (i.val < half n)
/-- A coordinate is 1 precisely when this half does NOT satisfy the clause. -/
def fails (side : Fin n → Bool) (a : Fin n → Bool) (clause : List (Literal n)) : Bool :=
!(clause.any fun literal => side literal.index && literal.eval a)
def leftAssignment (n : Nat) (a : Fin (2 ^ half n)) : Fin n → Bool :=
fun i => (BitVec.ofFin a).getLsbD i.val
def rightAssignment (n : Nat) (b : Fin (2 ^ half n)) : Fin n → Bool :=
fun i => (BitVec.ofFin b).getLsbD (i.val - half n)
/-- An explicit, computable OV instance with 2^ceil(n/2) vectors on EACH side
and one coordinate per clause. No SAT oracle is used to construct the vectors. -/
def toOV (f : SATInstance) : OVInstance where
count := 2 ^ half f.variables
dimension := f.clauses.length
left := fun a j => fails (onLeft f.variables) (leftAssignment f.variables a) f.clauses[j.val]
right := fun b j => fails (fun i => !(onLeft f.variables i))
(rightAssignment f.variables b) f.clauses[j.val]
end Reduction
/-- The same SAT time bound, restricted to formulas with at most density·n
clauses. Density, k, and q are fixed before selecting an algorithm. -/
def HasFastSparseSAT (k density q : Nat) : Prop :=
∃ a : Algorithm, ∃ C p n₀ : Nat, 0 < C ∧
∀ f : SATInstance, f.IsKCNF k → f.clauses.length ≤ density * f.variables →
∃ t : Nat, DecidesIn a f.encode f.variables t f.Satisfiable ∧
(n₀ ≤ f.variables →
t ^ q ≤ C * 2 ^ ((q - 1) * f.variables) * (f.encode.length + 1) ^ p)
end WordRAM.Conjectures
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Reduction.half
For a natural number , is the natural number
Edge values: , , , . For even it equals ; for odd it equals , one more than .
Reduction.onLeft
For a natural number and a variable index , is the Boolean value
So the indices are "left" and the indices (there are of them) are "right". For there are no indices; for the single index is left and no index is right.
Reduction.fails
Here a literal over variables is a pair with variable index and polarity ; under an assignment its value is if and otherwise. A clause is a finite list of such literals (possibly empty, possibly with repeated literals). The number of variables is an implicit argument. Given a "side" predicate , an assignment , and a clause , is the Boolean
Literals whose variable is not on the side are ignored entirely, regardless of . If is the empty clause, or if no literal of has its variable on side , then for every .
Reduction.leftAssignment
For and , is the assignment that sends variable to the -th binary digit of (least significant digit is digit ), obtained by viewing as a bit string of length and reading bit , with the convention that a position (outside that bit string) reads as :
Since , this equals for every . Every left variable is driven by a distinct bit of , and all bits of are used, so distinct give distinct restrictions to the left variables. For , ranges over the single value and the assignment has empty domain.
Reduction.rightAssignment
For and , is the assignment given by
where is truncated natural-number subtraction () and is read as a bit string of length (positions at or beyond that length read as , though that never happens here, see below). Consequences of the arithmetic:
- For a left index , the subtraction truncates to , so every left variable receives the same value, namely bit of (not ).
- For a right index , variable receives bit of ; these positions range over , which are all inside the bit string.
- For even , all bits of drive right variables. For odd , the top bit of (position ) drives no right variable, so and (for ) induce the same values on the right variables. For there are no right variables and both only affect variable (a left variable) through bit .
Reduction.toOV
Given a SAT instance , consisting of a number of variables and a list of clauses (each clause a finite, possibly empty, list of literals over the variables, as described for fails), is the following orthogonal-vectors instance: two lists, "left" and "right", each of exactly
Boolean vectors (indexed by ), all of dimension (one coordinate per clause, in the clause order of ). Writing for the left variables and for the right ones, the coordinates are
where sets variable to bit of , and sets variable to bit of (its values on , which equal bit of , are never consulted here because left-side literals are filtered out of the right vectors). Clause indexing is always in range. Edge cases: both lists have the same length even though there are only right variables, so for odd each right vector appears (at least) twice; for every right vector is the all- vector. For , and every clause is necessarily empty, so the single left and single right vector are both all- of dimension . An empty clause gives coordinate equal to in every left and every right vector. A clause containing only left variables gives coordinate equal to in every right vector (and symmetrically). If the vectors are all the empty vector. The construction is a direct function of ; nothing in it refers to satisfiability. (An OV instance in the dependencies also has a notion "there exist with no coordinate where both and are "; toOV itself does not state any relation between that notion and satisfiability of .)
HasFastSparseSAT
For natural numbers , ("density") and , is the proposition:
There exist an algorithm and natural numbers with such that for every SAT instance with variables and clause list satisfying
- every clause has at most literals ( for all ), and
- ,
there exists such that decides the satisfiability of in exactly steps on input with extra-bits parameter (defined below), and if then
The quantifier order is: are chosen once (depending only on ), then is arbitrary, then may depend on . The decision requirement holds for all admissible , including ; only the time inequality is restricted to .
Instances, satisfiability, encoding. A literal is a variable index in with a polarity; clauses may be empty or contain repeated literals. is satisfiable iff there is an assignment such that every clause contains at least one literal true under ; so an empty clause makes unsatisfiable and an empty clause list makes satisfiable (also when ). The encoding is the list of natural numbers followed, for each clause in order, by its length and then, for each literal in order, the pair (variable index, if positive else ). Hence .
Algorithms and the machine. An algorithm consists of a finite list of source instructions and a positive natural number ("word factor"). Given an input list of naturals and an extra-bits parameter , the word width is
(with the floor binary logarithm); here and . The source code is compiled to a word RAM program over -bit words (values in ) in the "multiplication" model: instructions are copy, binary operation (addition, subtraction, multiplication all mod ; left/right shift by the unsigned value of the second operand with zero fill; bitwise AND, OR), bitwise NOT, "store the word width" (writes into a cell; this is the only native constant), unconditional jump to a fixed instruction index, conditional branch on an unsigned comparison (, , ) to a fixed index, and halt. Operands are immediates (fixed natural-number literals reduced mod ) or memory reads; destination and source addresses are direct (a fixed cell number) or indirect (the unsigned value stored in a fixed cell). Each executed instruction advances the program counter by one (unless it jumps/branches), and halt sets a halted flag. A step is defined only when the machine is not halted and the program counter indexes an existing instruction; otherwise no step exists (in particular, falling off the end of the program is a stuck state, not a halt).
Deciding in exactly steps. " decides in steps on input with extra bits " means: with as above, starting from the initial state in which cell holds , cell holds for and for , program counter , not halted, there is a sequence of exactly successive successful steps ending in a state with
- halted,
- the word in cell of equal to or to , and
- (cell of equals ) , here = " is satisfiable".
Because the initial state is not halted and only the halt instruction sets the flag, and counts every executed instruction including the final halt. Since each step is a function of the state, at most one such exists for given and . Input loading costs nothing.
Edge cases of the parameters.
- : and , so the time inequality reads , which holds automatically since ; only correctness/halting remains.
- : the inequality is (no exponential factor).
- : .
- , or : only instances with no clauses at all are quantified over.
- : only instances whose clauses are all empty are quantified over.
- The polynomial exponent is unrestricted, and , , may not depend on .
Confirmed by the mission captain (proposal self-audit).