NLA-lib Explorer

NLAlib.Krylov.GolubKahan.Band.extend_writes

Library · theorem

The call rule of a basis extension. On a readable basis qs of k columns at Q and a readable block ws of b columns at W, in three distinct buffers with room for the new block directly after the basis and for the coefficients at C, a call of an operation that satisfies the contract of a basis extension for the predicate Ext at admitted dimensions [r, k, b] writes only its three output blocks, does not move the tape, and leaves a stored extension by the decoded block ws. Shared by the trees of NLAlib.Krylov.GolubKahan.Band.step, NLAlib.Krylov.GolubKahan.Band.solve.

NLAlib.Krylov.GolubKahan.Band.extend_writes {K Op Tst : Type} [Inhabited K] {dec : K → ℝ}
  {Ext : Ops.ExtendPred ℝ} {ok : ℕ → ℕ → ℕ → Prop} {I : Ops.Interp Op Tst K} {o : Op}
  (hO : I.Satisfies Ops.Mode.total o ((Ops.extendRelOf dec ok Ext).spec Ops.ExtendOperands))
  {τ : Ops.Tape K} {ρ : Ops.Env} {ds : List Ops.IExp} {ins outs : List Ops.Operand} {r k b : ℕ}
  {Q W C : ℕ × ℕ} {μ : Ops.Mem K} {qs ws : List K}
  (hd : Ops.IExp.evalList ρ.idx ds = some [r, k, b]) (ha : Ops.Operand.evalList ρ ins = some [Q, W])
  (hb : Ops.Operand.evalList ρ outs = some [(Q.1, Q.2 + k * r), W, C]) (hQW : Q.1 ≠ W.1)
  (hQC : Q.1 ≠ C.1) (hWC : W.1 ≠ C.1) (hok : ok r k b) (hl : μ.Live [Q, W, C])
  (hq : μ.store.readBlock Q.1 Q.2 (k * r) = some qs)
  (hw : μ.store.readBlock W.1 W.2 (b * r) = some ws) (hQr : Q.2 + k * r + b * r ≤ μ.store.len Q.1)
  (hWr : W.2 + b * r ≤ μ.store.len W.1) (hCr : C.2 + (k + b) * b ≤ μ.store.len C.1) :
  Ops.Writes Ops.Mode.total I τ (Ops.Stmt.call o ds ins outs) ρ
    (Ops.Fp.blocks [(Q.1, Q.2 + k * r), W, C] [b * r, b * r, (k + b) * b])
    (fun μ' ↦
      μ'.pos = μ.pos ∧
        Krylov.GolubKahan.Band.ExtAt dec Ext μ'.store r k b Q C fun x ↦
          x = Ops.decodeMatrix dec r b ws)
    μ

Full source on GitHub

Import NLAlib.Krylov.GolubKahan.Band.StoredExtension.