1.2. Functions
此篇笔记是【实分析笔记】系列的第2篇,记录了如何用“一石一鸟”的比喻来理解函数的严格定义和根据其定义域(Domain)与取值范围(Codomain)的关联方式所区分的三类映射,即满射 (Surjection or onto)、单射(Injection or one-to-one)和双射(Bijection) ;以及函数的像(Image)和原像(Pre-Image) 的相关性质及其证明。
1. Functions are not just Formulas
A function $f$ as a formula or a rule that enables us to compute the function value $f(x)$ given any specific value for $x$.
函数 $f$ 可以被理解为一种公式或规则,它使我们能够根据 $x$ 的具体值计算出函数值
For example, if we have the formula $f(x) = x^2 + 3$,
例如,如果我们有公式
-
we can compute $f(5)$ by taking $5^2$ and adding 3.
我们可以通过计算 $5^2$ 然后加上 3 来求出 $f(5)$。 -
Thus the real number 5 is made to correspond to the real number 28,
因此,实数 5 对应于实数 28, \(f(5) = 5^2 + 3 = 28\) and the function $f$ is seen to establish a correspondence between real numbers and certain other real numbers.
并且函数 $f$ 被看作在实数与某些其他实数之间建立了一种对应关系。
Thinking of a function in this way as a formula is helpful in many contexts,
以这种方式将函数理解为一个公式在许多情况下是有帮助的,
- but it is inadequate for some of the things we wish to do in analysis.
但对于我们在分析中想要完成的某些事情来说,这种方式是不够的。
In searching for a more general understanding of a function, we need to hold on to the idea of a correspondence between sets,
在寻找对函数更普遍的理解时,我们需要坚持集合之间对应的概念,
- but not require that it be described by a formula.
但并不要求这种对应必须由公式描述。
What is important is that a given element in the first set cannot correspond to two different elements in the second set.
重要的是,第一集合中的某个元素不能对应于第二集合中的两个不同元素。
- Thus we see that a function is a special kind of relation.
因此,我们看到函数是一种特殊的关系。 - We make this precise in the following definition.
我们在以下定义中对其进行了准确描述。
Definition
Let $A$ and $B$ be sets.
设 $A$ 和 $B$ 为集合。
A function from $A$ to $B$ is a nonempty relation $f \subseteq A \times B$ that satisfies the following two conditions:
从 $A$ 到 $B$ 的一个函数是一个非空关系 $f \subseteq A \times B$,满足以下两个条件:
-
Existence: For all $a$ in $A$, there exists a $b$ in $B$ such that $(a, b) \in f$.
存在性:对于 $A$ 中的所有 $a$,在 $B$ 中存在一个 $b$,使得 $(a, b) \in f$。 -
Uniqueness: If $(a, b) \in f$ and $(a, c) \in f$, then $b = c$.
唯一性:如果 $(a, b) \in f$ 且 $(a, c) \in f$,则 $b = c$。
- That is, given any element $a$ in $A$, there is one and only one element $b$ in $B$ such that $(a, b) \in f$.
即,对于 $A$ 中的任一元素 $a$,在 $B$ 中存在唯一的一个对应元素 $b$,使得 $(a, b) \in f$。
The Analogy of Stones and Birds
If we think of elements in $A$ as stones and elements in $B$ as birds, a function from $A$ to $B$ can be understood as a rule for throwing stones to hit birds.
如果我们将 $A$ 中的元素类比为石头,将 $B$ 中的元素类比为鸟,那么从 $A$ 到 $B$ 的函数可以理解为一种将石头击中鸟的规则。
-
Existence: Every stone in $A$ must hit one bird in $B$.
存在性:$A$ 中的每块石头必须击中 $B$ 中一只鸟。 -
Uniqueness: No stone in $A$ can hit more than one bird in $B$.
唯一性:$A$ 中的任何一块石头都不能同时击中 $B$ 中的多只鸟。
-
This ensures that every stone (element in $A$) has one and only one bird (element in $B$) it hits.
这确保了 $A$ 中的每块石头都只有且仅有$B$ 中的一只鸟(元素)被它击中。 -
However, multiple stones in $A$ can hit the same bird in $B$.
然而,$A$ 中的多块石头可以击中 $B$ 中的同一只鸟。
Some Terminology
Set $A$ is called the domain of $f$ and is denoted by $\text{dom } f$.
集合 $A$ 被称为 $f$ 的定义域,记为 $\text{dom } f$。
Set $B$ is referred to as the codomain of $f$.
集合 $B$ 被称为 $f$ 的取值空间。
- We may write $f: A \to B$ to indicate $f$ has domain $A$ and codomain $B$.
我们可以写作 $f: A \to B$ 来表示 $f$ 的定义域为 $A$,取值空间为 $B$。
The range of $f$, denoted $\text{rng } f$, is the set of all second elements of members of $f$. That is,
$f$ 的值域(实际值域),记为 $\text{rng } f$,是 $f$ 中所有成员的第二个元素的集合。 即:
If $(x, y)$ is a member of $f$, we often say that $f$ maps $x$ onto $y$ or that $y$ is the image of $x$ under $f$.
如果 $(x, y)$ 是 $f$ 的成员,我们通常说 $f$ 将 $x$ 映射到 $y$,或者 $y$ 是在 $f$ 下 $x$ 的映像。
-
It is also customary to write $y = f(x)$ instead of $(x, y) \in f$.
通常我们写作 $y = f(x)$ 而不是 $(x, y) \in f$。 -
This agrees with the familiar usage when $f$ is described by a formula, but also applies in more general settings.
当 $f$ 用公式描述时,这与常见用法一致,但也适用于更一般的情形。
Functions vs Ordered Pairs
We should note that the notation $f: A \to B$ is slightly more restrictive than the ordered pair definition because it specifies a particular codomain.
需要注意的是,符号 $f: A \to B$ 比有序对定义稍微严格一些,因为它指定了一个特定的取值范围。
- This subtle difference between the ordered pair definition and the $f: A \to B$ notation will be significant,
有序对定义与符号 $f: A \to B$ 之间的这种微妙差别将具有重要意义,
Example
We want to consider the functions
比如,以下两个函数:
\(f: \mathbb{R} \to \mathbb{R} \quad \text{such that } f(x) = x^2\)
\(g: \mathbb{R} \to [0, \infty) \quad \text{such that } g(x) = x^2\)
to be different functions (with different properties) even though their ordered pairs are identical.
即使它们的有序对相同,我们仍然认为它们是不同的函数(具有不同的性质)。
2. Surjective, Injective and Bijective Functions
Definition
A function $f: A \to B$ is called surjective (or is said to map $A$ onto $B$) if $B = \text{rng } f$.
如果 $f: A \to B$ 满足 $B = \text{rng } f$,则称其为满射(或称 $f$ 将 $A$ 映射到 $B$)。
- A surjective function is also referred to as a surjection.
满射函数也被称为满射映射。 - In Stones-and-Birds Analogy, surjectivity means there are no birds left untouched
在石头和鸟的比喻中,满射意味着没有任何鸟未被击中- every bird in $B$ must be hit by one or more stones from $A$.
$B$ 中的每只鸟都必须由 $A$ 中的一块或多块石头击中。
- every bird in $B$ must be hit by one or more stones from $A$.
A function $f: A \to B$ is called injective (or one-to-one) if, for all $a$ and $a’$ in $A$, $f(a) = f(a’)$ implies that $a = a’$.
如果对于 $A$ 中的任意 $a$ 和 $a’$,$f(a) = f(a’)$ 蕴涵 $a = a’$,则称 $f: A \to B$ 为单射(或一一对应)。
- An injective function is also referred to as an injection.
单射函数也被称为单射映射。 - In Stones-and-Birds Analogy, injectivity ensures no two stones share a bird
在石头和鸟的比喻中,单射意味着没有两块石头击中同一只鸟- each bird in $B$ is hit by at most one stone from $A$.
$B$ 中的每只鸟最多只被 $A$ 中的一块石头击中。
- each bird in $B$ is hit by at most one stone from $A$.
A function $f: A \to B$ is called bijective or a bijection if it is both surjective and injective.
如果 $f: A \to B$ 既是满射又是单射,则称其为双射或双射映射。
- In Stones-and-Birds Analogy, bijectivity ensures that every bird in $B$ is hit by exactly one stone in $A$
在石头和鸟的比喻中,双射意味着$B$ 中的每只鸟恰好被 $A$ 中的一块石头击中- no bird is left untouched,
没有鸟未被击中, - and no bird is hit by more than one stone.
也没有鸟被多块石头击中。
- no bird is left untouched,
Example
Consider the function given by the formula:
考虑函数
-
If we take $\mathbb{R}$ for both the domain and codomain so that $f: \mathbb{R} \to \mathbb{R}$,
如果我们将定义域和值域都取为 $\mathbb{R}$,使得 $f: \mathbb{R} \to \mathbb{R}$,- then $f$ is not surjective because there is no real number that maps onto $-1$.
则 $f$ 不是满射,因为没有任何实数可以映射到 $-1$。
- then $f$ is not surjective because there is no real number that maps onto $-1$.
-
If we limit the codomain to be the set $[0, \infty)$, then the function $g: \mathbb{R} \to [0, \infty)$ such that $g(x) = x^2$ is surjective.
如果将值域限制为集合 $[0, \infty)$,那么函数 $g: \mathbb{R} \to [0, \infty)$,定义为 $g(x) = x^2$,就是满射。- Since $g(-2) = g(2)$, we see that $g$ is not injective when defined on all of $\mathbb{R}$.
由于 $g(-2) = g(2)$,可以看出当定义域为整个 $\mathbb{R}$ 时,$g$ 不是单射。 - But restricting $g$ to be defined only on $[0, \infty)$, it becomes injective.
但将 $g$ 的定义域限制为 $[0, \infty)$ 时,它变为单射。 - Thus $h: [0, \infty) \to [0, \infty)$ such that $h(x) = x^2$ is bijective.
因此,函数 $h: [0, \infty) \to [0, \infty)$,定义为 $h(x) = x^2$,是双射。
- Since $g(-2) = g(2)$, we see that $g$ is not injective when defined on all of $\mathbb{R}$.
3. Image and Pre-Image
When thinking of a function as transforming its domain into its range, we may wish to consider what happens to certain subsets of the domain.
当我们将一个函数看作将其定义域映射到其值域时,我们可能希望考虑定义域中某些子集会发生什么变化。
- Or we may wish to identify the set of all points in the domain that are mapped into a particular subset of the range.
或者我们可能希望确定定义域中被映射到值域中特定子集的所有点的集合。
To do this we use the following notation: 为此,我们使用以下符号表示法:
Notation
Suppose that $f: A \to B$.
假设 $f: A \to B$。
- If $C \subseteq A$, we let $f(C)$ represent the subset ${f(x): x \in C}$ of codomain $B$.
如果 $C \subseteq A$,我们用 $f(C)$ 表示取值范围 $B$ 中的子集
\(f(C) = \{f(x): x \in C\}\)- The set $f(C)$ is called the image of $C$ in $B$.
集合 $f(C)$ 称为 $C$ 在 $B$ 中的像。
- The set $f(C)$ is called the image of $C$ in $B$.
- If $D \subseteq B$, we let $f^{-1}(D)$ represent the subset ${x \in A: f(x) \in D}$ of domain $A$.
如果 $D \subseteq B$,我们用 $f^{-1}(D)$ 表示定义域 $A$ 中的子集 \(f^{-1}(D) = \{x \in A: f(x) \in D\}\)- The set $f^{-1}(D)$ is called the pre-image of $D$ in $A$ or the inverse of $D$.
集合 $f^{-1}(D)$ 称为 $D$ 在 $A$ 中的原像或逆。
- The set $f^{-1}(D)$ is called the pre-image of $D$ in $A$ or the inverse of $D$.
Note: The symbol $f^{-1}$ is not to be thought of as an inverse function applied to points in the range of $f$.
注意:符号 $f^{-1}$ 不应被认为是应用于 $f$ 值域中点的逆函数。
- In particular, given a point $y$ in $B$, it makes no sense to talk about $f^{-1}(y)$ as a point in $A$,
特别是,对于 $B$ 中的某个点 $y$,将 $f^{-1}(y)$ 视为 $A$ 中的一个点是没有意义的,- since there may be several points in $A$ that are mapped to $y$.
因为 $A$ 中可能有多个点被映射到 $y$。
- since there may be several points in $A$ that are mapped to $y$.
Properties (Theorem)
Suppose that $f: A \to B$.
假设 $f: A \to B$。
- Let $C$, $C_1$, and $C_2$ be subsets of $A$ and let $D$, $D_1$, and $D_2$ be subsets of $B$.
令 $C$、$C_1$ 和 $C_2$ 为 $A$ 的子集,$D$、$D_1$ 和 $D_2$ 为 $B$ 的子集。 - Then the following hold:
则以下结论成立:
(a)
\(C \subseteq f^{-1}[f(C)]\)
Proof:
- Let $x \in C$.
- Then $f(x) \in f(C)$ (by definition of $f(C)$).
- Thus $x \in f^{-1}[f(C)]$ (by definition of $f^{-1}$).
- Therefore, $C \subseteq f^{-1}[f(C)]$.
(b)
\(f[f^{-1}(D)] \subseteq D\)
Proof:
- Let $y \in f[f^{-1}(D)]$.
- Then there exists $x \in f^{-1}(D)$ such that $f(x) = y$.
- By definition of $f^{-1}(D)$, $x \in f^{-1}(D)$ implies $f(x) \in D$.
- Thus, $y \in D$.
- Therefore, $f[f^{-1}(D)] \subseteq D$.
(c)
\(f(C_1 \cap C_2) \subseteq f(C_1) \cap f(C_2)\)
Proof:
- Let $y \in f(C_1 \cap C_2)$.
- Then there exists $x \in C_1 \cap C_2$ such that $f(x) = y$.
- Since $x \in C_1 \cap C_2$,
- $x \in C_1$ and $x \in C_2$.
- Therefore, $f(x) \in f(C_1)$ and $f(x) \in f(C_2)$,
- so $y \in f(C_1) \cap f(C_2)$.
- Hence, $f(C_1 \cap C_2) \subseteq f(C_1) \cap f(C_2)$.
(d)
\(f(C_1 \cup C_2) = f(C_1) \cup f(C_2)\)
Proof:
- To prove $f(C_1 \cup C_2) \subseteq f(C_1) \cup f(C_2)$, let $y \in f(C_1 \cup C_2)$.
- Then there exists $x \in C_1 \cup C_2$ such that $f(x) = y$.
- Since $x \in C_1 \cup C_2$,
- $x \in C_1$ or $x \in C_2$.
- Therefore, $f(x) \in f(C_1)$ or $f(x) \in f(C_2)$,
- so $y \in f(C_1) \cup f(C_2)$.
- Conversely, let $y \in f(C_1) \cup f(C_2)$.
- Then $y \in f(C_1)$ or $y \in f(C_2)$.
- If $y \in f(C_1)$, there exists $x \in C_1$ such that $f(x) = y$.
- Similarly, if $y \in f(C_2)$, there exists $x \in C_2$ such that $f(x) = y$.
- In either case, $x \in C_1 \cup C_2$, so $y \in f(C_1 \cup C_2)$.
- Hence, $f(C_1 \cup C_2) = f(C_1) \cup f(C_2)$.
(e)
\(f^{-1}(D_1 \cap D_2) = f^{-1}(D_1) \cap f^{-1}(D_2)\)
Proof:
- Let $x \in f^{-1}(D_1 \cap D_2)$.
- Then $f(x) \in D_1 \cap D_2$.
- Thus, $f(x) \in D_1$ and $f(x) \in D_2$.
- Hence, $x \in f^{-1}(D_1)$ and $x \in f^{-1}(D_2)$
- so $x \in f^{-1}(D_1) \cap f^{-1}(D_2)$.
- Conversely, let $x \in f^{-1}(D_1) \cap f^{-1}(D_2)$.
- Then $x \in f^{-1}(D_1)$ and $x \in f^{-1}(D_2)$.
- Thus, $f(x) \in D_1$ and $f(x) \in D_2$, so $f(x) \in D_1 \cap D_2$.
- Therefore, $x \in f^{-1}(D_1 \cap D_2)$.
- Hence, $f^{-1}(D_1 \cap D_2) = f^{-1}(D_1) \cap f^{-1}(D_2)$.
(f) \(f^{-1}(D_1 \cup D_2) = f^{-1}(D_1) \cup f^{-1}(D_2)\)
Proof:
- Let $x \in f^{-1}(D_1 \cup D_2)$.
- Then $f(x) \in D_1 \cup D_2$.
- Thus, $f(x) \in D_1$ or $f(x) \in D_2$.
- Hence, $x \in f^{-1}(D_1)$ or $x \in f^{-1}(D_2)$,
- so $x \in f^{-1}(D_1) \cup f^{-1}(D_2)$.
- Conversely, let $x \in f^{-1}(D_1) \cup f^{-1}(D_2)$.
- Then $x \in f^{-1}(D_1)$ or $x \in f^{-1}(D_2)$.
- Thus $f(x) \in D_1$ or $f(x) \in D_2$.
- In either case, $f(x) \in D_1 \cup D_2$,
- so $x \in f^{-1}(D_1 \cup D_2)$.
- Hence, $f^{-1}(D_1 \cup D_2) = f^{-1}(D_1) \cup f^{-1}(D_2)$.
(g)
\(f^{-1}(B \setminus D) = A \setminus f^{-1}(D)\)
Proof:
-
Let $x \in f^{-1}(B \setminus D)$.
- Then $f(x) \in B \setminus D$, so $f(x) \in B$ and $f(x) \notin D$.
- Hence, $x \in A$ and $x \notin f^{-1}(D)$,
- so $x \in A \setminus f^{-1}(D)$.
- Conversely, let $x \in A \setminus f^{-1}(D)$.
- Then $x \in A$ and $x \notin f^{-1}(D)$.
- Thus, $f(x) \notin D$,
- so $f(x) \in B \setminus D$.
- Therefore, $x \in f^{-1}(B \setminus D)$.
- Hence, $f^{-1}(B \setminus D) = A \setminus f^{-1}(D)$.
4. Properties of Functions with Images and Pre-Images
Theorem
Suppose that $f: A \to B$. Let $C, C_1$ and $C_2$ be subsets of $A$, and let $D$ be a subset of $B$. Then the following hold:
(a) If $f$ is injective, then
\[f^{-1}[f(C)] = C\]Proof:
- By the property (a) of the Image/Pre-Image, we only need to show that \(f^{-1}[f(C)] \subseteq C\)
- Let $x \in f^{-1}[f(C)]$.
- Then $f(x) \in f(C)$.
- Thus $f(x) = f(c)$ for some $c \in C$
- Since $f$ is injective,
- we must have $x=c$.
- so $x \in C$
- Thus $f^{-1}[f(C)] \subseteq C$.
(b) If $f$ is surjective, then
\[f[f^{-1}(D)] = D\]Proof:
- By the property (b) of the Image/Pre-Image, we only need to show that \(D \subseteq f^{-1}[f(D)]\)
- Let $y \in D$.
- Since $f$ is surjective,
- $\exists x \in A$ such that $f(x) = y$.
- and $x \in f^{-1}(D)$
- so $y = f(x) \in f[f^{-1}(D)]$.
- Thus $D \subseteq f[f^{-1}(D)]$.
(c) If $f$ is injective, then
\[f(C_1 \cap C_2) = f(C_1) \cap f(C_2)\]Proof:
- By the property (c) of the Image/Pre-Image, we only need to show that \(f(C_1) \cap f(C_2) \subseteq f(C_1 \cap C_2)\)
- Let $y \in f(C_1) \cap f(C_2)$.
- Then $y \in f(C_1)$ and $y \in f(C_2)$.
- Thus $f(x_1) = y$ for some $x_1 \in C_1$ and $f(x_2) = y$ for some $x_2 \in C_2$.
- Since $f$ is injective and $f(x_1) = y = f(x_2)$,
- we must have $x_1 = x_2$.
- That is, $x_1 \in C_1 = (C_1 \cap C_2)$.
- Thus $y = f(x_1) \in f(C_1 \cap C_2)$.
Resources
[1] Steven R. Lay, Analysis with an Introduction to Proof, 5th edition (Pearson, 2012)
[2] Raffi Grinberg, The real analysis lifesaver (Princeton University Press, 2012)