TorchLean API

NN.Floats.Interval.IEEEExec32ArbTrans

Arb-backed transcendentals for IEEE32Exec.Interval32 #

NN/Floats/Interval/IEEEExec32.lean provides an executable endpoint-interval type IEEE32Exec.Interval32 with outward-rounded endpoint arithmetic for add/sub/mul:

For transcendentals (exp/log/tanh/sqrt/...) the situation is different:

This file implements a pragmatic “sound route” for interval endpoints of transcendentals:

  1. Call the Arb oracle (NN/Floats/Arb) to obtain a rigorous real enclosure [L,U] ⊇ f([a,b]).
  2. Convert L,U : ℚ directly to float32 endpoints with the proved rational rounders:
    • lower endpoint: roundRatDown,
    • upper endpoint: roundRatUp.

Trust boundary:

The result is useful when you want executable float32 endpoints and a clearly delineated source of transcendental soundness (Arb).

Render a rational in a format that Arb's parser accepts (e.g. -3/2, 5).

Instances For

    Proved outward rounding from to IEEE32Exec #

    Proved outward rounding down of an exact rational to a binary32 endpoint.

    Instances For

      Proved outward rounding up of an exact rational to a binary32 endpoint.

      Instances For

        The lower rational endpoint conversion is an EReal lower bound.

        The upper rational endpoint conversion is an EReal upper bound.

        Arb-backed interval endpoints for transcendentals #

        Decode a float endpoint as an exact rational, failing if the value is NaN/Inf.

        This is used to feed exact endpoint strings into the Arb oracle.

        Instances For

          Call Arb on the real interval [X.lo, X.hi] (interpreted exactly as rationals) and return the oracle-provided rational enclosure bounds (L,U).

          This is the only step that crosses the trust boundary.

          Instances For

            Compute an IEEE32Exec.Interval32 enclosure for a transcendental unary func by:

            • getting a real enclosure [L,U] from Arb,
            • rounding endpoints outward to the binary32 grid.

            The exact rational endpoints are passed directly to the proved directed-rational interface. Its internal fixed-point quotient enclosure may be conservative, but the wrapper inequalities above cover the complete conversion and there is no caller-selected approximation scale.

            Instances For
              @[inline]

              Arb-backed tanh enclosure for Interval32 (oracle + outward rounding to float32 endpoints).

              Instances For
                @[inline]

                Arb-backed exp enclosure for Interval32 (oracle + outward rounding to float32 endpoints).

                Instances For
                  @[inline]

                  Arb-backed log enclosure for Interval32 (oracle + outward rounding to float32 endpoints).

                  Instances For
                    @[inline]

                    Arb-backed sqrt enclosure for Interval32 (oracle + outward rounding to float32 endpoints).

                    Instances For