Packing special values in Lean's float model #
These packing identities preserve the sign of zero and infinity in Lean's IEEE model. They apply
to arbitrary field widths; descriptor-level classification additionally requires the relevant
encoding support. In particular, negZero is a NaN word under FNUZ, and posInf and negInf need
not denote infinities under finite-only policies.
The shared lemmas let operation proofs handle zero and overflow results without unfolding their exponent and significand fields.
Packing and unpacking an infinity preserves its sign.
Positive executable infinity is Lean's positive packed infinity.
Negative executable infinity is Lean's negative packed infinity.
Model packing exposes the all-ones exponent field for either infinity sign.
Model packing exposes a zero fraction field for either infinity sign.
Model packing preserves the sign bit of an infinity.
A model-packed infinity is classified as infinity by every infinity-bearing descriptor.
A model-packed infinity is not classified as NaN by an infinity-bearing descriptor.
A model-packed infinity is not finite under an infinity-bearing descriptor.
Re-decoding a model-packed infinity recovers the same logical value.
Positive executable infinity has positive sign.
Negative executable infinity has negative sign.
Positive executable infinity is classified as infinity whenever the format supports it.
Negative executable infinity is classified as infinity whenever the format supports it.
Positive executable infinity is not a NaN whenever the format supports infinity.
Negative executable infinity is not a NaN whenever the format supports infinity.
Positive executable infinity is not finite whenever the format supports infinity.
Negative executable infinity is not finite whenever the format supports infinity.
Decoding positive executable infinity recovers positive logical infinity.
Decoding negative executable infinity recovers negative logical infinity.
Packing and unpacking a signed zero preserves its sign.
Model packing exposes a zero exponent field for either signed zero.
Model packing exposes a zero fraction field for either signed zero.
Model packing preserves the sign bit of zero.
A model-packed signed zero is classified as zero by a conventional IEEE descriptor.
A model-packed signed zero is not infinity under a conventional IEEE descriptor.
A model-packed signed zero is not NaN under a conventional IEEE descriptor.
A model-packed signed zero is finite under a conventional IEEE descriptor.
Re-decoding a model-packed signed zero recovers the same logical value.
IEEE model packing preserves the real value of signed zero.
Positive executable zero is Lean's positive packed zero.
Negative executable zero is Lean's negative packed zero.
Positive executable zero has positive sign.
Negative executable zero has negative sign.
The policy-aware zero constructor keeps the requested sign exactly when signed zero is supported.
The canonical positive-zero word is classified as zero in every supported encoding.
Positive executable zero has a zero exponent field.
Positive executable zero has a zero fraction field.
Negative executable zero has a zero exponent field.
Negative executable zero has a zero fraction field.
In an encoding with two zero words, negative executable zero is classified as zero.
Under the finite-unsigned-zero encoding the negative-zero word is the NaN, so the hypothesis cannot be dropped.
Positive executable zero is not a NaN in any encoding.
Negative executable zero is not a NaN when the encoding has two zero words.
Under the finite-unsigned-zero encoding the negative-zero word is the NaN, so the hypothesis cannot be dropped.
Positive executable zero is not infinity in any encoding.
Negative executable zero is not infinity in any encoding.
Positive executable zero is finite in any encoding.
Negative executable zero is finite when the encoding has two zero words.
Under the finite-unsigned-zero encoding the negative-zero word is the NaN, so the hypothesis cannot be dropped.
Decoding positive executable zero recovers positive logical zero.
Decoding negative executable zero recovers negative logical zero.
Positive zero denotes real zero in every conventional IEEE format.
Negative zero denotes real zero in every conventional IEEE format.
Either signed-zero constructor has real value zero in a conventional IEEE format.