Overview

Part 3 - Convexity II

Outline

In this part, we will cover the following topics:

  • Convex functions
  • The epigraph of a function
  • Characterizations of convex functions
  • Subgradients & subdifferentials
  • Convex optimization problems

We will start by defining convex functions and exploring their properties.

Convex Functions

Definition 1 (Convex Function)

Suppose S⊆RnS \subseteq \mathbb{R}^n is a convex set. Let f:S→Rf: S \to \mathbb{R} be a function. We say that ff is a convex function if,

f(λx1+(1−λ)x2)≤λf(x1)+(1−λ)f(x2){∀x1,x2∈S,λ∈(0,1)f(\lambda \mathbf{x}_1 + (1-\lambda) \mathbf{x}_2) \leq \lambda f(\mathbf{x}_1) + (1-\lambda) f(\mathbf{x}_2) \begin{cases} \forall \mathbf{x}_1, \mathbf{x}_2 \in S, \newline \lambda \in (0,1) \end{cases}
Convex Function Definition
Figure 1: Convex Function Definition
Note

It is called strictly convex if the inequality is strict for x1≠x2\mathbf{x}_1 \neq \mathbf{x}_2, i.e.,

f(λx1+(1−λ)x2)<λf(x1)+(1−λ)f(x2){∀x1,x2∈S,λ∈(0,1),x1≠x2f(\lambda \mathbf{x}_1 + (1-\lambda) \mathbf{x}_2) < \lambda f(\mathbf{x}_1) + (1-\lambda) f(\mathbf{x}_2) \begin{cases} \forall \mathbf{x}_1, \mathbf{x}_2 \in S, \newline \lambda \in (0,1), \newline \mathbf{x}_1 \neq \mathbf{x}_2 \end{cases}

The function is called concave if −f-f is convex.

Example 1 (Some Convex Functions)f(x)=cTx+d,c∈Rn,d∈R,f(\mathbf{x}) = \mathbf{c}^T \mathbf{x} + d, \quad \mathbf{c} \in \mathbb{R}^n, d \in \mathbb{R},

is both convex and concave (only function that is both convex and concave).

f(x)=∥x∥f(\mathbf{x}) = \Vert \mathbf{x} \Vert

is convex.

f(x)=∥x∥2f(\mathbf{x}) = \Vert \mathbf{x} \Vert^2

is strictly convex.

Proposition 1 (Non-negative Weighted Sum of Convex Functions is Convex)

Let S⊆RnS \subseteq \mathbb{R}^n be a convex set and fk:S→R,k=1,…,Kf_k: S \to \mathbb{R}, k=1, \ldots, K be convex functions. Let αk≥0,k=1,…,K\alpha_k \geq 0, k=1, \ldots, K. Then,

f(x)≔∑k=1Kαkfk(x) is convex.f(\mathbf{x}) \coloneqq \sum_{k=1}^K \alpha_k f_k(\mathbf{x}) \, \text{is convex.}
Proposition 2 (Composition of Convex Functions)

Let g:Rn→Rg: \mathbb{R}^n \to \mathbb{R} be a convex function and f:R→Rf: \mathbb{R} \to \mathbb{R} 1 be a convex function and non-decreasing 2 function. Then, the composition f(g(x))f(g(\mathbf{x})) is convex.

Example 2 (Composition of Convex Functions)

Let f(x)=ex(x) = e^x and g(x)=x2g(x) = x^2. Both are convex on R\mathbb{R} and ff is non-decreasing. By our proposition, f(g(x))=ex2f(g(x)) = e^{x^2} is convex (on R\mathbb{R}) 3.

The Epigraph of a Function

Definition 2 (Epigraph of a Function)

The epigraph of a function f:Rn→R∪{±∞}f: \mathbb{R}^n \to \mathbb{R} \cup \{\pm \infty \} is defined as,

epi(f)≔{(x,α)∈Rn×R∣f(x)≤α}\mathrm{epi}(f) \coloneqq \{(\mathbf{x}, \alpha) \in \mathbb{R}^n \times \mathbb{R} \mid f(\mathbf{x}) \leq \alpha \}
Noteepi(f)⊆Rn+1\mathrm{epi}(f) \subseteq \mathbb{R}^{n+1}
Theorem 1 (Characterization of Convex Functions via Epigraphs)

ff is convex if and only if epi(f)\mathrm{epi}(f) is a convex set.]

Definition 3 (C1C^1   Functions)C1≔set of all continuously differentiable functionsC^1 \coloneqq \text{set of all continuously differentiable functions}

Characterizations of Convexity (of C1C^1 Functions)

Theorem 2 (First Order Characterization of Convexity)

Let f∈C1f \in C^1 on an open convext set SS. Then,

f is convex  ⟺  f(x)≥f(x′)+∇f(x′)T(x−x′),∀x,x′∈Sf \text{ is convex} \iff f(\mathbf{x}) \geq f(\mathbf{x^{\prime}}) + \nabla f(\mathbf{x^{\prime}})^T (\mathbf{x} - \mathbf{x^{\prime}}), \quad \forall \mathbf{x}, \mathbf{x^{\prime}} \in S
Proof (First Order Characterization of Convexity)

Let ff be a convex functrion. Let x,x′∈S\mathbf{x}, \mathbf{x^{\prime}} \in S and λ∈(0,1)\lambda \in (0,1). By the definition of convexity,

f(λx+(1−λ)x′)≤λf(x)+(1−λ)f(x′)⏟f(x′)−λf(x′)f(x)−f(x′)≥f(λx+(1−λ)x′)−f(x′)λ≥f(x′+λ(x−x′))−f(x′)λ\begin{align*} f(\lambda \mathbf{x} + (1-\lambda) \mathbf{x^{\prime}}) & \leq \lambda f(\mathbf{x}) + \underbrace{(1-\lambda) f(\mathbf{x^{\prime}})}_{f(\mathbf{x}^{\prime}) - \lambda f(\mathbf{x}^{\prime})} \newline f(\mathbf{x}) - f(\mathbf{x^{\prime}}) & \geq \frac{f(\lambda \mathbf{x} + (1-\lambda) \mathbf{x^{\prime}}) - f(\mathbf{x^{\prime}})}{\lambda} \newline & \geq \frac{f(\mathbf{x^{\prime}} + \lambda (\mathbf{x} - \mathbf{x^{\prime}})) - f(\mathbf{x^{\prime}})}{\lambda} \newline \end{align*}

If we now let λ→0+\lambda \to 0^{+}, we get,

f(x)−f(x′)≥∇f(x′)T(x−x′)f(x)≥f(x′)+∇f(x′)T(x−x′) ■\begin{align*} f(\mathbf{x}) - f(\mathbf{x^{\prime}}) & \geq \nabla f(\mathbf{x^{\prime}})^T (\mathbf{x} - \mathbf{x^{\prime}}) \newline f(\mathbf{x}) & \geq f(\mathbf{x^{\prime}}) + \nabla f(\mathbf{x^{\prime}})^T (\mathbf{x} - \mathbf{x^{\prime}}) \ _\blacksquare \end{align*}

Now, let,

f(x)≥f(x′)+∇f(x′)T(x−x′),∀x,x′∈Sf(\mathbf{x}) \geq f(\mathbf{x^{\prime}}) + \nabla f(\mathbf{x^{\prime}})^T (\mathbf{x} - \mathbf{x^{\prime}}), \quad \forall \mathbf{x}, \mathbf{x^{\prime}} \in S

Let x1,x2∈S\mathbf{x}_1, \mathbf{x}_2 \in S and λ∈(0,1)\lambda \in (0,1). We set x=x1\mathbf{x} = \mathbf{x}_1 and x′=λx1+(1−λ)x2\mathbf{x^{\prime}} = \lambda \mathbf{x}_1 + (1-\lambda) \mathbf{x}_2 in the above inequality to get,

f(x1)≥f(λx1+(1−λ)x2)+∇f(λx1+(1−λ)x2)T(x1−(λx1+(1−λ)x2))f(\mathbf{x}_1) \geq f(\lambda \mathbf{x}_1 + (1-\lambda) \mathbf{x}_2) + \nabla f(\lambda \mathbf{x}_1 + (1-\lambda) \mathbf{x}_2)^T (\mathbf{x}_1 - (\lambda \mathbf{x}_1 + (1-\lambda) \mathbf{x}_2))

Further, we set x=x2\mathbf{x} = \mathbf{x}_2 and x′=λx1+(1−λ)x2\mathbf{x^{\prime}} = \lambda \mathbf{x}_1 + (1-\lambda) \mathbf{x}_2 in the above inequality to get,

f(x2)≥f(λx1+(1−λ)x2)+∇f(λx1+(1−λ)x2)T(x2−(λx1+(1−λ)x2))f(\mathbf{x}_2) \geq f(\lambda \mathbf{x}_1 + (1-\lambda) \mathbf{x}_2) + \nabla f(\lambda \mathbf{x}_1 + (1-\lambda) \mathbf{x}_2)^T (\mathbf{x}_2 - (\lambda \mathbf{x}_1 + (1-\lambda) \mathbf{x}_2))

Multiplying the first inequality by λ\lambda and the second by (1−λ)(1-\lambda) and adding them, we get,

λf(x1)+(1−λ)f(x2)≥f(λx1+(1−λ)x2)+∇f(λx1+(1−λ)x2)T(λ(x1−(λx1+(1−λ)x2))+(1−λ)(x2−(λx1+(1−λ)x2)))=f(λx1+(1−λ)x2)+∇f(λx1+(1−λ)x2)T⋅0=f(λx1+(1−λ)x2) ■\begin{align*} \lambda f(\mathbf{x}_1) + (1-\lambda) f(\mathbf{x}_2) & \geq f(\lambda \mathbf{x}_1 + (1-\lambda) \mathbf{x}_2) + \nabla f(\lambda \mathbf{x}_1 + (1-\lambda) \mathbf{x}_2)^T \newline & \quad (\lambda (\mathbf{x}_1 - (\lambda \mathbf{x}_1 + (1-\lambda) \mathbf{x}_2)) + (1-\lambda) (\mathbf{x}_2 - (\lambda \mathbf{x}_1 + (1-\lambda) \mathbf{x}_2))) \newline & = f(\lambda \mathbf{x}_1 + (1-\lambda) \mathbf{x}_2) + \nabla f(\lambda \mathbf{x}_1 + (1-\lambda) \mathbf{x}_2)^T \cdot 0 \newline & = f(\lambda \mathbf{x}_1 + (1-\lambda) \mathbf{x}_2) \ _\blacksquare \end{align*}

Subgradients & Subdifferentials

Definition 4 (Subgradient)

Let S⊆RnS \subseteq \mathbb{R}^n be a convex set and f:S→Rf: S \to \mathbb{R} be a convex function. P∈RnP \in \mathbb{R}^n is called a subgradient of ff at x′∈S\mathbf{x^{\prime}} \in S if,

f(x)≥f(x′)+PT(x−x′),∀x∈Sf(\mathbf{x}) \geq f(\mathbf{x^{\prime}}) + P^T (\mathbf{x} - \mathbf{x^{\prime}}), \quad \forall \mathbf{x} \in S
Definition 5 (Subdifferential)

Let S⊆RnS \subseteq \mathbb{R}^n be a convex set and f:S→Rf: S \to \mathbb{R} be a convex function. The subdifferential of ff at x′∈S\mathbf{x^{\prime}} \in S is defined as,

∂f(x′)≔{P∈Rn∣f(x)≥f(x′)+PT(x−x′),∀x∈S}\partial f(\mathbf{x^{\prime}}) \coloneqq \{ P \in \mathbb{R}^n \mid f(\mathbf{x}) \geq f(\mathbf{x^{\prime}}) + P^T (\mathbf{x} - \mathbf{x^{\prime}}), \quad \forall \mathbf{x} \in S \}

Or, in other words, the set of all subgradients of ff at x′\mathbf{x^{\prime}}.

Proposition 3 (Subdifferential of Differentiable Convex Function)

Let S⊆RnS \subseteq \mathbb{R}^n be a convex set and f:S→Rf: S \to \mathbb{R} be a convex function. If x′∈int S\mathbf{x}^{\prime} \in \mathrm{int} \, S 4, and ff is differentiable at x′\mathbf{x}^{\prime}, then,

∂f(x′)={∇f(x′)}\partial f(\mathbf{x^{\prime}}) = \{ \nabla f(\mathbf{x^{\prime}}) \}

Characterizations of Convexity (of C2C^2 Functions)

Theorem 3 (Second Order Characterization of Convexity)

Let S⊆RnS \subseteq \mathbb{R}^n be an open convex set and f∈C2f \in C^2 on SS. Then,

f is convex  ⟺  ∇2f(x)⪰0,∀x∈Sf \text{ is convex} \iff \nabla^2 f(\mathbf{x}) \succeq 0, \quad \forall \mathbf{x} \in S

where ∇2f(x)\nabla^2 f(\mathbf{x}) is the Hessian of ff at x\mathbf{x} and ⪰0\succeq 0 means positive semidefinite. Further,

∇2f(x)≻0,∀x∈S  ⟹  f is strictly convex\nabla^2 f(\mathbf{x}) \succ 0, \quad \forall \mathbf{x} \in S \implies f \text{ is strictly convex}

Notice how in the second part, we only have an implication and not an equivalence. This is because the converse is not necessarily true.

Example 3 (Second Order Characterization of Convexity)

Let f(x)=x4f(x) = x_4 this is a strictly convex and the gradient is,

∇f(x)=4x3\nabla f(x) = 4x^3

The Hessian is,

∇2f(x)=12x2,\nabla^2 f(x) = 12x^2,

But,

∇2f(0)=0⊁0\nabla^2 f(0) = 0 \nsucc 0
Example 4 (Second Order Characterization of Convexity)

Let f(x)=12xTQx−qTxf(\mathbf{x}) = \frac{1}{2} \mathbf{x}^T Q \mathbf{x} - \mathbf{q}^T \mathbf{x}, where Q∈Rn×nQ \in \mathbb{R}^{n \times n} is a symmetric matrix (i.e., Q=QTQ = Q^T) and q∈Rn\mathbf{q} \in \mathbb{R}^n. The gradient is,

∇f(x)=Qx−q\nabla f(\mathbf{x}) = Q \mathbf{x} - \mathbf{q}

The Hessian is,

∇2f(x)=Q\nabla^2 f(\mathbf{x}) = Q

Thus, by the second order characterization of convexity, ff is convex if and only if Q⪰0Q \succeq 0.

Convex Optimization Problems

Consider the problem PP

min⁡x f(x)subject to gi(x)≤0,i∈Igi(x)=0,i∈Ex∈X\begin{align*} \min_{\mathbf{x}} \ & f(\mathbf{x}) \newline \text{subject to } & g_i(\mathbf{x}) \leq 0, \quad i \in \mathcal{I} \newline & g_i(\mathbf{x}) = 0, \quad i \in \mathcal{E} \newline & \mathbf{x} \in X \end{align*}

PP is called a convex problem if,

  • (1) ff is convex,
  • (2) gi,i∈Ig_i, i \in \mathcal{I} are convex,
  • (3) gi,i∈Eg_i, i \in \mathcal{E} are affine,
  • (4) XX is a convex set.

These conditions make sure that {x∈Rn∣gi(x)≤0,i∈I}\{\mathbf{x} \in \mathbb{R}^n \mid g_i(\mathbf{x}) \leq 0, i \in \mathcal{I} \} is a convex set and {x∈Rn∣gi(x)=0,i∈E}\{\mathbf{x} \in \mathbb{R}^n \mid g_i(\mathbf{x}) = 0, i \in \mathcal{E} \} is a convext set.

Note

Very, very often we will minimize a function, but sometimes maximizing a function can be more natural, but we have to be careful.

min⁡f(x)  ⟺  −max⁡−f(x)\min f(\mathbf{x}) \iff -\max -f(\mathbf{x})

Therefore, also max⁡f(x)\max f(\mathbf{x}) for a concave function ff is a convex problem.

Footnotes
  1. Note that one can generalize this statement, the domains do not necessarily need to be Rn\mathbb{R}^n and R\mathbb{R}, respectievly.

    ↩
  2. The motivation here is, if we have f(x)=−xf(x) = -x, our composition will become concave.

    ↩
  3. Note that if we restrict our domain to R+\mathbb{R}^{+}, g(x)=x2g(x) = x^2 becomes non-decreasing and thus g(f(x))=(ex)2=e2xg(f(x)) = (e^x)^2 = e^{2x} is convex on R+\mathbb{R}^{+} as well.

    ↩
  4. int S\mathrm{int} \, S is the interior of SS.

    ↩

Search

Essays, lecture notes, and research

Type to search the site.