TorchLean API

NN.MLTheory.CROWN.Proofs.DirectedBackwardState

Coefficient and constant invariants for backward CROWN #

An absent coefficient represents zero. A present coefficient box must have the node's width and enclose its exact real coefficient vector. This convention makes repeated parent occurrences ordinary additions, including cancellation between the two parents of subtraction.

A box has the expected width and encloses a real coefficient at each valid coordinate.

Instances For

    The coefficient table encloses an exact real coefficient for every node.

    Instances For

      Both coefficient intervals and the accumulated constant contain an exact objective.

      Instances For
        theorem NN.MLTheory.CROWN.Graph.DirectedBackward.addCoeff_encloses {α : Type} [TorchLean.Storage α] [Context α] [BoundOps α] [LawfulBoundOps α] {dims : ℕ → ℕ} {st : Internal.DirectedBackwardState α} {f : ℕ → ℕ → ℝ} {c : ℝ} (hstate : StateEncloses dims st f c) (pid : ℕ) (hp : pid < st.coeffs.size) (box : FlatBox α) (a : ℕ → ℝ) (hbox : RowEncloses box (dims pid) a) :
        StateEncloses dims (Internal.addDirectedCoeff st pid box) (fun (id i : ℕ) => if id = pid then f id i + a i else f id i) c ∧ (Internal.addDirectedCoeff st pid box).failed = st.failed ∧ (Internal.addDirectedCoeff st pid box).coeffs.size = st.coeffs.size

        Updating one coefficient row adds its exact contribution, even when the row was absent.

        theorem NN.MLTheory.CROWN.Graph.DirectedBackward.addConstant_encloses {α : Type} [TorchLean.Storage α] [Context α] [BoundOps α] [LawfulBoundOps α] {dims : ℕ → ℕ} {st : Internal.DirectedBackwardState α} {f : ℕ → ℕ → ℝ} {c : ℝ} (hstate : StateEncloses dims st f c) (lo hi : α) (d : ℝ) (hd : LawfulBoundOps.toReal lo ≤ d ∧ d ≤ LawfulBoundOps.toReal hi) :

        Accumulating a constant interval preserves enclosure of the exact shifted constant.

        Negating a coefficient exchanges the endpoints and encloses its exact additive inverse.

        @[simp]

        Coefficient accumulation never changes the number of graph rows, even on failure.

        @[simp]

        Discharging a node only changes the constant or the failure flag.

        A failed state remains failed while accumulating any later coefficient.

        theorem NN.MLTheory.CROWN.Graph.DirectedBackward.initial_encloses {α : Type} [TorchLean.Storage α] [Context α] [BoundOps α] [LawfulBoundOps α] (dims : ℕ → ℕ) (size output : ℕ) (obj : FlatTensor α) (hdim : obj.n = dims output) :
        StateEncloses dims { coeffs := (Array.replicate size none).set! output (some (FlatBox.ofTensor obj.v)), cstLo := 0, cstHi := 0 } (fun (id i : ℕ) => if id = output then LawfulBoundOps.toReal (Spec.getAtOrZero obj.v [i]) else 0) 0

        The initial table encloses the output objective and zero at every other node.