NLAlib.matMulOn_writes_view
Library · theorem
NLAlib.matMulOn on strided views with c = 0, on a scalar machine and every tape: if the left view x (leading dimension ldx) reads the entries of \mathbf{X} (m \times p) from a matrix stored at xs, the right view y (leading dimension ldy) reads the entries of \mathbf{Y} (p \times q) from a matrix stored at ys, and the contiguous output z has room and is apart from both stored matrices, then the program writes only the output and stores NLAlib.matMulWord. Shared by the trees of NLAlib.ShiftedQR.roundedDecoupleUpdate, NLAlib.ShiftedQR.roundedLeafUpdate, NLAlib.matMulLBody.
NLAlib.matMulOn_writes_view {O Q : Type} [Ops.Has Ops.ScalarOp O] {M : Ops.Machine ℝ}
{I : Ops.Interp O Q ℝ} (hS : Ops.IsScalar M I) {τ : Ops.Tape ℝ} {μ : Ops.Mem ℝ}
{m p q ldx ldy r₁ r₂ r₃ r₄ : ℕ} {x y z xs ys : ℕ × ℕ} {Xs : Matrix (Fin r₁) (Fin r₂) ℂ}
{Ys : Matrix (Fin r₃) (Fin r₄) ℂ} (X : Matrix (Fin m) (Fin p) ℂ) (Y : Matrix (Fin p) (Fin q) ℂ)
(hX : HoldsMatrix xs Xs μ.store)
(hsrc :
∀ (s : Ops.Store ℝ),
HoldsMatrix xs Xs s →
∀ (i : Fin m) (l : Fin p),
s.readBlock x.1 (x.2 + 2 * (↑l * ldx + ↑i)) 2 = some [(X i l).re, (X i l).im])
(hY : HoldsMatrix ys Ys μ.store)
(hsrcY :
∀ (s : Ops.Store ℝ),
HoldsMatrix ys Ys s →
∀ (l : Fin p) (j : Fin q),
s.readBlock y.1 (y.2 + 2 * (↑j * ldy + ↑l)) 2 = some [(Y l j).re, (Y l j).im])
(hl : μ.Live [x, y, z, xs, ys]) (hz : z.2 + 2 * (m * q) ≤ μ.store.len z.1)
(hxz :
Ops.Fp.Disj (Ops.Store.inBlock xs.1 xs.2 (2 * (r₂ * r₁)))
(Ops.Store.inBlock z.1 z.2 (2 * (m * q))))
(hyz :
Ops.Fp.Disj (Ops.Store.inBlock ys.1 ys.2 (2 * (r₄ * r₃)))
(Ops.Store.inBlock z.1 z.2 (2 * (m * q)))) :
Ops.Writes Ops.Mode.total I τ matMulOn (Ops.Env.frame [m, p, q, ldx, ldy, m, 0] [x, y, z])
(Ops.Store.inBlock z.1 z.2 (2 * (m * q)))
(fun μ' ↦ μ'.pos = μ.pos ∧ HoldsMatrix z (matMulWord M X Y) μ'.store) μImport NLAlib.Matrix.FinitePrecision.StoredProducts.