NLA-lib Explorer

NLAlib.Ops.Examples.runs_sq2

Library · theorem

The abstract theorem of sq2, for every f and every interpretation satisfying the functional contract: two calls of mm at [n, n, n], the workspace of one, and the memory is given by f.

NLAlib.Ops.Examples.runs_sq2 {K : Type} {f : ℕ → ℕ → ℕ → List K → List K → List K}
  {I : Ops.Interp Ops.Examples.MOp Empty K} (hI : Ops.Examples.IsMM f I)
  (W : Ops.Examples.MOp → List ℕ → ℕ) {τ : Ops.Tape K} {n : ℕ} {A P S : ℕ × ℕ} {m : Ops.Mem K}
  {As : List K} (hAP : A.1 ≠ P.1) (hPS : P.1 ≠ S.1)
  (hA : m.store.readBlock A.1 A.2 (n * n) = some As) (hP : P.2 + n * n ≤ m.store.len P.1)
  (hS : S.2 + n * n ≤ m.store.len S.1) (hl : m.Live [A, P, S]) :
  Ops.ConditionalRuns I W τ Ops.Examples.sq2 { idx := [n, A.2, P.2, S.2], buf := [A.1, P.1, S.1] } m
    (2 • Ops.Count.one Ops.Examples.MOp.mm [n, n, n]) (W Ops.Examples.MOp.mm [n, n, n]) fun x ↦
    x = (m.updBlock P (f n n n As As)).updBlock S (f n n n (f n n n As As) (f n n n As As))

Full source on GitHub

Import NLAlib.Ops.Examples.MatMul.