Convexity I: Sets and Functions: Ryan Tibshirani Convex Optimization 10-725
Convexity I: Sets and Functions: Ryan Tibshirani Convex Optimization 10-725
Ryan Tibshirani
Convex Optimization 10-725
min f (x) ●
x∈D ●
subject to gi (x) ≤ 0, i = 1, . . . , m
hj (x) = 0, j = 1, . . . , r
● ●
where f and gi , i = 1, . . . , m are all convex, and
●
hj , j = 1, . . . , r are affine. Special property:
●●
any local minimizer is a global minimizer
2
Outline
Today:
• Convex sets
• Examples
• Key properties
• Operations preserving convexity
• Same, for convex functions
3
Convex sets
Convex set: C ⊆ Rn such that
In words,
24
line segment joining any two elements lies entirely2 inConvex
set sets
Convex combination
which includes1 its boundary
Rn :darker),
Figure 2.2 Some simple convex and
of x , . . . , xk ∈(shown nonconvex sets. Left. The hexagon,
any linear combination
is convex. Middle. The kidney
shaped set is not convex, since the line segment between the two points in
the set shown as dots is not contained in the set. Right. The square contains
θ x + ··· + θ x
some boundary1 points
1 but not others,k kand is not convex.
P
with θi ≥ 0, i = 1, . . . , k, and ki=1 θi = 1. Convex hull of a set C,
conv(C), is all convex combinations of elements. Always convex
4
Examples of convex sets
• Halfspace: {x : aT x ≤ b}
5
• Polyhedron: {x : Ax ≤ b}, where inequality ≤ is interpreted
componentwise. Note: the set {x : Ax ≤ b, Cx = d} is also a
polyhedron
32 (why?) 2 Convex sets
a1
a2
P
a5
a3
a4
P = {x | Ax ≼ b, Cx = d} (2.6)
conv{e 1 , . . . , en }
for (2.5), where ⎡
=⎤ {w : w
⎡
≥⎤ 0, 1T w = 1}
aT1 cT1
⎢ .. ⎥ , ⎢ ⎥
A=⎣ . ⎦ C = ⎣ ... ⎦ ,
aTm cTp
and the symbol ≼ denotes vector inequality or componentwise inequality in Rm :
6
Cones
Cone: C ⊆ Rn such that
x ∈ C =⇒ tx ∈ C for all t ≥ 0
Convex cone:
26 cone that is also convex, i.e., 2 Convex sets
x1 , x2 ∈ C =⇒ t1 x1 + t2 x2 ∈ C for all t1 , t2 ≥ 0
x1
x2
0
Figure 2.4 The pie slice shows all points of the form θ1 x1 + θ2 x2 , where
θ 1 x 1 + · · · + θk x k
●
●
regardless of C
D
C
C ⊆ {x : aT x ≤ b}
D ⊆ {x : aT x ≥ b}
9
• Supporting hyperplane theorem: a boundary point of a convex
set has a supporting hyperplane passing through it
C ⊆ {x : aT x ≤ aT x0 }
aC + b = {ax + b : x ∈ C}
f −1 (D) = {x : f (x) ∈ D}
is convex
11
Example: linear matrix inequality solution set
Given A1 , . . . , Ak , B ∈ Sn , a linear matrix inequality is of the form
x 1 A1 + x 2 A2 + · · · + x k Ak B
k
X
T
v B− (txi + (1 − t)yi )Ai v ≥ 0
i=1
P
Approach 2: let f : Rk → Sn , f (x) = B − ki=1 xi Ai . Note that
C = f −1 (Sn+ ), affine preimage of convex set
12
More operations preserving convexity
• Perspective images and preimages: the perspective function is
P : Rn × R++ → Rn (where R++ denotes positive reals),
P (x, z) = x/z
13
Example: conditional probability set
Let U, V be random variables over {1, . . . , n} and {1, . . . , m}. Let
C ⊆ Rnm be a set of joint distributions for U, V , i.e., each p ∈ C
defines joint probabilities
pij = P(U = i, V = j)
14
f (θx + (1 − θ)y) ≤ θf (x) + (1 − θ)f (y). (3.1)
Convex functions
Geometrically, this inequality means that the line segment between (x, f (x)) and
(y, f (y)), which is the chord from x to y, lies above the graph of f (figure 3.1).
A function f is strictly convex if strict inequality holds in (3.1) whenever x ̸= y
n → R such that dom(f ) ⊆ Rn convex, and
0 < θ < 1. Wefsay
Convexandfunction: :Rf is concave if −f is convex, and strictly concave if −f is
strictly convex.
For an affine function we always have equality in (3.1), so all affine (and therefore
falso
(tx + (1
linear) − t)y)
functions ≤ tf
are both (1 − t)f
(x)and+concave.
convex (y) any
Conversely, 0 ≤ that
forfunction t≤1
is convex and concave is affine.
A function is convex if and only if it is convex when restricted to any line that
x, y ∈itsdom(f
and allintersects domain. In)other words f is convex if and only if for all x ∈ dom f and
(y, f (y))
(x, f (x))
f concave ⇐⇒ −f convex
15
Important modifiers:
• Strictly convex: f tx + (1 − t)y < tf (x) + (1 − t)f (y) for
x 6= y and 0 < t < 1. In words, f is convex and has greater
curvature than a linear function
16
Examples of convex functions
• Univariate functions:
I Exponential function: eax is convex for any a over R
I Power function: xa is convex for a ≥ 1 or a ≤ 0 over R+
(nonnegative reals)
I Power function: xa is concave for 0 ≤ a ≤ 1 over R+
I Logarithmic function: log x is concave over R++
17
• Norm: kxk is convex for any norm; e.g., `p norms,
n
!1/p
X
kxkp = |xi |p for p ≥ 1, kxk∞ = max |xi |
i=1,...,n
i=1
18
• Indicator function: if C is convex, then its indicator function
(
0 x∈C
IC (x) =
∞ x∈
/C
is convex
is convex
19
Key properties of convex functions
is a convex set
{x ∈ dom(f ) : f (x) ≤ t}
20
• First-order characterization: if f is differentiable, then f is
convex if and only if dom(f ) is convex, and
21
Operations preserving convexity
22
Example: distances to a set
f (x) = max kx − yk
y∈C
f (x) = min kx − yk
y∈C
23
More operations preserving convexity
24
• Vector composition: suppose that
f (x) = h g(x) = h g1 (x), . . . , gk (x)
where g : Rn → Rk , h : Rk → R, f : Rn → R. Then:
I f is convex if h is convex and nondecreasing in each
argument, g is convex
I f is convex if h is convex and nonincreasing in each
argument, g is concave
I f is concave if h is concave and nondecreasing in each
argument, g is concave
I f is concave if h is concave and nonincreasing in each
argument, g is convex
25
Example: log-sum-exp function
P T
Log-sum-exp function: g(x) = log( ki=1 eai x+bi ), for fixed ai , bi ,
i = 1, . . . , k. Often called “soft max”, as it smoothly approximates
maxi=1,...k (aTi x + bi )
26
References and further reading
27