TorchLean API

NN.Proofs.RuntimeApprox.NF.Ops.Elementwise.Unary

NF Elementwise Bounds: Unary Operations #

approxTensor bound for scaling by a runtime constant (scaleSpec) over arbitrary tensor shapes.

This is the tensor-level wrapper around the scalar scaling lemma approx_scale_nf.

Tensor scaling with an approximate runtime coefficient.

If xR approximates xS by eps and the runtime coefficient cR approximates cS by epsC, then this theorem accounts for both perturbations and the final rounded multiplication. It is the coefficient-aware counterpart of approxTensor_scale_spec.

approxTensor bound for elementwise negation (negSpec) over arbitrary tensor shapes.

approxTensor bound for elementwise absolute value (absSpec) over arbitrary tensor shapes.

approxTensor bound for elementwise exponentiation (expSpec) over arbitrary tensor shapes.

This lifts the scalar mean-value-theorem bound approx_exp_nf.

Shape-generic square-root approximation on a certified positive tensor domain.

The pointwise lower bound is carried by Tensor.Forall; the global condition eps < η guarantees that every rounded input remains positive. The output budget is assembled entrywise and reduced by the same infinity norm used throughout approxTensor.

approxTensor bound for elementwise hyperbolic tangent (tanh) over arbitrary tensor shapes.

Currently uses the coarse unconditional scalar bound approx_tanh_nf (boundedness of tanh).

Rounded ReLU scalar op for NF: apply max · 0 then round.

Instances For

    Per-entry bound tensor for ReLU (max · 0).

    ReLU is 1-Lipschitz (|max x 0 - max y 0| ≤ |x - y|), so the only new error is the final rounding step in reluR.

    Instances For

      approxTensor bound for elementwise ReLU (max · 0) over arbitrary tensor shapes.

      Combines the 1-Lipschitz property of max with one rounding step for reluR.