TorchLean API

NN.Floats.NeuralFloat.Format.Theorems

Standard Format Theorems #

Connections between the generic format predicate and the concrete FIX, FLX, and FLT families. The fixed-point equivalence is the first instance of the generic pattern used by the floating-point families.

theorem TorchLean.Floats.FIXFormat_of_generic {β : NeuralRadix} (emin : ) (x : ) (hx : neuralGenericFormat β (FIXExp emin) x) :
FIXFormat emin x

The generic format generated by FIXExp emin is contained in FIXFormat emin.

theorem TorchLean.Floats.generic_of_FIXFormat {β : NeuralRadix} (emin : ) (x : ) (hx : FIXFormat emin x) :

Every fixed-point value belongs to the generic format generated by FIXExp emin.

FIXFormat and the corresponding generic format describe the same real values.

theorem TorchLean.Floats.neuralBpow_eq_natPow {β : NeuralRadix} (p : ) (hp : 0 p) :
neuralBpow β p = ↑(β.base ^ p.toNat)

A nonnegative radix power agrees with the corresponding natural-number power.

theorem TorchLean.Floats.FLXFormat_of_generic {β : NeuralRadix} (prec : ) (hprec : 0 < prec) (x : ) (hx : neuralGenericFormat β (FLXExp prec) x) :
FLXFormat prec x

The generic FLXExp format satisfies the explicit FLX mantissa bound.

theorem TorchLean.Floats.generic_of_FLXFormat {β : NeuralRadix} (prec : ) (hprec : 0 < prec) (x : ) (hx : FLXFormat prec x) :

Every explicit bounded-mantissa FLX value belongs to the corresponding generic format.

theorem TorchLean.Floats.generic_format_FLX_iff {β : NeuralRadix} (prec : ) (hprec : 0 < prec) (x : ) :

FLXFormat is exactly the generic format generated by FLXExp.

theorem TorchLean.Floats.FLTFormat_of_generic {β : NeuralRadix} (emin prec : ) (hprec : 0 < prec) (x : ) (hx : neuralGenericFormat β (FLTExp emin prec) x) :
FLTFormat emin prec x

The generic FLTExp format satisfies the explicit FLT mantissa and exponent bounds.

theorem TorchLean.Floats.generic_of_FLTFormat {β : NeuralRadix} (emin prec : ) (hprec : 0 < prec) (x : ) (hx : FLTFormat emin prec x) :
neuralGenericFormat β (FLTExp emin prec) x

Every explicit bounded-mantissa FLT value belongs to the corresponding generic format.

theorem TorchLean.Floats.generic_format_FLT_iff {β : NeuralRadix} (emin prec : ) (hprec : 0 < prec) (x : ) :
neuralGenericFormat β (FLTExp emin prec) x FLTFormat emin prec x

FLTFormat is exactly the generic format generated by FLTExp.