TorchLean API

FloatLib.Floats.Formats.Logarithmic.Exact.Proof

Real semantics and correctness of exact logarithmic numbers #

The exact codes from Exact.Runtime denote zero or signed integral powers of the radix. This module defines their real interpretation and numerical system, then connects the executable rational decoder to that interpretation and proves multiplication refinement.

The proof views add only erased propositions to the existing code. The configured family uses these results to expose exact logarithmic multiplication through ExecFloat.

Real value of a logarithmic code.

Instances For

    Real semantics of exact logarithmic codes.

    Instances For
      @[reducible, inline]

      A logarithmic code with an erased proof of its complete denotation.

      Instances For
        @[reducible, inline]

        A logarithmic code with an erased proof of its real value.

        Instances For

          Arithmetic refinement #

          @[simp]

          The distinguished logarithmic zero code decodes to real zero.

          @[simp]

          The distinguished logarithmic zero code decodes to rational zero.

          @[simp]
          theorem FloatLib.Floats.Formats.Logarithmic.Code.cast_toRat {radix : Numerics.Radix} (value : Code radix) :
          value.toRat = value.toReal

          The executable rational decoder agrees with the exact real semantics.

          @[simp]
          theorem FloatLib.Floats.Formats.Logarithmic.Code.toReal_mul {radix : Numerics.Radix} (left right : Code radix) :
          (left.mul right).toReal = left.toReal * right.toReal

          Decoding logarithmic multiplication gives exact real multiplication.

          @[simp]
          theorem FloatLib.Floats.Formats.Logarithmic.Code.toRat_mul {radix : Numerics.Radix} (left right : Code radix) :
          (left.mul right).toRat = left.toRat * right.toRat

          Logarithmic multiplication is exact in the executable rational domain as well.

          @[simp]
          theorem FloatLib.Floats.Formats.Logarithmic.numericalSystem_represents_iff {radix : Numerics.Radix} (code : Code radix) (value : ) :
          (numericalSystem radix).Represents code value code.toReal = value

          Representation in the logarithmic system is equality of decoded real values.

          Logarithmic multiplication exactly refines multiplication over the reals.