NLAlib.ShiftedQR.optimalTest_writes
Library · theorem
Standard rounding
Optimal decides optimality (corrected [BanksGarzaVargasSrivastava2022, Lemma 4.5]): on a scalar machine with the standard model, exact literals 0, 1 and exact comparisons, let \mathbf{H} of order N = n + 1 be stored at A, the k \ge 1 shifts s_j, k \le n, \lvert s_j\rvert \le C\|\mathbf{H}\|_2, stored as pairs at S, the word 0.999\theta^k at C, \theta > 0, \psi_k(\mathbf{H}) > 0, and 30000\,kN^{3/2}\boldsymbol{u}\,((2 + 2C)\|\mathbf{H}\|_2)^k \le (\theta\psi_k(\mathbf{H}))^k, \qquad 10^5 (N + k)^2\boldsymbol{u} \le 1. Then optimalTest writes only its flag word, and stores there \mathbf{b} \in \{0, 1\} with: \mathbf{b} = 1 implies the shifts are \theta-optimal, and \mathbf{b} = 0 implies they are not 0.998^{1/k}\theta-optimal. The computed norm, shifted by the threshold's rounding, meets the 0.0009(\theta\psi_k)^k hypothesis of NLAlib.isOptimalRitzValues_of_lt and NLAlib.not_isOptimalRitzValues_of_le. The paper's precision (2 \cdot 10^3 n^2)^{-1}(\psi_k/(\theta(2 + 2C)\|\mathbf{H}\|_2))^k rests on the constant 2n^2, which its proof does not give (n + kn^{3/2}); here kN^{3/2}. A fragment of the tree NLAlib.ShiftedQR.regularizeDecide.
NLAlib.ShiftedQR.optimalTest_writes {Op Tst : Type} [Ops.Has Ops.ScalarOp 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) (hNat : Ops.IsExactNatLit id M 1)
(hC : Ops.IsCmp id I) {τ : Ops.Tape ℝ} {μ : Ops.Mem ℝ} {n : ℕ} {a s c f : ℕ × ℕ}
{H : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ} {ss : List ℂ} {θ C : ℝ} (hss : ss ≠ [])
(hk : ss.length ≤ n) (hθ : 0 < θ) (hψ : 0 < hessenbergPotential ss.length H)
(hs : ∀ s ∈ ss, ‖s‖ ≤ C * specNorm H)
(hu :
30000 * ↑ss.length * (↑(n + 1) * √↑(n + 1) * u) * ((2 + 2 * C) * specNorm H) ^ ss.length ≤
(θ * hessenbergPotential ss.length H) ^ ss.length)
(hu1 : 100000 * ↑(n + 1 + ss.length) ^ 2 * u ≤ 1) (hH : HoldsMatrix a H μ.store)
(hsS : μ.store.readBlock s.1 s.2 (2 * ss.length) = some (List.flatMap (fun z ↦ [z.re, z.im]) ss))
(hc : μ.store.get c.1 c.2 = some (0.999 * θ ^ ss.length)) (hf : f.2 < μ.store.len f.1)
(hl : μ.Live [a, s, c, f])
(has :
Ops.Fp.Disj (Ops.Store.inBlock f.1 f.2 1)
(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 c.1 c.2 1)) :
Ops.Writes Ops.Mode.total I τ ShiftedQR.optimalTest
(Ops.Env.frame [n + 1, ss.length] [a, s, c, f]) (Ops.Store.inBlock f.1 f.2 1)
(fun μ' ↦
μ'.pos = μ.pos ∧
∃ b,
μ'.store.get f.1 f.2 = some b ∧
(b = 0 ∨ b = 1) ∧
(b = 1 → IsOptimalRitzValues θ H ss) ∧
(b = 0 → ¬IsOptimalRitzValues (0.998 ^ (↑ss.length)⁻¹ * θ) H ss))
μImport NLAlib.Eigensolvers.ShiftedQR.RoundedRitz.