Math Camp
Lecture 7: Constrained Optimization
1 Overview: constraints, tangent directions, and multipliers
Lecture 6 solved an optimization problem in three separate steps: establish that a solution exists, generate candidates from first-order conditions, and certify a candidate as global, by concavity or by comparing values. Its first-order condition at a boundary point was one-sided: at a local maximizer ,
where is a feasible direction if the segment stays in the feasible set for all small .
In economic problems the feasible set is typically described by equations and inequalities. For example, in a consumer problem, the budget constraint is a linear inequality. In a planner’s problem, the requirement that a resource be split between two uses is a linear equality. In a producer’s problem, the technology constraint , linking output to inputs , is a nonlinear equality whenever the production function is nonlinear.
Depending on the shape of the feasible set, the condition (FOC) may be vacuous, i.e., it may rule out nothing. Suppose first that there is just one equality constraint . If is affine, as in the planner’s problem, the feasible set is a line: segments along the line stay in the set, so nonzero feasible directions exist and (FOC) is not vacuous (Figure 1.1, left). If instead the feasible set is curved, such as the circle , it contains no segments: every straight move away from a point of the circle leaves the circle. The only feasible direction is then , so (FOC) holds at every point of the circle and rules out nothing (Figure 1.1, right).
For a curved feasible set, directions of movement come from curves rather than segments. A feasible movement through is a curve that stays in the feasible set, with : think of as the position of a moving point at time . Its velocity is the vector of the instantaneous rates of change of its coordinates — the direction in which the moving point passes through . The path bends with the set, but the velocity is an ordinary vector: on the circle it is tangent to the circle, and on the line the curve can be the line itself, whose velocity is one of the old feasible directions.
At points satisfying a regularity condition (LICQ), these velocities — the tangent directions — are exactly the vectors orthogonal to every constraint gradient , and the first-order condition becomes for some coefficients , which are the Lagrange multipliers. The function is the Lagrangian; its critical points are precisely the pairs that satisfy this equation together with .
Section 3 then adds inequality constraints, written . At a candidate , a constraint is active if and slack if ; a slack constraint does not restrict small movements, so it drops out of the first-order condition. Stationarity, feasibility, nonnegative multipliers on the inequalities, and the rule that each multiplier or its constraint is zero (complementary slackness) together form the Karush–Kuhn–Tucker (KKT) conditions.
Section 4 then provides the global certification, specialized to the cases of Section 2 and Section 3. As in Lecture 6, existence must be shown separately, using Weierstrass, coercivity, or a direct argument.
2 Equality constraints and the Lagrangian
2.1 Tangent directions and constraint normals
Let be open, let and be , and consider Here, the feasible set is described by a system of equations. When one of these equations is nonlinear, the feasible set may be curved. We thus work with feasible curves and their velocities.
We call a feasible curve through if is differentiable, , and for all near . Its velocity at is . Such a velocity is called a tangent direction to the constraint set at .
Lemma 2.1 (Tangent directions lie in the null space). Let be a feasible curve through with velocity . Then
Proof. for all near , and differentiating using the chain rule from Lecture 4 gives ◻
Every tangent direction thus lies in the null space from Lecture 3. Row by row, the display says In other words, each constraint gradient is orthogonal (perpendicular) to every tangent direction. A vector perpendicular to the tangent directions is called a normal to the constraint set. Thus the constraint gradients are normals to the constraint set.
The converse is generally not true. That is, if for some vector , there may be no feasible curve through with velocity . For example, if , then the feasible set is the single point , so the only feasible velocity at is . Yet, the null space of is all of , so any vector satisfies .
The following condition ensures that all vectors in the null space of are velocities of feasible curves through .
Definition 2.2 (LICQ for equality constraints). The linear independence constraint qualification holds at a feasible point if the constraint gradients are linearly independent; equivalently, if .
Remark 2.3 (How many constraints?). The number of equations need not equal the number of independent restrictions they place near ; that number is . When the constraints have a locally equivalent description by independent equations, the feasible set is locally a surface of dimension . Thus leaves feasible movement, while makes the feasible point locally isolated. LICQ says , so it requires : more than vectors in cannot be linearly independent. When , no description with that many equations satisfies LICQ; when possible, re-describe the same feasible set by independent equations, and otherwise analyze it directly.
Lemma 2.4 (Tangent directions under LICQ). Let be and let LICQ hold at the feasible point . If , then is the velocity of a differentiable feasible curve through .
Intuitively, if a vector is orthogonal to the constraint normals, then it is tangent to the constraint set, and a curve can be drawn along the constraint set in the direction of . LICQ thus ensures that the constraints form a smooth surface locally around , so that every vector of the null space is realized as the velocity of a feasible curve.
Combining Lemma 2.1 and Lemma 2.4, we conclude that under LICQ, the set of feasible velocities at is exactly .
2.2 First-order conditions and the Lagrangian
Now suppose is a local maximizer at which LICQ holds. For any feasible curve through , the restriction has a local maximum at the interior point , so its derivative at is zero. Chain rule and Lemma 2.4 thus yield This is the equality-constraint analogue of (FOC). It holds with equality because both directions along the constraint set are available: if is a tangent direction, then so is , the velocity of the reversed curve . Simply put, the gradient of the objective must be orthogonal to every tangent direction , or else moving along a feasible curve in one of the directions and would increase . Under LICQ, the tangent directions are exactly the vectors orthogonal to the constraint gradients.1 Since is orthogonal to every tangent direction, it must be a linear combination of the constraint gradients; that is, there are coefficients such that These coefficients are called the Lagrange multipliers. The first-order condition is summarized by the following theorem.
Theorem 2.5 (Lagrange multiplier theorem). Let and be , let be a local extremum (maximizer or minimizer) of subject to , and let LICQ hold at . Then there is a unique vector such that
Proof (optional, using Lecture 8’s implicit function theorem). Stack the objective gradient on top of the constraint gradients: Suppose, for contradiction, that . Then some columns of form an invertible matrix. Hold the remaining coordinates fixed at their -values and apply the implicit function theorem to the selected coordinates in the system It follows that every right-hand side sufficiently close to has a solution near . In particular, take and . If is a local maximizer, choose ; if it is a local minimizer, choose . Either choice produces a nearby feasible point that contradicts the optimality of . Therefore, .
By LICQ, the constraint gradients are linearly independent. Since adding does not increase their rank, must be a linear combination of them. Thus there is a vector such that Finally, if both and satisfy this equation, then . LICQ makes the constraint gradients linearly independent, so . ◻
As in Lecture 6, the theorem gives only a necessary condition for a local extremum. Note that the Lagrange multipliers are not restricted in sign, i.e., they can be positive or negative. For a fixed objective, constraint description, and candidate , LICQ makes the multiplier vector unique. Rescaling or rewriting a constraint (e.g., multiplying both sides by ) changes its multiplier. Finally, the theorem does not guarantee that an optimizer exists; existence must be established separately.
LICQ cannot be dropped from Theorem 2.5, and all points in the feasible set that do not satisfy LICQ must be treated separately.
Example 2.6 (A singular description loses the multiplier). Consider subject to . We have and . If we were to apply the Lagrange multiplier theorem, we would get . However, the feasible set is the single point , meaning that is the global maximizer. Clearly, at there does not exist a that satisfies the multiplier condition .
The Lagrange multiplier condition and the feasibility requirement form a system of equations in the unknowns . These equations can be written as the critical-point conditions of a single function of variables, the Lagrangian.
Definition 2.7 (Lagrangian). The Lagrangian of the problem subject to is the function of and given by
Its partial gradients are: Consequently, the critical points of are exactly the pairs that satisfy the first-order condition and the feasibility requirement. Note also that the Lagrangian is not being maximized: a constrained maximizer is a critical point of , and can thus be a maximum, a minimum, or a saddle point of the Lagrangian.
Example 2.8 (Solving directly and with a Lagrangian). Consider subject to .
Direct solution. The constraint gives , so the problem reduces to The unique global maximizer is , and the constraint then gives . Thus .
Lagrangian solution. Write the constraint as . Since , LICQ holds. The Lagrangian is so every constrained optimum must be among the solutions to The first two equations give . Substituting into the third gives and hence , the same point found above. The direct solution established that this point is the global maximizer; the Lagrangian equations by themselves identified it only as a candidate.
In particular, we did not maximize the Lagrangian. As a function of with fixed, whose characteristic equation gives eigenvalues and . The Hessian is indefinite, so by the second-order classification of Lecture 6 the point is a saddle point of . On the feasible set, makes , so does maximize the Lagrangian among feasible points. The Lagrangian collects the first-order conditions of the constrained problem; it does not turn the problem into an unconstrained maximization of .
3 Inequalities and the KKT conditions
3.1 Standard form and active sets
We fix one convention for inequality constraints. Every inequality is written as so becomes .
The optimization problem is where and . Its Lagrangian is The requirement is forced by the convention , and the one-dimensional calculation after Theorem 3.2 shows why.
For inequality constraints, we will use the following classification.
Definition 3.1 (Active and slack constraints, mixed LICQ). At a feasible point , the active set is and a constraint with is slack. LICQ holds at for the mixed problem if the vectors are linearly independent.
A slack constraint stays satisfied throughout a neighborhood of (by continuity of ), so it places no restriction on local movement and its gradient does not enter the constraint qualification.
3.2 The KKT theorem
Theorem 3.2 (Karush–Kuhn–Tucker). Let , , and be , let be a local maximizer subject to and , and let LICQ hold at . Then there are and such that
We use this result without proof.
Complementary slackness forces whenever , and permits only where : slack constraints have zero multipliers. The converse implication fails: an active constraint can also have a zero multiplier (as in Example 3.3 below).
The sign restriction can be read off a one-dimensional picture. Suppose , the constraint is active, and , so for every small and is a feasible direction. If is a local maximizer, the objective cannot increase into the feasible side, which is (FOC) with : . Stationarity reads , so With the constraint written as instead, the same calculation would produce the opposite sign, so the convention must be fixed once and recorded.
Like every first-order condition in this course, the KKT conditions generate candidates but do not certify them. On , the point with satisfies every condition of Theorem 3.2, yet is not even a local maximizer, since for every . Existence and certification remain separate steps, and here existence in fact fails.
3.3 Active-set reasoning in a capacity problem
With inequalities, the practical method is to reason/guess about which constraints bind. Each guess of an active set of constraints turns the KKT conditions into equalities that can be solved. The remaining KKT conditions — feasibility and multiplier signs — then confirm that the guess is a solution, or reject it.
Example 3.3 (KKT by guess-and-verify). Let and , and consider The feasible set is nonempty and compact and the objective is continuous, so a maximizer exists by Weierstrass. With and , the Lagrangian is and the KKT conditions are There are four cases to check.
. Then stationarity gives . To satisfy the second constraint, we must have .
, . Then stationarity gives , and is satisfied if and only if .
, . Then stationarity gives , which violates the sign restriction; this guess is rejected for every .
. This case is impossible because we cannot have and for .
The solution is thus Note that when , the solution is and the multiplier is , meaning that the capacity constraint is active and the multiplier is zero.
To certify that is a global maximizer, observe that the objective can be rewritten as follows: which shows that the objective is maximized by the point that minimizes , i.e., the point closest to . Since the point of closest to is , it is indeed a global maximizer.
4 Global certification
4.1 Concave programs
In Lecture 6, if the objective function is concave on a convex set, then the first-order condition is sufficient for a global maximum. The same logic extends to the following class of constrained problems.
Definition 4.1 (Concave program). Let be convex. The problem is a concave program if and every are concave on and is affine.
The sufficiency proof again relies on the tangent inequality from Lecture 5, .
Theorem 4.2 (Sufficiency in a concave program). Consider a concave program on an open convex set , and suppose that and every are differentiable. If a feasible and multipliers satisfy the KKT conditions of Theorem 3.2, then is a global maximizer.
Proof (optional). Let be feasible and put . Concavity of gives and stationarity rewrites the right-hand side as Because is affine and both points are feasible, , so the term vanishes. For each , concavity of gives , and since , where the final step uses complementary slackness, , and then with . Chaining the displays gives . ◻
Recall from Lecture 6 that the set of maximizers of a strictly concave function on a convex set contains at most one point (see Theorem 3.1, part 3 in Lecture 6). The constraints of a concave program define a convex feasible set (possibly empty): it is the intersection of superlevel sets of concave functions and an affine equality set, each convex (see Lecture 5). Thus, if is strictly concave, the program has at most one maximizer.
The following condition requires the set of strictly feasible points (points that satisfy the equality constraints and satisfy every inequality strictly) to be nonempty. In a concave program, it makes the KKT conditions necessary; they are already sufficient by Theorem 4.2.
Definition 4.3 (Slater’s condition). A concave program with affine equalities satisfies Slater’s condition if there is with
Theorem 4.4 (Necessity under Slater’s condition). Consider a concave program on an open convex set , and suppose that and every are differentiable. If Slater’s condition holds, then every global maximizer satisfies the KKT conditions with some multipliers .
Slater and LICQ are both constraint qualifications, but they are different: LICQ is local and point-specific, while Slater is global and specific to concave programs. However, both are sufficient to guarantee the existence of Lagrange multipliers.
Here is another example of what goes wrong when a constraint qualification fails.
Example 4.5 (A concave program with no multipliers). Consider This is a concave program: the objective and are affine, and is concave. Feasibility requires , so the feasible set is and is the global maximizer. Slater’s condition fails because requires , whereas requires .
At , stationarity would require which is impossible for any multipliers because the second component is always . Thus the global maximizer has no KKT multipliers. Yet, the global maximizer exists and is unique — it is the only feasible point .
4.2 Second-order conditions on the tangent space
For equality-constrained problems there is also a second-order local test. The relevant matrix is the Hessian of the Lagrangian, not of the objective: curvature only matters along the tangent directions, and along those directions both the objective and the constraints curve. The multiplier terms in account for the curvature of the constraints.
Theorem 4.6 (Second-order conditions on the tangent space). Let and be , let be feasible with LICQ, and let satisfy the stationarity condition from the Lagrange multiplier Theorem 2.5: Write so is the Hessian of at .
If is a local constrained maximizer, then for every .
If for every nonzero , then is a strict local constrained maximizer.
Example 4.7 (Classifying two candidates on a circle). Consider subject to .
Candidates. Since at every point of the circle, LICQ holds at every feasible point. The stationarity system of is with the two solutions and .
Classification. The objective is linear, so and the curvature comes entirely from the constraint: which is at the first candidate and at the second. Both tangent spaces are . On , the first candidate has for , a strict local maximum, and the second has , a strict local minimum. The Hessian of the objective alone is zero at both points, so it cannot distinguish them; the classification comes from the constraint curvature term .
Certification. The circle is compact, so Weierstrass gives a global maximizer and a global minimizer, and by Theorem 2.5 both are among the two candidates. Comparing values, and , so the local classification is also the global one.
There is also a second-order local test for inequality constraints, but it goes beyond the scope of this course due to the fact that the relevant set of directions is a cone rather than a subspace.