Documentation

CslibFrontier.Algorithms.WordRAM.ExactTriangle.RecordWitness.Original

Original signed arrays after real preparation #

The producer's existing prefix frame retains every original signed input word. These internal readback rules relate the recovery bank to those same words and to their original magnitude bound; they do not assume intermediate signed fits or add a second input encoding.

theorem Cslib.Algorithms.WordRAM.ExactTriangle.RecordWitness.original_matrices {n D g p : ℕ} (values : List ℤ) {mem : ℕ → ℕ} (hprefix : ∀ j < 5 + 3 * (n * n), mem j = (WordRAM.Data.init (PreparationInput.input n D g p values)).mem j) (a : ℕ) :
a < n → ∀ b < n, mem (5 + (a * n + b)) = WordRAM.Signed.encode (values.getD (a * n + b) 0) ∧ mem (5 + n * n + (a * n + b)) = WordRAM.Signed.encode (values.getD (n * n + (a * n + b)) 0) ∧ mem (5 + n * n + n * n + (a * n + b)) = WordRAM.Signed.encode (values.getD (2 * (n * n) + (a * n + b)) 0)

A preserved original payload supplies the three signed row-major weight arrays.

theorem Cslib.Algorithms.WordRAM.ExactTriangle.RecordWitness.original_magnitude {n A q : ℕ} (values : List ℤ) (hlen : values.length = 3 * (n * n)) (hv : ∀ z ∈ values, z.natAbs ≤ A) (hq : q < 3 * (n * n)) :
(values.getD q 0).natAbs ≤ A

Original magnitude bounds supply every original array entry, not merely a fitting intermediate machine state. The implicit index equation is the producer's existing layout.

theorem Cslib.Algorithms.WordRAM.ExactTriangle.RecordWitness.original_magnitudes {n A : ℕ} (values : List ℤ) (hlen : values.length = 3 * (n * n)) (hv : ∀ z ∈ values, z.natAbs ≤ A) (a : ℕ) :
a < n → ∀ b < n, (values.getD (a * n + b) 0).natAbs ≤ A ∧ (values.getD (n * n + (a * n + b)) 0).natAbs ≤ A ∧ (values.getD (2 * (n * n) + (a * n + b)) 0).natAbs ≤ A

One input magnitude bound applies to the entries of all three weight arrays.