18.10  Convex Functions

The chapter so far has studied convex sets. Convex functions have been in the book for longer, as the first subsection recalls, and every finite support function of §04 is one too. This section defines the notion, ties it to convex sets through the epigraph, and proves its basic theorems: Jensen’s inequality, the convexity of a supremum of affine functions, which pays a promise of Chapter 17 §06, a second-derivative test, and continuity. §11 then spends them on three classical inequalities.

Throughout, the field is R. V is a real vector space, and a set C⊆V called convex is convex in the sense of Definition 18.1.1. From the second-derivative test onward we work in Rn, with the standard inner product and its norm ‖⋅‖=‖⋅‖2. A function g on an interval of R is increasing when s≤t implies g(s)≤g(t), as in Chapter 17 §11, and strictly increasing when s<t implies g(s)<g(t).

18.10.1. Convex functions and their epigraphs

Look again at three inequalities the book has already proved. For a norm, (N2) and (N3) of Definition 16.1.1 give ‖tx+(1−t)y‖≤t‖x‖+(1−t)‖y‖ for 0≤t≤1. For the top partial sum sk(A)=∑i≤kλi(A) of a Hermitian matrix, Chapter 17 §06 derived sk(tA+(1−t)B)≤tsk(A)+(1−t)sk(B) from Corollary 17.6.5. And the case n=1 of operator convexity in Definition 17.11.1 (b) reads f(ta+(1−t)b)≤tf(a)+(1−t)f(b) for numbers a,b. It is the same inequality three times, and it deserves a name.

A function is convex when, on every segment of its domain, its graph lies on or below the chord.

Definition 18.10.1 (Convex Function)

Let C be a nonempty convex subset of a real vector space V, and let f:C→R. Then f is convex if f(tx+(1−t)y) ≤ tf(x)+(1−t)f(y) for all x,y∈C and all real t with 0≤t≤1. It is strictly convex if the inequality is strict whenever x≠y and 0<t<1. It is concave, or strictly concave, if −f is convex, or strictly convex.

The epigraph of f is the subset of the real vector space V×R, with componentwise operations, epif={(x,s)∈V×R:x∈C, s≥f(x)}.

In words: take any two points x and y of the domain and any point tx+(1−t)y between them. The left side is the value of f there. The right side is the value, at the same place, of the straight line through (x,f(x)) and (y,f(y)). So the condition says the chord is never below the graph. Strict convexity forbids the graph to touch the chord anywhere strictly between two distinct points. The epigraph is everything on or above the graph.

The domain must be convex, and this is the only thing to check. The point tx+(1−t)y must lie in C, or f is not defined there. That is exactly what Definition 18.1.1 guarantees.

Diagram. Labels: (x, f(x)), (y, f(y)), operatorname epi f

The picture shows f(x)=0.35x2 on R: the dashed chord lies above the graph between its endpoints, and the shaded region is the epigraph.

Example (First convex functions)

Check each against Definition 18.10.1.

  • (a) An affine function a(x)=φ(x)+c, with φ a linear functional on V (Definition 5.1.1) and c∈R.
  • (b) A norm ‖⋅‖ on Rn.
  • (c) f(x)=x2 on R, and more generally q(x)=x⊤Ax on Rn for a symmetric A⪰O.

Solution.

  • (a) Since φ is linear and c=tc+(1−t)c, a(tx+(1−t)y)=tφ(x)+(1−t)φ(y)+tc+(1−t)c=ta(x)+(1−t)a(y). Equality holds, so a is convex, and so is −a: an affine function is both convex and concave, and neither strictly. The constant functions are the degenerate case φ=0. They matter because they show that convexity by itself forces no growth at all.

  • (b) By (N3) and then (N2) of Definition 16.1.1, with |t|=t and |1−t|=1−t for 0≤t≤1, ‖tx+(1−t)y‖≤‖tx‖+‖(1−t)y‖=t‖x‖+(1−t)‖y‖. A norm is not strictly convex: on the ray through a nonzero x, ‖sx‖=s‖x‖ is linear in s≥0, so the chord between x and 2x lies on the graph.

  • (c) Expanding and collecting terms, tx2+(1−t)y2−(tx+(1−t)y)2=t(1−t)(x−y)2 ≥ 0, and the right side is strictly positive when x≠y and 0<t<1. So x2 is strictly convex. The same expansion with A symmetric gives tq(x)+(1−t)q(y)−q(tx+(1−t)y)=t(1−t)q(x−y), and q(x−y)=⟨A(x−y),x−y⟩≥0 by (P2) of Definition 13.1.1. So q is convex. The case n=1, A=(1), is x2.

A nonexample by minimal change. Replace x2 by x3 on R. With x=−2, y=0, and t=12, the left side is (−1)3=−1 and the right side is 12(−8)+12⋅0=−4, and −1≤−4 is false. What fails is the inequality for this pair, on the negative half-line, where the graph bends downward. On the convex domain (0,∞) the same function is convex, as the one-variable test below shows. So convexity depends on the domain.

Why this definition. The inequality is nonstrict so that affine functions and norms, the most important examples, qualify. Requiring it for every t∈[0,1], not just t=12, is what makes Jensen’s inequality below immediate. The name comes from the epigraph: a function is convex exactly when the set above its graph is convex.

Proposition 18.10.1 (Convex Function, Convex Epigraph)

Let C⊆V be nonempty and convex, and let f:C→R. Then f is convex if and only if epif is a convex subset of V×R.

Idea. A point (x,s) lies in the epigraph exactly when s≥f(x). So the chord inequality for f and the statement that segments between points of the epigraph stay in it are one inequality, read in two directions.

Proof. (⇒) Let (x,s),(y,u)∈epif and 0≤t≤1. The point tx+(1−t)y lies in C, since C is convex, and f(tx+(1−t)y)≤tf(x)+(1−t)f(y)≤ts+(1−t)u, the second step because f(x)≤s, f(y)≤u, and t,1−t≥0. So t(x,s)+(1−t)(y,u)∈epif.

(⇐) Let x,y∈C and 0≤t≤1. The points (x,f(x)) and (y,f(y)) lie in epif, so by convexity so does (tx+(1−t)y, tf(x)+(1−t)f(y)). By the definition of the epigraph this says f(tx+(1−t)y)≤tf(x)+(1−t)f(y). This proves the proposition.

The same one-line argument shows that every sublevel set {x∈C:f(x)≤c} of a convex f is convex: if f(x)≤c and f(y)≤c, then f(tx+(1−t)y)≤tc+(1−t)c=c.

Quick check. Every sublevel set of a convex function is convex. Is the converse true? Is a function f:R→R whose sublevel sets are all convex necessarily convex?

Solution. No. Take f(x)=x3. It is increasing: if a<b then b3−a3=(b−a)(a2+ab+b2)>0, since a2+ab+b2=(a+b2)2+34b2 vanishes only at a=b=0. So if x≤z≤y and x3,y3≤c, then z3≤y3≤c. Each sublevel set is therefore an interval, which is convex. But x3 is not convex on R, by the nonexample above.

Warning. A convex function need not be differentiable. The function |x| is a norm on R, hence convex, and it has a corner at 0: its difference quotients |h|/h are 1 for h>0 and −1 for h<0, so they have no limit. The same corner appears in linear algebra. The map A↦λ1(A) on Hermitian matrices is convex, as the next two subsections prove, and on the diagonal matrices diag(t,−t) it equals |t|. The corner sits at t=0, where the top eigenvalue is repeated.

18.10.2. Jensen’s inequality

The definition speaks of two points. Induction extends it to any finite convex combination (Definition 18.1.3), and that extension is the form in which convexity is most often used.

Theorem 18.10.2 (Jensen’s Inequality)

Let C⊆V be nonempty and convex, and let f:C→R be convex. Let x1,…,xm∈C, and let w1,…,wm≥0 with w1+⋯+wm=1. Then ∑iwixi∈C and f(∑i=1mwixi) ≤ ∑i=1mwif(xi). If f is strictly convex and every wi>0, equality holds only when x1=x2=⋯=xm.

Idea. Split off the last point. The remaining weights add up to s=1−wm, and after dividing by s they are the weights of a convex combination y of m−1 points, to which induction applies. The whole combination is then sy+wmxm, a combination of two points, which is where the definition applies.

Proof. We prove both statements by induction on m≥1. For m=1 the weight is w1=1, both sides equal f(x1), and the equality clause is empty.

Let m≥2 and assume both statements for m−1 points. If wm=1, every other weight is 0, both sides equal f(xm), and the equality clause does not apply since w1=0. Otherwise s=1−wm=w1+⋯+wm−1>0. The numbers wi/s for i<m are nonnegative with sum 1, so by the inductive hypothesis y=∑i<m(wi/s)xi lies in C and (1)f(y)≤∑i<mwisf(xi). Now ∑i=1mwixi=sy+wmxm with s+wm=1, so this point lies in C because C is convex, and Definition 18.10.1 gives (2)f(sy+wmxm)≤sf(y)+wmf(xm)≤∑i<mwif(xi)+wmf(xm), where the second step multiplies (1) by s>0. This proves the inequality.

For the equality clause, let f be strictly convex and every wi>0, so that 0<wm<1 and 0<s<1. If equality holds in the theorem, both inequalities in (2) are equalities. The second is s times (1), so (1) is an equality, and the inductive hypothesis gives x1=⋯=xm−1; then y equals this common point. The first is the two-point inequality with weights strictly between 0 and 1, so strict convexity forces y=xm. Hence all m points are equal, as claimed.

In the language of §01, the points (xi,f(xi)) lie in the convex set epif, and Jensen’s inequality says that their convex combinations stay there. That is Theorem 18.1.3 read inside the epigraph.

18.10.3. Suprema of affine functions

Chapter 17 §06 showed that sk(A)=∑i≤kλi(A) is the largest of the linear functions A↦tr(Q∗AQ), deduced its convexity, and ended with a promise: “Chapter 18 studies convex functions in general, and the observation that a pointwise supremum of linear functions is convex is one of its basic facts.” Here is that fact, stated for affine functions, which include the linear ones.

Proposition 18.10.3 (A Supremum of Affine Functions Is Convex)

Let C⊆V be nonempty and convex, and let (ai)i∈I be a nonempty family of affine functions on V. Suppose that for every x∈C the set {ai(x):i∈I} is bounded above, and put g(x)=supi∈Iai(x)(x∈C). Then g:C→R is convex.

Idea. Each ai meets its own chord inequality with equality, and each lies below g. So at a point between x and y, every ai is at most the chord of g, and therefore so is their supremum.

Proof. The supremum exists for each x∈C by completeness, fact (A1) of Chapter 16’s introduction. Let x,y∈C and 0≤t≤1. For each i∈I, by Example (First convex functions) (a) and then ai≤g at x and at y, ai(tx+(1−t)y)=tai(x)+(1−t)ai(y)≤tg(x)+(1−t)g(y), where the inequality uses t≥0 and 1−t≥0. So the right side is an upper bound for the set {ai(tx+(1−t)y):i∈I}, and it is therefore at least that set’s least upper bound, g(tx+(1−t)y). This proves the proposition.

The proof never used that the ai are affine beyond the fact that each is convex. So the same argument shows that a pointwise supremum of convex functions is convex, whenever it is finite. In particular the maximum of two convex functions is convex. The minimum need not be: min(x,−x)=−|x| is concave and not convex.

Instances. Many convex functions of this chapter are suprema of linear functions, and this proposition proves their convexity at a stroke.

  • |x|=max(x,−x); ‖x‖∞=maximax(xi,−xi); and ‖x‖1=max{⟨ϵ,x⟩:ϵ∈{±1}n}, the maximum being attained at the vector of signs of x.
  • The support function hK(y) of Definition 18.4.2 is the supremum over x∈K of the linear functions y↦⟨x,y⟩. So it is convex wherever it is finite, and in particular the dual norm of Definition 18.4.4 is convex.
  • Every norm is the maximum of x↦⟨x,y⟩ over ‖y‖∗≤1 (Corollary 18.4.9). This describes the norm; it is not a new proof of its convexity, since §04 derived the corollary from the triangle inequality.
  • The largest eigenvalue: by Lemma 13.5.2, λ1(A)=max‖x‖=1⟨Ax,x⟩, and each A↦⟨Ax,x⟩ is linear.
  • The Ky Fan sums sk, the case that prompted the promise. They are the subject of the next subsection.

18.10.4. Convex functions of a Hermitian matrix

Let F=R or F=C. The Hermitian n×n matrices over F form a real vector space: if A∗=A, B∗=B, and s,t∈R, then (sA+tB)∗=sA+tB. They do not form a complex one, since (iI)∗=−iI. This is the space on which Chapter 17 §06 called sk convex, and it is the setting here. When F=C it is an instance of the chapter’s convention that a complex space is treated as a real one.

Corollary 18.10.4 (The Top Eigenvalue Sums Are Convex)

Let 1≤k≤n. On the real vector space of Hermitian n×n matrices over F, the function sk(A)=λ1(A)+⋯+λk(A) is convex. In particular A↦λ1(A) is convex, and A↦λn(A) is concave.

Idea. Ky Fan’s theorem writes sk as a maximum of the functions A↦tr(Q∗AQ), each linear on the real space of Hermitian matrices, so Proposition 18.10.3 applies. For λn, change the sign of A.

Proof. By Theorem 17.6.2, sk(A)=max{tr(Q∗AQ):Q∈Mn×k(F), Q∗Q=Ik}. Fix such a Q. The matrix Q∗AQ is Hermitian, so its diagonal entries, and hence its trace, are real. By Theorem 0.9.6 (1), A↦tr(Q∗AQ) respects sums and real multiples. So it is a linear functional on the real space of Hermitian matrices, and sk is the maximum of this family. By Proposition 18.10.3, sk is convex, and k=1 gives λ1.

For λn, the eigenvalues of −A are the negatives of those of A, so λn(A)=−λ1(−A), as in the proof of Corollary 17.6.6. The map A↦λ1(−A) is convex, because it is the convex λ1 composed with the linear map A↦−A, and a convex function composed with a linear map is convex, by substituting into Definition 18.10.1. So λn is the negative of a convex function, that is, concave.

This is the fact Chapter 17 §06 anticipated, and its promise is now paid. Chapter 17 reached convexity by a different path: Corollary 17.6.5 gives sk(A+B)≤sk(A)+sk(B), and positive homogeneity sk(tA)=tsk(A), t≥0, turns subadditivity into convexity. Exercise C1 shows that the two paths are the same, and the warning at the end of Chapter 17 §06 still stands: a single λk with 1<k<n, the difference sk−sk−1 of two convex functions, is neither convex nor concave.

What is not proved here. For a convex f on an interval, A↦trf(A)=∑if(λi(A)) is convex on the Hermitian matrices with spectrum in that interval, a statement about sums over the spectrum and far weaker than the operator convexity of Chapter 17 §11. It is proved in Chapter 21, and nothing in this chapter uses it.

18.10.5. A second-derivative test

For a function on an interval, convexity says the slope never decreases. The mean value theorem turns an increasing derivative into a chord inequality.

Lemma 18.10.5 (Increasing Derivative Gives Convexity)

Let I⊆R be an open interval and let g:I→R be differentiable. If g′ is increasing on I, then g is convex; if g′ is strictly increasing, then g is strictly convex. In particular, if g is twice differentiable with g″≥0 on I, then g is convex, and if g″>0 on I, then g is strictly convex.

Idea. Split the chord at the intermediate point z into two sub-chords, over [x,z] and over [z,y]. By the mean value theorem, each slope is a value of g′ inside its interval, so an increasing g′ makes the left slope at most the right one. A graph whose chord slopes increase in this way lies below the long chord.

Proof. Let x,y∈I and 0<t<1; the cases t=0, t=1, and x=y are equalities. Exchanging x with y and t with 1−t if necessary, we may assume x<y. Put z=tx+(1−t)y, so that x<z<y, with z−x=(1−t)(y−x),y−z=t(y−x). By the mean value theorem, fact (A6) of Chapter 16’s introduction, applied on [x,z] and on [z,y], there are c1∈(x,z) and c2∈(z,y) with g(z)−g(x)=(1−t)(y−x)g′(c1),g(y)−g(z)=t(y−x)g′(c2). Since c1<c2 and g′ is increasing, g′(c1)≤g′(c2). Multiplying by t(1−t)(y−x)>0, t(g(z)−g(x))=t(1−t)(y−x)g′(c1)≤t(1−t)(y−x)g′(c2)=(1−t)(g(y)−g(z)). Rearranged, this is g(z)≤tg(x)+(1−t)g(y). If g′ is strictly increasing, then g′(c1)<g′(c2), and every inequality is strict.

For the last sentence, let a<b in I. Fact (A6) applied to g′ gives g′(b)−g′(a)=g″(c)(b−a) for some c∈(a,b). This is ≥0 when g″≥0, and >0 when g″>0. So g′ is increasing, or strictly increasing, and the first part applies.

Derivatives of polynomials, here and below, come from Chapter 10 §09: a polynomial is a power series with finitely many nonzero coefficients, so it converges for every real argument and that section’s fact (A2) differentiates it term by term, while its fact (A3), the linearity of differentiation, handles sums and constant multiples; a partial derivative is such a derivative with the other variables fixed. For instance, g(x)=x4 has g′(x)=4x3, which is strictly increasing (the Quick check after Proposition 18.10.1), so x4 is strictly convex on R. Likewise x3, with g″=6x≥0 on (0,∞), is convex there, which is the claim made after the nonexample.

In several variables the second derivative is the Hessian Hf(a) of Definition 14.6.2, and “g″≥0” becomes “positive semidefinite”. Chapter 14 §06 read the Hessian at a single critical point, where its definiteness decides a local extremum (Theorem 14.6.4). Here the Hessian is asked to be positive semidefinite at every point, and what it decides is global. Restricting f to lines would need a chain rule the book has not imported, so the proof below uses only Chapter 14 §06’s (A1), that Hf(a) is symmetric, and its (A2), Taylor’s theorem with a remainder r(h) satisfying r(h)/‖h‖2→0. It works with second differences, which (A2) controls directly.

Theorem 18.10.6 (Convexity from the Hessian)

Let U⊆Rn be a nonempty open convex set, and let f:U→R be twice continuously differentiable.

  • (a) f is convex on U if and only if Hf(a)⪰O for every a∈U.
  • (b) If Hf(a)≻O for every a∈U, then f is strictly convex on U.

Idea. Taylor’s theorem at z, applied at z+sv and at z−sv and added, kills the gradient term: f(z+sv)+f(z−sv)−2f(z)s2 ⟶ v⊤Hf(z)v. For (⇒), convexity makes the left side ≥0, so the limit is too. For the other direction, restrict f to a segment and subtract the chord. If the difference were positive somewhere, it would have an interior maximum, and at a maximum every second difference is ≤0. That contradicts a strictly positive limit. So the argument handles Hf≻O first, and reaches Hf⪰O by adding ε‖x‖2 and letting ε→0.

Proof. Write H(z)=Hf(z). For z∈U, v∈Rn, and real s≠0 small enough that z±sv∈U, put Δ(z,v,s)=f(z+sv)+f(z−sv)−2f(z).

Step 1: the second difference. We claim Δ(z,v,s)/s2→v⊤H(z)v as s→0. If v=0 both sides are 0. Otherwise Chapter 14 §06’s (A2) at z, with h=sv and with h=−sv, gives f(z±sv)=f(z)±s∇f(z)⋅v+12s2v⊤H(z)v+r(±sv). Adding the two and subtracting 2f(z), Δ(z,v,s)s2=v⊤H(z)v+‖v‖2(r(sv)‖sv‖2+r(−sv)‖sv‖2), and the bracket tends to 0 because ‖±sv‖→0. The same expansion shows that f is continuous: f(z+h)−f(z)=∇f(z)⋅h+12h⊤H(z)h+‖h‖2⋅r(h)/‖h‖2, and each term tends to 0 as h→0.

Step 2: (a), (⇒). Let f be convex, a∈U, and v∈Rn. For small s≠0, a=12(a+sv)+12(a−sv), so f(a)≤12f(a+sv)+12f(a−sv), that is, Δ(a,v,s)≥0. Dividing by s2>0 and letting s→0, Step 1 gives v⊤H(a)v≥0, since a nonstrict inequality survives a limit. The matrix H(a) is symmetric by Chapter 14 §06’s (A1), so H(a)⪰O by Definition 13.1.1.

Step 3: a maximum principle. Let x≠y in U, put v=y−x, and let ϕ:U→R be continuous with the following property: for every point z=x+tv with 0<t<1, the limit L(z)=lims→0(ϕ(z+sv)+ϕ(z−sv)−2ϕ(z))/s2 exists and is strictly positive. We claim ϕ(x+tv)<(1−t)ϕ(x)+tϕ(y)(0<t<1). Define h(t)=ϕ(x+tv)−(1−t)ϕ(x)−tϕ(y) on [0,1]. Every point of the segment lies in U, since U is convex. So h is continuous, and h(0)=h(1)=0. The subtracted part is affine in t, so its second differences vanish, and h(t+s)+h(t−s)−2h(t)=ϕ(z+sv)+ϕ(z−sv)−2ϕ(z) with z=x+tv.

Suppose h(t1)≥0 for some t1∈(0,1). The interval [0,1] is closed and bounded, hence compact by fact (A3) of Chapter 16’s introduction, so by the extreme value theorem, fact (A4), h attains a maximum value M at some point. Then M≥h(t1)≥0. If the maximum is attained only at 0 or 1, then M=0≤h(t1), so t1 attains it too. Either way, M=h(t∗) for some t∗∈(0,1). For 0<s<min(t∗,1−t∗), both h(t∗±s)≤h(t∗), so the second difference of h at t∗ is ≤0, and so is its limit L(x+t∗v). This contradicts L>0. Hence h<0 on (0,1), which is the claim.

Step 4: (b). Let H(z)≻O for every z∈U. By Step 1, ϕ=f has L(z)=v⊤H(z)v>0 whenever v≠0, and it is continuous. So Step 3 gives f((1−t)x+ty)<(1−t)f(x)+tf(y) for all x≠y in U and 0<t<1. Renaming t as 1−t, this is strict convexity.

Step 5: (a), (⇐). Let H(z)⪰O for every z∈U. Let x≠y in U, v=y−x, 0<t<1, and ε>0. Put ϕ(z)=f(z)+ε‖z‖2, which is continuous. Expanding the norms, ‖z+sv‖2+‖z−sv‖2−2‖z‖2=2s2‖v‖2, so by Step 1 the limit for ϕ is L(z)=v⊤H(z)v+2ε‖v‖2≥2ε‖v‖2>0. Step 3 applies. With w=(1−t)x+ty, it gives f(w)+ε‖w‖2<(1−t)(f(x)+ε‖x‖2)+t(f(y)+ε‖y‖2). Let ε→0 through ε=1/k. The inequality survives as a nonstrict one, and gives f(w)≤(1−t)f(x)+tf(y). The cases x=y, t=0, and t=1 are equalities. So f is convex. This proves the theorem.

For n=1, part (a) says that a twice continuously differentiable g on an open interval is convex exactly when g″≥0, and its “if” half is Lemma 18.10.5 again.

Quick check. The function f(x)=x4 is strictly convex on R. Is its Hessian, the 1×1 matrix (f″(x)), positive definite at every point? What does this say about part (b)?

Solution. No. f″(x)=12x2 vanishes at x=0, so the 1×1 matrix O1 is positive semidefinite but not positive definite. Yet f is strictly convex, as shown after Lemma 18.10.5. So the converse of part (b) fails: strict convexity does not force a positive definite Hessian.

Convexity is tested segment by segment, so f is convex exactly when its restriction t↦f(x+tv) to every line is convex. The phrase every line matters.

Warning. Convex along every line through one point is not enough. Let f(x,y)=x2y2 on R2. On each line through the origin, f(tv)=t4v12v22, a nonnegative multiple of the convex t4, so each such restriction is convex. But f is not convex. On the segment from (1,0) to (0,1), a line that misses the origin, f(1−t,t)=t2(1−t)2 is 0 at both ends and 116 at the midpoint. So the value at the midpoint exceeds the average 0 of the end values.

The Hessian test sees the same failure without guessing the segment. Here Hf(x,y)=(2y24xy4xy2x2),detHf(x,y)=−12x2y2, so at (1,1) the determinant is −12<0. The two eigenvalues of this symmetric matrix have product −12, so one is negative, and Hf(1,1)⪰̸O. Part (a) confirms that f is not convex.

18.10.6. Continuity

The warning about |x| shows that convexity does not buy differentiability. It does buy continuity on an open set, and in finite dimension the proof is short: a bound from above near a point is enough, and Jensen’s inequality supplies one.

Theorem 18.10.7 (Convex Functions Are Continuous)

Let U⊆Rn be a nonempty open convex set and let f:U→R be convex. Then f is continuous on U. More precisely, for every a∈U there are δ>0 and L≥0 with |f(a+h)−f(a)|≤L‖h‖whenever ‖h‖≤δ.

Idea. ① Bound f above on a small ball around a. The ball sits inside the “diamond” spanned by the 2n points a±ρei, and Jensen bounds f on the diamond by its largest value at those points. ② Turn an upper bound into a two-sided linear bound. Walk from a toward a+h and on to the edge of the ball: convexity makes the rise over the short step at most a fraction of the rise over the whole way. Then walk the other way for the lower bound.

Proof. Fix a∈U. Since U is open, Proposition 18.1.6 (a) gives r>0 such that every point within distance r of a lies in U. Put ρ=r/2. The 2n+1 points a and a±ρei lie in U, so let M be the largest value of f at them.

Step 1: an upper bound. Let h=∑ihiei with ‖h‖1≤ρ, and let σi=1 if hi≥0 and σi=−1 otherwise, so that |hi|σi=hi. Then a+h=∑i=1n|hi|ρ(a+ρσiei)+(1−‖h‖1ρ)a, a convex combination: the weights are nonnegative and add up to 1. By Theorem 18.10.2, f(a+h)≤M. Put δ=ρ/n. If ‖h‖≤δ, then ‖h‖1≤n‖h‖≤ρ by Proposition 16.1.2, so f(a+h)≤M.

Step 2: the linear bound. Put L=(M−f(a))/δ, which is ≥0 because a is one of the points defining M. Let 0<‖h‖≤δ; for h=0 there is nothing to prove. Put s=‖h‖/δ∈(0,1] and u=h/s, so that ‖u‖=δ and su=h. First, a+h=(1−s)a+s(a+u), so convexity gives f(a+h)≤(1−s)f(a)+sf(a+u), that is, f(a+h)−f(a)≤s(f(a+u)−f(a))≤s(M−f(a)), using Step 1 at u. Second, a=11+s(a+h)+s1+s(a−u), as one checks by multiplying out and using su=h. Here a−u lies in U, and convexity gives (1+s)f(a)≤f(a+h)+sf(a−u), that is, f(a)−f(a+h)≤s(f(a−u)−f(a))≤s(M−f(a)), using Step 1 at −u. Together, |f(a+h)−f(a)|≤s(M−f(a))=L‖h‖.

Step 3: continuity. If xk→a, then ‖xk−a‖≤δ for all large k, and for those k Step 2 gives |f(xk)−f(a)|≤L‖xk−a‖→0. So f is continuous at a, in the sequential sense of Chapter 16’s introduction. As a was arbitrary, this proves the theorem.

By Theorem 16.2.2 the choice of the Euclidean norm is immaterial: every norm on Rn gives the same continuous functions. Both hypotheses of the theorem are needed.

Warning. The domain must be open. On the closed interval [0,1], let f=0 on [0,1) and f(1)=1. It is convex: the right side tf(x)+(1−t)f(y) is never negative, and the left side is 0 unless tx+(1−t)y=1, which for 0<t<1 forces x=y=1, where both sides equal 1. But f(1−1/k)=0↛1=f(1). A convex function can jump at a boundary point of its domain.

Remark. Finite dimension is needed too. On the polynomials in C[0,1], with the sup norm ‖p‖∞=maxt∈[0,1]|p(t)| of Chapter 16 §01 restricted to them, the functional φ(p)=p′(1) is linear, hence convex, on the whole space. The polynomials pk=xk2/k have ‖pk‖∞=1/k→0 and φ(pk)=k→∞, so φ is not continuous at 0. Step 1 is what fails: there is no finite set of points whose convex hull contains a ball.

The basic theory is now in place. A convex function is one with a convex epigraph; Jensen’s inequality extends its defining inequality to every finite average; every supremum of affine functions is one, which accounts for the Ky Fan sums; the Hessian tests for it; and on an open set it is continuous. What it has not yet done is prove an inequality the book did not already know. §11 does that: with a logarithm constructed from the exponential, Jensen’s inequality for −log gives the weighted arithmetic–geometric mean inequality, and from it come Young’s and Hölder’s inequalities, the triangle inequality for every p-norm, and the dual norms that §04 left open.

18.10.7. Exercises

A. Check your understanding

Exercise (A1)
  • (a) Define “f is convex on C”, and explain why C is required to be convex.
  • (b) Decide whether the following is correct, and justify your answer: if f and g are convex on C, then so are f+g and max(f,g).
  • (c) Decide whether the following is correct, and justify your answer: if f and g are convex on R, then so is their product fg.
  • (d) Decide whether the following is correct, and justify your answer: a convex function on R is differentiable.
  • (e) Decide whether the following is correct, and justify your answer: if f:R2→R is convex along every line through the origin, then f is convex.
  • (f) Name the facts of analysis that the proof of Theorem 18.10.6 uses.

Solution.

  • (a) Let C be a nonempty convex subset of a real vector space. Then f:C→R is convex if f(tx+(1−t)y)≤tf(x)+(1−t)f(y) for all x,y∈C and all t∈[0,1] (Definition 18.10.1). The left side evaluates f at tx+(1−t)y, and this point is in the domain for every choice exactly when C is convex.

  • (b) Correct. Adding the inequalities for f and for g gives the inequality for f+g. For the maximum, the remark after Proposition 18.10.3 applies: its proof works for any family of convex functions, and here the family is {f,g}.

  • (c) Incorrect. f(x)=x is affine and g(x)=x2 is convex (Example (First convex functions)), but fg=x3 is not convex on R: at −2, 0, and their midpoint −1 the nonexample after Example (First convex functions) gives −1>−4.

  • (d) Incorrect. |x| is convex and not differentiable at 0, as the first warning of the section shows.

  • (e) Incorrect. f(x,y)=x2y2 is convex along every line through the origin but not convex, since f(12,12)=116>0=12f(1,0)+12f(0,1).

  • (f) Chapter 14 §06’s assumptions (A1), the symmetry of the Hessian, and (A2), Taylor’s theorem with a second-order remainder; facts (A3) and (A4) of Chapter 16’s introduction, compactness of [0,1] and the extreme value theorem, in the maximum principle; and the algebra of limits, in the form “a nonstrict inequality survives a limit”.

B. Practice

Exercise (B1: Which are convex?)

Determine which of the following functions are convex on the given domain. Justify your answer.

  • (a) f(x,y)=2x2−2xy+y2 on R2.
  • (b) f(x,y)=x2+4xy+y2 on R2.
  • (c) f(x)=max(2x+1, −x, 3) on R.
  • (d) g(x)=1/x on (0,∞).
  • (e) g(x)=1/x on {x∈R:x≠0}.

Solution.

  • (a) Convex, indeed strictly convex. f is a polynomial, so twice continuously differentiable, with constant Hessian H=(4−2−22), which is symmetric. For v=(v1,v2), v⊤Hv=4v12−4v1v2+2v22=2(v12+(v1−v2)2), which is positive unless v1=0 and v1=v2, that is, unless v=0. So H≻O at every point, and Theorem 18.10.6 (b) applies.

  • (b) Not convex. Take x=(1,−1) and y=(−1,1), with midpoint 0. Then f(x)=1−4+1=−2=f(y), while f(0)=0>12(−2)+12(−2)=−2. The inequality of Definition 18.10.1 fails with t=12.

  • (c) Convex. The three functions 2x+1, −x, and the constant 3 are affine, and f is their maximum, so Proposition 18.10.3 applies.

  • (d) Strictly convex. For x>0 and small h≠0, 1h(1x+h−1x)=−1x(x+h) ⟶ −1x2, so g′(x)=−1/x2. If 0<a<b then 1/a2>1/b2, so −1/a2<−1/b2: g′ is strictly increasing on (0,∞), and Lemma 18.10.5 gives strict convexity.

  • (e) The question has no answer: Definition 18.10.1 requires a convex domain, and this one is not. It contains −1 and 1 but not their midpoint 0, so the defining inequality is undefined for x=−1, y=1, t=12.

C. Going deeper

Exercise (C1: Subadditive and homogeneous)

Let g:V→R be positively homogeneous: g(tx)=tg(x) for every x∈V and every real t≥0.

  • (a) Prove that g is convex if and only if g(x+y)≤g(x)+g(y) for all x,y∈V.
  • (b) Deduce that every norm on Rn is convex, and that Corollary 17.6.5 and Corollary 18.10.4 are equivalent statements about sk.

Solution.

  • (a) (⇒) Let g be convex. By homogeneity with t=2 and then convexity with t=12, g(x+y)=2g(12x+12y)≤2(12g(x)+12g(y))=g(x)+g(y). (⇐) Let g be subadditive, and let 0≤t≤1. By subadditivity and then homogeneity with the nonnegative numbers t and 1−t, g(tx+(1−t)y)≤g(tx)+g((1−t)y)=tg(x)+(1−t)g(y).

  • (b) A norm is positively homogeneous by (N2) of Definition 16.1.1, since |t|=t for t≥0, and subadditive by (N3); so it is convex by (a). This is a second proof of Example (First convex functions) (b). The function sk is positively homogeneous on the Hermitian matrices, since multiplying by t≥0 multiplies each eigenvalue by t and keeps their order. So by (a), subadditivity of sk, which is Corollary 17.6.5, holds exactly when sk is convex, which is Corollary 18.10.4.

Exercise (C2: Tangent lines)

Let I⊆R be an open interval and let g:I→R be differentiable and convex.

  • (a) Prove that g(y)≥g(x)+g′(x)(y−x) for all x,y∈I.
  • (b) Deduce that g(y)=maxx∈I(g(x)+g′(x)(y−x)) for every y∈I: a differentiable convex function is the maximum of its tangent lines.

Hint: in (a), apply the definition to the points x and y with weight s on y, and let s→0.

Solution.

  • (a) If y=x both sides are equal. Let y≠x and 0<s≤1. Convexity with weight s on y gives g(x+s(y−x))≤(1−s)g(x)+sg(y), that is, (y−x)⋅g(x+s(y−x))−g(x)s(y−x) ≤ g(y)−g(x). The fraction is a difference quotient of g at x with step s(y−x)≠0. Take s=1/k; the step tends to 0, so the fraction tends to g′(x). A nonstrict inequality survives the limit, so (y−x)g′(x)≤g(y)−g(x), as claimed.

  • (b) For fixed y, each ℓx(y)=g(x)+g′(x)(y−x) is at most g(y) by (a), and ℓy(y)=g(y). So the maximum over x exists, is attained at x=y, and equals g(y). Each ℓx is an affine function of y, so this is the converse of Proposition 18.10.3, for differentiable functions.

Exercise (C3: Where a convex function is largest)
  • (a) Let f:Rn→R be convex, and let P be the convex hull conv{x1,…,xm}. Prove that maxx∈Pf(x)=maxif(xi).
  • (b) Let f(x,y)=x2−xy+y2 and let P be the triangle conv{(2,0),(0,2),(−2,−2)}. Find the maximum and the minimum of f on P, and say where each is attained.

Solution.

  • (a) Each xi lies in P, so the maximum over P, if it exists, is at least maxif(xi). Conversely, let x∈P. By Theorem 18.1.3, x=∑iwixi for some weights wi≥0 with sum 1, and Theorem 18.10.2 gives f(x)≤∑iwif(xi)≤maxif(xi). So maxif(xi) is an upper bound for f on P that is attained, hence the maximum. Compare Corollary 18.8.6, which says the same for a linear function on any compact convex set, with extreme points in place of the xi.

  • (b) The Hessian is the constant symmetric matrix (2−1−12), and 2v12−2v1v2+2v22=v12+v22+(v1−v2)2≥0, so it is positive semidefinite and f is convex by Theorem 18.10.6 (a). By (a) the maximum is the largest vertex value: f(2,0)=4, f(0,2)=4, and f(−2,−2)=4−4+4=4. So the maximum is 4, attained at all three vertices. For the minimum, f(x,y)=12(x2+y2+(x−y)2)≥0, with equality only at (0,0). And (0,0)=13(2,0)+13(0,2)+13(−2,−2) lies in P. So the minimum is 0, attained only at the interior point (0,0). The maximum of a convex function sits at vertices; its minimum need not.

Found a typo or a mistake? Report it, or read this page’s source

The text of this book is licensed under CC BY-NC-SA 4.0.