Exact physical pointer-input box products #
The public endpoint accepts actual external raw arrays and interleaved query occurrences, including duplicates. It computes its own layout, gathers directly into the snapshot, executes the unchanged mathematical back end and returns physically exact signed answers. The private low payload may be dirty; the five scalar words and appended threshold are original input data.
theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.PointerBoxProduct.exec {W b m t N s r q : ℕ} (X : Matrix (Fin N) (Fin (MatrixMultiplication.Schonhage.D m)) ℤ) (Y : Matrix (Fin (MatrixMultiplication.Schonhage.D m)) (Fin N) ℤ) (qs : List (Fin N × Fin N)) (x : WordRAM.Data 173) (hb : x.regs Reg.base = b) (hs : x.regs Reg.left = s) (hr : x.regs Reg.right = r) (hq : x.regs Reg.queries = q) (hheader : ∀ a < 5, x.mem (b + a) = (WordRAM.State.init (BoxProduct.input true (21 * m) t X Y qs)).data.mem a) (hthreshold : x.mem (b + QueriedProduct.inputEnd m N qs.length) = t) (hsb : s + N * MatrixMultiplication.Schonhage.D m ≤ b) (hrb : r + N * MatrixMultiplication.Schonhage.D m ≤ b) (hqb : q + 2 * qs.length ≤ b) (hleft :
∀ a < N * MatrixMultiplication.Schonhage.D m,
x.mem (s + a) = (WordRAM.State.init (BoxProduct.input true (21 * m) t X Y qs)).data.mem (5 + a)) (hright :
∀ a < N * MatrixMultiplication.Schonhage.D m,
x.mem (r + a) = (WordRAM.State.init (BoxProduct.input true (21 * m) t X Y qs)).data.mem
(5 + N * MatrixMultiplication.Schonhage.D m + a)) (hqueries :
∀ a < 2 * qs.length,
x.mem (q + a) = (WordRAM.State.init (BoxProduct.input true (21 * m) t X Y qs)).data.mem
(5 + 2 * (N * MatrixMultiplication.Schonhage.D m) + a)) (hX : ∀ (i : Fin N) (k : Fin (MatrixMultiplication.Schonhage.D m)), 0 ≤ X i k ∧ X i k ≤ 1) (hY : ∀ (k : Fin (MatrixMultiplication.Schonhage.D m)) (j : Fin N), 0 ≤ Y k j ∧ Y k j ≤ 1) (ht : t ≤ m) (hN : MatrixMultiplication.Schonhage.D m ^ 18 ≤ N) (hfit : WordRAM.Fits W (2 * b + 4 * CallableProduct.windowSize N qs.length + 1024)) :
∃ (y : WordRAM.Data 173),
WordRAM.ExecWithin W program x y (timeBound m t qs) ∧ y.regs (callableBank CallableProduct.Reg.result) = b + QueriedProduct.outputBase (21 * m) m N qs.length ∧ (∀ (i : Fin qs.length),
y.mem (b + (QueriedProduct.outputBase (21 * m) m N qs.length + ↑i)) = WordRAM.Signed.encode ((X * Y) (qs.get i).1 (qs.get i).2)) ∧ (∀ a < QueriedProduct.inputEnd m N qs.length + 1,
y.mem (b + a) = (WordRAM.State.init (BoxProduct.input true (21 * m) t X Y qs)).data.mem a) ∧ (∀ (a : ℕ), a < b ∨ b + CallableProduct.windowSize N qs.length ≤ a → y.mem a = x.mem a) ∧ y.regs Reg.left = s ∧ y.regs Reg.right = r ∧ y.regs Reg.queries = q
Execute fixed pointer code from actual external readback, without a solver certificate.
theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.PointerBoxProduct.timeBound_ledger (m t : ℕ) {N : ℕ} (qs : List (Fin N × Fin N)) :
CallableBoxProduct.timeBound m t qs + gatherTime (N * MatrixMultiplication.Schonhage.D m) qs.length = timeBound m t qs + 3 * (7 * QueriedProduct.inputEnd m N qs.length + 10)
Allowance identity relating CallableBoxProduct.timeBound plus gatherTime to timeBound
plus the translated snapshot-copy term.
One fixed flat native instruction list, returning the physical answer pointer.
theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.PointerBoxProduct.nativeCode_fixed :
Pointer gathering retains fixed code and does not inspect the physical word width.