NLAlib.givensReplayWith_writes_word
Library · theorem
A replay with any rotation routine stores the replayed word: if Rot at the plane k stores rotWord k c s of the matrix for the coefficients (c, s), the replay of a closed log whose entries have their two planes in range stores the left fold of rotWord over the valid entries, with the coefficients rounded from each entry. Shared by the trees of NLAlib.givensReplayRows, NLAlib.givensReplayColumns.
NLAlib.givensReplayWith_writes_word {O Q : Type} [Ops.Has Ops.ScalarOp O] [Ops.Has Ops.CmpTst Q]
[Ops.Has Ops.IdxTst Q] {Mch : Ops.Machine ℝ} {I : Ops.Interp O Q ℝ} (hS : Ops.IsScalar Mch I)
(hQ : Ops.IsToNat id I) (hC : Ops.IsCmp id I) {Rot : Ops.Stmt O Q} {N lo j0 nc ns w : ℕ}
{lg x : ℕ × ℕ} (rotWord : ℕ → ℂ → ℂ → Matrix (Fin N) (Fin N) ℂ → Matrix (Fin N) (Fin N) ℂ)
(hRot :
∀ {τ : Ops.Tape ℝ} {μ : Ops.Mem ℝ} {k : ℕ} {c s t : ℕ × ℕ} {Y : Matrix (Fin N) (Fin N) ℂ}
{cv sv : ℂ},
k + 1 < N →
HoldsMatrix x Y μ.store →
μ.store.readBlock c.1 c.2 2 = some [cv.re, cv.im] →
μ.store.readBlock s.1 s.2 2 = some [sv.re, sv.im] →
Ops.Fp.Disj (Ops.Store.inBlock x.1 x.2 (2 * (N * N))) (Ops.Store.inBlock c.1 c.2 2) →
Ops.Fp.Disj (Ops.Store.inBlock x.1 x.2 (2 * (N * N)))
(Ops.Store.inBlock s.1 s.2 2) →
t.1 ≠ x.1 →
t.1 ≠ c.1 →
t.1 ≠ s.1 →
t.2 + 10 ≤ μ.store.len t.1 →
Ops.Writes Ops.Mode.total I τ Rot
(Ops.Env.frame [N, k, j0, nc] [x, c, s, t, x])
(Ops.Store.inBlock x.1 x.2 (2 * (N * N)) ⊔ Ops.Store.inBlock t.1 t.2 10)
(fun μ' ↦ μ'.pos = μ.pos ∧ HoldsMatrix x (rotWord k cv sv Y) μ'.store)
μ)
{L : List (Option (List GivensEntry))} {P : List GivensEntry}
(hrow : ∀ e ∈ slotEntries w L, lo + e.1 + 1 < N) {X : Matrix (Fin N) (Fin N) ℂ} {τ : Ops.Tape ℝ}
{μ : Ops.Mem ℝ} (hlog : HoldsSlottedLog lg ns w L P μ.store) (hlen : L.length = ns)
(hX : HoldsMatrix x X μ.store) (hl : μ.Live [lg, x])
(hd :
Ops.Fp.Disj (Ops.Store.inBlock lg.1 lg.2 (ns * (1 + 5 * w)))
(Ops.Store.inBlock x.1 x.2 (2 * (N * N)))) :
Ops.Writes Ops.Mode.total I τ (givensReplayWith Rot)
(Ops.Env.frame [N, lo, j0, nc, ns, w] [lg, x, x]) (Ops.Store.inBlock x.1 x.2 (2 * (N * N)))
(fun μ' ↦
μ'.pos = μ.pos ∧
HoldsMatrix x
(List.foldl
(fun Y e ↦
rotWord (lo + e.1) (roundedGivensCoeffs Mch e.2.1 e.2.2).1
(roundedGivensCoeffs Mch e.2.1 e.2.2).2 Y)
X (slotEntries w L))
μ'.store)
μImport NLAlib.Matrix.FinitePrecision.GivensReplay.