Documentation

CslibFrontier.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxQuery.InputLayout

Original input and workspace of a complete native box query #

Four ordinary headers contain depth, inner count, threshold and the existing output code. Both canonical signed leaf arrays follow. Shared geometry and retained values are computed after these arrays; the query stack follows the actual compact table. Original scalar and magnitude envelopes supply all preparation fits.

Four ordinary scalar words, followed by both actual signed leaf arrays.

First free word after the original headers and two arrays.

The compact three-word descriptors follow the computed shared directory.

The compact value table follows the actual number of emitted descriptors.

The query stack starts after every retained compact value.

One original-input address envelope covers setup and the complete native query stack.

Preparation includes actual original-header adaptation, shared geometry and retained values.

@[simp]
theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxQuery.length_input (L m t : ℕ) (q : Fin (10 ^ L)) (a b : Fin (10 ^ L) → ℤ) :
(input L m t q a b).length = 4 + 2 * 10 ^ L
theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxQuery.input_readback (L m t : ℕ) (q : Fin (10 ^ L)) (a b : Fin (10 ^ L) → ℤ) :
have x := (WordRAM.State.init (input L m t q a b)).data; x.mem 1 = L ∧ x.mem 2 = m ∧ x.mem 3 = t ∧ x.mem 4 = ↑q ∧ (∀ (i : Fin (10 ^ L)), x.mem (5 + ↑i) = WordRAM.Signed.encode (a i)) ∧ ∀ (i : Fin (10 ^ L)), x.mem (5 + 10 ^ L + ↑i) = WordRAM.Signed.encode (b i)

Actual initialized headers and array words have their original contents.

theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxQuery.input_fits {w L m t A B : ℕ} (q : Fin (10 ^ L)) (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) (originalAddressBound L m t)) (hmag : GenericRAM.Signed.Fits w ↑(magnitudeBound L A B)) :
WordRAM.InputFits (w + 2) (input L m t q a b)

Original source and scalar envelopes derive the machine input-fit predicate.

The larger query envelope also covers every unchanged box-table signed operation.

theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxQuery.constructor_address_le (L m t : ℕ) (hm : m ≤ L) :
100 * (directoryBase L + 5 + (5 + 10 ^ L) + L + m + t + (m - t + 1) * 10 ^ L + 10) ≤ originalAddressBound L m t

The computed compact box count and original geometry fit the complete query envelope.