A function is continuous at c if, for every ε > 0, there exists δ > 0 such that |x - c| < δ implies |f(x) - f(c)| < ε. Continuous functions on closed intervals attain their extrema and hit every value in between.
Epsilon-delta continuity
The definition is a game: the adversary picks ε, you respond with δ. For f(x) = x^2 at c = 3, given ε = 0.1, you need |x^2 - 9| < 0.1 whenever |x - 3| < δ. Factoring: |x - 3||x + 3| < 0.1. Near x = 3, |x + 3| is about 6, so δ = 0.1/7 works.
Scheme
; Epsilon-delta for f(x) = x^2 at c = 3; Given epsilon, find delta such that; |x - 3| < delta => |x^2 - 9| < epsilon
(define (find-delta c epsilon)
; |x^2 - c^2| = |x-c||x+c|; Near c, |x+c| <= 2|c| + 1 (if delta <= 1)
(let ((bound (+ (* 2 (abs c)) 1)))
(min 1 (/ epsilon bound))))
(define (verify-continuity c epsilon n-tests)
(let ((delta (find-delta c epsilon)))
(display "c = ") (display c)
(display ", epsilon = ") (display epsilon)
(display ", delta = ") (display delta) (newline)
(let loop ((i 0) (all-good #t))
(if (>= i n-tests) all-good
(let* ((x (+ c (* delta (- (* 2.0 (/ i n-tests)) 1.0))))
(diff (abs (- (* x x) (* c c)))))
(loop (+ i 1) (and all-good (< diff epsilon))))))))
(display "All within epsilon? ")
(display (verify-continuity 30.11000)) (newline)
(display "All within epsilon? ")
(display (verify-continuity 30.011000))
Python
# Epsilon-delta for x^2 at c=3import random
random.seed(42)
def find_delta(c, eps):
bound = 2 * abs(c) + 1returnmin(1, eps / bound)
c, eps = 3, 0.1
delta = find_delta(c, eps)
tests = [c + delta * (2*i/999 - 1) for i inrange(1000)]
all_ok = all(abs(x**2 - c**2) < eps for x in tests)
print(f"delta = {delta:.6f}, all within eps? {all_ok}")
Intermediate value theorem
If f is continuous on [a, b] and f(a) < y < f(b), then there exists c in (a, b) with f(c) = y. The proof uses the completeness of the reals: take the supremum of the set where f is below y. This is why continuous functions can't "jump" over values.
Scheme
; IVT: f(x) = x^3 - x - 1 has a root in [1, 2]; f(1) = -1 < 0, f(2) = 5 > 0
(define (f x) (- (- (* x x x) x) 1))
(display "f(1) = ") (display (f 1)) (newline)
(display "f(2) = ") (display (f 2)) (newline)
(display "IVT guarantees a root in (1, 2)") (newline)
; Find it by bisection (constructive IVT)
(define (bisect a b tol)
(let ((mid (/ (+ a b) 2.0)))
(if (< (- b a) tol) mid
(if (< (* (f a) (f mid)) 0)
(bisect a mid tol)
(bisect mid b tol)))))
(define root (bisect 1.02.0 1e-10))
(display "Root: ") (display root) (newline)
(display "f(root) = ") (display (f root))
Python
# Python equivalent
f = lambda x: x**3 - x - 1print("f(1) =", f(1))
print("f(2) =", f(2))
print("IVT guarantees a root in (1, 2)")
a, b = 1.0, 2.0for _ inrange(60):
mid = (a + b) / 2if f(a) * f(mid) < 0:
b = mid
else:
a = mid
print("Root:", mid)
print("f(root) =", f(mid))
Extreme value theorem
A continuous function on a closed, bounded interval [a, b] attains its maximum and minimum. The proof combines Bolzano-Weierstrass (Ch. 2) with continuity. Open intervals or unbounded domains break this: 1/x on (0, 1] has no maximum.
Scheme
; EVT: f(x) = sin(x) + x/5 on [0, 10]; Continuous on closed bounded interval => attains max and min
(define (f x) (+ (sin x) (/ x 5.0)))
; Approximate max and min by sampling
(define (find-extrema a b n)
(let loop ((i 0) (xmin a) (fmin (f a)) (xmax a) (fmax (f a)))
(if (> i n)
(begin
(display " min at x=") (display xmin)
(display ", f(x)=") (display fmin) (newline)
(display " max at x=") (display xmax)
(display ", f(x)=") (display fmax))
(let* ((x (+ a (* (/ i n) (- b a))))
(fx (f x)))
(loop (+ i 1)
(if (< fx fmin) x xmin)
(if (< fx fmin) fx fmin)
(if (> fx fmax) x xmax)
(if (> fx fmax) fx fmax))))))
(display "f(x) = sin(x) + x/5 on [0, 10]:") (newline)
(find-extrema 0.010.010000)
Python
# Python equivalentimportmath
f = lambda x: math.sin(x) + x / 5
xs = [i / 10000 * 10for i inrange(10001)]
fvals = [(x, f(x)) for x in xs]
xmin, fmin = min(fvals, key=lambda p: p[1])
xmax, fmax = max(fvals, key=lambda p: p[1])
print("f(x) = sin(x) + x/5 on [0, 10]:")
print(" min at x=" + str(round(xmin, 4)) + ", f(x)=" + str(round(fmin, 6)))
print(" max at x=" + str(round(xmax, 4)) + ", f(x)=" + str(round(fmax, 6)))
Uniform continuity
f is uniformly continuous on S if the δ in the continuity definition can be chosen independently of the point c. On a closed bounded interval, continuity implies uniform continuity (Heine-Cantor theorem). On unbounded domains, this can fail: f(x) = x^2 is continuous but not uniformly continuous on all of R.
Scheme
; Uniform vs pointwise continuity; f(x) = x^2 on [0, 1]: uniformly continuous; f(x) = x^2 on [0, infinity): NOT uniformly continuous; delta depends on the point c; For f(x)=x^2, delta = eps/(2c+1); As c grows, delta shrinks to 0
(display "delta for x^2 with epsilon=0.1:") (newline)
(for-each (lambda (c)
(let ((delta (/ 0.1 (+ (* 2 c) 1))))
(display " c=") (display c)
(display ", delta=") (display delta) (newline)))
(list 1101001000))
(display "On [0,1]: delta >= 0.1/3 for all c") (newline)
(display "On [0,inf): delta -> 0 as c -> inf") (newline)
(display "No single delta works for all c on [0,inf)")
Python
# Python equivalentprint("delta for x^2 with epsilon=0.1:")
for c in [1, 10, 100, 1000]:
delta = 0.1 / (2 * c + 1)
print(" c=" + str(c) + ", delta=" + str(delta))
print("On [0,1]: delta >= 0.1/3 for all c")
print("On [0,inf): delta -> 0 as c -> inf")
print("No single delta works for all c on [0,inf)")
🎛 Control Ch.4 — stability theory depends on continuity of the vector field
🎰 Probability Ch.4 — continuous probability distributions require continuity of the CDF
Translation notes
Bisection is the constructive content of IVT. The sampling approach to EVT is not a proof; it misses the actual extremum by up to the sampling resolution. The real theorems depend on completeness and compactness, which have no computational shortcut.