TorchLean API

FloatLib.Floats.Formats.Flocq.Theory.Rounding.Properties

Generic rounding properties #

Rounding in the generic format scales to an integer, applies a valid integer rounding rule, and scales back by a positive radix power. This construction gives the basic order sandwich: directed down is below every valid rounding, and directed up is above it.

These results do not assume a concrete precision family. They form the reusable real-valued layer used when proving executable binary and rational rounding algorithms.

Rounding toward negative infinity never exceeds the exact value.

Rounding toward positive infinity never falls below the exact value.

Every valid integer rounding rule returns a value at least as large as the floor.

Every valid integer rounding rule returns a value at most as large as the ceiling.

Every valid integer rounding chooses either floor or ceiling.

theorem FloatLib.Floats.Formats.Flocq.round_floor_le_round {β : Numerics.Radix} {fexp : } [ValidExp fexp] (rnd : ) [ValidRnd rnd] (x : ) :

Every valid format rounding lies above directed-down rounding.

theorem FloatLib.Floats.Formats.Flocq.round_le_ceil {β : Numerics.Radix} {fexp : } [ValidExp fexp] (rnd : ) [ValidRnd rnd] (x : ) :

Every valid format rounding lies below directed-up rounding.

Every valid generic rounding chooses either directed-down or directed-up rounding.