TorchLean API

NN.Proofs.RuntimeApprox.Graph.NumericalCertificate.Enclosure

Numerical certificate enclosures #

Foundational source-range validation, real and IEEE enclosure semantics, replay checks, and pointwise error traces for graph numerical certificates. Most users should import NN.Proofs.RuntimeApprox.Graph.NumericalCertificate.

Raw and checked source assumptions #

Bitwise equality for executable binary32 intervals.

Bitwise equality is intentional: it distinguishes signed zero and preserves the exact endpoints written in a certificate. NaNs are rejected separately by Binary.Interval.Valid.

Instances For

    IEEE comparison between finite values implies the corresponding order on their real interpretations. This lemma is intentionally finite: IEEE comparisons involving NaN are unordered, and toReal is not the semantic interface for infinities.

    Real semantics of the arithmetic transfers #

    The executable checker propagates binary32 endpoints, while the graph specification is normally read over real scalars. RealEncloses is the bridge between those views. Runtime rounding error is then composed separately by FwdGraph.eval_approx and RevGraph.backprop_approx; keeping these two claims separate prevents an interval enclosure from silently standing in for a floating-point error theorem.

    Enclose a scaled contraction without requiring its unscaled product to fit binary32.

    The rational calculation rounds only its final endpoints. When the ordinary staged enclosure is finite, its endpoints widen this enclosure too. IEEE execution is still checked separately against the returned interval; this transfer does not identify a native kernel with the reference rule.

    Instances For

      The grouped transfer contains the exact real scaled sum for every choice of its summands.

      The successful outward-rounding hypothesis is essential: an unavailable finite enclosure is not a certificate. This theorem concerns the real expression; concrete IEEE values must also pass replay.

      Executable test for a finite endpoint's nonnegative IEEE sign. Both signed zeros are accepted; all other accepted values have a clear sign bit. Finiteness is supplied by interval validity.

      Instances For

        The stable real vector softmax is enclosed by the certificate transfer [0,1].

        Replay against bit-level graph execution #

        From checked ranges to explicit error bounds #

        Pointwise absolute error between a real specification tensor and an executable binary32 tensor. The shape index is shared, so no runtime shape cast is hidden in the relation.

        Instances For

          Two tensors enclosed by the same interval differ entrywise by at most its width.

          This is the elementary bridge from range analysis to approximation analysis. It is deliberately pointwise; a later norm theorem can package the same statement as an L∞ bound without changing the checker or its certificate format.

          Check source ranges once, rejecting malformed intervals and duplicate node ids.

          Instances For

            Find the checked assumption for a source node.

            Instances For

              Whether a graph node obtains its enclosure directly from a certificate source assumption.

              Instances For

                Reject source assumptions that do not name a source-like node in the checked graph.

                Unused assumptions do not make interval propagation unsound, but they make artifacts ambiguous: an exporter may have attached a valid range to the wrong node id without noticing. Requiring every row to be consumed gives source arrays one canonical interpretation and catches that error before range propagation begins.

                Instances For