NLA-lib Explorer

NLAlib.SmallEig.distSpec_accuracy

Library · theorem

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

Standard rounding

DistSpec is within 10\% of the distance to the spectrum ([BanksGarzaVargasSrivastava2025, Proposition 3.1 and Observation 3.3]): on a scalar machine with the standard model at \boldsymbol{u}, exact comparisons and natural literals up to n exact (the planes of the scratch log of NLAlib.ShiftedQR.comptauHalf), let \mathbf{H} \ne 0 of order n + 1 be upper Hessenberg, \mathbf{H}\mathbf{V} = \mathbf{V}\operatorname{diag}(\mathbf{d}) with \|\mathbf{V}\|_2\|\mathbf{V}^{-1}\|_2 \le \kappa and every last-row weight at least p > 0, the shift s in \mathbb{D}(0, C\|\mathbf{H}\|_2) (C \ge 0) at distance at least \eta_1 > 0 from every d_i, m = 2^q at least NLAlib.SmallEig.distSpecDegree \kappa p, and (n + 1)\boldsymbol{u} \le 1/2500, 30000(m + 1)\boldsymbol{u} \le 1, 300(n + 1)^2\boldsymbol{u} \le (8004\kappa)^{-1}(\eta_1/((2 + 2C)\|\mathbf{H}\|_2))^m. Then from \mathbf{H} at h, the pair of s at s and room for the word tau, NLAlib.SmallEig.distSpec writes only that word, keeps the tape position, and stores \hat\tau with 0.9\,D \le \hat\tau \le 1.1\,D, D = \min_i\lvert s - d_i\rvert.

NLAlib.SmallEig.distSpec_accuracy {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)
  (hL : Ops.IsIndexLit M I) (hM : Ops.StdModel u id M) (hCmp : Ops.IsCmp id I) {nmax : ℕ}
  (hNat : Ops.IsExactNatLit id M nmax) {n m q : ℕ} (hn : n ≤ nmax)
  {H V : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ} {d : Fin (n + 1) → ℂ} {s : ℂ} {κ p C η₁ : ℝ}
  (hH : IsUpperHessenberg H) (hH0 : H ≠ 0) (hV : IsUnit V) (hHV : H * V = V * diagonal d)
  (hκ : pseudoConditionNumber V ≤ κ) (hp : 0 < p) (hw : ∀ (i : Fin (n + 1)), p ≤ lastRowWeights V i)
  (hC : 0 ≤ C) (hs : ‖s‖ ≤ C * specNorm H) (hη₁ : 0 < η₁)
  (hdist : ∀ (i : Fin (n + 1)), η₁ ≤ ‖d i - s‖) (hmq : m = 2 ^ q)
  (hm : SmallEig.distSpecDegree κ p ≤ m) (hnu : (↑n + 1) * u ≤ 1 / 2500)
  (hum : 30000 * (↑m + 1) * u ≤ 1)
  (hxu : 300 * (↑n + 1) ^ 2 * u ≤ (8004 * κ)⁻¹ * (η₁ / ((2 + 2 * C) * specNorm H)) ^ m)
  {τ : Ops.Tape ℝ} {μ : Ops.Mem ℝ} {h sp tau : ℕ × ℕ} (hl : μ.Live [h, sp, tau])
  (hHs : HoldsMatrix h H μ.store) (hsp : μ.store.readBlock sp.1 sp.2 2 = some [s.re, s.im])
  (htau : tau.2 < μ.store.len tau.1) (hth : tau.1 ≠ h.1) (hts : tau.1 ≠ sp.1) :
  Ops.Writes Ops.Mode.total I τ SmallEig.distSpec (Ops.Env.frame [n + 1, m, q] [h, sp, tau])
    (Ops.Store.inBlock tau.1 tau.2 1)
    (fun μ' ↦
      μ'.pos = μ.pos ∧
        ∃ t,
          μ'.store.get tau.1 tau.2 = some t ∧ 0.9 * ⨅ i, ‖s - d i‖ ≤ t ∧ t ≤ 1.1 * ⨅ i, ‖s - d i‖)
    μ

Full source on GitHub

Import NLAlib.Eigensolvers.SmallEig.DistSpec.