NF Tensor Approximation Plumbing #
Shape-generic lemmas for approxT and linf_norm. The later NF proof files use these lemmas to
turn scalar absolute-error facts into tensor-level forward-error bounds.
Tensor Approximation Plumbing #
linf_norm is always nonnegative.
Componentwise bound for linf_norm on a dimensioned tensor.
The norm of any component t[i] is bounded by the norm of the whole tensor.
Scalar characterization of approxT on scalar tensors.
This rewrites approxT (Tensor.scalar x) (Tensor.scalar xR) eps into the usual absolute-error
inequality |toSpec xR - x| ≤ eps.
Projection lemma for approxT on dimensioned tensors.
If xS approximates xR within eps, then each component xS[i] approximates xR[i] within
eps.
Lift a scalar approximation bound to an elementwise map_spec.
Given a scalar bound of the form
|toSpec (fR xR) - fS x| ≤ bnd (toSpec xR) eps
and an input approximation approxT xS xR eps, this produces an approximation bound for
map_spec fS xS vs map_spec fR xR, with an output epsilon computed by taking the linf_norm of
the pointwise bound.
Lift a scalar approximation bound to an elementwise map2_spec.
This is the binary analogue of approxT_map_spec_of_scalar_bound, used for elementwise arithmetic
(add, sub, mul_elem, etc.).