NLA-lib Explorer

NLAlib.matMulOn_machineConjTranspose_writes_view

Library · theorem

NLAlib.matMulOn with the left factor conjugate-transposed on strided views (c = 1), on any scalar machine: if the left view x (leading dimension ldx) reads the entries of \mathbf{X} (p \times m) from a matrix stored at xs, the right view y reads \mathbf{Y} (p \times q) from a matrix stored at ys, and the contiguous output z has room apart from both, the program writes only the output and stores NLAlib.matMulWord of the machine conjugate transpose NLAlib.machineConjTranspose and \mathbf{Y}. A step in the proof of NLAlib.ShiftedQR.roundedLeafUpdate_writes, NLAlib.matMulOn_conjTranspose_writes_view.

NLAlib.matMulOn_machineConjTranspose_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 p) (Fin m) ℂ)
  (Y : Matrix (Fin p) (Fin q) ℂ) (hX : HoldsMatrix xs Xs μ.store)
  (hsrc :
    ∀ (s : Ops.Store ℝ),
      HoldsMatrix xs Xs s →
        ∀ (l : Fin p) (i : Fin m),
          s.readBlock x.1 (x.2 + 2 * (↑i * ldx + ↑l)) 2 = some [(X l i).re, (X l i).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, 1] [x, y, z])
    (Ops.Store.inBlock z.1 z.2 (2 * (m * q)))
    (fun μ' ↦ μ'.pos = μ.pos ∧ HoldsMatrix z (matMulWord M (machineConjTranspose M X) Y) μ'.store) μ

Full source on GitHub

Import NLAlib.Matrix.FinitePrecision.StoredProducts.