Native final Strassen child return #
The last actual product adds into the first output quarter, then the real parent/root pop returns. The completed four partial sums equal the existing finite Strassen product on every coefficient. This closes one parent's final stage, not the entire recursive traversal.
theorem Cslib.Algorithms.WordRAM.Strassen.exec_stage_finish {w p k A B a b out scratch frames frame : ℕ} (x : WordRAM.Data 64) (u v : ℕ → ℤ) (hx : NodeHeader p (k + 1) a b out scratch frames frame x) (hc : ChildBuffers p k scratch x) (hl : NodeLayout p (k + 1) a b out scratch frames frame) (hu : ∀ i < 4 ^ (k + 1) * p, (u i).natAbs ≤ A) (hv : ∀ i < 4 ^ (k + 1) * p, (v i).natAbs ≤ B) (hout :
∀ (s : Fin 4),
∀ j < 4 ^ k * p,
x.mem (out + ↑s * (4 ^ k * p) + j) = WordRAM.Signed.encode (MatrixMultiplication.Strassen.partialValue p k 6 u v s j)) (hprod :
∀ j < 4 ^ k * p,
x.mem (scratch + 2 * (4 ^ k * p) + j) = WordRAM.Signed.encode (MatrixMultiplication.Strassen.childProduct p k u v 6 j)) (hmag : GenericRAM.Signed.Fits w ↑(magnitudeBound p A B (k + 1))) (haddr : WordRAM.Fits (w + 2) (addressBound frames frame (k + 1))) :
∃ (y : WordRAM.Data 64),
WordRAM.ExecWithin (w + 2) (stage 7) x y (26 * (4 ^ k * p) + 13) ∧ NodeResult p (k + 1) out scratch frames frame u v x y
The actual seventh return stage produces every parent coefficient and performs the real parent/root pop. All inputs to this lemma are internal current-state invariants.