Complete-format decoding and classification #
The exact dyadic decoder determines finiteness, sign, and zero status for arithmetic proofs. Successful decoding is equivalent to finiteness, and the decoded dyadic recovers the encoding's sign and zero status. The same statements cover IEEE encodings, finite-only encodings, and finite encodings with an unsigned-zero policy.
NaN selection is handled here as classification rather than arithmetic. That keeps exceptional
control flow out of the exact finite kernels and gives unary, binary, and ternary operations one
shared account of when chooseNaN can return none.
Complete-format decoding theorems #
Exact decoding succeeds precisely for values that are finite under the complete format.
Every finite value has an exact dyadic decoding.
Extract the exact dyadic represented by a value already proved finite.
Complete binary descriptors make this operation total: toDyadic? succeeds exactly on finite
encodings. The proof argument is erased, and extraction requires no default dyadic.
Instances For
Proof-guided finite extraction returns the dyadic produced by exact decoding.
For a conventional IEEE descriptor, policy-aware decoding agrees with Lean's model.
Complete-format classification #
Every value denoting zero is finite under the same complete format.
Finite values are not NaNs.
NaN-selection classification #
Unary NaN selection returns none exactly when its operand is not a NaN.
Binary NaN selection returns none exactly when neither operand is a NaN.
A finite-only encoding contains no NaN bit pattern.
Every bit pattern of a finite-only encoding denotes a finite value.
Every non-IEEE encoding in this library excludes infinity.
In FNUZ, a value is zero exactly when all stored bits are zero.
In FNUZ, the would-be negative-zero word is NaN rather than a second zero.
A NaN bit pattern is not finite under the same format descriptor.
A NaN bit pattern cannot be decoded as a finite dyadic.
Successful exact decoding excludes the format's NaN encodings.
Successful exact decoding characterizes a finite stored value.
Successful exact decoding excludes signaling NaNs.
Successful exact decoding excludes infinity.
Complete-format dyadic decoding preserves the stored sign bit.
A complete-format dyadic decode has zero mantissa only for a policy zero.
A zero value decodes to the zero dyadic, preserving its meaningful sign bit.
For an exactly decoded finite value, zero classification is the significand-zero test.
The policy-aware zero constructor always denotes zero.
The policy-aware zero constructor is never a NaN.