TorchLean API

NN.MLTheory.CROWN.Proofs.GraphCertSoundness.Main.AffineOps

Certificate Soundness: Affine Nodes #

Operator cases linear and matmul of the IBP certificate induction. Both reduce to one box-level lemma about IBP.linear with a point bias box; matmul instantiates the bias with the zero vector.

Box-level enclosure #

theorem NN.MLTheory.CROWN.Graph.CertSoundness.enclosesBox_ibp_linear {B1 : FlatBox } {v1 : Val} {m n : } (W : TorchLean.Tensor [m, n]) (b : TorchLean.Tensor [m]) (h1 : EnclosesBox B1 v1) (hXin : B1.dim = n) (hxDim : v1.n = n) :
EnclosesBox (toFlatBox m (IBP.linear W (castBoxDim hXin (ofFlatBox B1)) (Box.point b))) { n := m, v := Spec.linearSpec { weights := W, bias := b } (castDimScalar hxDim v1.v) }

IBP.linear with a point bias box encloses the affine image of an enclosed value, once the input box and the value are cast to the weight's input dimension.

Node-level soundness #

theorem NN.MLTheory.CROWN.Graph.CertSoundness.linear_node_encloses {nodes : Array Node} {ps : ParamStore } {cert : Array (Option (FlatBox ))} {inputs : Std.HashMap Val} {vals : Array (Option Val)} {k : } {B : FlatBox } {v : Val} (hkKind : nodes[k]!.kind = IR.OpKind.linear) (hcertStep : certStepNode? nodes ps cert k = some B) (hvalStep : evalNode? nodes ps inputs vals k = some v) (hpe : ParentsEnclosed nodes cert vals k) :

Certificate soundness at a linear node.

theorem NN.MLTheory.CROWN.Graph.CertSoundness.matmul_node_encloses {nodes : Array Node} {ps : ParamStore } {cert : Array (Option (FlatBox ))} {inputs : Std.HashMap Val} {vals : Array (Option Val)} {k : } {B : FlatBox } {v : Val} (hkKind : nodes[k]!.kind = IR.OpKind.matmul) (hcertStep : certStepNode? nodes ps cert k = some B) (hvalStep : evalNode? nodes ps inputs vals k = some v) (hpe : ParentsEnclosed nodes cert vals k) :

Certificate soundness at a matmul node.