TorchLean API

NN.MLTheory.CROWN.Proofs.GraphAlphaCrownTransferSoundness.Alpha.ReLU

α-CROWN Transfer: ReLU Nodes #

The .relu case of alphaCrown_transfer_sound. The step propagates the parent's affine bounds through the α lower relaxation and the CROWN upper relaxation built from the IBP pre-activation box. The proof is componentwise: scalar inequalities for the two relaxations, a vector-level enclosure for a fixed α vector in [0, 1], and the range facts for the α vector the step selects.

Scalar relaxation inequalities #

The α lower relaxation on [l, u], evaluated at a lower estimate lAff ≤ z, lies below relu z.

relu z lies below the CROWN upper relaxation on [l, u] evaluated at an upper estimate z ≤ uAff.

Vector-level enclosure #

Componentwise ReLU bound: if z lies in both the affine estimate box and the IBP box, and the α vector lies in [0, 1], then the propagated lower and upper affine forms bracket relu z at every index.

ReLU transfer core: if xin encloses the parent value vp at x, the IBP box preB encloses vp, and the α vector lies in [0, 1], then propagating xin through the α lower and CROWN upper relaxations encloses relu vp.

The α vector selected by the step #

theorem NN.MLTheory.CROWN.Graph.AlphaCrownTransferSoundness.Alpha.alpha_cast_range {alpha : Array (Option (FlatTensor ))} {id : } {αv : FlatTensor } {n : } (halpha : AlphaOK alpha) (hαopt : Cert.getAlpha? alpha id = some αv) ( : αv.n = n) (i : Fin n) :

A certificate α entry, cast to the pre-activation dimension, has all components in [0, 1] under AlphaOK.

theorem NN.MLTheory.CROWN.Graph.AlphaCrownTransferSoundness.Alpha.selected_alpha_range {alpha : Array (Option (FlatTensor ))} {id : } {αv : FlatTensor } {preB : FlatBox } (halpha : AlphaOK alpha) (hαopt : Cert.getAlpha? alpha id = some αv) (i : Fin preB.dim) :
0 (if hα : αv.n = preB.dim then castDimScalar αv.v else Cert.defaultAlphaVec preB.lo preB.hi).getScalar i (if hα : αv.n = preB.dim then castDimScalar αv.v else Cert.defaultAlphaVec preB.lo preB.hi).getScalar i 1

The α vector the step selects when a certificate entry is present (the entry cast to the pre-activation dimension if the sizes agree, the default relaxation otherwise) has all components in [0, 1].

The .relu case #

theorem NN.MLTheory.CROWN.Graph.AlphaCrownTransferSoundness.Alpha.relu_sound {g : Graph} {ps : ParamStore } {ibp : Array (Option (FlatBox ))} {alpha : Array (Option (FlatTensor ))} {cert : Array (Option (FlatAffineBounds ))} {inputs : Std.HashMap CertSoundness.Val} {vals : Array (Option CertSoundness.Val)} {ctx : AffineCtx} {x : TorchLean.Tensor [ctx.inputDim]} {id : } {b : FlatAffineBounds } {v : CertSoundness.Val} (hk : g.nodes[id]!.kind = IR.OpKind.relu) (hs : stepAlpha g ps ibp alpha ctx cert id = some b) (hEvalSome : CertSoundness.evalNode? g.nodes ps inputs vals id = some v) (hpar : ParentsEnclosed g cert vals ctx x id) (hparLt : pg.nodes[id]!.parents, p < vals.size) (hibp : IBPEnclosesVals ibp vals) (halpha : AlphaOK alpha) :

The .relu case: the step propagates the parent's affine bounds through the α lower and CROWN upper relaxations built from the IBP pre-activation box at the parent, and the evaluator applies reluSpec to the parent's value. The α vector is the certificate entry when present and well-sized, and the default relaxation otherwise.