Quantized interval arithmetic (rounding-on-ℝ, 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 (β,fexp) format).
The main intended use is verification/bounding:
- You start from a real interval
x ∈ [lo,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
ℝ/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 contains0.
References:
- IEEE 1788-2015 (interval arithmetic).
- Moore, Kearfott, Cloud, Introduction to Interval Analysis (2009).
- Rump (INTLAB) for outward rounding.
A closed real interval [lo,hi].
Instances For
Enable x ∈ I notation for real intervals.
Degenerate interval [x,x].
Instances For
Interval negation: -[lo,hi] = [-hi,-lo].
Instances For
Outward-rounded interval addition, using the provided endpoint Rounder.
Instances For
Maximum absolute endpoint magnitude: max |lo| |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 ∈ A, y ∈ B we have |x*y| ≤ absMax A * absMax B, hence
x*y ∈ [-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: Real.tanh x ∈ [-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).