Lemma 6 — chain rule for the Jacobian of a layered network
ProvedCertDRO.NNSmooth.lemma_6chain-rulejacobianneural-networksp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1
Let be the output of the first layers of a network of depth , as in (20), and suppose every operation , , is differentiable. Then:
- for every the map is differentiable;
- for every its Jacobian satisfies the recursion
- for every , unrolling the recursion,
the product taken in network order (the identity for ).
Here denotes the Jacobian of . The recursion is the basis of the smoothness bounds of Proposition 5 and of the telescoping representation (34).
Formalization Note Layers are 0-based in Lean (Lean layer l is the paper's ). Part 2 is a HasFDerivAt statement for with the composed derivative; part 3 identifies fderiv (F l) x with the tail product of the definition file taken from layer at the same input . The paper prints the product with upper index ; it is read as .
Preamble
import Mathlib import Definitions.Def_CertDRO_NNSmooth_Network
Formal statement
namespace CertDRO.NNSmooth
open Network
/-- Lemma 6 (§B.8, p. 44). If `σ_l` is differentiable for every layer of a depth-`L` network, then
every `x ↦ F_l(θ; x)`, `l ≤ L`, is differentiable; its Jacobian satisfies the chain-rule recursion
`J_x F_{l+1}(θ; x) = Jσ_{l+1}(θ_{l+1} · F_l(θ; x)) · θ_{l+1} · J_x F_l(θ; x)` (0-based: layer `l`);
and it equals the product `∏ ∇σ_k(θ_k · F_{k-1}(θ; x)) · θ_k` over all `l` layers, i.e. the tail
product `tailJac x 0 l` taken at the same input `x`. -/
theorem lemma_6 (N : Network) (L : ℕ) (hσ : ∀ l < L, Differentiable ℝ (N.σ l)) :
(∀ l ≤ L, Differentiable ℝ (N.F l)) ∧
(∀ l < L, ∀ x : E (N.dO 0),
HasFDerivAt (N.F (l + 1))
((fderiv ℝ (N.σ l) (N.θ l (N.F l x))).comp ((N.θ l).comp (fderiv ℝ (N.F l) x))) x) ∧
(∀ l ≤ L, ∀ x : E (N.dO 0), fderiv ℝ (N.F l) x = N.tailJac x 0 l) := by sorry
end CertDRO.NNSmooth
Source
Sinha, Namkoong, Volpi, Duchi, Certifying Some Distributional Robustness with Principled Adversarial Training, arXiv:1710.10571v5, p. 44, §B.8, Lemma 6
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.