NLA-lib Explorer

NLAlib.Ops.ContextLinearRounded.guarded_laws

Library · theorem

Relative-error BLAS

Guarded rounded source laws for reusing an existing total numerical word theorem. The isolated matrix is decoded from the raw input words and comparisons stay unchanged.

NLAlib.Ops.ContextLinearRounded.guarded_laws {I : Ops.Interp Ops.RCLikeBlas.Operation Ops.CmpTst ℝ}
  {M : Ops.Machine ℝ} {e : Ops.Blas1Err} {ok : ℕ → Prop} (hS : Ops.IsScalar M I)
  (hB : Ops.IsBlas1 id e ok I) (hCmp : Ops.IsCmp id I) (context : List (ℕ × ℕ))
  (index : Fin context.length) {n : ℕ} {C : ℕ → Prop} (reference : Ops.Store ℝ) (raw : List ℝ)
  {error : ℝ} (herror : 0 ≤ error)
  (hError :
    ∀ (xs : List ℝ),
      ‖WithLp.toLp 2
            (Ops.StoredOperator.denseMatrix n n raw *ᵥ Ops.decv id n xs -
              Ops.decv id n (List.map (Ops.StoredDense.rowWord M n n raw xs) (List.range n)))‖ ≤
        error * ‖WithLp.toLp 2 (Ops.decv id n xs)‖)
  (hc : ∀ z ∈ context, C z.1)
  (hData : reference.readBlock context[index].1 context[index].2 (n * n) = some raw) :
  have J :=
    (I.linkContext (Ops.ContextLinear.table context.length ↑index) context).guardIsolated
      (fun o ↦
        (Ops.ContextLinearRounded.relation M e (Ops.StoredOperator.denseMatrix n n raw) error
              o).spec
          (Ops.ContextLinearRounded.admissible ok n o))
      (Ops.Mem.Isolated C reference) C
      (Ops.ContextLinearRounded.fallback I (Ops.StoredOperator.denseMatrix n n raw));
  Ops.IsScalar M J ∧
    Ops.IsBlas1 id e ok J ∧
      Ops.IsMatvec id (Ops.StoredOperator.denseMatrix n n raw) error J ∧ Ops.IsCmp id J

Full source on GitHub

Import NLAlib.Ops.Profiles.ContextLinearRoundedGuarded.