NLA-lib Explorer

NLAlib.Krylov.GolubKahan.Band.applyColumns_writes_of

Library · theorem

A block of products, for any contract of one product. If the operation o satisfies a contract Rm with the operand shape of a product with an r × c matrix (one input block of length c, one output block of length r in another buffer, no window) whose relation gives rel of the decoded input and output vectors, the loop over the b columns of the readable block xs writes a block ys with rel of every pair of decoded columns. The position of the tape does not move. Zero dimensions are included. A fragment of NLAlib.Krylov.GolubKahan.Band.solveRoutine.

NLAlib.Krylov.GolubKahan.Band.applyColumns_writes_of {K Op Tst : Type} [Inhabited K] {dec : K → ℝ}
  {r c b : ℕ} {Rm : Ops.BlockRel K} {rel : (Fin c → ℝ) → (Fin r → ℝ) → Prop}
  {I : Ops.Interp Op Tst K} {o : Op}
  (hA : I.Satisfies Ops.Mode.total o (Rm.spec (Ops.MatvecOperands r c))) (hnd : Rm.nd = 2)
  (hwin : Rm.win [r, c] = 0) (hin : Rm.inLens [r, c] = [c]) (hout : Rm.outLens [r, c] = [r])
  (hdom : ∀ (xs : List (List K)) (w : List K), Rm.dom [r, c] xs w)
  (hrel :
    ∀ (xs w ys : List K), Rm.rel [r, c] [xs] w [ys] → rel (Ops.decv dec c xs) (Ops.decv dec r ys))
  {τ : Ops.Tape K} {μ : Ops.Mem K} {x y : ℕ × ℕ} {xs : List K} (hxy : x.1 ≠ y.1)
  (hl : μ.Live [x, y]) (hx : μ.store.readBlock x.1 x.2 (b * c) = some xs)
  (hy : y.2 + b * r ≤ μ.store.len y.1) :
  Ops.Writes Ops.Mode.total I τ (Krylov.GolubKahan.Band.applyColumns o)
    (Ops.Env.frame [r, c, b] [x, y]) (Ops.Store.inBlock y.1 y.2 (b * r))
    (fun μ' ↦
      μ'.pos = μ.pos ∧
        ∃ ys,
          μ'.store.readBlock y.1 y.2 (b * r) = some ys ∧
            ∀ (j : Fin b),
              rel ((Ops.decodeMatrix dec c b xs).col j) ((Ops.decodeMatrix dec r b ys).col j))
    μ

Full source on GitHub

Import NLAlib.Krylov.GolubKahan.Band.Alg.