TorchLean API

NN.MLTheory.CROWN.Extras.FloatIntegration

Floats integration for CROWN (optional) #

This module bridges the CROWN bound-propagation development with the Floats infrastructure. It provides rounded-arithmetic variants of a few bound-propagation helpers, intended for experiments where you want the CROWN computations themselves to follow an explicit rounding model.

This is not required for the core CROWN proof layer and is grouped under NN/MLTheory/CROWN/Extras/.

noncomputable def NN.MLTheory.CROWN.Float.rFMA {β : TorchLean.Floats.NeuralRadix} {fexp : } (rnd : ) [TorchLean.Floats.NeuralValidExp fexp] (a b acc : ) :

Rounded multiply-add helper: round(a*b) then round(acc + ·).

Instances For
    noncomputable def NN.MLTheory.CROWN.Float.rAdd {β : TorchLean.Floats.NeuralRadix} {fexp : } (rnd : ) [TorchLean.Floats.NeuralValidExp fexp] (x y : ) :

    Rounded add

    Instances For
      noncomputable def NN.MLTheory.CROWN.Float.rMul {β : TorchLean.Floats.NeuralRadix} {fexp : } (rnd : ) [TorchLean.Floats.NeuralValidExp fexp] (x y : ) :

      Rounded mul

      Instances For
        noncomputable def NN.MLTheory.CROWN.Float.rMax {β : TorchLean.Floats.NeuralRadix} {fexp : } (rnd : ) [TorchLean.Floats.NeuralValidExp fexp] (x y : ) :

        Rounded max of two reals (stable under rounding by evaluating in ℝ, then rounding).

        Instances For
          noncomputable def NN.MLTheory.CROWN.Float.rMin {β : TorchLean.Floats.NeuralRadix} {fexp : } (rnd : ) [TorchLean.Floats.NeuralValidExp fexp] (x y : ) :

          Rounded min of two reals (stable under rounding by evaluating in ℝ, then rounding).

          Instances For

            Interval (IBP) linear layer with rounded arithmetic.

            Instances For

              Interval ReLU with float rounding: computes min/max of relu over bounds then rounds.

              Instances For

                Rounded elementwise add and mul on vectors

                Instances For

                  Evaluate affine on a box with rounding (vector case).

                  Instances For
                    noncomputable def NN.MLTheory.CROWN.Float.boundAffineFloat {β : TorchLean.Floats.NeuralRadix} {fexp : } (rnd : ) [TorchLean.Floats.NeuralValidExp fexp] {inDim hidDim outDim : } (net : MLP2 inDim hidDim outDim) (xB : Box (Spec.Shape.dim inDim Spec.Shape.scalar)) :

                    Affine (CROWN) bounds with rounding for a 2-layer MLP

                    Instances For
                      noncomputable def NN.MLTheory.CROWN.Float.boundIbpFloat {β : TorchLean.Floats.NeuralRadix} {fexp : } (rnd : ) [TorchLean.Floats.NeuralValidExp fexp] {inDim hidDim outDim : } (net : MLP2 inDim hidDim outDim) (xB : Box (Spec.Shape.dim inDim Spec.Shape.scalar)) :

                      End-to-end rounded IBP for 2-layer MLP (mirrors CROWN.bound_ibp).

                      Instances For

                        Public API: float-rounded CROWN IBP bounds wrapper with default config.

                        Instances For

                          Public API: float-rounded (IBP, Affine) bounds wrapper, mirroring CROWN.Examples.

                          Instances For
                            noncomputable def NN.MLTheory.CROWN.Float.forwardFloat {β : TorchLean.Floats.NeuralRadix} {fexp : } (rnd : ) [TorchLean.Floats.NeuralValidExp fexp] {inDim hidDim outDim : } (net : MLP2 inDim hidDim outDim) (x : Spec.Tensor (Spec.Shape.dim inDim Spec.Shape.scalar)) :

                            Rounded forward pass for a 2-layer MLP (linear → ReLU → linear).

                            Instances For

                              Round every scalar in a vector tensor to the target float grid.

                              Instances For

                                Round every scalar in a matrix tensor to the target float grid.

                                Instances For
                                  noncomputable def NN.MLTheory.CROWN.Float.quantizeParamsFloat {β : TorchLean.Floats.NeuralRadix} {fexp : } (rnd : ) [TorchLean.Floats.NeuralValidExp fexp] {inDim hidDim outDim : } (net : MLP2 inDim hidDim outDim) :
                                  MLP2 inDim hidDim outDim

                                  Pre-quantize an MLP2's parameters (W1, b1, W2, b2) onto the float grid.

                                  Instances For