Documentation

CslibFrontier.Algorithms.WordRAM.MatrixMultiplication.Strassen.LeafStep

Actual leaf iteration of the explicit Strassen controller #

This composes the real frame loads, the depth comparison, cyclic coefficient multiplication and real parent/root return. The internal frame equality is established by native setup or push; the complete counter does not accept it as input data or an assumed execution contract.

theorem Cslib.Algorithms.WordRAM.Strassen.exec_step_leaf {w p A B : ℕ} (x : WordRAM.Data 64) (u v : ℕ → ℤ) (h0 : x.regs Reg.zero = 0) (h1 : x.regs Reg.one = 1) (h7 : x.regs Reg.frameWidth = 7) (hd : x.regs Reg.depth = 0) (hframe : ∀ (j : Fin 7), x.mem (x.regs Reg.frame + ↑j) = x.regs (field j)) (hptr : WordRAM.Fits (w + 2) (x.regs Reg.frame + 7)) (hlen : x.regs Reg.modulus = p) (hbound : GenericRAM.Signed.Fits w ↑(CyclicConvolution.magnitudeBound p A B)) (hu : ∀ i < p, (u i).natAbs ≤ A) (hv : ∀ i < p, (v i).natAbs ≤ B) (hA : ∀ i < p, x.mem (x.regs Reg.inputA + i) = WordRAM.Signed.encode (u i)) (hB : ∀ i < p, x.mem (x.regs Reg.inputB + i) = WordRAM.Signed.encode (v i)) (h2p : WordRAM.Fits (w + 2) (2 * p)) (ha : WordRAM.Fits (w + 2) (x.regs Reg.inputA + p)) (hb : WordRAM.Fits (w + 2) (x.regs Reg.inputB + p)) (hout : WordRAM.Fits (w + 2) (x.regs Reg.output + p)) (hdisjA : x.regs Reg.inputA + p ≤ x.regs Reg.output ∨ x.regs Reg.output + p ≤ x.regs Reg.inputA) (hdisjB : x.regs Reg.inputB + p ≤ x.regs Reg.output ∨ x.regs Reg.output + p ≤ x.regs Reg.inputB) :
∃ (y : WordRAM.Data 64), WordRAM.ExecWithin (w + 2) step x y (42 * p * p + 9 * p + 26) ∧ (∀ i < p, y.mem (x.regs Reg.output + i) = WordRAM.Signed.encode (CyclicIntRing.convolution p u v i)) ∧ (∀ (a : ℕ), a < x.regs Reg.output ∨ x.regs Reg.output + p ≤ a → y.mem a = x.mem a) ∧ (y.regs Reg.frame = if x.regs Reg.frames < x.regs Reg.frame then x.regs Reg.frame - 7 else x.regs Reg.frame) ∧ (y.regs Reg.active = if x.regs Reg.frames < x.regs Reg.frame then x.regs Reg.active else 0) ∧ ∀ (i : Fin 64), 32 ≤ ↑i → i ≠ Reg.address → i ≠ Reg.frame → i ≠ Reg.active → y.regs i = x.regs i

A loaded scalar frame executes a complete native controller step, including the actual depth dispatch and every frame read. All original coefficient/magnitude premises are explicit.