α/β-CROWN certificate step function (graph dialect) #
This extends AlphaCROWN.alphaCrownStepNode? with explicit β-phase constraints for ReLU:
For a ReLU node, a certificate may additionally provide a per-neuron phase vector:
-1= neuron forced inactive (z ≤ 0)0= no phase constraint (unstable)1= neuron forced active (0 ≤ z)
The step function checks phase consistency against the provided IBP pre-activation bounds:
- active requires
0 ≤ lo - inactive requires
hi ≤ 0
If the phase vector is present and consistent, the propagated affine bounds use the exact ReLU behavior for active/inactive neurons (slope 1 / slope 0), and the usual α-CROWN / CROWN relaxations for unstable neurons.
This keeps the checker’s trust boundary small: β is treated as additional evidence that is verified against the (trusted-for-this-theorem) IBP bounds.
Background / citations #
This checker is deliberately narrow and certificate-friendly. Conceptually, β-phase information corresponds to the phase constraints used in branch-and-bound based verifiers (and in β-CROWN-style splitting), where additional information can turn unstable ReLUs into provably active/inactive ones.
- CROWN: Zhang et al., Efficient Neural Network Robustness Certification with General Activation Functions, NeurIPS 2018.
- β-CROWN (splitting / phase refinement): Wang et al., Beta-CROWN: Efficient Bound Propagation with Provable Guarantees, NeurIPS 2021 (and follow-up work).
We do not attempt to formalize the full β-CROWN search/optimization loop here; the checker only verifies that the provided β phases are consistent with IBP and then uses the corresponding exact ReLU transfer rule (slope (0) or (1)).
ReLU phase encoding #
We represent β information using a three-valued phase:
inactive: pre-activation (z \le 0), so ReLU is exactly (0);active: pre-activation (0 \le z), so ReLU is exactly (z);unstable: no phase constraint, so we fall back to linear relaxations.
At runtime, a certificate provides an Array Int with entries in ({-1,0,1}), which we decode
using ReLUPhase.ofInt?.
Encode a ReLUPhase as the certificate integer convention {-1, 0, 1}.
Instances For
Executable phase-consistency check for a scalar pre-activation interval ([l,u]).
This is written for a generic Context α (so it can run over floats or other semirings).
For proof-level soundness over ℝ, see theorems in
NN/MLTheory/CROWN/Proofs/AlphaBetaReLUScalarSoundness.lean.
Instances For
Phase-aware upper (over-approx) linear relaxation for ReLU.
Instances For
Phase-aware lower (under-approx) linear relaxation for ReLU.
Instances For
Opaque wrapper around Array.get! for β-phase vectors.
Why this exists:
- The executable definition
phaseRelaxVec?indexesphaseswithget!after a length check, to avoid threading bounds proofs through the code. - During proofs,
simpcan sometimes rewriteget!into the safe indexingphases[i](which carries a proof argument). Those proof terms are definitional artifacts and can make routine simplification depend on irrelevant proof objects.
Keeping the indexing step opaque prevents simp from introducing proof-carrying indices, while
preserving executability.
Vectorized construction of ReLU relaxations under β-phase constraints.
Returns (relaxLo, relaxHi) if:
- the β vector has the correct length, and
- every scalar entry is decodable and phase-consistent with the IBP interval bounds.
Implementation notes:
- We first compute a boolean
okover all indices (so the function remains executable in a genericContext α). - We access the β-phase vector with
get!after checking the length. This avoids carrying bounds proofs while remaining total as Lean code.
Instances For
One-node α/β-CROWN step:
- delegates to
alphaCrownStepNode?for all non-ReLU ops; - for ReLU, optionally uses a β phase vector (if provided at
beta[id]).
If no β info is present for this node, this is exactly alphaCrownStepNode?.