The library analyses a run through four accuracy parameters, one for each source of error. They are not unit roundoffs, so the same theorem applies to any way of computing the three operations.
Definition (Refinement run). A run of k steps for an invertible \mathbf{A} consists of iterates, residuals and corrections with, for every j<k,
\|\mathbf{b}-\mathbf{A}\mathbf{x}_j-\mathbf{r}_j\|\le\zeta\|\mathbf{b}-\mathbf{A}\mathbf{x}_j\|+\eta\bigl(\|\mathbf{b}\|+\|\mathbf{A}\|_2\|\mathbf{x}_j\|\bigr),
\|\mathbf{A}^{-1}\mathbf{r}_j-\mathbf{d}_j\|\le\theta\|\mathbf{A}^{-1}\mathbf{r}_j\|,\qquad\|\mathbf{x}_j+\mathbf{d}_j-\mathbf{x}_{j+1}\|\le\varepsilon\|\mathbf{x}_j+\mathbf{d}_j\|,
with \theta,\eta,\zeta,\varepsilon\ge0. The start is unrestricted, and no smallness of the parameters is assumed.
Lean statement and details
NLAlib.RefinementRun.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] [DecidableEq n]
(A : Matrix n n 𝕜) (b : n → 𝕜) (θ η ζ ε : ℝ) (k : ℕ) : Type (max u_1 u_2)
Full source on GitHub
Copy link
The residual has two parameters because it has two errors: \eta is the error of computing it, relative to the size of its operands, and \zeta is the error of rounding the result to the working precision, relative to the residual itself.
Theorem (Forward error of iterative refinement). Let \mathbf{A}\mathbf{x}_\star=\mathbf{b}, \kappa=\kappa_2(\mathbf{A}), and
\varphi=(1+\varepsilon)\bigl(\theta+(1+\theta)\kappa(\zeta+\eta)\bigr),\qquad\xi=(1+\varepsilon)(1+\theta)\,2\kappa\eta+\varepsilon.
If \varphi<1, every iterate j\le k of a run satisfies
\|\mathbf{x}_\star-\mathbf{x}_j\|\le\varphi^j\|\mathbf{x}_\star-\mathbf{x}_0\|+\frac{\xi}{1-\varphi}\|\mathbf{x}_\star\|.
Lean statement and details
NLAlib.RefinementRun.norm_sub_x_le.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n]
[DecidableEq n] {k : ℕ} {A : Matrix n n 𝕜} {b : n → 𝕜} {θ η ζ ε : ℝ}
(R : RefinementRun A b θ η ζ ε k) {xs : n → 𝕜} (hxs : A *ᵥ xs = b)
(hφ : refinementContractionFactor (pseudoConditionNumber A) θ η ζ ε < 1) {j : ℕ} (hj : j ≤ k) :
‖WithLp.toLp 2 (xs - R.x j)‖ ≤
refinementContractionFactor (pseudoConditionNumber A) θ η ζ ε ^ j *
‖WithLp.toLp 2 (xs - R.x 0)‖ +
refinementAccuracyBound (pseudoConditionNumber A) θ η ε /
(1 - refinementContractionFactor (pseudoConditionNumber A) θ η ζ ε) *
‖WithLp.toLp 2 xs‖
Full source on GitHub
Copy link
Theorem (One step). For \mathbf{A}\mathbf{x}_\star=\mathbf{b} and every j<k, with \varphi and \xi as above and no condition on their size,
\|\mathbf{x}_\star-\mathbf{x}_{j+1}\|\le\varphi\|\mathbf{x}_\star-\mathbf{x}_j\|+\xi\|\mathbf{x}_\star\|.
Lean statement and details
NLAlib.RefinementRun.norm_sub_x_succ_le.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2}
[Fintype n] [DecidableEq n] {k : ℕ} {A : Matrix n n 𝕜} {b : n → 𝕜} {θ η ζ ε : ℝ}
(R : RefinementRun A b θ η ζ ε k) {xs : n → 𝕜} (hxs : A *ᵥ xs = b) {j : ℕ} (hj : j < k) :
‖WithLp.toLp 2 (xs - R.x (j + 1))‖ ≤
refinementContractionFactor (pseudoConditionNumber A) θ η ζ ε * ‖WithLp.toLp 2 (xs - R.x j)‖ +
refinementAccuracyBound (pseudoConditionNumber A) θ η ε * ‖WithLp.toLp 2 xs‖
Full source on GitHub
Copy link
The solve accuracy comes from the backward error of the solver:
Theorem (A backward stable solve has a small relative error). If \mathbf{A} is invertible, (\mathbf{A}+\mathbf{E})\mathbf{d}=\mathbf{r} and \|\mathbf{A}^{-1}\mathbf{E}\|_2\le\omega<1, then
\|\mathbf{A}^{-1}\mathbf{r}-\mathbf{d}\|\le\frac{\omega}{1-\omega}\|\mathbf{A}^{-1}\mathbf{r}\|.
So \theta=\omega/(1-\omega), and \|\mathbf{E}\|_2\le c\,u_f\|\mathbf{A}\|_2 allows \omega=c\,\kappa_2(\mathbf{A})u_f.
Lean statement and details
NLAlib.norm_inv_mulVec_sub_le_of_add_mulVec_eq.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2}
[Fintype n] [DecidableEq n] {A E : Matrix n n 𝕜} (hA : IsUnit A) {ω : ℝ}
(hE : specNorm (A⁻¹ * E) ≤ ω) (hω : ω < 1) {d r : n → 𝕜} (hd : (A + E) *ᵥ d = r) :
‖WithLp.toLp 2 (A⁻¹ *ᵥ r - d)‖ ≤ ω / (1 - ω) * ‖WithLp.toLp 2 (A⁻¹ *ᵥ r)‖
Full source on GitHub
Copy link