Part 4 - Introduction to Optimality Conditions

Outline

In this part, we will cover the following topics:

  • Local & global optimality
  • Existence of optimal solutions
  • Optimality conditions for unconstrained problems (S=RnS = \mathbb{R}^n)
  • Optimality conditions for constrained problems (SRnS \subseteq \mathbb{R}^n)

Before we start with local and global optimality, we will have a short recap of some concepts that we need to use.

Open, closed, and bounded sets

Recall the following properties of sets in Rn\mathbb{R}^n,

Note (Set properties)

Bϵ(x){yRnxy<ϵ}B_{\epsilon}(\mathbf{x}) \coloneqq \{\mathbf{y} \in \mathbb{R}^n \mid \Vert \mathbf{x} - \mathbf{y} \Vert < \epsilon \} is the open ball of radius ϵ\epsilon around x\mathbf{x}.

A set SRnS \subseteq \mathbb{R}^n is called open if xS, ϵ>0:Bϵ(x)S\forall \mathbf{x} \in S, \ \exists \epsilon > 0 : B_{\epsilon}(\mathbf{x}) \subseteq S.

A set SRnS \subseteq \mathbb{R}^n is called closed if its complement RnS\mathbb{R}^n \setminus S is open (complement of an open set).

A set SRnS \subseteq \mathbb{R}^n is called bounded if M>0:xS:x<M, xS\exists M > 0 : \forall \mathbf{x} \in S : \Vert \mathbf{x} \Vert < M, \ \forall \mathbf{x} \in S.

A set SRnS \subseteq \mathbb{R}^n is called compact if it is closed and bounded.

Local & Global Optimality

Recall, our model problem can be written as,

(P){minxRnf(x)subject to xS,\begin{align*} (P) \quad & \begin{cases} \underset{\mathbf{x} \in \mathbb{R}^n}{\min} & f(\mathbf{x}) \newline \text{subject to } & \mathbf{x} \in S, \end{cases} \end{align*}

Optimality conditions will characterize which points x\mathbf{x} that can be locally/globally optimal to our problem (P)(P).

So the our first question is, where can the problem have local and global solutions?

Candidates for optimality
Candidates for optimality

From Figure 1 (and intuition calculus), we can see that the candidates for local and global optimality are:

  • Points where the gradient is zero (stationary points).
  • Points where the gradient is undefined (nondifferentiable points).
  • Boundary points of the feasible set SS.
  • Discontinuous points of the function ff.

Now, let’s (formally) define what we mean with global and local optimal solutions?

Definition 1 (Global and local optimality)

xS\mathbf{x}^{\star} \in S is a global minimum of ff over SS if,

f(x)f(x),xS.f(\mathbf{x}^{\star}) \leq f(\mathbf{x}), \quad \forall \mathbf{x} \in S.

xS\mathbf{x}^{\star} \in S is a local minimum of ff over SS if,

ϵ>0:f(x)f(x),xSBϵ(x).\exists \epsilon > 0 : f(\mathbf{x}^{\star}) \leq f(\mathbf{x}), \quad \forall \mathbf{x} \in S \cap B_{\epsilon}(\mathbf{x}^{\star}).

xS\mathbf{x}^{\star} \in S is a strict local minimum of ff over SS if f(x)<f(x)f(\mathbf{x}^{\star}) < f(\mathbf{x}) holds above for xx\mathbf{x} \neq \mathbf{x}^{\star}.

With these definitions, we can define the fundamental theorem of global optimality.

Theorem 1 (Fundamental theorem of global optimality)

Consider the problem

(P){minxRnf(x)subject to xS,\begin{align*} (P) \quad & \begin{cases} \underset{\mathbf{x} \in \mathbb{R}^n}{\min} & f(\mathbf{x}) \newline \text{subject to } & \mathbf{x} \in S, \end{cases} \end{align*}

where SS is a convex set and ff is convex on SS. Then, every local minimum of (P)(P) is also a global minimum.

Let’s now prove this theorem.

Proof (Proof of the fundamental theorem of global optimality)

We will use proof by contradiction. Let xS\mathbf{x}^{\star} \in S be a local optimal but not a global optimal solution.

Further, let xˉS\bar{\mathbf{x}} \in S be a point such that f(xˉ)<f(x)f(\bar{\mathbf{x}}) < f(\mathbf{x}^{\star}). For any λ(0,1)\lambda \in (0, 1),

λxˉ+(1λ)xS\lambda \bar{\mathbf{x}} + (1 - \lambda) \mathbf{x}^{\star} \in S

Therefore,

f(λxˉ+(1λ)x)λf(xˉ)<f(x)+(1λ)f(x)<λf(x)+(1λ)f(x)<f(x)\begin{align*} f(\lambda \bar{\mathbf{x}} + (1 - \lambda) \mathbf{x}^{\star}) & \leq \lambda \underbrace{f(\bar{\mathbf{x}})}_{< f(\mathbf{x}^{\star})} + (1 - \lambda) f(\mathbf{x}^{\star}) \newline & < \lambda f(\mathbf{x}^{\star}) + (1 - \lambda) f(\mathbf{x}^{\star}) \newline & < f(\mathbf{x}^{\star}) \end{align*}

However, if we now let λ0\lambda \rightarrow 0, leads to a contradiction to the local optimality of x\mathbf{x}^{\star}.

With this, we ask our third question, when does (P)(P) have a globally optimal solution?

Let’s review some examples first.

Example 1

Consider the following problem

minxR xsubject to x[0,1].\begin{align*} \underset{\mathbf{x} \in \mathbb{R}}{\min} & \ x \newline \text{subject to } & x \in [0, 1]. \end{align*}

The problem has a global optimal solution at x=0x^{\star} = 0

Example 2

Consider the following problem

minxR xsubject to x(0,1].\begin{align*} \underset{\mathbf{x} \in \mathbb{R}}{\min} & \ x \newline \text{subject to } & x \in (0, 1]. \end{align*}

The problem does not have a global optimal solution, the infimum is still 0, but x=0x = 0 is not attainable. The issue is that SS is not closed.

So it looks like having a closed set is nice.

Example 3

Let f:RRf : \mathbb{R} \mapsto \mathbb{R} be defined by,

f(x)={x,x>01,x0f(x) = \begin{cases} x, & x > 0 \newline 1, & x \leq 0 \end{cases}

Does the following problem have an optimal solution?

minxR f(x)subject to x[2,2].\begin{align*} \underset{\mathbf{x} \in \mathbb{R}}{\min} & \ f(x) \newline \text{subject to } & x \in [-2, 2]. \end{align*}

Again, the infimum is 0, but f(x)>0f(x) > 0 for all x. The issue is that ff 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 SRnS \subseteq \mathbb{R}^n and let f:SRf : S \mapsto \mathbb{R}. ff is said to be weakly coercive with respect to SS if,

  1. either SS is bounded,
  2. or, for all sequences {xk}S\{\mathbf{x}_k\} \subset S such that limkx\lim_{k \to \infty} \Vert \mathbf{x} \Vert \to \infty, we have that limkf(xk)\lim_{k \to \infty} f(\mathbf{x}_k) \to \infty.
Example 4

Let S:{xx0}RS \coloneq \{x | x \geq 0 \} \subset \mathbb{R}, and let f(x)=exf(x) = e^x. Is ff weakly coercive with respect to SS?

Solution

Yes. First, note that SS is not bounded. If {xk}\{ x_k \} is a sequence such that limkxk\lim_{k \to \infty} x_k \to \infty, then we have that limkf(xk)=limkexk=\lim_{k \to \infty} f(x_k) = \lim_{k \to \infty} e^{x_k} = \infty.

Example 5

Let SS and ff be as above. Does the following problem have an optimal solution?

minxR f(x)subject to xS.\begin{align*} \underset{\mathbf{x} \in \mathbb{R}}{\min} & \ f(x) \newline \text{subject to } & x \in S. \end{align*}

Yes, the problem has a global optimal solution at x=0x^{\star} = 0.

Example 6

Let S:{xx0}RS \coloneq \{x | x \geq 0 \} \subset \mathbb{R}, and let f(x)=exf(x) = e^{-x}. Is ff weakly coercive with respect to SS?

Solution

No. First, note that SS is not bounded. If {xk}\{ x_k \} is a sequence such that limkxk\lim_{k \to \infty} x_k \to \infty, then we have that limkf(xk)=limkexk=0\lim_{k \to \infty} f(x_k) = \lim_{k \to \infty} e^{-x_k} = 0 \neq \infty.

Example 7

Let SS and ff be as above. Does the following problem have an optimal solution?

minxR f(x)subject to xS.\begin{align*} \underset{\mathbf{x} \in \mathbb{R}}{\min} & \ f(x) \newline \text{subject to } & x \in S. \end{align*}

No, the problem does not have a global optimal solution, the infimum is 0, but f(x)>0f(x) > 0 for all xSx \in 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){minxRnf(x)subject to xS,\begin{align*} (P) \quad & \begin{cases} \underset{\mathbf{x} \in \mathbb{R}^n}{\min} & f(\mathbf{x}) \newline \text{subject to } & \mathbf{x} \in S, \end{cases} \end{align*}

and assume that,

  1. SS is a non-empty and closed set,
  2. ff is continuous on SS 1Technically, this still holds for ff is lower semi-continuous on SS, but we will not cover that here.,
  3. ff is weakly coercive with respect to SS.

Then, there exists a non-empty, compact set of global minimizers to (P)(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.\mathbf{x}^{\star} \text{ is a local minimum } \implies \text{ "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.\text{"something" does not hold } \implies \mathbf{x}^{\star} \text{ is not a local minimum.}

So, “something” is a property that x\mathbf{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.\text{"something" holds } \implies \mathbf{x}^{\star} \text{ is a local minimum.}

They are called sufficient because, if “something” holds, then we are guaranteed that x\mathbf{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=RnS = \mathbb{R}^n)

We will start by looking at the necessary condition for optimality in C1C^1 functions.

Theorem 3 (Necessary condition for optimality in   C1C^1   functions)

If fC1f \in C^1 on Rn\mathbb{R}^n, then,

x is a local minimum of f on Rn    f(x)=0.\mathbf{x}^{\star} \text{ is a local minimum of } f \text{ on } \mathbb{R}^n \implies \nabla f(\mathbf{x}^{\star}) = 0.
Proof (Proof of the necessary condition for optimality in   C1C^1   functions)

We will use proof by contradiction again. Let x\mathbf{x}^{\star} be a local minimum of ff on R\mathbb{R} but f(x)0\nabla f(\mathbf{x}^{\star}) \neq 0. Further, let p=f(x)0\mathbf{p} = -\nabla f(\mathbf{x}^{\star}) \neq 0. Then, for some α0\alpha \leq 0, we can taylor expand around f(x+αp)f(\mathbf{x}^{\star} + \alpha \mathbf{p}),

f(x+αp)=f(x)+αf(x)Tpf(x)+O(α)=f(x)αf(x)Tf(x)f(x)2+O(α)=f(x)αf(x)2<0+O(α)\begin{align*} f(\mathbf{x}^{\star} + \alpha \mathbf{p}) & = f(\mathbf{x}^{\star}) + \alpha \nabla f(\mathbf{x}^{\star})^T \underbrace{\mathbf{p}}_{-\nabla f(\mathbf{x}^{\star})} + \mathcal{O}(\alpha) \newline & = f(\mathbf{x}^{\star}) - \alpha \underbrace{\nabla f(\mathbf{x}^{\star})^T \nabla f(\mathbf{x}^{\star})}_{\Vert \nabla f(\mathbf{x}^{\star}) \Vert^2 } + \mathcal{O}(\alpha) \newline & = \underbrace{f(\mathbf{x}^{\star}) - \alpha \Vert \nabla f(\mathbf{x}^{\star}) \Vert^2}_{< 0} + \mathcal{O}(\alpha) \end{align*}

But, O(α)0\mathcal{O}(\alpha) \to 0 faster than α\alpha, so for sufficiently small α\alpha, we have that,

f(x+αp)<f(x),f(\mathbf{x}^{\star} + \alpha \mathbf{p}) < f(\mathbf{x}^{\star}),

which contradicts the local optimality of x\mathbf{x}^{\star}.

Note

A quick counterexample to show that the above theorem does not hold for the reverse direction is the function f(x)=x3f(x) = x^3 at x=0x^{\star} = 0.

Now let’s look at the necessary and sufficient conditions for optimality in C2C^2 functions.

Theorem 4 (Necessary conditions for optimality in   C2C^2   functions)

If fC2f \in C^2 on Rn\mathbb{R}^n, then,

x is a local minimum of f on Rn    {f(x)=02f(x)0\mathbf{x}^{\star} \text{ is a local minimum of } f \text{ on } \mathbb{R}^n \implies \begin{cases} \nabla f(\mathbf{x}^{\star}) & = \mathbf{0} \newline \nabla^2 f(\mathbf{x}^{\star}) & \succeq 0 \end{cases}
Theorem 5 (Sufficient conditions for optimality in   C2C^2   functions)

If fC2f \in C^2 on Rn\mathbb{R}^n, then,

{f(x)=02f(x)0    x is a strict local minimum of f on Rn\begin{cases} \nabla f(\mathbf{x}^{\star}) & = \mathbf{0} \newline \nabla^2 f(\mathbf{x}^{\star}) & \succ 0 \end{cases} \implies \mathbf{x}^{\star} \text{ is a strict local minimum of } f \text{ on } \mathbb{R}^n

Again, for a counterexample to show that the sufficient condition does not hold for the reverse direction, we can use the function f(x)=x4f(x) = x^4 at x=0x^{\star} = 0.

Optimality conditions for constrained problems (SRnS \subseteq \mathbb{R}^n)

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 SS.

Let’s define what a feasible and descent direction is.

Definition 3 (Feasible direction)

Let xS\mathbf{x} \in S, a vector pRn\mathbf{p} \in \mathbb{R}^n is called a feasible direction at the point x\mathbf{x}, if,

δ>0:x+αpS,α[0,δ]\exists \delta > 0 : \mathbf{x} + \alpha \mathbf{p} \in S, \quad \forall \alpha \in [0, \delta]
Definition 4 (Descent direction)

Let xS\mathbf{x} \in S, a vector pRn\mathbf{p} \in \mathbb{R}^n is called a descent direction with respect to ff at the point x\mathbf{x}, if,

δ>0:f(x+αp)<f(x),α(0,δ]\exists \delta > 0 : f(\mathbf{x} + \alpha \mathbf{p}) < f(\mathbf{x}), \quad \forall \alpha \in (0, \delta]
Note
  • For x\mathbf{x}^{\star} to be a local minimum, there cannot be any feasible descent directions at x\mathbf{x}^{\star}.
  • Recall that, for two vectors, y,zRn\mathbf{y}, \mathbf{z} \in \mathbb{R}^n, we have that,
yTz=yzcos(θ),\mathbf{y}^T \mathbf{z} = \Vert \mathbf{y} \Vert \Vert \mathbf{z} \Vert \cos(\theta),

where θ\theta is the angle between y\mathbf{y} and z\mathbf{z}.

If fC1f \in C^1 around the point x\mathbf{x}, and f(x)Tp<0\nabla f(\mathbf{x})^T \mathbf{p} < 0, then p\mathbf{p} is a descent direction with respect to ff at the point x\mathbf{x}. Which means that θ<90\theta < 90^{\circ} with f(x)-\nabla f(\mathbf{x}).

With this, we can now state the necessary condition for optimality in constrained problems.

Theorem 6 (Necessary condition for optimality in constrained problems)

Let SRnS \subseteq \mathbb{R}^n and let fC1f \in C^1 on SS.

x is a local minimum of f on S    f(x)Tp0,p feasible direction at x\mathbf{x}^{\star} \text{ is a local minimum of } f \text{ on } S \implies \nabla f(\mathbf{x}^{\star})^T \mathbf{p} \geq 0, \quad \forall \mathbf{p} \text{ feasible direction at } \mathbf{x}^{\star}
  1. If SS is convex, then,
x is a local minimum of f on S    f(x)T(xx)0,xS\begin{equation} \mathbf{x}^{\star} \text{ is a local minimum of } f \text{ on } S \implies \nabla f(\mathbf{x}^{\star})^T (\mathbf{x} - \mathbf{x}^{\star}) \geq 0, \quad \forall \mathbf{x} \in S \end{equation}
Theorem 7 (Necessary and sufficient condition for optimality in constrained problems)

Let SRnS \subseteq \mathbb{R}^n be a convex set and let fC1f \in C^1 be a convex function on SS. Then,

x is a global minimum of f on S    f(x)T(xx)0,xS\mathbf{x}^{\star} \text{ is a global minimum of } f \text{ on } S \iff \nabla f(\mathbf{x}^{\star})^T (\mathbf{x} - \mathbf{x}^{\star}) \geq 0, \quad \forall \mathbf{x} \in S
Note

If S=RnS = \mathbb{R}^n, then the above reduces to f(x)=0\nabla f(\mathbf{x}^{\star}) = 0. Why?

Solution

Because, if f(x)0\nabla f(\mathbf{x}^{\star}) \neq 0, then both p\mathbf{p} and p-\mathbf{p} are feasible directions, which leads to a contradiction, thus f(x)=0\nabla f(\mathbf{x}^{\star}) = 0.

We will now present three additional definitions that are all equivalent to Equation (1), i.e., a stationary point,

Definition 5 (Stationary point)

Let SRnS \subseteq \mathbb{R}^n be a convex set and let fC1f \in C^1 on SS. A point xS\mathbf{x}^{\star} \in S is called stationary if,

f(x)T(xx)0,xS\nabla f(\mathbf{x}^{\star})^T (\mathbf{x} - \mathbf{x}^{\star}) \geq 0, \quad \forall \mathbf{x} \in S

Further,

Theorem 8 (Stationary points)

Let SRnS \subseteq \mathbb{R}^n be a convex set and let fC1f \in C^1 on SS.

x is a local minimum of f on S    x is stationary.\mathbf{\mathbf{x}^{\star} \text{ is a local minimum of } f \text{ on } S} \implies \mathbf{\mathbf{x}^{\star} \text{ is stationary}}.

Let’s now define the normal cone.

Definition 6 (Normal cone)

Let SRnS \subseteq \mathbb{R}^n be a convex set and let xS\mathbf{x} \in S. The normal cone at the point x\mathbf{x} is defined as,

NS(x):{pRnpT(yx)0,yS}N_S(\mathbf{x}) \coloneq \{ \mathbf{p} \in \mathbb{R}^n \mid \mathbf{p}^T (\mathbf{y} - \mathbf{x}) \leq 0, \quad \forall \mathbf{y} \in S \}
Note
  • This gives x\mathbf{x}^{\star} is stationary     f(x)NS(x)\iff -\nabla f(\mathbf{x}^{\star}) \in N_S(\mathbf{x}^{\star}).
Theorem 9 (Equivalent statements for stationary points)

Let SRnS \subseteq \mathbb{R}^n be a convex set and let fC1f \in C^1 on SS. A point xS\mathbf{x}^{\star} \in S fulfilling any of the following equivalent statements is called a stationary point,

  1. f(x)T(xx)0,xS\nabla f(\mathbf{x}^{\star})^T (\mathbf{x} - \mathbf{x}^{\star}) \geq 0, \quad \forall \mathbf{x} \in S,
  2. f(x)NS(x)-\nabla f(\mathbf{x}^{\star}) \in N_S(\mathbf{x}^{\star}),
  3. minxS f(x)T(xx)=0\underset{\mathbf{x} \in S}{\min} \ \nabla f(\mathbf{x}^{\star})^T (\mathbf{x} - \mathbf{x}^{\star}) = 0.
  4. x=projS(xf(x))\mathbf{x}^{\star} = \mathrm{proj}_S(\mathbf{x}^{\star} - \nabla f(\mathbf{x}^{\star})).