Original matrix, coordinate and threshold input for a box product #
The existing four headers, both original matrices and coordinate occurrences retain their input addresses. One final word contains the ordinary box threshold. The actual program reads that word before either producer reuses the original low-memory payload.
def Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxProduct.input {m N : ℕ} (bits : Bool) (L t : ℕ) (X : Matrix (Fin N) (Fin (MatrixMultiplication.Schonhage.D m)) ℤ) (Y : Matrix (Fin (MatrixMultiplication.Schonhage.D m)) (Fin N) ℤ) (qs : List (Fin N × Fin N)) :
Original matrix/coordinate words, followed by one ordinary threshold word.
theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxProduct.input_length {m N : ℕ} (bits : Bool) (L t : ℕ) (X : Matrix (Fin N) (Fin (MatrixMultiplication.Schonhage.D m)) ℤ) (Y : Matrix (Fin (MatrixMultiplication.Schonhage.D m)) (Fin N) ℤ) (qs : List (Fin N × Fin N)) :
Every original word, including the threshold and native length header, has this extent.
theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxProduct.input_prefix {L m t N : ℕ} (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)) (p : ℕ) (hp : 0 < p) (hbound : p < QueriedProduct.inputEnd m N qs.length) :
(WordRAM.State.init (input bits L t X Y qs)).data.mem p = (WordRAM.State.init (QueriedProduct.input bits L X Y qs)).data.mem p
Appending the threshold preserves every original positive-address matrix/coordinate word. Address zero instead records the new literal input length.
theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxProduct.input_threshold {L m t N : ℕ} (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)) :
The final original word contains precisely the supplied threshold.
theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxProduct.input_fits {w L m t N A : ℕ} (hw : 0 < w) (hm : m ≤ L) (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) (hmag : magnitudeBound L A < 2 ^ (w - 1)) (hfit : WordRAM.Fits (w + 2) (wordBudget L m t N qs.length)) :
All original words fit from original dimensions, threshold and entry magnitudes.