Documentation

CslibFrontier.Computability.TreeEval.Ary.IterativePacked

Iterative packed Cook–Mertz with counter-based gate updates #

Instantiate the existing control loop with the counter implementation of finite-grid interpolation. The resulting loop adds the encoded tree value to its target and restores the other registers, from arbitrary initial contents. It uses the existing tree model and packed encoding contract, with the strict finite-field degree threshold.

Main results #

This is pure iterative correctness. Native lookup, original-input subroutine composition and the complete machine-space certificate are not supplied by this result.

theorem Cslib.TreeEval.Ary.Iter.exists_runFrom_counter_root {p s d b r : ℕ} [Fact (Nat.Prime p)] (hd : 0 < d) (hs : 0 < s) (h : Fin s ↪ ZMod p) (hh : ∀ (a : Fin s), h a = ↑↑a) (encode : (Fin b → Bool) → Fin r → Fin s) (decode : (Fin r → Fin s) → Fin b → Bool) (hdecode : Function.LeftInverse decode encode) (hD : d * r * (s - 1) < p - 1) {us : List (ZMod p)ˣ} (hnd : us.Nodup) (hmem : ∀ (u : (ZMod p)ˣ), u ∈ us) {height : ℕ} (T : Tree d b height) (S : State (ZMod p) d r) (c : ZMod p) (t : Fin (d + 1)) :
∃ (N : ℕ), runFrom hd (fun (v : Fin b → Bool) (i : Fin r) => h (encode v i)) (Packed.counterGateExtension hs encode decode) us T.nodeAt (initialCfg S c t) N = { regs := Function.update S t (S t + c • fun (i : Fin r) => h (encode T.eval i)), stack := [], mode := Mode.ret }

A packed root call using the counter-based gate extension adds the encoded root value and preserves every other global register. The encoding has a left inverse.