Overview

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 (S⊆RnS \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)≔{y∈Rn∣∥x−y∥<ϵ}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 S⊆RnS \subseteq \mathbb{R}^n is called open if ∀x∈S,∃ϵ>0:Bϵ(x)⊆S\forall \mathbf{x} \in S, \quad \exists \epsilon > 0 : B_{\epsilon}(\mathbf{x}) \subseteq S.

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

A set S⊆RnS \subseteq \mathbb{R}^n is called bounded if ∃M>0:∀x∈S:∥x∥<M,∀x∈S\exists M > 0 : \forall \mathbf{x} \in S : \Vert \mathbf{x} \Vert < M, \quad \forall \mathbf{x} \in S.

A set S⊆RnS \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){min⁡x∈Rnf(x)subject to x∈S,\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
Figure 1: 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)

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

f(x⋆)≤f(x),∀x∈S.f(\mathbf{x}^{\star}) \leq f(\mathbf{x}), \quad \forall \mathbf{x} \in S.

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

∃ϵ>0:f(x⋆)≤f(x),∀x∈S∩Bϵ(x⋆).\exists \epsilon > 0 : f(\mathbf{x}^{\star}) \leq f(\mathbf{x}), \quad \forall \mathbf{x} \in S \cap B_{\epsilon}(\mathbf{x}^{\star}).

x⋆∈S\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 x≠x⋆\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){min⁡x∈Rnf(x)subject to x∈S,\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 x⋆∈S\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−λ)x⋆∈S\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

min⁡x∈Rxsubject 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

min⁡x∈Rxsubject 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:R→Rf : \mathbb{R} \to \mathbb{R} be defined by,

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

Does the following problem have an optimal solution?

min⁡x∈Rf(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 S⊆RnS \subseteq \mathbb{R}^n and let f:S→Rf : S \to \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 lim⁡k→∞∥x∥→∞\lim_{k \to \infty} \Vert \mathbf{x} \Vert \to \infty, we have that lim⁡k→∞f(xk)→∞\lim_{k \to \infty} f(\mathbf{x}_k) \to \infty.
Example 4

Let S:−{x∣x≥0}⊂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 lim⁡k→∞xk→∞\lim_{k \to \infty} x_k \to \infty, then we have that lim⁡k→∞f(xk)=lim⁡k→∞exk=∞\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?

min⁡x∈Rf(x)subject to x∈S.\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:−{x∣x≥0}⊂RS \coloneq \{x | x \geq 0 \} \subset \mathbb{R}, and let f(x)=e−xf(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 lim⁡k→∞xk→∞\lim_{k \to \infty} x_k \to \infty, then we have that lim⁡k→∞f(xk)=lim⁡k→∞e−xk=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?

min⁡x∈Rf(x)subject to x∈S.\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 x∈Sx \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){min⁡x∈Rnf(x)subject to x∈S,\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 1,
  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 f∈C1f \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⋆)Tp⏟−∇f(x⋆)+O(α)=f(x⋆)−α∇f(x⋆)T∇f(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 f∈C2f \in C^2 on Rn\mathbb{R}^n, then,

x⋆ is a local minimum of f on Rn  ⟹  {∇f(x⋆)=0∇2f(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 f∈C2f \in C^2 on Rn\mathbb{R}^n, then,

{∇f(x⋆)=0∇2f(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 (S⊆RnS \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 x∈S\mathbf{x} \in S, a vector p∈Rn\mathbf{p} \in \mathbb{R}^n is called a feasible direction at the point x\mathbf{x}, if,

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

Let x∈S\mathbf{x} \in S, a vector p∈Rn\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,z∈Rn\mathbf{y}, \mathbf{z} \in \mathbb{R}^n, we have that,
yTz=∥y∥∥z∥cos⁡(θ),\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 f∈C1f \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 S⊆RnS \subseteq \mathbb{R}^n and let f∈C1f \in C^1 on SS.

x⋆ is a local minimum of f on S  ⟹  ∇f(x⋆)Tp≥0,∀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(x−x⋆)≥0,∀x∈S\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 S⊆RnS \subseteq \mathbb{R}^n be a convex set and let f∈C1f \in C^1 be a convex function on SS. Then,

x⋆ is a global minimum of f on S  ⟺  ∇f(x⋆)T(x−x⋆)≥0,∀x∈S\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 S⊆RnS \subseteq \mathbb{R}^n be a convex set and let f∈C1f \in C^1 on SS. A point x⋆∈S\mathbf{x}^{\star} \in S is called stationary if,

∇f(x⋆)T(x−x⋆)≥0,∀x∈S\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 S⊆RnS \subseteq \mathbb{R}^n be a convex set and let f∈C1f \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 S⊆RnS \subseteq \mathbb{R}^n be a convex set and let x∈S\mathbf{x} \in S. The normal cone at the point x\mathbf{x} is defined as,

NS(x):−{p∈Rn∣pT(y−x)≤0,∀y∈S}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 S⊆RnS \subseteq \mathbb{R}^n be a convex set and let f∈C1f \in C^1 on SS. A point x⋆∈S\mathbf{x}^{\star} \in S fulfilling any of the following equivalent statements is called a stationary point,

  1. ∇f(x⋆)T(x−x⋆)≥0,∀x∈S\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. min⁡x∈S∇f(x⋆)T(x−x⋆)=0\underset{\mathbf{x} \in S}{\min} \nabla f(\mathbf{x}^{\star})^T (\mathbf{x} - \mathbf{x}^{\star}) = 0.
  4. x⋆=projS(x⋆−∇f(x⋆))\mathbf{x}^{\star} = \mathrm{proj}_S(\mathbf{x}^{\star} - \nabla f(\mathbf{x}^{\star})).
Footnotes
  1. Technically, this still holds for ff is lower semi-continuous on SS, but we will not cover that here.

    ↩

Search

Essays, lecture notes, and research

Type to search the site.