NLA-lib Explorer

NLAlib.ShiftedQR.multiStepStable_isStableQRChainBy

Library · theorem

Standard rounding

The degree k rounded step is a stable chain by its recorded unitary (the setting of [BanksGarzaVargasSrivastava2022, Lemma 3.6]): on a machine with the standard model at \boldsymbol{u} \ge 0 with (n+1)\boldsymbol{u} \le 1/2500, from an upper Hessenberg \mathbf{H} of order n + 1 and the shifts s_1, \dots, s_k stored as 2k words, the program multiStepStable appends kn entries (planes below n) to the pending slot j of the log (empty before, P = []), stores in place an \widehat{\mathbf{H}}', and in Ds the last diagonal entries of triangular factors \widehat{\mathbf{R}}_1, \dots, \widehat{\mathbf{R}}_k, such that the steps form a backward-stable chain with relative error \mathbf{x} = 300(n+1)^2\boldsymbol{u} by the exact unitary givensLog (n + 1) es of the entries. The matrix, the shifts, the diagonal outputs and the log are pairwise disjoint views.

NLAlib.ShiftedQR.multiStepStable_isStableQRChainBy {Op Tst : Type} [Ops.Has Ops.ScalarOp Op]
  [Ops.Has Ops.IndexOp Op] [Ops.Has Ops.CmpTst Tst] {M : Ops.Machine ℝ} {I : Ops.Interp Op Tst ℝ}
  {u : ℝ} (hS : Ops.IsScalar M I) (hM : Ops.StdModel u id M) (hu : 0 ≤ u) (hCmp : Ops.IsCmp id I)
  (hL : Ops.IsIndexLit M I) {nmax : ℕ} (hNat : Ops.IsExactNatLit id M nmax) {τ : Ops.Tape ℝ}
  {m : Ops.Mem ℝ} {n : ℕ} {a s ds lg : ℕ × ℕ} {H : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ}
  {ss : List ℂ} (hH : IsUpperHessenberg H) (hnu : (↑n + 1) * u ≤ 1 / 2500) (hn : n ≤ nmax)
  {ns w : ℕ} {L : List (Option (List GivensEntry))} (hlog : HoldsSlottedLog lg ns w L [] m.store)
  (hj : L.length < ns) (hw : ss.length * n ≤ w) (hl : m.Live [a, s, ds, lg])
  (hA : HoldsMatrix a H m.store)
  (hs : m.store.readBlock s.1 s.2 (2 * ss.length) = some (List.flatMap (fun z ↦ [z.re, z.im]) ss))
  (hd : ds.2 + 2 * ss.length ≤ m.store.len ds.1)
  (has :
    Ops.Fp.Disj (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))))
      (Ops.Store.inBlock s.1 s.2 (2 * ss.length)))
  (had :
    Ops.Fp.Disj (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))))
      (Ops.Store.inBlock ds.1 ds.2 (2 * ss.length)))
  (hsd :
    Ops.Fp.Disj (Ops.Store.inBlock s.1 s.2 (2 * ss.length))
      (Ops.Store.inBlock ds.1 ds.2 (2 * ss.length)))
  (hlgd :
    Ops.Fp.Disj (Ops.Store.inBlock lg.1 lg.2 (ns * (1 + 5 * w)))
      (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))) ⊔
          Ops.Store.inBlock s.1 s.2 (2 * ss.length) ⊔
        Ops.Store.inBlock ds.1 ds.2 (2 * ss.length))) :
  Ops.Writes Ops.Mode.total I τ ShiftedQR.multiStepStable
    (Ops.Env.frame [n + 1, ss.length, w, L.length] [a, s, a, ds, lg])
    (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))) ⊔
        Ops.Store.inBlock ds.1 ds.2 (2 * ss.length) ⊔
      Ops.Store.inBlock lg.1 lg.2 (ns * (1 + 5 * w)))
    (fun m' ↦
      m'.pos = m.pos ∧
        ∃ es,
          es.length = ss.length * 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 ss H' Rs (givensLog (n + 1) es) ∧
                    IsUpperHessenberg H' ∧
                      HoldsMatrix a H' m'.store ∧
                        m'.store.readBlock ds.1 ds.2 (2 * ss.length) =
                          some
                            (List.flatMap
                              (fun R ↦
                                [(R (Fin.last n) (Fin.last n)).re,
                                  (R (Fin.last n) (Fin.last n)).im])
                              Rs))
    m

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.MultiStepStable.