Definition. A function f from a set X to a set Y is a subset f of the product such that if , then .
Instead of writing , you usually write . In ordinary terms, to say that an ordered pair is in f means that x is the "input" to f and y is the corresponding "output".
The requirement that implies means that there is a unique output for each input. (It's what is referred to as the "vertical line test" for a graph to be a function graph.)
(Why not say, as in precalculus or calculus classes, that a function is a rule that assigns a unique element of Y to each element of X? The problem is that the word "rule" is ambiguous. The definition above avoids this by identifying a function with its graph.)
The notation means that f is a function from X to Y.
X is called the domain, and Y is called the codomain. The image (or range) of f is the set of all outputs of the function:
Note that the domain and codomain are part of the definition of a function. For example, consider the following functions:
These are different functions; they're defined by the same rule, but they have different domains or codomains.
Example. Suppose is given by
Is this a function?
This does not define a function. For example, could be 3, since 3 is an integer bigger than 2.6. But it could also be 4, or 67, or 101, or .... This "rule" does not produce a unique output for each input.
Mathematicians say that such a function --- or such an attempted function --- is not well-defined.
In basic algebra and calculus, functions are often given by rules, without mention of a domain and codomain. In this case, the natural domain ("domain" for short) is the largest subset of consisting of numbers which can be "legally" plugged into the function.
Example. Find the natural domain of
(i) I must have in order for to be defined.
(ii) I must have in order to avoid division by zero.
Hence, the domain of f is .
Example. Define by
Prove that .
In words, the claim is that the outputs of y consist of all numbers other than 3. To see why 3 might be omitted, note that
That is, is a horizontal asymptote for the graph. Now this isn't a proof, because a graph can cross a horizontal asymptote; it just provides us with a "guess".
To prove , I'll show each set is contained in the other.
Suppose . On scratch paper, I solve for x in terms of y and get . (This is defined, since .) Now I prove that this input produces y as an output:
This proves that , so .
Conversely, suppose , so for some x. I must show that . I'll use proof by contradiction: Suppose . Then
This contradiction proves . Thus, .
Therefore, .
Definition. Let A, B, and C be sets, and let and be functions. The composite of f and g is the function defined by
In my opinion, the notation " " looks a lot like multiplication, so (at least when elements are involved) I prefer to write " " instead. However, the composite notation is used often enough that you should be familiar with it.
Example. Define by and by . Find and .
Example. Define and by
Find:
(a) .
(b) .
(a)
(b)
If you get confused doing this, keep in mind two things:
(i) The variables used in defining a function are "dummy variables" --- just placeholders. For example, defines the same function f as above.
(ii) The variables are "positional", so in " " the "x" stands for "the first input to f" and the "y" stands for "the second input to f". In fact, you might find it helpful to rewrite the definition of f this way:
Definition. Let X and Y be sets. A function is:
(a) Injective if for all , implies .
(b) Surjective if for all , there is an such that .
(c) Bijective if it is injective and surjective.
Intuitively, a function is injective if different inputs give different outputs. The older terminology for "injective" was "one-to-one".
For functions , "injective" means every horizontal line hits the graph at most once.
A function is surjective if every element of the codomain (the "target set") is an output of the function. The older terminology for "surjective" was "onto".
For functions , "injective" means every horizontal line hits the graph at least once.
A function is bijective if the elements of the domain and the elements of the codomain are "paired up". The older terminology for "bijective" was "one-to-one correspondence".
For functions , "bijective" means every horizontal line hits the graph exactly once.
Note: These are useful pictures to keep in mind, but don't confuse them with the definitions!
Example. (a) Prove that given by is neither injective nor surjective.
(b) Prove that given by is not injective, but it is surjective.
(c) Prove that given by is injective and surjective.
(a) It is not injective, since and : Different inputs may give the same output.
It is not surjective, since there is no such that .
(b) It is not injective, since and : Different inputs may give the same output.
It is surjective, since if , is defined, and
(c) It is injective, since if , then . But in this case, , so by taking square roots.
It is surjective, since if , then is defined, and
Notice that in this example, the same "rule" --- --- was used, but whether the function was injective or surjective changed. The domain and codomain are part of the definition of a function.
Example. Let be given by
Prove that f is injective.
Suppose and . I must prove that .
means that . Clearing denominators and doing some algebra, I get
Therefore, f is injective.
Example. Let be given by
Prove that f is injective.
It would probably be difficult to prove this directly. Instead, I'll use the following fact:
Suppose is differentiable, and that for all x or for all x. Then f is injective.
In this case, note that, since even powers are nonnegative,
Since the derivative is always positive, f is always increasing, and hence f is injective.
Here's a proof of the result I used in the last example.
Proposition. Suppose is differentiable, and that for all x or for all x. Then f is injective.
Proof. Suppose that f is differentiable and always increasing. Suppose that . I want to prove that .
Suppose on the contrary that . There's no harm in assuming (otherwise, switch them). By the Mean Value Theorem, there is a number c such that and
Since and for all x,
This contradiction proves that . Therefore, f is injective.
The same proof works with minor changes if for all x.
Example. Define by
Prove that f is surjective.
Note that is the real numbers other than 1.
Let . I have to show that there is an x such that .
I work backwards on scratch paper:
Note that this is not a proof --- I started with , which is what I want to show.
The last line tells me what I need to use for "x". To prove surjectivity, I plug it in and verify that it works. Remember that at this point, I've been given y. So
Thus, given , I have found an input to f which produces y as an output. Therefore, f is surjective.
The preceding example relied on being able to solve for x in terms of y. In general, you can't expect to solve an arbitrary equation for one variable in terms of another. In some cases, it's possible to prove surjectivity indirectly.
Example. Define by . Show that f is not injective, but that f is surjective. f is not injective, since and .
The graph suggests that f is surjective. To say that every is an output of f means graphically that every horizontal line crosses the graph at least once (whereas injectivity means that every horizontal line crosses that graph at most once).
To prove that f is surjective, take . I must find such that , i.e. such that .
The problem is that finding x in terms of y involves solving a cubic equation. This is possible, but it's easy to change the example to produce a function where solving algebraically is impossible in principle.
Instead, I'll proceed indirectly.
It follows from the definition of these infinite limits that there are numbers a and b such that
The existence of a comes from , which means that must eventually become smaller than any number y as . Likewise, the existence of b comes from , which means that must eventually become larger than any number y as .
But f is continuous --- it's a polynomial --- so by the Intermediate Value Theorem, there is a point c such that and . This proves that f is surjective.
Note, however, that I haven't found c; I've merely shown that such a value c must exist.
Example. Define
Prove that f is surjective, but not injective.
Let . If , then , so
If , then is defined and , so
This proves that f is surjective.
However,
Hence, f is not injective.
Example. Consider the function defined by
Prove that f is neither injective nor surjective.
Therefore, f is not injective.
To prove f is not surjective, I must find a point which is not an output of f. I'll show that is not an output of f. Suppose on the contrary that . Then
This gives two equations:
Multiply the second equation by -2 to obtain . Now I have and , so , a contradiction.
Therefore, there is no such , and f is not surjective.
Example. Let be defined by
Is f injective? Is f surjective?
First, I'll show that f is injective. Suppose . I have to show that .
Equating the second components, I get . By taking cube roots, I get . Equating the first components, I get . But , so subtracting I get . Now taking the log of both sides gives . Thus, , and f is injective.
I'll show that f is not surjective by showing that there is no input which gives as an output. Suppose on the contrary that . Then
Equating the second components gives , so . Equating the first components gives . But , so I get . This is impossible, since is always positive. Therefore, f is not surjective.
Definition. Let S and T be sets, and let be a function from S to T. A function is called the inverse of f if
Not all functions have inverses; if the inverse of f exists, it's denoted . (Despite the crummy notation, " " does not mean " ".)
You've undoubtedly seen inverses of functions in other courses; for example, the inverse of is . However, the functions I'm discussing may not have anything to do with numbers, and may not be defined using formulas.
Example. Define by . Find the inverse of f.
To find the inverse of f (if there is one), set . Swap the x's and y's, then solve for y in terms of x:
Thus, . To prove that this works using the definition of an inverse function, do this:
Recall that the graphs of f and are mirror images across the line :
I'm mentioning this to connect this discussion to things you've already learned. However, you should not make the mistake of equating this special case with the definition. The inverse of a function is not defined by "swapping x's and y's and solving" or "reflecting the graph about ". A function might not involve numbers or formulas, and a function might not have a graph. The inverse of a function is what the definition says it is --- nothing more or less.
Lemma. Let and be invertible functions. Then is invertible, and its inverse is
Proof. Let and let . Then
This proves that .
The next result relates bijectivity and inverses. I'll often use it in showing that a given function is bijective.
Theorem. Let S and T be sets, and let be a function. f is invertible if and only if f is bijective.
Proof. ( ) Suppose that f is bijective. I'll construct the inverse function .
Take . Since f is surjective, there is an element such that . Moreover, s is unique: If and , then . But f is injective, so .
Define
I have defined a function . I must show that it is the inverse of f.
Let . By definition of , to compute I must find an element such that . But this is easy --- just take . Thus, .
Going the other way, let . By definition of , to compute I find an element such that . Then , so
Therefore, really is the inverse of f.
( ) Suppose f has an inverse . I must show f is injective and surjective.
To show that f is surjective, take . Then , so I've found an element of S --- namely --- which f maps to t. Therefore, f is surjective.
To show that f is injective, suppose and . Then
Therefore, f is injective.
Corollary. The composite of bijective functions is bijective.
Proof. Since a function is bijective if and only if it has an inverse, the corollary follows from the fact that the composite of invertible functions is invertible.
Example. Consider the function defined by
Show that f is injective and surjective by constructing an inverse .
I will work backwards on scratch paper and figure out a formula for the inverse. Then I'll prove that my formula works.
Scratch work: Suppose the inverse is
Now f and g are supposed to be inverses, so . So
This gives
I want the formula for , which means I want to find x and y in terms of u and v. Thus, I solve the two equations above simultaneously. From , I get
That's x. Now plug this into and solve for y:
Thus, the formula for g is
That ends the scratch work, and I do the "real proof".
Let . I must show that
First,
Before doing the next equation, let's explain the second equality. " " means to plug in for y and in for v in the definition . Check carefully for yourself that we did that.
Another important point: When you compute , there should only be x's and y's in your work. You can't have any u's and v's, because u and v aren't "global variables" --- they don't exist outside of the definition of .
Please look at the computation above and read the last paragraph again, because it is easy to make the mistake you're being warned about!
Next,
As in the previous derivation, I got the second equality by plugging in for x and in for y in .
By analogy with the first derivation, when you do , there should only be u's and v's in your work --- you can't have any x's and y's.
The two equations above show that f and g are inverses. Therefore, f is bijective.
Copyright 2020 by Bruce Ikenaga