NLA-lib Explorer

NLAlib.Krylov.Lanczos.update_writes

Library · theorem

Exact arithmetic Oracle: matrix–vector product

The Paige-order raw update borrows Prev=L, Work=L+1 and two scalar cells at L+2. The current vector and coefficient cells lie below those buffers; the current vector and alpha output use different buffers. No spectral or nonbreakdown assumption is needed.

A fragment of NLAlib.Krylov.Lanczos.solveRoutine: the raw three-term update of one round, on the previous and work vectors the solver allocates and a column of V at the round index.

NLAlib.Krylov.Lanczos.update_writes {K Op Tst : Type} [Inhabited K] [Ops.Has Ops.ScalarOp Op]
  [Ops.Has Ops.Blas1Op Op] [Ops.Has Ops.OperatorOp Op] {M : Ops.Machine K} {dec : K → ℝ} {n L : ℕ}
  {I : Ops.Interp Op Tst K} {A : Matrix (Fin n) (Fin n) ℝ} {ok : ℕ → Prop} (hS : Ops.IsScalar M I)
  (hM : Ops.ExactModel dec M) (hB : Ops.IsExactBlas1 dec ok I) (hok : ok n)
  (hA : Ops.IsExactMatvec dec A I) {τ : Ops.Tape K} {μ : Ops.Mem K} {q b a : ℕ × ℕ} {ps qs : List K}
  {β : K} (hqa : q.1 ≠ a.1) (hqL : q.1 < L) (hbL : b.1 < L) (haL : a.1 < L)
  (hlen : List.length μ.store = L + 3) (hw : μ.store.len (L + 1) = n) (ht : μ.store.len (L + 2) = 2)
  (ha : a.2 < μ.store.len a.1) (hps : μ.store.readBlock L 0 n = some ps)
  (hqs : μ.store.readBlock q.1 q.2 n = some qs) (hβ : μ.store.get b.1 b.2 = some β) :
  Ops.Writes Ops.Mode.total I τ Krylov.Lanczos.update
    (Ops.Env.frame [n] [(L, 0), q, b, (L + 1, 0), a, (L + 2, 0), (L + 1, 0), a])
    (Ops.Fp.blocks [(L + 1, 0), a, (L + 2, 1)] [n, 1, 1])
    (fun μ' ↦
      μ'.pos = μ.pos ∧
        ∃ ws α,
          μ'.store.readBlock (L + 1) 0 n = some ws ∧
            μ'.store.get a.1 a.2 = some α ∧
              dec α =
                  lanczosAlpha A
                    { prev := Ops.decv dec n ps, cur := Ops.decv dec n qs, beta := dec β } ∧
                Ops.decv dec n ws =
                  A *ᵥ Ops.decv dec n qs - dec β • Ops.decv dec n ps - dec α • Ops.decv dec n qs)
    μ

Full source on GitHub

Import NLAlib.Krylov.Lanczos.Update.