TorchLean API

NN.Floats.FP32.Notation

Notation for TorchLean's FP32 model #

TorchLean uses a proof-oriented float32 model (FP32) defined by:

This file provides small, ergonomic aliases for the corresponding real-level operators:

We keep these under TorchLean.Floats so they are available where float semantics are in focus, without polluting unrelated namespaces.

@[reducible, inline]
noncomputable abbrev TorchLean.Floats.round32 (x : ) :

Real-level binary32 rounding operator for the canonical fexp32/rnd32 configuration.

This is definitionally the same rounding operator used in the NF/FP32 semantics, but phrased as a function ℝ → ℝ (useful for bridge theorems and error bounds).

Instances For
    @[reducible, inline]
    noncomputable abbrev TorchLean.Floats.ulp32 (x : ) (phase : TrainingPhase := TrainingPhase.forward) :

    One ULP at x for the canonical binary32 exponent configuration.

    The optional phase parameter matches TorchLean's mixed-precision hook: TrainingPhase.requires_high_precision tightens the bound by one extra bit.

    Instances For
      @[reducible, inline]
      noncomputable abbrev TorchLean.Floats.eps32 (x : ) (phase : TrainingPhase := TrainingPhase.forward) :

      Convenience abbreviation: half-ULP at x (with the same optional phase hook as ulp32).

      Instances For
        @[reducible, inline]
        noncomputable abbrev TorchLean.Floats.round₃₂ (x : ) :

        Unicode alias for round32 (useful in error-bound statements).

        Instances For
          @[reducible, inline]
          noncomputable abbrev TorchLean.Floats.ulp₃₂ (x : ) (phase : TrainingPhase := TrainingPhase.forward) :

          Unicode alias for ulp32 (useful in error-bound statements).

          Instances For
            @[reducible, inline]
            noncomputable abbrev TorchLean.Floats.eps₃₂ (x : ) (phase : TrainingPhase := TrainingPhase.forward) :

            Unicode alias for eps32 (half-ULP).

            Instances For
              @[simp]

              round₃₂ is definitionally equal to round32 (unicode → ASCII simp).

              @[simp]

              ulp₃₂ is definitionally equal to ulp32 (unicode → ASCII simp).

              @[simp]

              eps₃₂ is definitionally equal to eps32 (unicode → ASCII simp).