NLA-lib Explorer

NLAlib.LinearSystems.Refinement.Certification.algorithm_checked

Library · theorem

Forward error of certified iterative refinement. What the certificate states, with no reference to routines or contracts. For every invertible \mathbf{A} of order n whose contraction factor \varphi is less than one, every right-hand side \mathbf{b} and start \mathbf{x}_0, every interpretation of the residual, the correction solve and the update within their accuracies \eta, \zeta, \theta, \varepsilon for \mathbf{A}, and every tape, the counted run of the fixed program from \mathbf{b}, \mathbf{x}_0 and two blank vectors succeeds, executes at most 25 k + 15 instructions (each of the three operations counting one), keeps its resident memory within the payload of the four vectors plus the static scratch of the tree, and the second vector then holds an iterate \hat{\mathbf{x}} with, for every solution \mathbf{A}\mathbf{x}_\star = \mathbf{b}, \|\mathbf{x}_\star - \hat{\mathbf{x}}\| \le \varphi^k\|\mathbf{x}_\star - \mathbf{x}_0\| + \frac{\xi}{1 - \varphi}\,\|\mathbf{x}_\star\|\,. Here, with \kappa = \kappa(\mathbf{A}), the contraction factor is the following, <!-- value refinementContractionFactor \kappa \theta \eta \zeta \varepsilon --> \varphi = (1+\varepsilon)(\theta+(1+\theta)\kappa(\zeta+\eta)), and the accuracy bound is the following, <!-- value refinementAccuracyBound \kappa \theta \eta \varepsilon --> \xi = (1+\varepsilon)(1+\theta)2\kappa\eta+\varepsilon. [CarsonHigham2018, Corollary 3.3]; stated there for three unit roundoffs in the \infty-norm, here for the accuracies of the three operations in the Euclidean norm.

Notes

the matrix is in no buffer. It is reached only through the residual and the correction solve, and the work is counted in calls of them (NLAlib.LinearSystems.Refinement.Certification.oracles); a reader must check that the two contracts are the intended ones. The run behind the bound is NLAlib.RefinementRun.

NLAlib.LinearSystems.Refinement.Certification.algorithm_checked (θ η ζ ε : ℝ)
  (domain : (Fin 2 → ℕ) → Prop) (admitted : ∃ d, domain d)
  (supply :
    ∀ (d : Fin 2 → ℕ), domain d → ∃ x, LinearSystems.Refinement.Certification.accepts θ η ζ ε d x)
  (hθ : 0 ≤ θ) (hη : 0 ≤ η) (hζ : 0 ≤ ζ) (hε : 0 ≤ ε) (d : Fin 2 → ℕ) (hd : domain d)
  (A : Matrix (Fin (d 0)) (Fin (d 0)) ℝ) (rhs x₀ : Fin (d 0) → ℝ) (hA : IsUnit A)
  (hφ : refinementContractionFactor (pseudoConditionNumber A) θ η ζ ε < 1)
  (I : Ops.Interp Ops.RefinementOp Empty ℝ)
  (hI :
    (LinearSystems.Refinement.Certification.model θ η ζ ε domain admitted supply hθ hη hζ
          hε).contracts
      d
      ((LinearSystems.Refinement.Certification.inputs θ η ζ ε domain admitted supply).input d
        (A, rhs, x₀) ⋯)
      I)
  (τ : Ops.Tape ℝ) :
  ∃ st,
    Ops.Reference.Execution LinearSystems.Refinement.Certification.program I
        (LinearSystems.Refinement.Certification.model θ η ζ ε domain admitted supply hθ hη hζ
            hε).resources
        (LinearSystems.Refinement.Certification.inputs θ η ζ ε domain admitted supply).formats τ d
        ((LinearSystems.Refinement.Certification.inputs θ η ζ ε domain admitted supply).memory d
          (A, rhs, x₀))
        st ∧
      (LinearSystems.Refinement.Certification.model θ η ζ ε domain admitted supply hθ hη hζ
                  hε).resources.work
            st.cost ≤
          25 * d 1 + 15 ∧
        (LinearSystems.Refinement.Certification.inputs θ η ζ ε domain admitted supply).bytes d +
              st.peak ≤
            (LinearSystems.Refinement.Certification.inputs θ η ζ ε domain admitted supply).bytes d +
              Ops.staticPeak
                (LinearSystems.Refinement.Certification.model θ η ζ ε domain admitted supply hθ hη
                    hζ hε).resources
                LinearSystems.Refinement.Certification.program d ∧
          ∃ x,
            st.mem.Holds (Ops.Codec.vector (d 0)) 1 x ∧
              ∀ (xstar : Fin (d 0) → ℝ),
                A *ᵥ xstar = rhs →
                  ‖WithLp.toLp 2 (xstar - x)‖ ≤
                    refinementContractionFactor (pseudoConditionNumber A) θ η ζ ε ^ d 1 *
                        ‖WithLp.toLp 2 (xstar - x₀)‖ +
                      refinementAccuracyBound (pseudoConditionNumber A) θ η ε /
                          (1 - refinementContractionFactor (pseudoConditionNumber A) θ η ζ ε) *
                        ‖WithLp.toLp 2 xstar‖

Full source on GitHub

Import NLAlib.LinearSystems.Refinement.Certification.