NLAlib.ShiftedQR.writeAndSplit_writes_mem
Library · theorem
Commit and split, memory effect: writeAndSplit copies the work block \mathbf{B} into the diagonal block of the range (lo, d) of the stored matrix and pushes the right child, then the left child, on any scalar machine whose natural literals up to n + 1 are exact. Shared by the trees of NLAlib.ShiftedQR.shqrSmallEigRoutine and NLAlib.SmallEig.smallEigRoutine, on their scratch.
NLAlib.ShiftedQR.writeAndSplit_writes_mem {O Q : Type} [Ops.Has Ops.ScalarOp O]
[Ops.Has Ops.IndexOp O] [Ops.Has Ops.IdxTst Q] {M : Ops.Machine ℝ} {I : Ops.Interp O Q ℝ}
(hS : Ops.IsScalar M I) (hL : Ops.IsIndexLit M I) (hQ : Ops.IsToNat id I) {n : ℕ}
(hN : Ops.IsExactNatLit id M (n + 1)) {τ : Ops.Tape ℝ} {m : Ops.Mem ℝ} {lo d i : ℕ}
{a st w : ℕ × ℕ} {A : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ} {B : Matrix (Fin d) (Fin d) ℂ}
{rs : List (ℕ × ℕ)} (hl : m.Live [a, st, w]) (hA : HoldsMatrix a A m.store)
(hW : HoldsMatrix w B m.store) (hSt : ShiftedQR.StackHolds st rs m.store) (hr : lo + d ≤ n + 1)
(hi : i < d) (hcap : rs.length + 2 ≤ n + 1)
(hroomA : a.2 + 2 * ((n + 1) * (n + 1)) ≤ m.store.len a.1)
(hroomS : st.2 + (1 + 2 * (n + 1)) ≤ m.store.len st.1)
(hWA :
Ops.Fp.Disj (Ops.Store.inBlock w.1 w.2 (2 * (d * d)))
(Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1)))))
(hAS :
Ops.Fp.Disj (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))))
(Ops.Store.inBlock st.1 st.2 (1 + 2 * (n + 1)))) :
Ops.Writes Ops.Mode.total I τ ShiftedQR.writeAndSplit (Ops.Env.frame [n + 1, lo, d, i] [a, st, w])
(Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))) ⊔
Ops.Store.inBlock st.1 st.2 (1 + 2 * (n + 1)))
(fun m' ↦
m'.pos = m.pos ∧
HoldsMatrix a (setSubBlock A (lo, d) B) m'.store ∧
ShiftedQR.StackHolds st (rs ++ [(lo + i + 1, d - i - 1), (lo, i + 1)]) m'.store)
mImport NLAlib.Eigensolvers.ShiftedQR.RoundedSolveBackward.