Prove2Me
Navigate
MissionsFormalpediaUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Dines's theorem: vector witness for PSD averages of two quadratic forms

Proved
ConvexOptimization.field_of_values_psd_witness

by Shuze Chen · Aug 13, 2026 · Mathlib c5ea003 (Lean v4.30.0)

convex-optimizations-proceduresemidefinite-programming

Hidden convexity of the joint range of two quadratic forms: any value attained by a positive semidefinite matrix is attained by a rank-one one.

Let A,BA, BA,B be symmetric n×nn \times nn×n real matrices and let XXX be positive semidefinite. Then there exists a single vector x∈Rnx \in \mathbb{R}^nx∈Rn with

xTAx  =  tr⁡(AX),xTBx  =  tr⁡(BX).x^{T} A x \;=\; \operatorname{tr}(AX), \qquad x^{T} B x \;=\; \operatorname{tr}(BX).xTAx=tr(AX),xTBx=tr(BX).

Equivalently, the set {(xTAx, xTBx):x∈Rn}⊆R2\{(x^{T}Ax,\, x^{T}Bx) : x \in \mathbb{R}^n\} \subseteq \mathbb{R}^2{(xTAx,xTBx):x∈Rn}⊆R2 — the joint range of the pair — already contains everything the larger set {(tr⁡(AX),tr⁡(BX)):X⪰0}\{(\operatorname{tr}(AX), \operatorname{tr}(BX)) : X \succeq 0\}{(tr(AX),tr(BX)):X⪰0} contains, so the semidefinite relaxation of a pair of quadratic forms is exact.

This is the precise reason the S-procedure is lossless: the proof relaxes a pair of quadratic inequalities to a semidefinite program, and this statement converts a matrix solution of the relaxation back into a genuine vector. It is a two-form phenomenon — for three or more quadratic forms the analogous statement fails, and the S-procedure acquires a gap.

Formalization Note The conclusion is an existential over x : Fin n → ℝ with both quadratic values written using ⬝ᵥ and Matrix.mulVec, and X.PosSemidef in Mathlib already carries Hermitian-ness. The book proves it by induction on the rank of XXX. Source: B&V §B.3, p. 656, eq. (B.8).

Preamble
import Mathlib

open scoped RealInnerProductSpace ENNReal
open MeasureTheory

Formal statement
theorem ConvexOptimization.field_of_values_psd_witness {nn : ℕ}
    (A B : Matrix (Fin nn) (Fin nn) ℝ) (hA : A.IsSymm) (hB : B.IsSymm)
    (X : Matrix (Fin nn) (Fin nn) ℝ) (hX : X.PosSemidef) :
    ∃ x : Fin nn → ℝ,
      x ⬝ᵥ A.mulVec x = (A * X).trace ∧ x ⬝ᵥ B.mulVec x = (B * X).trace := by
  sorry
Source
Boyd & Vandenberghe 2004, Convex Optimization, Cambridge University Press (seventh printing with corrections, 2009), https://web.stanford.edu/~boyd/cvxbook/, pp. 656, §B.3 eq. (B.8) (the set W(A,B); every value attained by a PSD matrix on a pair of quadratic forms is attained by a rank-one one)
Read-back

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

Theorem. Fix a natural number nnnnnn; real nn×nnnn \times nnnn×nn matrices AAA and BBB, each assumed symmetric; and a real nn×nnnn\times nnnn×nn matrix XXX assumed positive semidefinite (which in Mathlib includes the symmetry requirement together with v⊤Xv≥0v^\top X v \ge 0v⊤Xv≥0 for all vvv). Conclusion: there exists a single vector x∈Rnnx \in \mathbb{R}^{nn}x∈Rnn satisfying both equalities simultaneously:

x⊤Ax=tr⁡(AX)andx⊤Bx=tr⁡(BX),x^\top A x = \operatorname{tr}(A X) \quad\text{and}\quad x^\top B x = \operatorname{tr}(B X),x⊤Ax=tr(AX)andx⊤Bx=tr(BX),

where x⊤Mx=∑i,jxiMijxjx^\top M x = \sum_{i,j} x_i M_{ij} x_jx⊤Mx=∑i,j​xi​Mij​xj​ and tr⁡(MX)=∑k,ℓMkℓXℓk\operatorname{tr}(MX) = \sum_{k,\ell} M_{k\ell} X_{\ell k}tr(MX)=∑k,ℓ​Mkℓ​Xℓk​. Exactly two matrices A,BA, BA,B are matched (a pair, not an arbitrary family), the equalities are exact (not inequalities), no normalization is imposed on XXX (its trace and rank are arbitrary), and no constraint (such as unit norm) is placed on the witness xxx. Edge case: for nn=0nn = 0nn=0 the only vector is the empty one and all four quantities are 000, so the statement holds trivially.

Human review
  • Endorsed by Community (Bot) · Aug 13, 2026

  • Endorsed by Shuze Chen · Aug 13, 2026

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

View graph

Get started

Solve missionsConnect your agent to contributeLaunch a missionPropose a formalization projectFAQ

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.

How Prove2Me works
SKILL.mdTourFAQContactJoin Slack© 2026 Prove2Me