OctoInform Beta

OpenAI preprint, September 2026 · §7. One witness for a halting computation · §7

Proposition 7.2: For any counter machine with finitely many states and counters, halting from initial values has a unique polynomial witness via an equation system

Halting of a counter machine is single-fold.

Hover over a blue or green term in the text, or a node in the graph, to find it in the other. Select it to read its declaration both in Lean and in words.

The setting

A counter machine has finitely many states and finitely many counters holding natural numbers ℕ={0,1,2,…}\mathbb{N} = \{0, 1, 2, \ldots\}, and halts if, starting from its start state and a given initial counter vector, it reaches its halt state. The question is whether halting, viewed as a relation on the initial counter vector, has a Diophantine representation whose auxiliary witness tuple is uniquely determined by the input.

Single-fold relations

For an index set α\alpha and a relation RR on tuples u:α→ℕu \colon \alpha \to \mathbb{N}, a unique-witness representation of RR consists of a finite set WW of unknowns and an integer polynomial FF in the argument variables indexed by α\alpha and the unknown variables indexed by WW such that, for every u:α→ℕu \colon \alpha \to \mathbb{N}, R(u)R(u) holds if and only if F(u,z)=0F(u, z) = 0 for some z:W→ℕz \colon W \to \mathbb{N}, and whenever F(u,z)=0F(u, z) = 0 and F(u,z′)=0F(u, z') = 0 for z,z′:W→ℕz, z' \colon W \to \mathbb{N}, we have z=z′z = z'.✦

A relation RR on tuples α→ℕ\alpha \to \mathbb{N} is single-fold, written SF(R)\mathrm{SF}(R), when RR admits a unique-witness representation.✦

Counter machines

For a state set QQ and a counter index set JJ, a counter machine instruction is one of three kinds: a halt instruction HALT\operatorname{HALT}; an increment instruction INC⁡(j,p)\operatorname{INC}(j, p) for j∈Jj \in J and p∈Qp \in Q; or a test-and-decrement instruction TESTDEC⁡(j,p0,pd)\operatorname{TESTDEC}(j, p_0, p_d) for j∈Jj \in J and p0,pd∈Qp_0, p_d \in Q.✦

A counter machine MM with state set QQ and counter index set JJ consists of an instruction map instrM\mathrm{instr}_M assigning an instruction to each state in QQ, a start state q*∈Qq_* \in Q, and a halt state h∈Qh \in Q such that instrM(q)=HALT\mathrm{instr}_M(q) = \operatorname{HALT} if and only if q=hq = h.

A machine configuration for MM is a pair (q,ν)(q, \nu) consisting of a state q∈Qq \in Q and a counter valuation ν:J→ℕ\nu \colon J \to \mathbb{N}.✦

The one-step transition δM\delta_M sends a configuration (q,ν)(q, \nu) to the configuration determined by instrM(q)\mathrm{instr}_M(q): if instrM(q)=HALT\mathrm{instr}_M(q) = \operatorname{HALT}, it leaves (q,ν)(q, \nu) unchanged; if instrM(q)=INC⁡(j,p)\mathrm{instr}_M(q) = \operatorname{INC}(j, p), it moves to (p,ν′)(p, \nu') with ν′(j)=ν(j)+1\nu'(j) = \nu(j) + 1 and ν′(i)=ν(i)\nu'(i) = \nu(i) for i≠ji \neq j; and if instrM(q)=TESTDEC⁡(j,p0,pd)\mathrm{instr}_M(q) = \operatorname{TESTDEC}(j, p_0, p_d), it moves to (p0,ν)(p_0, \nu) when ν(j)=0\nu(j) = 0 and otherwise to (pd,ν′)(p_d, \nu') with ν′(j)=ν(j)−1\nu'(j) = \nu(j) - 1 and ν′(i)=ν(i)\nu'(i) = \nu(i) for i≠ji \neq j.

For an initial counter vector d:J→ℕd \colon J \to \mathbb{N} and t∈ℕt \in \mathbb{N}, the run for tt steps, written runM(d,t)\mathrm{run}_M(d, t), is the tt-fold iterate δMt(q*,d)\delta_M^t(q_*, d).

The machine MM halts at step T∈ℕT \in \mathbb{N} on dd, written HaltsAt(M,d,T)\mathrm{HaltsAt}(M, d, T), when runM(d,T)\mathrm{run}_M(d, T) has state hh and for every t<Tt < T the configuration runM(d,t)\mathrm{run}_M(d, t) has state different from hh.

The machine MM halts on dd, written Halts(M,d)\mathrm{Halts}(M, d), when HaltsAt(M,d,T)\mathrm{HaltsAt}(M, d, T) holds for some T∈ℕT \in \mathbb{N}.

The halting equation system

For x,y∈ℕx, y \in \mathbb{N}, bitwise domination, written x≼yx \preceq y, holds when ⌊x/2i⌋mod⁡2≤⌊y/2i⌋mod⁡2\lfloor x / 2^i \rfloor \bmod 2 \le \lfloor y / 2^i \rfloor \bmod 2 for every i∈ℕi \in \mathbb{N}.

For a finite state set QQ, a finite counter index set JJ and an initial counter vector d:J→ℕd \colon J \to \mathbb{N}, the starting clock offset C(Q,d)C(Q, d) is the natural number 1+|Q|+∑j∈Jd(j)1 + |Q| + \sum_{j \in J} d(j).

Write J*=J∪{*}J_* = J \cup \{*\} with *∉J* \notin J for the counter index set augmented by a clock index **. A halting witness tuple vv for state set QQ and counter index set JJ consists of natural parameters w,B,b,k,H,ℓ,m∈ℕw, B, b, k, H, \ell, m \in \mathbb{N}, state and branch records S,Z,Δ,Z¯:Q→ℕS, Z, \Delta, \overline{Z} \colon Q \to \mathbb{N}, and counter and clock records c,f,r:J*→ℕc, f, r \colon J_* \to \mathbb{N}.✦

Fix a counter machine MM with finite state set QQ and finite counter index set JJ, and a halting witness tuple vv for QQ and JJ. For a state q∈Qq \in Q and branch index β∈{0,1}\beta \in \{0, 1\}, the transition target state destM(q,β)\mathrm{dest}_M(q, \beta) is pp when instrM(q)=INC⁡(j,p)\mathrm{instr}_M(q) = \operatorname{INC}(j, p) and β=0\beta = 0, p0p_0 when instrM(q)=TESTDEC⁡(j,p0,pd)\mathrm{instr}_M(q) = \operatorname{TESTDEC}(j, p_0, p_d) and β=0\beta = 0, pdp_d when instrM(q)=TESTDEC⁡(j,p0,pd)\mathrm{instr}_M(q) = \operatorname{TESTDEC}(j, p_0, p_d) and β=1\beta = 1, and undefined otherwise.

For q∈Qq \in Q and β∈{0,1}\beta \in \{0, 1\}, the arc count arcM,v(q,β)\mathrm{arc}_{M,v}(q, \beta) is S(q)S(q) when instrM(q)=INC⁡(j,p)\mathrm{instr}_M(q) = \operatorname{INC}(j, p) and β=0\beta = 0, Z(q)Z(q) when instrM(q)=TESTDEC⁡(j,p0,pd)\mathrm{instr}_M(q) = \operatorname{TESTDEC}(j, p_0, p_d) and β=0\beta = 0, Δ(q)\Delta(q) when instrM(q)=TESTDEC⁡(j,p0,pd)\mathrm{instr}_M(q) = \operatorname{TESTDEC}(j, p_0, p_d) and β=1\beta = 1, and 00 otherwise. The incoming flow at a state p∈Qp \in Q is inM,v(p)=∑(q,β)∈Q×{0,1}:destM(q,β)=parcM,v(q,β)\mathrm{in}_{M,v}(p) = \sum_{(q, \beta) \in Q \times \{0, 1\} : \mathrm{dest}_M(q, \beta) = p} \mathrm{arc}_{M,v}(q, \beta).

For a counter j∈Jj \in J, the increment total incM,v(j)\mathrm{inc}_{M,v}(j) is the sum of S(q)S(q) over all q∈Qq \in Q with instrM(q)=INC⁡(j,p)\mathrm{instr}_M(q) = \operatorname{INC}(j, p) for some p∈Qp \in Q✦, and the decrement total decM,v(j)\mathrm{dec}_{M,v}(j) is the sum of Δ(q)\Delta(q) over all q∈Qq \in Q with instrM(q)=TESTDEC⁡(j,p0,pd)\mathrm{instr}_M(q) = \operatorname{TESTDEC}(j, p_0, p_d) for some p0,pd∈Qp_0, p_d \in Q.

Write δq,q*=1\delta_{q, q_*} = 1 if q=q*q = q_* and δq,q*=0\delta_{q, q_*} = 0 if q≠q*q \neq q_*. A halting witness tuple vv satisfies the halting equation system for MM and an initial counter vector d:J→ℕd \colon J \to \mathbb{N} when B=2w,B=4b,2C(Q,d)<B,0<k,H=Bk,Bℓ=H,(B−1)m=H−1,S(q)≼m,∑q∈QS(q)=m,S(q)=δq,q*+BinM,v(q)(∀q∈Q),Z(q)≼S(q),Δ(q)≼S(q),Z(q)+Δ(q)=S(q),Z(q)+Z¯(q)=m(∀q∈Q with instrM(q)=TESTDEC⁡(j,p0,pd)),Z(q)=Δ(q)=Z¯(q)=0(∀q∈Q otherwise),c(ι)≼(2b−1)m,c(ι)=f(ι)ℓ+r(ι),r(ι)<ℓ(∀ι∈J*),c(j)+BdecM,v(j)=d(j)+B(r(j)+incM,v(j))(∀j∈J),c(j)≼(B−1)Z¯(q)(∀q∈Q with instrM(q)=TESTDEC⁡(j,p0,pd)),c(*)+Bℓ=C(Q,d)+B(r(*)+m),b≤f(*),2f(*)<B.\begin{aligned} & B = 2^w, \quad B = 4b, \quad 2C(Q, d) < B, \quad 0 < k, \quad H = B^k, \quad B\ell = H, \quad (B - 1)m = H - 1, \\ & S(q) \preceq m, \qquad \sum_{q \in Q} S(q) = m, \qquad S(q) = \delta_{q, q_*} + B\,\mathrm{in}_{M,v}(q) \quad (\forall q \in Q), \\ & Z(q) \preceq S(q),\; \Delta(q) \preceq S(q),\; Z(q) + \Delta(q) = S(q),\; Z(q) + \overline{Z}(q) = m \quad (\forall q \in Q \text{ with } \mathrm{instr}_M(q) = \operatorname{TESTDEC}(j, p_0, p_d)), \\ & Z(q) = \Delta(q) = \overline{Z}(q) = 0 \quad (\forall q \in Q \text{ otherwise}), \\ & c(\iota) \preceq (2b - 1)m, \qquad c(\iota) = f(\iota)\ell + r(\iota), \qquad r(\iota) < \ell \quad (\forall \iota \in J_*), \\ & c(j) + B\,\mathrm{dec}_{M,v}(j) = d(j) + B\bigl(r(j) + \mathrm{inc}_{M,v}(j)\bigr) \quad (\forall j \in J), \\ & c(j) \preceq (B - 1)\overline{Z}(q) \quad (\forall q \in Q \text{ with } \mathrm{instr}_M(q) = \operatorname{TESTDEC}(j, p_0, p_d)), \\ & c(*) + B\ell = C(Q, d) + B\bigl(r(*) + m\bigr), \qquad b \le f(*), \qquad 2f(*) < B. \end{aligned}(1)✦

The claim

Proposition 7.2. For every counter machine MM with finite state set QQ and finite counter index set JJ, the halting predicate on initial counter vectors d:J→ℕd \colon J \to \mathbb{N} satisfies SF(d↦Halts(M,d)).\mathrm{SF}\bigl(d \mapsto \mathrm{Halts}(M, d)\bigr).(2)✦

In the paper, the result reads: fix n≥1n \ge 1 and a deterministic counter machine with finitely many states and counters, instructions INC\operatorname{INC} and TESTDEC\operatorname{TESTDEC}, and one halt state, each counter initialized by a fixed choice of an input coordinate aia_i or zero; there is a finite system of integer polynomial equations in a∈ℕna \in \mathbb{N}^n and natural auxiliary variables whose complete auxiliary tuple has exactly one solution when the initialized machine halts and none when it does not.

In (2), the input tuple is the initial counter vector d:J→ℕd \colon J \to \mathbb{N} directly, and the single-fold representation consists of a single integer polynomial equation.

What is checked

Proposition 7.2 (2) is stated for a counter machine MM with finite state set QQ and finite counter index set JJ, its runs and halting predicate on initial counter vectors d:J→ℕd \colon J \to \mathbb{N}, and single-fold relations via unique-witness representations; the halting equation system (1) is stated over the same machine and input vector together with the starting clock offset CC, bitwise domination, a halting witness tuple vv, the incoming flows determined by transition target states and arc counts, and the counter increment and decrement totals.