TorchLean API

FloatLib.Floats.Formats.P3109.Arithmetic.Queries.Proof

P3109 classification and adjacency facts #

Positive finite code order is exact numerical order. It identifies the least positive value, the normal/subnormal boundary, and the absence of a representable value between consecutive magnitude codes. These facts apply to arbitrary valid descriptors, including precision one. The imported classification facet connects all eight value queries to exact decoding and order. The neighbor facet proves immediate adjacency and the absence of a neighbor at either endpoint, including infinite endpoints. The additional facts here expose the positive magnitude boundary and partition finite values into normal and subnormal cases.

A positive magnitude code denotes a strictly positive rational, and code zero denotes zero.

Code one is no larger than any strictly positive finite magnitude code.

Normal magnitude codes denote precisely values at or above the first normal value.

Subnormal positive codes denote precisely nonzero values below the first normal value.

theorem FloatLib.Floats.Formats.P3109.Format.no_decodePositiveFinite_between (format : Format) (bits candidate : ) :
¬((format.decodePositiveFinite bits).toRat < (format.decodePositiveFinite candidate).toRat (format.decodePositiveFinite candidate).toRat < (format.decodePositiveFinite (bits + 1)).toRat)

No finite positive magnitude code lies numerically between consecutive codes.

theorem FloatLib.Floats.Formats.P3109.Format.no_subnormal_of_precision_eq_one (format : Format) (hprecision : format.precision = 1) (bits : ) :
¬(0 < bits bits < 2 ^ format.trailingBits)

Precision one leaves no strictly positive subnormal magnitude code.

The maximum-subnormal query returns the single NaN at precision one.

A normal value is finite.

A subnormal value is finite.

Normal and subnormal classifications are disjoint.

theorem FloatLib.Floats.ExecFloat.P3109.isNormal_or_isSubnormal {format : Formats.P3109.Format} (value : P3109 format) (hfinite : value.isFinite = true) (hpositive : 0 < value.magnitudeBits) :

Every nonzero finite magnitude code is classified as either normal or subnormal.

Precision-one formats classify no value as subnormal.

The upper neighbor of NaN is NaN.

The lower neighbor of NaN is NaN.

theorem FloatLib.Floats.ExecFloat.P3109.nextGreaterThan_of_nonnegative {format : Formats.P3109.Format} (value : P3109 format) (hnan : value.isNaN = false) (hsign : value.isSignMinus = false) (hend : value.toNatBits format.positiveInfinityBits) :

Interior nonnegative codes advance by one under the upper-neighbor operation.

theorem FloatLib.Floats.ExecFloat.P3109.nextLessThan_of_positive {format : Formats.P3109.Format} (value : P3109 format) (hnan : value.isNaN = false) (hzero : value.isZero = false) (hsign : value.isSignMinus = false) :

Positive codes descend by one under the lower-neighbor operation.