NLAlib.ShiftedQR.regularizeWith_terminates
Library · theorem
This statement changed in the recorded rename: 2026-11-schur.
Regularize with a terminating small-eigenvalue routine terminates on any matrix ([BanksGarzaVargasSrivastava2022, §4.2]): on a scalar machine with exact comparisons, index literals and exact natural literals up to n + 1, with an exact polar sampler and a routine SE that terminates on orders at most k with the cap T and the words qs (NLAlib.ShiftedQR.TerminatingSmallEig) stored at qw, from any matrix of order n + 1 at a, any words at rd, c, thr, room for k \le n output pairs at s and the flag at f (the views live, the matrix, the pairs and the flag apart from each other and from the inputs), NLAlib.ShiftedQR.regularizeWith writes only the matrix, the pairs and the flag, and leaves all three stored, on every tape.
NLAlib.ShiftedQR.regularizeWith_terminates {O Q : Type} [Ops.Has Ops.ScalarOp O]
[Ops.Has Ops.IndexOp O] [Ops.Has ShiftedQR.DiskSampleOp O] [Ops.Has Ops.CmpTst Q]
{M : Ops.Machine ℝ} {I : Ops.Interp O Q ℝ} (hS : Ops.IsScalar M I) (hL : Ops.IsIndexLit M I)
{n : ℕ} (hNat : Ops.IsExactNatLit id M (n + 1)) (hC : Ops.IsCmp id I) {s₀ : ℕ}
(hD : ShiftedQR.IsPolarDiskSampler s₀ I) {τ : Ops.Tape ℝ} {m : Ops.Mem ℝ} {k : ℕ} (hk : k ≤ n)
{a rd c thr s f : ℕ × ℕ}
(has :
Ops.Fp.Disj (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))))
(Ops.Store.inBlock s.1 s.2 (2 * k)))
(haf :
Ops.Fp.Disj (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1)))) (Ops.Store.inBlock f.1 f.2 1))
(hsf : Ops.Fp.Disj (Ops.Store.inBlock s.1 s.2 (2 * k)) (Ops.Store.inBlock f.1 f.2 1))
(hio :
(Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))) ⊔ Ops.Store.inBlock s.1 s.2 (2 * k) ⊔
Ops.Store.inBlock f.1 f.2 1).Disj
(Ops.Store.inBlock rd.1 rd.2 1 ⊔ Ops.Store.inBlock c.1 c.2 1 ⊔
Ops.Store.inBlock thr.1 thr.2 1))
{H : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ} {R cw tv : ℝ} (hl : m.Live [a, rd, c, thr, s, f])
(hA : HoldsMatrix a H m.store) (hrd : m.store.get rd.1 rd.2 = some R)
(hc : m.store.get c.1 c.2 = some cw) (hthr : m.store.get thr.1 thr.2 = some tv)
(hrs : s.2 + 2 * k ≤ m.store.len s.1) (hrf : f.2 < m.store.len f.1) {T : ℕ} {qs : List ℝ}
{SE : Ops.Stmt O Q} (hSE : ShiftedQR.TerminatingSmallEig k T qs SE I) {qw : ℕ × ℕ}
(hlq : qw.1 < List.length m.store) (hq : m.store.readBlock qw.1 qw.2 qs.length = some qs)
(hqw :
(Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))) ⊔ Ops.Store.inBlock s.1 s.2 (2 * k) ⊔
Ops.Store.inBlock f.1 f.2 1).Disj
(Ops.Store.inBlock qw.1 qw.2 qs.length))
{ns w : ℕ} {lg : ℕ × ℕ} {LL : List (Option (List GivensEntry))} (hj : LL.length + k ≤ ns)
(hw : k * n ≤ w) (hlog : HoldsSlottedLog lg ns w LL [] m.store) (hlgl : m.Live [lg])
(hlgv : ∀ b ∈ [a, rd, c, thr, qw, s, f], b.1 ≠ lg.1) :
Ops.Writes Ops.Mode.total I τ (ShiftedQR.regularizeWith SE)
(Ops.Env.frame [n + 1, k, qs.length, T, w, LL.length] [a, rd, c, thr, qw, a, s, f, lg])
(Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))) ⊔ Ops.Store.inBlock s.1 s.2 (2 * k) ⊔
Ops.Store.inBlock f.1 f.2 1 ⊔
Ops.Store.inBlock lg.1 lg.2 (ns * (1 + 5 * w)))
(fun m' ↦
(∃ H', HoldsMatrix a H' m'.store) ∧
(∃ ys, m'.store.readBlock s.1 s.2 (2 * k) = some ys) ∧
∃ x,
m'.store.get f.1 f.2 = some x ∧
∃ Ls,
Ls.length = k ∧
(∀ x ∈ slotEntries w Ls, x.1 + 1 < n + 1) ∧
HoldsSlottedLog lg ns w (LL ++ Ls) [] m'.store)
mImport NLAlib.Eigensolvers.ShiftedQR.RoundedDecoupleRoutine.