Verified reductions for optimization

Alexander Bentkamp, Ramon Fernández Mir, Jeremy Avigad

Introduction

In fields ranging from engineering to finance, mathematical optimization is a cornerstone of decision-making. However, high-level optimization models are rarely solved directly. Instead, they undergo a series of "reductions"—mathematical transformations that convert the problem into a standard format, such as conic programming, which specialized solvers like MOSEK or Gurobi can process. While tools like CVXPY automate these transformations using Disciplined Convex Programming (DCP), they are typically unverified. A bug in the reduction logic can lead to incorrect solutions that are infeasible or sub-optimal for the original problem.

The CvxLean Framework

To address this reliability gap, the authors introduce CvxLean, a framework implemented in the Lean 4 proof assistant. CvxLean treats the transformation of an optimization problem as a formal theorem-proving task. By representing optimization problems as first-class objects—comprising a domain, objective function, and constraints—the system can formally prove that a reduction is mathematically sound.

The core of this verification is the concept of strong equivalence. For any reduction from a problem $P$ to a problem $Q$, CvxLean requires the construction of a forward map ($\phi$) and a backward map ($\psi$). The system then generates formal proofs ensuring that $\phi$ preserves feasibility and that $\psi$ correctly maps a solution of the reduced problem $Q$ back to a solution of the original problem $P$.

Verified Atom Library and DCP

Following the DCP paradigm, CvxLean utilizes a library of "atoms"—basic functions like log, sqrt, and exp. Unlike standard unverified tools, every atom in CvxLean is accompanied by Lean proofs of its mathematical properties, including curvature, monotonicity, and its "graph implementation" for conic form.

Figure 2: A tree representation of a function composition in CvxLean, illustrating how curvature (convex/concave) and monotonicity (increasing/decreasing) are tracked through the expression tree to verify DCP compliance.

This localized verification allows the system to automatically compose atoms into complex, verified reductions. Users can also perform manual, non-DCP reductions—such as logarithmic transforms or changes of variables—and use Lean’s interactive tactic system to prove their validity.

Key Results and Case Studies

The authors demonstrated the utility of CvxLean through a successful prototype that reduces and solves standard convex problems with end-to-end verification. A significant milestone was the formalization of a reduction for covariance estimation of Gaussian variables. This complex case study involved maximizing a likelihood function, requiring proofs of properties related to the Schur complement, LDL factorization, and the subadditivity of the determinant.

The interactive workflow provides real-time feedback. When a user applies a transformation, Lean identifies any remaining proof obligations, such as verifying that a specific function argument is monotonic within its domain.

Limitations and Future Directions

While CvxLean significantly hardens the optimization pipeline, some challenges remain. A primary limitation is the "floating-point gap": while the symbolic reduction is verified, the final conversion to floating-point arithmetic and the internal logic of the external solver remain unverified. Future work may involve integrating verified floating-point libraries or using dual certificates to verify solver outputs. Additionally, expanding the atom library and increasing automation through specialized Lean tactics are key priorities for making the system more accessible to non-experts.

Summary updated

BibTeX
@inproceedings{bentkamp2023verified,
  author = {Alexander Bentkamp and Ramon Fernández Mir and Jeremy Avigad},
  title = {{Verified reductions for optimization}},
  booktitle = {TACAS},
  year = {2023},
  doi = {10.1007/978-3-031-30820-8\_8},
}
Figure