NLA-lib Explorer

NLAlib.Ops.Hermitian.averageUpper_writes

Library · theorem

Hermitian averaging writes the two actual rounded operations per component, with zero imaginary diagonal. Every transposed input word belongs to the same supplied matrix. A fragment of the tree NLAlib.Ops.Hermitian.average.

NLAlib.Ops.Hermitian.averageUpper_writes {K Op Tst : Type} [Ops.Has Ops.ScalarOp Op]
  {M : Ops.Machine K} {I : Ops.Interp Op Tst K} (hI : Ops.IsScalar M I) {τ : Ops.Tape K} {n : ℕ}
  {x c y : ℕ × ℕ} {m : Ops.Mem K} {A : ℕ → ℕ → K × K} {d : K}
  (hxy :
    Ops.Fp.Disj (Ops.Store.inBlock x.1 x.2 (2 * (n * n))) (Ops.Store.inBlock y.1 y.2 (2 * (n * n))))
  (hcy : Ops.Fp.Disj (Ops.Store.inBlock c.1 c.2 1) (Ops.Store.inBlock y.1 y.2 (2 * (n * n))))
  (hX :
    m.store.HoldsEntries (Ops.EntryCodec.pair K)
      { buf := x.1, off := x.2, rows := n, cols := n, ld := n } A)
  (hc : m.store.get c.1 c.2 = some d) (hY : y.2 + 2 * (n * n) ≤ m.store.len y.1)
  (hl : m.Live [x, c, y]) :
  Ops.Writes Ops.Mode.total I τ Ops.Hermitian.averageUpper (Ops.Env.frame [n] [x, c, y])
    (Ops.Store.inBlock y.1 y.2 (2 * (n * n)))
    (fun μ ↦
      (μ.store.HoldsRowEntries (Ops.EntryCodec.pair K)
          { buf := y.1, off := y.2, rows := n, cols := n, ld := n } (fun j ↦ j + 1) fun i j ↦
          if i = j then (M.div (M.add (A i i).1 (A i i).1) d, M.lit 0)
          else (M.div (M.add (A i j).1 (A j i).1) d, M.div (M.sub (A i j).2 (A j i).2) d)) ∧
        μ.pos = m.pos)
    m

Full source on GitHub

Import NLAlib.Ops.Blas.HermitianUpper.