Lectures

Math Camp

Lecture 2: Real Analysis in ℝn\mathbb{R}^{n}

In economics, we often want to maximize a function subject to constraints: maxx∈Df(x).\max_{x\in D} f(x). Here ff is the objective function and DD is the feasible set: the set of choices satisfying the constraints. There is little point in trying to solve this problem if no solution exists. This lecture develops the machinery to guarantee that a solution exists, in ℝn\mathbb{R}^{n}.

1 Distance and sequences

We begin by defining Euclidean distance in ℝn\mathbb{R}^{n}. Note that there are other ways to measure and define distance, even in ℝn\mathbb{R}^{n}. We opt to only use Euclidean distance for most of this class.

Definition 1.1 (Inner product, norm, and distance). For x,y∈ℝnx,y\in\mathbb{R}^{n},

  • the inner product (also known as the dot product) of xx and yy is x⋅y=∑i=1nxiyi,x \cdot y = \sum_{i=1}^n x_i y_i,

  • the (Euclidean) norm (or length) of xx is ∥x∥=x⋅x=∑i=1nxi2,\lVert x \rVert=\sqrt{x \cdot x}=\sqrt{\sum_{i=1}^n x_i^2},

  • the distance between xx and yy is d(x,y)=∥x−y∥=∑i=1n(xi−yi)2.d(x,y)=\lVert x-y \rVert = \sqrt{\sum_{i=1}^n (x_i-y_i)^2}.

For example, x=(3,4)∈ℝ2x=(3,4)\in\mathbb{R}^2 has x⋅x=25x\cdot x=25 and ∥x∥=5\lVert x \rVert=5, and the distance between (1,2)(1,2) and (4,6)(4,6) is 55 as well. In ℝ1\mathbb{R}^1 the norm is the absolute value, so d(x,y)=|x−y|d(x,y)=\lvert x-y \rvert.

The inner product and the norm are related by the Cauchy–Schwarz inequality:

Theorem 1.2 (Cauchy–Schwarz). For every x,y∈ℝnx,y\in\mathbb{R}^{n}, (x⋅y)2≤(x⋅x)(y⋅y),(x\cdot y)^2\leq(x\cdot x)(y\cdot y), and hence |x⋅y|≤∥x∥∥y∥\lvert x\cdot y \rvert\leq\lVert x \rVert\lVert y \rVert.

Proof (optional). If y=0y=0, both sides of the first inequality vanish.

Next suppose y≠0y\ne0, so that y⋅y=∑i=1nyi2>0y\cdot y=\sum_{i=1}^n y_i^2>0. For every λ∈ℝ\lambda\in\mathbb{R}, consider a vector z=x−λyz = x-\lambda y. By Definition 1.1, z⋅z=∑i=1nzi2≥0z \cdot z = \sum_{i=1}^n z_i^2 \geq 0. Hence, we have 0≤z⋅z=(x−λy)⋅(x−λy)=x⋅x−2λ(x⋅y)+λ2(y⋅y).0 \leq z\cdot z=(x-\lambda y)\cdot(x-\lambda y) =x\cdot x-2\lambda\,(x\cdot y)+\lambda^2\,(y\cdot y). Next, choose λ=(x⋅y)/(y⋅y)\lambda=(x\cdot y)/(y\cdot y) so that 0≤x⋅x−2(x⋅y)(y⋅y)(x⋅y)+((x⋅y)(y⋅y))2(y⋅y)=x⋅x−(x⋅y)2y⋅y.0 \leq x\cdot x-2\frac{(x\cdot y)}{(y\cdot y)}\,(x\cdot y)+\left(\frac{(x\cdot y)}{(y\cdot y)}\right)^2\,(y\cdot y) = x\cdot x-\frac{(x\cdot y)^2}{y\cdot y}. Multiplying it by y⋅y>0y\cdot y>0 gives the first inequality in Theorem 1.2. Taking square roots gives the second inequality in Theorem 1.2, since (x⋅x)1/2=∥x∥(x\cdot x)^{1/2}=\lVert x \rVert by Definition 1.1. ◻

Here are some useful properties of the norm.

Theorem 1.3 (Norm properties). For x,y∈ℝnx,y\in\mathbb{R}^{n} and a∈ℝa\in\mathbb{R},

  1. ∥x∥≥0\lVert x \rVert\geq0, and ∥x∥=0\lVert x \rVert=0 if and only if x=0x=0 (positivity),

  2. ∥ax∥=|a|∥x∥\lVert ax \rVert=\lvert a \rvert\lVert x \rVert (homogeneity),

  3. ∥x+y∥≤∥x∥+∥y∥\lVert x+y \rVert\leq\lVert x \rVert+\lVert y \rVert (triangle inequality).

Proof. Parts (1) and (2) follow from Definition 1.1. The triangle inequality is shown as follows: ∥x+y∥2=∥x∥2+2x⋅y+∥y∥2≤∥x∥2+2∥x∥∥y∥+∥y∥2=(∥x∥+∥y∥)2,\lVert x+y \rVert^2 =\lVert x \rVert^2+2\,x\cdot y+\lVert y \rVert^2 \leq\lVert x \rVert^2+2\lVert x \rVert\lVert y \rVert+\lVert y \rVert^2 =(\lVert x \rVert+\lVert y \rVert)^2, where the first inequality uses the Cauchy–Schwarz inequality. Taking square roots gives the triangle inequality. ◻

Read in terms of the distance function dd, the three norm properties say that the distance behaves as a distance should: for all x,y,z∈ℝnx,y,z\in\mathbb{R}^{n}, d(x,y)≥0,with equality exactly when x=y,d(x,y)=d(y,x),d(x,z)≤d(x,y)+d(y,z).\begin{gathered} d(x,y)\geq0,\quad\text{with equality exactly when }x=y,\\ d(x,y)=d(y,x), \qquad d(x,z)\leq d(x,y)+d(y,z). \end{gathered} Here, nonnegativity is part (1) applied to x−yx-y; symmetry is part (2) with a=−1a=-1; and the triangle inequality is part (3) applied to x−z=(x−y)+(y−z)x-z=(x-y)+(y-z). A function satisfying these three conditions is called a metric.

Equipped with a concept of distance, we can name the set of points lying within a given distance of a point.

Definition 1.4 (Open ball). For x∈ℝnx\in\mathbb{R}^{n} and r>0r>0, the open ball with center xx and radius rr is B(x,r)={y∈ℝn:∥y−x∥<r}.B(x,r)=\{y\in\mathbb{R}^{n}:\lVert y-x \rVert<r\}.

Definition 1.5 (Interior points, open sets, and limit points).

Let D⊆ℝnD\subseteq\mathbb{R}^{n}.

  • A point x∈Dx\in D is an interior point of DD if B(x,r)⊆DB(x,r)\subseteq D for some r>0r>0. The set of all interior points of DD is its interior, written intD\operatorname{int}D.

  • The set DD is open if every point of DD is an interior point.

  • A point a∈ℝna\in\mathbb{R}^{n} is a limit point of DD if every ball B(a,r)B(a,r) contains a point of DD different from aa; equivalently, B(a,r)∩(D\{a})≠∅for every r>0.B(a,r)\cap\left(D\setminus\{a\}\right)\neq\emptyset \qquad\text{for every }r>0.

For example, let a<ba<b and take x∈(a,b)x\in(a,b). The number r=min{x−a,b−x}r=\min\{x-a,b-x\} is positive and B(x,r)⊆(a,b)B(x,r)\subseteq(a,b), so (a,b)(a,b) is open. The endpoints of [a,b][a,b] are not interior points, and therefore int[a,b]=(a,b).\operatorname{int}[a,b]=(a,b). The limit-point condition says that points of DD different from aa can be found arbitrarily close to aa; the point aa need not itself belong to DD.

Geometrically, in ℝ\mathbb{R} the ball B(x,r)B(x,r) is the interval (x−r,x+r)(x-r,x+r), and in ℝ2\mathbb{R}^2 it is the disk of radius rr around xx without its bounding circle.

Definition 1.6 (Sequence and convergence). A sequence in ℝn\mathbb{R}^{n} is a list (xk)k=1∞(x_k)_{k=1}^{\infty} with xk∈ℝnx_k\in\mathbb{R}^{n}. It converges to x∈ℝnx\in\mathbb{R}^{n}, and xx is its limit, written xk→xx_k\to x, if for every ε>0\varepsilon>0 there is K∈ℕK\in\mathbb N such that k≥K⇒∥xk−x∥<ε.k\geq K\quad\Longrightarrow\quad\lVert x_k-x \rVert<\varepsilon. A sequence that has no limit in ℝn\mathbb{R}^{n} diverges.

In the notation of Definition 1.4, the condition says that every ball B(x,ε)B(x,\varepsilon), however small its radius, contains all terms of the sequence from some index on.

We check the definition on two sequences in ℝ\mathbb{R}.

Example 1.7 (Convergence and divergence).

  1. The sequence xk=1/kx_k=1/k converges to 00. Let ε>0\varepsilon>0 and take an integer K>1/εK>1/\varepsilon. Then every k≥Kk\geq K satisfies |xk−0|=1k≤1K<ε,\lvert x_k-0 \rvert=\frac1k\leq\frac1K<\varepsilon, which is the implication Definition 1.6 requires of KK. Since ε>0\varepsilon>0 was arbitrary, xk→0x_k\to0.

  2. The sequence xk=(−1)kx_k=(-1)^k diverges. Let x∈ℝx\in\mathbb{R} be a candidate limit and take ε=1\varepsilon=1. By part (3) of Theorem 1.3, |1−x|+|−1−x|≥|(1−x)−(−1−x)|=2,\lvert 1-x \rvert+\lvert -1-x \rvert\geq\lvert (1-x)-(-1-x) \rvert=2, so at least one of the two numbers is at least 11. The values 11 and −1-1 both occur at arbitrarily large indices, so every K∈ℕK\in\mathbb N admits some k≥Kk\geq K with |xk−x|≥1\lvert x_k-x \rvert\geq1, and the implication in Definition 1.6 fails for ε=1\varepsilon=1. Since xx was arbitrary, no limit exists.

A subsequence is exactly what is sounds like: a sequence drawn from another sequence by skipping some terms.

Definition 1.8 (Subsequence). If k1<k2<⋯k_1<k_2<\cdots is a strictly increasing sequence of indices, then (xkj)j=1∞(x_{k_j})_{j=1}^{\infty} is a subsequence of (xk)(x_k).

Here are some useful properties of sequences and their limits.

Theorem 1.9 (Basic limit facts). Let (xk)(x_k) be a sequence in ℝn\mathbb{R}^{n}.

  1. If xk→xx_k\to x and xk→yx_k\to y, then x=yx=y.

  2. If xk→xx_k\to x, then (xk)(x_k) is bounded: there is M>0M>0 with ∥xk∥≤M\lVert x_k \rVert\leq M for every kk.

  3. The convergence xk→xx_k\to x holds if and only if xk,i→xix_{k,i}\to x_i in ℝ\mathbb{R} for every coordinate i=1,…,ni=1,\ldots,n.

  4. If xk→xx_k\to x, then every subsequence of (xk)(x_k) also converges to xx.

Proof (optional). Uniqueness. Let ε>0\varepsilon>0. By Definition 1.6 there is K1K_1 with ∥xk−x∥<ε/2\lVert x_k-x \rVert<\varepsilon/2 for k≥K1k\geq K_1, and K2K_2 with ∥xk−y∥<ε/2\lVert x_k-y \rVert<\varepsilon/2 for k≥K2k\geq K_2. Fix one k≥max{K1,K2}k\geq\max\{K_1,K_2\} and write x−y=(x−xk)+(xk−y)x-y=(x-x_k)+(x_k-y); parts (2) and (3) of Theorem 1.3 give ∥x−y∥≤∥xk−x∥+∥xk−y∥<ε.\lVert x-y \rVert\leq\lVert x_k-x \rVert+\lVert x_k-y \rVert<\varepsilon. So the nonnegative number ∥x−y∥\lVert x-y \rVert lies below every positive ε\varepsilon, hence equals 00, and part (1) of Theorem 1.3 gives x=yx=y.

Boundedness. Left as an exercise: Definition 1.6 with ε=1\varepsilon=1 leaves all but finitely many terms in B(x,1)B(x,1), and a bound is the largest of ∥x∥+1\lVert x \rVert+1 and the norms of those remaining terms.

Coordinates. Write aj=xk,j−xja_j=x_{k,j}-x_j. Since ai2a_i^2 is one of the squares summed in Definition 1.1, and since that sum is at most (∑j=1n|aj|)2\left(\sum_{j=1}^n\lvert a_j \rvert\right)^2, taking square roots gives |xk,i−xi|≤∥xk−x∥≤∑j=1n|xk,j−xj|.\lvert x_{k,i}-x_i \rvert \leq\lVert x_k-x \rVert \leq\sum_{j=1}^n\lvert x_{k,j}-x_j \rvert. Let ε>0\varepsilon>0. If xk→xx_k\to x, the left inequality lets any KK that Definition 1.6 supplies for ε\varepsilon serve the coordinate sequence (xk,i)(x_{k,i}) as well. Conversely, if every coordinate converges, choose for each jj an index KjK_j beyond which |xk,j−xj|<ε/n\lvert x_{k,j}-x_j \rvert<\varepsilon/n; then k≥max{K1,…,Kn}k\geq\max\{K_1,\ldots,K_n\} makes the right-hand sum, and hence ∥xk−x∥\lVert x_k-x \rVert, smaller than ε\varepsilon.

Subsequences. The indices of a subsequence satisfy kj≥jk_j\geq j: this holds at j=1j=1 because indices are natural numbers, and kj+1>kj≥jk_{j+1}>k_j\geq j forces kj+1≥j+1k_{j+1}\geq j+1. Now let ε>0\varepsilon>0 and take the KK that Definition 1.6 supplies for (xk)(x_k). Every j≥Kj\geq K has kj≥j≥Kk_j\geq j\geq K, and therefore ∥xkj−x∥<ε\lVert x_{k_j}-x \rVert<\varepsilon. ◻

Limits also respect the arithmetic of ℝn\mathbb{R}^{n}, one operation at a time.

Theorem 1.10 (Algebra of limits). Suppose xk→xx_k\to x and yk→yy_k\to y in ℝn\mathbb{R}^{n}, and ak→aa_k\to a and bk→bb_k\to b in ℝ\mathbb{R}. Then

  1. xk+yk→x+yx_k+y_k\to x+y,

  2. akxk→axa_kx_k\to ax,

  3. akbk→aba_kb_k\to ab,

  4. xk⋅yk→x⋅yx_k\cdot y_k\to x\cdot y,

  5. ∥xk∥→∥x∥\lVert x_k \rVert\to\lVert x \rVert,

  6. ak/bk→a/ba_k/b_k\to a/b, provided b≠0b\neq0 and bk≠0b_k\neq0 for every kk,

  7. x≥yx\geq y, provided xk≥ykx_k\geq y_k coordinatewise for every kk.

Its proof is left as an exercise; the claims follow from part (3) of Theorem 1.3, which gives |∥xk∥−∥x∥|≤∥xk−x∥\lvert \lVert x_k \rVert-\lVert x \rVert \rvert\leq\lVert x_k-x \rVert, from Theorem 1.2, and from the coordinatewise criterion in part (3) of Theorem 1.9, together with the boundedness supplied by part (2).

2 Suprema and compactness

We first develop two ingredients for existence arguments: a way to describe the limiting upper value of a set, and a condition that makes sequences behave well inside a feasible set.

2.1 Suprema and maximizing sequences

Definition 2.1 (Bounds and extrema). Let A⊆ℝA\subseteq\mathbb{R} be nonempty.

  • A number uu is an upper bound of AA if a≤ufor every a∈A,a\leq u\qquad\text{for every }a\in A, and AA is bounded above if it has an upper bound.

  • The supremum, or least upper bound, of AA, written supA\sup A, is an upper bound ss of AA satisfying s≤ufor every upper bound u of A.s\leq u\qquad\text{for every upper bound }u\text{ of }A.

  • A number zz is the maximum of AA, written maxA\max A, if z∈Aanda≤z for every a∈A.z\in A \qquad\text{and}\qquad a\leq z\ \text{ for every }a\in A.

Lower bounds, bounded below, the infimum, or greatest lower bound, infA\inf A, and the minimum minA\min A are defined by reversing every inequality above.

If a maximum exists, it is automatically the supremum. Conversely, if the supremum exists and belongs to AA, it is the maximum. Thus maxA exists⇔supA exists and supA∈A,\max A\text{ exists} \quad\Longleftrightarrow\quad \sup A\text{ exists and }\sup A\in A, and then the two numbers are equal.

For example, the upper bounds of (0,1)(0,1) are precisely the numbers at least 11, so sup(0,1)=1,inf(0,1)=0.\sup(0,1)=1, \qquad \inf(0,1)=0. Neither bound belongs to the interval, so it has neither a maximum nor a minimum. The interval [0,1][0,1] has the same supremum and infimum, but it contains both; hence max[0,1]=1\max[0,1]=1 and min[0,1]=0\min[0,1]=0.

Definition 2.1 does not guarantee that a supremum exists; it is possible for a set to have upper bounds but no least one. For instance, the set of rational numbers qq with q2<2q^2<2 is bounded above by 22, but it has no least upper bound in ℚ\mathbb Q. When dealing with ℝ\mathbb{R}, we make a fundamental assumption that every nonempty set that is bounded above has a supremum. This is known as the completeness property of the real numbers.

Axiom 2.2 (Completeness of ℝ\mathbb{R}). Every nonempty subset of ℝ\mathbb{R} that is bounded above has a supremum in ℝ\mathbb{R}.

Note the role of both hypotheses of the axiom. First, the set ℝ\mathbb{R} is nonempty but not bounded above, so it has no supremum. Second, the empty set ∅\emptyset is bounded above by every real number, but it has no least upper bound.

2.2 Closed, bounded, and compact sets

Our existence argument will turn a sequence of feasible points into a candidate solution. For this to work, some subsequence must converge and its limit must remain in the feasible set. Compactness guarantees both.

Definition 2.3 (Closed, bounded, and compact sets). A set D⊆ℝnD\subseteq\mathbb{R}^{n} is

  • closed if xk∈Dx_k\in D and xk→xx_k\to x imply x∈Dx\in D;

  • bounded if there is M>0M>0 such that ∥x∥≤M\lVert x \rVert\leq M for every x∈Dx\in D;

  • compact if every sequence (xk)(x_k) in DD has a subsequence converging to some point of DD.

There are two failures to remember: xk=kx_k=k runs off to infinity in ℝ\mathbb{R}, while xk=1/kx_k=1/k converges to a point missing from (0,1)(0,1). Compactness rules out both.

In Euclidean space these conditions are related by a fundamental result that we use without proof.

Theorem 2.4 (Heine–Borel). A set D⊆ℝnD\subseteq\mathbb{R}^{n} is compact if and only if it is closed and bounded.

Thus every closed interval [a,b][a,b] is compact, whereas (0,1)(0,1) and ℝ\mathbb{R} are not. The empty set is compact, so compactness alone does not supply a feasible point.

3 Continuity and existence

3.1 Continuity

So far, a limit has described the behavior of a sequence. We will also need to describe the behavior of a function as its input approaches a point.

Definition 3.1 (Limit of a function). Let D⊆ℝnD\subseteq\mathbb{R}^{n}, let f:D→ℝmf:D\to\mathbb{R}^m, let aa be a limit point of DD, and let L∈ℝmL\in\mathbb{R}^m. We write limx→af(x)=L\lim_{x\to a}f(x)=L if, for every sequence (xk)(x_k) in D\{a}D\setminus\{a\} such that xk→ax_k\to a, we have f(xk)→Lf(x_k)\to L.

In Euclidean space this sequential definition is equivalent to the familiar ε\varepsilon–δ\delta condition: for every ε>0\varepsilon>0 there is δ>0\delta>0 such that x∈D,0<∥x−a∥<δ⇒∥f(x)−L∥<ε.x\in D,\quad 0<\lVert x-a \rVert<\delta \quad\Longrightarrow\quad \lVert f(x)-L \rVert<\varepsilon.

The restriction x≠ax\neq a is deliberate: a function limit depends on values near aa, not on the value at aa. The point aa need not be in the domain. For example, if q(h)=h2/|h|=|h|q(h)=h^2/\lvert h \rvert=\lvert h \rvert for h≠0h\neq0, then Theorem 1.10 gives limh→0q(h)=0\lim_{h\to0}q(h)=0, even though q(0)q(0) is not defined.

For functions of one real variable, suppose aa is approached by points of DD from the indicated side. The notation limx↓af(x)=Landlimx↑af(x)=L\lim_{x\downarrow a}f(x)=L \qquad\text{and}\qquad \lim_{x\uparrow a}f(x)=L denotes the right-hand limit and left-hand limit, respectively. The first applies Definition 3.1 to D∩(a,∞)D\cap(a,\infty); the second applies it to D∩(−∞,a)D\cap(-\infty,a). If the two-sided limit exists, then every one-sided limit that is defined exists and equals it.

Definition 3.2 (Continuity). Let D⊆ℝnD\subseteq\mathbb{R}^{n}, let f:D→ℝmf:D\to\mathbb{R}^m, and let x∈Dx\in D. The function ff is continuous at xx if, whenever xk∈Dx_k\in D and xk→xx_k\to x, we have f(xk)→f(x).f(x_k)\to f(x). The function is continuous on DD, or simply continuous, if it is continuous at every point of DD.

At a limit point x∈Dx\in D, Definition 3.2 is equivalent to limy→xf(y)=f(x).\lim_{y\to x}f(y)=f(x). Equivalently, for every ε>0\varepsilon>0 there is δ>0\delta>0 such that, for every y∈Dy\in D, ∥y−x∥<δ⇒∥f(y)−f(x)∥<ε.\lVert y-x \rVert<\delta \quad\Longrightarrow\quad \lVert f(y)-f(x) \rVert<\varepsilon. We will continue to use the sequential formulation because it fits our existence argument. In Lecture 4, the same function-limit notation will define derivatives: a difference quotient is evaluated only for h≠0h\neq0, while hh approaches 00.

Here are the rules that let us build continuous functions out of simpler ones.

Theorem 3.3 (Operations preserving continuity). Let D⊆ℝnD\subseteq\mathbb{R}^{n}.

  1. If f,g:D→ℝf,g:D\to\mathbb{R} are continuous and a∈ℝa\in\mathbb{R}, then f+gf+g, afaf, and fgfg are continuous on DD, and the quotient f/gf/g is continuous on the subset of DD on which g≠0g\neq 0.

  2. A composition of continuous functions is continuous.

Its proof is left as an exercise. Part (1) follows from Definition 3.2 applied to an arbitrary sequence xk→xx_k\to x, together with Theorem 1.10; part (2) follows from Definition 3.2 applied twice.

For example, constant functions and the identity function f(x)=xf(x)=x are continuous on ℝ\mathbb{R} by Definition 3.2. Part (1) then makes every polynomial continuous on ℝ\mathbb{R}, and every rational function continuous off the zeros of its denominator, such as (x2+1)/(x−2)(x^2+1)/(x-2) on ℝ\{2}\mathbb{R}\setminus\{2\}. Taking as known that exp\exp is continuous on ℝ\mathbb{R} and log\log on (0,∞)(0,\infty), part (2) gives combinations: e−x2e^{-x^2} is continuous on ℝ\mathbb{R}, and so is log(1+x2)\log(1+x^2), since 1+x21+x^2 stays positive.

3.2 The Weierstrass theorem

We are now ready to show existence. First, let us formalize what a solution to an optimization problem is.

Definition 3.4 (Maximizers and minimizers). Let D⊆ℝnD\subseteq\mathbb{R}^{n} be nonempty and let f:D→ℝf:D\to\mathbb{R}. The set of maximizers of ff on DD is arg maxx∈Df(x)={x*∈D:f(x*)≥f(x) for every x∈D}.\mathop{\mathrm{arg\,max}}_{x\in D}f(x) =\{x^*\in D:f(x^*)\geq f(x)\text{ for every }x\in D\}. The set arg minx∈Df(x)\mathop{\mathrm{arg\,min}}_{x\in D}f(x) of minimizers is defined by reversing the inequality.

The main existence result is the Weierstrass theorem, which we can now state and prove.

Theorem 3.5 (Weierstrass). Let D⊆ℝnD\subseteq\mathbb{R}^{n} be nonempty and compact, and let f:D→ℝf:D\to\mathbb{R} be continuous. Then ff attains a maximum and a minimum on DD; equivalently, arg maxx∈Df(x)≠∅,arg minx∈Df(x)≠∅.\mathop{\mathrm{arg\,max}}_{x\in D}f(x)\neq\emptyset, \qquad \mathop{\mathrm{arg\,min}}_{x\in D}f(x)\neq\emptyset.

Proof (optional). We first prove that ff has a maximizer; the minimizer will follow at the end.

Step 1: show that the attainable values f(D)f(D) are bounded above. Suppose they were not. Then for each kk there would be yk∈Dy_k\in D with f(yk)>kf(y_k)>k. By Definition 2.3, some subsequence satisfies ykj→y∈Dy_{k_j}\to y\in D, and Definition 3.2 gives f(ykj)→f(y)f(y_{k_j})\to f(y). Thus (f(ykj))(f(y_{k_j})) is bounded by part (2) of Theorem 1.9. But kj≥jk_j\geq j, so f(ykj)>kj≥jf(y_{k_j})>k_j\geq j for every jj, making the same sequence unbounded. This contradiction proves that f(D)f(D) is bounded above.

Step 2: construct feasible points whose values approach the best possible value. The set f(D)f(D) is nonempty because DD is nonempty. By Step 1 it is also bounded above, so completeness gives the real number S=supf(D)S=\sup f(D). For each kk, the smaller number S−1/kS-1/k cannot be an upper bound of f(D)f(D). Hence there is xk∈Dx_k\in D with S−1k<f(xk)≤S,that is,|f(xk)−S|<1k.S-\frac1k<f(x_k)\leq S, \qquad\text{that is,}\qquad \lvert f(x_k)-S \rvert<\frac1k. Since 1/k→01/k\to0 by part (1) of Example 1.7, this proves f(xk)→Sf(x_k)\to S. The sequence (xk)(x_k) is called a maximizing sequence.

Step 3: obtain a feasible candidate for the maximizer. Compactness of DD gives a subsequence xkjx_{k_j} and a point x*∈Dx^*\in D such that xkj→x*x_{k_j}\to x^*. The membership x*∈Dx^*\in D is important: the candidate remains feasible.

Step 4: prove that the candidate is a maximizer. Continuity gives f(xkj)→f(x*)f(x_{k_j})\to f(x^*). On the other hand, because f(xk)→Sf(x_k)\to S, its subsequence also satisfies f(xkj)→Sf(x_{k_j})\to S by part (4) of Theorem 1.9. Limits are unique, so f(x*)=Sf(x^*)=S. Since SS is an upper bound of f(D)f(D), we have f(x)≤S=f(x*)f(x)\leq S=f(x^*) for every x∈Dx\in D. Therefore x*x^* is a maximizer in the sense of Definition 3.4.

Step 5: obtain a minimizer. The function −f-f is continuous by part (1) of Theorem 3.3. Applying Steps 1–4 to −f-f gives a point that maximizes −f-f, which is exactly a point that minimizes ff. ◻

Note that failure of any one of the three hypotheses — nonemptiness, compactness, or continuity — can lead to a function that does not attain its maximum or minimum.

Example 3.6 (One failed hypothesis at a time). None of the following problems has a maximizer, and in each one exactly one hypothesis of Theorem 3.5 fails.

  1. In ℝ2\mathbb{R}^2, let f(x)=x1+x2f(x)=x_1+x_2 on D={x∈ℝ2:x1≥0,x2≥0,x1+x2≤1,x1x2≥1}.D=\{x\in\mathbb{R}^2:x_1\geq0,\ x_2\geq0,\ x_1+x_2\leq1,\ x_1x_2\geq1\}. The feasible set DD is empty, so ff has no maximizer.

  2. D=(0,1)D=(0,1) and f(x)=xf(x)=x. The domain is bounded but not closed, since xk=1/(k+1)x_k=1/(k+1) lies in DD and converges to 0∉D0\notin D, so again it is not compact. Here supf(D)=1\sup f(D)=1, while f(x)<1f(x)<1 for every x∈Dx\in D.

  3. D=[0,1]D=[0,1], which is compact, and f(x)={x,0≤x<1,0,x=1.f(x)= \begin{cases} x, & 0\leq x<1,\\ 0, & x=1. \end{cases} What fails is continuity, and only at 11: the sequence xk=1−1/kx_k=1-1/k lies in DD and converges to 11, while f(xk)=1−1/k→1≠0=f(1)f(x_k)=1-1/k\to1\neq0=f(1), which Definition 3.2 forbids. Again supf(D)=1\sup f(D)=1 is not attained.

That said, a maximum might exist even if one of the hypotheses of Theorem 3.5 fails. In that case, one must prove existence by other means, such as by finding a candidate and verifying that it is indeed a maximizer.

3.3 Intermediate values and fixed points

While we need linear algebra to meaningfully study functions in ℝn\mathbb{R}^{n}, we can already prove some useful results about continuous functions in ℝ\mathbb{R}. The intermediate value theorem says that a continuous function on an interval takes on every value between its values at the endpoints.

Theorem 3.7 (Intermediate value theorem). Let f:[a,b]→ℝf:[a,b]\to\mathbb{R} be continuous. If min{f(a),f(b)}≤c≤max{f(a),f(b)},\min\{f(a),f(b)\}\leq c\leq\max\{f(a),f(b)\}, then there is x∈[a,b]x\in[a,b] such that f(x)=cf(x)=c.

Proof (optional). Assume first that f(a)≤c≤f(b)f(a)\leq c\leq f(b), and let A={x∈[a,b]:f(x)≤c}.A=\{x\in[a,b]:f(x)\leq c\}. Then AA contains aa and is bounded above by bb, so s=supAs=\sup A exists by Axiom 2.2 and satisfies a≤s≤ba\leq s\leq b. We show that f(s)=cf(s)=c.

f(s)≤cf(s)\leq c. For each kk, the number s−1/ks-1/k is smaller than ss and therefore not an upper bound of AA, so we may pick ak∈Aa_k\in A with s−1k<ak≤s.s-\frac1k<a_k\leq s. Then ak→sa_k\to s, since 1/k→01/k\to0 by part (1) of Example 1.7, and Definition 3.2 gives f(ak)→f(s)f(a_k)\to f(s). Each aka_k lies in AA, so f(ak)≤cf(a_k)\leq c for every kk, and part (7) of Theorem 1.10 carries the inequality to the limit: f(s)≤cf(s)\leq c.

f(s)≥cf(s)\geq c. If s=bs=b, this is the hypothesis f(b)≥cf(b)\geq c. If s<bs<b, no point of (s,b](s,b] lies in AA, so f(x)>cf(x)>c on (s,b](s,b]. The points xk=s+1/kx_k=s+1/k lie in (s,b](s,b] as soon as 1/k≤b−s1/k\leq b-s, and xk→sx_k\to s, so Definition 3.2 gives f(xk)→f(s)f(x_k)\to f(s). Part (7) of Theorem 1.10 again carries f(xk)>cf(x_k)>c to the limit, giving f(s)≥cf(s)\geq c.

This proves f(s)=cf(s)=c. In the remaining case f(b)≤c≤f(a)f(b)\leq c\leq f(a), apply what we have just proved to −f-f, continuous by part (1) of Theorem 3.3, and to the value −c-c: this produces a point xx with −f(x)=−c-f(x)=-c, that is, f(x)=cf(x)=c. ◻

From that, we obtain our first fixed point theorem in ℝ\mathbb{R} for free.

Theorem 3.8 (Brouwer in ℝ\mathbb{R}). Let a≤ba\leq b. Every continuous function f:[a,b]→[a,b]f:[a,b]\to[a,b] has a fixed point: there is x*∈[a,b]x^*\in[a,b] such that f(x*)=x*f(x^*)=x^*.

Proof. Let g(x)=f(x)−xg(x)=f(x)-x, continuous on [a,b][a,b] by part (1) of Theorem 3.3. Since ff takes its values in [a,b][a,b], we have f(a)≥af(a)\geq a and f(b)≤bf(b)\leq b, so g(a)=f(a)−a≥0,g(b)=f(b)−b≤0.g(a)=f(a)-a\geq0, \qquad g(b)=f(b)-b\leq0. Hence g(b)≤0≤g(a)g(b)\leq0\leq g(a), and Theorem 3.7 applied to gg with c=0c=0 gives x*∈[a,b]x^*\in[a,b] with g(x*)=0g(x^*)=0, which means f(x*)=x*f(x^*)=x^*. ◻