Runtime greedy parity-row search for CNF formulas #
In §6 and Lemma 6.2 of [OAI26c] (pp. 40, 42), given an initial parity-check matrix where
every passing nonsatisfying assignment violates at least m / P clauses, a deterministic greedy
loop runs for 3n rounds, streaming all (2m)^P tuples γ ∈ ([m] × {0, 1})^P via
Cslib.GenericRAM.IndexFold.run, materializing h_γ mod 2, and—whenever the candidate space is
nonempty (0 < candidateTupleCount m P)—appending the first candidate in enumeration order
minimizing countSys (rows ++ [h_γ]) (falling back to the length-m zero row
List.replicate m false when candidateTupleCount m P = 0, i.e., m = 0 and P > 0).
Scope and fixed-counter quantifier #
In the native certificate and complexity API (selectBestStepCertificate,
selectBestTestRowCertificate, greedyParityRowsCertificate, computableInO_selectBestTestRow,
computableInO_greedyParityRows, computableInPolySpace_greedyParityRows), the candidate counter
countSys : List (List Bool) → ℕ and its certificate
cCount : NativeCertificate countSys (encList encBits) encNat are fixed before the runtime inputs
(m, P, rows) / (n, m, P, rows). Neither the original CNF formula φ nor an arbitrary encoded
context is a runtime input to this machine: choosing a separate countSys per φ allows a
different machine and polynomial bound per φ. Uniform composition with a variable-CNF Theorem 2.2
common-zero counter therefore requires a captured-context certificate interface—for example, a
counter on (context, rows) whose encoded context is retained and charged throughout IndexFold
and the outer 3n-round loop.
Main definitions #
Cslib.Logic.PL.CNF.candidateTupleCount,Cslib.Logic.PL.CNF.encodeTestTuple,Cslib.Logic.PL.CNF.decodeTestTuple,Cslib.Logic.PL.CNF.materializeTestRow: base-2mcodec and length-mmod-2parity-test row materializer.Cslib.Logic.PL.CNF.selectBestTestRow,Cslib.Logic.PL.CNF.greedyParityRows,Cslib.Logic.PL.CNF.selectBestTestRowCertificate,Cslib.Logic.PL.CNF.greedyParityRowsCertificate: streaming selector,3n-round greedy loop, and fixed-counter native certificates.
Main results #
Cslib.Logic.PL.CNF.decodeTestTuple_encodeTestTuple,Cslib.Logic.PL.CNF.encodeTestTuple_decodeTestTuple,Cslib.Logic.PL.CNF.mem_map_decodeTestTuple_range,Cslib.Logic.PL.CNF.length_materializeTestRow,Cslib.Logic.PL.CNF.count_true_materializeTestRow_le,Cslib.Logic.PL.CNF.materializeTestRow_ofFn: base-2mbijection, weight≤ P, andtestRow.Cslib.Logic.PL.CNF.computableInPolyTime_candidateTupleCount,Cslib.Logic.PL.CNF.computableInPolyTime_decodeTestTuple,Cslib.Logic.PL.CNF.computableInPolyTime_materializeTestRow: plain polynomial-time certificates.Cslib.Logic.PL.CNF.exists_min_index_selectBestTestRow,Cslib.Logic.PL.CNF.countSys_selectBestTestRow_le,Cslib.Logic.PL.CNF.countSys_greedyParityRows_eq_card_sat,Cslib.Logic.PL.CNF.numPassing_greedyParityRows_fin: nonempty-space (0 < candidateTupleCount m P) tie-breaking, minimality, and Lemma 6.2 underhn : 1 ≤ Fintype.card VandhP : 1 ≤ P.Cslib.Logic.PL.CNF.computableInO_selectBestTestRow,Cslib.Logic.PL.CNF.computableInO_greedyParityRows,Cslib.Logic.PL.CNF.computableInPolySpace_greedyParityRows: fixed-counter native time and workspace bounds.
References #
- OpenAI, The Exponential Time Hypothesis is False, §6, §6.2 Lemma 6.2, §6.3
Candidate-tuple count and base-2m tuple decoding #
Number (2 * m) ^ P of ordered candidate lists γ ∈ ([m] × {0, 1})^P (Lemma 6.2, p. 42).
Instances For
The binary encoding of (2 * m) ^ P has bit-length at most P * (2 * m) + 1.
candidateTupleCount m P is computable in polynomial time in binary from unary (m, P).
Decode a binary candidate index j : ℕ in base 2 * m into ((e₁, c₁), …, (e_P, c_P))
via Cslib.Radix.digit without materializing (2 * m) ^ P lists
([OAI26c], §6, p. 40; Lemma 6.2, p. 42). At m = 0, digits default to 0 so clause
indices remain bounded in unary.
Instances For
Little-endian base-2m encoder inverse to decodeTestTuple m P on lists with clause
indices < m, defined via Nat.ofDigits (2 * m).
Instances For
Every pair (e, c) produced by decodeTestTuple m P j satisfies e < m when 1 ≤ m.
Encoding the decoded tuple of any j < (2 * m) ^ P recovers j.
Completeness of decodeTestTuple m P over List.range ((2 * m) ^ P).
Every valid candidate index j < (2 * m) ^ P decodes to a typed γ : Fin P → Fin m × Bool.
decodeTestTuple m P j is computable in polynomial time from unary (m, P) and binary j.
Mod-2 row materialization #
Exact bridge to Cslib.BitString.testRow on γ : Fin P → Fin m × Bool.
Every decoded candidate row for (m, P) has Hamming weight at most P.
materializeTestRow is computable in polynomial time from unary m and (e, c) pairs.
Streaming (2m)^P min-count selector and 3n-round greedy loop #
Live streaming accumulator: (m, P), rows, and optional (bestRow, bestVal).
Instances For
Callback body of IndexFold.run for candidate index j, replacing the incumbent only on
strict improvement candVal < best.2 ([OAI26c], Lemma 6.2, p. 42).
Instances For
Stream j ∈ 0 .. (2 * m) ^ P - 1 via Cslib.GenericRAM.IndexFold.run: when the candidate
space is nonempty (0 < candidateTupleCount m P), select the first candidate parity-test row in
enumeration order attaining the minimum of countSys (rows ++ [h_γ]); if
candidateTupleCount m P = 0 (m = 0, P > 0), return the total fallback length-m zero row
List.replicate m false.
Instances For
Prefix invariant, tie-breaking, and minimality #
Enumeration-order tie-breaking characterization of selectBestTestRow when (2 * m) ^ P > 0:
jStar < (2 * m) ^ P attains the minimum count and strictly beats every j < jStar.
Whenever (2 * m) ^ P > 0, selectBestTestRow equals List.ofFn (testRow γ) for some γ.
Row counts, widths, weights, and CNF bridge for greedyParityRows #
Exact bridge from greedyParityRows to CNF.numPassing_greedy
([OAI26c], Lemma 6.2).
Under hn : 1 ≤ Fintype.card V and hP : 1 ≤ P, when initRows has row width φ.length,
countSys computes numPassing φ.violations on width-φ.length candidate row lists of length at
most initRows.length + 3 * Fintype.card V whose appended rows have weight ≤ P, and initRows
satisfies Lemma 6.1's φ.length ≤ P * weight (φ.violations σ) bound, 3 * Fintype.card V greedy
rounds yield countSys finalRows = #{σ : V → Bool | φ.eval σ = true}. Positivity is material:
for V = Fin 0, φ = [[]], P = 1, initRows = [], and countSys given by numPassing, the
agreement and support conditions hold, yet 0 rounds leave count 1 while #sat = 0.
Concrete Fin n specialization of Lemma 6.2: under hn : 1 ≤ n and hP : 1 ≤ P, 3 * n
greedy rounds yield N(A) = #F and D(A) = 0.
Encodings for native IndexFold certificates #
Binary encoding of the live streaming accumulator ((m, P), (rows, bestOpt)).
Instances For
Native IndexFold certificates and ComputableInO / ComputableInPolySpace bounds #
Candidate test row decoded and materialized from an IndexFold state (j, acc).
Instances For
Existing parity-test rows extended with the candidate row at IndexFold state s.
Instances For
Update SelectBestAcc after evaluating the candidate score p.2 at IndexFold state p.1.
Instances For
Native callback certificate for one candidate step selectBestStep countSys.
Instances For
Native streaming machine certificate for selectBestTestRow via IndexFold.certificate, for a
fixed counter (countSys, cCount) supplied before runtime inputs (m, P, rows).
Instances For
Native machine certificate for the 3 * n-round greedyParityRows procedure for a fixed
counter (countSys, cCount).
Here countSys and cCount are fixed before the runtime inputs (n, m, P, rows) encoded by
encGreedyIn; neither the original CNF nor an arbitrary encoded context is an input to this
machine, and choosing a separate countSys per φ allows a different machine and polynomial per
φ. Uniform composition with a variable-CNF Theorem 2.2 counter requires a captured-context
certificate interface (such as a counter on (context, rows) retaining and charging context
throughout the loop).
Instances For
Live-state length bounds and ComputableInO / ComputableInPolySpace theorems #
Live accumulator length bound during IndexFold.run (selectBestStep countSys), independent of
the number k of visited candidates.
Fixed-counter per-round ComputableInO time and polynomial-workspace bound for
selectBestTestRow (with countSys and cCount fixed before runtime inputs (m, P, rows)).
Fixed-counter 3n-round ComputableInO time and polynomial-workspace bound for
greedyParityRows. For fixed countSys and cCount (supplied before runtime inputs
(n, m, P, rows)), runs in time O((3 * n + 1) * ((2 * m) ^ P + 1) * (poly(|input|) + R)) and
polynomial workspace O(poly(|input|)), never storing (2 * m) ^ P lists or counts
([OAI26c], §6.3, p. 43).
For a fixed counter (countSys, cCount) using polynomial workspace, greedyParityRows runs in
polynomial space on runtime inputs (n, m, P, rows).