NLA-lib Explorer

NLAlib.ShiftedQR.shPotentialAccept_writes

Library · theorem

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

Standard rounding

The potential test on a scalar machine with the standard model at 20000k\boldsymbol{u} \le 1, exact comparisons and exact natural literals up to 1: from a step \widehat{\mathbf{H}} at T (k = 2^q \le n), the threshold p_t at Pt, the matrix \mathbf{H} at A and the words g, f at G, Fl, NLAlib.ShiftedQR.shPotentialAccept computes a p within 20\boldsymbol{u}, relatively, of \psi_k(\widehat{\mathbf{H}}), and either p < p_t and the step is accepted (A holds \widehat{\mathbf{H}}, G is 0, Fl is 1), or p_t \le p and A, G, Fl are unchanged. It writes only A, G, Fl and P2. Shared by the trees of NLAlib.ShiftedQR.shqrSmallEigRoutine, on their scratch.

NLAlib.ShiftedQR.shPotentialAccept_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) (hNat : Ops.IsExactNatLit id M 1)
  (hC : Ops.IsCmp id I) {τ : Ops.Tape ℝ} {m : Ops.Mem ℝ} {n k q : ℕ} (hkq : k = 2 ^ q) (hkn : k ≤ n)
  (hu : 20000 * ↑k * u ≤ 1) {pt t p2 a g f : ℕ × ℕ} {H H' : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ}
  {pv gv fv : ℝ} (hT : HoldsMatrix t H' m.store) (hA : HoldsMatrix a H m.store)
  (hpt : m.store.get pt.1 pt.2 = some pv) (hg : m.store.get g.1 g.2 = some gv)
  (hf : m.store.get f.1 f.2 = some fv) (hrp : p2.2 < m.store.len p2.1)
  (hta :
    Ops.Fp.Disj (Ops.Store.inBlock t.1 t.2 (2 * ((n + 1) * (n + 1))))
      (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1)))))
  (hga :
    (Ops.Store.inBlock g.1 g.2 1 ⊔ Ops.Store.inBlock f.1 f.2 1).Disj
      (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))
  (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))
  (hL : Ops.IsIndexLit M I) {ns w : ℕ} {lg : ℕ × ℕ} {LL : List (Option (List GivensEntry))}
  {P : List GivensEntry} (hlog : HoldsSlottedLog lg ns w LL P m.store) (hj : LL.length < ns)
  (hlgl : m.Live [lg]) (hlgb : ∀ b ∈ [pt, t, p2, a, g, f], b.1 ≠ lg.1) :
  Ops.Writes Ops.Mode.total I τ ShiftedQR.shPotentialAccept
    (Ops.Env.frame [n + 1, k, q, w, LL.length] [pt, t, 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 p2.1 p2.2 1 ⊔
      Ops.Store.inBlock lg.1 lg.2 (ns * (1 + 5 * w)))
    (fun m' ↦
      ∃ p,
        |p - hessenbergPotential k H'| ≤ 20 * u * hessenbergPotential k H' ∧
          (p < pv ∧
              HoldsMatrix a H' m'.store ∧
                m'.store.get g.1 g.2 = some 0 ∧
                  m'.store.get f.1 f.2 = some 1 ∧
                    HoldsSlottedLog lg ns w (LL ++ [some P]) [] m'.store ∨
            pv ≤ p ∧
              HoldsMatrix a H m'.store ∧
                m'.store.get g.1 g.2 = some gv ∧
                  m'.store.get f.1 f.2 = some fv ∧ HoldsSlottedLog lg ns w LL P m'.store))
    m

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.RoundedShTrial.