NLA-lib Explorer

NLAlib.Krylov.CG.Reorth.advance_writes

Library · theorem

Exact arithmetic Oracle: matrix–vector product

Before the grade, saving a residual and taking the reorthogonalized round succeeds.

A fragment of NLAlib.Krylov.CG.Reorth.solveRoutine, not a routine: it reads the loop index of rounds and writes the history buffer and guard cell that the solver allocates.

NLAlib.Krylov.CG.Reorth.advance_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 → ℝ}
  {I : Ops.Interp Op Tst K} (hS : Ops.IsScalar M I) (hM : Ops.ExactModel dec M)
  (hB : Ops.IsExactBlas1 dec (fun x ↦ True) I) {n cap i L : ℕ} {A : Matrix (Fin n) (Fin n) ℝ}
  (hA : Ops.IsExactMatvec dec A I) (hPos : A.PosDef) {τ : Ops.Tape K} {μ : Ops.Mem K}
  {b x r p : ℕ × ℕ} {bs x₀ : Fin n → ℝ} (hi : i < cap) (hig : i < krylovGrade A (bs - A *ᵥ x₀))
  (hxr : x.1 ≠ r.1) (hxp : x.1 ≠ p.1) (hrp : r.1 ≠ p.1) (hxL : x.1 < L) (hrL : r.1 < L)
  (hpL : p.1 < L) (hl : List.length μ.store = L + 2) (hQ : μ.store.len L = cap * n)
  (hv : μ.store.len (L + 1) = 1) (hz : μ.Room [x, r, p] [n, n, n])
  (hs : Krylov.CG.HSCG.StoresState dec n x r p (cgState A bs x₀ i) μ)
  (hh : Krylov.CG.Reorth.StoresHistory dec n (L, 0) (fun j ↦ (cgState A bs x₀ j).r) i μ) :
  Ops.Writes Ops.Mode.total I τ Krylov.CG.Reorth.advance
    { idx := [n, cap, b.2, x.2, x.2, r.2, p.2, i], buf := [b.1, x.1, x.1, r.1, p.1, L, L + 1] }
    (Ops.Fp.blocks [x, r, p] [n, n, n] ⊔ Ops.Fp.above L)
    (fun μ' ↦
      μ'.pos = μ.pos ∧
        Krylov.CG.HSCG.StoresState dec n x r p (cgState A bs x₀ (i + 1)) μ' ∧
          Krylov.CG.Reorth.StoresHistory dec n (L, 0) (fun j ↦ (cgState A bs x₀ j).r) (i + 1) μ' ∧
            ∃ rr,
              μ'.store.get (L + 1) 0 = some rr ∧
                dec rr = (cgState A bs x₀ (i + 1)).r ⬝ᵥ (cgState A bs x₀ (i + 1)).r)
    μ

Full source on GitHub

Import NLAlib.Krylov.CG.Reorth.Advance.