Quantized real intervals and unbounded division enclosures #
Intervals are propagated over ℝ or EReal, then their endpoints are snapped outward to a chosen
representable grid, a Flocq-style $(\beta,\mathtt{fexp})$ format.
The usual workflow is:
- start from a real interval $x\in[\mathtt{lo},\mathtt{hi}]$;
- propagate it through arithmetic or a monotone nonlinear function; and
- round each new endpoint outward with a
Rounder.
The layer is meant for real-valued enclosure proofs, not bit-level IEEE execution. It therefore has no NaN payloads, signed-zero rules, or status flags.
Division returns an EReal interval so that a denominator interval containing zero can be enclosed
by $[-\infty,+\infty]$.
References:
- IEEE 1788-2015 (interval arithmetic).
- Moore, Kearfott, Cloud, Introduction to Interval Analysis (2009).
- Rump (INTLAB) for outward rounding.
Membership predicate: $x\in I$ means $I.\mathtt{lo}\le x\le I.\mathtt{hi}$.
Instances For
Enable $x\in I$ notation for real intervals.
Degenerate interval $[x,x]$.
Instances For
Interval negation: $-[\mathtt{lo},\mathtt{hi}]=[-\mathtt{hi},-\mathtt{lo}]$.
Instances For
Outward-rounded interval addition, using the provided endpoint Rounder.
Instances For
Outward-rounded interval subtraction, implemented as $A+(-B)$.
Instances For
Maximum absolute endpoint magnitude: $\max(|\mathtt{lo}|,|\mathtt{hi}|)$.
For a member of the interval, this bounds its absolute value. It is useful for even functions such
as Real.cosh, whose maximum over an interval occurs at an endpoint of largest magnitude.
Instances For
Outward-rounded multiplication using the four products of the endpoint pairs.
Instances For
Soundness of sqrt: membership is preserved by Real.sqrt.
Real.sqrt is monotone on all of ℝ (it sends every nonpositive input to 0), so no sign
hypothesis on A is needed; the nonnegativity remark on sqrt only describes when the enclosure
is informative.
Extended-real intervals (for division by an interval containing 0) #
Enable x ∈ I notation for EReal intervals.
Top interval [-∞,+∞] (the most conservative enclosure).
Instances For
Embed a real interval into an extended-real interval.
Instances For
Embedding an interval into EReal preserves membership of real values.
Division with possibly unbounded results.
If the denominator interval contains 0, the enclosure is [-∞,+∞].
Otherwise the quotient is enclosed by the four endpoint quotients.
Outward-rounded interval division as an EReal enclosure.
If the denominator interval contains 0, we return EInterval.top = [-∞,+∞]. Otherwise we
outward-round the minimum and maximum of the four endpoint quotients.
Instances For
Soundness of div in the nonzero-denominator case (0 ∉ B).
Under the hypothesis ¬ (B.lo ≤ 0 ∧ 0 ≤ B.hi), the constructed EInterval contains the true real
quotient x/y (as an EReal).
Soundness of div without any hypothesis on the denominator interval.
When B contains zero the result is EInterval.top, which contains everything; otherwise this is
mem_div_of_nozero. Division by zero itself is Lean's totalized x / 0 = 0, which the top
interval also contains.