Documentation

CslibFrontier.Computability.TreeEval.Ary.Packed.Executable

Counter implementation of packed gate extensions #

The existing finite-grid gate extension is computed by the counter-based interpolation loop. A table query decodes one assignment index, calls the Boolean gate and encodes one output chunk. This connects the packed algebra to the gate update of the iterative controller, without constructing a truth table or a polynomial representation at runtime.

Main definitions #

Main results #

This is functional correctness of the inner loop. Native gate queries and their composition with the caller's original input still require a separate resource certificate.

def Cslib.TreeEval.Ary.Packed.counterGateExtension {p s b d r : ℕ} (hs : 0 < s) (encode : (Fin b → Bool) → Fin r → Fin s) (decode : (Fin r → Fin s) → Fin b → Bool) (f : Gate d b) (x : Fin d → Fin r → ZMod p) (i : Fin r) :

Compute one chunk of a gate extension using the finite-grid counter loops. The point and one requested table value are passed to the arithmetic loop; no table is materialized.

theorem Cslib.TreeEval.Ary.Packed.counterGateExtension_eq {p s b d r : ℕ} [Fact (Nat.Prime p)] (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) (f : Gate d b) (x : Fin d → Fin r → ZMod p) (i : Fin r) :
counterGateExtension hs encode decode f x i = gateExtension h encode decode f x i

The counter loop computes the same packed extension as the existing low-degree algebra. The full alphabet, not only the encoded values, must embed in the selected field.