NLA-lib Explorer

NLAlib.SmallEig.smallEigProg_reduce_writes

Library · theorem

Standard rounding

NLAlib.SmallEig.smallEigProg_reduce_writes_if under the standard model at \boldsymbol{u} \le 1/100: the reduction and the replay with the accumulator bound. A step in the proof of NLAlib.SmallEig.SmallEigScratch.of_alloc, NLAlib.SmallEig.smallEigProg_tail_pwrites, NLAlib.SmallEig.smallEigProg_pwrites_schur.

NLAlib.SmallEig.smallEigProg_reduce_writes {O Q : Type} [Ops.Has Ops.ScalarOp O]
  [Ops.Has Ops.IndexOp O] [Ops.Has Ops.CmpTst Q] [Ops.Has Ops.IdxTst Q] {M : Ops.Machine ℝ}
  {I : Ops.Interp O Q ℝ} {u : ℝ} (hS : Ops.IsScalar M I) (hM : Ops.StdModel u id M)
  (hu : u ≤ 1 / 100) (hL : Ops.IsIndexLit M I) {n : ℕ} (hn1 : 1 ≤ n)
  (hNat : Ops.IsExactNatLit id M (n + 1)) (hC : Ops.IsCmp id I) (hQ : Ops.IsToNat id I)
  {qs : List ℝ} (hlen : 12 ≤ qs.length) {ρ : Ops.Env} {ds₁ ds₂ ds₃ : List Ops.IExp}
  {as₁ as₂ as₃ : List Ops.Operand} {w p ub : ℕ × ℕ} {L : ℕ}
  (hd₁ : Ops.IExp.evalList ρ.idx ds₁ = some [n + 1, n + 1])
  (ha₁ : Ops.Operand.evalList ρ as₁ = some [(L + 2, 0)])
  (hd₂ : Ops.IExp.evalList ρ.idx ds₂ = some [n + 1, n + 1, 0])
  (ha₂ : Ops.Operand.evalList ρ as₂ = some [w, w, (L + 2, 0)])
  (hd₃ : Ops.IExp.evalList ρ.idx ds₃ = some [n + 1, 0, 0, n + 1, n + 1, n + 1])
  (ha₃ : Ops.Operand.evalList ρ as₃ = some [(L + 2, 0), ub, ub]) {tape : Ops.Tape ℝ} {μ : Ops.Mem ℝ}
  {A : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ} (hwL : w.1 < L) (hpL : p.1 < L) (huL : ub.1 < L)
  (hlen₂ : List.length μ.store = L + 3) (hFl : μ.store.len L = 1) (hTh : μ.store.len (L + 1) = 1)
  (hLg : μ.store.len (L + 2) = (n + 1) * (1 + 5 * (n + 1))) (hB : HoldsMatrix w A μ.store)
  (hU : HoldsMatrix ub 1 μ.store) (hp : μ.store.readBlock p.1 p.2 qs.length = some qs)
  (hThv : μ.store.get (L + 1) 0 = some (qs.getD 6 0))
  (hwu :
    Ops.Fp.Disj (Ops.Store.inBlock w.1 w.2 (2 * ((n + 1) * (n + 1))))
      (Ops.Store.inBlock ub.1 ub.2 (2 * ((n + 1) * (n + 1)))))
  (hpwu :
    Ops.Fp.Disj (Ops.Store.inBlock p.1 p.2 qs.length)
      (Ops.Store.inBlock w.1 w.2 (2 * ((n + 1) * (n + 1))) ⊔
        Ops.Store.inBlock ub.1 ub.2 (2 * ((n + 1) * (n + 1))))) :
  Ops.Writes Ops.Mode.total I tape
    ((Ops.Stmt.frame ds₁ as₁ slottedLogOpen).seq
      ((Ops.Stmt.frame ds₂ as₂ hessenbergReduceLast).seq
        (Ops.Stmt.frame ds₃ as₃ givensReplayColumns)))
    ρ
    (Ops.Store.inBlock w.1 w.2 (2 * ((n + 1) * (n + 1))) ⊔
        Ops.Store.inBlock ub.1 ub.2 (2 * ((n + 1) * (n + 1))) ⊔
      Ops.Fp.above L)
    (fun μ' ↦
      ∃ X',
        SmallEig.SmallEigCoreReady qs w p ub L (hessenbergReduceLastWord M A) X' μ' ∧
          specNorm (X' - givensLog (n + 1) (hessenbergReduceLastSlots M A).flatten) ≤
            (1 + 24 * u) ^ ((n + 1) * (n + 1)) - 1)
    μ

Full source on GitHub

Import NLAlib.Eigensolvers.SmallEig.Program.