TorchLean API

NN.MLTheory.Proofs.Approximation.Universal.UniversalApproximationIEEE32ExecTwoLayerMlp

IEEE32Exec two-layer ReLU approximation bound #

This file proves the reusable three-term error decomposition for executing a single-hidden-layer ReLU MLP under concrete IEEE binary32 semantics.

The theorem separates the three mathematically different sources of error:

This is the finite-dimensional analogue of the hinge-network executable bound in UniversalApproximationIEEE32Exec. The decomposition follows the standard numerical-analysis pattern for floating-point algorithms: prove the real algorithm correct, bound data/parameter rounding, and bound arithmetic rounding separately. For background, see IEEE Std 754-2019, Goldberg (1991), Higham (2002), and the ReLU density literature of Cybenko, Hornik, Leshno, and Pinkus.

Three-term bound #

Read this as:

Given an IEEE32Exec input xI, let $x_R$ be its real interpretation (toReal elementwise). If:

  1. the target $f$ is approximated by a real two-layer ReLU MLP with error at most $\varepsilon_{\mathrm{approx}}$,
  2. the real MLP is close to the real interpretation of the IEEE parameters, with error at most $\varepsilon_Q$,
  3. executing the IEEE MLP and then mapping to reals is close to the real interpretation of those IEEE parameters, with error at most $\varepsilon_R$,

then the IEEE32Exec execution approximates $f$ within $\varepsilon_{\mathrm{approx}}+\varepsilon_Q+\varepsilon_R$.

theorem NN.MLTheory.Proofs.UniversalApproximation.IEEE32ExecTwoLayerMLP.relu_twoLayerMlp_ieee32exec_threeTerm {n hidDim : } (D : Set (TorchLean.Tensor (FloatLib.Floats.ExecFloat.Binary 8 23 FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.Encoding.ieee (FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.Encoding.ieee.defaultBias 8) relu_twoLayerMlp_ieee32exec_threeTerm._proof_1 relu_twoLayerMlp_ieee32exec_threeTerm._proof_2 relu_twoLayerMlp_ieee32exec_threeTerm._proof_3 relu_twoLayerMlp_ieee32exec_threeTerm._proof_4) [n])) (f : TorchLean.Tensor [n]) (l1R : Spec.LinearSpec n hidDim) (l2R : Spec.LinearSpec hidDim 1) (l1I : Spec.LinearSpec (FloatLib.Floats.ExecFloat.Binary 8 23 FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.Encoding.ieee (FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.Encoding.ieee.defaultBias 8) relu_twoLayerMlp_ieee32exec_threeTerm._proof_1 relu_twoLayerMlp_ieee32exec_threeTerm._proof_2 relu_twoLayerMlp_ieee32exec_threeTerm._proof_3 relu_twoLayerMlp_ieee32exec_threeTerm._proof_4) n hidDim) (l2I : Spec.LinearSpec (FloatLib.Floats.ExecFloat.Binary 8 23 FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.Encoding.ieee (FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.Encoding.ieee.defaultBias 8) relu_twoLayerMlp_ieee32exec_threeTerm._proof_1 relu_twoLayerMlp_ieee32exec_threeTerm._proof_2 relu_twoLayerMlp_ieee32exec_threeTerm._proof_3 relu_twoLayerMlp_ieee32exec_threeTerm._proof_4) hidDim 1) (εApprox εQ εR : ) (hApprox : xID, have xR := IEEE32ExecCore.tensorToReal xI; |f xR - ReLUMlpBridge.mlpEval l1R l2R xR| εApprox) (hQ : xID, have xR := IEEE32ExecCore.tensorToReal xI; |ReLUMlpBridge.mlpEval l1R l2R xR - ReLUMlpBridge.mlpEval (IEEE32ExecCore.linearSpecToReal l1I) (IEEE32ExecCore.linearSpecToReal l2I) xR| εQ) (hR : xID, have xR := IEEE32ExecCore.tensorToReal xI; |(FloatLib.Floats.ExecFloat.Binary.toModel (IEEE32ExecCore.mlpEvalIEEE32Exec l1I l2I xI)).toReal - ReLUMlpBridge.mlpEval (IEEE32ExecCore.linearSpecToReal l1I) (IEEE32ExecCore.linearSpecToReal l2I) xR| εR) (xI : TorchLean.Tensor (FloatLib.Floats.ExecFloat.Binary 8 23 FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.Encoding.ieee (FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.Encoding.ieee.defaultBias 8) relu_twoLayerMlp_ieee32exec_threeTerm._proof_1 relu_twoLayerMlp_ieee32exec_threeTerm._proof_2 relu_twoLayerMlp_ieee32exec_threeTerm._proof_3 relu_twoLayerMlp_ieee32exec_threeTerm._proof_4) [n]) :