NLA-lib Explorer

NLAlib.Krylov.Lanczos.Reorth.Rounded.Stored.Certification.exec_scalarProgram_work_le_and_spectral

Library · theorem

Headline of lanczos-reorth-scalar-rounded-operation-count-spectral Standard rounding

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).

Then for every such input, every interpretation of the scalar operations that meets the model, and every tape, the run succeeds, and

* it executes at most 33 n^{2} k + 92 n k^{2} + 152 k^{2} + 269 n k + 581 k + 58 n + 179 instructions (scalar operations, comparisons, index arithmetic, operand addressing, loop control and allocation, each of unit cost); * it performs some number m \le k of steps and leaves in memory the vectors \mathbf{v}_1, \dots, \mathbf{v}_{m+1}, the coefficients \alpha_j, \beta_j and, for each step, the norm \nu_j of the new vector before reorthogonalization (Lanczos.Reorth.Rounded.Output); if m < k, the last computed \beta_m (or the computed norm of \mathbf{b}) is exactly zero; * for every threshold 0 < \tau \le 1 and tolerances 0 \le \eta, c \le 1/100 that satisfy the three conditions hbudget, hsmall and hrec below, let r \le m be the number of leading steps with \beta_j > \tau \nu_j (no severe cancellation), and e = 100 (r + 1)\, \delta\, \|\mathbf{A}\|_2 with \delta = 2(2c + 2(\eta + c)^2/\tau + E) + E + 3c. If r \ge 1, then with \mathbf{V}_r = [\mathbf{v}_1, \dots, \mathbf{v}_r] and \theta_0 \ge \dots \ge \theta_{r-1} the eigenvalues of the stored tridiagonal matrix \mathbf{T}_r, \|\mathbf{V}_r^{\mathsf{T}} \mathbf{V}_r - \mathbf{I}\|_2 \le \eta, \qquad \lambda_{i + n - r}(\mathbf{A}) - e \le \theta_i \le \lambda_i(\mathbf{A}) + e \quad (i < r).

The conditions on \tau, \eta and c involve only n, k, u and E: hbudget asks that c dominate the accumulated rounding of one two-pass orthogonalization against at most k vectors, hsmall is the fixed-point condition \sqrt{3(k+1)}\,\cdot 2(2c + 2(\eta + c)^2/\tau + E) \le \eta, and hrec is \delta \le 1/100. The prefix r may be shorter than the run, and is empty when the first step already has \beta_1 \le \tau \nu_1; nothing is claimed beyond it. The count is an upper bound read off the fixed program (NLAlib.Ops.Program.countPoly). Orthogonality: [Paige1971, §6.1, (6.9)]; interlacing: [HornJohnson2013, Corollary 4.3.37] for the exact case. Result: lanczos-reorth-scalar-rounded-operation-count-spectral

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

Import NLAlib.Krylov.Lanczos.Reorth.Rounded.ScalarTheorem.