Lipschitz bounds for neural-network operations #
This module owns Lipschitz estimates for ReLU, matrix-vector multiplication, linear layers, and
composition. The underlying real-valued tensor norm API lives in
NN.Proofs.Analysis.Lipschitz.Norm.
Import NN.Proofs.Analysis.Lipschitz for the complete norm and network-bound API.
Bridges between tensorL2Dist bounds and Mathlib's LipschitzWith #
A tensorL2Dist bound with a nonnegative constant is a Mathlib Lipschitz bound.
A Mathlib Lipschitz bound on real tensors is a tensorL2Dist bound.
ReLU is 1-Lipschitz in the L2 norm for tensors of every shape.
ReLU is 1-Lipschitz for the Euclidean metric on real tensors.
Tensor subtraction can be rewritten as addition of a -1 scale.
This is a small algebraic normal form used by linear-operator proofs, where it is often easier to
reuse additive and scaling lemmas than reason about subSpec directly.
Matrix-vector multiplication sends the zero vector to the zero vector.
The proof follows the spec definition: each output coordinate is a fold over scalar products, and every scalar product contains a zero input coordinate.
Frobenius norm of a matrix tensor.
We use the Frobenius-norm-style bound:
$$ \lVert W\rVert_F =\sqrt{\sum_i\lVert\operatorname{row}_i(W)\rVert_2^2}, $$
This is an upper bound for the induced Euclidean operator norm; it is not the spectral norm.
Instances For
The Frobenius norm bounds matrix-vector multiplication in the Euclidean norm.
Matrix-vector multiplication is Lipschitz with its matrix's Frobenius norm as a bound.
Composing the two distance bounds multiplies their constants.
The nonnegative Lg preserves the inequality when multiplying the bound for f.
No sign assumption on Lf is needed.
ReLU after matrix-vector multiplication retains the matrix's Frobenius Lipschitz bound.