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⊆Rn is a convex set. Let f:S↦R be a function.
We say that f is a convex function if,
f(λx1+(1−λ)x2)≤λf(x1)+(1−λ)f(x2){∀x1,x2∈S,λ∈(0,1)
Convex Function Definition
Note
It is called strictly convex if the inequality is strict for x1=x2, i.e.,
f(λx1+(1−λ)x2)<λf(x1)+(1−λ)f(x2)⎩⎨⎧∀x1,x2∈S,λ∈(0,1),x1=x2
The function is called concave if −f is convex.
Example 1 (Some Convex Functions)
f(x)=cTx+d,c∈Rn,d∈R,is both convex and concave (only function that is both convex and concave).
f(x)=∥x∥is convex.
f(x)=∥x∥2is strictly convex.
Proposition 1 (Non-negative Weighted Sum of Convex Functions is Convex)
Let S⊆Rn be a convex set and fk:S↦R,k=1,…,K be convex functions.
Let αk≥0,k=1,…,K. Then,
f(x):=k=1∑Kαkfk(x) is convex.
Proposition 2 (Composition of Convex Functions)
Let g:Rn↦R be a convex function and f:R↦R 1 be a convex function and non-decreasing 2 function. Then, the composition f(g(x)) is convex.
Example 2 (Composition of Convex Functions)
Let f(x)=ex and g(x)=x2. Both are convex on R and f is non-decreasing.
By our proposition, f(g(x))=ex2 is convex (on R) 3.
The Epigraph of a Function
Definition 2 (Epigraph of a Function)
The epigraph of a function f:Rn↦R∪{±∞} is defined as,
epi(f):={(x,α)∈Rn×R∣f(x)≤α}
Note
epi(f)⊆Rn+1
Theorem 1 (Characterization of Convex Functions via Epigraphs)
f is convex if and only if epi(f) is a convex set.]
Definition 3 (C1 Functions)
C1:=set of all continuously differentiable functions
Characterizations of Convexity (of C1 Functions)
Theorem 2 (First Order Characterization of Convexity)
Let f∈C1 on an open convext set S. Then,
f is convex⟺f(x)≥f(x′)+∇f(x′)T(x−x′),∀x,x′∈S
Proof (First Order Characterization of Convexity)
Let f be a convex functrion. Let x,x′∈S and λ∈(0,1). By the definition of convexity,
f(λx+(1−λ)x′)f(x)−f(x′)≤λf(x)+f(x′)−λf(x′)(1−λ)f(x′)≥λf(λx+(1−λ)x′)−f(x′)≥λf(x′+λ(x−x′))−f(x′)If we now let λ→0+, we get,
f(x)−f(x′)f(x)≥∇f(x′)T(x−x′)≥f(x′)+∇f(x′)T(x−x′) ■Now, let,
f(x)≥f(x′)+∇f(x′)T(x−x′),∀x,x′∈SLet x1,x2∈S and λ∈(0,1). We set x=x1 and x′=λx1+(1−λ)x2 in the above inequality to get,
f(x1)≥f(λx1+(1−λ)x2)+∇f(λx1+(1−λ)x2)T(x1−(λx1+(1−λ)x2))Further, we set x=x2 and x′=λx1+(1−λ)x2 in the above inequality to get,
f(x2)≥f(λx1+(1−λ)x2)+∇f(λx1+(1−λ)x2)T(x2−(λx1+(1−λ)x2))Multiplying the first inequality by λ and the second by (1−λ) 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) ■
Subgradients & Subdifferentials
Definition 4 (Subgradient)
Let S⊆Rn be a convex set and f:S↦R be a convex function.
P∈Rn is called a subgradient of f at x′∈S if,
f(x)≥f(x′)+PT(x−x′),∀x∈S
Definition 5 (Subdifferential)
Let S⊆Rn be a convex set and f:S↦R be a convex function. The subdifferential of f at x′∈S is defined as,
∂f(x′):={P∈Rn∣f(x)≥f(x′)+PT(x−x′),∀x∈S}Or, in other words, the set of all subgradients of f at x′.
Proposition 3 (Subdifferential of Differentiable Convex Function)
Let S⊆Rn be a convex set and f:S↦R be a convex function. If x′∈int S 4, and f is differentiable at x′, then,
∂f(x′)={∇f(x′)}
Characterizations of Convexity (of C2 Functions)
Theorem 3 (Second Order Characterization of Convexity)
Let S⊆Rn be an open convex set and f∈C2 on S. Then,
f is convex⟺∇2f(x)⪰0,∀x∈Swhere ∇2f(x) is the Hessian of f at x and ⪰0 means positive semidefinite.
Further,
∇2f(x)≻0,∀x∈S⟹f 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)=x4 this is a strictly convex and the gradient is,
∇f(x)=4x3The Hessian is,
∇2f(x)=12x2,But,
∇2f(0)=0⊁0
Example 4 (Second Order Characterization of Convexity)
Let f(x)=21xTQx−qTx, where Q∈Rn×n is a symmetric matrix (i.e., Q=QT) and q∈Rn. The gradient is,
∇f(x)=Qx−qThe Hessian is,
∇2f(x)=QThus, by the second order characterization of convexity, f is convex if and only if Q⪰0.
Convex Optimization Problems
Consider the problem P
xmin subject to f(x)gi(x)≤0,i∈Igi(x)=0,i∈Ex∈X
P is called a convex problem if,
- (1) f is convex,
- (2) gi,i∈I are convex,
- (3) gi,i∈E are affine,
- (4) X is a convex set.
These conditions make sure that {x∈Rn∣gi(x)≤0,i∈I} is a convex set and {x∈Rn∣gi(x)=0,i∈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)Therefore, also max f(x) for a concave function f is a convex problem.