Documentation

CslibFrontier.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.InputLayout

Original input and native box-table layout #

Three raw headers are followed by the two canonical signed leaf arrays. The directory, compact descriptors and values are allocated after those original arrays. Their extents are computed from the depth and finite box cardinality; no layout is an input certificate.

Ordinary scalar headers and two actual canonical signed encoding arrays.

The directory starts immediately after the original input.

The compact descriptors follow the complete shared directory.

The actual value array follows three words per emitted record.

End of the shared directory, compact descriptors and one complete value table.

One original-input scalar envelope covers all address arithmetic of construction.

One signed envelope covers operands even when their opposite array is identically zero.

@[simp]
theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.length_input (L m t : ℕ) (a b : Fin (10 ^ L) → ℤ) :
(input L m t a b).length = 3 + 2 * 10 ^ L
theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.input_fits {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) (haddr : WordRAM.Fits (w + 2) (addressBound L m t)) (hmag : GenericRAM.Signed.Fits w ↑(magnitudeBound L A B)) :
WordRAM.InputFits (w + 2) (input L m t a b)

The actual input fits under the same original scalar and signed envelopes as execution.

theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.input_readback (L m t : ℕ) (a b : Fin (10 ^ L) → ℤ) :
have x := (WordRAM.State.init (input L m t a b)).data; x.mem 1 = L ∧ x.mem 2 = m ∧ x.mem 3 = t ∧ (∀ (i : Fin (10 ^ L)), x.mem (4 + ↑i) = WordRAM.Signed.encode (a i)) ∧ ∀ (i : Fin (10 ^ L)), x.mem (4 + 10 ^ L + ↑i) = WordRAM.Signed.encode (b i)

Actual initialized words contain the two original signed arrays at their computed bases.