Lectures

Math Camp

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

In economics, we often want to maximize a function subject to constraints: maxxDf(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,ynx,y\in\mathbb{R}^{n},

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

  • the (Euclidean) norm (or length) of xx is x=xx=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)=xy=i=1n(xiyi)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 xx=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)=|xy|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,ynx,y\in\mathbb{R}^{n}, (xy)2(xx)(yy),(x\cdot y)^2\leq(x\cdot x)(y\cdot y), and hence |xy|xy\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 y0y\ne0, so that yy=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, zz=i=1nzi20z \cdot z = \sum_{i=1}^n z_i^2 \geq 0. Hence, we have 0zz=(xλy)(xλy)=xx2λ(xy)+λ2(yy).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 λ=(xy)/(yy)\lambda=(x\cdot y)/(y\cdot y) so that 0xx2(xy)(yy)(xy)+((xy)(yy))2(yy)=xx(xy)2yy.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 yy>0y\cdot y>0 gives the first inequality in Theorem 1.2. Taking square roots gives the second inequality in Theorem 1.2, since (xx)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,ynx,y\in\mathbb{R}^{n} and aa\in\mathbb{R},

  1. x0\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+yx+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+y2=x2+2xy+y2x2+2xy+y2=(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,znx,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 xyx-y; symmetry is part (2) with a=1a=-1; and the triangle inequality is part (3) applied to xz=(xy)+(yz)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 xnx\in\mathbb{R}^{n} and r>0r>0, the open ball with center xx and radius rr is B(x,r)={yn:yx<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 DnD\subseteq\mathbb{R}^{n}.

  • A point xDx\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 ana\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{xa,bx}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 (xr,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 xknx_k\in\mathbb{R}^{n}. It converges to xnx\in\mathbb{R}^{n}, and xx is its limit, written xkxx_k\to x, if for every ε>0\varepsilon>0 there is KK\in\mathbb N such that kKxkx<ε.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 kKk\geq K satisfies |xk0|=1k1K<ε,\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, xk0x_k\to0.

  2. The sequence xk=(1)kx_k=(-1)^k diverges. Let xx\in\mathbb{R} be a candidate limit and take ε=1\varepsilon=1. By part (3) of Theorem 1.3, |1x|+|1x||(1x)(1x)|=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 KK\in\mathbb N admits some kKk\geq K with |xkx|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 xkxx_k\to x and xkyx_k\to y, then x=yx=y.

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

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

  4. If xkxx_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 xkx<ε/2\lVert x_k-x \rVert<\varepsilon/2 for kK1k\geq K_1, and K2K_2 with xky<ε/2\lVert x_k-y \rVert<\varepsilon/2 for kK2k\geq K_2. Fix one kmax{K1,K2}k\geq\max\{K_1,K_2\} and write xy=(xxk)+(xky)x-y=(x-x_k)+(x_k-y); parts (2) and (3) of Theorem 1.3 give xyxkx+xky<ε.\lVert x-y \rVert\leq\lVert x_k-x \rVert+\lVert x_k-y \rVert<\varepsilon. So the nonnegative number xy\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,jxja_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,ixi|xkxj=1n|xk,jxj|.\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 xkxx_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,jxj|<ε/n\lvert x_{k,j}-x_j \rvert<\varepsilon/n; then kmax{K1,,Kn}k\geq\max\{K_1,\ldots,K_n\} makes the right-hand sum, and hence xkx\lVert x_k-x \rVert, smaller than ε\varepsilon.

Subsequences. The indices of a subsequence satisfy kjjk_j\geq j: this holds at j=1j=1 because indices are natural numbers, and kj+1>kjjk_{j+1}>k_j\geq j forces kj+1j+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 jKj\geq K has kjjKk_j\geq j\geq K, and therefore xkjx<ε\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 xkxx_k\to x and ykyy_k\to y in n\mathbb{R}^{n}, and akaa_k\to a and bkbb_k\to b in \mathbb{R}. Then

  1. xk+ykx+yx_k+y_k\to x+y,

  2. akxkaxa_kx_k\to ax,

  3. akbkaba_kb_k\to ab,

  4. xkykxyx_k\cdot y_k\to x\cdot y,

  5. xkx\lVert x_k \rVert\to\lVert x \rVert,

  6. ak/bka/ba_k/b_k\to a/b, provided b0b\neq0 and bk0b_k\neq0 for every kk,

  7. xyx\geq y, provided xkykx_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 |xkx|xkx\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 AA\subseteq\mathbb{R} be nonempty.

  • A number uu is an upper bound of AA if aufor every aA,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 sufor 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 zAandaz for every aA.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 existssupA exists and supAA,\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 DnD\subseteq\mathbb{R}^{n} is

  • closed if xkDx_k\in D and xkxx_k\to x imply xDx\in D;

  • bounded if there is M>0M>0 such that xM\lVert x \rVert\leq M for every xDx\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 DnD\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 DnD\subseteq\mathbb{R}^{n}, let f:Dmf:D\to\mathbb{R}^m, let aa be a limit point of DD, and let LmL\in\mathbb{R}^m. We write limxaf(x)=L\lim_{x\to a}f(x)=L if, for every sequence (xk)(x_k) in D\{a}D\setminus\{a\} such that xkax_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 xD,0<xa<δf(x)L<ε.x\in D,\quad 0<\lVert x-a \rVert<\delta \quad\Longrightarrow\quad \lVert f(x)-L \rVert<\varepsilon.

The restriction xax\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 h0h\neq0, then Theorem 1.10 gives limh0q(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 limxaf(x)=Landlimxaf(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 DnD\subseteq\mathbb{R}^{n}, let f:Dmf:D\to\mathbb{R}^m, and let xDx\in D. The function ff is continuous at xx if, whenever xkDx_k\in D and xkxx_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 xDx\in D, Definition 3.2 is equivalent to limyxf(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 yDy\in D, yx<δ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 h0h\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 DnD\subseteq\mathbb{R}^{n}.

  1. If f,g:Df,g:D\to\mathbb{R} are continuous and aa\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 g0g\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 xkxx_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)/(x2)(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: ex2e^{-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 DnD\subseteq\mathbb{R}^{n} be nonempty and let f:Df:D\to\mathbb{R}. The set of maximizers of ff on DD is arg maxxDf(x)={x*D:f(x*)f(x) for every xD}.\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 minxDf(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 DnD\subseteq\mathbb{R}^{n} be nonempty and compact, and let f:Df:D\to\mathbb{R} be continuous. Then ff attains a maximum and a minimum on DD; equivalently, arg maxxDf(x),arg minxDf(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 ykDy_k\in D with f(yk)>kf(y_k)>k. By Definition 2.3, some subsequence satisfies ykjyDy_{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 kjjk_j\geq j, so f(ykj)>kjjf(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 S1/kS-1/k cannot be an upper bound of f(D)f(D). Hence there is xkDx_k\in D with S1k<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/k01/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 xkjx*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 xDx\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={x2:x10,x20,x1+x21,x1x21}.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 0D0\notin D, so again it is not compact. Here supf(D)=1\sup f(D)=1, while f(x)<1f(x)<1 for every xDx\in D.

  3. D=[0,1]D=[0,1], which is compact, and f(x)={x,0x<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=11/kx_k=1-1/k lies in DD and converges to 11, while f(xk)=11/k10=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)}cmax{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)cf(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 asba\leq s\leq b. We show that f(s)=cf(s)=c.

f(s)cf(s)\leq c. For each kk, the number s1/ks-1/k is smaller than ss and therefore not an upper bound of AA, so we may pick akAa_k\in A with s1k<aks.s-\frac1k<a_k\leq s. Then aksa_k\to s, since 1/k01/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/kbs1/k\leq b-s, and xksx_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)cf(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 aba\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)a0,g(b)=f(b)b0.g(a)=f(a)-a\geq0, \qquad g(b)=f(b)-b\leq0. Hence g(b)0g(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^*. ◻