NLA-lib Explorer

NLAlib.ShiftedQR.shDecide_terminates

Library · theorem

This statement changed in the recorded rename: 2026-11-schur.

The decision of Sh terminates on any matrix: with the views and the context of Sh, a stored pair at Z, stored words at Rt, P0, P1, a stored step at T and the pending entries P (planes below n) of slot LL.length of a log with room for 1 + n_0 slots, apart from the views and the scratch, 1 \le k \le n, NLAlib.ShiftedQR.shDecide (accept the computed step, or the exceptional branch) leaves the matrix and the flag stored and closes 1 + n_0 slots.

NLAlib.ShiftedQR.shDecide_terminates {O Q : Type} [Ops.Has Ops.ScalarOp O] [Ops.Has Ops.IndexOp O]
  [Ops.Has ShiftedQR.DiskSampleOp O] [Ops.Has Ops.CmpTst Q] {n : ℕ} {M : Ops.Machine ℝ}
  {I : Ops.Interp O Q ℝ} (hS : Ops.IsScalar M I) (hL : Ops.IsIndexLit M I)
  (hNat : Ops.IsExactNatLit id M (n + 1)) (hC : Ops.IsCmp id I) {s₀ : ℕ}
  (hD : ShiftedQR.IsPolarDiskSampler s₀ I) {τ : Ops.Tape ℝ} {m : Ops.Mem ℝ} {L k q : ℕ}
  (hk0 : 0 < k) (hkn : k ≤ n) {ε : ℝ} {a s wg wr ww wp g thr f : ℕ × ℕ}
  (hv : ShiftedQR.ShViews L n k ε a s wg wr ww wp g thr f)
  {H H' : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ} {ss : List ℂ} {cg cr cw cp tv : ℝ}
  (hctx : ShiftedQR.ShCtx L k ε H ss cg cr cw cp tv a s wg wr ww wp g thr f m) {z : ℂ} {p p0 p1 : ℝ}
  (hZ : m.store.readBlock L 0 2 = some [z.re, z.im]) (hRt : m.store.get (L + 1) 0 = some p)
  (hP0 : m.store.get (L + 3) 0 = some p0) (hP1 : m.store.get (L + 4) 0 = some p1)
  (hT : HoldsMatrix (L + 5, 0) H' m.store) {ns w : ℕ} {lg : ℕ × ℕ}
  {LL : List (Option (List GivensEntry))} {P : List GivensEntry}
  (hlog : HoldsSlottedLog lg ns w LL P m.store) (hP : ∀ x ∈ P, x.1 + 1 < n + 1)
  (hj : LL.length + (1 + (ShiftedQR.excNet ε).length) ≤ ns) (hw : k * n ≤ w) (hlgl : m.Live [lg])
  (hlgL : lg.1 < L) (hlgv : ∀ b ∈ [a, s, wg, wr, ww, wp, g, thr, f], b.1 ≠ lg.1) :
  Ops.Writes Ops.Mode.total I τ ShiftedQR.shDecide
    (Ops.Env.frame [n + 1, k, q, (ShiftedQR.excNet ε).length, w, LL.length]
      [a, (L, 0), wr, ww, wp, g, thr, (L + 1, 0), (L + 2, 0), (L + 3, 0), (L + 4, 0), (L + 5, 0),
        (L + 6, 0), (L + 7, 0), (L + 8, 0), (L + 9, 0), (L + 10, 0), a, (L + 11, 0), f, lg])
    (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))) ⊔ Ops.Store.inBlock f.1 f.2 1 ⊔
        Ops.Fp.above L ⊔
      Ops.Store.inBlock lg.1 lg.2 (ns * (1 + 5 * w)))
    (fun m' ↦
      (∃ H', HoldsMatrix a H' m'.store) ∧
        ∃ x,
          m'.store.get f.1 f.2 = some x ∧
            ∃ Ls,
              Ls.length = 1 + (ShiftedQR.excNet ε).length ∧
                (∀ x ∈ slotEntries w Ls, x.1 + 1 < n + 1) ∧
                  HoldsSlottedLog lg ns w (LL ++ Ls) [] m'.store)
    m

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.RoundedShTermination.