NLA-lib Explorer

NLAlib.ShiftedQR.optimalTest_writes_word

Library · theorem

Optimal on any scalar machine with exact comparisons: with the order-(n+1) matrix \mathbf{H} at A, the shifts ss (k \le n of them) stored as pairs at S, the word c at C, and the flag word apart from these, optimalTest stores NLAlib.ShiftedQR.optimalTestWord in F and writes only F. A fragment of the tree NLAlib.ShiftedQR.regularizeDecide.

NLAlib.ShiftedQR.optimalTest_writes_word {Op Tst : Type} [Ops.Has Ops.ScalarOp Op]
  [Ops.Has Ops.CmpTst Tst] {M : Ops.Machine ℝ} {I : Ops.Interp Op Tst ℝ} (hS : Ops.IsScalar M I)
  (hC : Ops.IsCmp id I) {τ : Ops.Tape ℝ} {m : Ops.Mem ℝ} {n : ℕ} {a s c f : ℕ × ℕ}
  {H : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ} {ss : List ℂ} {cv : ℝ} (hk : ss.length ≤ n)
  (hH : HoldsMatrix a H m.store)
  (hs : m.store.readBlock s.1 s.2 (2 * ss.length) = some (List.flatMap (fun z ↦ [z.re, z.im]) ss))
  (hc : m.store.get c.1 c.2 = some cv) (hf : f.2 < m.store.len f.1) (hl : m.Live [a, s, c, f])
  (has :
    Ops.Fp.Disj (Ops.Store.inBlock f.1 f.2 1)
      (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))) ⊔
          Ops.Store.inBlock s.1 s.2 (2 * ss.length) ⊔
        Ops.Store.inBlock c.1 c.2 1)) :
  Ops.Writes Ops.Mode.total I τ ShiftedQR.optimalTest
    (Ops.Env.frame [n + 1, ss.length] [a, s, c, f]) (Ops.Store.inBlock f.1 f.2 1)
    (fun m' ↦ m'.pos = m.pos ∧ m'.store.get f.1 f.2 = some (ShiftedQR.optimalTestWord M H ss cv)) m

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.RoundedRitz.