NLA-lib Explorer

NLAlib.ShiftedQR.solveRoundedWith_terminates

Library · theorem

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

Standard rounding

The rounded worklist in Schur mode terminates, and its accumulator stays near a unitary on every tape: on a scalar machine with the standard model, natural literals up to n + 1 exact, exact toNat and comparisons, let the decoupling routine terminate with a closed log (NLAlib.ShiftedQR.TerminatingDecouplerRoutine) and the leaf routine terminate with an accumulator within \varepsilon_L of a unitary on orders at most \min(k, n + 1) (NLAlib.ShiftedQR.TerminatingLeafRoutine). Then for any matrix \mathbf{H} and accumulator \mathbf{U}, any threshold word and on every tape, solveRoundedWith D L runs to completion, writes only the matrix, the accumulator and the failure word, and the stored accumulator is within ((1 + 24\boldsymbol{u})^{2(n+1)(n_s w + 2k(k+2))}(1 + \varepsilon_L)^{n+1} - 1) \|\mathbf{U}\|_2 of \mathbf{U}\mathbf{V} for an e\mathbf{x}act unitary \mathbf{V}, whatever the shifts (each replayed rotation and each leaf product is a near-unitary update).

NLAlib.ShiftedQR.solveRoundedWith_terminates {O Q : Type} [Ops.Has Ops.ScalarOp O]
  [Ops.Has Ops.IndexOp O] [Ops.Has Ops.CmpTst Q] [Ops.Has Ops.IdxTst Q] {Mch : Ops.Machine ℝ}
  {I : Ops.Interp O Q ℝ} {u : ℝ} {n : ℕ} (hS : Ops.IsScalar Mch I) (hM : Ops.StdModel u id Mch)
  (hu1 : u ≤ 1 / 100) (hL : Ops.IsIndexLit Mch I) (hNat : Ops.IsExactNatLit id Mch (n + 1))
  (hQ : Ops.IsToNat id I) (hC : Ops.IsCmp id I) {k F T ns w : ℕ} {ps : List ℝ} {εL : ℝ}
  (hεL : 0 ≤ εL) (D : Ops.Stmt O Q) (hD : ShiftedQR.TerminatingDecouplerRoutine n k F T ps ns w D I)
  (L : Ops.Stmt O Q) (hLeaf : ShiftedQR.TerminatingLeafRoutine εL (min k (n + 1)) ps T L I)
  {tape : Ops.Tape ℝ} {μ : Ops.Mem ℝ} {a t p uo f : ℕ × ℕ}
  {H U : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ} {thr : ℝ} (hl : μ.Live [a, t, p, uo, f])
  (hr : μ.Room [a, t, p, uo, f] [2 * ((n + 1) * (n + 1)), 1, ps.length, 2 * ((n + 1) * (n + 1)), 1])
  (ha : ShiftedQR.ShQRViewsApart (n + 1) ps.length a t p uo f) (hA : HoldsMatrix a H μ.store)
  (hU : HoldsMatrix uo U μ.store) (ht : μ.store.get t.1 t.2 = some thr)
  (hp : μ.store.readBlock p.1 p.2 ps.length = some ps) :
  Ops.Writes Ops.Mode.total I tape (ShiftedQR.solveRoundedWith D L)
    (Ops.Env.frame [n + 1, k, ps.length, F, T, ns, w] [a, t, p, uo, a, uo, f])
    (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))) ⊔
        Ops.Store.inBlock uo.1 uo.2 (2 * ((n + 1) * (n + 1))) ⊔
      Ops.Store.inBlock f.1 f.2 1)
    (fun μ' ↦
      ∃ U' Tm V,
        HoldsMatrix a Tm μ'.store ∧
          HoldsMatrix uo U' μ'.store ∧
            HasOrthonormalCols V ∧
              specNorm (U' - U * V) ≤
                ((1 + 24 * u) ^ (2 * (n + 1) * (ns * w + 2 * k * (k + 2))) * (1 + εL) ^ (n + 1) -
                    1) *
                  specNorm U)
    μ

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.RoundedSolveCompletion.