NLA-lib Explorer

NLAlib.Ops.Hermitian.scale_writes_packed

Library · theorem

The scalar-visible scale program writes exactly the existing mathematical machine's packed output on the actual stored finite matrix. Spatially disjoint arena regions are allowed; numerical accuracy is a separate property of the same machine functions. Shared by the trees of NLAlib.Sign.initialized, NLAlib.Sign.inputs, NLAlib.SpectralBisection.nodeProjectors and 1 more.

NLAlib.Ops.Hermitian.scale_writes_packed {K Su Sg : Type} {M : Ops.Machine K} {dec : K → ℝ}
  {mm : MatMulMap (K × K)} {qr : QRMap (K × K)} {unif : K → Su → K} {normal : Sg → K × K}
  {Op Tst : Type} [Inhabited K] [Ops.Has Ops.ScalarOp Op] {I : Ops.Interp Op Tst K}
  (hI : Ops.IsScalar M I) {τ : Ops.Tape K} {n : ℕ} (A : Matrix (Fin n) (Fin n) (K × K)) (d : K)
  {x c y : ℕ × ℕ} {μ : Ops.Mem 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 : μ.store.readBlock x.1 x.2 (2 * (n * n)) = some ((Ops.EntryCodec.pair K).packFinMatrix A))
  (hc : μ.store.get c.1 c.2 = some d) (hY : y.2 + 2 * (n * n) ≤ μ.store.len y.1)
  (hl : μ.Live [x, c, y]) :
  Ops.Writes Ops.Mode.total I τ Ops.Hermitian.scale (Ops.Env.frame [n] [x, c, y])
    (Ops.Store.inBlock y.1 y.2 (2 * (n * n)))
    (fun μ' ↦
      μ'.pos = μ.pos ∧
        μ'.store.readBlock y.1 y.2 (2 * (n * n)) =
          some
            ((Ops.EntryCodec.pair K).packFinMatrix
              ((M.toFloatMachine dec (fun {l m n} ↦ mm) (fun {m n} ↦ qr) unif normal).hermScale A
                d)))
    μ

Full source on GitHub

Import NLAlib.Matrix.FinitePrecision.OpsHermitian.