Deterministic SETH and the Orthogonal Vectors Conjecture on the word RAM
DefinitionWordRAM_ConjecturesDefinitions of the deterministic Strong Exponential Time Hypothesis (SETH) and the low-dimensional Orthogonal Vectors Conjecture (OVC) over a concrete word RAM. Running time is the number of instructions a fixed program actually executes, with no abstract "fast algorithm" predicate.
Machine and algorithms. The machine is the multiplication word RAM of Def_WordRAMEquivalence_Foundation1. Each instruction takes one step. Words are -bit, and the instructions are modulo , shifts, AND, OR, NOT, copy, unsigned comparisons and branches, jumps and halt, with direct and indirect addressing. This file adds the exact-step relation : precisely successful instruction executions lead from to . An algorithm consists of:
- a finite program, the same at every input size, whose immediates are natural-number literals truncated to bits and whose only built-in constant is the word width ;
- a positive constant , its word-size factor.
On input , with an extra-bits parameter , let . The algorithm runs with word width
Cell holds the output and starts at . Cells hold reduced modulo , and every other cell is . We say decides on in steps if the machine runs exactly steps from this state to a halted state whose cell holds or , and cell holds if and only if holds.
-SAT. A CNF formula has variables and a list of clauses of literals. is a -CNF if every clause has at most literals. Empty clauses and repeated literals are allowed. is encoded as , and is the length of this list. For natural numbers and , says there are an algorithm and constants , , such that, for every -CNF , decides satisfiability of on with in some steps, where
That is, .
Orthogonal Vectors. An OV instance consists of two lists and in . Duplicates are allowed. The question is whether some are orthogonal, that is, share no coordinate equal to . The instance is encoded as followed by all bits of the left list in row order, then the right list, one word per bit. For natural numbers and , says there are an algorithm and constants , such that, for every instance with and , decides the instance with in some steps, where
That is, .
The file also defines the proposition as SETHImpliesOV. These are the standard hypotheses of fine-grained complexity, fixed here to one machine model, input encoding and step count so that conditional lower bounds can be stated and proved without hidden assumptions.
Formalization Note The improvement ranges over with , which is enough to rule out every fixed . Raising to the power keeps the bounds in . The hypotheses are deterministic, whereas Cygan et al. allow bounded-error randomized algorithms. A solver must decide every input correctly, including inputs below . SAT runs get extra word bits, so a -size workspace is addressable. OV runs get logarithmic words. The ceiling uses for . Lean names: WordRAM.Runs, WordRAM.Conjectures.{Algorithm, DecidesIn, SATInstance, HasFastSAT, SETH, OVInstance, HasFastOV, OVConjecture, SETHImpliesOV}.
import Definitions.Def_WordRAMEquivalence_Foundation1
set_option autoImplicit true
namespace WordRAM
/-- Exactly `n` successful instruction executions; allows unbounded reasoning
about finite executions independently of the fuel-based interpreter. -/
inductive Runs (constants : NativeConstants k) (p : Program w m k) :
Nat → State w → State w → Prop where
| refl (s) : Runs constants p 0 s s
| cons : step constants p s = some t → Runs constants p n t u →
Runs constants p (n + 1) s u
end WordRAM
/-!
# Deterministic SETH and the Orthogonal Vectors conjecture
These definitions use the multiplication word RAM from `Basic`, fixed finite
programs, explicit input encodings, and its actual instruction-step relation.
They do not take an unspecified "fast solver" predicate as a parameter.
Reference conventions:
* Cygan et al., On Problems as Hard as CNFSAT, https://arxiv.org/abs/1112.2275
* Abboud, Vassilevska Williams, Wang, §1.2 (OVC and SETH ⇒ OVC):
https://theory.stanford.edu/~virgi/dirRad.pdf
We quantify over improvements ε = 1/q, q ≥ 2. This suffices to express the
absence of ANY fixed positive improvement. Natural-number inequalities on
t^q express the rational-exponent time bounds without importing real analysis.
Equivalence with other machine/encoding conventions is not proved here.
`SETHImpliesOV` at the end is a proposition stating the desired implication,
NOT a proof or an axiom asserting it.
`WordRAM.Runs` is the exact-step execution relation from the source model's
`Basic.lean`; the rest of the word-RAM model is imported unchanged from
`Def_WordRAMEquivalence_Foundation1`.
-/
namespace WordRAM.Conjectures
/-! ## Finite, uniform programs -/
/-- An immediate is a fixed natural literal in finite source code, not an
arbitrary function of word width. Compilation truncates it to a word. -/
inductive SourceOperand where
| immediate (literal : Nat)
| memory (address : Address)
deriving Repr
def SourceOperand.compile (w : Width) : SourceOperand → Operand w
| .immediate n => .immediate (BitVec.ofNat w.bits n)
| .memory a => .memory a
/-- One syntax tree is used at every input size and word width. The only native
constant available to these algorithms is the word width itself. -/
inductive SourceInstruction where
| copy (dst : Address) (src : SourceOperand)
| binary (op : BinOp .multiplication) (dst : Address) (x y : SourceOperand)
| bitNot (dst : Address) (src : SourceOperand)
| wordWidth (dst : Address)
| jump (target : Nat)
| branch (cmp : Comparison) (x y : SourceOperand) (target : Nat)
| halt
deriving Repr
def SourceInstruction.compile (w : Width) : SourceInstruction → Instruction w .multiplication 1
| .copy dst src => .copy dst (src.compile w)
| .binary op dst x y => .binary op dst (x.compile w) (y.compile w)
| .bitNot dst src => .bitNot dst (src.compile w)
| .wordWidth dst => .native dst ⟨0, by decide⟩
| .jump target => .jump target
| .branch cmp x y target => .branch cmp (x.compile w) (y.compile w) target
| .halt => .halt
structure Algorithm where
code : List SourceInstruction
/-- Fixed constant factor in the word-size convention, independent of input. -/
wordFactor : Nat
wordFactor_pos : 0 < wordFactor
def Algorithm.program (a : Algorithm) (w : Width) : Program w .multiplication 1 :=
a.code.map (SourceInstruction.compile w)
def widthConstant : NativeConstants 1 := fun w _ => BitVec.ofNat w.bits w.bits
/-- The maximum includes the input length to allow addressing all input cells. -/
def inputMagnitude (input : List Nat) : Nat := input.foldl max input.length + 1
/-- OV uses extraBits = 0 (logarithmic words). SAT uses extraBits = n to
permit addresses into exponential workspace. Polynomial-bit SAT operations
are the convention here; machine-simulation equivalences are not proved. -/
def Algorithm.width (a : Algorithm) (input : List Nat) (extraBits : Nat) : Width :=
⟨a.wordFactor * (extraBits + (inputMagnitude input).log2 + 1),
Nat.mul_pos a.wordFactor_pos (by omega)⟩
/-- Output is cell 0; input words begin at cell 1; other memory starts at zero.
Input loading is a convention outside the measured instruction count. -/
def initialState (w : Width) (input : List Nat) : State w :=
{ mem := fun address =>
if address = 0 then 0
else BitVec.ofNat w.bits (input[address - 1]?.getD 0) }
/-- An ACTUAL t-step execution, ending in halt with output exactly 0 or 1.
The final output is 1 iff the input's mathematical decision predicate holds. -/
def DecidesIn (a : Algorithm) (input : List Nat) (extraBits t : Nat)
(answer : Prop) : Prop :=
let w := a.width input extraBits
∃ final : State w,
Runs widthConstant (a.program w) t (initialState w input) final ∧
final.halted = true ∧
(final.mem 0 = 0 ∨ final.mem 0 = 1) ∧
(final.mem 0 = 1 ↔ answer)
/-! ## k-CNF satisfiability -/
structure Literal (n : Nat) where
index : Fin n
positive : Bool
deriving DecidableEq, Repr
def Literal.eval (assignment : Fin n → Bool) (literal : Literal n) : Bool :=
if literal.positive then assignment literal.index else !(assignment literal.index)
structure SATInstance where
variables : Nat
clauses : List (List (Literal variables))
/-- Clauses have AT MOST k literals. Empty clauses and duplicate literals are
allowed, with their ordinary Boolean meanings. -/
def SATInstance.IsKCNF (f : SATInstance) (k : Nat) : Prop :=
∀ clause ∈ f.clauses, clause.length ≤ k
def SATInstance.Satisfiable (f : SATInstance) : Prop :=
∃ assignment : Fin f.variables → Bool,
∀ clause ∈ f.clauses, ∃ literal ∈ clause, literal.eval assignment = true
/-- Encoding: n, number of clauses, then for each clause its length followed
by (variable index, polarity) pairs. Positive polarity is 1, negative is 0. -/
def SATInstance.encode (f : SATInstance) : List Nat :=
[f.variables, f.clauses.length] ++ f.clauses.flatMap fun clause =>
clause.length :: clause.flatMap fun literal =>
[literal.index.val, if literal.positive then 1 else 0]
/-- A uniform deterministic solver in O(2^((1−1/q)n) · L^O(1)) time,
where L is encoded input length. Raising the time to q avoids real powers:
t^q ≤ C · 2^((q−1)n) · (L+1)^p. The polynomial exponent p is unrestricted.
Correctness/termination is required also below the asymptotic threshold n₀. -/
def HasFastSAT (k q : Nat) : Prop :=
∃ a : Algorithm, ∃ C p n₀ : Nat, 0 < C ∧
∀ f : SATInstance, f.IsKCNF k →
∃ 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)
/-- For every fixed exponential improvement, some fixed clause width k is hard.
The solver and its constants may depend on k and q, but not on the instance. -/
def SETH : Prop :=
∀ q : Nat, 2 ≤ q → ∃ k : Nat, 3 ≤ k ∧ ¬ HasFastSAT k q
/-! ## Bichromatic Boolean Orthogonal Vectors -/
abbrev BooleanVector (d : Nat) := Fin d → Bool
/-- For Boolean coordinates, dot product zero means no shared 1 coordinate. -/
def Orthogonal (x y : BooleanVector d) : Prop :=
∀ i : Fin d, x i = false ∨ y i = false
/-- Two lists, each containing n vectors of common dimension d. Duplicates
are allowed; the pair must contain one vector from each list. -/
structure OVInstance where
count : Nat
dimension : Nat
left : Fin count → BooleanVector dimension
right : Fin count → BooleanVector dimension
def OVInstance.HasOrthogonalPair (v : OVInstance) : Prop :=
∃ i j : Fin v.count, Orthogonal (v.left i) (v.right j)
/-- Encoding: n, d, then all bits of the left list in row order, then the right
list. A coordinate takes one word; no compression or precomputed answers. -/
def OVInstance.encode (v : OVInstance) : List Nat :=
[v.count, v.dimension] ++
(List.ofFn fun i : Fin v.count =>
List.ofFn fun j : Fin v.dimension => if v.left i j then 1 else 0).flatten ++
(List.ofFn fun i : Fin v.count =>
List.ofFn fun j : Fin v.dimension => if v.right i j then 1 else 0).flatten
/-- ceil(log₂ n) for n ≥ 2 (the only counts used in the conjecture). -/
def ceilLog2 (n : Nat) : Nat := (n - 1).log2 + 1
/-- O(n^(2−1/q)) time for all dimensions d ≤ c·ceil(log₂ n).
The single program may depend on c and q, but must work for every valid input.
Constants and the threshold are independent of n, d, and the vector contents. -/
def HasFastOV (c q : Nat) : Prop :=
∃ a : Algorithm, ∃ C n₀ : Nat, 0 < C ∧
∀ v : OVInstance, 2 ≤ v.count → v.dimension ≤ c * ceilLog2 v.count →
∃ t : Nat, DecidesIn a v.encode 0 t v.HasOrthogonalPair ∧
(n₀ ≤ v.count → t ^ q ≤ C * v.count ^ (2 * q - 1))
/-- For every fixed subquadratic improvement, some constant logarithmic
dimension factor c is hard. This is the deterministic, low-dimensional OVC. -/
def OVConjecture : Prop :=
∀ q : Nat, 2 ≤ q → ∃ c : Nat, 1 ≤ c ∧ ¬ HasFastOV c q
/-- The requested STATEMENT. No theorem asserting it has been proved here.
A proof requires a SAT-to-OV reduction, sparsification (for logarithmic
dimension), and verified running-time/machine simulations. -/
def SETHImpliesOV : Prop := SETH → OVConjecture
end WordRAM.Conjectures
Confirmed by the moderator at approval.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the mission captain (proposal self-audit).