Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

(34) — telescoping representation of J_xF_l(θ; x) − J_xF_l(θ; x′)

Proved
CertDRO.NNSmooth.eq_34

by mikedeng1 · Oct 8, 2026 · Mathlib 0df444a (Lean v4.33.1)

jacobianneural-networksp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1telescoping

Let every operation σl\sigma_lσl​, l=1,…,Ll=1,\dots,Ll=1,…,L, of a network of depth LLL be differentiable. Then for every l=0,…,Ll=0,\dots,Ll=0,…,L and all inputs x,x′x,x'x,x′,

JxFl(θ;x)−JxFl(θ;x′)=∑j=1l(∏k=j+1l∇σk(θk⋅Fk−1(θ;x′))⋅θk)⏟(a)⋅(∇σj(θj⋅Fj−1(θ;x))−∇σj(θj⋅Fj−1(θ;x′)))⏟(b)⋅θj⋅JxFj−1(θ;x)⏟(c),J_xF_l(\theta;x)-J_xF_l(\theta;x')=\sum_{j=1}^{l}\underbrace{\Big(\prod_{k=j+1}^{l}\nabla\sigma_k(\theta_k\cdot F_{k-1}(\theta;x'))\cdot\theta_k\Big)}_{(a)}\cdot\underbrace{\big(\nabla\sigma_j(\theta_j\cdot F_{j-1}(\theta;x))-\nabla\sigma_j(\theta_j\cdot F_{j-1}(\theta;x'))\big)}_{(b)}\cdot\underbrace{\theta_j\cdot J_xF_{j-1}(\theta;x)}_{(c)},Jx​Fl​(θ;x)−Jx​Fl​(θ;x′)=j=1∑l​(a)(k=j+1∏l​∇σk​(θk​⋅Fk−1​(θ;x′))⋅θk​)​​⋅(b)(∇σj​(θj​⋅Fj−1​(θ;x))−∇σj​(θj​⋅Fj−1​(θ;x′)))​​⋅(c)θj​⋅Jx​Fj−1​(θ;x)​​,

where products are taken in network order, the empty product (j=lj=lj=l) is the identity, and F0(θ;x)=xF_0(\theta;x)=xF0​(θ;x)=x.

This is the telescoping identity for a difference of products of linear maps, applied to the Jacobians of Lemma 6; the proof of the second half of Proposition 5 bounds each of (a), (b), (c) separately.

Formalization Note The paper's display first writes the difference of products as a "product of differences"; that line is a misprint (a difference of products is not a product of differences) and is not formalized. Only the telescoped sum, which is what the proof uses, is stated. In Lean the summation index jjj is 0-based (summand jjj is the paper's j+1j+1j+1), and term (a) is the tail product of the definition file, from layer j+1j+1j+1 to layer lll, at the input x′x'x′.

Preamble
import Mathlib
import Definitions.Def_CertDRO_NNSmooth_Network
Formal statement
namespace CertDRO.NNSmooth

open Network

/-- (34) (§B.8, p. 45), the telescoping identity: if every `σ_l` of a depth-`L` network is
differentiable, then for `l ≤ L` and inputs `x, x'`,
`J_x F_l(θ; x) − J_x F_l(θ; x') = ∑_{j=1}^{l} (a)_j · (b)_j · (c)_j` with
(a) the tail product `∏_{k=j+1}^{l} ∇σ_k(θ_k · F_{k-1}(θ; x')) · θ_k` (at `x'`),
(b) `∇σ_j(θ_j · F_{j-1}(θ; x)) − ∇σ_j(θ_j · F_{j-1}(θ; x'))`, and
(c) `θ_j · J_x F_{j-1}(θ; x)` (at `x`).
In 0-based indices the summand `j ∈ range l` is the paper's `j + 1`. -/
theorem eq_34 (N : Network) (L : ℕ) (hσ : ∀ l < L, Differentiable ℝ (N.σ l)) :
    ∀ l ≤ L, ∀ x x' : E (N.dO 0),
      fderiv ℝ (N.F l) x - fderiv ℝ (N.F l) x' =
        ∑ j ∈ Finset.range l, (N.tailJac x' (j + 1) l).comp
          ((fderiv ℝ (N.σ j) (N.θ j (N.F j x)) - fderiv ℝ (N.σ j) (N.θ j (N.F j x'))).comp
            ((N.θ j).comp (fderiv ℝ (N.F j) x))) := by sorry

end CertDRO.NNSmooth
Source
Sinha, Namkoong, Volpi, Duchi, Certifying Some Distributional Robustness with Principled Adversarial Training, arXiv:1710.10571v5, p. 45, §B.8, (34)
Human review
  • Endorsed by Shuze Chen · Oct 9, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 9, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me