Linear Programming in Isabelle/HOL
Julian Parsert
TL;DR
The paper presents a formally verified linear programming solver implemented in Isabelle/HOL, building on a prior simplex formalisation and leveraging duality to convert optimisation into a constraint-satisfaction task. By combining two representations of linear polynomials and constructing a robust constraint-generation pipeline, it proves soundness and enables code generation of a verified external solver. The approach is demonstrated through examples, including a production-planning LP and a zero-sum game (Rock–Paper–Scissors) yielding optimal strategies, with generated code available in multiple functional languages. The work advances formal verification for optimization algorithms and lays groundwork for verified solvers in game-theoretic contexts, with planned extensions to completeness proofs and broader integrations.
Abstract
Linear programming describes the problem of optimising a linear objective function over a set of constraints on its variables. In this paper we present a solver for linear programs implemented in the proof assistant Isabelle/HOL. This allows formally proving its soundness, termination, and other properties. We base these results on a previous formalisation of the simplex algorithm which does not take optimisation problems into account. Using the weak duality theorem of linear programming we obtain an algorithm for solving linear programs. Using Isabelle's code generation mechanism we can generate an external solver for linear programs.
