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, anddot_eq_inneridentify the historicaltensorL2Norm,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 #
- $\ell_2$/$\ell_1$/$\ell_\infty$ norms correspond to PyTorch's
torch.linalg.*_norm/torch.linalg.normAPIs. 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
$\ell_\infty$ norm (maximum norm) for tensors. Important for uniform convergence and pointwise bounds.
Instances For
$\ell_1$ norm (Manhattan norm) for tensors. Useful for sparsity-inducing regularization.
Instances For
Distance function based on the $\ell_2$ norm.
Instances For
Distance function based on the $\ell_\infty$ 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.
Spec.dot is the Euclidean inner product.
tensorNormSquared is the squared Euclidean norm.
tensorL2Norm is the Euclidean norm.
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.
Basic lemma: dot product with zero tensor is zero.
Bilinearity of dot product over addition (distributive property).
Bilinearity of the dot product: $\operatorname{dot}(x+ty,x+ty)=\lVert x\rVert^2+2t\langle x,y\rangle+t^2\lVert y\rVert^2$.
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.