NLA-lib Explorer

NLAlib.ShiftedQR.shIteration_pwrites

Library · theorem

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

Standard rounding

One rounded iteration of the decoupling loop as a probabilistic block ([BanksGarzaVargasSrivastava2022, Lemma 6.4], one round, corrected: the dichotomy constant of Theorem 4.1 is \tfrac12 k^{-1/(2k)} for the printed (2k)^{-1/(2k)}, and the test in the proof of Lemma 4.6 is \psi_k \ge \varepsilon; the net of Exc, Lemma 5.3, has rounding at most 0.005\varepsilon\widetilde{R}, covers \mathbb{D}(r, (1 + \varepsilon)\widetilde{R}) and has at most 11 points near an eigenvalue, and its radius keeps the factor 2^{1/k} the paper omits (2.002^{1/k} for 1.001, so the shift bound is 4.1\|\mathbf{H}\|_2 for 3\|\mathbf{H}\|_2); Sh, Lemma 5.4, returns the computed step, assumes \|\mathbf{H}\|_2 \le \Sigma and k \ge 2, and reports with a flag that no shift was accepted; the precision of Optimal, Lemma 4.5, carries n + kn^{3/2} for the printed 2n^2): on a scalar machine with the standard model, exact comparisons, index literals, index conversion 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, B^{2/k} \le 2, 2 \le k = 2^m \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 words of Regularize (radius R > 0, 0.999\theta^k for \theta = 1.01 \cdot 0.998^{-1/k}(2B^4)^{1/(2k)}, the threshold t \ge (1 + \boldsymbol{u})^2 \omega^2) with 0 < \varphi_R \le 1, \eta = R\sqrt{\varphi_R/(2k)} and d = \eta/2, and the words of Sh ((1 - \gamma)^k, 2^{1/k}\theta\alpha B^{1/k}, \varepsilon/2, 1.0015(1 - \gamma), the net NLAlib.ShiftedQR.excNet ε) with \alpha = (1.01B)^{4m/2^m}, 0 < \gamma < 1, \varepsilon = (0.998(1 - \gamma)^2/((13B^4)^{1/k}\alpha^2\theta^2))^{k/(k-1)} \le 1/2, 0 < \varphi \le 1/5, 1.1 + 2.1 \cdot 2.002^{1/k}\theta\alpha B^{1/k} \le C, d \le \varepsilon \cdot 1.998^{1/k}\theta\alpha B^{1/k}\omega\sqrt{\varphi/(11(n + 1))}/4; and the precision conditions of Regularize and Sh, those of Sh that involve \psi_k(\mathbf{H}) asked at \omega (below) and at \Sigma (above). Then NLAlib.ShiftedQR.shIteration writes only the matrix and the flag and, except with probability at most \varphi_{\mathrm{se}} + \varphi_R/2 + \varphi, ends in NLAlib.ShiftedQR.ShIterationOutcome: an upper Hessenberg perturbed unitary similarity of \mathbf{H} with error (1 + C)\|\mathbf{H}\|_2((1 + \mathbf{x})^k - 1), \mathbf{x} = 300(n+1)^2\boldsymbol{u}, decoupled at the bottom or with \psi_k \le 1.002(1 - \gamma)\psi_k(\mathbf{H}). A fragment of the tree NLAlib.ShiftedQR.roundedDecoupleWith.

NLAlib.ShiftedQR.shIteration_pwrites {n : ℕ} {O Q : Type} [Ops.Has Ops.ScalarOp O]
  [Ops.Has Ops.IndexOp O] [Ops.Has ShiftedQR.DiskSampleOp O] [Ops.Has Ops.CmpTst Q]
  [Ops.Has Ops.IdxTst Q] [Ops.Has ShiftedQR.EigenvalueKernelOp O] {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) (hNat : Ops.IsExactNatLit id M (n + 1))
  (hC : Ops.IsCmp id I) (hQ : Ops.IsToNat id I) {law : ℕ → Measure ℝ} {s₀ : ℕ} {β φse : ℝ}
  (hSE : ShiftedQR.IsRandomSmallEig law s₀ β φse I) (hβ0 : 0 ≤ β) (hφse : 0 ≤ φse)
  (hD : ShiftedQR.IsPolarDiskSampler s₀ I) (hU : law s₀ = ℙ.restrict (Set.Icc 0 1)) {k q : ℕ}
  (hkq : k = 2 ^ q) (hk : 2 ≤ k) (hkn : k ≤ n) {ε : ℝ} {a rd c thr wg wr ww wp g f : ℕ × ℕ}
  (haf :
    Ops.Fp.Disj (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1)))) (Ops.Store.inBlock f.1 f.2 1))
  (hio :
    (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))) ⊔ 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 ⊔
                Ops.Store.inBlock wg.1 wg.2 1 ⊔
              Ops.Store.inBlock wr.1 wr.2 1 ⊔
            Ops.Store.inBlock ww.1 ww.2 1 ⊔
          Ops.Store.inBlock wp.1 wp.2 1 ⊔
        Ops.Store.inBlock g.1 g.2 (2 * (ShiftedQR.excNet ε).length)))
  {H V : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ} {e : Fin (n + 1) → ℂ} {B S ω R φR α γ φ C 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φR : 0 < φR)
  (hφR1 : φR ≤ 1) (hβ : β + R + 2 * u * (S + β + R) ≤ ω ^ 2 / (20 * 101 * S))
  (hdη : 4 * u * (S + β + R) ≤ 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)
  (hxuR :
    300 * (↑n + 1) ^ 2 * u ≤ (16 * B)⁻¹ * (R * √(φR / (2 * ↑k)) / 2 / ((2 + 2 * 1.1) * S)) ^ k)
  (hboundR :
    (66 + 2 * 1.1) * B * S * ((2 + 2 * 1.1) * S / (R * √(φR / (2 * ↑k)) / 2)) ^ k * √(↑n + 1) *
        (300 * (↑n + 1) ^ 2 * u) ≤
      ω / 2)
  (hα : α = (1.01 * B) ^ (4 * ↑q / 2 ^ q)) (hγ : 0 < γ) (hγ1 : γ < 1)
  (hε :
    ε =
      (0.998 * (1 - γ) * (1 - γ) /
          ((13 * B ^ 4) ^ (↑k)⁻¹ * α ^ 2 *
            (1.01 * 0.998 ^ (-(↑k)⁻¹) * (2 * B ^ 4) ^ (2 * ↑k)⁻¹) ^ 2)) ^
        (↑k / (↑k - 1)))
  (hε2 : ε ≤ 1 / 2) (hφ : 0 < φ) (hφ1 : φ ≤ 1 / 5)
  (hd :
    R * √(φR / (2 * ↑k)) / 2 ≤
      ε *
            (1.998 ^ (↑k)⁻¹ * (1.01 * 0.998 ^ (-(↑k)⁻¹) * (2 * B ^ 4) ^ (2 * ↑k)⁻¹) * α *
                B ^ (↑k)⁻¹ *
              ω) *
          √(φ / (11 * ↑(n + 1))) /
        4)
  (hC1 :
    1.1 +
        2.1 *
          (2.002 ^ (↑k)⁻¹ * (1.01 * 0.998 ^ (-(↑k)⁻¹) * (2 * B ^ 4) ^ (2 * ↑k)⁻¹) * α *
            B ^ (↑k)⁻¹) ≤
      C)
  (hxu : 300 * (↑n + 1) ^ 2 * u ≤ (8004 * B)⁻¹ * (R * √(φR / (2 * ↑k)) / 2 / ((2 + 2 * C) * S)) ^ k)
  (hbound :
    (66 + 2 * C) * B * S * ((2 + 2 * C) * S / (R * √(φR / (2 * ↑k)) / 2)) ^ k * √(↑n + 1) *
        (300 * (↑n + 1) ^ 2 * u) ≤
      1e-3 * ω)
  (hexc1 :
    6 * u *
        (1.1 * S +
          3 *
            (2.002 ^ (↑k)⁻¹ * (1.01 * 0.998 ^ (-(↑k)⁻¹) * (2 * B ^ 4) ^ (2 * ↑k)⁻¹) * α *
                B ^ (↑k)⁻¹ *
              S)) ≤
      5e-3 * ε *
        (1.998 ^ (↑k)⁻¹ * (1.01 * 0.998 ^ (-(↑k)⁻¹) * (2 * B ^ 4) ^ (2 * ↑k)⁻¹) * α * B ^ (↑k)⁻¹ *
          ω))
  (hexc2 :
    6 * u *
        (1.1 * S +
          3 *
            (2.002 ^ (↑k)⁻¹ * (1.01 * 0.998 ^ (-(↑k)⁻¹) * (2 * B ^ 4) ^ (2 * ↑k)⁻¹) * α *
                B ^ (↑k)⁻¹ *
              S)) ≤
      ε *
            (1.998 ^ (↑k)⁻¹ * (1.01 * 0.998 ^ (-(↑k)⁻¹) * (2 * B ^ 4) ^ (2 * ↑k)⁻¹) * α *
                B ^ (↑k)⁻¹ *
              ω) *
          √(φ / (11 * ↑(n + 1))) /
        8)
  (hthrω : (1 + u) ^ 2 * ω ^ 2 ≤ tv) {ns w : ℕ} {lg : ℕ × ℕ} {LL : List (Option (List GivensEntry))}
  (hj : LL.length + (k + 1 + (ShiftedQR.excNet ε).length) ≤ ns) (hw : k * n ≤ w)
  (hlgv : ∀ b ∈ [a, rd, c, thr, wg, wr, ww, wp, g, f], b.1 ≠ lg.1) :
  Ops.PWrites law I ShiftedQR.shIteration
    (Ops.Env.frame [n + 1, q, k, (ShiftedQR.excNet ε).length, w, LL.length]
      [a, rd, c, thr, wg, wr, ww, wp, g, a, f, lg])
    (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))) ⊔ 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, wg, wr, ww, wp, g, f] ∧
        HoldsMatrix a H m.store ∧
          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 ∧
                m.store.get wg.1 wg.2 = some ((1 - γ) ^ k) ∧
                  m.store.get wr.1 wr.2 =
                      some
                        (2 ^ (↑k)⁻¹ *
                          (1.01 * 0.998 ^ (-(↑k)⁻¹) * (2 * B ^ 4) ^ (2 * ↑k)⁻¹ * α * B ^ (↑k)⁻¹)) ∧
                    m.store.get ww.1 ww.2 = some (ε / 2) ∧
                      m.store.get wp.1 wp.2 = some (1.0015 * (1 - γ)) ∧
                        m.store.readBlock g.1 g.2 (2 * (ShiftedQR.excNet ε).length) =
                            some (List.flatMap (fun z ↦ [z.re, z.im]) (ShiftedQR.excNet ε)) ∧
                          f.2 < m.store.len f.1 ∧
                            HoldsSlottedLog lg ns w LL [] m.store ∧ m.Live [lg])
    (ShiftedQR.ShIterationOutcomeBy u k H γ tv
      ((1 + C) * specNorm H * ((1 + 300 * (↑n + 1) ^ 2 * u) ^ k - 1)) a lg ns w LL
      (k + 1 + (ShiftedQR.excNet ε).length))
    (φse + φR / 2 + φ)

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.RoundedIterationAt.