Lec3 Convex Function Exercise
Lec3 Convex Function Exercise
Lec3 Convex Function Exercise
Bolei Zhang
December 7, 2022
1 Problems
Problem 1: A function f (·) is convex ⇐⇒ ∀x, v ∈ domf, g(t) = f (x + tv) is convex.
Theorem 1: First order condition: For a differentiable function f , if dom f is a convex set, then f is
a convex function ⇐⇒ f (y) ≥ f (x) + ∇f (x)T (y − x), ∀x, y ∈ domf .
Proof: First consider the case n = 1: We show that a differentiable function f : R → R is convex if
and only if
f (y) ≥ f (x) + f ′ (x)(y − x) (3)
for all x and y in domf .
Assume first that f is convex and x, y ∈ domf . Since domf is convex, we conclude that for all
0 < t ≤ 1, x + t(y − x) ∈ domf , and by convexity of f ,
Multiplying the first inequality by θ, the second by 1 − θ, and adding them yields
1
Now we can prove the general case, with f : Rn → R. Let x, y ∈ Rn and consider f restricted
to the line passing through them, i.e., the function defined by g(t) = f (ty + (1 − t)x), so g ′ (t) =
∇f (ty + (1 − t)x)T (y − x).
First assume f is convex, which implies g is convex, so by the argument above we have g(1) ≥
g(0) + g ′ (0), which means
f (y) ≥ f (x) + ∇f (x)T (y − x). (8)
Now assume that this inequality holds for any x and y, so if ty +(1−t)x ∈ domf , and t̃y +(1− t̃)x ∈
domf , we have
i.e., g(t) ≥ g(t) + g ′ (t̃)(t − t̃). We have seen that this implies that g is convex.
Problem 4: L0 norm: ||x||0 is the number of non-zero elements in x. Explain that whether L0 norm
is a norm function, whether it is a convex function.
Solution: Let x = (0, 1). There is ||x||0 = 1 and ||2x||0 = 1. However, 2||x||0 = 2, which violates the
homogeneity. Therefore, L0 norm is not a norm function.
Let x = (0, 1), y = (1, 0). Let θ = 0.5,
2
Problem 6: Compute the conjugate of the functions:
(1) f (x) = ax + b, domf = R.
(2) f (x) = − log x, domf = R++
. But this follows from the Cauchy-Schwarz inequality (aT a)(bT b) ≥ (aT b)2 applied to the vectors
√ √
with components ai = vi zi , bi = zi .
Pn
Problem 8: The KL-divergence is convex DKL (u, v) = i=1 (ui log uvii − ui + vi )
2
Solution: First, we show that g(x, t) = −t log(x/t) is convex on R++ : Let domf = C. The domain
2
domg = R++ is a convex set.
The function g(·) is convex because the function is defined as a scaled and shifted version of convex
function f (x).
n
Therefore, the relative entropy of two vectors u, v ∈ R++ , defined as
n
X
ui log(ui /vi )
i=1
. Show that this implies that f satisfies the strong max-min property:
3
(and their common value is f (x̃, z̃).
(3) Now suppose that f : Rn × Rm → R is differentiable, but not necessarily convex-concave, and
the saddle-point property holds at x̃, z̃:
where A11 ∈ Rn×n , A12 ∈ Rn×m , A21 ∈ Rm×n , A22 ∈ Rm×m . And there is ∇2 f = A11 , ∇2z f = A22 .
As f is convex when z is fixed, then A11 is positive semi-definite; As f is concave when x is fixed, then
A22 is negative semi-definite.
(2) For the first inequality, as f (x, z) is convex of x, there is
As
sup inf f (x, z) ≤ f (x̃, z̃),
z x
and
sup inf f (x, z) ≥ inf f (x, z̃) ≥ f (x̃, z̃),
z x x
Therefore, there is supz inf x f (x, z) = f (x̃, z̃). The same is true for inf x supz f (x, z) = f (x̃, z̃), which
proves the equality.
(3) We need to prove ∇x f (x̃, z̃) = 0 and ∇z f (x̃, z̃) = 0. We prove by contradiction. Assume
∇x f (x̃, z̃) ̸= 0, let v = (∇x f (x̃, z̃)T , 0)T . Get the first order of f (x̃ + tv, z̃) at (x̃, z̃) (t ̸= 0),
Solution: The domain of f (Ax + b) is the same with f (x), which is a convex set. For any two points
x, y ∈ domf , 0 ≤ θ ≤ 1, there is,
f (A(θx + (1 − θ)y) + b) = f (θ(Ax + b) + (1 − θ)(Ay + b)) ≤ θf (Ax + b) + (1 − θ)f (Ay + b). (14)