Real initialized preparation for candidate recovery #
This internal composition rule executes the existing producer on its complete renamed bank, then selects ordinal zero with one real instruction. Nonemptiness and the producer's original word bound are derived from the original input and actual execution. No prepared catalogue, index, run or intermediate fit certificate is an input to this rule.
theorem Cslib.Algorithms.WordRAM.ExactTriangle.RecordWitness.prepare_input {w m n g p A : ℕ} (values : List ℤ) (hlen : values.length = 3 * (n * n)) (hD : 16 ≤ MatrixMultiplication.Schonhage.D m) (hg : 1 ≤ g) (hp : 0 < p) (hN : MatrixMultiplication.Schonhage.D m ^ 18 ≤ n) (hv : ∀ z ∈ values, z.natAbs ≤ A) (hW : admissionWidth n (MatrixMultiplication.Schonhage.D m) g p A ≤ w + 2) :
WordRAM.InputFits (w + 2) (PreparationInput.input n (MatrixMultiplication.Schonhage.D m) g p values) ∧ ∃ (a : WordRAM.Data 64) (idx : ExactTriangle.InstanceIndex p) (z : WordRAM.Data 400),
WordRAM.ExecWithin (w + 2) Instances.program
(WordRAM.Data.init (PreparationInput.input n (MatrixMultiplication.Schonhage.D m) g p values)) a
(RecordProduct.preparationTime n (MatrixMultiplication.Schonhage.D m) g p values - 1) ∧ Instances.Output n (MatrixMultiplication.Schonhage.D m) g p (fun (q : ℕ) => values.getD q 0)
(WordRAM.Data.init (PreparationInput.input n (MatrixMultiplication.Schonhage.D m) g p values)) a ∧ idx ∈ ExactTriangle.instanceIndices (fun (a b : Fin n) => values.getD (Matrix.pairIndex (a, b)) 0)
(MatrixMultiplication.Schonhage.D m) g p ∧ RecordProduct.recordOrdinal n (MatrixMultiplication.Schonhage.D m) g p (fun (q : ℕ) => values.getD q 0) idx = 0 ∧ WordRAM.ExecWithin (w + 2)
(produce.seq (WordRAM.Code.op (WordRAM.Op.const (productBank RecordProduct.Reg.ordinal) 0)))
(WordRAM.Data.init (PreparationInput.input n (MatrixMultiplication.Schonhage.D m) g p values)) z
(RecordProduct.preparationTime n (MatrixMultiplication.Schonhage.D m) g p values) ∧ WordRAM.Data.comap RecordProduct.producerBank (WordRAM.Data.comap productBank z) = a ∧ z.regs (productBank RecordProduct.Reg.ordinal) = 0 ∧ z.regs (productBank 42) ≤ PreparationInput.wordBound n (MatrixMultiplication.Schonhage.D m) g p A
Actual preparation and charged first-record selection, from the original initialized input. All later structured/flat clients reuse this same producer state and selected record.