NLA-lib Explorer

NLAlib.Ops.Hermitian.diagonal_writes

Library · theorem

A diagonal entry procedure is lifted to all diagonal positions by the injective-region rule. Its matrix-level proof supplies no partial-output invariant or component framing. Shared by the trees of NLAlib.ShiftedQR.stepComptau, NLAlib.ShiftedQR.RandomDecouplingRoutineContract, NLAlib.ShiftedQR.replicatePair and 16 more.

NLAlib.Ops.Hermitian.diagonal_writes {K Op Tst : Type} {I : Ops.Interp Op Tst K} {τ : Ops.Tape K}
  (entry : Ops.Stmt Op Tst) (F : K × K → K → K × K)
  (hentry :
    ∀ (μ : Ops.Mem K) (x c z : ℕ × ℕ) (a : K × K) (d : K),
      Ops.Fp.Disj (Ops.Store.inBlock x.1 x.2 2) (Ops.Store.inBlock z.1 z.2 2) →
        Ops.Fp.Disj (Ops.Store.inBlock c.1 c.2 1) (Ops.Store.inBlock z.1 z.2 2) →
          μ.Live [x, c, z] →
            μ.store.get x.1 x.2 = some a.1 →
              μ.store.get x.1 (x.2 + 1) = some a.2 →
                μ.store.get c.1 c.2 = some d →
                  z.2 + 2 ≤ μ.store.len z.1 →
                    Ops.Wp Ops.Mode.total I τ entry (Ops.Env.frame [] [x, c, z])
                      (fun μ' ↦ μ' = μ.updBlock z [(F a d).1, (F a d).2]) μ)
  {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.diagonal entry) (Ops.Env.frame [n] [x, c, y])
    ((Ops.EntryCodec.pair K).regionFp y.1 y.2 n (fun x j ↦ j * n + j) fun x ↦ 1)
    (fun m' ↦
      (m'.store.HoldsEntryRegion (Ops.EntryCodec.pair K) y.1 y.2 n (fun x j ↦ j * n + j) (fun x ↦ 1)
          fun x j ↦ F (A j j) d) ∧
        m'.pos = m.pos)
    m

Full source on GitHub

Import NLAlib.Ops.Blas.HermitianUpper.