Continuity

Level FundamentalDifficulty ★★★★★Concept⌖ Open in the map

What is it?

ff is continuous at aa if lim⁡x→af(x)=f(a)\lim_{x\to a} f(x) = f(a): small changes in the input produce small changes in the output. Continuous on an interval means you can draw the graph without lifting the pen.

Why does it exist?

Measurements are never exact. If a model is continuous, a slightly wrong input gives a slightly wrong output, and computing with approximations makes sense. Continuity is also the hypothesis that unlocks the existence theorems (Bolzano, Weierstrass) on which root-finding and optimization rely.

Intuition

Three things must hold at aa: f(a)f(a) is defined, the limit exists, and they agree. Each failure is a kind of discontinuity: a hole, a jump, or a wild oscillation. Geometrically, zooming in on a continuous graph never reveals a gap.

Formal definition

f continuous at a  ⟺  ∀ε>0 ∃δ>0: ∣x−a∣<δ⇒∣f(x)−f(a)∣<ε.f \text{ continuous at } a \iff \forall\varepsilon > 0\ \exists\delta > 0:\ |x - a| < \delta \Rightarrow |f(x) - f(a)| < \varepsilon.

Sums, products, quotients (where the denominator is non-zero) and compositions of continuous functions are continuous; so are polynomials, exe^x, sin⁡\sin, cos⁡\cos, and ln⁡\ln on (0,∞)(0, \infty).

Formulas

lim⁡x→af(x)=f(a)\lim_{x\to a} f(x) = f(a)
ReLU⁡(x)=max⁡(0,x)\operatorname{ReLU}(x) = \max(0, x)
continuous everywhere, differentiable except at 0

Example

The step function H(x)=1H(x) = 1 for x≥0x \ge 0 and 00 otherwise is discontinuous at 0. The perceptron used it as its activation, and that is precisely why gradient methods could not train multilayer perceptrons until the step was replaced by the continuous (and differentiable) sigmoid.

Why does it matter?

Continuity is the minimal promise that a numerical method can work: rounding the input should not change the answer much. Where models are discontinuous (decision boundaries, collisions in a physics engine, edges in an image) software needs special handling.

Where it shows up in computing

  • Bézier curves and splines★★★★★frequentComputer graphics

    Joining spline pieces with C0C^0, C1C^1 or C2C^2 continuity decides how smooth the curve looks.

  • Physics engines★★★★★frequentPhysics and simulation

    Simulation assumes motion is continuous between frames; collisions break that and are handled separately.

Where it shows up in AI

  • Activation functions★★★★★fundamentalAI and machine learning

    Activations must be continuous (and almost everywhere differentiable) for gradient training to work.

Where is it used?

Computing topics reachable from here, through the chain of ideas that leads to them:

What depends on it

Exercises

1Computation

For which kk is f(x)=kx+1f(x) = kx + 1 for x<1x < 1, f(x)=x2+3f(x) = x^2 + 3 for x≥1x \ge 1 continuous?

Solution

Left limit k+1k + 1, value f(1)=4f(1) = 4. Continuity requires k+1=4k + 1 = 4, so k=3k = 3.

2AI

Why can't you train a network whose activation is the step function HH with gradient descent?

Solution

HH is constant except at 0, so its derivative is 0 almost everywhere (and undefined at 0). Every gradient flowing through it is zero: the weights never move.

↑ ↓ to navigate · ↵ · Esc