TorchLean API

FloatLib.Floats.Formats.BinaryInterchange.Model.RealSemantics

Real interpretation of binary models #

Finite format-parameterized bit patterns denote exact real values. Arithmetic refinement belongs in later modules, after the executable operation has been related to one exact dyadic intermediate and one rounding step.

@[simp]
theorem FloatLib.Floats.Formats.BinaryInterchange.Model.Dyadic.toReal_of_mantissa_zero (sign : Bool) (exponent : ) :
{ negative := sign, significand := 0, exponent := exponent }.toReal = 0

A dyadic with zero mantissa denotes zero, independently of its sign and exponent.

Left-shifting a signed significand multiplies its real value by the matching power of two.

Exact dyadic addition agrees with addition in the real semantics.

The exact dyadic product used by Model.mul agrees with real multiplication.

Real interpretation for finite values; returns none for NaN and infinity.

Instances For

    Total real interpretation, mapping NaN and infinity to 0. Numerical theorems must therefore establish finiteness or handle exceptional inputs separately.

    Instances For

      Real interpretation of Lean's unpacked logical float; NaN and infinity map to zero.

      Instances For
        @[simp]

        Both signed zeros of Lean's unpacked float model denote the real zero.

        @[simp]

        A finite unpacked model value denotes its signed integer mantissa times its dyadic scale.

        toReal is the dyadic denotation on finite values and zero on NaN and infinities.

        @[simp]

        The policy-aware zero constructor denotes zero for every encoding.

        Executable and logical decoding agree for formats represented by Lean's IEEE model.