Verified Optimization (work in progress)

Alexander Bentkamp, Jeremy AvigadCICM Workshops 2021

Introduction

Optimization is a foundational pillar in modern engineering, finance, and industrial operations. Despite the efficiency of numerical solvers for linear or semidefinite programming, a significant "trust gap" persists in the pipeline. Translating a high-level mathematical model into a solver-ready "conic form" is a complex, manual, and error-prone process. While automated tools like CVX and CVXPy exist, they lack formal guarantees. A bug in transformation logic or a misunderstanding of function properties can lead to suboptimal or incorrect solutions. This work introduces a framework for Verified Optimization, leveraging the Lean interactive proof assistant to formally prove the correctness of problem transformations.

Methodology

The proposed framework utilizes the Lean 4 proof assistant to bridge the gap between high-level modeling and low-level solvers through formal verification.

Formal Reductions

A "reduction" from a problem $P$ to $Q$ is defined as a function mapping any solution of $Q$ back to a solution of $P$. By formally proving this mapping, the framework ensures that a solver's output for the simplified problem $Q$ is mathematically guaranteed to solve the original problem $P$.

Disciplined Convex Programming (DCP)

The framework implements the rules of Disciplined Convex Programming (DCP) within Lean. DCP ensures convexity by construction. By formalizing these rules, the system can systematically verify "atom" properties—such as monotonicity or concavity—using Lean’s rigorous logical foundation.

Reduction Schemas and DSL

To handle complex expressions, the authors employ specific proof patterns, such as linearization_antimono and graph_expansion_concave. These schemas facilitate the decomposition of complex constraints into simpler auxiliary variables. To enhance usability, a Domain-Specific Language (DSL) is implemented via Lean 4 macros. This allows practitioners to define optimization problems using intuitive keywords like !objective and !constraints while maintaining the underlying formal mathematical structure.

Key Insights

The Verification Spectrum

The authors argue that verification is not a binary state. Even without verifying the entire numerical solver, formally specifying the problem and verifying the reduction process significantly enhances reliability.

Graph Implementations and Mathlib

A core technique in convex optimization involves replacing functions with their "graph" (e.g., substituting $\sqrt{x}$ with a variable $t$ subject to $t^2 \leq x$). This framework formally justifies these expansions. Furthermore, by building on Lean, the project leverages mathlib, a comprehensive library of formalized mathematics. This allows the framework to inherit proven properties of real-world functions, such as the convexity of logarithmic or exponential functions.

Current Progress and Future Directions

As a work in progress, the framework has successfully demonstrated a manual, step-by-step verified reduction of a non-trivial problem involving exponential, logarithmic, and square root functions. The DSL implementation provides a flexible syntax for intuitive modeling.

Future work aims to:

  1. Automate Canonization: Transition from manual proof steps to fully automated DCP canonization.
  2. Solver Integration: Develop a pipeline to send simplified problems to external solvers and verify the results using dual solutions within Lean.
  3. Expand Scope: Extend the framework to include disciplined quasiconvex programming and geometric programming.
  4. Library Porting: Continue porting advanced mathematical analysis from Lean 3 to Lean 4 to support more complex optimization classes.

By integrating formal methods into the optimization workflow, this framework moves toward a "gold standard" of certainty in mathematical programming.

Summary updated

BibTeX
@inproceedings{bentkamp2021verified,
  author = {Alexander Bentkamp and Jeremy Avigad},
  title = {{Verified Optimization (work in progress)}},
  booktitle = {CICM Workshops},
  year = {2021},
}
Figure