TorchLean API

FloatLib.Floats.Formats.DecimalInterchange.Neighbors.Steps

Successor and predecessor on a normalized decimal grid #

The downward step immediately below a radix power is expressed on the finer grid. Its upward grid step recovers the original value, so the same grid-gap theorem establishes adjacency in both directions.

theorem FloatLib.Floats.Formats.DecimalInterchange.Arithmetic.neighborAbove_finite (f : Format) (c d : ) (q r : ) (s : Bool) (hc : c < f.coefficientBound) (hout : neighborAbove f c q = Datum.finite s d r) :
s = false d * 10 ^ r = ↑(c + 1) * 10 ^ q
theorem FloatLib.Floats.Formats.DecimalInterchange.Arithmetic.neighborBelow_spec (f : Format) (c : ) (q : ) (hc : c < f.coefficientBound) (hcpos : 0 < c) (hqmin : f.minQuantum q) (hqmax : q f.maxQuantum) (hfull : q = f.minQuantum f.payloadBound c) :
∃ (d : ) (r : ), neighborBelow f c q = Datum.finite false d r Datum.Valid f (Datum.finite false d r) (r = f.minQuantum f.payloadBound d) ↑(d + 1) * 10 ^ r = c * 10 ^ q

The predecessor of a normalized positive input is valid, normalized, and one upward grid step below the input. It may be zero.

Upper bound on every finite magnitude, including all nonminimal cohorts.

An infinite successor requires the greatest finite magnitude.