TorchLean API

NN.MLTheory.CROWN.Proofs.GraphAlphaCrownTransferSoundness.AlphaBeta

α/β-CROWN Graph Transfer Soundness #

Pointwise soundness theorem for the β-extended graph transfer rule.

The proof is a dispatch over two cases. Every node that is not a ReLU carrying a β vector is handled by alphaCrown_transfer_sound, since stepAlphaBeta agrees with stepAlpha there (stepAlphaBeta_eq_stepAlpha). A ReLU node with a β vector is handled by inverting the step (stepAlphaBeta_relu_beta_inv), reading off the parent's value from the semantics, and applying the pointwise β-phase ReLU lemma enclosesAtInput_relu_beta.

Semantic glue #

theorem NN.MLTheory.CROWN.Graph.AlphaCrownTransferSoundness.enclosesAtInput_of_parents {g : Graph} {cert : Array (Option (FlatAffineBounds ))} {vals : Array (Option CertSoundness.Val)} {ctx : AffineCtx} {x : TorchLean.Tensor [ctx.inputDim]} {id p : } {xin : FlatAffineBounds } {vp : CertSoundness.Val} (hparents : pg.nodes[id]!.parents, match cert[p]!, vals[p]! with | some bp, some vp => CrownCertSoundness.EnclosesAtInput ctx x bp vp | x, x_1 => True) (hp : p g.nodes[id]!.parents) (hcert : cert[p]! = some xin) (hval : vals[p]! = some vp) :

The parent hypothesis of CrownTransferSound, specialised to a parent whose certificate entry and semantic value are both present.

theorem NN.MLTheory.CROWN.Graph.AlphaCrownTransferSoundness.vals_relu_eq {g : Graph} {ps : ParamStore } {inputs : Std.HashMap CertSoundness.Val} {vals : Array (Option CertSoundness.Val)} {id p1 : } {v : CertSoundness.Val} (hsem : CertSoundness.SemLocalOK g ps inputs vals) (hid : id < g.nodes.size) (hk : g.nodes[id]!.kind = IR.OpKind.relu) (hps : IR.unaryParent? g.nodes[id]!.parents = some p1) (hv : vals[id]! = some v) :
∃ (vp : CertSoundness.Val), vals[p1]! = some vp v = { n := vp.n, v := Activation.reluSpec vp.v }

A ReLU node's semantic value is relu of its unary parent's value.

theorem NN.MLTheory.CROWN.Graph.AlphaCrownTransferSoundness.enclosesBox_parent {g : Graph} {ps : ParamStore } {inputs : Std.HashMap CertSoundness.Val} {ibp : Array (Option (FlatBox ))} {vals : Array (Option CertSoundness.Val)} {id p : } {preB : FlatBox } {vp : CertSoundness.Val} (htopo : CertSoundness.TopoSorted g) (hsem : CertSoundness.SemLocalOK g ps inputs vals) (hibp : IBPEnclosesVals ibp vals) (hid : id < g.nodes.size) (hp : p g.nodes[id]!.parents) (hpre : ibp[p]! = some preB) (hvp : vals[p]! = some vp) :

The IBP box of a parent node encloses that parent's semantic value.

Per-case soundness #

theorem NN.MLTheory.CROWN.Graph.AlphaCrownTransferSoundness.alphaBetaCrown_alpha_case_sound (g : Graph) (ps : ParamStore ) (ibp : Array (Option (FlatBox ))) (alpha : Array (Option (FlatTensor ))) (beta : Array (Option (Array ))) (cert : Array (Option (FlatAffineBounds ))) (inputs : Std.HashMap CertSoundness.Val) (vals : Array (Option CertSoundness.Val)) (ctx : AffineCtx) (x : TorchLean.Tensor [ctx.inputDim]) (htopo : CertSoundness.TopoSorted g) (hsem : CertSoundness.SemLocalOK g ps inputs vals) (hinputs : InputsMatch inputs ctx x) (hibp : IBPEnclosesVals ibp vals) (halpha : AlphaOK alpha) (id : ) (hid : id < g.nodes.size) (hparents : pg.nodes[id]!.parents, match cert[p]!, vals[p]! with | some bp, some vp => CrownCertSoundness.EnclosesAtInput ctx x bp vp | x, x_1 => True) (hnb : g.nodes[id]!.kind = IR.OpKind.reluCert.getBeta? beta id = none) {b : FlatAffineBounds } {v : CertSoundness.Val} (hs : stepAlphaBeta g ps ibp alpha beta ctx cert id = some b) (hv : vals[id]! = some v) :

Soundness of stepAlphaBeta at every node handled by the α-CROWN rule: all non-ReLU kinds, and ReLU nodes with no β entry. The step is literally stepAlpha there, so this is alphaCrown_transfer_sound read at one node.

theorem NN.MLTheory.CROWN.Graph.AlphaCrownTransferSoundness.alphaBetaCrown_relu_beta_case_sound (g : Graph) (ps : ParamStore ) (ibp : Array (Option (FlatBox ))) (alpha : Array (Option (FlatTensor ))) (beta : Array (Option (Array ))) (cert : Array (Option (FlatAffineBounds ))) (inputs : Std.HashMap CertSoundness.Val) (vals : Array (Option CertSoundness.Val)) (ctx : AffineCtx) (x : TorchLean.Tensor [ctx.inputDim]) (htopo : CertSoundness.TopoSorted g) (hsem : CertSoundness.SemLocalOK g ps inputs vals) (hibp : IBPEnclosesVals ibp vals) (halpha : AlphaOK alpha) (id : ) (hid : id < g.nodes.size) (hparents : pg.nodes[id]!.parents, match cert[p]!, vals[p]! with | some bp, some vp => CrownCertSoundness.EnclosesAtInput ctx x bp vp | x, x_1 => True) {phases : Array } (hk : g.nodes[id]!.kind = IR.OpKind.relu) (hbeta : Cert.getBeta? beta id = some phases) {b : FlatAffineBounds } {v : CertSoundness.Val} (hs : stepAlphaBeta g ps ibp alpha beta ctx cert id = some b) (hv : vals[id]! = some v) :

Soundness of stepAlphaBeta at a ReLU node carrying a β vector.

The step inversion supplies the parent's certificate entry, its IBP box, the α vector used, and the accepted phase relaxations; the semantics supplies the parent's value; enclosesAtInput_relu_beta does the rest.

Main transfer theorem #

theorem NN.MLTheory.CROWN.Graph.AlphaCrownTransferSoundness.alphaBetaCrown_transfer_sound (g : Graph) (ps : ParamStore ) (ibp : Array (Option (FlatBox ))) (alpha : Array (Option (FlatTensor ))) (beta : Array (Option (Array ))) (cert : Array (Option (FlatAffineBounds ))) (inputs : Std.HashMap CertSoundness.Val) (vals : Array (Option CertSoundness.Val)) (ctx : AffineCtx) (x : TorchLean.Tensor [ctx.inputDim]) (htopo : CertSoundness.TopoSorted g) (hsem : CertSoundness.SemLocalOK g ps inputs vals) (hinputs : InputsMatch inputs ctx x) (hibp : IBPEnclosesVals ibp vals) (halpha : AlphaOK alpha) :
CrownCertSoundness.CrownTransferSound g ps inputs vals ctx x (stepAlphaBeta g ps ibp alpha beta ctx) cert

Pointwise soundness of the graph-dialect α/β-CROWN transfer rule.

This is the β-extended analog of alphaCrown_transfer_sound. The step function additionally receives a beta array of per-ReLU phase constraints (active, inactive, unstable). At a ReLU node with a β vector, phaseRelaxVec? checks each phase against the IBP pre-activation interval via phaseConsistentScalar? (inactive needs u ≤ 0, active needs 0 ≤ l) and, if every phase passes, uses the phase's exact affine rule for that unit; an inconsistent phase rejects the step rather than falling back to another relaxation. All other nodes use the α-CROWN rule.

What the β relaxation contributes here, and what it does not. Because a phase is accepted only when the IBP interval already implies it, a β vector can never certify a sign that the supplied ibp box does not fix on its own; for such stable units the phase rule coincides with the standard relaxation. The theorem therefore establishes two things about β: the exact rules are sound whenever the consistency check passes, and inconsistent phase vectors are rejected. It does not model branch-and-bound split constraints. A split that tightens beyond IBP would have to be reflected in a tighter ibp argument, which this theorem takes as given through IBPEnclosesVals.

The theorem states that this concrete step function satisfies CrownTransferSound, and thus can be used as the trusted checker semantics in crown_checker_encloses_semantics.

theorem NN.MLTheory.CROWN.Graph.AlphaCrownTransferSoundness.alphaBetaCrown_cert_encloses_semantics (g : Graph) (ps : ParamStore ) (ibp : Array (Option (FlatBox ))) (alpha : Array (Option (FlatTensor ))) (beta : Array (Option (Array ))) (cert : Array (Option (FlatAffineBounds ))) (inputs : Std.HashMap CertSoundness.Val) (vals : Array (Option CertSoundness.Val)) (ctx : AffineCtx) (x : TorchLean.Tensor [ctx.inputDim]) (htopo : CertSoundness.TopoSorted g) (hsem : CertSoundness.SemLocalOK g ps inputs vals) (hinputs : InputsMatch inputs ctx x) (hibp : IBPEnclosesVals ibp vals) (halpha : AlphaOK alpha) (hcert : CrownCertSoundness.CrownCertLocalOK g (stepAlphaBeta g ps ibp alpha beta ctx) cert) (id : ) :
id < g.nodes.size∀ (b : FlatAffineBounds ) (v : CertSoundness.Val), cert[id]! = some bvals[id]! = some vCrownCertSoundness.EnclosesAtInput ctx x b v

A locally replayed α/β-CROWN certificate encloses every corresponding graph value.

This is the user-facing composition of alphaBetaCrown_transfer_sound with the generic graph certificate checker. The certificate producer remains untrusted: hcert requires its entries to agree node-by-node with TorchLean's α/β transfer function.