Intuition The one core idea
You want the lowest point of a landscape, but you're locked inside a fenced yard. The KKT conditions are the exact rulebook for "the ball has stopped" — the downhill pull is either cancelled by flat ground, or blocked by the fences you're leaning on. Everything below is the vocabulary you need before that sentence makes full sense.
This page builds every symbol used in the parent KKT note from absolute zero. Read it top to bottom: each item uses only the ones above it.
Definition Standing assumption: everything is smooth (
C 1 )
Throughout, we assume f , every fence g i , and every wire h j are continuously differentiable (C 1 ): they have no jumps, kinks, or corners, and their slopes vary smoothly. Why this matters: the whole KKT story is built from the arrows ∇ f , ∇ g i , ∇ h j (§3). Those arrows only exist if the functions are differentiable. At a sharp kink there is no single well-defined slope, so no gradient — and the arguments below would collapse. Keep this in your back pocket: no smoothness, no gradients, no KKT.
Definition Objective function
f
f is a machine: feed it a point, it spits out one number — the cost . We write f ( x ) = "the cost at point x ". Minimizing means finding the input that makes that number as small as possible.
Picture a landscape. The horizontal floor is where your input lives; the height above each spot is f . Low valleys = cheap; high peaks = expensive.
Worked example Reading figure s01
The blue rings are contours — each ring links all points of equal cost, like height lines on a hiking map. Rings packed close = steep; rings far apart = gentle. The yellow dot at the centre is the valley floor , the single lowest cost. As you walk outward across rings, f climbs. This one picture is the definition of "minimum": the spot no ring encircles from below.
Why the topic needs it: the entire game is "find the lowest reachable height." Without a cost function there is nothing to minimize.
Definition The optimal point
x ∗ (arg min)
x ∗ (read "x -star") is our name for the winning input — the point where f attains its lowest allowed value. We write x ∗ = arg min f , "the argument (input) that achieves the minimum." Careful: min f is the smallest cost (a number, the height of the valley floor); x ∗ is the location that achieves it (the coordinates on the floor). In figure s01 the height of the yellow dot is min f ; the position of the yellow dot is x ∗ . Every condition later in this page is a statement about what must be true at x ∗ .
x ∈ R n
x is a point — a list of n numbers, the coordinates of where you stand. R means "any real number"; R n means "a list of n of them." The little symbol ∈ reads "belongs to / is an element of."
n = 1 : x is a single slider on a line.
n = 2 : x = ( x , y ) is a dot on a flat map — the floor of the landscape above (the same floor figure s01 draws its contours on).
n = 3 : a point in a room. Beyond that we can't draw it, but the algebra is identical.
Why the topic needs it: the ball can be anywhere in this space. Constraints will carve out the part where it's allowed to be, and the winner x ∗ (defined above) is one specific such point.
min x ∈ R n f ( x )
Break it into words: "min over all points x in R n , of f ( x ) " = "walk everywhere allowed and report the smallest cost you found." The little x under min just names what we're free to choose .
Now we forbid part of the yard.
Definition Inequality constraint
g i ( x ) ≤ 0 — a fence
g i is another cost-like machine. The rule g i ( x ) ≤ 0 says "only stand where this machine reads zero or negative." The set of allowed points is bordered by a fence : the curve where g i ( x ) = 0 .
Definition Equality constraint
h j ( x ) = 0 — a wire
h j ( x ) = 0 forces you onto a thin curve — a wire you must slide along, no leaving it.
Definition The subscripts
i and j
There can be many fences and many wires. i = 1 … m counts the fences (m of them); j = 1 … p counts the wires (p of them). A subscript is just a name tag: g 3 is "the third fence."
Worked example Reading figure s02
The red line is a fence's border, where g = 0 ; the pink shaded band is the allowed side (g ≤ 0 , here x + y ≥ 1 ). The yellow line is a wire, where h = 0 — you must stand exactly on it. The green dot sits on the yellow wire and inside the pink allowed band, so it satisfies both at once: that is what "feasible" looks like. Notice the sign story: on the fence border g = 0 ; step into the pink and g < 0 (allowed); step across the red into the unshaded region and g > 0 (forbidden).
Definition Feasible point
A point is feasible if it obeys every fence and every wire at once. Feasible = "legally allowed to stand here." The optimum x ∗ must be feasible.
Why the ≤ 0 convention? Any inequality can be pushed into this shape: g ( x ) ≥ 0 becomes − g ( x ) ≤ 0 ; "x + y ≥ 1 " becomes "1 − x − y ≤ 0 ." One convention → one clean rulebook.
≤ and ≥ are interchangeable, sign doesn't matter."
Why it feels right: they both just carve the yard.
The fix: the sign of the multiplier (§6) is tied to the ≤ 0 convention. Convert first , then apply KKT, or every sign flips.
This is the star of KKT, so we build it carefully. (Recall the standing C 1 assumption above — that is exactly what lets us write ∇ f at all.)
Intuition Why we need a new tool here
"Minimum" means "you can't decrease f by any small step." To check that, we need to know which direction decreases f fastest , and by how much. That direction is exactly what the gradient measures — no other single tool answers "which way is downhill and how steep?"
Definition Partial derivative
∂ x k ∂ f
Freeze every coordinate except the k -th, wiggle only x k , and ask "how fast does f change?" That rate is the partial derivative. The curly ∂ (not d ) is a reminder: "other variables held still." (This is well-defined precisely because f is smooth.)
∇ f ( x )
Stack all the partials into one arrow:
∇ f ( x ) = ( ∂ x 1 ∂ f , ∂ x 2 ∂ f , … , ∂ x n ∂ f ) .
The symbol ∇ ("nabla") = "gradient of." This arrow points in the direction of steepest increase of f ; its length says how steep.
Worked example Reading figure s03
Same blue contour rings as before. At the white dot the green arrow is ∇ f : it points straight across the rings toward higher cost — the steepest way up . The red arrow is − ∇ f , the exact opposite: the steepest way down , the direction a released ball rolls. Two things to notice: (1) both arrows are perpendicular to the contour ring they start on — uphill is always "straight across" the height lines; (2) at the valley floor of figure s01 the gradient still exists — it is just the zero vector ∇ f = 0 (an arrow of zero length, so it points nowhere), which is exactly why the ground is flat and the ball stops.
∇ f points uphill → so − ∇ f points downhill (steepest descent — the direction a rolling ball wants to go, and the engine of Gradient Descent and Projected Gradient ).
Where the ground is flat , every partial is zero, so the gradient is the zero vector ∇ f = 0 (it still exists — it just has no length). That's the unconstrained minimum test.
∇ g i is the same arrow built from a fence: it points out of the allowed region (toward larger g i , i.e. toward g i > 0 , the forbidden side).
Why the topic needs it: KKT is entirely a statement about arrows — where − ∇ f can point once the fences box it in.
a ⋅ b
Give two arrows a = ( a 1 , … , a n ) and b = ( b 1 , … , b n ) the same number of coordinates. Their dot product is a single number, built by multiplying matching coordinates and adding:
a ⋅ b = ∑ k = 1 n a k b k = a 1 b 1 + a 2 b 2 + ⋯ + a n b n .
The ∑ k = 1 n (capital sigma) just means "add this up for k = 1 , 2 , … , n ." The result is positive if the arrows roughly agree in direction, negative if they oppose, and zero if they meet at a right angle.
Definition Perpendicular ⟂
Two arrows are perpendicular (⟂) exactly when their dot product is 0 : a ⋅ b = 0 . Quick check: ( 1 , 0 ) ⋅ ( 0 , 1 ) = 1 ⋅ 0 + 0 ⋅ 1 = 0 ✓ — the two axes really are at a right angle.
Intuition Why "flat along a wire" means perpendicular
Along a wire h = 0 , the allowed moves are the directions tangent to the wire. If ∇ f had any piece pointing along the wire, you'd slide that way and lower f . So at a wire-constrained minimum, ∇ f must be perpendicular to the wire — i.e. parallel to the wire's own gradient ∇ h . This is the seed of Lagrange Multipliers .
Before we can talk about which fence-arrows matter, we must know which fences you are actually touching at a point.
Definition Active vs inactive fence
At a point x ∗ (the optimum, defined in §0):
g i ( x ∗ ) < 0 → strictly inside the allowed region → inactive (you're not touching that fence — it plays no role locally).
g i ( x ∗ ) = 0 → on the border → active (leaning on it — it can push back).
Only active fences can push, so only their gradients ∇ g i enter the picture below.
Definition Linear combination
A linear combination of arrows v 1 , … , v k is any sum c 1 v 1 + c 2 v 2 + … with number weights c i . It's "mix these arrows in some proportion."
Definition Cone (of active constraint gradients)
Take the gradients ∇ g i of the active fences only (the ones just defined). If we mix them with non-negative weights (c i ≥ 0 ), the reachable set of arrows is a wedge called a cone . Picture the active fence-normal arrows fanning out; the cone is everything you can build by adding them with positive amounts.
Worked example Reading figure s04
The two red arrows are the outward gradients ∇ g 1 , ∇ g 2 of two active fences you're leaning on at the optimum x ∗ (white dot). The yellow wedge is their cone: every arrow you can make as c 1 ∇ g 1 + c 2 ∇ g 2 with c 1 , c 2 ≥ 0 . The green arrow is − ∇ f (downhill), and it lands inside the yellow wedge — that is the picture of the ball being trapped: the only downhill direction is a positive mix of "into the fences," which the fences forbid.
Intuition Geometric soul, restated with the vocabulary now in hand
At the KKT optimum x ∗ , − ∇ f (downhill) sits inside the cone of the active fence-gradients (the cone just defined above, drawn in figure s04). Every escape direction that lowers f would poke through a fence. The ball is trapped.
Why non-negative weights? A fence can only push , never pull. Push = a ≥ 0 amount of its outward arrow. That single restriction is what makes inequality constraints different from wires — and it becomes the rule λ i ≥ 0 .
Definition Lagrange multipliers
μ j (wires) and KKT multipliers λ i (fences)
Each constraint gets a number — how hard it "pushes back" at the optimum.
μ j belongs to a wire h j . A wire can push either way (you can be shoved from both sides of a wire), so μ j is free in sign — positive, negative, or zero.
λ i belongs to a fence g i . A fence pushes only one way (outward), so λ i ≥ 0 . Recall from §5 that only active fences push, so an inactive fence has λ i = 0 .
Common mistake "All multipliers must be
≥ 0 ."
Why it feels right: you memorized λ i ≥ 0 and spread it to everything.
The fix: only fence multipliers λ i are non-negative. Wire multipliers μ j are unrestricted, exactly like ordinary Lagrange multipliers.
Definition Complementary slackness
λ i g i ( x ∗ ) = 0
The product of "how hard fence i pushes" (λ i ) and "the signed slack of fence i " (g i ( x ∗ ) ) is always zero. Here g i ( x ∗ ) is a signed constraint value , not a distance: g i = 0 means "exactly on the border," and g i < 0 means "safely on the allowed side, with room to spare" (slack). In words: a fence only pushes when your slack is used up (you're touching it). Either g i = 0 (active, touching) or λ i = 0 (inactive, no push) — never both nonzero.
g i ( x ∗ ) < 0 measures how far inside I am."
Why it feels right: more negative feels like "deeper in."
The fix: g i is a signed constraint function , not a ruler. Its numeric value depends on how you wrote the constraint (scale it by 2 and every value doubles). All KKT reads off it is the sign / whether it is zero , not a true geometric distance.
Definition The Lagrangian
L ( x , λ , μ ) = f ( x ) + ∑ i λ i g i ( x ) + ∑ j μ j h j ( x ) .
It's the cost f plus a penalty term for each constraint, weighted by its multiplier. The ∑ i (capital sigma, just met in §4) means "add up over all fences i ."
Once packaged this way, the messy "stationarity" condition of KKT collapses to one clean line: ∇ x L = 0 — "the gradient of the bundled function, in the x variables, is flat." The multipliers are tuned so the fence-penalties exactly cancel the downhill pull. This same object powers Duality and the Dual Problem .
Definition Convex function / set
A function is convex if its graph is a bowl — the straight line between any two points on it never dips below the graph. A set is convex if the straight segment between any two of its points stays inside. See Convex Optimization .
Intuition Why convexity matters
For a bowl there is exactly one valley and no false bottoms. So for a convex problem, KKT don't just suggest a candidate — they guarantee the global minimum. Non-convex landscapes have many dips, so KKT can also flag maxima and saddles.
Definition Constraint qualification — the fine print that makes KKT valid
KKT are only guaranteed to hold at an optimum x ∗ if a constraint qualification (a regularity condition on the constraints) is satisfied. Two standard ones:
LICQ (Linear Independence Constraint Qualification): the gradients of all active fences and all wires at x ∗ are linearly independent — no one of them is a linear combination of the others. Picture the active arrows pointing in genuinely different directions, not stacked on top of each other or squashed into a lower dimension.
Slater's condition (for convex problems): there exists at least one strictly feasible point — a point where every inequality is slack (g i ( x ) < 0 , strictly inside every fence) while the wires hold. Picture a point comfortably in the interior of the allowed yard, touching no fence.
Intuition Why we need a qualification at all
If the active fence-gradients are degenerate — say two fences meeting in a sharp cusp so their arrows line up — the multipliers λ i may fail to exist even though x ∗ is genuinely optimal. LICQ (or Slater) rules out that pathology, guaranteeing the multipliers exist so the rulebook applies. See Constraint Qualifications (LICQ, Slater) .
These foundations combine directly in the flagship application, Support Vector Machines , where every symbol above reappears.
gradient nabla f uphill arrow
optimal point x star arg min
constraints g fences and h wires
perpendicular and dot product
linear combination and cone
multipliers lambda and mu
convexity and constraint qualification
Cover the right side and recite before moving to the main note.
What smoothness do f , g i , h j need, and why? Continuously differentiable (C 1 ) — otherwise the gradients ∇ f , ∇ g i , ∇ h j don't exist and KKT can't even be written.
What does x ∈ R n mean? A point = a list of n real-number coordinates; where you stand in the landscape.
What is x ∗ , and how does it differ from min f ? x ∗ = arg min f is the optimal location (input); min f is the optimal cost (the number/height it achieves).
What does f ( x ) measure? The cost / height at point x — the thing we minimize.
Convert "x + y ≥ 1 " to standard fence form. 1 − x − y ≤ 0 (move everything to one side as ≤ 0 ).
What does the gradient ∇ f point toward, and − ∇ f ? ∇ f points steepest uphill ; − ∇ f points steepest downhill .
At the valley floor, does the gradient vanish or cease to exist? It still exists — it is the zero vector ∇ f = 0 (an arrow of zero length).
Write the dot product formula and the perpendicular test. a ⋅ b = ∑ k a k b k ; perpendicular when a ⋅ b = 0 .
What makes a fence "active" vs "inactive" at x ∗ ? Active: g i ( x ∗ ) = 0 (touching). Inactive: g i ( x ∗ ) < 0 (strictly inside).
What is a cone of gradients, and why non-negative weights? All sums of active fence-arrows with weights ≥ 0 ; because a fence can only push outward, never pull.
Which multipliers are ≥ 0 and which are free in sign? Fence (inequality) multipliers λ i ≥ 0 ; wire (equality) multipliers μ j free.
Is g i ( x ∗ ) < 0 a distance? No — it's a signed constraint value (slack); KKT only cares about its sign / whether it's zero.
State complementary slackness in words. A fence only pushes when its slack is used up: λ i g i = 0 .
Why is convexity the golden property? One valley, no false bottoms → KKT become sufficient for the global minimum.
State one constraint qualification. LICQ — active fence and wire gradients are linearly independent at x ∗ ; or Slater — a strictly feasible interior point exists.
What breaks if the constraint qualification fails? Multipliers may not exist even at a true optimum, so KKT can be inapplicable.