NLA-lib Explorer

NLAlib.Computation.IsDotTrace.abs_sub_mulVec_le

Library · theorem

The forward error of a trace of one row of a matrix-vector product, against its partial products: if s is a trace (NLAlib.Computation.IsDotTrace, relative error u \ge 0) of \sum_r a_{ir} \mathbf{x}_r for row i of the m \times n matrix \mathbf{A}, then \lvert s_n - (\mathbf{A}\mathbf{x})_i\rvert \le (1 + u)^n u \Bigl((\lvert\mathbf{A}\rvert \lvert\mathbf{x}\rvert)_i + \sum_{r < n} \lvert(\mathbf{A}\mathbf{x}_{\le r})_i\rvert\Bigr), \mathbf{x}_{\le r} the vector \mathbf{x} with the entries after r set to zero. This is the bound behind the rounded dots and gemv of one classical Gram–Schmidt pass.

NLAlib.Computation.IsDotTrace.abs_sub_mulVec_le {u : ℝ} {m n : ℕ} (A : Matrix (Fin m) (Fin n) ℝ)
  (x : Fin n → ℝ) (i : Fin m) {xs ys s : ℕ → ℝ} (hxs : ∀ (r : ℕ) (hr : r < n), xs r = A i ⟨r, hr⟩)
  (hys : ∀ (r : ℕ) (hr : r < n), ys r = x ⟨r, hr⟩)
  (h : Computation.IsDotTrace (fun x ↦ Computation.RelErr u) xs ys n s) (hu : 0 ≤ u) :
  |s n - (A *ᵥ x) i| ≤
    (1 + u) ^ n * u *
      ((A.map abs *ᵥ fun r ↦ |x r|) i +
        ∑ r ∈ Finset.range n, |(A *ᵥ fun t ↦ if ↑t < r + 1 then x t else 0) i|)

Full source on GitHub

Import NLAlib.Matrix.FinitePrecision.ClassicalGramSchmidtRoundingError.