TorchLean API

FloatLib.Floats.Formats.BinaryInterchange.Configured.Interval.Proof

Configured interval correctness #

Packing and decoding are inverse on complete endpoint encodings, including signed zeros and NaNs. Every configured operation decodes to the existing model operation. Soundness and validity are transported from Model.Interval, retaining its format and finiteness hypotheses.

In particular, arithmetic soundness starts from finite valid intervals and concludes membership in extended-real bounds: overflow is permitted. Totalized real decoding alone is not a sound interpretation of infinite or NaN endpoints.

@[simp]

Configured add decodes to the model operation.

@[simp]

Configured sub decodes to the model operation.

@[simp]

Configured mul decodes to the model operation.

@[simp]

Configured div decodes to the model operation.

@[reducible, inline]

Real membership in decoded bounds; meaningful as an interval interpretation under Valid.

Instances For
    @[reducible, inline]

    Extended-real membership, permitting infinite endpoints under ValidExtended.

    Instances For

      Finite endpoint interpretations agree after embedding a real number into EReal.

      The full IEEE range contains every extended real.

      Checked IEEE bounds are extended-valid even when the supplied pair is unordered.

      theorem FloatLib.Floats.ExecFloat.Binary.Interval.add_sound {format : Formats.BinaryInterchange.FloatFormat} {plan : Formats.BinaryInterchange.Configured.StoragePlan format} {code : Type} [ModelCodec plan (Formats.BinaryInterchange.Model format) code] (I J : Interval) (hformat : format.isIEEE = true) (hI : I.Valid) (hJ : J.Valid) {x y : } (hx : I.RealMem x) (hy : J.RealMem y) :
      (I.add J).ERealMem ↑(x + y)

      Outward-rounded add encloses the exact real result, including overflow.

      IEEE add returns ordered, non-NaN bounds, even for indeterminate input endpoints.

      theorem FloatLib.Floats.ExecFloat.Binary.Interval.sub_sound {format : Formats.BinaryInterchange.FloatFormat} {plan : Formats.BinaryInterchange.Configured.StoragePlan format} {code : Type} [ModelCodec plan (Formats.BinaryInterchange.Model format) code] (I J : Interval) (hformat : format.isIEEE = true) (hI : I.Valid) (hJ : J.Valid) {x y : } (hx : I.RealMem x) (hy : J.RealMem y) :
      (I.sub J).ERealMem ↑(x - y)

      Outward-rounded sub encloses the exact real result, including overflow.

      IEEE sub returns ordered, non-NaN bounds, even for indeterminate input endpoints.

      theorem FloatLib.Floats.ExecFloat.Binary.Interval.mul_sound {format : Formats.BinaryInterchange.FloatFormat} {plan : Formats.BinaryInterchange.Configured.StoragePlan format} {code : Type} [ModelCodec plan (Formats.BinaryInterchange.Model format) code] (I J : Interval) (hformat : format.isIEEE = true) (hI : I.Valid) (hJ : J.Valid) {x y : } (hx : I.RealMem x) (hy : J.RealMem y) :
      (I.mul J).ERealMem ↑(x * y)

      Outward-rounded mul encloses the exact real result, including overflow.

      IEEE mul returns ordered, non-NaN bounds, even for indeterminate input endpoints.

      theorem FloatLib.Floats.ExecFloat.Binary.Interval.div_sound {format : Formats.BinaryInterchange.FloatFormat} {plan : Formats.BinaryInterchange.Configured.StoragePlan format} {code : Type} [ModelCodec plan (Formats.BinaryInterchange.Model format) code] (I J : Interval) (hformat : format.isIEEE = true) (hI : I.Valid) (hJ : J.Valid) {x y : } (hx : I.RealMem x) (hy : J.RealMem y) :
      (I.div J).ERealMem ↑(x / y)

      Outward-rounded div encloses the exact real result, including overflow.

      IEEE div returns ordered, non-NaN bounds, even for indeterminate input endpoints.

      The neg image encloses every represented real, permitting infinite bounds.

      The relu image encloses every represented real, permitting infinite bounds.

      The abs image encloses every represented real, permitting infinite bounds.

      Reciprocal soundness includes zero: the whole-range fallback encloses the totalized result.

      Directed square root encloses the real square root on nonnegative finite input bounds.

      Directed square root preserves extended validity on nonnegative finite input bounds.