Initialized flat box-table construction and actual lookup #
One fixed 64-register program computes the shared catalogue and a complete tile from the original arrays. The exact pre-halt state is the same witness used for all table readbacks and the charged final halt. Physical admission is an original-input logarithm. The lookup theorem remains separately callable, so geometry is not rebuilt per query.
theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.runs_wide {W L m t A B : ℕ} (a b : Fin (10 ^ L) → ℤ) (ha : ∀ (i : Fin (10 ^ L)), (a i).natAbs ≤ A) (hb : ∀ (i : Fin (10 ^ L)), (b i).natAbs ≤ B) (hW : admissionWidth L m t A B ≤ W) :
WordRAM.InputFits W (input L m t a b) ∧ ∃ (y : WordRAM.Data registers) (n : ℕ),
n + 1 ≤ timeBound L m t ∧ WordRAM.Runs W (program.program Reg.values) (WordRAM.State.init (input L m t a b))
{ pc := program.size, data := y } n ∧ WordRAM.Executes W (program.program Reg.values) (WordRAM.State.init (input L m t a b)) (valueBase L m t)
(n + 1) ∧ WordRAM.Data.Bounded W y ∧ y.regs Reg.levels = L ∧ y.regs Reg.height = m - t ∧ y.regs Reg.span = 10 ^ L ∧ y.regs Reg.directory = directoryBase L ∧ y.regs Reg.values = valueBase L m t ∧ y.regs Reg.count = (MatrixMultiplication.Schonhage.boxes L m t).card ∧ (∀ s < (m - t + 1) * 10 ^ L, y.mem (directoryBase L + s) = directoryWord L (m - t) s) ∧ (∀ s < (m - t + 1) * 10 ^ L,
Eligible L (m - t) s →
y.mem (valueBase L m t + Nat.count (Eligible L (m - t)) s) = WordRAM.Signed.encode
(slotValue
(fun (τ : MatrixMultiplication.Schonhage.Leaf L) => a (Encoding.leafIndex τ))
(fun (τ : MatrixMultiplication.Schonhage.Leaf L) => b (Encoding.leafIndex τ))
s)) ∧ ∀ (q : ℕ),
¬(directoryBase L ≤ q ∧ q < memoryEnd L m t) →
y.mem q = (WordRAM.State.init (input L m t a b)).data.mem q
The standard compiler gives a real initialized prefix and charged halt with the same data.
theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.bounded_reachable {W L m t A B n : ℕ} (a b : Fin (10 ^ L) → ℤ) (ha : ∀ (i : Fin (10 ^ L)), (a i).natAbs ≤ A) (hb : ∀ (i : Fin (10 ^ L)), (b i).natAbs ≤ B) (hW : admissionWidth L m t A B ≤ W) {y : WordRAM.State registers} (hy : WordRAM.Runs W (program.program Reg.values) (WordRAM.State.init (input L m t a b)) y n) :
Every reachable initialized prefix has fitting native words under the same admission.