Lipschitz-based robustness lemmas #
This file connects Lipschitz continuity assumptions to the robustness specifications from
NN.MLTheory.Robustness.Spec.
Main results (over $\mathbb{R}$):
- An $L$-Lipschitz map is adversarially robust: $\varepsilon$ input perturbations imply $L\varepsilon$ output perturbations.
- If a logits vector has a positive logit margin, then its
argmaxclassifier is stable under sufficiently small $\ell_\infty$ perturbations; combined with an output-$\ell_\infty$ Lipschitz bound, this yields certified robustness radii.
Lipschitz continuity implies adversarial robustness #
If $f$ is $L$-Lipschitz and $L\geq 0$, then $f$ is adversarially robust at $x_0$: every input within distance $\varepsilon$ of $x_0$ maps within distance $L\varepsilon$ of $f(x_0)$.
Bridging $\ell_2$ and $\ell_\infty$ Lipschitz predicates #
$\ell_2$-Lipschitz implies $\ell_\infty$-Lipschitz into logits, with the same constant.
This is the standard norm comparison $\lVert v\rVert_\infty\leq\lVert v\rVert_2$ (proved as
Proofs.tensor_linf_norm_le_tensor_l2_norm).
Argmax stability from a positive logit margin #
The argmax classifier on logits vectors, breaking ties by the earliest index.
When $n=0$, this returns $0$ by convention.
Instances For
HasLogitMargin y c m means class $c$ beats every competitor by at least $m$ in logit value.
Instances For
If $y_0$ has a positive logit margin $m$ for class $c$, then any $y$ within $\ell_\infty$
distance $\delta$ with $2\delta<m$ has the same argmax class.
If $y_0$ has margin $m>0$ for class $c$, then $c$ is the argmaxClassifier of $y_0$.
Certified robustness from a Lipschitz bound and a logit margin #
If $f$ is $L$-Lipschitz into $\ell_\infty$ logits and the reference logits $f(x_0)$ have margin $m$ for class $c$, then any input perturbation of radius $\varepsilon$ with $2L\varepsilon<m$ preserves the predicted class.
This is a standard “margin over Lipschitz constant” certified robustness lemma.
Certified robustness, but starting from an output-$\ell_2$ Lipschitz assumption.
This avoids requiring the user to manually insert the norm-equivalence step $\lVert\cdot\rVert_\infty\leq\lVert\cdot\rVert_2$.