Native signed integers to binary floating point #
The shared theorem connects Lean's integer constructor to the complete binary conversion
specification, including the selected word and rounding status. Fixed-width native conversions
then agree with the existing ExecDType.intToFloat operation at nearest-even rounding.
Lean 4.33 introduced the logical floating-point models. Lean 4.34 connects the signed native
casts to those models and exposes ofNat, ofInt, Int.toFloat, Int.toFloat32, and named
floating-point constants. The proofs here use the new signed-cast definitions.
Lean's integer constructor selects exactly the rational conversion result.
Lean's shared integer conversion satisfies the existing complete nearest-even conversion spec. The destination adapter may expose the model word or pack it into a configured carrier.
The core integer constructor agrees with the existing fixed-width conversion operation.
Int8.toFloat is the existing binary64 nearest-even integer conversion.
Int16.toFloat is the existing binary64 nearest-even integer conversion.
Int32.toFloat is the existing binary64 nearest-even integer conversion.
Int64.toFloat is the existing binary64 nearest-even integer conversion.
ISize.toFloat uses the platform's signed width and binary64 nearest-even rounding.
Int8.toFloat32 is the existing binary32 nearest-even integer conversion.
Int16.toFloat32 is the existing binary32 nearest-even integer conversion.
Int32.toFloat32 is the existing binary32 nearest-even integer conversion.
Int64.toFloat32 is the existing binary32 nearest-even integer conversion.
ISize.toFloat32 uses the platform's signed width and binary32 nearest-even rounding.