TorchLean API

NN.MLTheory.CROWN.Proofs.DirectedIBPTensor

Tensor enclosure for structural interval transfers #

Coordinatewise enclosure is preserved by changes of shape, broadcasting, and directed axis summation. These lemmas use the tensor operations executed by the forward IBP dispatcher.

A shaped endpoint pair encloses a real tensor at every coordinate.

Instances For
    theorem NN.MLTheory.CROWN.Graph.DirectedBackward.TensorEncloses.cast {α : Type} [TorchLean.Storage α] [Context α] [BoundOps α] [LawfulBoundOps α] {s t : Spec.Shape} {lo hi : TorchLean.Tensor α s} {x : TorchLean.Tensor ℝ s} (h : TensorEncloses lo hi x) (hst : s = t) :
    TensorEncloses (hst ▸ lo) (hst ▸ hi) (hst ▸ x)

    Reconstruct a real tensor from its row-major graph coordinates.

    Instances For

      Read the flat coordinates of a real tensor, extending them by zero out of bounds.

      Instances For
        @[simp]

        realTensor reads the flat graph value at the row-major position of each coordinate.

        Flattened endpoint bounds recover enclosure of the shaped real input.

        theorem NN.MLTheory.CROWN.Graph.DirectedBackward.TensorEncloses.row {α : Type} [TorchLean.Storage α] [Context α] [BoundOps α] [LawfulBoundOps α] {s : Spec.Shape} {lo hi : TorchLean.Tensor α s} {x : TorchLean.Tensor ℝ s} (h : TensorEncloses lo hi x) {f : ℕ → ℝ} (hf : ∀ (i : Fin s.size), f ↑i = x.flattenSpec.getScalar i) :
        RowEncloses { dim := s.size, lo := lo.flattenSpec, hi := hi.flattenSpec } s.size f

        A shaped enclosure gives the flat graph enclosure when the real coordinates agree.

        The induction follows both the selected axis and every surviving leading dimension.