NLA-lib Explorer

NLAlib.ShiftedQR.trialStep_writes

Library · theorem

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

Standard rounding

The computation of one trial on a scalar machine with the standard model at (n + 1)\boldsymbol{u} \le 1/2500, exact comparisons, index literals and exact natural literals up to n + 1: from an upper Hessenberg \mathbf{H} of order n + 1 at A, the shift r at S and the threshold word t at Thr, NLAlib.ShiftedQR.trialStep writes only its four outputs and its rotations in the pending slot of the log, and stores at T a backward-stable degree k step by the exact unitary of the entries, \widehat{\mathbf{H}} with the shift r repeated (relative error 300(n+1)^2\boldsymbol{u}), upper Hessenberg, and in Rg the scan of its bottom k subdiagonal entries (NLAlib.ShiftedQR.bottomScan_writes). Shared by the trees of NLAlib.ShiftedQR.shqrSmallEigRoutine, on their scratch.

NLAlib.ShiftedQR.trialStep_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 : ℕ} (hk0 : 0 < k) (hk : k ≤ n) {a sp thr t sr ds rg : ℕ × ℕ}
  {H : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ} {r : ℂ} {tv : ℝ} (hH : IsUpperHessenberg H)
  (hnu : (↑n + 1) * u ≤ 1 / 2500) (hA : HoldsMatrix a H m.store)
  (hs : m.store.readBlock sp.1 sp.2 2 = some [r.re, r.im])
  (hthr : m.store.get thr.1 thr.2 = some tv) (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)
  (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 sp.1 sp.2 2 ⊔
        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)))))
  {ns w : ℕ} {lg : ℕ × ℕ} {L : List (Option (List GivensEntry))}
  (hlog : HoldsSlottedLog lg ns w L [] m.store) (hj : L.length < ns) (hw : k * n ≤ w)
  (hlgl : m.Live [lg]) (hlgb : ∀ b ∈ [a, sp, thr, t, sr, ds, rg], b.1 ≠ lg.1) :
  Ops.Writes Ops.Mode.total I τ ShiftedQR.trialStep
    (Ops.Env.frame [n + 1, k, w, L.length] [a, sp, thr, t, sr, ds, rg, lg])
    (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 lg.1 lg.2 (ns * (1 + 5 * w)))
    (fun m' ↦
      ∃ es,
        es.length = k * 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 (List.replicate k r) H' Rs
                    (givensLog (n + 1) es) ∧
                  IsUpperHessenberg H' ∧
                    HoldsMatrix t H' m'.store ∧
                      ((m'.store.get rg.1 (rg.2 + 3) = some 1 ∧
                          ∃ i, n ≤ ↑i + k ∧ (1 - u) ^ 2 * ‖H' i.succ i.castSucc‖ ^ 2 ≤ tv) ∨
                        m'.store.get rg.1 (rg.2 + 3) = some 0 ∧
                          ∀ (i : Fin n),
                            n ≤ ↑i + k → tv < (1 + u) ^ 2 * ‖H' i.succ i.castSucc‖ ^ 2))
    m

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.RoundedRegularizeTrial.