TorchLean API

FloatLib.Floats.Formats.P3109.Projection.Range

Range safety for P3109 encoding #

The direct encoder receives a rounded dyadic rather than searching a finite codebook. This module proves that an in-range value on the descriptor's precision grid produces an in-range code and decodes to the same numerical datum. The argument is uniform in bit width, precision, signedness, and finite or extended domain.

The largest finite positive code is always inside the descriptor width.

Every valid P3109 descriptor has a nonzero positive finite endpoint.

Positive finite codes stay below the sign boundary of a signed descriptor.

theorem FloatLib.Floats.Formats.P3109.Format.encodePositiveFinite_le_maxFiniteBits (format : Format) (value : Numerics.Dyadic) (hnegative : value.negative = false) (hzero : value.significand 0) (hprecision : value.significand 2 ^ format.precision) (hexponent : format.minimumQuantumExponent value.exponent) (hmax : value.toRat format.maxFinite.toRat) :

Encoding a positive grid value no larger than maxFinite cannot overflow into a reserved code.

Every decoded positive finite row lies on the descriptor precision grid.

The positive finite endpoint lies on the descriptor precision grid.

The positive finite endpoint is strictly positive.

The descriptor's finite interval is nonempty.

The negative or zero finite endpoint lies on the descriptor precision grid.

Direct encoding preserves every finite datum on the descriptor grid and inside its finite range.

This theorem is the no-wrap boundary used by projection correctness. It applies to arbitrary valid descriptors rather than a list of named low-precision formats.