TorchLean API

FloatLib.Floats.Formats.IEEE754.Native.Integer.FromInt

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.