Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Theorem 3 — Transformation of the Gradient and Hessian

Proved
DinhSharpness.DerivativeTransformation

by Minghui · Sep 26, 2026 · Mathlib c5ea003 (Lean v4.30.0)

analysismachine-learningneural-networks

Let LLL be continuous and satisfy the local twice Fréchet differentiability condition at θ\thetaθ. For every α>0\alpha>0α>0, the same regularity holds at TαθT_\alpha\thetaTα​θ, and for all parameter directions u,wu,wu,w,

DL(Tαθ)[u]=DL(θ)[Tα−1u],DL(T_\alpha\theta)[u]=DL(\theta)[T_{\alpha^{-1}}u],DL(Tα​θ)[u]=DL(θ)[Tα−1​u], HL(Tαθ)[u,w]=HL(θ)[Tα−1u,Tα−1w].H_L(T_\alpha\theta)[u,w] =H_L(\theta)[T_{\alpha^{-1}}u,T_{\alpha^{-1}}w].HL​(Tα​θ)[u,w]=HL​(θ)[Tα−1​u,Tα−1​w].

No critical-point or minimum assumption is imposed here. Formalization note: direct source Theorem 3, expressing its row-gradient formula as equality of linear functionals and its Hessian congruence as equality on two arguments. Transport of local regularity records that these are actual derivatives.

Source: Laurent Dinh, Razvan Pascanu, Samy Bengio, Yoshua Bengio, Sharp Minima Can Generalize For Deep Nets, ICML 2017, arXiv:1703.04933v2, https://arxiv.org/abs/1703.04933v2; Section 4.2, PDF p. 5, Theorem 3 and its unnumbered first- and second-derivative identities; Section 2, PDF p. 2.

Notation and network conventions

Let d,h≥1d,h\ge1d,h≥1 be the input dimension and hidden width. The parameter θ=(W,v)\theta=(W,v)θ=(W,v) consists of W∈Rd×hW\in\mathbb R^{d\times h}W∈Rd×h and v∈Rhv\in\mathbb R^hv∈Rh, with the Euclidean norm on all n=dh+hn=dh+hn=dh+h entries. The scalar-output network is

fθ(x)=∑j=1hmax⁡ ⁣(∑i=1dxiWij,0)vj,x∈Rd.f_\theta(x)=\sum_{j=1}^h \max\!\left(\sum_{i=1}^d x_i W_{ij},0\right)v_j, \qquad x\in\mathbb R^d.fθ​(x)=j=1∑h​max(i=1∑d​xi​Wij​,0)vj​,x∈Rd.

There are no biases and no output activation. For any real-valued functional ℓ\ellℓ on prediction functions, L(θ)=ℓ(fθ)L(\theta)=\ell(f_\theta)L(θ)=ℓ(fθ​). In particular, losses with additional parameter-dependent penalties are not included unless they also admit this representation. The positive rescaling is

Tα(W,v)=(αW,α−1v),α>0.T_\alpha(W,v)=(\alpha W,\alpha^{-1}v),\qquad \alpha>0.Tα​(W,v)=(αW,α−1v),α>0.

Observational equivalence means equality of predictions on every input.

The local regularity condition means that LLL is Fréchet differentiable at every point of some neighborhood of θ\thetaθ, and the map z↦DL(z)z\mapsto DL(z)z↦DL(z) is Fréchet differentiable at θ\thetaθ. Write HL(θ)=D(DL)(θ)H_L(\theta)=D(DL)(\theta)HL​(θ)=D(DL)(θ), a continuous bilinear form. Its norm is

∥HL(θ)∥=sup⁡∥u∥≤1, ∥w∥≤1∣HL(θ)[u,w]∣.\|H_L(\theta)\|=\sup_{\|u\|\le1,\,\|w\|\le1} |H_L(\theta)[u,w]|.∥HL​(θ)∥=∥u∥≤1,∥w∥≤1sup​∣HL​(θ)[u,w]∣.

Under Euclidean/Riesz identification, this is the spectral operator norm of the Hessian matrix. A local minimum uses the usual Euclidean neighborhood; it need not be isolated or global. No probability model is assumed: the claim is deterministic and compares the same prediction function.

Formalization note: the network and scaling directly encode Section 3, Definition 3 (PDF p. 3), Theorem 1 and Definition 5 (PDF p. 4). The function-based continuous-loss convention is Section 2, PDF p. 2. For the Hessian targets, the local regularity condition makes the source's implicit second differentiability explicit without requiring global smoothness or continuity of second derivatives. The model defines actual Fréchet derivatives, not an arbitrary matrix constrained by desired conclusions. Relevant displayed formulas have no equation numbers.

Preamble
import Definitions.Def_DinhSharpness_Model
Formal statement
namespace DinhSharpness
theorem DerivativeTransformation :
  ∀ (d h : ℕ), 0 < d → 0 < h →
    ∀ (ℓ : (Input d → ℝ) → ℝ), Continuous (parameterLoss (h := h) ℓ) →
      ∀ (θ : Parameter d h), TwiceDifferentiableAt (parameterLoss ℓ) θ →
        ∀ (α : ℝ), 0 < α →
          TwiceDifferentiableAt (parameterLoss ℓ) (scale α θ) ∧
          (∀ u : Parameter d h,
            fderiv ℝ (parameterLoss ℓ) (scale α θ) u =
              fderiv ℝ (parameterLoss ℓ) θ (scale α⁻¹ u)) ∧
          (∀ u v : Parameter d h,
            hessian (parameterLoss ℓ) (scale α θ) u v =
              hessian (parameterLoss ℓ) θ (scale α⁻¹ u) (scale α⁻¹ v)) := by sorry
end DinhSharpness
Source
Laurent Dinh, Razvan Pascanu, Samy Bengio, Yoshua Bengio, Sharp Minima Can Generalize For Deep Nets, ICML 2017, arXiv:1703.04933v2, https://arxiv.org/abs/1703.04933v2; Section 4.2, PDF p. 5, Theorem 3 and its unnumbered first- and second-derivative identities; Section 2, PDF p. 2.
Read-back

What the Lean code literally says, in plain math · gpt-6

For every pair of natural numbers d,hd,hd,h with d>0d>0d>0 and h>0h>0h>0, identify the input space with Euclidean Rd\mathbb R^dRd and the parameter space with the Euclidean space P=Rd×h×RhP=\mathbb R^{d\times h}\times\mathbb R^hP=Rd×h×Rh, whose coordinates are indexed by the disjoint union ({0,…,d−1}×{0,…,h−1})⊔{0,…,h−1}(\{0,\ldots,d-1\}\times\{0,\ldots,h-1\})\sqcup\{0,\ldots,h-1\}({0,…,d−1}×{0,…,h−1})⊔{0,…,h−1}. For every functional ℓ:(Rd→R)→R\ell:(\mathbb R^d\to\mathbb R)\to\mathbb Rℓ:(Rd→R)→R, define the scalar parameter function by L(W,a)=ℓ(x↦∑j=0h−1max⁡{∑i=0d−1xiWij,0} aj)L(W,a)=\ell\bigl(x\mapsto\sum_{j=0}^{h-1}\max\{\sum_{i=0}^{d-1}x_iW_{ij},0\}\,a_j\bigr)L(W,a)=ℓ(x↦∑j=0h−1​max{∑i=0d−1​xi​Wij​,0}aj​), and suppose that LLL is continuous on all of PPP. Write DL(z)DL(z)DL(z) for the real Fréchet derivative, viewed as a continuous linear map P→RP\to\mathbb RP→R, and write HL(z)=D(DL)(z)H_L(z)=D(DL)(z)HL​(z)=D(DL)(z) for the real Fréchet derivative of the map z↦DL(z)z\mapsto DL(z)z↦DL(z), viewed as a continuous linear map from PPP to the space of continuous linear maps P→RP\to\mathbb RP→R; these derivative operators take the zero map at points where the corresponding function is not differentiable. For every parameter θ=(W,a)∈P\theta=(W,a)\in Pθ=(W,a)∈P, suppose that there is a neighborhood of θ\thetaθ on which LLL is differentiable at every point, and that the map z↦DL(z)z\mapsto DL(z)z↦DL(z) is differentiable at θ\thetaθ. Then, for every real α>0\alpha>0α>0, at the scaled parameter Tαθ=(αW,α−1a)T_\alpha\theta=(\alpha W,\alpha^{-1}a)Tα​θ=(αW,α−1a) there is likewise a neighborhood on which LLL is differentiable at every point, and the map z↦DL(z)z\mapsto DL(z)z↦DL(z) is differentiable at TαθT_\alpha\thetaTα​θ; moreover, for every direction u=(U,b)∈Pu=(U,b)\in Pu=(U,b)∈P and every pair of directions u=(U,b),v=(V,c)∈Pu=(U,b),v=(V,c)\in Pu=(U,b),v=(V,c)∈P, respectively, DL(Tαθ)[u]=DL(θ)[(α−1U,αb)]DL(T_\alpha\theta)[u]=DL(\theta)[(\alpha^{-1}U,\alpha b)]DL(Tα​θ)[u]=DL(θ)[(α−1U,αb)] and HL(Tαθ)[u][v]=HL(θ)[(α−1U,αb)][(α−1V,αc)]H_L(T_\alpha\theta)[u][v]=H_L(\theta)[(\alpha^{-1}U,\alpha b)][(\alpha^{-1}V,\alpha c)]HL​(Tα​θ)[u][v]=HL​(θ)[(α−1U,αb)][(α−1V,αc)]. Thus the inverse scaling in each direction multiplies its matrix coordinates by α−1\alpha^{-1}α−1 and its final hhh coordinates by α\alphaα. The quantifiers exclude zero input dimension, zero hidden dimension, and zero or negative scaling factors, so no inverse of zero occurs in these conclusions; they include arbitrary zero coordinates, the zero parameter, and zero directions. No regularity assumption is imposed on ℓ\ellℓ itself beyond the stated continuity and differentiability conditions on its composite LLL, and differentiability of z↦DL(z)z\mapsto DL(z)z↦DL(z) is assumed at θ\thetaθ only, rather than throughout a neighborhood.

Human review
  • Endorsed by Shuze Chen · Sep 26, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Minghui · Sep 26, 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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me