The search region #
The search region of ratpoints: search intervals [l, u] for x / z, whose ends are IEEE
binary64 doubles, given here by their bits, and a range of the denominators z. A double has a
value in ℚ extended by ⊥ and ⊤ (WithBotTop ℚ), the two infinities; a NaN has none (its value
here is junk), and both zeros have the value 0; ratpoints refuses search intervals with a NaN
end, with l > u or that are not increasing and strictly apart. A point lies in the region when it
is at infinity, or its denominator is in the range and x / z lies in one of the intervals (in any,
when there are none). The specification uses Mathlib and nothing of the model; the comparator
challenge restates its definitions verbatim.
Main definitions #
Ratpoints.IsNaN,Ratpoints.doubleValue: whether the bits of a double are a NaN, and the value of a double.Ratpoints.AreSearchIntervals,Ratpoints.IntervalsWF: closed intervals, increasing and strictly apart, over values and over the bits of doubles.Ratpoints.InIntervals: a rational number lies in one of a list of intervals.Ratpoints.InRegion: a point lies in the search region.Ratpoints.IsFullBox: the search region is the whole box of heightH, so thatratpointsmay reverse the polynomial.Ratpoints.denominatorBound: the largest denominator of the search.
Implementation notes #
The file imports Mathlib.Order.WithBotTop for the extended values and
Mathlib.Algebra.Order.Field.Rat for the order and the field operations of ℚ, both publicly: the
comparator challenge imports the Mathlib modules among the public imports of the files of the
specification that it restates, so that the definitions it restates elaborate to the same terms as
here.
The value of the IEEE binary64 double with the bits x: ±f 2 ^ (-1074) for the exponent
field 0 (the zeros and the subnormals, both zeros giving 0), ±(2 ^ 52 + f) 2 ^ (e - 1075) for
an exponent field e from 1 to 2046, and ⊥ and ⊤ for the infinities, where f is the
fraction and the sign is that of the top bit. The value of a NaN (the exponent field 2047 with a
nonzero fraction) is junk, an infinity: Ratpoints.IntervalsWF excludes NaNs.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Closed intervals [l, u] with l ≤ u, increasing and strictly apart: the upper end of each
below the lower end of the next.
Equations
- Ratpoints.AreSearchIntervals dom = ((∀ i ∈ dom, i.1 ≤ i.2) ∧ List.IsChain (fun (i j : WithBotTop ℚ × WithBotTop ℚ) => i.2 < j.1) dom)
Instances For
Equations
- One or more equations did not get rendered due to their size.
The search intervals with the ends of the bits of doubles that ratpoints accepts, the test of
RATPOINTS_BAD_ARGS: no end is a NaN, and the values are closed intervals, increasing and strictly
apart (Ratpoints.AreSearchIntervals); -0 and 0 have the same value.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
The rational number x lies in one of the intervals D, over the values of their ends, both
ends included.
Equations
- Ratpoints.InIntervals D x = ∃ i ∈ D, i.1 ≤ WithBotTop.coe x ∧ WithBotTop.coe x ≤ i.2
Instances For
Equations
The triple p = (x, y, z) lies in the search region of the intervals dom (over the values of
their ends) and the range of the denominators from bLow to bHigh: z = 0 (a point at
infinity), or bLow ≤ z, z ≤ bHigh unless bHigh < 1 (no bound beyond the height bound), and
x / z in one of the intervals (Ratpoints.InIntervals), or anywhere when there are none.
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
The search region of the intervals dom and the range of the denominators from bLow to
bHigh is the whole box of the height bound H: no intervals, bLow ≤ 1 and no bound below H
on the denominators (bHigh < 1 or H ≤ bHigh). Only then may ratpoints reverse the polynomial
(otherwise it sets RATPOINTS_NO_REVERSE_AUTO).