NLAlib.ShiftedQR.loop_writes_normSqOpRound
Library · theorem
The fold loop of squared moduli on any scalar machine: let the scalar operation o be the machine function g. If, in round i < N, the operand x addresses a pair holding z_i, inside a region R apart from the scratch view t (three words) and the accumulator word p, and p holds \mathbf{v}, then the loop stores in p the fold NLAlib.ShiftedQR.foldWords by g of \mathbf{v} and the machine squared moduli of z_0, \dots, z_{N-1}, and writes only p and t. A step in the proof of loop_writes_normSqMulRound, pairVecNormWithScratch_writes_word.
NLAlib.ShiftedQR.loop_writes_normSqOpRound {Op Tst : Type} [Ops.Has Ops.ScalarOp Op]
{M : Ops.Machine ℝ} {I : Ops.Interp Op Tst ℝ} (hS : Ops.IsScalar M I) {o : Ops.ScalarOp}
{g : ℝ → ℝ → ℝ} (hg : M.fn o = Ops.BlockFn.bin fun a b ↦ some (g a b)) {τ : Ops.Tape ℝ}
{m : Ops.Mem ℝ} {ρ : Ops.Env} {cnt : Ops.IExp} {N : ℕ} (hN : Ops.IExp.eval ρ.idx cnt = some N)
{x t p : Ops.Operand} {xs : ℕ → ℕ × ℕ} {tl pl : ℕ × ℕ} {R : Ops.Fp} {z : ℕ → ℂ} {v : ℝ}
(hx : ∀ i < N, Ops.Operand.eval (ρ.pushIdx i) x = some (xs i))
(ht : ∀ i < N, Ops.Operand.eval (ρ.pushIdx i) t = some tl)
(ht2 :
∀ i < N,
Ops.Operand.eval (ρ.pushIdx i) { buf := t.buf, off := t.off + Ops.IExp.const 2 } =
some (tl.1, tl.2 + 2))
(hp : ∀ i < N, Ops.Operand.eval (ρ.pushIdx i) p = some pl)
(hxR : ∀ i < N, Ops.Store.inBlock (xs i).1 (xs i).2 2 ≤ R)
(hre : ∀ i < N, m.store.get (xs i).1 (xs i).2 = some (z i).re)
(him : ∀ i < N, m.store.get (xs i).1 ((xs i).2 + 1) = some (z i).im)
(hroom : tl.2 + 3 ≤ m.store.len tl.1) (hv : m.store.get pl.1 pl.2 = some v)
(hRt : R.Disj (Ops.Store.inBlock tl.1 tl.2 3)) (hRp : R.Disj (Ops.Store.inBlock pl.1 pl.2 1))
(htp : Ops.Fp.Disj (Ops.Store.inBlock tl.1 tl.2 3) (Ops.Store.inBlock pl.1 pl.2 1)) :
Ops.Writes Ops.Mode.total I τ (Ops.Stmt.loop cnt (ShiftedQR.normSqOpRound o x t p)) ρ
(Ops.Store.inBlock pl.1 pl.2 1 ⊔ Ops.Store.inBlock tl.1 tl.2 3)
(fun m' ↦
m'.pos = m.pos ∧
m'.store.get pl.1 pl.2 = some (ShiftedQR.foldWords g (ShiftedQR.normSqFactors M v z) N))
mImport NLAlib.Eigensolvers.ShiftedQR.RoundedModuli.