Runtime CROWN operators #
Executable helper operators for the graph-based CROWN/IBP engine.
This file keeps runtime certificate replay separate from proof imports:
- Some proof-facing CROWN modules import
Mathliband large theorem developments. Native executables that only replay certificates should not pay that import cost. - The graph verifier and executable certificate checks only need a compact set of computational definitions: ReLU relaxations plus interval rules for a few scalar activations.
These definitions live under NN.MLTheory.CROWN.Runtime.Ops, with no direct Mathlib dependency.
The proof modules can cite these functions, but this file itself stays focused on the runtime
support code used for fast certificate replay.
References (bound propagation background):
- Zhang et al., "Efficient Neural Network Robustness Certification with General Activation Functions" (CROWN), 2018: https://arxiv.org/abs/1811.00866
- Singh et al., "An Abstract Domain for Certifying Neural Networks" (DeepPoly), POPL 2019.
Lower (under-approx) relaxation for ReLU.
For crossing bounds l < 0 < u, basic CROWN/DeepPoly chooses either:
y ≥ 0(slope 0), ory ≥ x(slope 1), based on which side of 0 is “wider”. This keeps the relaxation sound without α-optimization.
Instances For
Vectorized relax_scalar, applied componentwise to lo/hi.
Instances For
Vectorized relax_scalar_lower, applied componentwise to lo/hi.
Instances For
Propagate an affine form through ReLU using a per-neuron relaxation.
Given y ≈ A*x + c and per-output relaxations (slopeᵢ, biasᵢ), produces the affine form
y' ≈ diag(slope) * (A*x + c) + bias.
Instances For
Generic elementwise bound propagation for monotone activations (min/max of endpoints).
Instances For
Interval bound propagation for sigmoid (monotone, so min/max of endpoints).
Instances For
Interval bound propagation for tanh (monotone, so min/max of endpoints).
Instances For
Conservative IBP for sin using a 1-Lipschitz enclosure:
sin([l,u]) ⊆ [sin(m)-r, sin(m)+r] ∩ [-1,1], m=(l+u)/2, r=(u-l)/2.
This avoids periodic case splits (no floor/ceil in Context α) while remaining sound.
Instances For
Same 1-Lipschitz enclosure as IBP.sin, but for cos.