Adjacency of the public decimal neighbor operations #
The quantified bounds compare the delivered result with every valid finite datum, including other cohorts and either sign of zero. The endpoint theorems cover infinite results separately.
theorem
FloatLib.Floats.Formats.DecimalInterchange.Arithmetic.nextUp_finite_adjacent
(f : Format)
(s : Bool)
(c : ℕ)
(q : ℤ)
(hx : Datum.Valid f (Datum.finite s c q))
(v : ℚ)
(hout : (nextUp f (Datum.finite s c q)).value.toRat? = some v)
:
Datum.finiteValue s c q < v ∧ ∀ (t : Bool) (d : ℕ) (r : ℤ),
Datum.Valid f (Datum.finite t d r) → Datum.finiteValue s c q < Datum.finiteValue t d r → v ≤ Datum.finiteValue t d r
The finite successor is strictly greater, and no valid finite value lies between them.