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 #
- Everything here is spec-level and real-valued (
ℝ), so we can freely use Mathlib's analysis and order theory. Tensor ℝ sis anInnerProductSpace ℝ(seeNN.Proofs.Tensor.Euclidean). The bridge lemmastensorL2Norm_eq_norm,tensorL2Dist_eq_dist, andSpec.dot_eq_inneridentifytensorL2Norm,tensorL2Dist, andSpec.dotwith‖·‖,dist, and⟪·, ·⟫_ℝ; every norm inequality below is then a direct instance of the Mathlib theorem.NN.MLTheory.Robustness.Specalso has scalar-polymorphic norm definitions for runtime and verification statements. This file does not duplicate that API surface; it proves real-valued theorems and includes bridge lemmas where those polymorphic specs need theorem-level support.
PyTorch correspondence / citations #
- The $\ell_2$ norm corresponds to PyTorch's
torch.linalg.vector_norm/torch.linalg.norm. https://pytorch.org/docs/stable/generated/torch.linalg.vector_norm.html https://pytorch.org/docs/stable/generated/torch.linalg.norm.html
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 #
$\ell_2$ norm (Euclidean norm) for tensors. Fundamental for measuring tensor magnitudes and distances.
Instances For
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.
The squared norm is the coordinate sum of squares.
tensorNormSquared is the squared Euclidean norm.
tensorL2Norm is the 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.
tensorL2Dist is symmetric.
Triangle inequality for tensorL2Dist.