TorchLean API

NN.Verification.Cert.CROWNQuery

Exact CROWN output-query checks #

Recompute affine bounds for dense/ReLU networks and prove strict or non-strict output inequalities over an input box. The arithmetic is rational; the conclusion uses TorchLean's existing real module semantics. Every transfer and final query check is proved here, with no external soundness premise.

Check all upper endpoints against zero, using strict inequalities when requested.

Instances For

    Affine bounds with their input and output dimensions checked by Lean.

    Instances For

      Forget the static dimensions to reuse the dimension-carrying CROWN transfer functions.

      Instances For

        The bounds enclose a value at a particular real input.

        Instances For

          The identity affine bounds at the network input.

          Instances For

            Push affine bounds through an exact linear layer with the sign-split CROWN transfer.

            Instances For

              Bound each affine form over the original input box.

              Instances For

                Push affine bounds through ReLU using the α lower and triangle upper relaxations.

                Instances For

                  Every proposed ReLU lower slope lies in [0, 1], as the relaxation soundness requires.

                  Instances For

                    Dense/ReLU networks with a proposed lower-relaxation slope at each ReLU.

                    Instances For

                      Use the same linear and activation modules as ordinary TorchLean models.

                      Instances For

                        Recompute affine bounds with existing CROWN transfers and exact rational arithmetic.

                        Instances For
                          theorem NN.Verification.Cert.CROWNQuery.Network.propagate_sound {n m k : ℕ} (net : Network m k) (b : Bounds n m) (input : MLTheory.CROWN.Box ℚ [n]) (out : Bounds n k) (h : net.propagate b input = some out) (x : TorchLean.Tensor ℝ [n]) (y : TorchLean.Tensor ℝ [m]) (hx : MLTheory.CROWN.Graph.Theorems.Semantics.encloses { dim := n, lo := RationalReflection.realTensor input.lo, hi := RationalReflection.realTensor input.hi } x) (hy : b.Encloses x y) :
                          out.Encloses x (net.model.forward y)

                          Replayed bounds enclose the whole network, not just individual certificate entries.

                          A conjunction of affine output inequalities, interpreted as weights * output + bias.

                          Instances For

                            Every lower endpoint is at most its upper endpoint; a reversed box has no real members.

                            Instances For

                              Reject reversed boxes and empty input, output, or query dimensions.

                              Instances For

                                An executable safety check; no externally supplied affine bounds are trusted.

                                Instances For

                                  Every real input in the decoded box satisfies every decoded output inequality.

                                  Instances For

                                    Acceptance implies query-level soundness with no unproved transfer or coverage premise.