Quantized interval arithmetic (rounding on $\mathbb{R}$, overflow-aware) #
This file provides a sound enclosure layer for real computations where interval endpoints are snapped outward to a chosen representable grid (a Flocq-style $(\beta,\mathtt{fexp})$ format).
The main intended use is verification/bounding:
- You start from a real interval $x\in[\mathtt{lo},\mathtt{hi}]$.
- You propagate it through primitive operations and monotone nonlinearities.
- After each primitive, you quantize the endpoint outward via a
Rounder(down/up).
Compared to an executable IEEE kernel:
- This is proof-friendly (everything lives in $\mathbb{R}$ or
ERealand uses Flocq-style rounding). - It is not a bit-level IEEE-754 model (no NaN payloads, signed zero rules, etc.).
Overflow-awareness:
- We use
EReal(extended reals) to represent unbounded intervals arising from division by an interval that contains $0$.
References:
- IEEE 1788-2015 (interval arithmetic).
- Moore, Kearfott, Cloud, Introduction to Interval Analysis (2009).
- Rump (INTLAB) for outward rounding.
A closed real interval $[\mathtt{lo},\mathtt{hi}]$.
Instances For
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.
Validity predicate: endpoints are ordered ($\mathtt{lo}\le\mathtt{hi}$).
Instances For
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
Maximum absolute endpoint magnitude: $\max(|\mathtt{lo}|,|\mathtt{hi}|)$.
This is a convenient (and very proof-stable) way to get a coarse enclosure for products.
Instances For
Loose-but-sound multiplication enclosure.
For $x\in A$ and $y\in B$, we have
$|xy|\le\operatorname{absMax}(A)\operatorname{absMax}(B)$, hence $xy\in[-M,M]$.
We then outward-round the endpoints via R.
This bound is conservative and serves as a generally applicable, proof-stable fallback. The executable IEEE interval layer provides the tighter four-corner multiplication theorem when that extra precision matters.
Instances For
Soundness of tanhBounds: $\tanh x\in[-1,1]$.
Interval tanh enclosure.
This deliberately returns the global codomain enclosure tanhBounds. It is a proof-stable fallback
for pipelines that only need a sound bound; monotone interval refinements can live beside it without
changing this simple contract.
Instances For
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
Membership in ofRInterval is the same as membership in the underlying real interval.
This is a small simp lemma that helps bridge between ℝ-level and EReal-level enclosures.
Division with overflow-awareness.
If the denominator interval contains 0, the result is unbounded ([-∞,+∞]).
Otherwise we return a loose enclosure using absolute-value bounds.
Outward-rounded interval division as an EReal enclosure.
If the denominator interval contains 0, we return EInterval.top = [-∞,+∞]. Otherwise we use a
coarse-but-sound absolute-value bound and outward-round the endpoints with R.
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).