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 SRnS \subseteq \mathbb{R}^n is a convex set. Let f:SRf: S \mapsto \mathbb{R} be a function. We say that ff is a convex function if,

f(λx1+(1λ)x2)λf(x1)+(1λ)f(x2){x1,x2S,λ(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
Convex Function Definition
Note

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

f(λx1+(1λ)x2)<λf(x1)+(1λ)f(x2){x1,x2S,λ(0,1),x1x2f(\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,cRn,dR,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)=xf(\mathbf{x}) = \Vert \mathbf{x} \Vert

is convex.

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

is strictly convex.

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

Let SRnS \subseteq \mathbb{R}^n be a convex set and fk:SR,k=1,,Kf_k: S \mapsto \mathbb{R}, k=1, \ldots, K be convex functions. Let αk0,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:RnRg: \mathbb{R}^n \mapsto \mathbb{R} be a convex function and f:RRf: \mathbb{R} \mapsto \mathbb{R} 1Note that one can generalize this statement, the domains do not necessarily need to be Rn\mathbb{R}^n and R\mathbb{R}, respectievly. be a convex function and non-decreasing 2The motivation here is, if we have f(x)=xf(x) = -x, our composition will become concave. 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}) 3Note 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..

The Epigraph of a Function

Definition 2 (Epigraph of a Function)

The epigraph of a function f:RnR{±}f: \mathbb{R}^n \mapsto \mathbb{R} \cup \{\pm \infty \} is defined as,

epi(f){(x,α)Rn×Rf(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)C1set 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 fC1f \in C^1 on an open convext set SS. Then,

f is convex    f(x)f(x)+f(x)T(xx),x,xSf \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,xS\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+λ(xx))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(xx)f(x)f(x)+f(x)T(xx) \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(xx),x,xSf(\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,x2S\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)T0=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 SRnS \subseteq \mathbb{R}^n be a convex set and f:SRf: S \mapsto \mathbb{R} be a convex function. PRnP \in \mathbb{R}^n is called a subgradient of ff at xS\mathbf{x^{\prime}} \in S if,

f(x)f(x)+PT(xx),xSf(\mathbf{x}) \geq f(\mathbf{x^{\prime}}) + P^T (\mathbf{x} - \mathbf{x^{\prime}}), \quad \forall \mathbf{x} \in S
Definition 5 (Subdifferential)

Let SRnS \subseteq \mathbb{R}^n be a convex set and f:SRf: S \mapsto \mathbb{R} be a convex function. The subdifferential of ff at xS\mathbf{x^{\prime}} \in S is defined as,

f(x){PRnf(x)f(x)+PT(xx),xS}\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 SRnS \subseteq \mathbb{R}^n be a convex set and f:SRf: S \mapsto \mathbb{R} be a convex function. If xint S\mathbf{x}^{\prime} \in \mathrm{int} \ S 4int S\mathrm{int} \ S is the interior of SS., 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 SRnS \subseteq \mathbb{R}^n be an open convex set and fC2f \in C^2 on SS. Then,

f is convex    2f(x)0,xSf \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,xS    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)=00\nabla^2 f(0) = 0 \nsucc 0
Example 4 (Second Order Characterization of Convexity)

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

f(x)=Qxq\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 Q0Q \succeq 0.

Convex Optimization Problems

Consider the problem PP

minx f(x)subject to gi(x)0,iIgi(x)=0,iExX\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,iIg_i, i \in \mathcal{I} are convex,
  • (3) gi,iEg_i, i \in \mathcal{E} are affine,
  • (4) XX is a convex set.

These conditions make sure that {xRngi(x)0,iI}\{\mathbf{x} \in \mathbb{R}^n \mid g_i(\mathbf{x}) \leq 0, i \in \mathcal{I} \} is a convex set and {xRngi(x)=0,iE}\{\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.