NLA-lib Explorer

NLAlib.ShiftedQR.splitPush_writes_of_isExactNatLit

Library · theorem

Splitting is two total stack operations on the actual stored count. The two persistent slots have capacity before execution; the existing stack words are retained by the frame. Only the literals written need to be exact. Shared by the trees of NLAlib.ShiftedQR.shqrSmallEigRoutine and NLAlib.SmallEig.smallEigRoutine, on their scratch.

NLAlib.ShiftedQR.splitPush_writes_of_isExactNatLit {O Q : Type} [Ops.Has Ops.IndexOp O]
  [Ops.Has Ops.IdxTst Q] {M : Ops.Machine ℝ} {I : Ops.Interp O Q ℝ} (hL : Ops.IsIndexLit M I)
  (hQ : Ops.IsToNat id I) {B : ℕ} (hN : Ops.IsExactNatLit id M B) {τ : Ops.Tape ℝ} {m : Ops.Mem ℝ}
  {capacity lo d i : ℕ} {b : ℕ × ℕ} (hli : lo + i + 1 ≤ B) (hd : d ≤ B) (hcB : capacity ≤ B)
  {rs : List (ℕ × ℕ)} (hl : m.Live [b]) (hSt : ShiftedQR.StackHolds b rs m.store)
  (hcap : rs.length + 2 ≤ capacity) (hroom : b.2 + 1 + 2 * capacity ≤ m.store.len b.1) :
  Ops.Writes Ops.Mode.total I τ ShiftedQR.splitPush (Ops.Env.frame [capacity, lo, d, i] [b])
    (Ops.Store.inBlock b.1 b.2 (1 + 2 * capacity))
    (fun m' ↦
      m'.pos = m.pos ∧
        ShiftedQR.StackHolds b (rs ++ [(lo + i + 1, d - i - 1), (lo, i + 1)]) m'.store)
    m

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.Deflation.