NLA-lib Explorer

NLAlib.ShiftedQR.stepComptau_writes

Library · theorem

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

Standard rounding

comptau of a degree k rounded step is within 0.001 ([BanksGarzaVargasSrivastava2022, Lemmas 3.6 and 3.9]; the precision condition below, with 8004\kappa, comes from the last diagonal entry of the triangular factor of p(\mathbf{H}), \|\mathbf{e}_n^{\mathsf{T}}p(\mathbf{H})^{-1}\|^{-1}, without Lemma 3.7; the paper's route needs \kappa^2 and 24000): on a scalar machine with the standard model and exact comparisons, let \mathbf{H} \ne 0 of order n + 1 be upper Hessenberg, \mathbf{H}\mathbf{V} = \mathbf{V}\operatorname{diag}(\mathbf{e}) with \kappa(\mathbf{V}) \le \kappa, the k shifts s_1, \dots, s_k in \mathbb{D}(0, C\|\mathbf{H}\|_2) (C \ge 0) at distance at least d > 0 from every e_i, (n + 1)\boldsymbol{u} \le 1/2500, 30000(k + 1)\boldsymbol{u} \le 1 and \mathbf{x} = 300(n + 1)^2\boldsymbol{u} \le (8004\kappa)^{-1}(d/((2 + 2C)\|\mathbf{H}\|_2))^k. Then stepComptau (the chain of NLAlib.ShiftedQR.multiStepStable, then NLAlib.ShiftedQR.comptau) fills the pending slot j of the log with kn entries, stores in place the rounded step's output \widehat{\mathbf{H}}' (upper Hessenberg, the end of a stable chain from \mathbf{H} with the shifts s_1, \dots, s_k by the exact unitary of the entries), and in P a t with \lvert t - \tau\rvert \le 0.001\,\tau, \tau = \|\mathbf{e}_n^{\mathsf{T}}p(\mathbf{H})^{-1}\|_2^{-1}. It writes only the matrix, P and the log; matrix, shifts, P and the log are disjoint views.

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

NLAlib.ShiftedQR.stepComptau_writes {O Q : Type} [Ops.Has Ops.ScalarOp O] [Ops.Has Ops.IndexOp O]
  [Ops.Has Ops.CmpTst Q] {M : Ops.Machine ℝ} {I : Ops.Interp O Q ℝ} {u : ℝ} (hS : Ops.IsScalar M I)
  (hM : Ops.StdModel u id M) (hCmp : Ops.IsCmp id I) (hL : Ops.IsIndexLit M I) {nmax : ℕ}
  (hNat : Ops.IsExactNatLit id M nmax) {τ : Ops.Tape ℝ} {m : Ops.Mem ℝ} {n : ℕ} {C κ d : ℝ}
  {H V : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ} {ev : Fin (n + 1) → ℂ} {ss : List ℂ}
  {a s p lg : ℕ × ℕ} (hH : IsUpperHessenberg H) (hH0 : H ≠ 0) (hV : IsUnit V)
  (hHV : H * V = V * diagonal ev) (hκ : pseudoConditionNumber V ≤ κ) (hC : 0 ≤ C) (hd : 0 < d)
  (hs : ∀ s ∈ ss, ‖s‖ ≤ C * specNorm H) (hdist : ∀ s ∈ ss, ∀ (i : Fin (n + 1)), d ≤ ‖ev i - s‖)
  (hnu : (↑n + 1) * u ≤ 1 / 2500) (hu : 30000 * (↑ss.length + 1) * u ≤ 1)
  (hxu : 300 * (↑n + 1) ^ 2 * u ≤ (8004 * κ)⁻¹ * (d / ((2 + 2 * C) * specNorm H)) ^ ss.length)
  (hn : n ≤ nmax) {ns w : ℕ} {L : List (Option (List GivensEntry))}
  (hlog : HoldsSlottedLog lg ns w L [] m.store) (hj : L.length < ns) (hw : ss.length * n ≤ w)
  (hl : m.Live [a, s, p, lg]) (hA : HoldsMatrix a H m.store)
  (hss : m.store.readBlock s.1 s.2 (2 * ss.length) = some (List.flatMap (fun z ↦ [z.re, z.im]) ss))
  (hp : p.2 < m.store.len p.1)
  (has :
    Ops.Fp.Disj (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))))
      (Ops.Store.inBlock s.1 s.2 (2 * ss.length)))
  (hap :
    Ops.Fp.Disj (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1)))) (Ops.Store.inBlock p.1 p.2 1))
  (hlgd :
    Ops.Fp.Disj (Ops.Store.inBlock lg.1 lg.2 (ns * (1 + 5 * w)))
      (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 p.1 p.2 1)) :
  Ops.Writes Ops.Mode.total I τ ShiftedQR.stepComptau
    (Ops.Env.frame [n + 1, ss.length, w, L.length] [a, s, a, p, lg])
    (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))) ⊔ Ops.Store.inBlock p.1 p.2 1 ⊔
      Ops.Store.inBlock lg.1 lg.2 (ns * (1 + 5 * w)))
    (fun m' ↦
      m'.pos = m.pos ∧
        ∃ es,
          es.length = ss.length * n ∧
            (∀ e ∈ es, e.1 + 1 < n + 1) ∧
              HoldsSlottedLog lg ns w L es m'.store ∧
                ∃ H' Rs,
                  IsStableQRChainBy (300 * (↑n + 1) ^ 2 * u) H ss H' Rs (givensLog (n + 1) es) ∧
                    IsUpperHessenberg H' ∧
                      HoldsMatrix a H' m'.store ∧
                        ∃ t,
                          m'.store.get p.1 p.2 = some t ∧
                            |t -
                                  ‖WithLp.toLp 2
                                        (((Polynomial.aeval H) (shiftPoly ss))⁻¹ (Fin.last n))‖⁻¹| ≤
                              1e-3 *
                                ‖WithLp.toLp 2
                                      (((Polynomial.aeval H) (shiftPoly ss))⁻¹ (Fin.last n))‖⁻¹)
    m

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.RoundedFind.