Documentation

CslibFrontier.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxProduct.Width

Initialized routed box products and every wider execution prefix #

The original matrices, raw coordinates and threshold initialize the actual program. Exact original-order product values, restored input, pre-halt execution and charged halt share one final memory. The minimum-admission run bounds every wider prefix independently of its physical width, including all words and memory support.

theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxProduct.runs {w L m t N A : ℕ} (hw : 0 < w) (hm : m ≤ L) (ht : t ≤ m) (bits : Bool) (X : Matrix (Fin N) (Fin (MatrixMultiplication.Schonhage.D m)) ℤ) (Y : Matrix (Fin (MatrixMultiplication.Schonhage.D m)) (Fin N) ℤ) (qs : List (Fin N × Fin N)) (hX : ∀ (i : Fin N) (k : Fin (MatrixMultiplication.Schonhage.D m)), |X i k| ≤ ↑A) (hY : ∀ (k : Fin (MatrixMultiplication.Schonhage.D m)) (j : Fin N), |Y k j| ≤ ↑A) (hbits : bits = true → (∀ (i : Fin N) (k : Fin (MatrixMultiplication.Schonhage.D m)), 0 ≤ X i k) ∧ ∀ (k : Fin (MatrixMultiplication.Schonhage.D m)) (j : Fin N), 0 ≤ Y k j) (hmag : magnitudeBound L A < 2 ^ (w - 1)) (hfit : WordRAM.Fits (w + 2) (wordBudget L m t N qs.length)) :
WordRAM.InputFits (w + 2) (input bits L t X Y qs) ∧ ∃ (y : WordRAM.Data 160) (n : ℕ), n + 1 ≤ timeBound L m t qs + 1 ∧ WordRAM.Runs (w + 2) ((program bits).program QueriedProduct.Reg.output) (WordRAM.State.init (input bits L t X Y qs)) { pc := (program bits).size, data := y } n ∧ WordRAM.Executes (w + 2) ((program bits).program QueriedProduct.Reg.output) (WordRAM.State.init (input bits L t X Y qs)) (QueriedProduct.outputBase L m N qs.length) (n + 1) ∧ WordRAM.Data.Bounded (w + 2) y ∧ (∀ (i : Fin qs.length), y.mem (QueriedProduct.outputBase L m N qs.length + ↑i) = WordRAM.Signed.encode ((X * Y) (qs.get i).1 (qs.get i).2)) ∧ ∀ (p : ℕ), ¬(QueriedProduct.inputEnd m N qs.length + 1 ≤ p ∧ p < memoryEnd L m t N qs.length) → y.mem p = (WordRAM.State.init (input bits L t X Y qs)).data.mem p

Actual initialized execution of both original input modes, with one charged halt and the same final state containing every matrix-product answer in request order.

theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxProduct.runs_wide {W L m t N A : ℕ} (hm : m ≤ L) (ht : t ≤ m) (bits : Bool) (X : Matrix (Fin N) (Fin (MatrixMultiplication.Schonhage.D m)) ℤ) (Y : Matrix (Fin (MatrixMultiplication.Schonhage.D m)) (Fin N) ℤ) (qs : List (Fin N × Fin N)) (hX : ∀ (i : Fin N) (k : Fin (MatrixMultiplication.Schonhage.D m)), |X i k| ≤ ↑A) (hY : ∀ (k : Fin (MatrixMultiplication.Schonhage.D m)) (j : Fin N), |Y k j| ≤ ↑A) (hbits : bits = true → (∀ (i : Fin N) (k : Fin (MatrixMultiplication.Schonhage.D m)), 0 ≤ X i k) ∧ ∀ (k : Fin (MatrixMultiplication.Schonhage.D m)) (j : Fin N), 0 ≤ Y k j) (hW : admissionWidth L m t N qs.length A ≤ W) :
WordRAM.InputFits W (input bits L t X Y qs) ∧ ∃ (y : WordRAM.Data 160) (n : ℕ), n + 1 ≤ timeBound L m t qs + 1 ∧ WordRAM.Runs W ((program bits).program QueriedProduct.Reg.output) (WordRAM.State.init (input bits L t X Y qs)) { pc := (program bits).size, data := y } n ∧ WordRAM.Executes W ((program bits).program QueriedProduct.Reg.output) (WordRAM.State.init (input bits L t X Y qs)) (QueriedProduct.outputBase L m N qs.length) (n + 1) ∧ WordRAM.Data.Bounded W y ∧ (∀ (i : Fin qs.length), y.mem (QueriedProduct.outputBase L m N qs.length + ↑i) = WordRAM.Signed.encode ((X * Y) (qs.get i).1 (qs.get i).2)) ∧ ∀ (p : ℕ), ¬(QueriedProduct.inputEnd m N qs.length + 1 ≤ p ∧ p < memoryEnd L m t N qs.length) → y.mem p = (WordRAM.State.init (input bits L t X Y qs)).data.mem p

Both native input modes run at every sufficiently wide original-input admission. The scalar return is the first address of the complete original-order answer array.

theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxProduct.prefix_bounded {W L m t N A : ℕ} (hm : m ≤ L) (ht : t ≤ m) (bits : Bool) (X : Matrix (Fin N) (Fin (MatrixMultiplication.Schonhage.D m)) ℤ) (Y : Matrix (Fin (MatrixMultiplication.Schonhage.D m)) (Fin N) ℤ) (qs : List (Fin N × Fin N)) (hX : ∀ (i : Fin N) (k : Fin (MatrixMultiplication.Schonhage.D m)), |X i k| ≤ ↑A) (hY : ∀ (k : Fin (MatrixMultiplication.Schonhage.D m)) (j : Fin N), |Y k j| ≤ ↑A) (hbits : bits = true → (∀ (i : Fin N) (k : Fin (MatrixMultiplication.Schonhage.D m)), 0 ≤ X i k) ∧ ∀ (k : Fin (MatrixMultiplication.Schonhage.D m)) (j : Fin N), 0 ≤ Y k j) (hW : admissionWidth L m t N qs.length A ≤ W) (s : WordRAM.State 160) (steps : ℕ) (hr : WordRAM.Runs W ((program bits).program QueriedProduct.Reg.output) (WordRAM.State.init (input bits L t X Y qs)) s steps) :
(∀ (i : Fin 160), s.data.regs i < wordBound L m t N qs.length A) ∧ (∀ (p : ℕ), s.data.mem p < wordBound L m t N qs.length A) ∧ ∀ (p : ℕ), wordBound L m t N qs.length A ≤ p → s.data.mem p = 0

Original-input bounds on every successful prefix, independent of any larger admitted width.