Linear Algebra
17.37 min read

Constrained Optimization — The Setup

We want to minimize f(x)f(\mathbf{x}) subject to the constraint g(x)=kg(\mathbf{x}) = k for some function gg. The feasible set is the isosurface S={x:g(x)=k}S = \{\mathbf{x} : g(\mathbf{x}) = k\} — a hypersurface in Rn\mathbb{R}^n.

We cannot just run unconstrained gradient descent — it might step off the surface. We need to understand which directions of movement are feasible (stay on SS) and which make ff decrease.

Feasible directions at x0\mathbf{x}_0 are exactly the tangent space Tx0S=Null(Dg(x0))T_{\mathbf{x}_0} S = \text{Null}(Dg(\mathbf{x}_0)). A direction u\mathbf{u} decreases ff if Df(x0)u<0Df(\mathbf{x}_0)\mathbf{u} < 0.

So if there exists a uTx0S\mathbf{u} \in T_{\mathbf{x}_0} S with Df(x0)u<0Df(\mathbf{x}_0)\mathbf{u} < 0, we can move along u\mathbf{u} to decrease ff while staying on SSx0\mathbf{x}_0 is not optimal. For x0\mathbf{x}_0 to be a constrained minimum, no such direction can exist: Df(x0)u=0Df(\mathbf{x}_0)\mathbf{u} = 0 for all uTx0S\mathbf{u} \in T_{\mathbf{x}_0} S.

Formal View

Definition 17.3 — Constrained Optimization
The constrained optimization problem:
minxf(x)s.t.g(x)=k\min_{\mathbf{x}} f(\mathbf{x}) \quad \text{s.t.} \quad g(\mathbf{x}) = k
with f,gC1f, g \in C^1. The feasible set is S={x:g(x)=k}S = \{\mathbf{x} : g(\mathbf{x}) = k\}. We assume Dg(x)0Dg(\mathbf{x}) \neq \mathbf{0} on SS (so SS is a well-behaved hypersurface).
Lemma 17.1 — Necessary Condition for a Constrained Minimum
If x0S\mathbf{x}_0 \in S is a constrained minimum of ff on SS, then:
Null(Dg(x0))Null(Df(x0))\text{Null}(Dg(\mathbf{x}_0)) \subseteq \text{Null}(Df(\mathbf{x}_0))
Every direction tangent to SS at x0\mathbf{x}_0 must be an isovector of ff.

Why This Matters

Equality-constrained optimization is everywhere: engineering design with fixed resources, physics with conservation laws, economics with budget constraints.

  • Budget-constrained utility maximization in economics
  • Robot arm reaching target position (kinematic constraint)
  • Circuit design: minimize power subject to performance constraints
  • Machine learning: training with constraints (e.g., orthogonality)

Quiz

Question 1

For constrained optimization minf\min f s.t. g(x)=kg(\mathbf{x}) = k, the feasible directions at x0\mathbf{x}_0 are:

Question 2

At a constrained minimum x0\mathbf{x}_0, what must be true about all tangent directions uTx0S\mathbf{u} \in T_{\mathbf{x}_0} S?

Question 3

A constrained minimum of ff on SS must also be an unconstrained critical point of ff.

Question 4

The necessary condition for a constrained minimum is Null(Dg)Null(Df)\text{Null}(Dg) \subseteq \text{Null}(Df). This means:

Common Mistakes

  • Confusing the feasible set (the surface SS) with the constraint function gg.
  • Forgetting that unconstrained critical points of ff need not be constrained critical points, and vice versa.
  • Applying unconstrained gradient descent on the full space when the feasible set is a lower-dimensional surface.