NLA-lib Explorer

NLAlib.ShiftedQR.solveRoundedWith_pwrites

Library · theorem

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

Standard rounding

The rounded worklist in Schur mode as a probabilistic block ([BanksGarzaVargasSrivastava2022, Theorem 6.3] with the Schur form): on a scalar machine with the standard model at 0 \le \boldsymbol{u} \le 1/100, exact natural literals up to n + 1, exact toNat and comparisons, and a measurable tape-local interpretation, let the decoupler meet NLAlib.ShiftedQR.RandomDecouplingRoutineContract on the class (2B, g/2) with error \varepsilon(N_0), and the leaf meet the Schur leaf contract (NLAlib.Schur.RandomSchurLeafContract) with errors (\varepsilon_L, \beta) on orders at most \min(k, n + 1). From an upper Hessenberg \mathbf{H}, diagonalizable with condition at most B and eigenvalues separated by g > 0, and an accumulator \mathbf{U}, with the threshold word t, (1 + \boldsymbol{u})^2\omega^2 \le t \le (1 - \boldsymbol{u})^2c^2, c, \beta, \varepsilon(N_0), \varepsilon_L, N_0 \ge 0 and the round error e = c + \varepsilon(N_0) + \beta + 2\varepsilon_L N_0 + \rho + \rho_L with the replay and product errors \rho = 78\boldsymbol{u}\,n_s w N_0 and \rho_L = 8(n + 1)(k + 2)\boldsymbol{u}N_0, \|\mathbf{H}\|_2 + 2(n + 1)e \le N_0 and 2(n + 1)e \le g/(16(n + 1)B), except with probability at most 2(n + 1)(\varphi_D + \varphi_L) the flag is 0, the stored matrix \widehat{\mathbf{T}} is upper triangular and (\widehat{\mathbf{U}}, \widehat{\mathbf{T}}) is tracked from (\mathbf{U}, \mathbf{H}) (NLAlib.IsTrackedUnitarySimilar) with the backward error 2(n + 1)e and the relative accumulator error (1 + 24\boldsymbol{u})^{2(n+1)(n_s w + 2k(k+2))}(1 + \varepsilon_L)^{n+1} - 1.

Shared by the trees of NLAlib.ShiftedQR.shqrSmallEigRoutine and NLAlib.SmallEig.smallEigRoutine, on their scratch.

NLAlib.ShiftedQR.solveRoundedWith_pwrites {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)
  (hu : 0 ≤ u) (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)
  (hI : I.IsMeasurable) {win : O → List ℕ → ℕ} (hloc : ∀ (o : O), I.TapeLocal o (win o))
  {law : ℕ → Measure ℝ} {B g φD εL β φL : ℝ} {k F T ns w : ℕ} {ps : List ℝ} {ω : ℝ} {ε : ℝ → ℝ}
  (D : Ops.Stmt O Q) {N₀ : ℝ}
  (hD : ShiftedQR.RandomDecouplingRoutineContract law (2 * B) (g / 2) φD k F T n N₀ ps ns w ω ε D I)
  (L : Ops.Stmt O Q) (hLeaf : Schur.RandomSchurLeafContract law εL β φL (min k (n + 1)) N₀ ps T L I)
  (hφD : 0 ≤ φD) (hφL : 0 ≤ φL) (hεL : 0 ≤ εL) {a t p uo f : ℕ × ℕ}
  {H U V : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ} {d : Fin (n + 1) → ℂ} {thr c : ℝ}
  (hHess : IsUpperHessenberg H) (hV : IsUnit V) (hHV : H * V = V * diagonal d)
  (hκ : pseudoConditionNumber V ≤ B) (hg : 0 < g)
  (hgap : ∀ (i j : Fin (n + 1)), i ≠ j → g ≤ ‖d i - d j‖) (hfind : (1 + u) ^ 2 * ω ^ 2 ≤ thr)
  (hcut : thr ≤ (1 - u) ^ 2 * c ^ 2) (hc : 0 ≤ c) (hβ : 0 ≤ β) (hε0 : 0 ≤ ε N₀) (hN0 : 0 ≤ N₀)
  (hN₀ :
    specNorm H +
        2 * (↑n + 1) *
          (c + ε N₀ + β + 2 * εL * N₀ + 78 * u * (↑ns * ↑w) * N₀ +
            8 * (↑n + 1) * (↑k + 2) * u * N₀) ≤
      N₀)
  (hsmall :
    2 * (↑n + 1) *
        (c + ε N₀ + β + 2 * εL * N₀ + 78 * u * (↑ns * ↑w) * N₀ + 8 * (↑n + 1) * (↑k + 2) * u * N₀) ≤
      g / (16 * (↑n + 1) * B)) :
  Ops.PWrites law I (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 μ ↦
      μ.Live [a, t, p, uo, f] ∧
        μ.Room [a, t, p, uo, f]
            [2 * ((n + 1) * (n + 1)), 1, ps.length, 2 * ((n + 1) * (n + 1)), 1] ∧
          ShiftedQR.ShQRViewsApart (n + 1) ps.length a t p uo f ∧
            HoldsMatrix a H μ.store ∧
              HoldsMatrix uo U μ.store ∧
                μ.store.get t.1 t.2 = some thr ∧ μ.store.readBlock p.1 p.2 ps.length = some ps)
    (fun μ' ↦
      μ'.store.get f.1 f.2 = some 0 ∧
        ∃ U' Tm,
          HoldsMatrix a Tm μ'.store ∧
            HoldsMatrix uo U' μ'.store ∧
              Tm.IsUpperTriangular ∧
                IsTrackedUnitarySimilar
                  ((1 + 24 * u) ^ (2 * (n + 1) * (ns * w + 2 * k * (k + 2))) * (1 + εL) ^ (n + 1) -
                    1)
                  (2 * (↑n + 1) *
                    (c + ε N₀ + β + 2 * εL * N₀ + 78 * u * (↑ns * ↑w) * N₀ +
                      8 * (↑n + 1) * (↑k + 2) * u * N₀))
                  U H U' Tm)
    (2 * (↑n + 1) * (φD + φL))

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.RoundedWorklistSchur.