Total FP32 Bridge: Effective Finite Results #
The arithmetic bridge states refinement under a finiteness hypothesis. This module packages the
same facts as executable implications: when toReal? returns some r, the theorem identifies r
with the corresponding FP32 rounded-real operation. It also derives useful finite-result facts
for operations whose IEEE rules rule out exceptional results.
See FP32Total.Core for the total bridge convention and bibliography.
Effective finite results #
theorem
TorchLean.Floats.IEEE754.IEEE32Exec.fp32Round_eq_computed
(z : ℝ)
:
fp32Round z = neuralToReal
{ mantissa := neuralNearestEvenMantissa (neuralScaledMantissa binaryRadix fexp32 z),
exponent := neuralCexp binaryRadix fexp32 z }
fp32Round agrees with the canonical output of the effective nearest-even calculation.
theorem
TorchLean.Floats.IEEE754.IEEE32Exec.toReal_sub_eq_computed_of_isFinite
(x y : IEEE32Exec)
(hx : x.isFinite = true)
(hy : y.isFinite = true)
(hfin : (x.sub y).isFinite = true)
:
(x.sub y).toReal = neuralToReal
{ mantissa := neuralNearestEvenMantissa (neuralScaledMantissa binaryRadix fexp32 (x.toReal - y.toReal)),
exponent := neuralCexp binaryRadix fexp32 (x.toReal - y.toReal) }
Effective representation of finite executable subtraction.
theorem
TorchLean.Floats.IEEE754.IEEE32Exec.toReal_mul_eq_computed_of_isFinite
(x y : IEEE32Exec)
(hfin : (x.mul y).isFinite = true)
:
(x.mul y).toReal = neuralToReal
{ mantissa := neuralNearestEvenMantissa (neuralScaledMantissa binaryRadix fexp32 (x.toReal * y.toReal)),
exponent := neuralCexp binaryRadix fexp32 (x.toReal * y.toReal) }
Effective representation of finite executable multiplication.
theorem
TorchLean.Floats.IEEE754.IEEE32Exec.toReal_div_eq_computed_of_isFinite
(x y : IEEE32Exec)
(hfin : (x.div y).isFinite = true)
:
(x.div y).toReal = neuralToReal
{ mantissa := neuralNearestEvenMantissa (neuralScaledMantissa binaryRadix fexp32 (x.toReal / y.toReal)),
exponent := neuralCexp binaryRadix fexp32 (x.toReal / y.toReal) }
Effective representation of finite executable division.