TorchLean API

NN.Verification.Cert.FiniteArtifactSemantics

Exact-real IR semantics for the finite artifact fragment #

The payload below reads the same binary32 parameter store as the fragment decoder. Successful tensor decoding retains each finite word's exact real value. The node equations use the ordinary IR evaluator, including its shape and parent checks.

theorem NN.Verification.Cert.FiniteArtifact.accepts_graph_sound (g : MLTheory.CROWN.Graph) (ps : MLTheory.CROWN.Graph.ParamStore (FloatLib.Floats.ExecFloat.Binary 8 23 FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.Encoding.ieee (FloatLib.Floats.Formats.BinaryInterchange.FloatFormat.Encoding.ieee.defaultBias 8) exactPayload._proof_1 exactPayload._proof_2 exactPayload._proof_3 exactPayload._proof_4)) (cert : NodeReplay.CROWNCertificate) (query : OutputQuery) (h : accepts g ps cert query = true) :
∃ (decoded : Decoded), decode g ps cert query = some decoded ∧ nodeBounds cert query.outputId decoded.graph.inputDim decoded.graph.outputDim = some decoded.artifact.chain.bounds ∧ 0 < decoded.graph.inputDim ∧ 0 < decoded.graph.outputDim ∧ 0 < decoded.numConstraints ∧ ∀ (x : TorchLean.Tensor ℝ [decoded.graph.inputDim]), MLTheory.CROWN.Graph.Theorems.Semantics.encloses { dim := decoded.graph.inputDim, lo := RationalReflection.realTensor decoded.graph.input.lo, hi := RationalReflection.realTensor decoded.graph.input.hi } x → ∃ (y : TorchLean.Tensor ℝ [decoded.graph.outputDim]), IR.Graph.denote g (exactPayload ps) { shape := [decoded.graph.inputDim], tensor := x } query.outputId = Except.ok { shape := [decoded.graph.outputDim], tensor := y } ∧ ∀ (i : Fin decoded.numConstraints), have margin := (Spec.matVecMulSpec (RationalReflection.realTensor decoded.inequalities.weights) y).addSpec (RationalReflection.realTensor decoded.inequalities.bias); if decoded.strict = true then margin.getScalar i < 0 else margin.getScalar i ≤ 0

The requested margins hold for the original graph under its exactly decoded payload.