NLA-lib Explorer

NLAlib.ShiftedQR.regularizeWith_pwrites_at

Library · theorem

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

Standard rounding

Regularize with a small-eigenvalue routine as a probabilistic block, with the word count nq apart from the words qs (NLAlib.ShiftedQR.RandomSmallEigContractAt): NLAlib.ShiftedQR.regularize_pwrites for NLAlib.ShiftedQR.regularizeWith; the merged statement is the case of the kernel, NLAlib.ShiftedQR.regularizeWith_pwrites the case nq = qs.length. Regularize as a probabilistic block ([BanksGarzaVargasSrivastava2022, Lemma 4.6], corrected: the constant of the dichotomy, Theorem 4.1, is \tfrac12 k^{-1/(2k)}, which the printed last display drops to (2k)^{-1/(2k)} without the factor 2; the proof's test is \psi_k(\mathbf{H}) \ge \varepsilon where the paper prints \le; and the precision of Optimal, Lemma 4.5, carries n + kn^{3/2} where the paper has 2n^2, which needs k \lesssim 2\sqrt{n}): on a scalar machine with the standard model, exact comparisons, index literals and exact natural literals up to n + 1, a measurable tape-local interpretation whose SmallEig is a randomized kernel with forward error \beta \ge 0 and failure probability \varphi_{\mathrm{se}} \ge 0 on a stream s₀ uniform on [0, 1], and an exact polar disk sampler on the same stream: let \mathbf{H} be upper Hessenberg of order n + 1, \mathbf{H}\mathbf{V} = \mathbf{V}\operatorname{diag}(\mathbf{e}) with \kappa(\mathbf{V}) \le B and B^{2/k} \le 2, 1 \le k \le n, \|\mathbf{H}\|_2 \le \Sigma, 0 < \omega \le \psi_k(\mathbf{H}), eigen\mathbf{v}alues separated \mathbf{b}y 2\omega^2/\Sigma, the radius word R > 0, 0 < \varphi \le 1, \eta = R\sqrt{\varphi/(2k)}, \theta = 1.01 \cdot 0.998^{-1/k}(2B^4)^{1/(2k)}, the word 0.999\theta^k and a threshold word t \ge (1 + \boldsymbol{u})^2\omega^2, and the precision conditions \beta + R + 2\boldsymbol{u}(\Sigma + \beta + R) \le \omega^2/(2020\Sigma), 4\boldsymbol{u}(\Sigma + \beta + R) \le \eta, those of Optimal (with C = 1.1), and those of the forward error of the rounded steps at the distance \eta/2 (NLAlib.IsStableQRChain.exists_norm_subdiag_le_of_le_norm_inv_pow). Then NLAlib.ShiftedQR.regularize writes only the matrix, the k output pairs, the flag and the log, and except with probability at most \varphi_{\mathrm{se}} + \varphi/2 ends in NLAlib.ShiftedQR.RegularizeOutcome: \theta-optimal shifts at distance at least \eta/2 from the spectrum with \mathbf{H} unchanged, or a decoupled perturbed unitary similarity with backward error 2.1\|\mathbf{H}\|_2((1 + \mathbf{x})^k - 1), \mathbf{x} = 300(n+1)^2\boldsymbol{u}. Shared by the trees of NLAlib.ShiftedQR.shqrSmallEigRoutine, on their scratch.

NLAlib.ShiftedQR.regularizeWith_pwrites_at {O Q : Type} [Ops.Has Ops.ScalarOp O]
  [Ops.Has Ops.IndexOp O] [Ops.Has ShiftedQR.DiskSampleOp O] [Ops.Has Ops.CmpTst Q]
  {M : Ops.Machine ℝ} {I : Ops.Interp O Q ℝ} {u : ℝ} (hI : I.IsMeasurable) {win : O → List ℕ → ℕ}
  (hloc : ∀ (o : O), I.TapeLocal o (win o)) (hS : Ops.IsScalar M I) (hM : Ops.StdModel u id M)
  (hu1 : u ≤ 1) (hL : Ops.IsIndexLit M I) {n : ℕ} (hNat : Ops.IsExactNatLit id M (n + 1))
  (hC : Ops.IsCmp id I) {law : ℕ → Measure ℝ} {s₀ : ℕ} {β φse : ℝ} (hβ0 : 0 ≤ β) (hφse : 0 ≤ φse)
  (hD : ShiftedQR.IsPolarDiskSampler s₀ I) (hU : law s₀ = ℙ.restrict (Set.Icc 0 1)) {k : ℕ}
  (hk0 : 0 < k) (hk : k ≤ n) {a rd c thr s f : ℕ × ℕ}
  (has :
    Ops.Fp.Disj (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))))
      (Ops.Store.inBlock s.1 s.2 (2 * k)))
  (haf :
    Ops.Fp.Disj (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1)))) (Ops.Store.inBlock f.1 f.2 1))
  (hsf : Ops.Fp.Disj (Ops.Store.inBlock s.1 s.2 (2 * k)) (Ops.Store.inBlock f.1 f.2 1))
  (hio :
    (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))) ⊔ Ops.Store.inBlock s.1 s.2 (2 * k) ⊔
          Ops.Store.inBlock f.1 f.2 1).Disj
      (Ops.Store.inBlock rd.1 rd.2 1 ⊔ Ops.Store.inBlock c.1 c.2 1 ⊔
        Ops.Store.inBlock thr.1 thr.2 1))
  {H V : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ} {e : Fin (n + 1) → ℂ} {B S ω R φ tv : ℝ}
  (hH : IsUpperHessenberg H) (hV : IsUnit V) (hHV : H * V = V * diagonal e)
  (hκ : pseudoConditionNumber V ≤ B) (hBk : B ^ (2 / ↑k) ≤ 2) (hω : 0 < ω)
  (hψ : ω ≤ hessenbergPotential k H) (hSH : specNorm H ≤ S)
  (hgap : ∀ (i j : Fin (n + 1)), i ≠ j → 2 * ω ^ 2 / S ≤ ‖e i - e j‖) (hR : 0 < R) (hφ : 0 < φ)
  (hφ1 : φ ≤ 1) (hβ : β + R + 2 * u * (S + β + R) ≤ ω ^ 2 / (20 * 101 * S))
  (hdη : 4 * u * (S + β + R) ≤ R * √(φ / (2 * ↑k))) (hnu : (↑n + 1) * u ≤ 1 / 2500)
  (huo :
    30000 * ↑k * (↑(n + 1) * √↑(n + 1) * u) * ((2 + 2 * 1.1) * S) ^ k ≤
      (1.01 * 0.998 ^ (-(↑k)⁻¹) * (2 * B ^ 4) ^ (2 * ↑k)⁻¹ * ω) ^ k)
  (huo1 : 100000 * ↑(n + 1 + k) ^ 2 * u ≤ 1)
  (hxu : 300 * (↑n + 1) ^ 2 * u ≤ (16 * B)⁻¹ * (R * √(φ / (2 * ↑k)) / 2 / ((2 + 2 * 1.1) * S)) ^ k)
  (hbound :
    (66 + 2 * 1.1) * B * S * ((2 + 2 * 1.1) * S / (R * √(φ / (2 * ↑k)) / 2)) ^ k * √(↑n + 1) *
        (300 * (↑n + 1) ^ 2 * u) ≤
      ω / 2)
  (hthrω : (1 + u) ^ 2 * ω ^ 2 ≤ tv) {nq T : ℕ} {qs : List ℝ} {SE : Ops.Stmt O Q}
  (hSE : ShiftedQR.RandomSmallEigContractAt law β φse k nq T S qs SE I) {qw : ℕ × ℕ}
  (hqw :
    (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))) ⊔ Ops.Store.inBlock s.1 s.2 (2 * k) ⊔
          Ops.Store.inBlock f.1 f.2 1).Disj
      (Ops.Store.inBlock qw.1 qw.2 qs.length))
  {ns w : ℕ} {lg : ℕ × ℕ} {LL : List (Option (List GivensEntry))} (hj : LL.length + k ≤ ns)
  (hw : k * n ≤ w) (hlgv : ∀ b ∈ [a, rd, c, thr, qw, s, f], b.1 ≠ lg.1) :
  Ops.PWrites law I (ShiftedQR.regularizeWith SE)
    (Ops.Env.frame [n + 1, k, nq, T, w, LL.length] [a, rd, c, thr, qw, a, s, f, lg])
    (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))) ⊔ Ops.Store.inBlock s.1 s.2 (2 * k) ⊔
        Ops.Store.inBlock f.1 f.2 1 ⊔
      Ops.Store.inBlock lg.1 lg.2 (ns * (1 + 5 * w)))
    (fun m ↦
      m.Live [a, rd, c, thr, qw, s, f] ∧
        HoldsMatrix a H m.store ∧
          m.store.readBlock qw.1 qw.2 qs.length = some qs ∧
            m.store.get rd.1 rd.2 = some R ∧
              m.store.get c.1 c.2 =
                  some (0.999 * (1.01 * 0.998 ^ (-(↑k)⁻¹) * (2 * B ^ 4) ^ (2 * ↑k)⁻¹) ^ k) ∧
                m.store.get thr.1 thr.2 = some tv ∧
                  s.2 + 2 * k ≤ m.store.len s.1 ∧
                    f.2 < m.store.len f.1 ∧ HoldsSlottedLog lg ns w LL [] m.store ∧ m.Live [lg])
    (ShiftedQR.RegularizeOutcome k H e u (1.01 * 0.998 ^ (-(↑k)⁻¹) * (2 * B ^ 4) ^ (2 * ↑k)⁻¹)
      (R * √(φ / (2 * ↑k)) / 2) tv ((1 + 1.1) * specNorm H * ((1 + 300 * (↑n + 1) ^ 2 * u) ^ k - 1))
      a s f lg ns w LL)
    (φse + φ / 2)

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.RoundedRegularize.