NLA-lib Explorer

NLAlib.Krylov.CG.residualCache_wp_fixedPoint

Library · theorem

Bounded nearest-grid fixed-point arithmetic has an absolute half-grid allowance. The resulting cache error is at most n/scale, and a zero cache bounds the residual by that same value. Saturation is excluded by the supplied input-only range inequality. An end statement in operand form: no other declaration of the library is proved from it.

NLAlib.Krylov.CG.residualCache_wp_fixedPoint {Op Tst : Type} [Ops.Has Ops.ScalarOp Op]
  [Ops.Has Ops.Blas1Op Op] [Ops.Apart Ops.Blas1Op Ops.ScalarOp Op] (bound scale : ℕ)
  (hs : 0 < scale) {I : Ops.Interp Op Tst (Ops.Examples.FixedPoint.Word bound)}
  (hI : Ops.IsScalar (Ops.Examples.FixedPoint.machine bound scale) I)
  {τ : Ops.Tape (Ops.Examples.FixedPoint.Word bound)} {n : ℕ} {r z : ℕ × ℕ}
  {m : Ops.Mem (Ops.Examples.FixedPoint.Word bound)}
  {rs : List (Ops.Examples.FixedPoint.Word bound)} (hl : m.Live [r, z])
  (hr : m.store.readBlock r.1 r.2 n = some rs) (hz : z.2 < m.store.len z.1)
  (hRange :
    ‖WithLp.toLp 2 (Ops.decv (Ops.Examples.FixedPoint.decode scale) n rs)‖ ^ 2 + ↑n / ↑scale ≤
      ↑bound / ↑scale) :
  Ops.Wp Ops.Mode.total I τ (Ops.Stmt.link Ops.Blas.sumSeqTable Ops.dotSum)
    (Ops.Env.frame [n] [r, r, z])
    (fun out ↦
      ∃ cache,
        out = m.upd z cache ∧
          out.store.get z.1 z.2 = some cache ∧
            |‖WithLp.toLp 2 (Ops.decv (Ops.Examples.FixedPoint.decode scale) n rs)‖ ^ 2 -
                    Ops.Examples.FixedPoint.decode scale cache| ≤
                ↑n / ↑scale ∧
              (Ops.Examples.FixedPoint.decode scale cache = 0 →
                ‖WithLp.toLp 2 (Ops.decv (Ops.Examples.FixedPoint.decode scale) n rs)‖ ^ 2 ≤
                  ↑n / ↑scale))
    m

Full source on GitHub

Import NLAlib.Krylov.CG.ResidualCacheFormats.