Mathematical Proof/Functions

Introduction
In the previous chapter, we have discussed the concept of. There are not much restrictions on the relations. For instance, for a relation from set $$A$$ to set $$B$$, every element of $$A$$ can be related to no elements of $$B$$, exactly one element of $$B$$, or multiple elements of $$B$$. In this chapter, we will focus on a particular type of relations from set $$A$$ to set $$B$$ where element in $$A$$ is related to  (or an ) element of $$B$$.

You should have encountered the concept of before, e.g. a function defined by $$f(x)=x^2$$ gives you a value of $$f(x)$$ for every given value of $$x$$. The functions you have encountered are likely to be in the above form, i.e. in the form of an equation. Also, the value of $$x$$ and $$f(x)$$ are likely to be real numbers.

But we can generalize such ideas to more general situations where $$x$$ and $$f(x)$$ are not necessarily real numbers (e.g., they can be elements of certain sets), and the functions need not be expressed by a formula like above. As a result, the concept and definition of functions discussed here may seem foreign to you, and look quite different from what you have previously learnt about functions.

Definitions
We should be aware that the codomain of a function is not necessarily the same as the range of a function. The following is the definition of the of a function (same as the definition for a relation).

Since the domain and codomain, in addition to the "way" of the mapping, all affect the "behaviour" and properties of a function, it is natural to incorporate all these features into the definition of of functions:

Injective, surjective and bijective functions
In this section, we will discuss some important properties that a function may possess, namely injectivity, surjectivity, and bijectivity.

Composition of functions
Let $$A,B$$ and $$C$$ be nonempty sets, and let $$f:A\to B$$ and $$g:B\to C$$ be two functions. In this section, we are going to discuss a way to create a new function from "combining" the two functions $$f$$ and $$g$$, called their :

Although the composition of functions is not commutative, it is.

Now, let us study some results that are related to the composition, injectivity, surjectivity, and bijectivity.

After knowing such results, it is natural to question that whether the of the above proposition holds. Indeed, the converse does not hold, and we have the following results:

To summarize the results, we have the following table:

Inverse functions
Recall that a function $$f:A\to B$$ is a special relation from set $$A$$ to set $$B$$ satisfying some requirements. Also, recall that given a relation from $$A$$ to $$B$$, the $$R^{-1}$$ is defined to be $$R^{-1}=\{(b,a):(a,b)\in R\}\subseteq B\times A.$$ We know that the inverse relation is always a relation itself. However, is the inverse relation of a $$f:A\to B$$ always a  from $$B$$ to $$A$$ itself? The answer is, indeed, no. Consider the following example.

Of course, when the inverse relation of a function $$f:A\to B$$ turns out to be also a function from $$B$$ to $$A$$, it is natural to define it as the of $$f$$:

We are then interested in knowing under what conditions the inverse relation $$f^{-1}$$ is a function from $$B$$ to $$A$$, so that the.

First, in order for $$f^{-1}$$ to be a function from $$B$$ to $$A$$, we must have $$\operatorname{dom}f^{-1}=B$$. So, we need to ensure that element of $$B$$ is related to some elements in $$A$$, so that when we "reverse" the ordered pairs in $$f$$ to get $$f^{-1}$$, there is at least one image for every $$b\in B$$. This means $$\operatorname{ran}f=B$$, i.e., $$f$$ needs to be surjective.

Of course, we also need to ensure that there is a image for every $$b\in B$$. Under the condition that $$f$$ is surjective, there is at least one image for every $$b\in B$$ already. So, it remains to ensure that there is one image for every $$b\in B$$.

To ensure this, we need the function $$f$$ to be injective, since, if $$f$$ is injective, then every element of $$B$$ has at most one pre-image. So, when we "reverse" the ordered pairs in $$f$$ to get $$f^{-1}$$, every element of $$B$$ has at most one.

From this discussion, we know that if $$f^{-1}$$ is a function from $$B$$ to $$A$$, then $$f$$ has to be injective and surjective, i.e. bijective. This shows that the bijectivity of $$f$$ is the necessary condition for the existence of the inverse function. Is it also the sufficient condition? It turns out that the bijectivity of $$f$$ is actually the condition for the existence of the inverse function:

Hence, from this theorem, we know that it is only meaningful to talk about inverse function of $$f$$ when $$f$$ is bijective. If $$f$$ is not bijective, then its inverse function does not exist at all, and it is meaningless to talk about it. The following theorem further suggests that the inverse function must also be bijective.

Another common definition of inverse function is that the inverse function of $$f$$, denoted by $$f^{-1}$$, is a function satisfying $$f^{-1}\circ f=id_A\text{ and }f\circ f^{-1}=id_B.$$ It turns out that these two definitions of inverse function are indeed (logically) equivalent. Consider the following theorem.

The converse of the above theorem is also true. More precisely, if $$f$$ is bijective, and thus its inverse function $$f^{-1}$$ exists, then we have $$f\circ f^{-1}=id_A$$ and $$f^{-1}\circ f=id_B$$. (Details are left to the following exercise.) Hence, the two definitions are actually logically equivalent, in the sense that It then follows that the function $$g$$ satisfying $$f\circ g=id_A$$ and $$g\circ f=id_B$$ is unique, since the inverse function is unique.
 * by the above theorem, the conditions in the alternative definition imply the conditions in our definition.
 * by the above remark, the conditions in our definition imply the conditions in the alternative definition.

Here, we will introduce an approach to find a formula for the inverse function. But this approach does not work.

In this approach, we use some algebraic manipulation to find the inverse function. However, such method is not always possible. For instance, the function $$f:\mathbb R\to(0,\infty)$$ defined by $$f(x)=e^x$$ is bijective, but its inverse function $$f^{-1}:(0,\infty)\to\mathbb R$$ is given by (indeed, defined to be) $$f^{-1}(x)=\ln x$$. In this case, such inverse function cannot be obtained by such algebraic manipulation.

Image sets and preimage sets
The concepts discussed in this section are the generalizations of the concepts of and.

Graphically, the image set looks like: A             B The preimage set looks like A             B
 * . X |      | f(X) |
 * . X |      | f(X) |
 * . X |      | f(X) |
 * f-1(Y)|      |      |
 * .  |       |  Y   |
 * .  |       |  Y   |

Cardinalities of sets
Recall that a set is $$S$$ if it contains a finite number of elements, i.e., $$S=\varnothing$$ or $$|S|=n$$ for some $$n\in\mathbb N$$. On the other hand, a set is infinite if it is not finite. Previously, we have studied cardinalities of finite sets, and we have left cardinalities of sets undefined. But, it turns out that we can define cardinalities of infinite sets in a more complicated way, using.

It may now seem that we can write something like $$|S|=\infty$$ for an infinite set $$S$$. But it turns out that this is not quite meaningful, and as we shall see, infinite sets can have different cardinalities, or different "sizes". That is, there are different sizes of infinity! (in some sense).

To motivate the definition for the cardinalities of infinite sets, let us first consider a simple example of sets.

This example suggests that for two finite (nonempty) sets $$A$$ and $$B$$, they have the if there exists a bijective function from $$A$$ to $$B$$ (or from $$B$$ to $$A$$. One such function is given by the  of the bijective function from $$A$$ to $$B$$.) This leads us to the following definition:

The result in this example may seem strange and counter-intuitive, since $$\mathbb Z$$ seems to be twice as large as $$E$$, and $$E$$ is a proper subset of $$\mathbb Z$$, but they turn out to have the same cardinality. Such phenomenon is actually quite common when we deal with the cardinalities of.

Fortunately, the numerical equivalence has some nice properties: reflexivity, symmetry and transitivity:

Now, let us focus on the set $$\mathbb N$$, and consider the (infinite) sets having the same cardinality as $$\mathbb N$$. We give a special name for such sets:

Using this definition, we can further define another property of a set:

We now know that $$\mathbb N$$ and $$\mathbb Z$$ have the same cardinality. It is then natural to consider the set of all rational numbers, $$\mathbb Q$$. It appears that $$\mathbb Q$$ is much larger than $$\mathbb Z$$, so it may seem that $$\mathbb Q$$ should no longer be denumerable, and be uncountable. But it turns out that $$\mathbb Q$$ is also denumerable.

So, we have proved that $$|\mathbb N|=|\mathbb Z|=|\mathbb Q|$$. It turns out that even if $$\mathbb Q$$ seems much larger than $$\mathbb N$$ and $$\mathbb Z$$, it still has the same cardinality as them. A natural question then arises: is there any uncountable set at all? The answer is yes, and the best known example is the set of all real numbers, $$\mathbb R$$. In other words, there does not exist a bijective function from $$\mathbb N$$ to $$\mathbb R$$. Since $$\mathbb R$$ is uncountable, this suggests that the "size" of $$\mathbb R$$ is different from the "size" of $$\mathbb N$$, i.e., there are different sizes of infinity (in some sense).

The following results may be useful for comparing denumerable or uncountable sets.