Floating-Point Interval Semantics #
Interval-domain semantics for ExecFloat.Binary 8 23 neural networks.
This file formalizes the interval domain, concretization map, executable interval operators, and
the exact-interval-image property used by the floating-point interval-approximation theorem of
Hwang, Lee, Park, Park, and Saad, Floating-Point Neural Networks Are Provably Robust Universal
Approximators (arXiv:2506.16065).
Basic aliases #
Shorthand for the executable binary32 float type used in this development.
Instances For
ExecFloat.Binary 8 23 is stored as a UInt32 bit-pattern, so the carrier is finite. We use this
only to
obtain Finset.univ for paper-style “finite hull” definitions; nothing is computed.
Hence a Fintype, classically.
Binary32 is finite, since it is determined by its bits.
Hence a Fintype. This is what makes the interval hull below a Finset construction and the
abstract operators exact rather than approximate: the whole float type can be enumerated.
Small helper lemmas about the ExecFloat.Binary 8 23 order #
Comparing a non-NaN float with itself yields eq, infinities included.
Reflexivity of ≤ away from NaN, which is as much as IEEE 754 order gives.
Instances For
Membership in an abstract interval, via the concretization γI.
Abstract boxes B ∈ I^d.
Instances For
A box is in [-1,1]^d (paper: “abstract boxes in [-1,1]^d”).
Instances For
Everything is in ⊤, NaN included; that is what makes ⊤ the sound fallback.
Point interval ⟨x,x⟩.
Instances For
Executable interval operators for +, *, and ReLU #
Minimum of two ExecFloat.Binary 8 23 values (NaN-aware, via min).
Instances For
Maximum of two ExecFloat.Binary 8 23 values (NaN-aware, via max).
Instances For
Minimum of four ExecFloat.Binary 8 23 values, computed via nested min2.
Instances For
Maximum of four ExecFloat.Binary 8 23 values, computed via nested max2.
Instances For
Return true iff any of the four arguments is NaN.
Instances For
Corner-based interval addition for ExecFloat.add.
Instances For
Corner-based interval multiplication for ExecFloat.mul.
Instances For
Executable ReLU for ExecFloat.Binary 8 23, defined via max.
Instances For
Exact ReLU♯ for intervals, using monotonicity of ReLU:
for ⟨a,b⟩, ReLU([a,b]) = [ReLU(a), ReLU(b)].
Instances For
Eq. (8): exact interval hull on finite sets #
Totalized extended-real interpretation (defaults to 0 only on NaN).
Instances For
Away from NaN, float comparison agrees with the order on EReal under the total embedding.
This is the lemma that buys the whole development a linear order to take minima and maxima in:
ExecFloat.Binary 8 23 itself has no LinearOrder, but its non-NaN part embeds into one.
A nonempty finite set of floats has an element attaining the minimum of its EReal image.
Dually, an element attaining the maximum.
A minimizing element of s, chosen classically.
Choice rather than computation because several distinct floats can share one EReal value (the two
zeros), so "the" minimum is not well defined as a float; every use below only needs some minimizer.
Instances For
chooseMin is in the set and attains the minimum of the image.
chooseMax is in the set and attains the maximum of the image.
Interval hull for a finite set of floats:
⊤if the set contains a NaN (paper:⊥ ∈ S), otherwise- the interval
⟨min S, max S⟩.
Instances For
Concretization of a box as a Finset of points. Finite because F is, which is what lets the
abstract operators be defined as images of concrete ones rather than by endpoint formulas.
Instances For
Build a 2D box from two intervals (coordinate 0 is A, coordinate 1 is B).
Instances For
Abstract addition +♯: the hull of float addition over the whole input box.
Defined as an image rather than by adding endpoints, because float addition is not monotone in the
presence of NaN and signed zeros, so an endpoint formula would not be exact. ⊤ absorbs.
Instances For
Abstract multiplication *♯, again as the hull of the concrete image over the box.
Instances For
Abstract ReLU, the hull of the concrete image.
Instances For
OpsExact implements the finite interval semantics used for exact interval-image statements.
The Sound class isolates the operation-level obligations used by higher-level semantic proofs.
The addition, multiplication, and ReLU obligations are proved below, followed by the canonical
ExecFloat.Binary 8 23 instance.
The per-operation soundness obligations the interval semantics rests on: every abstract operation must contain the concrete result of any pair of members of its arguments.
Abstract addition contains every concrete sum of members.
Abstract multiplication contains every concrete product of members.
Abstract ReLU contains the concrete ReLU of every member.
Instances
Soundness of abstract addition: concrete sums of members stay in the abstract sum.
Soundness of abstract multiplication.
Soundness of the interval sum ◦∑♯: folding concrete additions stays inside the folded
intervals.
Proved by induction on the list rather than on Fin n, so that the accumulator interval can vary;
the base case needs 0 ∈ ⟨0, 0⟩, which is where the non-NaN side condition on zero comes in.
Exact interval-image property for rounded targets #
For each box B, the abstract output interval is exactly the interval hull of the rounded target's
direct image on γ(B), expressed via existential min/max witnesses.
Instances For
A constant target has an exact interval image: the point interval ⟨c, c⟩.
The easiest instance of the exactness property, and the one the constant-target construction of the paper needs; the nonemptiness hypothesis is what supplies the min and max witnesses.
Two-layer interval evaluator using OpsExact #
Parameters of a 2-layer MLP of shape d → h → 1 for the exact interval semantics (OpsExact).
Weight matrix for layer 1.
Bias for layer 1.
Weight matrix for layer 2.
Bias for layer 2.
Instances For
Evaluate a 2-layer ReLU MLP on a concrete input, using the exact op wrappers (OpsExact.relu).
Instances For
The abstract affine transform is sound, given that no weight or bias is NaN.
Weights enter as point intervals, so the proof is mulSharp soundness coordinatewise, then
sumSharp soundness, then one addSharp for the bias, in exactly the order aff computes.
The abstract semantics ν♯ of a two-layer ReLU network overapproximates the concrete one.
Set-level restatement: the image of the concretization is contained in the abstract output.
This is the form the approximation theorem cites, since it speaks about images of sets rather than about individual points.
Specialization to a point box: the abstract semantics contains the concrete value at x.
Worth stating separately because it says the abstraction has no false negatives at single inputs, which is what a verifier reports back to a user.