Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§4.1 — along the gradient flow, ddtf(Kt)=−∥∇f(Kt)∥F2\frac{d}{dt}f(K_t) = -\|\nabla f(K_t)\|_F^2dtd​f(Kt​)=−∥∇f(Kt​)∥F2​

Proved
FatkhullinPolyak.Flow.flow_energy_identity

by mikedeng1 · Sep 27, 2026 · Mathlib 0df444a (Lean v4.33.1)

gradient-flowlqrp2o-batch-p100bp2o-gran-per-chapterp2o-plan-paperp2o-v1

Let Q,R,Σ≻0Q, R, \Sigma\succ0Q,R,Σ≻0 and let Kt=K(t)K_t = K(t)Kt​=K(t) be a solution on [0,∞)[0,\infty)[0,∞) of the gradient flow (4.1), K˙=−∇f(K)\dot K = -\nabla f(K)K˙=−∇f(K), K(0)=K0K(0)=K_0K(0)=K0​ (in particular Kt∈SK_t\in\mathcal SKt​∈S for all t≥0t\ge0t≥0). Then for every t≥0t\ge0t≥0 the function s↦f(Ks)s\mapsto f(K_s)s↦f(Ks​) is differentiable at ttt (from the right at t=0t=0t=0) with

ddtf(Kt)=−∥∇f(Kt)∥F2.\frac{d}{dt} f(K_t) = -\|\nabla f(K_t)\|_F^2 .dtd​f(Kt​)=−∥∇f(Kt​)∥F2​.

This energy identity is "the main idea of the proof" of Theorem 4.1: it shows at once that f(Kt)f(K_t)f(Kt​) is nonincreasing.

Formalization Note The derivative is taken within [0,∞)[0,\infty)[0,∞). The norm is the Frobenius norm, the one with respect to which (3.3) is the gradient.

Preamble
import Mathlib
import Definitions.Def_FatkhullinPolyak_Flow_LQR
import Definitions.Def_FatkhullinPolyak_Flow_GradientFlow
Formal statement
namespace FatkhullinPolyak.Flow

open Matrix

theorem flow_energy_identity {n m r : ℕ}
    (A : Matrix (Fin n) (Fin n) ℝ) (B : Matrix (Fin n) (Fin m) ℝ) (C : Matrix (Fin r) (Fin n) ℝ)
    (Q : Matrix (Fin n) (Fin n) ℝ) (R : Matrix (Fin m) (Fin m) ℝ) (Sig : Matrix (Fin n) (Fin n) ℝ)
    (hQ : Q.PosDef) (hR : R.PosDef) (hSig : Sig.PosDef)
    (K₀ : Matrix (Fin m) (Fin r) ℝ) (K : ℝ → Matrix (Fin m) (Fin r) ℝ)
    (hK : IsGradFlow A B C Q R Sig K₀ K) :
    ∀ t : ℝ, 0 ≤ t →
      HasDerivWithinAt (fun s => cost A B C Q R Sig (K s))
        (-(frobNorm (grad A B C Q R Sig (K t)) ^ 2)) (Set.Ici 0) t := by sorry

end FatkhullinPolyak.Flow
Source
Fatkhullin, Polyak, Optimizing Static Linear Feedback: Gradient Method, arXiv:2004.09875v2, p. 10, §4.1, last paragraph; Appendix D.1, p. 18
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Setting. Let

A∈Rn×n,B∈Rn×m,C∈Rr×n,Q∈Rn×n,R∈Rm×m,Σ∈Rn×n.A\in\mathbb R^{n\times n},\quad B\in\mathbb R^{n\times m},\quad C\in\mathbb R^{r\times n},\quad Q\in\mathbb R^{n\times n},\quad R\in\mathbb R^{m\times m},\quad \Sigma\in\mathbb R^{n\times n}.A∈Rn×n,B∈Rn×m,C∈Rr×n,Q∈Rn×n,R∈Rm×m,Σ∈Rn×n.

Gains are m×rm\times rm×r real matrices. The notions used are:

  • S\mathcal SS is the set of gains with every complex eigenvalue of A−BKCA-BKCA−BKC having negative real part.
  • X(K)X(K)X(K) and Y(K)Y(K)Y(K) are the unique solutions (or 000 if the solution is not unique) of
(A−BKC)⊤X+X(A−BKC)+C⊤K⊤RKC+Q=0,(A-BKC)^\top X+X(A-BKC)+C^\top K^\top RKC+Q=0,(A−BKC)⊤X+X(A−BKC)+C⊤K⊤RKC+Q=0, (A−BKC)Y+Y(A−BKC)⊤+Σ=0.(A-BKC)Y+Y(A-BKC)^\top+\Sigma=0.(A−BKC)Y+Y(A−BKC)⊤+Σ=0.
  • The cost is f(K)=tr⁡(X(K)Σ)f(K)=\operatorname{tr}(X(K)\Sigma)f(K)=tr(X(K)Σ).
  • ∇f(K):=2(RKC−B⊤X(K))Y(K)C⊤\nabla f(K):=2\big(RKC-B^\top X(K)\big)Y(K)C^\top∇f(K):=2(RKC−B⊤X(K))Y(K)C⊤ is the explicit formula.
  • ∥⋅∥F\|\cdot\|_F∥⋅∥F​ is the Frobenius norm.

Hypotheses.

  • QQQ, RRR, Σ\SigmaΣ are positive definite (symmetric, with x⊤Mx>0x^\top Mx>0x⊤Mx>0 for x≠0x\ne0x=0).
  • K0∈Rm×rK_0\in\mathbb R^{m\times r}K0​∈Rm×r, and K:R→Rm×rK:\mathbb R\to\mathbb R^{m\times r}K:R→Rm×r is a gradient-flow solution from K0K_0K0​. This means:
    • K(0)=K0K(0)=K_0K(0)=K0​;
    • K(t)∈SK(t)\in\mathcal SK(t)∈S for all t≥0t\ge0t≥0;
    • for every t≥0t\ge 0t≥0, each entry K(⋅)ijK(\cdot)_{ij}K(⋅)ij​ has derivative −(∇f(K(t)))ij-\big(\nabla f(K(t))\big)_{ij}−(∇f(K(t)))ij​ at ttt relative to [0,∞)[0,\infty)[0,∞) (one-sided at t=0t=0t=0).
  • No rank condition on CCC and no condition on BBB is imposed.

Conclusion. For every t≥0t\ge0t≥0, the function s↦f(K(s))s\mapsto f(K(s))s↦f(K(s)) has derivative at ttt relative to [0,∞)[0,\infty)[0,∞) equal to

−∥∇f(K(t))∥F2.-\|\nabla f(K(t))\|_F^2.−∥∇f(K(t))∥F2​.

At t=0t=0t=0 this is a right derivative.

Degenerate cases.

  • If no gradient-flow solution exists for the data, the statement is vacuous.
  • If n=0n=0n=0, then f≡0f\equiv0f≡0 and ∇f≡0\nabla f\equiv 0∇f≡0, and the claim is that a constant function has derivative 000.
  • If m=0m=0m=0 or r=0r=0r=0, the curve is constant on [0,∞)[0,\infty)[0,∞) and ∇f\nabla f∇f is the empty matrix with norm 000.
Human review
  • Endorsed by Shuze Chen · Sep 27, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 27, 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