NLA-lib Explorer

NLAlib.Ops.StdModel.isAccurate_toFloatMachine

Library · theorem

Standard rounding

The actual scalar functions and implemented samplers satisfy the full mathematical matrix-machine accuracy interface. The common allowance includes uniform seed rounding; matrix multiplication and QR must satisfy their numerical contracts at that same allowance. Measurability and the ideal sample law remain separate from numerical accuracy.

NLAlib.Ops.StdModel.isAccurate_toFloatMachine {K : Type} {M : Ops.Machine K} {dec : K → ℝ} {u : ℝ}
  (h : Ops.StdModel u dec M) (hu : 0 ≤ u) {cU cG Ω : ℝ} (hcU : 0 ≤ cU) (hcG : 0 ≤ cG)
  (hsmall : (cG + 3) * u ≤ 1 / 10) (hlit : Ops.IsExactNatLit dec M 2)
  (roundUnif roundGaussian : ℝ → K)
  (hU : ∀ (v : ℝ), |v| ≤ 1 → |dec (roundUnif v) - v| ≤ cU * u * |v|)
  (hUr : ∀ v ∈ Set.Icc (-1) 1, dec (roundUnif v) ∈ Set.Icc (-1) 1)
  (hmul : ∀ (x y : K), |dec y| ≤ 1 → |dec (M.mul x y)| ≤ |dec x|)
  (hG : ∀ (x : ℝ), |x| ≤ 2 * Ω → |dec (roundGaussian x) - x| ≤ cG * u * |x|)
  (mm : MatMulMap (K × K)) (qr : QRMap (K × K)) (μM μQ : ℕ → ℝ)
  (hmm : IsMatMulErr (decodeComplex dec) ((cU + 1) * u) 0 Ω μM fun {l m n} ↦ mm)
  (hqr : IsQRErr (decodeComplex dec) ((cU + 1) * u) 0 Ω μQ fun {m n} ↦ qr) :
  (M.toFloatMachine dec (fun {l m n} ↦ mm) (fun {m n} ↦ qr) (M.uniformSample roundUnif)
        (M.normalSample roundGaussian)).IsAccurate
    dec ((cU + 1) * u) 0 Ω μM μQ (2 * (cG + 3))

Full source on GitHub

Import NLAlib.Matrix.FinitePrecision.OpsSampling.