Formalization of Optimality Conditions for Smooth Constrained Optimization Problems
Chenyi Li, Shengyang Xu, Chumin Sun, Li Zhou, Zaiwen Wen
TL;DR
This work presents a Lean4 formalization of first-order optimality conditions for smooth constrained optimization, grounding the development in the Lagrangian, tangent cone, and constraint qualifications. It defines constrained problems as a structured type, encodes feasible sets and local minima, and formalizes the geometric and linearized notions that connect the tangent cone to feasible directions. Building on this, the Farkas lemma is formalized to enable rigorous KKT proofs, followed by a complete presentation of the KKT conditions under LICQ or LinearCQ. The dual problem and weak duality are also formalized, providing a verified framework for primal–dual analysis. Overall, the paper delivers a reusable Lean4 toolkit for rigorous optimization proofs and paves the way for extensions to additional constraint qualifications and higher-order conditions.
Abstract
Optimality conditions are central to analysis of optimization problems, characterizing necessary criteria for local minima. Formalizing the optimality conditions within the type-theory-based proof assistant Lean4 provides a precise, robust, and reusable framework essential for rigorous verification in optimization theory. In this paper, we introduce a formalization of the first-order optimality conditions (also known as the Karush-Kuhn-Tucker (KKT) conditions) for smooth constrained optimization problems by beginning with concepts such as the Lagrangian function and constraint qualifications. The geometric optimality conditions are then formalized, offering insights into local minima through tangent cones. We also establish the critical equivalence between the tangent cone and linearized feasible directions under appropriate constraint qualifications. Building on these key elements, the formalization concludes the KKT conditions through the proof of the Farkas lemma. Additionally, this study provides a formalization of the dual problem and the weak duality property.
