In this part we will cover the concept of Lagrangian duality, which is a powerful tool in optimization theory.
We will introduce, discuss and prove several important results, including weak and strong duality.
We will then connect this to global optimality conditions, and show how duality can be used to derive optimality conditions for (un)constrained optimization problems.
Finally, we will also (very shortly) introduce Linear Programming (LP) and prove Farkas’ lemma using duality.
The Lagrangian: Setup
Recall our setup for the Lagrangian,
Definition 1 (Lagrangian Function)
For the optimization problem 1Note that our “base set” X is a set where we have “baked in” the rest of the constraints, e.g. X=Rn or X=R+n.
(P)⎩⎨⎧infsubject tof(x)gi(x)≤0,i=1,…,mx∈X
The Lagrangian function is defined as,
L(x,μ)=f(x)+i=1∑mμigi(x),
for μ≥0.
Further,
infsubject tof(x)x∈X
is a relaxation of the (primal) problem (P)2This is why we have called the problems (P) for primal :).
Note
Not all constraints in (P) are relaxed, we still have x∈X.
Further, in practice, there is no general recipe for which constraints to relax and which to keep, it depends on the problem at hand.
With our setup we can now define the Lagrangian dual function.
q(μ)≤f⋆,∀μ≥0.Proof (Weak Duality)q(μ):=inff(z)+i=1∑mμigi(z)subject toz∈X≤f(x)+≤0i=1∑m≥0μi≤0gi(x)(for any feasible x to (P))≤f(x)■.
The Lagrangian: Dual Problem
Definition 3 (Lagrangian Dual Problem)
One can understand that the dual function q(μ) gives a lower bound on the optimal value of (P) for any μ≥0.
Thus, we can try to find the “best” lower bound by solving the dual problem, i.e., maximizing q(μ) over μ≥0,
The (Lagrangian) dual problem is defined as,
(D){supsubject toq(μ)μ≥0Note
From weak duality, if q⋆ is the optimal value of (D), then q⋆≤f⋆, i.e., the optimal value of the dual problem is a lower bound on the optimal value of the primal problem.
This is also what we saw in the last part with the relaxtion theorem.
Theorem 2 (Convexity of the Dual Function)
The dual function q is concave and its effective domain, defined as,
{μ∈Rn∣q(μ)>−∞},
is a convex set. Thus (D) is a convex optimization problem, even if (P) is not.
Note
In the dual problem, we are maximizing a concave function on a convex set, which is equivalent to minimizing a convex function on a convex set, thus (D) is a convex optimization problem.
Definition 4 (Lagrangian Multiplier)
μ⋆ is called a Lagrange multiplier if,
μ⋆≥0 and f⋆=infL(x,μ⋆)subject tox∈XNote
We can see that, if μ⋆ is a Lagrange multiplier, then
q(μ⋆)=f⋆
This means that,
μ⋆ solves the dual problem (D), and
only exists if q⋆=f⋆.
Danger
In other literature, any μ⋆≥0 is called a Lagrange multiplier, and the above is called an optimal Lagrange multiplier.
Not just the optimal ones.
Global Optimality Conditions
We will now connect duality to global optimality conditions.
Theorem 3 (Global Optimality Conditions)
Consider the pair of primal-dual vectors (x⋆,μ⋆), x⋆ is optimal to the primal problem (P) and μ⋆ is optimal to the dual problem (D), if and only if,
x⋆∈arginfL(x,μ⋆)subject tox∈X,
x⋆∈X,gi(x⋆)≤0,i=1,…,m,
μ⋆≥0,
μi⋆gi(x⋆)=0,i=1,…,m.
Proof (Global Optimality Conditions)
Firstly, let (x⋆,μ⋆) satisfy the four conditions.
The first and third condition means x⋆ is a optimal solution to a relaxation.
The second condition means x⋆ is feasible to (P).
Fourth condition ensures that f(x⋆)=fR(x⋆)=L(x⋆,μ⋆).
By the relaxtion theorem, x⋆ is optimal to (P).
Therefore by definition of Lagrange multiplier, μ⋆ is optimal to (D).
Conversely, now let x⋆ be optimal to (P) and μ⋆ be a Lagrange multiplier (i.e., optimal to (D)).
Then, the second and third conditions hold by definition.
Further, by optimality of x⋆ to (P) and definition of Lagrange multiplier, we have,
∇xL(x⋆,μ⋆)∇f(x⋆)+i=1∑mμi⋆∇gi(x⋆)=0=0Example 1 (Global Optimality Conditions and KKT Points)
Consider the problem,
minimizesubject tox12+1001x22−x12−x22+1≤0
Find points fulfilling the global optimality conditions and KKT points.
Solution
How do we find points fulfilling the global optimality conditions?
Firstly, we note that, it is only possible if q⋆=f⋆, in which case μ⋆ solves the dual problem.
One strategy is to,
Define the Lagrangian,
Derive the dual function,
Solve the dual problem to get μ⋆,
Use it to find x⋆ fulfilling the global optimality conditions.
So x⋆∈{x∈R2∣x1=0}.
However, by the fourth condition, we have,
−(x1⋆)2−(x2⋆)2+1=0⟹x2⋆=±1
Thus, the points fulfilling the global optimality conditions are x⋆=[0±1]T and μ⋆=1001 fulfill the global optimality condition fulfill the global optimality conditions.
From @fig, we can verify that the KKT points are [0±1]T and [±10]T.
However, the KKT points [±10]T do not fulfill the global optimality conditions.
In these points we will find μ=1, and thus,
Consider the primal problem (P) and let f⋆ and q⋆ be the optimal values of the primal problem and the dual problem, respectively.
Further, let f⋆>−∞ and let f,gi,i=1,…,m be convex functions and X be a convex set.
Finally, assume that, ∃x0∈X such that, gi(x0)<0,i=1,…,m (Slater’s condition).
Then, f⋆=q⋆ and there exists a Lagrange multiplier μ⋆.
Moreover, if x⋆ is optimal to (P), then (x⋆,μ⋆) satisfies the global optimality conditions.
Linear Programming and Farkas’ Lemma
We will now (very shortly) introduce Linear Programming (LP) and prove Farkas’ lemma using duality.
Definition 5 (Linear Programming)
A linear progrm (LP) on standard form is defined as,
(P)⎩⎨⎧infsubject tocTxAx=bx≥0
Thus, the Lagrangian for a LP is,
L(x,y)=cTx+yT(b−Ax).
With this, we can now prove Farkas’ lemma in a very elegant way using duality.
Theorem 5 (Farkas’ Lemma)
Let A∈Rm×n and b∈Rm. Then, exactly one of the following systems is solvable,
{Ax=bx≥0{ATy≤0bTy>0Proof (Farkas’ Lemma)
If the first system has a solution x, then,
bTy=xTATy≤0,
But x≥0 so ATy≤0 cannot hold, which means that the second system is infeasible.
Assume that the second system is infeasible. Consider the LP,
minsubject to0TxAx=bx≥0
and its dual program,
maxsubject tobTyATy≤0y free
Since the second system is infeasible, y=0 is an optimal solution to the primal problem with optimal value 0.
Hence the Strong Duality theorem implies that there exists an optimal solution x⋆ to the dual problem with optimal value 0.
This solution is feasible to the first system.
What we have proved above is the equivalence,
(I)⟺¬(II)
Logically, this is equivalent to the statement that,
¬(I)⟺(II)
We have hence established that precisely one of the systems is solvable. ■