MLP robustness: basic analytic lemmas #
This file proves L2 Lipschitz bounds for spec-level linear layers and two-layer ReLU MLPs, with
the Frobenius norm of each weight matrix as the layer constant. The general tensor-norm facts come
from NN.Proofs.Analysis.Lipschitz.
References #
Frobenius-norm Lipschitz bound for a linear layer's weight matrix.
Instances For
The Frobenius constant is nonnegative.
The Frobenius constant is positive for a nonzero weight matrix.
A linear layer is Lipschitz in L2 with the Frobenius norm of its weights as a valid, possibly loose, constant. The bias cancels in the difference of two outputs.
ReLU is 1-Lipschitz in the L2 distance, so activations never amplify an input perturbation.
A two-layer ReLU MLP is Lipschitz in L2, with the product of the two Frobenius constants.
The constant is the naive product of layer norms, which is what makes it cheap: it needs no
information about the input region. That is also why it is loose compared to the CROWN bounds in
NN.MLTheory.CROWN, and the contrast is the reason both developments are kept.
Repackage mlp_lipschitz_frobenius as a robustness-spec IsLipschitzContinuous fact with a
positive constant. The nonzero-weight hypotheses only make the Frobenius product positive.
This is the form expected by the certified-robustness lemmas in
NN.MLTheory.Proofs.Verification.Robustness.LipschitzCertified.