TorchLean API

NN.Proofs.Analysis.Lipschitz.Norm

Real-valued tensor norm facts #

This module owns the proof-oriented Tensor norm and distance definitions over ℝ, together with their algebraic properties. Neural-network Lipschitz bounds build on these facts in NN.Proofs.Analysis.Lipschitz.Network.

Scope and conventions #

PyTorch correspondence / citations #

Import NN.Proofs.Analysis.Lipschitz for both the norm foundation and network bounds, or this module when only the norm theory is needed.

Tensor norms and distance functions #

noncomputable def Proofs.tensorL2Norm {s : Spec.Shape} (t : TorchLean.Tensor ℝ s) :

$\ell_2$ norm (Euclidean norm) for tensors. Fundamental for measuring tensor magnitudes and distances.

Instances For
    noncomputable def Proofs.tensorL2Dist {s : Spec.Shape} (x y : TorchLean.Tensor ℝ s) :

    Distance function based on the $\ell_2$ norm.

    Instances For

      Bridges to the inner product space structure #

      The zero-filled tensor is the zero of the additive group.

      Scaling by a scalar is the module action.

      tensorNormSquared is the squared Euclidean norm.

      Squaring the $\ell_2$ norm recovers the squared-norm spec.

      tensorL2Dist is the Euclidean distance.

      Cross-library norm facts #

      NN.MLTheory.Robustness.Spec defines a scalar-polymorphic tensorLinfNorm. In this file we work over $\mathbb R$ and often use tensorL2Norm. The key inequality $\lVert v\rVert_\infty\le\lVert v\rVert_2$ is what lets $\ell_2$-based Lipschitz proofs feed directly into the $\ell_\infty$-robustness lemmas.

      For a real vector-valued tensor, the $\ell_\infty$ norm from NN.MLTheory.Robustness.Spec is bounded by the $\ell_2$ norm from this file:

      $\lVert v\rVert_\infty\le\lVert v\rVert_2$.

      Basic norm properties used throughout the Lipschitz development #

      The $\ell_2$ norm is nonnegative.

      The $\ell_2$ norm is zero if and only if the tensor is zero.

      Cauchy-Schwarz inequality for tensors. For any tensors $x$ and $y$, $|\langle x,y\rangle|\le\lVert x\rVert\,\lVert y\rVert$. This is a fundamental inequality in inner product spaces.

      Triangle inequality for the $\ell_2$ norm.

      Homogeneity of the $\ell_2$ norm.