NLA-lib Explorer

Scalar conjugate gradient in rounded arithmetic: termination, operation count and energy-norm error

Library · Result group

Theorem (Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.exec_scalarProgram_work_le_and_quadForm_le). Scalar conjugate gradient in rounded arithmetic: termination, operation count and energy-norm error. Let \mathbf{A} \in \mathbb{R}^{n \times n} be symmetric with spectrum in [a, a'], a > 0, stored entry by entry, let \mathbf{b} \in \mathbb{R}^n and let k be the iteration cap; write \kappa = a'/a. The program is Hestenes–Stiefel conjugate gradient from \mathbf{x}_0 = \mathbf{0} that keeps the residual self-product between rounds, with every matrix-vector product and every vector operation written out as scalar loops. Its arithmetic is any scalar machine in the standard model with unit roundoff u: each of +, -, \times, /, \sqrt{\cdot} returns the exact result times 1 + \delta, \lvert \delta \rvert \le u, with no overflow or underflow, and comparisons of stored numbers are exact. Let E be an allowance with E \le 1/100 that dominates the rounding of one scalar operation (16 u \le E), of one dot product, vector update and scaling of length n, and of one row-by-row matrix-vector product (Standard.Accuracy), and assume 3 E a' \le a and k^{2} \sqrt{k}\, E\, \kappa^{2} \le 10^{-5}.

Headline Standard rounding

Lean statement and details
NLAlib.Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.exec_scalarProgram_work_le_and_quadForm_le
  {lower upper : (Fin 2 → ℕ) → ℝ} {domain : (Fin 2 → ℕ) → Prop} {admitted : ∃ d, domain d}
  {supply :
    ∀ (d : Fin 2 → ℕ),
      domain d → ∃ x, Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.accepts lower upper d x}
  (M : Ops.Machine ℝ) (u : ℝ) (hM : Ops.StdModel u id M) (hu : 0 ≤ u) (em E : (Fin 2 → ℕ) → ℝ)
  (hMatvec : ∀ (d : Fin 2 → ℕ), domain d → Ops.ScalarProducts.roundoff u (d 0) * √↑(d 0) ≤ em d)
  (hAccuracy :
    ∀ (d : Fin 2 → ℕ), domain d → Ops.Standard.Accuracy (em d) u (E d) (Ops.Blas.seq.err u) (d 0))
  (ha : ∀ (d : Fin 2 → ℕ), domain d → 0 < lower d)
  (hprec : ∀ (d : Fin 2 → ℕ), domain d → 3 * E d * upper d ≤ lower d)
  (hwindow :
    ∀ (d : Fin 2 → ℕ), domain d → ↑(d 1) ^ 2 * √↑(d 1) * E d * (upper d / lower d) ^ 2 ≤ 1 / 10 ^ 5)
  {d : Fin 2 → ℕ} (hd : domain d)
  (x :
    (Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.problem lower upper domain admitted
          supply).Input
      d)
  (I : Ops.Interp Ops.ScalarOp Ops.CmpTst ℝ)
  (hI :
    (Ops.RoundedScalarBlas.model
          (Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.problem lower upper domain admitted
            supply)
          M).contracts
      d x I)
  (τ : Ops.Tape ℝ) :
  ∃ st,
    Ops.Reference.Execution Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.scalarProgram I
        Ops.RoundedScalarBlas.resources
        (Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.problem lower upper domain admitted
            supply).formats
        τ d
        ((Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.problem lower upper domain admitted
              supply).initial
          d x)
        st ∧
      Ops.RoundedScalarBlas.resources.work st.cost ≤
          33 * d 0 ^ 2 * d 1 + 157 * d 0 * d 1 + 242 * d 1 + 50 * d 0 + 127 ∧
        ∃ m ≤ d 1,
          ∃ s rho,
            Krylov.CG.HSCG.Carried.Rounded.StoresValues id (d 0) (2, 0) (3, 0) (4, 0) (5, 0) s rho
                st.mem ∧
              (m < d 1 → s.r = 0) ∧
                ∀ (xs : Fin (d 0) → ℝ),
                  Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.inputMatrix x *ᵥ xs =
                      Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.inputRhs x →
                    quadForm (Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.inputMatrix x)
                        (xs - s.x) ≤
                      4 *
                              ((√(2 * (upper d / lower d) + 1) - 1) /
                                  (√(2 * (upper d / lower d) + 1) + 1)) ^
                                (2 * m) *
                            quadForm
                              (Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.inputMatrix x)
                              xs +
                          2 *
                                ‖WithLp.toLp 2
                                      (Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.inputRhs
                                        x)‖ ^
                                  2 *
                              (6000 * ↑m ^ 2 * √↑m * E d * (upper d / lower d) * upper d) /
                            lower d ^ 2 +
                        135 * ↑m ^ 2 * E d * (upper d / lower d) *
                          (‖WithLp.toLp 2
                                  (Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.inputRhs
                                    x)‖ ^
                              2 /
                            lower d)

Full source on GitHub

Copy link