TorchLean API

NN.Verification.Cert.CROWNNodeCert

CROWNNodeCert #

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

This mirrors NN.Verification.IBPNodeCert, but for affine bounds produced by a CROWN/DeepPoly pass with optional α-parameters for the ReLU lower relaxation (α-CROWN).

Certificate JSON format:

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

Trust boundary notes:

The helpers below are the JSON-facing boundary for the CROWN certificate checkers. They parse the artifact, require exact binary32 agreement for affine replay data, and check parent and shape requirements before invoking the semantic checker.

def NN.Verification.CROWNNodeCert.checkCROWNNode (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) checkCROWNNode._proof_1 checkCROWNNode._proof_2 checkCROWNNode._proof_3 checkCROWNNode._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) checkCROWNNode._proof_1 checkCROWNNode._proof_2 checkCROWNNode._proof_3 checkCROWNNode._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) checkCROWNNode._proof_1 checkCROWNNode._proof_2 checkCROWNNode._proof_3 checkCROWNNode._proof_4)))) (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) checkCROWNNode._proof_1 checkCROWNNode._proof_2 checkCROWNNode._proof_3 checkCROWNNode._proof_4)))) (ctx : MLTheory.CROWN.Graph.AffineCtx) (id : ) :

Check the local CROWN enclosure condition for one node against a certificate entry.

Instances For

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

    Instances For

      Check a per-node α-CROWN certificate against Lean's propagation rules.

      Returns true iff every supplied IBP box contains Lean's authoritative recomputation and every node's affine replay data agrees exactly with Lean's CROWN step.

      Instances For