Soundness of IEEE32Exec.Interval32.add / sub / neg #
This file proves the “golden theorem”-style enclosure results for the monotone interval operations:
- addition: $[a,b]+[c,d]\subseteq[a+c,b+d]$,
- negation: $-[a,b]=[-b,-a]$,
- subtraction: $[a,b]-[c,d]\subseteq[a-d,b-c]$ (a derived combination of addition and negation).
In NN/Floats/Interval/IEEEExec32.lean, these are implemented with IEEE32 executable
outward-rounded
endpoints:
addusesaddDown/addUp,subusessubDown/subUp, where $\operatorname{subDown}(x,y)=\operatorname{addDown}(x,-y)$, and similarly forsubUp.
We work in EReal because finite binary32 inputs can still overflow under addition or subtraction.
The extended-real endpoints record those infinite results directly and let these lemmas compose
with the multiplication/division soundness layer without a separate no-overflow hypothesis.
Standards alignment (informal):
- IEEE 754-2019 defines binary32 arithmetic and special values (NaN/Inf/signed zero).
- IEEE 1788-2015 defines a standard API and semantics for interval arithmetic; the enclosures above are the basic “set-based” interval laws in the valid (outer enclosure) mode.
Note: we do not attempt to prove bit-for-bit conformance of IEEE32Exec to any specific
CPU/GPU.
Instead, we prove that our executable model (which follows IEEE-style rules) has the stated
enclosure relationship to the real semantics on the finite path.
Small helpers #
Interval addition #
Soundness of Interval32.add w.r.t. real addition, in the finite-endpoint regime.
If $x\in[A.\mathtt{lo},A.\mathtt{hi}]$ and
$y\in[B.\mathtt{lo},B.\mathtt{hi}]$ in real semantics, then $x+y$ lies between the EReal
interpretation of the executable endpoints of Interval32.add A B.
Interval negation #
Soundness of Interval32.neg w.r.t. real negation, in the finite-endpoint regime.
If $x\in[A.\mathtt{lo},A.\mathtt{hi}]$ in real semantics, then $-x$ lies between the EReal
interpretation of the
executable endpoints of Interval32.neg A.
Interval subtraction #
Soundness of Interval32.sub w.r.t. real subtraction, in the finite-endpoint regime.
This is a derived enclosure rule:
[a,b] - [c,d] ⊆ [a-d, b-c], implemented with directed rounding via subDown/subUp.