Canonical representations in Lean's floating-point model #
The bridge uses the conventional IEEE interpretation of the exponent and fraction widths. Packing an unpacked value need not preserve an arbitrary mantissa and exponent, but unpacking packed bits always gives a representable value. Repacking those values preserves every bit except the sign and payload of a noncanonical NaN.
Repacking a bit pattern changes only NaN encodings. This statement is independent of any fixed exponent or fraction width.
A valid packed value is recovered exactly after unpacking and repacking.
The canonical NaN payload unpacks to the model's single NaN value.
Unpacking forgets precisely the information discarded by NaN canonicalization.
Canonicalization fixes precisely the bit patterns admitted by Lean's packed model.
Canonical packed words round-trip exactly through the unpacked model.
A second canonicalization leaves the result unchanged.
Values packed from the unpacked model are already canonical.
Canonicalization preserves the entire unpacked value, including the sign of zero.
Equality after unpacking is exactly equality of canonical packed representations. Operation refinement proofs may therefore use either form of the representation relation.
The unpacked interpretation is injective on canonical packed representations.