NLAlib.ShiftedQR.regularizeDecide_writes
Library · theorem
This statement changed in the recorded rename: 2026-11-schur.
Standard rounding
The decision of Regularize on a scalar machine with the standard model at \boldsymbol{u} \le 1, exact comparisons, index literals and exact natural literals up to n + 1: from an upper Hessenberg \mathbf{H} at A, 1 \le k \le n, the k shifts z_j at S with \lvert z_j\rvert \le C\|\mathbf{H}\|_2, \theta > 0, \psi_k(\mathbf{H}) > 0, the word 0.999\theta^k at C, the threshold word t at Thr, the scratch and output views apart, and the precision conditions (n + 1)\boldsymbol{u} \le 1/2500, 10^5(n + 1 + k)^2\boldsymbol{u} \le 1 and 30000k(n + 1)^{3/2}\boldsymbol{u}((2 + 2C)\|\mathbf{H}\|_2)^k \le (\theta\psi_k(\mathbf{H}))^k, NL\mathbf{A}li\mathbf{b}.Shifted\mathbf{Q}R.regularizeDecide either sets the flag to 0, leaves \mathbf{H} at A and the shifts are \theta-optimal, or sets the flag to 1 and stores at A an accepted step (NLAlib.ShiftedQR.regularizeTrials_writes), given that, when the shifts are not 0.998^{1/k}\theta-optimal, some shift decouples every backward-stable step with it. The trials use the slots j_0, \dots, j_0 + k - 1 of the log: on acceptance they are closed, the accepted one valid, and the step is by the exact unitary of its entries; when optimal the log is untouched.
Shared by the tree of NLAlib.ShiftedQR.shqrSmallEigRoutine, on its scratch.
NLAlib.ShiftedQR.regularizeDecide_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 s c thr t sr ds rg g f : ℕ × ℕ}
{H : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ} {zs : Fin k → ℂ} {tv ω θ C : ℝ}
(hH : IsUpperHessenberg H) (hnu : (↑n + 1) * u ≤ 1 / 2500) (hθ : 0 < θ)
(hψ : 0 < hessenbergPotential k H) (hzs : ∀ (j : Fin k), ‖zs j‖ ≤ C * specNorm H)
(huo :
30000 * ↑k * (↑(n + 1) * √↑(n + 1) * u) * ((2 + 2 * C) * specNorm H) ^ k ≤
(θ * hessenbergPotential k H) ^ k)
(huo1 : 100000 * ↑(n + 1 + k) ^ 2 * u ≤ 1) (hA : HoldsMatrix a H m.store)
(hs : ∀ (j : Fin k), m.store.readBlock s.1 (s.2 + 2 * ↑j) 2 = some [(zs j).re, (zs j).im])
(hc : m.store.get c.1 c.2 = some (0.999 * θ ^ k)) (hthr : m.store.get thr.1 thr.2 = some tv)
(hrg' : g.2 < m.store.len g.1) (hrf : f.2 < m.store.len f.1)
(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 s.1 s.2 (2 * k) ⊔
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)))))
(hGF :
(Ops.Store.inBlock g.1 g.2 1 ⊔ Ops.Store.inBlock f.1 f.2 1).Disj
(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 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))
(hAS :
(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).Disj
(Ops.Store.inBlock s.1 s.2 (2 * k) ⊔ Ops.Store.inBlock thr.1 thr.2 1 ⊔
Ops.Store.inBlock c.1 c.2 1))
(hdich :
¬IsOptimalRitzValues (0.998 ^ (↑k)⁻¹ * θ) H (List.ofFn zs) →
∃ jstar,
∀ (H' : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ)
(Rs : List (Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ)),
IsStableQRChain (300 * (↑n + 1) ^ 2 * u) H (List.replicate k (zs jstar)) H' Rs →
∃ i, n ≤ ↑i + k ∧ ‖H' i.succ i.castSucc‖ ≤ ω)
(hthrω : (1 + u) ^ 2 * ω ^ 2 ≤ tv) {ns w : ℕ} {lg : ℕ × ℕ} {L : List (Option (List GivensEntry))}
(hlog : HoldsSlottedLog lg ns w L [] m.store) (hj : L.length + k ≤ ns) (hw : k * n ≤ w)
(hlgl : m.Live [lg]) (hlgb : ∀ b ∈ [a, s, c, thr, t, sr, ds, rg, g, f], b.1 ≠ lg.1) :
Ops.Writes Ops.Mode.total I τ ShiftedQR.regularizeDecide
(Ops.Env.frame [n + 1, k, w, L.length] [a, s, c, thr, t, sr, ds, rg, 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 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' ↦
m'.store.get f.1 f.2 = some 0 ∧
HoldsMatrix a H m'.store ∧
HoldsSlottedLog lg ns w L [] m'.store ∧ IsOptimalRitzValues θ H (List.ofFn zs) ∨
m'.store.get f.1 f.2 = some 1 ∧
∃ j Ls es,
Ls.length = k ∧
(∀ e ∈ slotEntries w Ls, e.1 + 1 < n + 1) ∧
HoldsSlottedLog lg ns w (L ++ Ls) [] m'.store ∧
slotEntries w Ls = padEntries w es ∧
∃ H' Rs,
IsStableQRChainBy (300 * (↑n + 1) ^ 2 * u) H (List.replicate k (zs j)) H' Rs
(givensLog (n + 1) es) ∧
IsUpperHessenberg H' ∧
HoldsMatrix a H' m'.store ∧
∃ i, n ≤ ↑i + k ∧ (1 - u) ^ 2 * ‖H' i.succ i.castSucc‖ ^ 2 ≤ tv)
mImport NLAlib.Eigensolvers.ShiftedQR.RoundedRegularizeTrial.