TorchLean API

NN.Verification.Cert.CROWNNodeCertAlphaBeta

CROWNNodeCertAlphaBeta #

Per-node α/β-CROWN certificate checking (graph dialect).

This extends NN.Verification.CROWNNodeCert with an optional β phase vector for ReLU nodes.

Certificate JSON format:

{
  "ctx": { "inputId": 0, "inputDim": 2 },
  "ibp": [ null | { "lo": [...], "hi": [...] }, ... ],
  "crown": [
    null |
      { "loA": [[...], ...], "loC": [...],
        "hiA": [[...], ...], "hiC": [...] },
    ...
  ],
  "alpha": [ null | [...], ... ],
  "beta":  [ null | [-1,0,1,...], ... ]   // optional per-node ReLU phase vector
}

β encoding (per neuron):

As with the α-CROWN checker, the certificate is accepted only if the provided binary32 affine bounds exactly match Lean recomputation.

Helpers for the alpha/beta-CROWN style node certificate checker.

These are the JSON-facing utilities for the checker: they parse imported bounds, require exact binary32 agreement for affine replay data, and keep shape mismatches from reaching the semantic checker.

Parse a JSON integer (used for beta vectors).

Instances For

    Parse a beta vector from JSON.

    Instances For

      AlphaBetaCROWNNodeCertificate is the in-memory representation of an alpha/beta-CROWN node certificate read from JSON.

      The checker returns this structure from readAlphaBetaCROWNNodeCertificate, and the blueprint uses it as the documented shape of the artifact being checked.

      Instances For

        Read an alpha/beta-CROWN node certificate from JSON on disk.

        Instances For
          def NN.Verification.CROWNNodeCertAlphaBeta.checkAlphaBetaCROWNNode (g : MLTheory.CROWN.Graph) (ps : MLTheory.CROWN.Graph.ParamStore (FloatLib.Floats.ExecFloat.Binary 8 23 FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.Encoding.ieee (FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.Encoding.ieee.defaultBias 8) AlphaBetaCROWNNodeCertificate._proof_1 AlphaBetaCROWNNodeCertificate._proof_2 AlphaBetaCROWNNodeCertificate._proof_3 AlphaBetaCROWNNodeCertificate._proof_4)) (authoritativeIbp : Array (Option (MLTheory.CROWN.FlatBox (FloatLib.Floats.ExecFloat.Binary 8 23 FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.Encoding.ieee (FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.Encoding.ieee.defaultBias 8) AlphaBetaCROWNNodeCertificate._proof_1 AlphaBetaCROWNNodeCertificate._proof_2 AlphaBetaCROWNNodeCertificate._proof_3 AlphaBetaCROWNNodeCertificate._proof_4)))) (certAlpha : Array (Option (MLTheory.CROWN.Graph.FlatTensor (FloatLib.Floats.ExecFloat.Binary 8 23 FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.Encoding.ieee (FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.Encoding.ieee.defaultBias 8) AlphaBetaCROWNNodeCertificate._proof_1 AlphaBetaCROWNNodeCertificate._proof_2 AlphaBetaCROWNNodeCertificate._proof_3 AlphaBetaCROWNNodeCertificate._proof_4)))) (certBeta : Array (Option (Array ))) (authoritativeCrown certCrown : Array (Option (MLTheory.CROWN.Graph.FlatAffineBounds (FloatLib.Floats.ExecFloat.Binary 8 23 FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.Encoding.ieee (FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.Encoding.ieee.defaultBias 8) AlphaBetaCROWNNodeCertificate._proof_1 AlphaBetaCROWNNodeCertificate._proof_2 AlphaBetaCROWNNodeCertificate._proof_3 AlphaBetaCROWNNodeCertificate._proof_4)))) (ctx : MLTheory.CROWN.Graph.AffineCtx) (id : ) :

          Check the local α/β-CROWN enclosure condition for one node against a certificate entry.

          Instances For
            def NN.Verification.CROWNNodeCertAlphaBeta.replayStep (g : MLTheory.CROWN.Graph) (ps : MLTheory.CROWN.Graph.ParamStore (FloatLib.Floats.ExecFloat.Binary 8 23 FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.Encoding.ieee (FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.Encoding.ieee.defaultBias 8) AlphaBetaCROWNNodeCertificate._proof_1 AlphaBetaCROWNNodeCertificate._proof_2 AlphaBetaCROWNNodeCertificate._proof_3 AlphaBetaCROWNNodeCertificate._proof_4)) (authoritativeIbp : Array (Option (MLTheory.CROWN.FlatBox (FloatLib.Floats.ExecFloat.Binary 8 23 FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.Encoding.ieee (FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.Encoding.ieee.defaultBias 8) AlphaBetaCROWNNodeCertificate._proof_1 AlphaBetaCROWNNodeCertificate._proof_2 AlphaBetaCROWNNodeCertificate._proof_3 AlphaBetaCROWNNodeCertificate._proof_4)))) (cert : AlphaBetaCROWNNodeCertificate) :

            The α/β-CROWN replay function associated with a parsed certificate.

            Instances For