Documentation

CslibFrontier.Algorithms.WordRAM.ExactTriangle.CountPrime.Product

Actual low-bank CountPrime multiplication call #

The counter copies six real arguments and invokes the complete native 64-register Strassen program in its low bank. Its 64-and-above metadata survives the existing native register renaming semantics. Monomial inputs have coefficient magnitude at most one; all recursive signed fits therefore follow from the explicit original cyclic-length/depth envelope.

This is an internal stage contract. The complete counter derives its monomial readback and pointer separation from preceding native setup and matrix construction, rather than taking a layout or multiplication certificate as an algorithm input.

theorem Cslib.Algorithms.WordRAM.ExactTriangle.CountPrime.exec_product {w p k : ℕ} (x : WordRAM.Data 128) (u v : ℕ → ℤ) (hp : 0 < p) (hpr : x.regs Reg.modulus = p) (hkr : x.regs Reg.depth = k) (hPQ : x.regs Reg.matrixP + 4 ^ k * p ≤ x.regs Reg.matrixQ) (hQR : x.regs Reg.matrixQ + 4 ^ k * p ≤ x.regs Reg.matrixR) (hRS : x.regs Reg.matrixR + 4 ^ k * p ≤ x.regs Reg.productScratch) (hu : ∀ i < 4 ^ k * p, (u i).natAbs ≤ 1) (hv : ∀ i < 4 ^ k * p, (v i).natAbs ≤ 1) (hleft : ∀ i < 4 ^ k * p, x.mem (x.regs Reg.matrixP + i) = WordRAM.Signed.encode (u i)) (hright : ∀ i < 4 ^ k * p, x.mem (x.regs Reg.matrixQ + i) = WordRAM.Signed.encode (v i)) (hmag : GenericRAM.Signed.Fits w ↑(2 * (p + 4) * 16 ^ k)) (haddr : WordRAM.Fits (w + 2) (Strassen.addressBound (x.regs Reg.productScratch + 4 ^ k * p) (x.regs Reg.productScratch + 4 ^ k * p) k)) :
∃ (y : WordRAM.Data 128), WordRAM.ExecWithin (w + 2) product x y (Strassen.traceBudget p k + 4 * k + 38) ∧ (∀ i < 4 ^ k * p, y.mem (x.regs Reg.matrixR + i) = WordRAM.Signed.encode (MatrixMultiplication.Strassen.multiply p k u v i)) ∧ (∀ (d : ℕ), ¬Strassen.NodeWrites p k (x.regs Reg.matrixR) (x.regs Reg.productScratch) (x.regs Reg.productScratch + 4 ^ k * p) (x.regs Reg.productScratch + 4 ^ k * p) d → y.mem d = x.mem d) ∧ ∀ (i : Fin 128), 64 ≤ ↑i → y.regs i = x.regs i

Invoke the actual complete native Strassen program, charging argument copies, all coefficient arithmetic/recursion and loop exit. No multiplication/run/time contract is assumed.