1.2.9 · D1Calculus & Optimization Basics

Foundations — Local vs global minima - maxima

1,895 words9 min readBack to topic

This page assumes you know nothing beyond basic arithmetic. We will build every symbol the parent note Local vs global minima - maxima throws at you — one brick at a time, each earned before it is used.


1. What is a function ?

Picture a vending machine: press a button (the input ), out drops one snack (the output ). Never two snacks, never zero — exactly one.

Figure — Local vs global minima - maxima

In the picture, the input runs left–right along the flat ground. The output is the height of the curve above that spot. So a function is literally a landscape: input = where you stand, output = how high you are.


2. The symbol and the arrow

Picture as an endless ruler. Picture as a floor tiled with coordinates. The arrow says: stand anywhere on the floor, the machine tells you one height.


3. Points, stars, and bold letters: , ,

Think of as the little flag planted at the bottom of a valley.


4. Slope, the derivative , and "flat"

Before minima make sense, you must be able to see steepness.

Figure — Local vs global minima - maxima

Look at the figure: the green line just touches the curve at one point — that touching line is called the tangent, and its steepness is . Where the curve turns around at a valley or a peak, the tangent lies perfectly flat, so .


5. The second derivative — which way does it curve?

A flat spot could be a valley bottom, a hilltop, or a flat ledge. To tell them apart we need curvature.

Figure — Local vs global minima - maxima

6. Going multi-dimensional: the gradient

On a floor there isn't just one direction to step — there are many. So one slope number is not enough.

Picture standing on a hillside: the gradient is the arrow pointing the way water would not flow — straight up the steepest slope. Walk against it and you go downhill fastest. That is why Gradient Descent takes steps in the direction .


7. The Hessian — curvature in every direction

Just as tested curvature in 1D, we need a curvature test in many dimensions.

The Hessian's job: tell you the shape of the bowl in every direction at once.

  • Positive definite (all curvatures effectively "cup-like") → valley → local minimum.
  • Negative definite (all "cap-like") → peak → local maximum.
  • Mixed → a saddle: a cup one way, a cap the crossways direction (like a horse saddle or a Pringle).
Figure — Local vs global minima - maxima

8. The neighbourhood: , the norm , and

The formal definition of local needs a way to say "nearby only."

So with reads: "our spot is lowest among everybody inside the tiny circle." That is a local minimum — lowest only nearby. Drop the circle (compare against all points) and you get a global minimum.


9. The whole-picture map

Function f maps inputs to a height

Slope f prime tells steepness

Flat spot means slope equals zero

Curvature f double prime cup or cap

Many inputs need the gradient arrow

Gradient equals zero flat in all directions

Hessian gives curvature every direction

Local vs global minima and maxima

Neighborhood epsilon and distance

Gradient Descent walks downhill

Everything on the left is a prerequisite brick; the topic sits at node H; and the payoff is Gradient Descent, later refined by Momentum and Nesterov and Adam Optimizer.


Equipment checklist

Cover the right side and answer aloud. If any stumps you, re-read its section above.

What does physically mean on a landscape?
The height of the ground above the spot .
What does the arrow in say?
Take a list of numbers (a point), return one number (its height).
Why does a bold differ from plain ?
Bold is a whole list of coordinates (a point in many dimensions); plain is a single number.
What does tell you geometrically?
The ground is flat there — the tangent line is horizontal; it's a candidate peak or valley.
means the curve is shaped like a ___ and is a ___.
A cup; a local minimum.
What is the gradient in one sentence?
An arrow pointing straight uphill whose length is the steepness.
Why do we set instead of one slope?
In many dimensions we need every directional slope flat at once.
What shape does a Hessian with mixed-sign curvature describe?
A saddle — up one way, down the crossways way.
What does describe?
All points inside a tiny circle of radius around .
State the difference between local and global minimum.
Local = lowest within a small neighbourhood; global = lowest over the entire domain.