2. Functions, Cardinality and Distance

2.1 Functions

2.1.1 Elementary Conventions

Definition 2.1 (Function): Let AA and BB be two sets. A function f:ABf : A \to B is a rule which assigns to each element aAa \in A exactly one element f(a)Bf(a) \in B.
Definition 2.2 (Image, Preimage): Let f:ABf : A \to B be a function. We define the following sets: Image: The image of ff under CAC \subset A is the set

f(C) = \qty{f(a) : a \in C}

.
Preimage: The preimage of ff under DD is the set

f^{-1}(D) = \qty{a : f(a) \in D}

.
Example (Image): Let f:RRf: \R \to \R, f(x)=x2f(x) = x^2. We have that f(R)=[0,)f(\mathbb{R}) = [0, \infty). To see it, it is clear that f(R)[0,)f(\R) \subset [0, \infty). For the other inclusion, take any y[0,)y \in [0,\infty). If we set x=yx = \sqrt{y}, then x2=yx^2 = y. Thus, yf(R)y \in f(\R) and [0,)f(R)[0, \infty) \subset f(\R).
Example (Vector valued function): A function f:ARkf : A \to \R^k assigns to each element aAa \in A a vector f(a)Rkf(a) \in \mathbb{R}^{k}. We use the notation

f(a) = \qty(f_1(a), \ldots, f_k(a))

for the value of ff at aa, where fi(a)f_i(a), i=1,,ki = 1, \ldots, k, are referred to as the coordinate functions of ff.

To indicate that an element aa is assigned to an element f(a)f(a) we often use the notation af(a)a \mapsto f(a) to define the assignment, i.e. the function. The following definition clarifies some notation for algebraic operations on functions.

Definition 2.3 (Sum, product, quotient): Let f,g:ARf,g : A \to \R be two real-valued functions. Sum: f+gf + g is the function a(f+g)(a)=f(a)+g(a)a \mapsto (f+g)(a) = f(a) + g(a). Product: fgfg is the function a(fg)(a)=f(a)g(a)a \mapsto (fg)(a) = f(a)g(a). Quotient: If g(a)0g(a) \neq 0 aA\forall a \in A, then f/gf/g is the function a(f/g)(a)=f(a)/g(a)a \mapsto (f/g)(a) = f(a) / g(a).

If a function takes values in the extended real numbers, we rely on the following definition regarding the infimum and supremum of the image.

Definition 2.4 (Infimum and supremum of image): Let f:ARf: A \to \overline{\R} be a function and EAE \subset A. For the image f(E)f(E) we use the notation

\inf f(E) = \inf \qty{f(e) : e \in E} = \inf_{e \in E} f(e)

and

\sup f(E) = \sup \qty{f(e) : e \in E} = \sup_{e \in E} f(e)

.

2.1.2 Invertible Mappings

Definition 2.5 (Surjective, injective, bijective): Let f:ABf: A \to B be a function. Surjective: ff is called surjective, if f(A)=Bf(A) = B. Injective: ff is called injective, if aa2    f(a1)f(a2)a \neq a_2 \implies f(a_1) \neq f(a_2). Bijective: ff is called bijective if it is surjective and injective.
Example (Surjection): Let f:R[0,)f : \R \to [0, \infty), f(x)=x2f(x) = x^2. We already know that ff is surjective. However, it is not injective, since for x1=1x_1 = -1 and x2=1x_2 = 1, f(x1)=f(x2)=1f(x_1) = f(x_2) = 1. This shows that xx2x \mapsto x^2 is not bijective.
Definition 2.6 (Restriction): Let f:ABf: A \to B be a function and EAE \subset A. The restriction of ff to EE is the function fE:EBf \vert_E : E \to B given by fE(a)=f(a)f \vert_E (a) = f(a) for any aEa \in E.
Example (Restriction): The function f:R[0,)f : \R \to [0, \infty), f(x)=x2f(x) = x^2 is not bijective. However, its restriction to [0,)[0, \infty) is.
Definition 2.7 (Composition): Let f:ABf: A \to B and g:BCg: B \to C be two functions. The composition gfg \circ f or g(f)g(f) is defined pointwise, i.e. (gf)(a)=g(f)(a)=g(f(a))(g \circ f)(a) = g(f)(a) = g(f(a)). Thus, gf:ACg \circ f: A \to C.
Definition 2.8 (Inverse): Let f:ABf : A \to B be a function. A function g:BAg: B \to A is called an inverse of ff if g(f(a))=ag(f(a)) = a aA\forall a \in A and f(g(b))=bf(g(b)) = b bB\forall b \in B. If ff has an inverse it is called invertible.

A characterization of invertible functions is given by the notions of surjectivity and injectivity. This is summarized in the following result.

Proposition 2.9 (Invertible iff bijection): Let f:ABf: A \to B be a function. Then ff is bijective if and only if it is invertible.
Example (Exponential function): Let f(x)=exf(x) = e^x, xRx \in \R, i.e. ff is the natural exponential function. One can show that f:R(0,)f : \R \to (0, \infty) is bijective where the inverse is given by the natural logarithm log(y):(0,)R\log(y) : (0,\infty) \to \R.
Example (Trigonometric functions): The trigonometric functions sin:RR\sin : \R \to \R and cos:RR\cos : \R \to \R are clearly not bijective. However, sin[π/2,π/2]:[π/2,π/2][1,1]\sin \vert_{[-\pi/2, \pi/2]} : [-\pi/2, \pi/2] \to [-1,1] and cos[0,π]:[0,π][1,1]\cos \vert_{[0,\pi]} : [0, \pi] \to [-1,1] are bijective with inverse arcsin:[1,1][π/2,π/2]\arcsin: [-1,1] \to [-\pi/2, \pi/2] and arccos:[1,1][0,π]\arccos : [-1, 1] \to [0, \pi], respectively. As a further example, the cotangent cot:(0,π)R\cot: (0, \pi) \to \R, cot(θ)=cos(θ)sin(θ)\cot(\theta) = \frac{\cos(\theta)}{\sin(\theta)}, is bijective with inverse

\arccot: \R \to (0, \pi)

.

2.1.3 Set Operations for Image and Preimage

Proposition 2.10 (Set operations for image and preimage): Let f:ABf: A \to B be a function. Let BBB_{*} \subset B. Then f1(Bc)=f1(B)cf^{-1}(B_{*}^c) = f^{-1}(B_{*})^c. Let II and JJ be some sets and AiAA_i \subset A, iIi \in I, and BjBB_j \subset B, jJj \in J, be collections of sets from AA and BB respectively. Then
  1. f(iIAi)=iIf(Ai)f(\bigcup_{i \in I} A_i) = \bigcup_{i \in I} f(A_i)
  2. f1(jJBj)=jJf1(Bj)f^{-1}(\bigcup_{j \in J} B_j) = \bigcup_{j \in J} f^{-1}(B_j)
  3. f1(jJBj)=jJf1(Bj)f^{-1}(\bigcap_{j \in J} B_j) = \bigcap_{j \in J} f^{-1}(B_j)

2.1.4 Polar Coordinate Representation

Introduce the set

U = \qty{(\rho, \theta) \in \R^2 : \rho > 0, 0<\theta<2\pi} = (0,\infty) \times (0,2\pi)

. Define the function T(ρ,θ)=(ρcos(θ),ρsin(θ))T(\rho, \theta) = (\rho \cos(\theta), \rho \sin(\theta)), (ρ,θ)U(\rho, \theta) \in U. Clearly, T(U)R2T(U) \subset \R^2. The identification x=ρcos(θ)x = \rho \cos(\theta) and y=ρsin(θ)y = \rho \sin(\theta) is known as a polar coordinate representation of the point (x,y)R2(x,y) \in \R^2. Define V=R2 ([0,)×0)V = R^2 \ ([0,\infty) \times {0}).

Proposition 2.11 (Bijection of polar coordinates): The mapping T:UVT: U \to V is bijective.

Notice that for any point s=(x,0)s = (x,0), x0x \geq 0, sT(U)s \notin T(U). In particular, T:UR2T: U \to \R^2 can not be bijective.

2.1.5 Monotonic Function

Definition 2.12 (Increasing, decreasing, monotonic): Let f:IRf: I \to \R, IRI \subset \R be a function. Increasing, decreasing: ff is called increasing, resp. decreasing, if x1x2    f(x1)f(x2)x_1 \leq x_2 \implies f(x_1) \leq f(x_2), resp. x1x2    f(x1)f(x2)x_1 \leq x_2 \implies f(x_1) \geq f(x_2). Strictly increasing, decreasing: ff is called strictly increasing, resp. strictly decreasing, if x1<x2    f(x1)<f(x2)x_1 < x_2 \implies f(x_1) < f(x_2), resp. x1<x2    f(x1)>f(x2)x_1 < x_2 \implies f(x_1) > f(x_2). Monotonic: ff is called monotonic, resp. strictly monotonic, if it is either increasing or decreasing, resp. strictly increasing or decreasing.
Proposition 2.13 (Strict monotonicity and inverse): Let f:IRf : I \to \R, IRI \subset \R be a strictly monotonic function. Then, f:If(I)f: I \to f(I) is a bijection. Further, if ff is strictly increasing, resp. strictly decreasing, on II, then an inverse of ff is strictly increasing, resp. strictly decreasing, on f(I)f(I).
Example (Strict monotonicity and inverse): Let f:[0,)[0,)f:[0,\infty) \to [0,\infty), f(x)=x2f(x) = x^2. We know that f([0,))=[0,)f([0,\infty)) = [0,\infty). Further, if x1<x2x_1 < x_2, then f(x1)<x12<x22=f(x2)f(x_1) < x_1^2 < x_2^2 = f(x_2). Thus, ff is strictly increasing and therefore we know that ff has an inverse f1:[0,)[0,)f^{-1}:[0,\infty) \to [0,\infty) which is also strictly increasing. In this case, we know that f1(y)=yf^{-1}(y) = \sqrt{y} is the unique inverse of ff, since y=x2y = x^2 has only one non-negative solution.
Proposition 2.14 (Monotonicity and derivatives): Let a,bRa,b \in \R and f:(a,b)Rf: (a,b) \to \R be a function that is differentiable on (a,b)(a,b). That is, the derivative ff' of ff exists on (a,b)(a,b). Then:
  • f(x)0f'(x) \geq 0 x(a,b)\forall x \in (a,b) implies f(a,b)f \vert_{(a,b)} is increasing
  • f(x)>0f'(x) \gt 0 x(a,b)\forall x \in (a,b) implies f(a,b)f \vert_{(a,b)} is strictly increasing
  • f(x)0f'(x) \leq 0 x(a,b)\forall x \in (a,b) implies f(a,b)f \vert_{(a,b)} is decreasing
  • f(x)<0f'(x) \lt 0 x(a,b)\forall x \in (a,b) implies f(a,b)f \vert_{(a,b)} is strictly decreasing

2.2 Cardinality of Sets

2.2.1 Cardinality

Definition 2.15 (Finite and infinte sets): Let AA be a set. AA is said to be finite if it contains a finite number of elements. Otherwise, if the number of elements AA is not finite, AA is referred to as infinite.
Example (Infinite sets): The sets N\N, Z\Z, Q\Q, R\R and C\C are all infinite.
Definition 2.16 (Cardinality equality): Let AA and BB be two arbitrary sets. AA and BB are said to have the same cardinality, #A=#B\# A = \# B, if and only if there exists a bijection f:ABf: A \to B.
Example (Cardinality of finite sets): If AA and BB are finite, then #A=#B\# A = \# B precisely means that AA and BB have the same number of elements. In particular #=0\# \varnothing = 0.
Definition 2.17 (Cardinality order): Let AA and BB be two sets and CBC \subset B. If there exists a bijection g:ACg: A \to C we write #A#B\# A \leq \# B. If there exists a bijection g:ACg: A \to C but no bijection f:ABf : A \to B, we write #A<#B\# A < \# B.
Example (Cardinality of subsets): Let AA and BB with ABA \subset B, then #A#B\# A \leq \# B. This is because the identity map g:AAg: A \to A, g(a)=ag(a) = a, is a bijection.
Proposition 2.18 (Cardinality relations): We have that #N=#Z=#Q\#\N = \#\Z = \#\Q, #R>#N\#\R > \#\N and that any interval IRI \subset \R is s.t. #I>#N\# I > \#\N.

2.2.2 Countability

Definition 2.19 (Countable and uncountable sets): Let AA be a set. If #A#N\#A \leq \#\N, then AA is countable, otherwise it is uncountable.
Proposition 2.20 (Countably infinite sets): Let AA be a set. If AA is countable but not finite, then #A=#N\# A = \#\N and AA is said to be countably infinite.

2.2.3 Cardinality of Set Operations

Proposition 2.21 (Union of countable sets): Let

\qty{A_i : i \in \N }

be a collection of sets s.t. for any iNi \in \N, AiA_i is countable. Then the union iNAi\bigcup_{i \in \N} A_i is countable as well.
Proposition 2.22 (Cartesian product of countable sets): Let AiA_i, i=1,,ni = 1, \ldots, n, be countable sets. Then, their Cartesian product i=1nAi\bigtimes_{i=1}^n A_i is countable.

2.2.4 Heine-Borel Theorem

Theorem 2.23 (Heine-Borel theorem for intervals): Let [a,b][a,b], a,bRa,b \in R, a<ba < b, be any closed interval. Let II be some countable set and assume that there exists a family of open intervals (ai,bi)(a_i, b_i), ai,biRa_i, b_i \in \R, iIi \in I, s.t. [a,b]iI(ai,bi)[a,b] \subset \bigcup_{i \in I} (a_i, b_i). Then, there exists NNN \in \N and i1,,iNIi_1, \ldots, i_N \in I s.t. [a,b]j=1N(aij,bij)[a,b] \subset \bigcup_{j=1}^N (a_{i_j}, b_{i_j}).

The latter result shows that any closed interval on the real line which is covered by a countable collection of open intervals can be covered by a finite sub-collection.

2.3 Open and Closed Sets in Real Coordinate Spaces

2.3.1 Euclidean Norm

Definition 2.24 (Euclidean norm): Let xRk\vb{x} \in \R^k, x=(x1,,xk)\vb{x} = (x_1, \ldots, x_k). The Euclidean norm of x\vb{x} is given by x=x12++xk2\norm{\vb{x}} = \sqrt{x_1^2 + \ldots + x_k^2}.

xy\norm{ \vb{x} - \vb{y} } gives the Euclidean distance between two points x,yRk\vb{x}, \vb{y} \in \mathbb{R}^k.

Example (Euclidean norm in one dimension): If k=1k = 1, then we write x=x\norm{x} = \abs{x}, where the function xxx \mapsto \abs{x} maps xRx \in \mathbb{R} to its absolute value x2=x[0,)\sqrt{x^2} = \abs{x} \in [0, \infty).

For the next proposition, we use the notation 0\vb{0} for the vector in Rk\mathbb{R}^k, kNk \in \N, with all of its coordinates equal to zero.

Proposition 2.25 (Properties of the Euclidean norm): For any x,yRk\vb{x}, \vb{y} \in \R^k, the Euclidean norm satisfies:
  1. x0\norm{\vb{x}} \geq 0
  2. x=0    x=0\norm{\vb{x}} = 0 \iff \vb{x} = \vb{0}
  3. λx=λx\norm{\lambda \vb{x}} = \lambda \norm{\vb{x}} for any λR\lambda \in \R
  4. xy=yx\norm{\vb{x} - \vb{y}} = \norm{\vb{y} - \vb{x}}
  5. x+yx+y\norm{\vb{x} + \vb{y}} \leq \norm{\vb{x}} + \norm{\vb{y}}, the triangular inequality
  6. xyxy\norm{\vb{x} - \vb{y}} \geq \abs{\norm{\vb{x}} - \norm{\vb{y}}}, the reverse triangular inequality

2.3.2 Open and Closed Balls and Boundedness

Definition 2.26 (Open and closed balls): The open, resp. closed, ball of radius r>0r > 0 with center yRk\vb{y} \in \R^k is

B_r(\vb{y}) = \qty{\vb{x} \in \R^k : \norm{\vb{y} - \vb{x}} < r}

,
resp.

B_r[\vb{y}] = \qty{\vb{x} \in \R^k : \norm{\vb{y} - \vb{x}} \leq r}

.
Definition 2.27 (Open set): A set URkU \subset \R^k is called open if for any point xU\vb{x} \in U there exists an ε>0\epsilon > 0 s.t. Bε(x)UB_{\epsilon}(\vb{x}) \subset U.
Example (Intersection of open sets is open): Let U1U_1, U2U_2 be two open subsets of Rk\R^k. By definition, for an arbitrary xU1U2x \in U_1 \cap U_2 there exist Bε1(x)B_{\epsilon_1}(\vb{x}) and Bε2(x)B_{\epsilon_2}(\vb{x}) s.t. Bε1(x)U1B_{\epsilon_1}(\vb{x}) \subset U_1 and Bε2(x)B_{\epsilon_2}(\vb{x}). Set

\epsilon = \min\qty{\epsilon_1, \epsilon_2}

and we obtain Bε(x)U1U2B_{\epsilon}(\vb{x}) \subset U_1 \cap U_2. Hence, U1U2U_1 \cap U_2 is open.
Example (Open interval is an open set): Let a,bRa,b \in \R, a<ba < b s.t. (a,b)(a,b) is an open interval. Let x(a,b)x \in (a,b). Note that xa=xa\abs{x-a} = x-a and xb=bx\abs{x-b} = b-x. Let

\epsilon < \min\qty{x-a, b-x}

and take any y(xε,x+ε)=Bε(x)y \in (x-\epsilon, x+\epsilon) = B_{\epsilon}(x). We have xy<ε\abs{x-y} < \epsilon and thus xyxy<ε<xax-y \leq \abs{x-y} < \epsilon < x-a and yxxy<ε<bxy-x \leq \abs{x-y} < \epsilon < b-x. Hence a<y<ba < y < b and y(a,b)y \in (a,b) and Bε(x)(a,b)B_{\epsilon}(x) \subset (a,b).
Example (Open ball is an open set): Let Br(y)RkB_r(\vb{y}) \subset \R^k and xBr(y)\vb{x} \in B_r(\vb{y}) be an arbitrary point. Set δ=xy\delta = \norm{\vb{x} - \vb{y}}. By definition of Br(y)B_r(\vb{y}) we have δ<r\delta < r. Let ε=rδ\epsilon = r-\delta. For any zBε(x)\vb{z} \in B_{\epsilon}(\vb{x}) we have by the triangle inequality zyzx+xy<ε+δ=r\norm{ \vb{z} - \vb{y} } \leq \norm{ \vb{z} - \vb{x} } + \norm{ \vb{x} - \vb{y} } < \epsilon + \delta = r. Hence Bε(x)Br(y)B_{\epsilon}(\vb{x}) \subset B_r(\vb{y}).
Definition 2.28 (Closed set): A set VRkV \subset \R^k is said to be closed if VcV^c is open.
Definition 2.29 (Bounded set): A set ARkA \subset \R^k is said to be bounded if there exists an r>0r>0 and yA\vb{y} \in A s.t. ABr[y]A \subset B_r[\vb{y}].
Definition 2.30 (Bounded function): Let f:ARf: A \to \overline{\R} and EAE \subset A. THe function ff is said to be bounded on EE if thre exists a 0M<0 \leq M < \infty s.t. f(a)M\abs{f(a)} \leq M for any aEa \in E.

2.3.3 Open Set Characterization of Continuity

Continuous functions on Euclidean spaces are characterized in terms of open sets.

Definition 2.31 (Continuous function on Euclidean spaces): A function f:RmRkf: \R^m \to \R^k is continuous if for any open set URkU \subset \R^k the preimage f1(U)f^{-1}(U) is open in Rm\R^m.
Example (Continuity of the identity function): Let f:RRf : \R \to \R, f(x)=xf(x) = x. Take any open set URU \subset \R. Then f1(U)=Uf^{-1}(U) = U. Hence, f1(U)f^{-1}(U) is an open subset of R\R and ff is continuous.

In terms of functions defined on subsets of Euclidean spaces Rm\R^m, continuity is characterized as follows.

Proposition 2.32 (Generalized notion of continuity): Let ERmE \subset \R^m, EE \neq \varnothing. A function f:ERkf : E \to \R^k is continuous iff for any open set URkU \subset \R^k we have

f^{-1}(U) \in \qty{G \cap E : G \text{ open in } \R^m}

.

Another characterization of continuity, known as the sequence criterion for continuous functions, will be introduced in the next chapter.