End-to-end CROWN certificate-checking framework (graph dialect) #
This file provides the reusable end-to-end CROWN certificate-checking framework for graph dialects:
- an "end-to-end" enclosure theorem that composes:
- a value semantics (
evalNode?/SemLocalOK) - a per-node CROWN certificate (
FlatAffineBounds) - a checker predicate (local consistency + per-op transfer soundness)
- a value semantics (
The main theorem is phrased in the standard "if the checker accepts, the bound holds" style.
Relation to auto_LiRPA / alpha-beta-CROWN #
This file is written in a producer/checker style that matches common workflows:
- an external engine (e.g. the LiRPA engine in
auto_LiRPA, or the verifier inalpha-beta-CROWN) can act as an untrusted producer of per-node affine bounds; - Lean hosts the checker theorem: given a concrete step function and proved
CrownTransferSoundrules, accepted per-node affine bounds imply an end-to-end enclosure against the Lean graph denotation.
We deliberately state the main theorem schematically in terms of an abstract step function:
plain CROWN, α-CROWN, and α/β-CROWN can all share the same end-to-end checker theorem once their
transfer rules are proved sound.
Trust boundary for transcendental ops #
IEEE-754 does not standardize libm transcendental functions. For ops like exp, log, tanh,
and sigmoid, soundness is therefore expressed as an explicit assumption in the checker predicate.
A concrete checker may discharge that assumption with a proved approximation or a validated
external interval enclosure, but it may not infer it from a particular libm implementation.
References (code) #
auto_LiRPA: https://github.com/Verified-Intelligence/auto_LiRPAalpha-beta-CROWN: https://github.com/Verified-Intelligence/alpha-beta-CROWN
Pointwise interpretation of affine bounds #
A FlatAffineBounds α represents (componentwise) affine lower/upper functions of a fixed
flattened input vector. To compare it to a concrete semantic value, we evaluate the affine maps at
the chosen input point.
Instances For
Evaluate affine lower/upper bounds at a concrete input point, yielding a FlatBox.
Instances For
Enclosure predicate #
We reuse Semantics.encloses from NN.MLTheory.CROWN.Graph for componentwise enclosure.
Enclosure of a node value v under an affine bound b, evaluated at the designated input x.
This is a well-typed variant of EnclosesVec (boundsEvalAt b x) v that guards the dependent
dimension b.inDim.
In a well-formed CROWN certificate, every bound satisfies b.inDim = ctx.inputDim, so the guard
branch is the one that matters.
Instances For
Local semantic consistency #
We reuse the real-valued graph dialect evaluator from graph_cert_soundness.lean, but we keep the
definition abstract: the CROWN enclosure theorem below holds for any locally-consistent
semantic interpretation vals (provided the graph is topologically sorted).
For IEEE32Exec, a separate evaluator can be plugged in later; the theorem below is stated for any
vals satisfying SemLocalOK.
Alias for the semantic value record used by CertSoundness.
Instances For
Alias for the partial node evaluator used by CertSoundness.
Instances For
Alias for the local semantic consistency predicate used by CertSoundness.
Instances For
Alias for the topological-sorting predicate used by CertSoundness.
Instances For
A CROWN certificate "step function" (checker interface) #
The runtime runCROWN produces FlatAffineBounds by a forward pass. For a certificate/checker
architecture, we treat the producer as untrusted and phrase correctness as a local step condition:
CrownCertLocalOK: the certificate is locally consistent with a (trusted) step function.CrownTransferSound: each node kind's step function is sound w.r.t. the semantics.
This file separates the generic checker theorem from per-operator transfer proofs. In particular, transcendental operators are represented by explicit transfer-soundness assumptions supplied by the backend or checker workflow.
Instances For
crownStepNode? is a parameter to the checker theorem:
different certificate formats (plain CROWN, α/β-CROWN, split certificates) can share the same
end-to-end theorem as long as they provide a step function and discharge transfer soundness.
Instances For
Transfer-rule soundness assumptions #
CrownTransferSound is the kernel of the checker theorem: it states that the certificate's local
step rule is sound for each supported node kind.
For transcendental ops, this assumption is where you connect to an oracle model (e.g. Arb).
Instances For
Checker implies enclosure #
If a certificate is locally consistent and the transfer rules are sound, then every certified node encloses the graph value computed at that node.
This theorem does not pick a certificate producer or a nonlinear backend. Those details come in
through step and CrownTransferSound.
IEEE32Exec specialization #
For IEEE32 we still leave the node evaluator to the caller. The caller supplies the evaluator,
proves that vals is its trace, and proves that evaluating node id does not read vals[id]!.
The floating-point refinement theorem itself lives outside this checker lemma.
Instances For
Instances For
The IEEE32 node evaluator may inspect already-computed values, but not the slot it is supposed to compute.