NLA-lib Explorer

NLAlib.ShiftedQR.bottomScan_writes

Library · theorem

Standard rounding

The rounded bottom-k scan (the decision of Deflate, [BanksGarzaVargasSrivastava2022, §6], corrected: it scans the bottom k subdiagonal entries, where Deflate takes the bottom k - 1): on a machine with the standard model at 0 \le \boldsymbol{u} \le 1 whose natural literals up to n + 1 are exact (the flag and the index are such literals), for an (n+1) \times (n+1) matrix \mathbf{H}, k \le n and the threshold word t, bottomScan writes only its five registers and either sets the flag to 1 and the index to some i among the bottom k subdiagonal positions (n \le i + k) with (1 - \boldsymbol{u})^2\lvert h_{i+1,i} \rvert^2 \le t, or sets the flag to 0, and then every bottom k subdiagonal entry has t < (1 + \boldsymbol{u})^2\lvert h_{i+1,i} \rvert^2. Shared by the trees of NLAlib.ShiftedQR.shqrSmallEigRoutine and NLAlib.SmallEig.smallEigRoutine, on their scratch.

NLAlib.ShiftedQR.bottomScan_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 : ℝ} {n : ℕ}
  (hS : Ops.IsScalar M I) (hM : Ops.StdModel u id M) (hu : 0 ≤ u) (hu1 : u ≤ 1)
  (hL : Ops.IsIndexLit M I) (hNat : Ops.IsExactNatLit id M (n + 1)) (hC : Ops.IsCmp id I)
  {τ : Ops.Tape ℝ} {m : Ops.Mem ℝ} {k : ℕ} (hk : k ≤ n) {a t r : ℕ × ℕ}
  {H : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ} {thr : ℝ} (hH : HoldsMatrix a H m.store)
  (ht : m.store.get t.1 t.2 = some thr) (hl : m.Live [a, t, r]) (hroom : r.2 + 5 ≤ m.store.len r.1)
  (hA :
    Ops.Fp.Disj (Ops.Store.inBlock r.1 r.2 5) (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1)))))
  (hT : Ops.Fp.Disj (Ops.Store.inBlock r.1 r.2 5) (Ops.Store.inBlock t.1 t.2 1)) :
  Ops.Writes Ops.Mode.total I τ ShiftedQR.bottomScan (Ops.Env.frame [n + 1, k] [a, t, r])
    (Ops.Store.inBlock r.1 r.2 5)
    (fun m' ↦
      m'.pos = m.pos ∧
        ((m'.store.get r.1 (r.2 + 3) = some 1 ∧
            ∃ i,
              n ≤ ↑i + k ∧
                m'.store.get r.1 (r.2 + 4) = some ↑↑i ∧
                  (1 - u) ^ 2 * ‖H i.succ i.castSucc‖ ^ 2 ≤ thr) ∨
          m'.store.get r.1 (r.2 + 3) = some 0 ∧
            ∀ (i : Fin n), n ≤ ↑i + k → thr < (1 + u) ^ 2 * ‖H i.succ i.castSucc‖ ^ 2))
    m

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.RoundedSolveBackward.