Theorem 3.1 — many targets in a window: decide in word-RAM time ,
DisprovedAlmostLinSubsetSum.Main.theorem_3_1Theorem 3.1 (p. 14). Fix and . Let with integers . Let be a multiset of integer vectors from , and let be a set of targets with for some and integer . We can determine whether in deterministic time , where is the target window size. Time is measured in the word-RAM model, with words of bits; if some , the window misses and we reject at once.
Formally: for every there is a width constant , fixed before . For every real there are one program and such that for all , all and items , every integer , every and every list of distinct offsets (the targets ), at word width with and on any memory content outside the input, halts within
steps and outputs if some target is a subset sum and otherwise. The 'reject at once' remark is a property of the input layout (the length word of each coordinate of ), not a separate clause.
Differences from the source:
- encoding: a multiset {a_1, …, a_n} of items and 'Σ_{i∈I} a_i = t for some I ⊆ {1,…,n}' → a list a : Fin n → ℤ^d (0-based, repetitions allowed) and sums over index subsets I : Finset (Fin n); reason: the sub-multisets of a multiset are exactly the index subsets of an explicit listing
- encoding: a set T ⊆ o + τ·Q of targets → a duplicate-free list of offsets x = t − o with |x_j| ≤ τN_j, in any order, written after |T|; reason: every such finite set has such listings and the answer does not depend on the order
- encoding: integers in the input (no layout given) → every input integer written as encInt: sign word, length word min(L, 2^w − 1), then the L base-2^w digits; answer = one-word output [1] or [0]; reason: all digits are retained and every word is below 2^w; comparison with an O(1)-word bound rejects oversized coordinates from the length word, otherwise reads O(1) digits; a saturated length need not be skipped because an oversized target or center permits immediate rejection
- reading: words of Θ_d(log(nτ|Q| + 2)) bits → width c_w(⌊log₂(nτ|Q| + 2)⌋ + 1) for a constant c_w ≥ 1 chosen for d before ε, followed by P and C for (d, ε); reason: explicit Θ_d dependence: c_w depends only on d; P and the running-time constant may depend on d and ε
- reading: O_{d,ε}(n + w^{1+ε}) → ∃ C > 0 fixed with the program before the instance: steps ≤ C(n + w^{1+ε}), w = ∏j(2τN_j + 1), real power; reason: explicit form of O{d,ε}; w = |τ·Q| for integer half-widths
- reading: 'the word-RAM model' (no instruction set named) → the published CentralStrQ_Machine (Hagerup's multiplication instruction set plus unsigned division and modulo, unit cost per instruction, memory arbitrary outside the input; a run must halt); reason: the standard word RAM with all standard arithmetic operations; it adds no condition on inputs
import Mathlib import Definitions.Def_CentralStrQ_Machine import Definitions.Def_AlmostLinSubsetSum_Main_Basic import Definitions.Def_AlmostLinSubsetSum_Main_Encoding set_option autoImplicit false
namespace AlmostLinSubsetSum.Main
/-- **Theorem 3.1** (Chen, Mao, Zhang 2026, p. 14). Fix `d ≥ 1` and `ε > 0`. Let
`Q = ∏_{j=1}^d [−N_j, N_j]` with integers `N_j ≥ 1`, `V = {v_1, …, v_n}` a multiset of integer
vectors from `Q`, and `T` a set of targets with `T ⊆ o + τ · Q` for some `o ∈ ℤ^d` and integer
`τ ≥ 1`. We can determine whether `S(V) ∩ T ≠ ∅` in deterministic time `O_{d,ε}(n + w^{1+ε})`,
where `w = |τ · Q| = ∏_j (2τN_j + 1)`; time is measured in the word-RAM model with words of
`Θ_d(log(nτ|Q| + 2))` bits.
Here: `c_w ≥ 1` is fixed for `d` before `ε`; one program `P` and `C > 0` are then fixed
for `(d, ε)` before the instance. The
input is `n, N, τ, o`, the items, `|T|` and the targets as offsets `t − o` (each integer as
`encInt`; `T` listed without repetition, in any order); at word width
`c_w (⌊log₂(nτ|Q| + 2)⌋ + 1)`, `|Q| = ∏_j (2N_j + 1)`, and on any memory outside the input,
`P` halts within `C (n + w^{1+ε})` steps with output `[1]` if some target is a subset sum and
`[0]` otherwise. -/
theorem theorem_3_1 :
∀ d : ℕ, 1 ≤ d → ∃ cw : ℕ, 1 ≤ cw ∧
∀ ε : ℝ, 0 < ε →
∃ P : CentralStrQ.Program, ∃ C : ℝ, 0 < C ∧
∀ (N : Fin d → ℕ), (∀ j, 1 ≤ N j) →
∀ (n : ℕ) (v : Fin n → Fin d → ℤ), (∀ i j, |v i j| ≤ (N j : ℤ)) →
∀ (τ : ℕ), 1 ≤ τ → ∀ (o : Fin d → ℤ) (offs : List (Fin d → ℤ)), offs.Nodup →
(∀ x ∈ offs, ∀ j, |x j| ≤ ((τ * N j : ℕ) : ℤ)) →
∀ (w : WordRAM.Width),
w.bits = cw * (Nat.log 2 (n * τ * ∏ j, (2 * N j + 1) + 2) + 1) →
∀ (rest : WordRAM.Memory w),
CentralStrQ.RunsWithin P (CentralStrQ.loadMem (windowInput w N v τ o offs) rest)
(C * ((n : ℝ) + ((∏ j, (2 * τ * N j + 1) : ℕ) : ℝ) ^ (1 + ε)))
(fun mem reach => CentralStrQ.OutputsAt mem
[boolWord (∃ x ∈ offs, o + x ∈ subsetSums Finset.univ v)] reach) := by sorry
end AlmostLinSubsetSum.Main
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.