However, if we now let λ→0, leads to a contradiction to the local optimality of x⋆.
With this, we ask our third question, when does (P) have a globally optimal solution?
Let’s review some examples first.
Example 1
Consider the following problem
x∈Rminsubject to xx∈[0,1].
The problem has a global optimal solution at x⋆=0
Example 2
Consider the following problem
x∈Rminsubject to xx∈(0,1].
The problem does not have a global optimal solution, the infimum is still 0, but x=0 is not attainable.
The issue is that S is not closed.
So it looks like having a closed set is nice.
Example 3
Let f:R↦R be defined by,
f(x)={x,1,x>0x≤0
Does the following problem have an optimal solution?
x∈Rminsubject to f(x)x∈[−2,2].
Again, the infimum is 0, but f(x)>0 for all x.
The issue is that f is not continuous.
So it looks like having a continuous function is also nice :).
We will define one more nice property, weakly coercive functions.
Definition 2 (Weakly coercive functions)
Let S⊆Rn and let f:S↦R.
f is said to be weakly coercive with respect to S if,
either S is bounded,
or, for all sequences {xk}⊂S such that limk→∞∥x∥→∞, we have that limk→∞f(xk)→∞.
Example 4
Let S:−{x∣x≥0}⊂R, and let f(x)=ex.
Is f weakly coercive with respect to S?
Solution
Yes. First, note that S is not bounded. If {xk} is a sequence such that limk→∞xk→∞, then we have that limk→∞f(xk)=limk→∞exk=∞.
Example 5
Let S and f be as above. Does the following problem have an optimal solution?
x∈Rminsubject to f(x)x∈S.
Yes, the problem has a global optimal solution at x⋆=0.
Example 6
Let S:−{x∣x≥0}⊂R, and let f(x)=e−x.
Is f weakly coercive with respect to S?
Solution
No. First, note that S is not bounded. If {xk} is a sequence such that limk→∞xk→∞, then we have that limk→∞f(xk)=limk→∞e−xk=0=∞.
Example 7
Let S and f be as above. Does the following problem have an optimal solution?
x∈Rminsubject to f(x)x∈S.
No, the problem does not have a global optimal solution, the infimum is 0, but f(x)>0 for all x∈S.
With these examples, we will now define Weierstrass’ theorem, which states the existence of globally optimal solutions.
Theorem 2 (Weierstrass’ theorem)
Consider the problem,
(P){x∈Rnminsubject to f(x)x∈S,
and assume that,
S is a non-empty and closed set,
f is continuous on S1Technically, this still holds for f is lower semi-continuous on S, but we will not cover that here.,
f is weakly coercive with respect to S.
Then, there exists a non-empty, compact set of global minimizers to (P).
Before we start on optimality conditions, we will see two types of optimality conditions, necessary and sufficient conditions.
Necessary optimality conditions are of the form,
x⋆ is a local minimum ⟹ "something" holds.
They are called necessray because, if we negate the above logical statement, we get,
"something" does not hold ⟹x⋆ is not a local minimum.
So, “something” is a property that x must have in order to (potentially) be a local minimum.
The other type is sufficient optimality conditions, which are of the form,
"something" holds ⟹x⋆ is a local minimum.
They are called sufficient because, if “something” holds, then we are guaranteed that x is a local minimum.
Sufficient conditions are stronger and more nice, but they are also harder to come by.
Optimality conditions for unconstrained problems (S=Rn)
We will start by looking at the necessary condition for optimality in C1 functions.
Theorem 3 (Necessary condition for optimality in C1 functions)
If f∈C1 on Rn, then,
x⋆ is a local minimum of f on Rn⟹∇f(x⋆)=0.Proof (Proof of the necessary condition for optimality in C1 functions)
We will use proof by contradiction again.
Let x⋆ be a local minimum of f on R but ∇f(x⋆)=0.
Further, let p=−∇f(x⋆)=0. Then, for some α≤0, we can taylor expand around f(x⋆+αp),
But, O(α)→0 faster than α, so for sufficiently small α, we have that,
f(x⋆+αp)<f(x⋆),
which contradicts the local optimality of x⋆.
Note
A quick counterexample to show that the above theorem does not hold for the reverse direction is the function f(x)=x3 at x⋆=0.
Now let’s look at the necessary and sufficient conditions for optimality in C2 functions.
Theorem 4 (Necessary conditions for optimality in C2 functions)
If f∈C2 on Rn, then,
x⋆ is a local minimum of f on Rn⟹{∇f(x⋆)∇2f(x⋆)=0⪰0Theorem 5 (Sufficient conditions for optimality in C2 functions)
If f∈C2 on Rn, then,
{∇f(x⋆)∇2f(x⋆)=0≻0⟹x⋆ is a strict local minimum of f on Rn
Again, for a counterexample to show that the sufficient condition does not hold for the reverse direction, we can use the function f(x)=x4 at x⋆=0.
Optimality conditions for constrained problems (S⊆Rn)
We will now look at optimality conditions for constrained problems. When we dealt with unconstrained problems, we used the fact that we could move in any direction.
But this is not the case for constrained problems, we can only move in directions that keeps us in the feasible set S.
Let’s define what a feasible and descent direction is.
Definition 3 (Feasible direction)
Let x∈S, a vector p∈Rn is called a feasible direction at the point x, if,