NLA-lib Explorer

NLAlib.Krylov.GolubKahan.Band.runs_linkedSolve

Library · theorem

Total counted execution of the linked program under exact contracts. Let the lower interpretation have the exact products with \mathbf{A} and \mathbf{A}^{\mathsf{H}} and draws that return the words of the tape, let the scheme E be certified against the exact contract of a basis extension, cost at most κ d at the dimensions d and use at most w scratch, and let every lower primitive have workspace at most w. Then for all dimensions (m, n, \mathbf{b}, q), on five live output blocks in distinct buffers with room for the output lengths, the linked program terminates within the counts NLAlib.Krylov.GolubKahan.Band.linkedSolveCount and the scratch \max(m, n)\,\mathbf{b} + w, consumes n\mathbf{b} samples, and the stored blocks decode to an exact run for \mathbf{A} from the start block decoded from the window of the tape.

NLAlib.Krylov.GolubKahan.Band.runs_linkedSolve {K Lo Tst : Type} [Ops.Has Ops.OperatorPairOp Lo]
  [Ops.Has Ops.SampleOp Lo] [Inhabited K] {dec : K → ℝ} {m n b q : ℕ} {A : Matrix (Fin m) (Fin n) ℝ}
  {I : Ops.Interp Lo Tst K} {E : Ops.Stmt Lo Tst} (hA : Ops.IsExactMatvecPair dec A I)
  (hSample : Ops.IsSample I) (hE : (Ops.extendRoutine E).Meets I (Ops.exactExtendSpec dec))
  (κ : List ℕ → Ops.Count Lo Tst) (W : Lo → List ℕ → ℕ) (w : ℕ)
  (hcost :
    ∀ (d offs : List ℕ),
      d.length = 3 →
        offs.length = 5 → Ops.stmtCost E (d ++ offs) ≤ κ d ∧ Ops.stmtPeak W E (d ++ offs) ≤ w)
  (hW : ∀ (o : Lo) (ds : List ℕ), W o ds ≤ w) (stream : ℕ) {τ : Ops.Tape K} {μ : Ops.Mem K}
  {U V G R S : ℕ × ℕ} (hbuf : [U.1, V.1, G.1, R.1, S.1].Nodup) (hl : μ.Live [U, V, G, R, S])
  (hz : μ.Room [U, V, G, R, S] (Krylov.GolubKahan.Band.outLens m n b q)) :
  Ops.ConditionalRuns I W τ (Krylov.GolubKahan.Band.linkedSolve E stream)
    (Ops.Env.frame [m, n, b, q] [U, V, G, R, S]) μ
    (Krylov.GolubKahan.Band.linkedSolveCount κ stream m n b q) ((m + (n - m)) * b + w) fun μ' ↦
    μ'.pos = μ.pos + n * b ∧
      ∃ us vs gs rs ss,
        μ'.readBlocks [U, V, G, R, S] (Krylov.GolubKahan.Band.outLens m n b q) =
            some [us, vs, gs, rs, ss] ∧
          Krylov.GolubKahan.Band.StoredOut dec m n b q
            (Krylov.GolubKahan.Band.IsExactStoredRun A b q) (τ.window stream μ.pos (n * b)) us vs gs
            rs ss

Full source on GitHub

Import NLAlib.Krylov.GolubKahan.Band.Linked.