NLA-lib Explorer

Scalar Lanczos with full reorthogonalization in rounded arithmetic: termination, operation count, orthogonality and Ritz values

Library · Result group

Theorem (Krylov.Lanczos.Reorth.Rounded.Stored.Certification.exec_scalarProgram_work_le_and_spectral). Scalar Lanczos with full reorthogonalization in rounded arithmetic: termination, operation count, orthogonality and Ritz values. Let \mathbf{A} \in \mathbb{R}^{n \times n} be symmetric, stored entry by entry, let \mathbf{b} \in \mathbb{R}^n and let k be the iteration cap. The program is the Lanczos recurrence started from \mathbf{b} in which each new vector is orthogonalized twice against all stored vectors (classical Gram–Schmidt, two passes) before it is normalized, 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} exact up to a factor 1 + \delta, \lvert\delta\rvert \le u, no overflow or underflow, exact comparisons), and E \le 1/100 is an allowance that dominates the rounding of one scalar operation, of one dot product, vector update and scaling of length n, and of one matrix-vector product (Lanczos.Rounded.Precision).

Headline Standard rounding

Lean statement and details
NLAlib.Krylov.Lanczos.Reorth.Rounded.Stored.Certification.exec_scalarProgram_work_le_and_spectral
  {domain : (Fin 2 → ℕ) → Prop} {admitted : ∃ d, domain d} (M : Ops.Machine ℝ) (u : ℝ)
  (hM : Ops.StdModel u id M) (hu : 0 ≤ u) (E : (Fin 2 → ℕ) → ℝ)
  (hprec :
    ∀ (d : Fin 2 → ℕ),
      domain d →
        Krylov.Lanczos.Rounded.Precision (Ops.ScalarProducts.roundoff u (d 0) * √↑(d 0)) u (E d)
          (Ops.Blas.seq.err u) (d 0))
  {d : Fin 2 → ℕ} (hd : domain d)
  (x : (Krylov.Lanczos.Reorth.Rounded.Stored.Certification.problem domain admitted).Input d)
  (I : Ops.Interp Ops.ScalarOp Ops.CmpTst ℝ)
  (hI :
    (Ops.RoundedScalarBlas.model
          (Krylov.Lanczos.Reorth.Rounded.Stored.Certification.problem domain admitted) M).contracts
      d x I)
  (τ : Ops.Tape ℝ) :
  ∃ st,
    Ops.Reference.Execution Krylov.Lanczos.Reorth.Rounded.Stored.Certification.scalarProgram I
        Ops.RoundedScalarBlas.resources
        (Krylov.Lanczos.Reorth.Rounded.Stored.Certification.problem domain admitted).formats τ d
        ((Krylov.Lanczos.Reorth.Rounded.Stored.Certification.problem domain admitted).initial d x)
        st ∧
      Ops.RoundedScalarBlas.resources.work st.cost ≤
          33 * d 0 ^ 2 * d 1 + 92 * d 0 * d 1 ^ 2 + 152 * d 1 ^ 2 + 269 * d 0 * d 1 + 581 * d 1 +
              58 * d 0 +
            179 ∧
        ∃ vs cs,
          st.mem.store.readBlock 2 0 ((d 1 + 1) * d 0) = some vs ∧
            st.mem.store.readBlock 3 0 (3 * d 1 + 2) = some cs ∧
              ∀ (thr η c : ℝ),
                0 < thr →
                  thr ≤ 1 →
                    0 ≤ η →
                      η ≤ 1 / 100 →
                        0 ≤ c →
                          c ≤ 1 / 100 →
                            (∀ j < d 1,
                                (↑j + 1 + 1) * (Ops.Blas.seq.err u).dot (d 0) * (1 + η) ^ 2 +
                                    ((1 + (Ops.Blas.seq.err u).axpy) ^ (j + 1) - 1) *
                                      (1 +
                                        (↑j + 1) * (1 + (Ops.Blas.seq.err u).dot (d 0)) *
                                          (1 + η) ^ 2) ≤
                                  c) →
                              √(3 * (↑(d 1) + 1)) * (2 * (2 * c + 2 * (η + c) ^ 2 / thr + E d)) ≤
                                  η →
                                2 * (2 * c + 2 * (η + c) ^ 2 / thr + E d) + E d + 3 * c ≤ 1 / 100 →
                                  ∃ done ≤ d 1,
                                    ∃ z nus,
                                      Krylov.Lanczos.Reorth.Rounded.History id (↑x).1.1 (↑x).1.2
                                          (Ops.ScalarProducts.roundoff u (d 0) * √↑(d 0)) u (E d)
                                          (Ops.Blas.seq.err u) done z nus ∧
                                        Krylov.Lanczos.Reorth.Rounded.PackedOutput id (d 1) done z
                                            nus vs cs ∧
                                          (done < d 1 →
                                              (if done = 0 then z.initialNorm else z.beta done) =
                                                0) ∧
                                            ∃ r ≤ done,
                                              (∀ j < r, thr * nus (j + 1) < z.beta (j + 1)) ∧
                                                (r < done → z.beta (r + 1) ≤ thr * nus (r + 1)) ∧
                                                  (r = 0 ∨
                                                    specNorm
                                                          ((Krylov.Lanczos.basisMatrix id (d 0) vs
                                                                  r)ᵀ *
                                                              Krylov.Lanczos.basisMatrix id (d 0) vs
                                                                r -
                                                            1) ≤
                                                        η ∧
                                                      ∀ i < r,
                                                        eigenvalue (↑x).1.1 (i + (d 0 - r)) -
                                                              100 * (↑r + 1) *
                                                                  (2 *
                                                                        (2 * c +
                                                                            2 * (η + c) ^ 2 / thr +
                                                                          E d) +
                                                                      E d +
                                                                    3 * c) *
                                                                specNorm (↑x).1.1 ≤
                                                            eigenvalue
                                                              (Krylov.Lanczos.tridiagonalMatrix id
                                                                (d 1) cs r)
                                                              i ∧
                                                          eigenvalue
                                                              (Krylov.Lanczos.tridiagonalMatrix id
                                                                (d 1) cs r)
                                                              i ≤
                                                            eigenvalue (↑x).1.1 i +
                                                              100 * (↑r + 1) *
                                                                  (2 *
                                                                        (2 * c +
                                                                            2 * (η + c) ^ 2 / thr +
                                                                          E d) +
                                                                      E d +
                                                                    3 * c) *
                                                                specNorm (↑x).1.1)

Full source on GitHub

Copy link