Theorem 4.3.3 — S-lemma
ProvedModernConvex.SLemma.s_lemmaLet be symmetric real matrices, and assume that the quadratic inequality is strictly feasible: there is with . Then is a consequence of (it holds at every satisfying ) if and only if it is a linear consequence of it, i.e., if and only if there exists such that
The S-lemma (Yakubovich, 1971) is the quadratic counterpart of the homogeneous Farkas lemma for a single inequality, and underlies the semidefinite reformulation of many robust and control problems. The "if" direction is the case of Proposition 4.3.4.
Formalization Note Vectors are Fin n → ℝ, is x ⬝ᵥ (A *ᵥ x), symmetry is Matrix.IsHermitian, and is (B - lam • A).PosSemidef. "Consequence" is the pointwise implication over all of . The platform's ConvexOptimization.s_procedure is the inhomogeneous S-procedure in another sign convention; this theorem is a special case of it but not the same statement, so it is drafted here.
import Mathlib open Matrix
namespace ModernConvex.SLemma
/-- Ben-Tal–Nemirovski, Theorem 4.3.3 (S-lemma), p. 176: let `A, B` be symmetric `n × n`
matrices such that `xᵀAx ≥ 0` is strictly feasible (`x̄ᵀAx̄ > 0` for some `x̄`). Then `xᵀBx ≥ 0`
is a consequence of `xᵀAx ≥ 0` if and only if `B ⪰ λA` for some `λ ≥ 0`. -/
theorem s_lemma {n : ℕ} (A B : Matrix (Fin n) (Fin n) ℝ) (hA : A.IsHermitian)
(hB : B.IsHermitian) (hfeas : ∃ x : Fin n → ℝ, 0 < x ⬝ᵥ (A *ᵥ x)) :
(∀ x : Fin n → ℝ, 0 ≤ x ⬝ᵥ (A *ᵥ x) → 0 ≤ x ⬝ᵥ (B *ᵥ x)) ↔
∃ lam : ℝ, 0 ≤ lam ∧ (B - lam • A).PosSemidef := by sorry
end ModernConvex.SLemma
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Let be a natural number and real matrices.
Assumptions:
- is symmetric.
- is symmetric.
- Strict feasibility: some has .
Conclusion: the following two statements are equivalent.
- For every , .
- There is a real such that is positive semidefinite, that is, symmetric with for all .
Here is the dot product of with .
Degenerate cases:
- : the only vector is empty and every quadratic form is . The strict-feasibility hypothesis cannot hold, so the statement is vacuous.
- Any with negative semidefinite (for example ): the strict-feasibility hypothesis likewise cannot be satisfied.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.