NLA-lib Explorer

NLAlib.ShiftedQR.shTrials_writes

Library · theorem

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

Standard rounding

The trials of Sh on a scalar machine with the standard model at (n + 1)\boldsymbol{u} \le 1/2500 and 20000k\boldsymbol{u} \le 1, exact comparisons, index literals and exact natural literals up to n + 1, for k = 2^q \le n: from an upper Hessenberg \mathbf{H} at A, n_0 shifts z_j stored as pairs at S, the threshold words t at Thr and p_t at Pt, the search word 1 at G, and a shift z_{j_0} every backward-stable degree k step of which has a bottom subdiagonal entry of modulus below \omega, (1 + \boldsymbol{u})^2\omega^2 \le t, or passes the potential test against p_t, NLAlib.ShiftedQR.shTrials sets the flag to 1 and stores at A an accepted (NLAlib.ShiftedQR.ShAccepted) backward-stable degree k step with some shift z_j repeated, upper Hessenberg. Shared by the trees of NLAlib.ShiftedQR.shqrSmallEigRoutine, on their scratch.

NLAlib.ShiftedQR.shTrials_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) (hu1 : u ≤ 1) (hL : Ops.IsIndexLit M I) {n : ℕ}
  (hNat : Ops.IsExactNatLit id M (n + 1)) (hC : Ops.IsCmp id I) {τ : Ops.Tape ℝ} {m : Ops.Mem ℝ}
  {k q n0 : ℕ} (hk0 : 0 < k) (hk : k ≤ n) (hkq : k = 2 ^ q) (hu : 20000 * ↑k * u ≤ 1)
  {a s thr pt t sr ds rg p2 g f : ℕ × ℕ} {H : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ}
  {zs : Fin n0 → ℂ} {tv pv fv ω : ℝ} (hH : IsUpperHessenberg H) (hnu : (↑n + 1) * u ≤ 1 / 2500)
  (hA : HoldsMatrix a H m.store)
  (hs : ∀ (j : Fin n0), m.store.readBlock s.1 (s.2 + 2 * ↑j) 2 = some [(zs j).re, (zs j).im])
  (hthr : m.store.get thr.1 thr.2 = some tv) (hpt : m.store.get pt.1 pt.2 = some pv)
  (hg : m.store.get g.1 g.2 = some 1) (hf : m.store.get f.1 f.2 = some fv)
  (hrt : t.2 + 2 * ((n + 1) * (n + 1)) ≤ m.store.len t.1) (hrsr : sr.2 + 2 * k ≤ m.store.len sr.1)
  (hrds : ds.2 + 2 * k ≤ m.store.len ds.1) (hrrg : rg.2 + 5 ≤ m.store.len rg.1)
  (hrp : p2.2 < m.store.len p2.1)
  (hW :
    (Ops.Store.inBlock t.1 t.2 (2 * ((n + 1) * (n + 1))) ⊔ Ops.Store.inBlock sr.1 sr.2 (2 * k) ⊔
            Ops.Store.inBlock ds.1 ds.2 (2 * k) ⊔
          Ops.Store.inBlock rg.1 rg.2 5).Disj
      (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))) ⊔ Ops.Store.inBlock s.1 s.2 (2 * n0) ⊔
        Ops.Store.inBlock thr.1 thr.2 1))
  (hts :
    Ops.Fp.Disj (Ops.Store.inBlock t.1 t.2 (2 * ((n + 1) * (n + 1))))
      (Ops.Store.inBlock sr.1 sr.2 (2 * k)))
  (htd :
    Ops.Fp.Disj (Ops.Store.inBlock t.1 t.2 (2 * ((n + 1) * (n + 1))))
      (Ops.Store.inBlock ds.1 ds.2 (2 * k)))
  (hsd : Ops.Fp.Disj (Ops.Store.inBlock sr.1 sr.2 (2 * k)) (Ops.Store.inBlock ds.1 ds.2 (2 * k)))
  (hrg :
    Ops.Fp.Disj (Ops.Store.inBlock rg.1 rg.2 5)
      (Ops.Store.inBlock t.1 t.2 (2 * ((n + 1) * (n + 1)))))
  (hGF :
    (Ops.Store.inBlock g.1 g.2 1 ⊔ Ops.Store.inBlock f.1 f.2 1).Disj
      (Ops.Store.inBlock t.1 t.2 (2 * ((n + 1) * (n + 1))) ⊔ Ops.Store.inBlock sr.1 sr.2 (2 * k) ⊔
            Ops.Store.inBlock ds.1 ds.2 (2 * k) ⊔
          Ops.Store.inBlock rg.1 rg.2 5 ⊔
        Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1)))))
  (hgf : Ops.Fp.Disj (Ops.Store.inBlock g.1 g.2 1) (Ops.Store.inBlock f.1 f.2 1))
  (hAS :
    (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))) ⊔ Ops.Store.inBlock g.1 g.2 1 ⊔
          Ops.Store.inBlock f.1 f.2 1).Disj
      (Ops.Store.inBlock s.1 s.2 (2 * n0) ⊔ Ops.Store.inBlock thr.1 thr.2 1))
  (hPt :
    Ops.Fp.Disj (Ops.Store.inBlock pt.1 pt.2 1)
      (Ops.Store.inBlock t.1 t.2 (2 * ((n + 1) * (n + 1))) ⊔ Ops.Store.inBlock sr.1 sr.2 (2 * k) ⊔
                Ops.Store.inBlock ds.1 ds.2 (2 * k) ⊔
              Ops.Store.inBlock rg.1 rg.2 5 ⊔
            Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))) ⊔
          Ops.Store.inBlock g.1 g.2 1 ⊔
        Ops.Store.inBlock f.1 f.2 1))
  (hP2 :
    Ops.Fp.Disj (Ops.Store.inBlock p2.1 p2.2 1)
      (Ops.Store.inBlock t.1 t.2 (2 * ((n + 1) * (n + 1))) ⊔ Ops.Store.inBlock pt.1 pt.2 1 ⊔
                Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))) ⊔
              Ops.Store.inBlock g.1 g.2 1 ⊔
            Ops.Store.inBlock f.1 f.2 1 ⊔
          Ops.Store.inBlock s.1 s.2 (2 * n0) ⊔
        Ops.Store.inBlock thr.1 thr.2 1))
  (jstar : Fin n0)
  (hgood :
    ∀ (H' : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ)
      (Rs : List (Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ)),
      IsStableQRChain (300 * (↑n + 1) ^ 2 * u) H (List.replicate k (zs jstar)) H' Rs →
        (∃ i, n ≤ ↑i + k ∧ ‖H' i.succ i.castSucc‖ < ω) ∨
          ∀ (p : ℝ), |p - hessenbergPotential k H'| ≤ 20 * u * hessenbergPotential k H' → p < pv)
  (hthrω : (1 + u) ^ 2 * ω ^ 2 ≤ tv) {ns w : ℕ} {lg : ℕ × ℕ} {LL : List (Option (List GivensEntry))}
  (hlog : HoldsSlottedLog lg ns w LL [] m.store) (hj : LL.length + n0 ≤ ns) (hw : k * n ≤ w)
  (hlgl : m.Live [lg]) (hlgb : ∀ b ∈ [a, s, thr, pt, t, sr, ds, rg, p2, g, f], b.1 ≠ lg.1) :
  Ops.Writes Ops.Mode.total I τ ShiftedQR.shTrials
    (Ops.Env.frame [n + 1, k, q, n0, w, LL.length] [a, s, thr, pt, t, sr, ds, rg, p2, a, g, f, lg])
    (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))) ⊔ Ops.Store.inBlock g.1 g.2 1 ⊔
          Ops.Store.inBlock f.1 f.2 1 ⊔
        (Ops.Store.inBlock t.1 t.2 (2 * ((n + 1) * (n + 1))) ⊔ Ops.Store.inBlock sr.1 sr.2 (2 * k) ⊔
              Ops.Store.inBlock ds.1 ds.2 (2 * k) ⊔
            Ops.Store.inBlock rg.1 rg.2 5 ⊔
          Ops.Store.inBlock p2.1 p2.2 1) ⊔
      Ops.Store.inBlock lg.1 lg.2 (ns * (1 + 5 * w)))
    (fun m' ↦
      m'.store.get f.1 f.2 = some 1 ∧
        ∃ j Ls es,
          Ls.length = n0 ∧
            (∀ x ∈ slotEntries w Ls, x.1 + 1 < n + 1) ∧
              HoldsSlottedLog lg ns w (LL ++ Ls) [] m'.store ∧
                slotEntries w Ls = padEntries w es ∧
                  ∃ H' Rs,
                    IsStableQRChainBy (300 * (↑n + 1) ^ 2 * u) H (List.replicate k (zs j)) H' Rs
                        (givensLog (n + 1) es) ∧
                      IsUpperHessenberg H' ∧
                        HoldsMatrix a H' m'.store ∧ ShiftedQR.ShAccepted u k tv pv H')
    m

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.RoundedShTrial.