Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

(7), p. 3 — the hypergradient formula is the gradient of Φ

Proved
DecBilevel.SLDBO.eq_7_hypergradient

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

bilevel-optimizationhypergradientimplicit-function-theoremp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1

Let Fi,fiF_i,f_iFi​,fi​ (i=1,…,ni=1,\dots,ni=1,…,n, n≥1n\ge1n≥1) satisfy Assumption 2.1, let f=1n∑ifif=\frac1n\sum_if_if=n1​∑i​fi​, and let y∗(x)y^*(x)y∗(x) minimize f(x,⋅)f(x,\cdot)f(x,⋅) for every x∈Rpx\in\mathbb R^px∈Rp. Then Φ(x)=1n∑iFi(x,y∗(x))\Phi(x)=\frac1n\sum_iF_i(x,y^*(x))Φ(x)=n1​∑i​Fi​(x,y∗(x)) is differentiable at every xxx, and its gradient is given by (7):

∇Φ(x)=1n∑i=1n∇1Fi(x,y∗(x))−[1n∑i=1n∇122fi(x,y∗(x))][1n∑i=1n∇222fi(x,y∗(x))]−11n∑i=1n∇2Fi(x,y∗(x)).\nabla\Phi(x)=\frac1n\sum_{i=1}^n\nabla_1F_i(x,y^*(x))-\Big[\frac1n\sum_{i=1}^n\nabla^2_{12}f_i(x,y^*(x))\Big]\Big[\frac1n\sum_{i=1}^n\nabla^2_{22}f_i(x,y^*(x))\Big]^{-1}\frac1n\sum_{i=1}^n\nabla_2F_i(x,y^*(x)).∇Φ(x)=n1​i=1∑n​∇1​Fi​(x,y∗(x))−[n1​i=1∑n​∇122​fi​(x,y∗(x))][n1​i=1∑n​∇222​fi​(x,y∗(x))]−1n1​i=1∑n​∇2​Fi​(x,y∗(x)).

This identifies the quantity that Algorithm 1 tracks, and that Theorem 3.1 drives to zero, with the true gradient of the bilevel objective.

Formalization Note. The right-hand side is the definition hypergrad; the conclusion is HasGradientAt Φ (hypergrad x) x. Strong convexity makes y∗(x)y^*(x)y∗(x) unique, so taking y∗y^*y∗ as a given minimizer map loses nothing.

Preamble
import Mathlib
import Definitions.Def_DecBilevel_SLDBO_Setting
Formal statement
namespace DecBilevel.SLDBO

theorem eq_7_hypergradient {n p q : ℕ} (hn : 0 < n) (F f : Fin n → E p → E q → ℝ)
    (σ LF0 LF1 Lf1 Lf2 : ℝ) (hA21 : Assumption21 F f σ LF0 LF1 Lf1 Lf2)
    (ystar : E p → E q) (hystar : ∀ x, IsMinOn (avgf f x) Set.univ (ystar x)) (x : E p) :
    HasGradientAt (Phi F ystar) (hypergrad F f ystar x) x := by sorry

end DecBilevel.SLDBO
Source
Dong, Ma, Yang, Yin, A Single-Loop Algorithm for Decentralized Bilevel Optimization, arXiv:2311.08945v3, p. 3, (7)
Human review
  • Endorsed by Shuze Chen · Oct 23, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 23, 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