Actual two-quadrant Strassen operand forms #
Both source pointers are computed by native quadrant address blocks. The existing signed array loop then reads, adds/subtracts and stores every coefficient. Original matrix bounds imply operand fits; the output may be dirty. This internal composition lemma does not assume the recursively computed matrix product or its execution/time contract.
theorem Cslib.Algorithms.WordRAM.Strassen.exec_arithmeticForm {w q t₁ t₂ A : ℕ} (base dst : Fin 64) (sign : ℤ) (x : WordRAM.Data 64) (u : ℕ → ℤ) (hb : 32 ≤ ↑base) (hd : 32 ≤ ↑dst) (hbt : base ≠ Reg.temporary) (hdt : dst ≠ Reg.temporary) (hq : x.regs Reg.quarter = q) (ht₁ : t₁ < 4) (ht₂ : t₂ < 4) (hsign : sign ≠ 0) (hbound : GenericRAM.Signed.Fits w ↑(A + A)) (hu : ∀ j < 4 * q, (u j).natAbs ≤ A) (hinput : ∀ j < 4 * q, x.mem (x.regs base + j) = WordRAM.Signed.encode (u j)) (hw : WordRAM.Fits (w + 2) (x.regs base + 4 * q + x.regs dst + q + 8)) (hsep : x.regs base + 4 * q ≤ x.regs dst ∨ x.regs dst + q ≤ x.regs base) :
∃ (y : WordRAM.Data 64),
WordRAM.ExecWithin (w + 2) (form base dst t₁ t₂ sign) x y (26 * q + 12) ∧ (∀ j < q,
y.mem (x.regs dst + j) = WordRAM.Signed.encode
(if sign < 0 then u (t₁ * q + j) - u (t₂ * q + j) else u (t₁ * q + j) + u (t₂ * q + j))) ∧ (∀ (a : ℕ), a < x.regs dst ∨ x.regs dst + q ≤ a → y.mem a = x.mem a) ∧ ∀ (i : Fin 64), 32 ≤ ↑i → i ≠ Reg.temporary → y.regs i = x.regs i
Materialize a signed sum/difference of two actual matrix quarters in a disjoint buffer, charging all address multiplication, argument copies and vector instructions.