Bracketing a Real Value #
Effective rounding algorithms refine an interval until its endpoints are adjacent representable
values. A location records whether the input is the lower endpoint or, for an interior point,
whether it lies below, at, or above the interval midpoint. This is the Lean counterpart of
Flocq's Calc.Bracket location semantics.
Position of a real value relative to the lower endpoint and midpoint of a bracket.
- exact : NeuralLocation
- inexact (midpointOrder : Ordering) : NeuralLocation
Instances For
Instances For
Instances For
Compute the location of x in a bracket whose lower endpoint is d.
Instances For
Semantic meaning of a bracket location.
- exact {d u x : ℝ} (hx : x = d) : NeuralInbetween d u x NeuralLocation.exact
- inexact {d u x : ℝ} (l : Ordering) (hx : d < x ∧ x < u) (hmid : cmp x ((d + u) / 2) = l) : NeuralInbetween d u x (NeuralLocation.inexact l)
Instances For
The computed location satisfies the bracket semantics.
A value has at most one semantic location in a fixed bracket.
Every semantic location places the input in the half-open bracket [d, u).
An inexact location places the input strictly between the bracket endpoints.
Midpoint comparison is equivalent to comparing distances from the two endpoints.
The midpoint order also compares the absolute distances to the endpoints.
Every location is realized by a point in every nondegenerate bracket.
Lift a location in an interior arithmetic-progression cell to the full interval. The caller supplies the comparison with the full midpoint; later refinement rules compute that comparison from the cell index and local location.
A subinterval strictly below the global midpoint has global location .lt.
A subinterval strictly above the global midpoint has global location .gt.
Exactness at the first cell's lower endpoint remains exact in the full interval.
An inexact point in the first cell lies below the full midpoint when there are several cells.
At the central lower endpoint of an even subdivision, the global location is midpoint exact.
An inexact point in the central cell of an even subdivision is above the global midpoint.
At the lower endpoint of the central cell of an odd subdivision, the global location is low.
In the central cell of an odd subdivision, local and global midpoint locations agree.
Refine a local location when the enclosing subdivision count is even.
Instances For
Refine a local location when the enclosing subdivision count is odd.
Instances For
Correctness of location refinement for an even number of cells.
Correctness of location refinement for an odd number of cells.
Refine a local location, selecting the even or odd subdivision rule automatically.
Instances For
Correctness of automatic local-to-global location refinement.