Lectures

Math Camp

Lecture 5: Curvature, Convexity, and Separation

Lecture 4 used a linear map to approximate a differentiable function near a point. In the one-variable case, we saw that f(x0+h)f(x0)+f(x0)h.f(x_0+h)\approx f(x_0)+f'(x_0)h.

In this lecture we are interested in the curvature of a function, which is described by a second-order approximation. In the one-variable case, if ff is twice continuously differentiable near x0x_0, the second-order Taylor approximation adds a quadratic term: f(x0+h)f(x0)+f(x0)h+12f(x0)h2.f(x_0+h)\approx f(x_0)+f'(x_0)h+\frac12 f''(x_0)h^2. When f(x0)=0f'(x_0)=0, the linear term vanishes, so first-order information does not tell us whether the graph bends upward or downward. The sign of f(x0)f''(x_0) does. In several variables, the Hessian HfH_{f} generalizes f(x0)f''(x_0), and the quadratic term becomes 12hHf(x0)h\tfrac12h^{\top}H_{f}(x_0)h.

1 Second-order approximation and curvature

1.1 Hessians and local quadratic models

Definition 1.1 (C2C^2 function). Let UnU\subseteq\mathbb{R}^{n} be open. A function f:Uf:U\to\mathbb{R} is C2C^2 on UU, or twice continuously differentiable on UU, if each first partial derivative f/xi\partial f/\partial x_i is C1C^1 on UU. Equivalently, all second partial derivatives of ff exist and are continuous on UU.

Definition 1.2 (Hessian). Let UnU\subseteq\mathbb{R}^{n} be open and let f:Uf:U\to\mathbb{R} be differentiable. If the gradient f:Un\nabla f:U\to\mathbb{R}^{n} is differentiable at xUx\in U, the Hessian of ff at xx is the Jacobian of its gradient, Hf(x)=D(f)(x).H_{f}(x)=\mathrm{D}(\nabla f)(x). It is the n×nn\times n matrix whose (i,j)(i,j) entry is (Hf(x))ij=xj(fxi)(x).\left(H_{f}(x)\right)_{ij} =\frac{\partial}{\partial x_j} \left(\frac{\partial f}{\partial x_i}\right)(x).

Example 1.3 (Computing a Hessian). Let f:2f:\mathbb{R}^2\to\mathbb{R} be given by f(x1,x2)=x12x2.f(x_1,x_2)=x_1^2x_2. In Lecture 4 we computed f(x)=(2x1x2x12).\nabla f(x) =\begin{pmatrix}2x_1x_2\\x_1^2\end{pmatrix}. The Hessian is the Jacobian of the gradient, so Hf(x)=(2x22x12x10).H_{f}(x) =\begin{pmatrix} 2x_2&2x_1\\ 2x_1&0 \end{pmatrix}.

Theorem 1.4 (Equality of mixed partials). Let UnU\subseteq\mathbb{R}^{n} be open and let f:Uf:U\to\mathbb{R} be C2C^2. Then xj(fxi)(x)=xi(fxj)(x)\frac{\partial}{\partial x_j} \left(\frac{\partial f}{\partial x_i}\right)(x) = \frac{\partial}{\partial x_i} \left(\frac{\partial f}{\partial x_j}\right)(x) for every xUx\in U and every i,ji,j. Thus Hf(x)H_{f}(x) is symmetric.

We use this result without proof. Importantly, it requires continuity of the second partial derivatives.

Theorem 1.5 (Second-order Taylor expansion). Let UnU\subseteq\mathbb{R}^{n} be open, let f:Uf:U\to\mathbb{R} be C2C^2, and let x0Ux_0\in U. For changes hh such that x0+thUx_0+th\in U for every t[0,1]t\in[0,1],

f(x0+h)=f(x0)+f(x0)h+12hHf(x0)h+r(h),|r(h)|h20as h0.f(x_0+h) =f(x_0)+\nabla f(x_0)\cdot h +\frac12h^{\top}H_{f}(x_0)h+r(h), \qquad \frac{\lvert r(h) \rvert}{\lVert h \rVert^2}\longrightarrow0 \quad\text{as }h\to0.(1)

We use this result without proof. It has exactly the form of the linear approximation in Lecture 4, with one additional term. The expression f(x0)+f(x0)h+12hHf(x0)hf(x_0)+\nabla f(x_0)\cdot h +\frac12h^{\top}H_{f}(x_0)h is the quadratic approximation to f(x0+h)f(x_0+h). The first-order approximation stops after the linear term and has a remainder negligible relative to h\lVert h \rVert. The second-order approximation keeps the quadratic term and has a remainder negligible relative to h2\lVert h \rVert^2.

1.2 Quadratic forms and their shapes

The quadratic term of the Taylor approximation has the form xAxx^{\top}Ax. We next study expressions of this form, called quadratic forms. They are essentially quadratic polynomials in several variables. Like quadratic functions in one dimension, quadratic forms have a constant Hessian. That allows us to characterize all possible types of curvature in terms of the sign of the quadratic form.

Definition 1.6 (Quadratic form).

Let AA be a symmetric n×nn\times n matrix. The function QA(x)=xAx,xn,Q_A(x)=x^{\top}Ax, \qquad x\in\mathbb{R}^{n}, is the quadratic form associated with AA.

The restriction to symmetric matrices is without loss of generality. That is, if a quadratic form is associated with a nonsymmetric matrix BB, then the same quadratic form is associated with a symmetric matrix B̃=(B+B)/2\widetilde{B}=(B+B^{\top})/2.

Next, the Hessian of QA=xAxQ_A=x^{\top}Ax equals 2A2A. To see this, observe that QA(x)=i=1nj=1naijxixj,Q_A(x)=\sum_{i=1}^n\sum_{j=1}^n a_{ij}x_ix_j, so, using the symmetry aij=ajia_{ij}=a_{ji}, the kkth component of the gradient and the (k,l)(k,l) second partial are QAxk(x)=2j=1nakjxj,xl(QAxk)(x)=2akl.\frac{\partial Q_A}{\partial x_k}(x)=2\sum_{j=1}^n a_{kj}x_j, \qquad \frac{\partial}{\partial x_l} \left(\frac{\partial Q_A}{\partial x_k}\right)(x)=2a_{kl}. In matrix form, QA(x)=2Ax\nabla Q_A(x)=2Ax and HQA(x)=2A,H_{Q_A}(x)=2A, which indeed does not depend on xx.

The sign of xAxx^{\top}Ax (which is a scalar) describes the possible shapes of the curvature of the quadratic form in n\mathbb{R}^n.

Definition 1.7 (Definiteness). Let AA be a symmetric n×nn\times n matrix. A is 𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒 𝑑𝑒𝑓𝑖𝑛𝑖𝑡𝑒xAx>0for every x0,A is 𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒 𝑠𝑒𝑚𝑖𝑑𝑒𝑓𝑖𝑛𝑖𝑡𝑒xAx0for every x,A is 𝑛𝑒𝑔𝑎𝑡𝑖𝑣𝑒 𝑑𝑒𝑓𝑖𝑛𝑖𝑡𝑒xAx<0for every x0,A is 𝑛𝑒𝑔𝑎𝑡𝑖𝑣𝑒 𝑠𝑒𝑚𝑖𝑑𝑒𝑓𝑖𝑛𝑖𝑡𝑒xAx0for every x.\begin{aligned} A\text{ is }\textit{positive definite}\text{} &\quad\Longleftrightarrow\quad x^{\top}Ax>0 &&\text{for every }x\ne0,\\ A\text{ is }\textit{positive semidefinite}\text{} &\quad\Longleftrightarrow\quad x^{\top}Ax\geq0 &&\text{for every }x,\\ A\text{ is }\textit{negative definite}\text{} &\quad\Longleftrightarrow\quad x^{\top}Ax<0 &&\text{for every }x\ne0,\\ A\text{ is }\textit{negative semidefinite}\text{} &\quad\Longleftrightarrow\quad x^{\top}Ax\leq0 &&\text{for every }x. \end{aligned} The matrix is indefinite if its quadratic form takes both positive and negative values.

Figure 1.1. Four representative quadratic forms in two variables. The light blue surface is the graph of Q over a square around the origin; the two thick curves show the values of Q along the x_1-axis and along the x_2-axis.

To read the pictures, fix a direction v0v\ne0 and move through the origin along the line tvtv. Along this line, the quadratic form becomes the one-variable function ϕv(t)=QA(tv)=t2vAv\phi_v(t)=Q_A(tv)=t^2\,v^{\top}Av, a parabola through the origin with second derivative ϕv(t)=2vAv.\phi_v''(t)=2v^{\top}Av. The sign of vAvv^{\top}Av therefore tells us whether this slice bends upward, bends downward, or is flat. Thus definiteness describes every one-dimensional slice through the origin. Positive definite means that every nonzero-direction slice bends upward, so the origin is the unique global minimum; negative definite means that every such slice bends downward, so the origin is the unique global maximum. A positive semidefinite form may be flat in some directions, while an indefinite form bends upward in some directions and downward in others, so the origin is neither a maximum nor a minimum. These are exactly the shapes in Figure 1.1.

1.3 Computational tests for definiteness

Checking definiteness of a matrix AA using the definition in Definition 1.7 requires evaluating xAxx^{\top}Ax for every nonzero xnx\in\mathbb{R}^{n}; that is not very practical.

Instead, this section introduces two types of tests that are easier to apply. The first uses eigenvalues, and the second uses determinants of submatrices.

For a diagonal matrix D=(λ1000λ2000λn),D=\begin{pmatrix} \lambda_1&0&\cdots&0\\ 0&\lambda_2&\cdots&0\\ \vdots&\vdots&\ddots&\vdots\\ 0&0&\cdots&\lambda_n \end{pmatrix}, the check is immediate: xDx=λ1x12+λ2x22++λnxn2,x^{\top}Dx=\lambda_1x_1^2+\lambda_2x_2^2+\cdots+\lambda_nx_n^2, a sum of squares weighted by the diagonal entries. If every λi>0\lambda_i>0, the sum is positive for every x0x\ne0, so DD is positive definite; if every λi0\lambda_i\geq0, the sum is nonnegative, so DD is positive semidefinite; the negative cases flip the inequalities. If some λi>0>λj\lambda_i>0>\lambda_j, then eiDei=λi>0e_i^{\top}De_i=\lambda_i>0 and ejDej=λj<0e_j^{\top}De_j=\lambda_j<0, so DD is indefinite. The definiteness of a diagonal matrix is thus decided by the signs of its diagonal entries.

Recall the diagonalization theorem of Lecture 3: a matrix AA with nn independent eigenvectors can be written as A=PDP1A=PDP^{-1}, where the columns of PP are the eigenvectors and DD is the diagonal matrix of the corresponding eigenvalues; we also noted, without proof, that symmetric matrices always have nn independent eigenvectors. For symmetric matrices slightly more is true: the eigenvectors can be chosen so that P1=PP^{-1}=P^{\top} — such a PP is called orthogonal — and the factorization becomes A=PDPA=PDP^{\top}. This refinement is the spectral theorem, which we again use without proof. It reduces any symmetric matrix to the diagonal case: changing variables to z=Pxz=P^{\top}x turns xAxx^{\top}Ax into zDzz^{\top}Dz, and the diagonal computation above applies. This gives the first test.

Theorem 1.8 (Eigenvalue test). Let AA be a symmetric n×nn\times n matrix. Then A is positive definiteevery eigenvalue of A is positive,A is positive semidefiniteevery eigenvalue of A is nonnegative,A is negative definiteevery eigenvalue of A is negative,A is negative semidefiniteevery eigenvalue of A is nonpositive.\begin{aligned} A\text{ is positive definite} &\quad\Longleftrightarrow\quad \text{every eigenvalue of }A\text{ is positive},\\ A\text{ is positive semidefinite} &\quad\Longleftrightarrow\quad \text{every eigenvalue of }A\text{ is nonnegative},\\ A\text{ is negative definite} &\quad\Longleftrightarrow\quad \text{every eigenvalue of }A\text{ is negative},\\ A\text{ is negative semidefinite} &\quad\Longleftrightarrow\quad \text{every eigenvalue of }A\text{ is nonpositive}. \end{aligned} The matrix is indefinite if and only if it has eigenvalues of both signs.

Proof (optional). By the spectral theorem, write A=PDPA=PDP^{\top} with D=diag(λ1,,λn)D=\operatorname{diag}(\lambda_1,\ldots,\lambda_n) and PP orthogonal, and put z=Pxz=P^{\top}x. Then xAx=xPDPx=zDz=i=1nλizi2.x^{\top}Ax=x^{\top}PDP^{\top}x=z^{\top}Dz=\sum_{i=1}^n\lambda_i z_i^2 . Since PP is orthogonal, x=Pzx=Pz, so x=0x=0 if and only if z=0z=0, and as xx ranges over n\mathbb{R}^{n} so does zz. The quantity xAxx^{\top}Ax therefore has the same range of signs as iλizi2\sum_i\lambda_i z_i^2 over all zz. That sum is positive for every z0z\ne0 exactly when every λi>0\lambda_i>0: the “if” direction is immediate, and taking z=eiz=e_i gives λi\lambda_i itself, which forces the “only if” direction. The other three cases are the same argument with the inequality changed, and the indefinite case follows by taking z=eiz=e_i for eigenvalues of each sign. ◻

The second test requires no eigenvalues. Instead, it looks at the signs of the determinants of certain submatrices of AA.

Definition 1.9 (Principal minors). Let AA be an n×nn\times n matrix. For a nonempty index set I{1,,n}I\subseteq\{1,\ldots,n\}, let AIA_I be the square matrix obtained by retaining the rows and columns whose indices belong to II. The determinant detAI\det A_I is a principal minor of order kk when II contains kk indices. The minors Δk=detA{1,,k},k=1,,n,\Delta_k=\det A_{\{1,\ldots,k\}}, \qquad k=1,\ldots,n, are the leading principal minors of AA.

In general, a minor of AA is the determinant of a submatrix obtained by retaining some rows and some columns; a minor is principal when the retained row and column index sets are the same set II. For example, for a 3×33\times3 matrix A=(aij)A=(a_{ij}), the index set I={1,3}I=\{1,3\} retains rows 1,31,3 and columns 1,31,3: A{1,3}=(a11a13a31a33),A_{\{1,3\}} =\begin{pmatrix}a_{11}&a_{13}\\a_{31}&a_{33}\end{pmatrix}, and detA{1,3}\det A_{\{1,3\}} is a principal minor of order 22. Counting nonempty index sets, AA has 231=72^3-1=7 principal minors. The three leading ones come from the sets {1}\{1\}, {1,2}\{1,2\}, and {1,2,3}\{1,2,3\}, so they grow from the top-left corner: Δ1=a11,Δ2=det(a11a12a21a22),Δ3=detA.\Delta_1=a_{11}, \qquad \Delta_2=\det\begin{pmatrix}a_{11}&a_{12}\\a_{21}&a_{22}\end{pmatrix}, \qquad \Delta_3=\det A.

Definiteness can be read off the signs of these minors.

Theorem 1.10 (Principal-minor tests). Let AA be a symmetric n×nn\times n matrix, and let Δ1,,Δn\Delta_1,\ldots,\Delta_n be its leading principal minors.

  1. AA is positive definite if and only if Δk>0\Delta_k>0 for every k=1,,nk=1,\ldots,n.

  2. AA is negative definite if and only if (1)kΔk>0(-1)^k\Delta_k>0 for every k=1,,nk=1,\ldots,n.

  3. AA is positive semidefinite if and only if every principal minor of AA is nonnegative.

  4. AA is negative semidefinite if and only if every principal minor of order kk has sign satisfying (1)kdetAI0.(-1)^k\det A_I\geq0.

We use this result without proof. The first two parts are commonly called Sylvester’s criterion. Notice the difference between the definite and semidefinite cases: definite matrices require only the nn leading principal minors, while semidefinite matrices require all 2n12^n-1 nonempty principal minors.

Example 1.11 (The 2×22\times2 tests).

Let A=(abbc).A=\begin{pmatrix}a&b\\b&c\end{pmatrix}. Its leading principal minors are aa and acb2ac-b^2, while all of its principal minors are aa, cc, and acb2ac-b^2. Therefore A is positive definitea>0 and acb2>0,A is negative definitea<0 and acb2>0,A is positive semidefinitea0,c0, and acb20,A is negative semidefinitea0,c0, and acb20.\begin{aligned} A\text{ is positive definite} &\quad\Longleftrightarrow\quad a>0\text{ and }ac-b^2>0,\\ A\text{ is negative definite} &\quad\Longleftrightarrow\quad a<0\text{ and }ac-b^2>0,\\ A\text{ is positive semidefinite} &\quad\Longleftrightarrow\quad a\geq0,\ c\geq0, \text{ and }ac-b^2\geq0,\\ A\text{ is negative semidefinite} &\quad\Longleftrightarrow\quad a\leq0,\ c\leq0, \text{ and }ac-b^2\geq0. \end{aligned} For the positive-definite case, the first line can also be seen directly by completing the square (possible whenever a0a\ne0): xAx=a(x1+bax2)2+acb2ax22.x^{\top}Ax =a\left(x_1+\frac{b}{a}x_2\right)^2 +\frac{ac-b^2}{a}\,x_2^2. If a>0a>0 and acb2>0ac-b^2>0, both coefficients are positive. Conversely, if AA is positive definite, evaluating at x=e1x=e_1 gives a>0a>0, and evaluating at x=(b/a,1)x=(-b/a,1)^{\top} gives (acb2)/a>0(ac-b^2)/a>0.

The next example shows why the semidefinite tests need more than just the leading minors.

Example 1.12 (Weak leading-minor inequalities are insufficient).

Let A=diag(0,1)A=\operatorname{diag}(0,-1). Its leading minors satisfy Δ1=Δ2=0\Delta_1=\Delta_2=0, but the principal minor indexed by I={2}I=\{2\} is 1-1. Thus weak inequalities on the leading minors alone do not establish positive semidefiniteness. The missing principal minor detects the negative direction e2e_2, along which e2Ae2=1e_2^{\top}Ae_2=-1.

Example 1.13 (A three-variable quadratic form).

Let Q:3Q:\mathbb{R}^3\to\mathbb{R} be given by Q(x1,x2,x3)=x12x22x32+x1x2+x2x3.Q(x_1,x_2,x_3) =-x_1^2-x_2^2-x_3^2+x_1x_2+x_2x_3. Its Hessian is HQ=(210121012),H_{Q} =\begin{pmatrix} -2&1&0\\ 1&-2&1\\ 0&1&-2 \end{pmatrix}, whose leading principal minors are Δ1=2,Δ2=3,Δ3=4.\Delta_1=-2, \qquad \Delta_2=3, \qquad \Delta_3=-4. Thus (1)kΔk(-1)^k\Delta_k equals 22, 33, and 44, respectively, so by Theorem 1.10 HQH_{Q} is negative definite. This establishes negative definiteness without computing any eigenvalues.

The tests apply equally when the Hessian entries are not constant.

Example 1.14 (A varying Hessian). Let f:++2f:\mathbb{R}_{++}^{2}\to\mathbb{R} be given by f(x1,x2)=logx1+logx2f(x_1,x_2)=\log x_1+\log x_2. Differentiating twice, Hf(x)=(1/x12001/x22),H_{f}(x) =\begin{pmatrix} -1/x_1^2&0\\ 0&-1/x_2^2 \end{pmatrix}, which is diagonal with negative entries and hence negative definite at every xx, by Theorem 1.8. The Hessian varies with xx, but its definiteness does not.

In the last example of this section, definiteness depends on a parameter.

Example 1.15 (An interaction term). Fix b2b\in\mathbb{R}^2 and γ\gamma\in\mathbb{R}, and define q:2q:\mathbb{R}^2\to\mathbb{R} by q(x)=bx(x12+γx1x2+x22).q(x)=b\cdot x-\left(x_1^2+\gamma x_1x_2+x_2^2\right). Here HqH_{q} is constant. Direct differentiation gives Hq=(2γγ2).H_{q} =\begin{pmatrix}-2&-\gamma\\-\gamma&-2\end{pmatrix}. The leading principal minors are 2-2 and 4γ24-\gamma^2. Therefore Theorem 1.10 shows that HqH_{q} is negative definite when |γ|<2\lvert \gamma \rvert<2. When |γ|=2\lvert \gamma \rvert=2, its two order-one principal minors are negative and its determinant is zero, so it is negative semidefinite. When |γ|>2\lvert \gamma \rvert>2, its determinant is negative, so it is indefinite: symmetry makes both eigenvalues real, and their negative product forces them to have opposite signs. The interaction term can therefore preserve, flatten, or overturn the downward curvature of the two squared terms.

At this point two exact tests are available: definiteness can be read off the signs of the eigenvalues (Theorem 1.8) or off the signs of the principal minors (Theorem 1.10). Often a full classification is unnecessary, and a cheaper observation settles the question. Table 1.1 collects these quick checks for the negative case; reversing every sign gives the positive case. A necessary condition can rule the property out but never establishes it.

Table 1.1. Quick checks for a symmetric matrix AA with entries aija_{ij} and leading principal minors Δk\Delta_k.
Check Verdict
aii0a_{ii}\leq0 for every ii necessary for negative semidefiniteness, not sufficient
aii<0a_{ii}<0 for every ii necessary for negative definiteness, not sufficient
(1)kΔk0(-1)^k\Delta_k\geq0 for every kk necessary for negative semidefiniteness, not sufficient
(1)kΔk>0(-1)^k\Delta_k>0 for every kk equivalent to negative definiteness
some xx has xAx>0x^{\top}Ax>0 counterexample to negative semidefiniteness
some x0x\ne0 has xAx=0x^{\top}Ax=0 counterexample to negative definiteness
negative semidefinite and detA0\det A\ne0 sufficient for negative definiteness

The diagonal checks follow by evaluating the quadratic form at the coordinate vectors, since eiAei=aiie_i^{\top}Ae_i=a_{ii}. The reverse is not true in the first three rows: for example, (1221)\left(\begin{smallmatrix}-1&2\\2&-1\end{smallmatrix}\right) passes both diagonal checks yet is indefinite. The last row follows from the eigenvalue test: the eigenvalues are nonpositive and their product detA\det A is nonzero, so all of them are negative.

2 Convex sets and concave functions

2.1 Convex sets and preservation

The Hessian and Taylor expansion describe a function near one point. Turning their curvature information into a statement about the function everywhere requires moving between arbitrary points along the segment joining them. The domain must contain that segment.

Definition 2.1 (Convex combination and convex set). Let x,ynx,y\in\mathbb{R}^{n}.

  • A convex combination of xx and yy is a point (1t)x+ty,t[0,1],(1-t)x+ty, \qquad t\in[0,1] , and the set of all of them is the line segment joining xx and yy.

  • A set CnC\subseteq\mathbb{R}^{n} is convex if (1t)x+tyCfor every x,yC and every t[0,1].(1-t)x+ty\in C \qquad\text{for every }x,y\in C\text{ and every }t\in[0,1] .

At t=0t=0 the combination is xx and at t=1t=1 it is yy, so a set is convex exactly when the segment joining any two of its points stays inside it. For example, n\mathbb{R}^{n} itself, every affine subspace, every halfspace {x:axc}\{x:a\cdot x\leq c\}, and the orthants +n\mathbb{R}^n_+ and ++n\mathbb{R}^n_{++} are convex. The unit circle {x2:x=1}\{x\in\mathbb{R}^2:\lVert x \rVert=1\} is not: it contains e1e_1 and e1-e_1 but not their midpoint 00. Figure 2.1 shows the definition in 2\mathbb{R}^2.

Figure 2.1. The set on the left is convex: for any two points in the set, the segment joining them is inside the set. The right is not convex: the segment joining the marked points x and y is not entirely in the set.

Rather than verify Definition 2.1 for each new set, it is usually quicker to build the set out of convex pieces. An affine map T:nmT:\mathbb{R}^{n}\to\mathbb{R}^m has the form T(x)=Ax+bT(x)=Ax+b for an m×nm\times n matrix AA and a vector bmb\in\mathbb{R}^m.

Theorem 2.2 (Preservation rules). The following constructions preserve convexity.

  1. The intersection of any collection of convex sets is convex.

  2. The Cartesian product of convex sets is convex.

  3. The image of a convex set under an affine map is convex.

  4. The inverse image of a convex set under an affine map is convex.

Proof (optional). Intersections. Let C=αCαC=\bigcap_{\alpha}C_{\alpha} with each CαC_{\alpha} convex, and let x,yCx,y\in C and t[0,1]t\in[0,1]. For each α\alpha both xx and yy lie in CαC_{\alpha}, so Definition 2.1 puts (1t)x+ty(1-t)x+ty in CαC_{\alpha}. Being in every CαC_{\alpha}, it lies in CC.

Products. Convex combinations in a product are taken coordinate block by coordinate block, so the claim follows by applying Definition 2.1 in each factor.

Affine maps. Let T(x)=Ax+bT(x)=Ax+b. Expanding, and recombining the two copies of bb as (1t)b+tb(1-t)b+tb,

T((1t)x+ty)=A((1t)x+ty)+b=(1t)T(x)+tT(y),T\left((1-t)x+ty\right) =A\left((1-t)x+ty\right)+b =(1-t)T(x)+tT(y) ,(2)

so TT carries the segment joining xx and yy onto the segment joining T(x)T(x) and T(y)T(y). If CC is convex, (2) exhibits every point between T(x)T(x) and T(y)T(y) as the image of a point of CC, so T(C)T(C) is convex. If DD is convex and x,yT1(D)x,y\in T^{-1}(D), then (2) puts T((1t)x+ty)T((1-t)x+ty) between T(x)T(x) and T(y)T(y), hence in DD. ◻

A useful consequence of the preservation rules: any finite list of linear equalities and inequalities defines a convex set. The example below shows why.

Example 2.3 (Linear restrictions define a convex set).

Let AA be m×nm\times n, let BB be p×np\times n, and let bmb\in\mathbb{R}^m and cpc\in\mathbb{R}^p. The set C={xn:Axb,Bx=c}C=\{x\in\mathbb{R}^{n}:Ax\leq b,\ Bx=c\} is convex, where the inequality is coordinatewise. Each row of these restrictions has the form ax=da\cdot x=d or axda\cdot x\leq d for some ana\in\mathbb{R}^{n} and dd\in\mathbb{R}. The set each restriction defines is the inverse image of the convex set {d}\{d\} or (,d](-\infty,d] under the affine map xaxx\mapsto a\cdot x. Part (4) of Theorem 2.2 makes each restriction convex, and part (1) makes their intersection CC convex.

2.2 Concavity and superlevel sets

Convexity of a set says that its line segments stay in the domain. Concavity then compares the height of a function along those same segments.

Definition 2.4 (Concave and convex functions). Let CnC\subseteq\mathbb{R}^{n} be convex and let f:Cf:C\to\mathbb{R}.

  • ff is concave if f((1t)x+ty)(1t)f(x)+tf(y)for every x,yC and every t[0,1].f\left((1-t)x+ty\right)\geq(1-t)f(x)+tf(y) \qquad\text{for every }x,y\in C\text{ and every }t\in[0,1] .

  • ff is strictly concave if that inequality is strict whenever xyx\ne y and t(0,1)t\in(0,1).

  • ff is convex if f-f is concave, and strictly convex if f-f is strictly concave.

The right-hand side is the height at (1t)x+ty(1-t)x+ty of the chord joining the two points (x,f(x))(x,f(x)) and (y,f(y))(y,f(y)) on the graph, so a concave function lies on or above each of its chords. This is the global version of bending downward: it compares any two points, not only nearby ones. Strict concavity additionally forbids the graph from containing a line segment. If ana\in\mathbb{R}^{n} and bb\in\mathbb{R}, the affine function f(x)=ax+bf(x)=a\cdot x+b satisfies Definition 2.4 with equality, by the computation (2). Thus it is both concave and convex, and neither strictly.

Figure 2.2. The chord inequality of Definition 2.4. At each point (1-t)x+ty of the segment joining x and y, the graph of a concave function lies on or above the chord joining (x,f(x)) and (y,f(y)). Here f is strictly concave, but establishing that requires checking the inequality for every pair of points x \neq y.

Concavity is a statement about the graph. It also imposes structure on the sets of points at which the function is at least as large as a given level.

Definition 2.5 (Superlevel set). Let CnC\subseteq\mathbb{R}^{n}, let f:Cf:C\to\mathbb{R}, and let α\alpha\in\mathbb{R}. The superlevel set of ff at level α\alpha is Sα(f)={xC:f(x)α}.S_{\alpha}(f)=\{x\in C:f(x)\geq\alpha\} .

Theorem 2.6 (Superlevel sets of a concave function). If CC is convex and f:Cf:C\to\mathbb{R} is concave, then Sα(f)S_{\alpha}(f) is convex for every α\alpha\in\mathbb{R}.

Proof. Let x,ySα(f)x,y\in S_{\alpha}(f) and t[0,1]t\in[0,1], and put z=(1t)x+tyz=(1-t)x+ty. Convexity of CC puts zz in CC by Definition 2.1, and Definition 2.4 gives f(z)(1t)f(x)+tf(y)(1t)α+tα=α,f(z)\geq(1-t)f(x)+tf(y)\geq(1-t)\alpha+t\alpha=\alpha , the second inequality because f(x)αf(x)\geq\alpha and f(y)αf(y)\geq\alpha by Definition 2.5. Hence zSα(f)z\in S_{\alpha}(f). ◻

2.3 Quasiconcavity

The proof of Theorem 2.6 used concavity only to keep f(z)f(z) above α\alpha, never to keep it above the weighted average. Demanding just the conclusion gives a weaker property, and it is the one that many results actually need.

Definition 2.7 (Quasiconcavity). Let CnC\subseteq\mathbb{R}^{n} be convex. A function f:Cf:C\to\mathbb{R} is quasiconcave if Sα(f)S_{\alpha}(f) is convex for every α\alpha\in\mathbb{R}.

In one variable, the convex sets are the intervals, so quasiconcavity requires each superlevel set to be an interval. Figure 2.3 shows a single-peaked function that passes this test and a two-peaked function that fails it.

Figure 2.3. Superlevel sets in one variable. The single-peaked function on the left is quasiconcave: at each level \alpha, the superlevel set S_{\alpha}(f) is an interval. The two-peaked function on the right is not: at the level shown, its superlevel set is a union of two disjoint intervals, which is not convex.

Quasiconcavity can also be stated as an inequality along segments, parallel to Definition 2.4 but with the minimum in place of the weighted average.

Theorem 2.8 (Minimum characterization). Let CnC\subseteq\mathbb{R}^{n} be convex. A function f:Cf:C\to\mathbb{R} is quasiconcave if and only if f((1t)x+ty)min{f(x),f(y)}for every x,yC and every t[0,1].f\left((1-t)x+ty\right)\geq\min\{f(x),f(y)\} \qquad\text{for every }x,y\in C\text{ and every }t\in[0,1] .

Proof. Convex superlevel sets imply the inequality. Let x,yCx,y\in C and t[0,1]t\in[0,1], and put α=min{f(x),f(y)}\alpha=\min\{f(x),f(y)\}. Then x,ySα(f)x,y\in S_{\alpha}(f) by Definition 2.5, and that set is convex by Definition 2.7, so (1t)x+tySα(f)(1-t)x+ty\in S_{\alpha}(f), which is the inequality.

The inequality implies convex superlevel sets. Fix α\alpha and let x,ySα(f)x,y\in S_{\alpha}(f) and t[0,1]t\in[0,1]. Then (1t)x+tyC(1-t)x+ty\in C by Definition 2.1, and f((1t)x+ty)min{f(x),f(y)}α,f\left((1-t)x+ty\right)\geq\min\{f(x),f(y)\}\geq\alpha , so the point lies in Sα(f)S_{\alpha}(f). ◻

Concavity implies quasiconcavity, since a weighted average of f(x)f(x) and f(y)f(y) is at least their minimum, so Definition 2.4 gives the inequality of Theorem 2.8. The converse fails.

Example 2.9 (Quasiconcave but not concave). Let f:f:\mathbb{R}\to\mathbb{R} be given by f(x)=x3f(x)=x^3. Since ff is increasing, each superlevel set is the interval [α1/3,)[\alpha^{1/3},\infty), which is convex, so ff is quasiconcave by Definition 2.7. It is not concave: taking the midpoint of 00 and 22, f(1)=1<4=12f(0)+12f(2),f(1)=1<4=\tfrac12 f(0)+\tfrac12 f(2) , which violates Definition 2.4.

What made Example 2.9 work is that x3x^3 is an increasing relabelling of the values of xx, and quasiconcavity, unlike concavity, survives any such relabelling.

Theorem 2.10 (Increasing transformations). Let CnC\subseteq\mathbb{R}^{n} be convex, let f:Cf:C\to\mathbb{R} be quasiconcave, and let φ:\varphi:\mathbb{R}\to\mathbb{R} be nondecreasing. Then φf\varphi\circ f is quasiconcave.

Proof. Let x,yCx,y\in C and t[0,1]t\in[0,1]. Applying φ\varphi to the inequality of Theorem 2.8 preserves it, because φ\varphi is nondecreasing, so φ(f((1t)x+ty))φ(min{f(x),f(y)})=min{φ(f(x)),φ(f(y))},\varphi\left(f\left((1-t)x+ty\right)\right) \geq\varphi\left(\min\{f(x),f(y)\}\right) =\min\left\{\varphi(f(x)),\varphi(f(y))\right\} , the equality because a nondecreasing φ\varphi sends the smaller of two numbers to the smaller of their images. By Theorem 2.8 again, φf\varphi\circ f is quasiconcave. ◻

3 Concavity criteria, global optimality, and separation

3.1 Restriction to line segments

To decide whether a function of nn variables is concave, we reduce the question to one variable. The reduction rests on three results: concavity of ff is equivalent to concavity of its restriction to every line segment of the domain (Lemma 3.1); such a restriction has second derivative vHf(x+tv)vv^{\top}H_{f}(x+tv)v (Theorem 3.2); and a one-variable function is concave exactly when its second derivative is nonpositive (Lemma 3.3).

Lemma 3.1 (Line-segment restriction). Let UnU\subseteq\mathbb{R}^{n} be convex and let f:Uf:U\to\mathbb{R}. For x,yUx,y\in U let v=yxv=y-x and ϕ(t)=f(x+tv),t[0,1].\phi(t)=f(x+tv), \qquad t\in[0,1] . Then ff is concave if and only if ϕ\phi is concave on [0,1][0,1] for every choice of x,yUx,y\in U, and ff is strictly concave if and only if ϕ\phi is strictly concave for every choice of x,yUx,y\in U with xyx\ne y.

Proof (optional). Concavity of ff implies concavity of every ϕ\phi. Fix x,yUx,y\in U and let s,s[0,1]s,s'\in[0,1] and t[0,1]t\in[0,1]. The point x+((1t)s+ts)vx+\left((1-t)s+ts'\right)v is the convex combination (1t)(x+sv)+t(x+sv)(1-t)(x+sv)+t(x+s'v) of two points of UU, so Definition 2.4 gives ϕ((1t)s+ts)=f((1t)(x+sv)+t(x+sv))(1t)ϕ(s)+tϕ(s).\phi\left((1-t)s+ts'\right) =f\left((1-t)(x+sv)+t(x+s'v)\right) \geq(1-t)\phi(s)+t\phi(s') .

Concavity of every ϕ\phi implies concavity of ff. Given x,yUx,y\in U and t[0,1]t\in[0,1], take s=0s=0 and s=1s'=1 above. Since ϕ(0)=f(x)\phi(0)=f(x) and ϕ(1)=f(y)\phi(1)=f(y), f((1t)x+ty)=ϕ(t)(1t)f(x)+tf(y).f\left((1-t)x+ty\right)=\phi(t)\geq(1-t)f(x)+tf(y) .

For the strict statements, note that xyx\ne y makes v0v\ne0, so distinct values of ss give distinct points x+svx+sv; both displays above then hold with strict inequalities under the corresponding strict hypothesis. ◻

For a function of one variable, the second derivative tells us whether the graph bends upward or downward. For a function of several variables, the input can move in many directions, and the curvature may depend on the direction. We therefore restrict the function to the line x+tvx+tv and study it as a function of the single variable tt. Figure 3.1 shows the construction.

Figure 3.1. Restricting f to a line segment. The segment joining x and y in the n-dimensional domain U\subseteq\mathbb{R}^{n} (left) is parameterized as x+tv with v=y-x; along it, the n-variable function f collapses to the function \phi(t)=f(x+tv) of the single real variable t (right), with \phi(0)=f(x) and \phi(1)=f(y).

Theorem 3.2 (Directional curvature). Let UnU\subseteq\mathbb{R}^{n} be open, let f:Uf:U\to\mathbb{R} be C2C^2, let xUx\in U, and let vnv\in\mathbb{R}^{n}. Put ϕ(t)=f(x+tv)\phi(t)=f(x+tv) for those tt with x+tvUx+tv\in U. Then ϕ(t)=f(x+tv)v,ϕ(t)=vHf(x+tv)v.\phi'(t)=\nabla f(x+tv)\cdot v, \qquad \phi''(t)=v^{\top}H_{f}(x+tv)\,v .

Proof (optional). Define the curve γ:n\gamma:\mathbb{R}\to\mathbb{R}^{n} by γ(t)=x+tv.\gamma(t)=x+tv. Its iith coordinate is the affine function γi(t)=xi+tvi\gamma_i(t)=x_i+tv_i, whose derivative is γi(t)=vi\gamma_i'(t)=v_i. Therefore γ(t)=v\gamma'(t)=v.

Fix any tt such that γ(t)U\gamma(t)\in U. Because UU is open, there is ε>0\varepsilon>0 such that B(γ(t),ε)UB(\gamma(t),\varepsilon)\subseteq U. If v0v\ne0, then γ(s)γ(t)=|st|v<ε\lVert \gamma(s)-\gamma(t) \rVert=\lvert s-t \rvert\lVert v \rVert<\varepsilon whenever |st|<ε/v\lvert s-t \rvert<\varepsilon/\lVert v \rVert. If v=0v=0, then γ(s)=γ(t)\gamma(s)=\gamma(t) for every ss. In either case, fγf\circ\gamma is defined on an open interval containing tt. Since ϕ=fγ\phi=f\circ\gamma, the derivative-along-a-curve formula from Lecture 4 gives ϕ(t)=i=1nfxi(γ(t))γi(t)=i=1nfxi(x+tv)vi=f(x+tv)v.\phi'(t) =\sum_{i=1}^n \frac{\partial f}{\partial x_i}(\gamma(t))\gamma_i'(t) =\sum_{i=1}^n \frac{\partial f}{\partial x_i}(x+tv)v_i =\nabla f(x+tv)\cdot v.

For each ii, define gi:Ug_i:U\to\mathbb{R} by gi(y)=fxi(y).g_i(y)=\frac{\partial f}{\partial x_i}(y). Because ff is C2C^2, each gig_i is C1C^1 and hence differentiable. Applying the same derivative-along-a-curve formula to giγg_i\circ\gamma gives (giγ)(t)=j=1ngixj(γ(t))γj(t)=j=1n(Hf(x+tv))ijvj,\begin{aligned} (g_i\circ\gamma)'(t) &=\sum_{j=1}^n \frac{\partial g_i}{\partial x_j}(\gamma(t))\gamma_j'(t)\\ &=\sum_{j=1}^n \left(H_{f}(x+tv)\right)_{ij}v_j, \end{aligned} where the second equality follows from the definition of the Hessian. For every ss in the open interval above, the formula for the first derivative can be written as ϕ(s)=i=1nvi(giγ)(s).\phi'(s)=\sum_{i=1}^n v_i(g_i\circ\gamma)(s). Since each viv_i is constant, differentiating this equality at s=ts=t gives ϕ(t)=i=1nvi(giγ)(t)=i=1nj=1nvi(Hf(x+tv))ijvj,\phi''(t) =\sum_{i=1}^n v_i(g_i\circ\gamma)'(t) =\sum_{i=1}^n\sum_{j=1}^n v_i\left(H_{f}(x+tv)\right)_{ij}v_j, which equals vHf(x+tv)vv^{\top}H_{f}(x+tv)v by the definition of matrix multiplication. Since tt was arbitrary, both formulas hold for every tt in the domain of ϕ\phi. ◻

Thus vHf(x)vv^{\top}H_{f}(x)v is the second derivative of ff along the line through xx in direction vv: the Hessian measures curvature one direction at a time, just as the gradient measures slope one direction at a time. We use this result below to relate the signs of vHf(x)vv^{\top}H_{f}(x)v across directions vv to concavity, and in Lecture 6 to derive necessary second-order conditions for a local optimum.

Finally, we state the one-variable second-derivative test.

Lemma 3.3 (One-variable second-derivative test). Let II\subseteq\mathbb{R} be an interval, and suppose ϕ\phi is twice continuously differentiable on an open interval containing II. Then ϕ\phi is concave on II if and only if ϕ(t)0\phi''(t)\leq0 for every tIt\in I. If ϕ(t)<0\phi''(t)<0 for every tIt\in I, then ϕ\phi is strictly concave.

We use this result without proof.

The second half of the statement does not reverse: a strictly concave ϕ\phi may have ϕ=0\phi''=0 somewhere, as ϕ(t)=t4\phi(t)=-t^4 does at t=0t=0.

3.2 Tangent and Hessian criteria

The first criterion replaces the chord inequality by a comparison with the tangent plane at one point.

Theorem 3.4 (Tangent characterization). Let UnU\subseteq\mathbb{R}^{n} be open and convex, and let f:Uf:U\to\mathbb{R} be differentiable. Then ff is concave if and only if

f(y)f(x)+f(x)(yx)for every x,yU.f(y)\leq f(x)+\nabla f(x)\cdot (y-x) \qquad\text{for every }x,y\in U .(3)

Proof (optional). Concavity implies (3). Let x,yUx,y\in U and t(0,1)t\in(0,1). By Definition 2.4 applied to xx and yy, f(x+t(yx))(1t)f(x)+tf(y),f\left(x+t(y-x)\right)\geq(1-t)f(x)+tf(y) , and subtracting f(x)f(x) and dividing by t>0t>0 gives f(x+t(yx))f(x)tf(y)f(x).\frac{f\left(x+t(y-x)\right)-f(x)}{t}\geq f(y)-f(x) . As tt decreases to zero the left-hand side tends to ϕ(0)\phi'(0), where ϕ(t)=f(x+t(yx))\phi(t)=f(x+t(y-x)), and the chain rule gives ϕ(0)=f(x)(yx)\phi'(0)=\nabla f(x)\cdot (y-x). The inequality passes to the limit, which is (3).

(3) implies concavity. Let x,yUx,y\in U, let t[0,1]t\in[0,1], and put z=(1t)x+tyz=(1-t)x+ty, which lies in UU because UU is convex. Applying (3) at the point zz to each of xx and yy, f(x)f(z)+f(z)(xz),f(y)f(z)+f(z)(yz).\begin{aligned} f(x)&\leq f(z)+\nabla f(z)\cdot (x-z),\\ f(y)&\leq f(z)+\nabla f(z)\cdot (y-z) . \end{aligned} Multiply the first by 1t1-t and the second by tt and add. The gradient terms combine into f(z)((1t)x+tyz)\nabla f(z)\cdot \left((1-t)x+ty-z\right), which is zero by the definition of zz, leaving (1t)f(x)+tf(y)f(z)(1-t)f(x)+tf(y)\leq f(z). ◻

A differentiable concave function thus lies on or below each of its tangent planes. Note that the right-hand side of (3) uses the value and gradient of ff at the point xx only, yet it bounds ff everywhere. Figure 3.2 shows the inequality in one variable.

Figure 3.2. The tangent characterization of Theorem 3.4. The graph of a differentiable concave function lies on or below the tangent line at x, so the value f(x)+\nabla f(x)\cdot (y-x) computed from data at x alone bounds f(y) at every other point y.

The second criterion uses the Hessian. Negative semidefiniteness means that every line restriction bends downward or remains flat.

Theorem 3.5 (Hessian characterization). Let UnU\subseteq\mathbb{R}^{n} be open and convex, and let f:Uf:U\to\mathbb{R} be C2C^2.

  1. ff is concave if and only if Hf(x)H_{f}(x) is negative semidefinite for every xUx\in U.

  2. If Hf(x)H_{f}(x) is negative definite for every xUx\in U, then ff is strictly concave.

The corresponding statements for convexity reverse every sign.

Proof (optional). Negative semidefinite implies concave. Fix x,yUx,y\in U, put v=yxv=y-x, and let ϕ(t)=f(x+tv)\phi(t)=f(x+tv) as in Lemma 3.1. By openness of UU, this restriction is C2C^2 on an open interval containing [0,1][0,1]. By Theorem 3.2, ϕ(t)=vHf(x+tv)v\phi''(t)=v^{\top}H_{f}(x+tv)v, which is at most 00 by Definition 1.7. So ϕ\phi is concave by Lemma 3.3, and since xx and yy were arbitrary, ff is concave by Lemma 3.1.

Concave implies negative semidefinite. Fix xUx\in U and vnv\in\mathbb{R}^{n}. Since UU is open, x+tvUx+tv\in U for every tt in some open interval containing 00. The restriction ϕ(t)=f(x+tv)\phi(t)=f(x+tv) is concave by Lemma 3.1, so Lemma 3.3 gives ϕ(0)0\phi''(0)\leq0. By Theorem 3.2, ϕ(0)=vHf(x)v0.\phi''(0)=v^{\top}H_{f}(x)v\leq0. Since vv was arbitrary, Hf(x)H_{f}(x) is negative semidefinite.

Negative definite implies strictly concave. Fix distinct x,yUx,y\in U, put v=yxv=y-x, and let ϕ(t)=f(x+tv)\phi(t)=f(x+tv). The direction vv is nonzero, so ϕ(t)<0\phi''(t)<0 throughout by Theorem 3.2 and Definition 1.7. Hence Lemma 3.3 makes ϕ\phi strictly concave. Since xx and yy were arbitrary, Lemma 3.1 makes ff strictly concave. ◻

Part (2) does not reverse, for the same reason Lemma 3.3 does not: f(x)=x4f(x)=-x^4 is strictly concave on \mathbb{R} while f(0)=0f''(0)=0. Negative definiteness is sufficient for strict concavity, never necessary.

3.3 Global optimality and uniqueness

For concave functions, a first-order condition at a single point is sufficient for a global maximum.

Corollary 3.6 (First-order sufficiency). Let UnU\subseteq\mathbb{R}^{n} be open and convex, let CUC\subseteq U be convex, and let f:Uf:U\to\mathbb{R} be differentiable and concave. If x*Cx^*\in C satisfies

f(x*)(xx*)0for every xC,\nabla f(x^*)\cdot (x-x^*)\leq0 \qquad\text{for every }x\in C,(4)

then x*x^* maximizes ff on CC. If ff is strictly concave, then x*x^* is the only maximizer.

Proof. For xCx\in C, Theorem 3.4 at the point x*x^* and then (4) give f(x)f(x*)+f(x*)(xx*)f(x*).f(x)\leq f(x^*)+\nabla f(x^*)\cdot (x-x^*)\leq f(x^*) .

Uniqueness. Suppose ff is strictly concave and xyx\ne y both maximize ff on CC, with common value mm. Their midpoint lies in CC by Definition 2.1, and Definition 2.4 gives f(12x+12y)>12m+12m=mf\left(\tfrac12x+\tfrac12y\right)>\tfrac12 m+\tfrac12 m=m, contradicting that mm is the maximum. ◻

In particular, any x*Cx^*\in C with f(x*)=0\nabla f(x^*)=0 satisfies (4). It is therefore a global maximizer of a concave function, and under strict concavity it is the only one. The more general inequality (4) also allows x*x^* to lie on the boundary of CC, where the gradient need not vanish.

Example 3.7 (Maximizing a strictly concave quadratic).

Fix b2b\in\mathbb{R}^2 and γ\gamma\in\mathbb{R} with |γ|<2\lvert \gamma \rvert<2, and define q:2q:\mathbb{R}^2\to\mathbb{R} by q(x)=bx(x12+γx1x2+x22).q(x)=b\cdot x-\left(x_1^2+\gamma x_1x_2+x_2^2\right). Its Hessian has leading principal minors 2-2 and 4γ2>04-\gamma^2>0, so it is negative definite by Theorem 1.10. Hence qq is strictly concave on 2\mathbb{R}^2 by Theorem 3.5. Setting q(x)=0\nabla q(x)=0 gives (2γγ2)x=b,sox*=14γ2(2γγ2)b.\begin{pmatrix}2&\gamma\\\gamma&2\end{pmatrix}x=b, \qquad\text{so}\qquad x^* =\frac{1}{4-\gamma^2} \begin{pmatrix}2&-\gamma\\-\gamma&2\end{pmatrix}b . By Corollary 3.6, x*x^* is the unique global maximizer of qq over 2\mathbb{R}^2. The first-order equations produce the candidate; strict concavity is what makes it the answer.

3.4 Separation

We end with a geometric consequence of convexity. Separating hyperplanes place two convex sets in opposite halfspaces.

Definition 3.8 (Hyperplane). Let an\{0}a\in\mathbb{R}^{n}\setminus\{0\} and cc\in\mathbb{R}. The hyperplane with normal aa at level cc is H(a,c)={xn:ax=c},H(a,c)=\{x\in\mathbb{R}^{n}:a\cdot x=c\} , and its two closed halfspaces are {x:axc}\{x:a\cdot x\leq c\} and {x:axc}\{x:a\cdot x\geq c\}.

Theorem 3.9 (Separating hyperplane). Let A,BnA,B\subseteq\mathbb{R}^{n} be nonempty, disjoint, and convex. There exist a0a\ne0 and cc\in\mathbb{R} such that axcayfor every xA and every yB.a\cdot x\leq c\leq a\cdot y \qquad \text{for every }x\in A\text{ and every }y\in B .

We use this result without proof.

The two sets lie in opposite closed halfspaces of H(a,c)H(a,c). The inequalities are weak: the common level cc may be approached, or even attained, by points of the two sets. Figure 3.3 shows the configuration in 2\mathbb{R}^2.

Figure 3.3. A hyperplane separating two disjoint convex sets. Every point of A satisfies a\cdot x\leq c and every point of B satisfies a\cdot y\geq c.

Example 3.10 (No gap between the sets). Let A={x2:x2<0}A=\{x\in\mathbb{R}^2:x_2<0\} and B={x2:x20}B=\{x\in\mathbb{R}^2:x_2\geq0\}, which are nonempty, disjoint, and convex. Taking a=e2a=e_2 and c=0c=0 gives ax=x2<0y2=ay(xA,yB).a\cdot x=x_2<0\leq y_2=a\cdot y \qquad (x\in A,\ y\in B). Thus the sets are separated by the level 00, but there is no positive gap between their separating levels: points of AA have second coordinate arbitrarily close to 00.

A positive gap therefore requires hypotheses beyond disjointness.