OctoInform Beta

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

The base, the masks and the unique scale: For L>0L > 0 a unique 2w2^w lies in (2L,4L](2L, 4L], and any solution fixes the halt record, final clock, and zero-branch counter digits

Packed run traces satisfy the scaled counter system.

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

Given a deterministic counter machine MM and initial counter values dd, one wants to represent a halting run of MM by a single tuple of natural numbers whose base-BB digits record the machine state, active branch, and counter values at each step. The base is a power B=2wB = 2^w with B=4bB = 4b for b∈ℕb \in \mathbb{N}, large enough for every counter value to stay below B/2B/2 without carries between steps and for an auxiliary counter, the clock, that increases by one at each step.

Counter machines

A counter instruction over a finite state set QQ and a finite counter index set JJ is an operation of one of three kinds: halt; increment a counter j∈Jj \in J and go to a state p∈Qp \in Q, written INC⁡(j,p)\operatorname{INC}(j, p); or test a counter j∈Jj \in J with zero-branch state p0∈Qp_0 \in Q and decrement-branch state pd∈Qp_d \in Q, written TESTDEC⁡(j,p0,pd)\operatorname{TESTDEC}(j, p_0, p_d).

A counter machine MM over QQ and JJ is a triple (ι,q*,h)(\iota, q_*, h) consisting of an instruction map ι\iota assigning a counter instruction over QQ and JJ to each state in QQ, a start state q*∈Qq_* \in Q, and a halting state h∈Qh \in Q such that ι(q)\iota(q) is the halt instruction if and only if q=hq = h.

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

The one-step transition σM(c)\sigma_M(c) of MM at a configuration c=(q,α)c = (q, \alpha) is the configuration obtained by executing ι(q)\iota(q): if ι(q)\iota(q) is the halt instruction, then σM(c)=c\sigma_M(c) = c; if ι(q)=INC⁡(j,p)\iota(q) = \operatorname{INC}(j, p), then σM(c)=(p,α′)\sigma_M(c) = (p, \alpha') where α′(j)=α(j)+1\alpha'(j) = \alpha(j) + 1 and α′(i)=α(i)\alpha'(i) = \alpha(i) for i≠ji \neq j; and if ι(q)=TESTDEC⁡(j,p0,pd)\iota(q) = \operatorname{TESTDEC}(j, p_0, p_d), then σM(c)=(p0,α)\sigma_M(c) = (p_0, \alpha) when α(j)=0\alpha(j) = 0, and σM(c)=(pd,α″)\sigma_M(c) = (p_d, \alpha'') when α(j)>0\alpha(j) > 0, where α″(j)=α(j)−1\alpha''(j) = \alpha(j) - 1 and α″(i)=α(i)\alpha''(i) = \alpha(i) for i≠ji \neq j.

For initial counter values d:J→ℕd \colon J \to \mathbb{N} and a step count t∈ℕt \in \mathbb{N}, the run run⁡M(d,t)\operatorname{run}_M(d, t) of MM on dd for tt steps is the configuration σMt(q*,d)\sigma_M^t(q_*, d) obtained by applying σM\sigma_M to (q*,d)(q_*, d) a total of tt times.

The machine MM, started on dd, halts at step T∈ℕT \in \mathbb{N} if the state of run⁡M(d,T)\operatorname{run}_M(d, T) is hh and for every t<Tt < T the state of run⁡M(d,t)\operatorname{run}_M(d, t) differs from hh.✦

Base-BB packing

For a base B∈ℕB \in \mathbb{N}, a natural number xx, and a position t∈ℕt \in \mathbb{N}, the base-BB digit δB(x,t)\delta_B(x, t) of xx at position tt is the natural number δB(x,t)=⌊x/Bt⌋mod⁡B.\delta_B(x, t) = \lfloor x / B^t \rfloor \bmod B.(1)✦

For B,k∈ℕB, k \in \mathbb{N} and a sequence f:ℕ→ℕf \colon \mathbb{N} \to \mathbb{N}, the base-BB packing pack⁡B(k,f)\operatorname{pack}_B(k, f) of length kk is the natural number pack⁡B(k,f)=∑t=0k−1f(t)Bt.\operatorname{pack}_B(k, f) = \sum_{t=0}^{k-1} f(t) B^t.(2)

For B,k∈ℕB, k \in \mathbb{N}, the all-ones packed number 𝟏B,k\mathbf{1}_{B, k} of length kk in base BB is the value of the packing (2) on the constant sequence 11, 𝟏B,k=pack⁡B(k,t↦1)=∑t=0k−1Bt.\mathbf{1}_{B, k} = \operatorname{pack}_B(k, t \mapsto 1) = \sum_{t=0}^{k-1} B^t.(3)

Bitwise domination

For natural numbers xx and yy, xx is bitwise dominated by yy, written x≼yx \preceq y, if every base-22 digit (1) of xx is at most that of yy: ⌊x/2i⌋mod⁡2≤⌊y/2i⌋mod⁡2for all i∈ℕ.\lfloor x / 2^i \rfloor \bmod 2 \le \lfloor y / 2^i \rfloor \bmod 2 \qquad \text{for all } i \in \mathbb{N}.(4)

The base constant

For a finite state set QQ, a finite counter index set JJ, and initial counter values d:J→ℕd \colon J \to \mathbb{N}, the base constant CC is the natural number C=1+|Q|+∑j∈Jd(j).C = 1 + |Q| + \sum_{j \in J} d(j).(5)✦

The halting witness tuple

Let J*=J∪{⋆}J^* = J \cup \{\star\} with ⋆∉J\star \notin J be the counter index set augmented by a clock index ⋆\star. A halting witness tuple collects the natural auxiliary variables whose complete tuple solves the system exactly when the counter machine halts. A halting witness tuple vv for QQ and JJ is a tuple (w,B,b,k,H,ℓ,m,s,z,u,z‾,x,f,r)(w, B, b, k, H, \ell, m, s, z, u, \bar{z}, x, f, r) consisting of natural numbers w,B,b,k,H,ℓ,m∈ℕw, B, b, k, H, \ell, m \in \mathbb{N}, state records s,z,u,z‾:Q→ℕs, z, u, \bar{z} \colon Q \to \mathbb{N}, and counter records x,f,r:J*→ℕx, f, r \colon J^* \to \mathbb{N}.

Transition flows

For a counter machine M=(ι,q*,h)M = (\iota, q_*, h) over QQ and JJ, a state q∈Qq \in Q, and a branch index β∈{0,1}\beta \in \{0, 1\}, the transition target dest⁡M(q,β)∈Q∪{⊥}\operatorname{dest}_M(q, \beta) \in Q \cup \{\bot\} (with ⊥∉Q\bot \notin Q) is pp when ι(q)=INC⁡(j,p)\iota(q) = \operatorname{INC}(j, p) and β=0\beta = 0, p0p_0 when ι(q)=TESTDEC⁡(j,p0,pd)\iota(q) = \operatorname{TESTDEC}(j, p_0, p_d) and β=0\beta = 0, pdp_d when ι(q)=TESTDEC⁡(j,p0,pd)\iota(q) = \operatorname{TESTDEC}(j, p_0, p_d) and β=1\beta = 1, and ⊥\bot in all remaining cases.

For a halting witness tuple v=(w,B,b,k,H,ℓ,m,s,z,u,z‾,x,f,r)v = (w, B, b, k, H, \ell, m, s, z, u, \bar{z}, x, f, r), a state q∈Qq \in Q, and β∈{0,1}\beta \in \{0, 1\}, the arc count arc⁡M(v,q,β)∈ℕ\operatorname{arc}_M(v, q, \beta) \in \mathbb{N} is s(q)s(q) when ι(q)=INC⁡(j,p)\iota(q) = \operatorname{INC}(j, p) and β=0\beta = 0, z(q)z(q) when ι(q)=TESTDEC⁡(j,p0,pd)\iota(q) = \operatorname{TESTDEC}(j, p_0, p_d) and β=0\beta = 0, u(q)u(q) when ι(q)=TESTDEC⁡(j,p0,pd)\iota(q) = \operatorname{TESTDEC}(j, p_0, p_d) and β=1\beta = 1, and 00 in all remaining cases.

For a counter machine MM over QQ and JJ, a halting witness tuple vv for QQ and JJ, and a state p∈Qp \in Q, the incoming flow in⁡M(v,p)∈ℕ\operatorname{in}_M(v, p) \in \mathbb{N} is in⁡M(v,p)=∑q∈Q,β∈{0,1}dest⁡M(q,β)=parc⁡M(v,q,β).\operatorname{in}_M(v, p) = \sum_{\substack{q \in Q,\; \beta \in \{0, 1\} \\ \operatorname{dest}_M(q, \beta) = p}} \operatorname{arc}_M(v, q, \beta).(6)✦

For a counter machine MM over QQ and JJ, a halting witness tuple vv for QQ and JJ, and a counter j∈Jj \in J, the increment total inc⁡M(v,j)∈ℕ\operatorname{inc}_M(v, j) \in \mathbb{N} is inc⁡M(v,j)=∑q∈Qι(q)=INC⁡(j,p)s(q).\operatorname{inc}_M(v, j) = \sum_{\substack{q \in Q \\ \iota(q) = \operatorname{INC}(j, p)}} s(q).(7)✦

For a counter machine MM over QQ and JJ, a halting witness tuple vv for QQ and JJ, and a counter j∈Jj \in J, the decrement total dec⁡M(v,j)∈ℕ\operatorname{dec}_M(v, j) \in \mathbb{N} is dec⁡M(v,j)=∑q∈Qι(q)=TESTDEC⁡(j,p0,pd)u(q).\operatorname{dec}_M(v, j) = \sum_{\substack{q \in Q \\ \iota(q) = \operatorname{TESTDEC}(j, p_0, p_d)}} u(q).(8)✦

The scaled counter system

Given a counter machine M=(ι,q*,h)M = (\iota, q_*, h) over QQ and JJ, initial counter values d:J→ℕd \colon J \to \mathbb{N}, and a halting witness tuple v=(w,B,b,k,H,ℓ,m,s,z,u,z‾,x,f,r)v = (w, B, b, k, H, \ell, m, s, z, u, \bar{z}, x, f, r), the scaled counter system 𝒮M,d(v)\mathcal{S}_{M, d}(v) is the predicate stating that vv satisfies the constraints below, using the base constant (5), bitwise domination (4), and the flows (6), (7), and (8).

First, the scale parameters satisfy B=2wB = 2^w, B=4bB = 4b, 2C<B2C < B, 0<k0 < k, H=BkH = B^k, Bℓ=HB\ell = H, and (B−1)m=H−1(B - 1)m = H - 1.

Second, for every q∈Qq \in Q, the state records satisfy s(q)≼ms(q) \preceq m, ∑q∈Qs(q)=m\sum_{q \in Q} s(q) = m, and s(q)=𝟏q=q*+Bin⁡M(v,q)s(q) = \mathbf{1}_{q = q_*} + B\operatorname{in}_M(v, q), where 𝟏q=q*\mathbf{1}_{q = q_*} is 11 if q=q*q = q_* and 00 otherwise; if ι(q)\iota(q) is a test instruction then z(q)≼s(q)z(q) \preceq s(q), u(q)≼s(q)u(q) \preceq s(q), z(q)+u(q)=s(q)z(q) + u(q) = s(q), and z(q)+z‾(q)=mz(q) + \bar{z}(q) = m, and otherwise z(q)=u(q)=z‾(q)=0z(q) = u(q) = \bar{z}(q) = 0.

Third, for every α∈J*\alpha \in J^*, the counter records satisfy x(α)≼(2b−1)mx(\alpha) \preceq (2b - 1)m, x(α)=f(α)ℓ+r(α)x(\alpha) = f(\alpha)\ell + r(\alpha), and r(α)<ℓr(\alpha) < \ell; for every j∈Jj \in J, x(j)+Bdec⁡M(v,j)=d(j)+B(r(j)+inc⁡M(v,j))x(j) + B\operatorname{dec}_M(v, j) = d(j) + B(r(j) + \operatorname{inc}_M(v, j)); for every q∈Qq \in Q with ι(q)=TESTDEC⁡(j,p0,pd)\iota(q) = \operatorname{TESTDEC}(j, p_0, p_d), x(j)≼(B−1)z‾(q)x(j) \preceq (B - 1)\bar{z}(q); and the clock satisfies x(⋆)+Bℓ=C+B(r(⋆)+m)x(\star) + B\ell = C + B(r(\star) + m), b≤f(⋆)b \le f(\star), and 2f(⋆)<B2f(\star) < B.

The packed run trace

For a configuration c=(q′,α)c = (q', \alpha) of MM and a state q∈Qq \in Q, the state indicator χst(c,q)\chi_{\mathrm{st}}(c, q) is 11 if q=q′q = q' and 00 otherwise.✦

For a configuration c=(q′,α)c = (q', \alpha) of MM and a state q∈Qq \in Q, the zero-branch indicator χ0(M,c,q)\chi_0(M, c, q) is 11 if q=q′q = q', ι(q)=TESTDEC⁡(j,p0,pd)\iota(q) = \operatorname{TESTDEC}(j, p_0, p_d) for some j∈Jj \in J and p0,pd∈Qp_0, p_d \in Q, and α(j)=0\alpha(j) = 0, and is 00 otherwise.

For a configuration c=(q′,α)c = (q', \alpha) of MM and a state q∈Qq \in Q, the decrement-branch indicator χ−(M,c,q)\chi_-(M, c, q) is 11 if q=q′q = q', ι(q)=TESTDEC⁡(j,p0,pd)\iota(q) = \operatorname{TESTDEC}(j, p_0, p_d) for some j∈Jj \in J and p0,pd∈Qp_0, p_d \in Q, and α(j)≠0\alpha(j) \neq 0, and is 00 otherwise.

For initial counter values d:J→ℕd \colon J \to \mathbb{N}, an extended index α∈J*\alpha \in J^*, and a step t∈ℕt \in \mathbb{N}, the time-tt value val⁡M,d(α,t)\operatorname{val}_{M, d}(\alpha, t) is C+tC + t when α=⋆\alpha = \star, and is the value of counter jj in run⁡M(d,t)\operatorname{run}_M(d, t) when α=j∈J\alpha = j \in J.✦

The packed run trace gives the base-BB encoding of a run’s configurations in which each time step occupies one block of ww binary digits. Given MM, initial counter values d:J→ℕd \colon J \to \mathbb{N}, and natural numbers B,w,b,TB, w, b, T, write ct=run⁡M(d,t)c_t = \operatorname{run}_M(d, t). Using the packing (2) and the all-ones packed number (3), the packed run trace τ(M,d,B,w,b,T)\tau(M, d, B, w, b, T) is the halting witness tuple (w,B,b,T+1,BT+1,BT,𝟏B,T+1,s,z,u,z‾,x,f,r)(w, B, b, T + 1, B^{T+1}, B^T, \mathbf{1}_{B, T+1}, s, z, u, \bar{z}, x, f, r) whose record components are given by s(q)=pack⁡B(T+1,t↦χst(ct,q)),z(q)=pack⁡B(T+1,t↦χ0(M,ct,q)),u(q)=pack⁡B(T+1,t↦χ−(M,ct,q)),z‾(q)={pack⁡B(T+1,t↦1−χ0(M,ct,q))if ι(q) is a test instruction,0otherwise,\begin{aligned} s(q) &= \operatorname{pack}_B(T + 1, t \mapsto \chi_{\mathrm{st}}(c_t, q)), \\ z(q) &= \operatorname{pack}_B(T + 1, t \mapsto \chi_0(M, c_t, q)), \\ u(q) &= \operatorname{pack}_B(T + 1, t \mapsto \chi_-(M, c_t, q)), \\ \bar{z}(q) &= \begin{cases} \operatorname{pack}_B(T + 1, t \mapsto 1 - \chi_0(M, c_t, q)) & \text{if $\iota(q)$ is a test instruction,} \\ 0 & \text{otherwise,} \end{cases} \end{aligned}(9) for each q∈Qq \in Q, and x(α)=pack⁡B(T+1,t↦val⁡M,d(α,t)),f(α)=val⁡M,d(α,T),r(α)=pack⁡B(T,t↦val⁡M,d(α,t)),\begin{aligned} x(\alpha) &= \operatorname{pack}_B(T + 1, t \mapsto \operatorname{val}_{M, d}(\alpha, t)), \\ f(\alpha) &= \operatorname{val}_{M, d}(\alpha, T), \\ r(\alpha) &= \operatorname{pack}_B(T, t \mapsto \operatorname{val}_{M, d}(\alpha, t)), \end{aligned}(10) for each α∈J*\alpha \in J^*.

The claim

Theorem. First, for every natural number L>0L > 0, there is a unique w∈ℕw \in \mathbb{N} such that 2L<2w≤4L.2L < 2^w \le 4L.(11)✦

Second, let M=(ι,q*,h)M = (\iota, q_*, h) be a counter machine over a finite state set QQ and a finite counter index set JJ, let d:J→ℕd \colon J \to \mathbb{N} be initial counter values, and let v=(w,B,b,k,H,ℓ,m,s,z,u,z‾,x,f,r)v = (w, B, b, k, H, \ell, m, s, z, u, \bar{z}, x, f, r) be a halting witness tuple satisfying 𝒮M,d(v)\mathcal{S}_{M, d}(v). Then the halt record s(h)s(h) equals ℓ\ell, the marker of the last digit, s(h)=ℓ,s(h) = \ell,(12)✦ and the final value of the clock satisfies f(⋆)=C+(k−1).f(\star) = C + (k - 1).(13)✦ Moreover, if q∈Qq \in Q has instruction ι(q)=TESTDEC⁡(j,p0,pd)\iota(q) = \operatorname{TESTDEC}(j, p_0, p_d) for some j∈Jj \in J and p0,pd∈Qp_0, p_d \in Q, and t<kt < k satisfies δB(z(q),t)=1\delta_B(z(q), t) = 1, then δB(x(j),t)=0.\delta_B(x(j), t) = 0.(14)✦

Third, for any counter machine MM over QQ and JJ, initial counter values d:J→ℕd \colon J \to \mathbb{N}, and natural numbers B,w,b,TB, w, b, T such that MM started on dd halts at step TT, B=2wB = 2^w, w>0w > 0, b>0b > 0, B=4bB = 4b, 2(C+T)<B2(C + T) < B, and b≤C+Tb \le C + T, the packed run trace satisfies the scaled counter system: 𝒮M,d(τ(M,d,B,w,b,T)).\mathcal{S}_{M, d}(\tau(M, d, B, w, b, T)).(15)✦

What is checked

The unique-scale claim (11) is stated over positive natural numbers LL; the invariants (12), (13), and (14) are stated over any halting witness tuple vv satisfying the scaled counter system 𝒮M,d(v)\mathcal{S}_{M, d}(v) for a counter machine MM over finite sets QQ and JJ and initial counter values d:J→ℕd \colon J \to \mathbb{N}; and the trace claim (15) is stated over the packed run trace defined by (9) and (10) for a run of MM on dd halting at step TT under the stated bounds on BB, ww, and bb.