Complete traversal of the actual prepared catalogue #
Every guarded iteration constructs the next logical chunk/piece in one fixed slot and calls the complete backend at physical ordinal zero. The invariant counts only the visited prefix: distinct failures share one global budget and the successful-return flags sum to at most one. A charged heap reset reclaims the slot after verification. Queries, catalogue and original weights stay below the slot; no current state is asserted to contain all logical records.
theorem Cslib.Algorithms.WordRAM.ExactTriangle.StreamingFixedPrime.exec_traverse {w m n g p A : ℕ} (values : List ℤ) (hlen : values.length = 3 * (n * n)) (hD : 16 ≤ MatrixMultiplication.Schonhage.D m) (hg : 1 ≤ g) (hp : p ∈ (MatrixMultiplication.Schonhage.D m).sqrtPrimeWindow) (hN : MatrixMultiplication.Schonhage.D m ^ 18 ≤ n) (hv : ∀ z ∈ values, z.natAbs ≤ A) (hW : FixedPrime.admissionWidth n (MatrixMultiplication.Schonhage.D m) g p A ≤ w + 2) (a : WordRAM.Data 64) (x : WordRAM.Data 416) (hout :
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) (cursor :
Cursor n (MatrixMultiplication.Schonhage.D m) g p (fun (q : ℕ) => values.getD q 0)
(WordRAM.Data.comap producerBank x)) (hproduced : x.regs (producerBank Instances.produced) = 0) (hslotHeap : x.regs (producerBank Instances.heap) = x.regs (producerBank Instances.output)) (hmem : Set.EqOn x.mem a.mem (Set.Iio (a.regs Instances.output))) (hheap : a.regs Instances.heap ≤ PreparationInput.wordBound n (MatrixMultiplication.Schonhage.D m) g p A) :
have V := fun (q : ℕ) => values.getD q 0;
have wAB := fun (u v : Fin n) => V (Matrix.pairIndex (u, v));
have wBC := fun (b c : Fin n) => V (n * n + Matrix.pairIndex (b, c));
have wAC := fun (u c : Fin n) => V (2 * (n * n) + Matrix.pairIndex (u, c));
have hn := ⋯;
∃ (y : WordRAM.Data 416),
WordRAM.ExecWithin (w + 2) traverse x y
(∑ idx ∈ ExactTriangle.instanceIndices wAB (MatrixMultiplication.Schonhage.D m) g p,
(FixedPrime.recordBase hn V a.mem idx + (40 * (n * MatrixMultiplication.Schonhage.D m) + 67)) + (42 * ExactTriangle.pieceSize (MatrixMultiplication.Schonhage.D m) g + 28) * (ExactTriangle.falsePositiveCount wAB wBC wAC p + 1) + 7) ∧ (y.regs FixedPrime.Reg.found = 0 ∨ y.regs FixedPrime.Reg.found = 1) ∧ y.regs FixedPrime.Reg.scans ≤ ExactTriangle.falsePositiveCount wAB wBC wAC p + y.regs FixedPrime.Reg.found ∧ (y.regs FixedPrime.Reg.found = 1 ↔ ExactTriangle.HasZeroTriangle wAB wBC wAC) ∧ (y.regs FixedPrime.Reg.found = 1 →
y.regs (FixedPrime.recordBank RecordWitness.Reg.witnessA) < n ∧ y.regs (FixedPrime.recordBank RecordWitness.Reg.witnessB) < n ∧ y.regs (FixedPrime.recordBank RecordWitness.Reg.witnessC) < n ∧ V
(y.regs (FixedPrime.recordBank RecordWitness.Reg.witnessA) * n + y.regs (FixedPrime.recordBank RecordWitness.Reg.witnessB)) + V
(n * n + (y.regs (FixedPrime.recordBank RecordWitness.Reg.witnessB) * n + y.regs (FixedPrime.recordBank RecordWitness.Reg.witnessC))) + V
(2 * (n * n) + (y.regs (FixedPrime.recordBank RecordWitness.Reg.witnessA) * n + y.regs (FixedPrime.recordBank RecordWitness.Reg.witnessC))) = 0) ∧ (∀ (u : ℕ),
u < a.regs Instances.output ∨ a.regs Instances.output + (6 + 2 * (n * MatrixMultiplication.Schonhage.D m)) + MatrixMultiplication.Schonhage.CallableProduct.windowSize n (n * n) ≤ u →
y.mem u = x.mem u) ∧ Cursor n (MatrixMultiplication.Schonhage.D m) g p V (WordRAM.Data.comap producerBank y) ∧ y.regs (producerBank Instances.produced) = y.regs FixedPrime.Reg.index ∧ y.regs (producerBank Instances.heap) = y.regs (producerBank Instances.output)
Construct and immediately consume each logical record, stopping at the first original witness. The reference readback indexes immutable catalogue data and mathematical charges; the actual cursor starts with no records and resets its physical heap after each visit.