NLA-lib Explorer

NLAlib.ShiftedQR.findRitzDecision_writes_of_exactNatLit

Library · theorem

The decision of a level with exact natural literals up to B: it keeps the first half when the value in R[4] is at most the one in R[3], halves the half length and doubles the exponent. Shared by the trees of NLAlib.ShiftedQR.scalarDecouple and NLAlib.ShiftedQR.shqrSmallEigRoutine, on their scratch.

NLAlib.ShiftedQR.findRitzDecision_writes_of_exactNatLit {O Q : Type} [Ops.Has Ops.IndexOp O]
  [Ops.Has Ops.CmpTst Q] {M : Ops.Machine ℝ} {I : Ops.Interp O Q ℝ} (hL : Ops.IsIndexLit M I)
  {B : ℕ} (hNat : Ops.IsExactNatLit id M B) (hCmp : Ops.IsCmp id I) {τ : Ops.Tape ℝ} {m : Ops.Mem ℝ}
  {a h e : ℕ} {r : ℕ × ℕ} {left right : ℝ} (hwords : ShiftedQR.SearchWords r a h e m.store)
  (hl : m.store.get r.1 (r.2 + 3) = some left) (hr : m.store.get r.1 (r.2 + 4) = some right)
  (hcap : r.2 + 3 ≤ m.store.len r.1) (hah : a + h ≤ B) (he : 2 * e ≤ B) :
  Ops.Writes Ops.Mode.total I τ ShiftedQR.findRitzDecision (Ops.Env.frame [a, h, e] [r, r])
    (Ops.Store.inBlock r.1 r.2 3)
    (fun m' ↦
      m'.pos = m.pos ∧
        ShiftedQR.SearchWords r (if right ≤ left then a else a + h) (h / 2) (2 * e) m'.store)
    m

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.RoundedFind.