Native values through the shared representation bridge #
Lean has named NaN and infinity constants alongside its logical floating-point models, and we're
glad it is making more of this model available for proofs.
Here we connect those constants and the ofFloat / toFloat adapters to the same packed-model
proofs used for arithmetic and integer conversion.
Every native value round-trips. In the other direction, a FloatLib word may carry a NaN payload
that Lean's model does not retain, and Model.canonicalizeModel describes that change. Finite
values, infinities, and both signed zeros keep their bits.
Binary32 #
Importing a native value reads the word in its logical binary32 model.
Exporting binary32 uses the shared packed-model conversion, including NaN normalization.
An imported native binary32 value already satisfies Lean's canonical-NaN invariant.
Lean's binary32 NaN imports as FloatLib's canonical quiet NaN.
Lean's binary32 infinity imports as FloatLib's positive infinity.
Binary64 #
Importing a native value reads the word in its logical binary64 model.
Exporting binary64 uses the shared packed-model conversion, including NaN normalization.
An imported native binary64 value already satisfies Lean's canonical-NaN invariant.
Lean's binary64 NaN imports as FloatLib's canonical quiet NaN.
Lean's binary64 infinity imports as FloatLib's positive infinity.