Visual walkthrough — KKT conditions for constrained optimization
Before we start, three plain-word promises about the symbols we'll use:
Prerequisites we lean on: Lagrange Multipliers (the equality-only ancestor), and later Convex Optimization and Constraint Qualifications (LICQ, Slater).
Step 1 — What a gradient is, and what "downhill" means
WHAT. Stand at a point on the cost landscape . The gradient is the single arrow pointing where the ground rises steepest. Turn it around and you get : the direction water would run — the direction that decreases the most.
WHY this tool and not another? We could ask "does moving this way lower the cost?" for a thousand directions. That's exhausting. The gradient answers all of them at once. First, plain words: a direction is just a little arrow saying "which way to step" — say, "one metre east and half a metre north." Take a tiny step along that arrow and the cost changes by (roughly) a single dot product that multiplies the two arrows and the cosine of the angle between them. If that number is negative (you stepped more against the uphill arrow than with it), you went downhill. So the gradient is the compass of optimization; we reach for it because it compresses "which way is down" into one arrow.
PICTURE. The blue curves below are level sets — rings of equal height, like a contour map. The pale-yellow arrow is (uphill, always ⟂ to the rings). The pink arrow is (downhill), the way the ball rolls when nothing stops it.

Step 2 — Free minimum: the ball stops where the ground is flat
WHAT. With no fences, where does the ball rest? Exactly where downhill points nowhere — where the ground is flat.
WHY. If were any nonzero arrow, the ball could follow it and drop lower. So resting requires that arrow to vanish. Flatness is the condition .
PICTURE. At the bowl's bottom the rings shrink to a point and the gradient arrow has zero length — nothing left to push the ball.

Step 3 — A wire (equality): the ball can only slide along it
WHAT. Now force the ball onto a wire — a curve it must stay on. It can slide along the wire but not leave it.
WHY the gradient must line up. Split into two parts: the part along the wire and the part across it. If any downhill push runs along the wire, the ball slides that way and lowers — not resting yet. So at rest, the along-wire push is zero. That leaves pointing purely across the wire, i.e. parallel to the wire's own normal . "Parallel" means one is a multiple of the other:
This is exactly ordinary Lagrange Multipliers.
PICTURE. Blue rings (cost), yellow curve (the wire ). At the resting point the cost-ring is tangent to the wire — they kiss. There, (pink) and (yellow-outline) lie on the same line, pointing opposite ways; the number is how many times longer one is than the other.

Step 4 — A fence (inequality): forbidden only on ONE side
WHAT. Replace the wire with a fence . Crucial difference: one side () is open ground the ball may enter; the other () is forbidden. A fence pushes back only from one direction.
WHY this changes everything. With a wire the ball is trapped on the curve. With a fence the ball has a whole region to roam. Two totally different resting scenarios appear, which we split in Steps 5 and 6.
PICTURE. The pink shaded half is forbidden (); the clear half is feasible (). The fence line is . The arrow points into the forbidden side (that's the direction increases).

Step 5 — Case A: fence inactive → it might as well not exist
WHAT. Suppose the free minimum from Step 2 already sits inside the allowed region (). Then the fence never mattered.
WHY the multiplier is zero. We'll write the resting condition as (like the wire, one multiplier ). But here the ball rests on flat ground, so , which forces . Since on a real fence, we need . Meaning: an untouched fence exerts no force.
PICTURE. The bowl's true bottom lands in clear (feasible) territory; the fence sits far away, slack. The force arrow from the fence has zero length.

Step 6 — Case B: fence active → the wall pushes, and only ONE way
WHAT. Now the free minimum is forbidden, so the ball rolls until it jams against the fence and stops there with .
WHY the multiplier must be (this is the heart of KKT). At rest against the fence, balances the fence's push: The only escape directions the ball has are feasible ones — directions where does not increase, i.e. that point away from . For the ball to truly be stuck, none of those escape directions may go downhill. Working the inequality through, the downhill arrow must point into the fence (same side as ), which forces: Contrast Step 3's wire, where was free: a fence blocks only one direction, so its multiplier can only have one sign. A negative would mean points into open ground — but then the ball could roll off the fence and drop lower. So is impossible at a genuine rest.
PICTURE. The ball is jammed on the fence. Downhill (pink) points into the forbidden zone; the fence's inward normal (yellow) exactly cancels it. Their lengths differ by the factor .

Step 7 — Fusing both cases: complementary slackness
WHAT. Steps 5 and 6 are two branches. KKT bottles them into one elegant equation:
WHY it captures both. A product is zero exactly when one factor is zero:
- If (inactive), the product forces — that's Step 5.
- If (real push), the product forces — that's Step 6.
They can never both be "loose" ( and ) — that would be a wall pushing on a ball it isn't touching. Impossible.
PICTURE. A two-branch fork: the left path (inactive, ) and the right path (active, ) both funnel into the single node .

Step 8 — Stacking many fences and wires: the cone of forces
WHAT. Real problems have several fences and several wires. Before bundling them, let's fix the plain-word bookkeeping so no new symbol sneaks in:
- Number the fences — one per inequality, with its own non-negative multiplier . The little subscript is just a name-tag running .
- Number the wires — one per equality, with its own sign-free multiplier . The subscript runs .
So means "add up over every fence" and means "add up over every wire." With this in hand we bundle every push and pull into one bookkeeping object, the Lagrangian:
WHY a "cone". Each active fence contributes a push with — a non-negative amount along its normal. Adding non-negative amounts of several arrows sweeps out a wedge-shaped region called a cone. The rule says: (downhill) must live inside that cone. If it does, the ball is trapped — every downhill direction is blocked by some wall.
PICTURE. Two active fence-normals (yellow) open a shaded cone. The downhill arrow (pink) sits inside it — trapped. This is the "geometric soul" the parent note mentioned.

Step 9 — When is "trapped" the SAME as "global best"? (convex + Slater)
WHAT. Everything so far is local — the ball stopped, but is this the lowest point anywhere? For a convex problem, with a mild regularity condition, the answer is yes.
WHY convexity seals it. Convex means the landscape is a single smooth bowl (no secondary dips) and every feasible region is a solid, dent-free blob. In such a world "no downhill escape here" can't be a local trick — there's only one basin. Two precise statements:
- KKT ⟹ global minimum (sufficiency): for a convex problem ( convex, affine), any point satisfying the four KKT conditions is a global minimum — no extra assumption needed.
- Global minimum ⟹ KKT (necessity): to guarantee the multipliers exist at the optimum you still need a constraint qualification. The convex-friendly one is Slater's condition: some strictly feasible point exists ( for all ). Slater also delivers strong duality, tying these same 's to the dual problem.
This "necessary and sufficient (under Slater)" fact is why Support Vector Machines and other Convex Optimization models can trust a KKT point, and why solvers like Gradient Descent and Projected Gradient converge to the true optimum.
PICTURE. Left: a wiggly non-convex landscape where a KKT point sits in a shallow false dip (also flags a mere saddle/max). Right: a clean convex bowl where the one KKT point is the global floor.

The one-picture summary
Everything above, on a single board: the ball at rest against active fences, downhill trapped in the cone of pushes, inactive fences dangling with zero force, and the four KKT stamps labelled where they live.

Recall Feynman retelling of the whole walkthrough
A marble rolls down a bumpy floor toward the lowest spot it can reach, but there are fences. First I learned the marble always wants to roll straight downhill — that arrow is . On open ground it stops only where the floor is flat. Put it on a wire and it slides until the downhill push runs sideways-into the wire, not along it. Fences are trickier: a fence only blocks one side, so it can only push, never pull — that's why its number can't go negative. If the marble stops away from a fence, that fence did nothing (); if it stops against one, the fence is definitely pushing (). "Push only where you touch" is one neat line: . And of course the marble has to actually stay inside the playground the whole time — that's "primal feasibility." To keep the books, we pile cost plus all pushes into one function and set its -gradient to zero. With many fences meeting at a corner, their pushes add up into a wedge (a cone), and the marble is stuck exactly when downhill points inside that wedge — provided no fence has a degenerate, direction-less edge (that's what LICQ forbids). Finally, if the whole floor is one smooth bowl (convex) and there's some strictly-inside point (Slater), "stuck here" means "lowest anywhere." That's the entire KKT story.
Recall Why can
be negative but not ? A wire () forbids both sides, so it can pull either way → free in sign. A fence () forbids only one side, so it can only push one way → (this is "dual feasibility").
Recall What does
forbid? The combination and — a wall pushing a ball it isn't touching. One of the two must always be zero.
Recall Why does LICQ insist gradients be linearly independent?
Because the balance argument secretly needs each and needs the normals not to collapse onto one line. Linear independence guarantees both, so the cone is full-dimensional and honest multipliers exist and are unique.