NLA-lib Explorer

NLAlib.ShiftedQR.loop_writes_normSqMulRound

Library · theorem

The product loop of squared moduli on any scalar machine: the fold loop (NLAlib.ShiftedQR.loop_writes_normSqOpRound) by the multiplication stores the rounded product NLAlib.prodWords of \mathbf{v} and the machine squared moduli of z_0, \dots, z_{N-1}. A step in the proof of subdiagProductWithScratch_writes_word, comptau_writes_word.

NLAlib.ShiftedQR.loop_writes_normSqMulRound {Op Tst : Type} [Ops.Has Ops.ScalarOp Op]
  {M : Ops.Machine ℝ} {I : Ops.Interp Op Tst ℝ} (hS : Ops.IsScalar M I) {τ : 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.normSqMulRound 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 (prodWords M (ShiftedQR.normSqFactors M v z) N))
    m

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.RoundedModuli.