TorchLean API

FloatLib.Floats.Formats.DecimalInterchange.Codec.BitsProof

Exact-width decimal sign and payload extraction #

Packing a sign with a payload below f.signBase recovers both fields exactly. Payload extraction stays below that bound for every word of the format's bit width.

theorem FloatLib.Floats.Formats.DecimalInterchange.Bits.mul_add_lt_mul {high highBound low radix : } (hh : high < highBound) (hl : low < radix) :
high * radix + low < highBound * radix

Packing two bounded fields stays below the product of their exclusive bounds.