Vous êtes sur la page 1sur 2

Functions

Reading
The reading associated to this lecture is contained in Rosen, section 2.3. The section on Partial Functions is
optional, but not very long so perhaps worth glancing over anyway.

Summary
Given two sets X and Y , a function (or map or mapping or transformation...) f from X to Y is a rule that
associates an element f (x) Y to each element x X. We say that X is the domain (or source) of the function
and that Y is the codomain (or target). To specify all of this information in one go, well write let f : X Y be
a function... We say that f (x) is the image of x under f .
There are different ways of defining a function.
If we can list out all of the elements of the domain, then we can just specify what the function does on each
element of the domain. For example, we might say something like let f : {1, 2, 3} R be the function defined
by f (1) = , f (2) = 3/2 and f (3) = 34337.2.
More commonly, we can define a rule that tells us what to do to any particular element of the domain. For
example, we often say things like let f : R R be the function given by f (x) = x2 . These rules dont have to
be written out in symbols; we can alternatively describe the same function by letting f be the function that
takes in a real number and spits out its square.
If f : X Y is a function and A X, we define
f (A) = {y Y : there exists x A such that f (x) = y}.
If B Y , we define
f 1 (B) = {x X : f (x) B}.
The graph of a function f : X Y , sometimes denoted (f ), is the set
{(x, y) X Y : x X and y = f (x)}.
You should think about why this is the same as the notion of a graph of a function you might be used to from
before.
Given two functions f : X Y and g : Y Z, we define the composite g f to be the function X Z given
by
(g f )(x) = g(f (x)).
There are two main properties a function can have.
A function f : X Y is injective if f (x) = f (x0 ) implies x = x0 for all x, x0 X. In other words, f is
injective if x 6= x0 implies f (x) 6= f (x0 ).
A function f : X Y is surjective if for every y Y , there exists an x X such that y = f (x).
A function that is both injective and surjective is bijective. Note that a function f : X Y is bijective if and only
if for every y Y , there exists a unique x X such that f (x) = y. When f is bijective, we let f 1 : Y X be the
function that associates to each y Y that unique element x X such that f (x) = y. Thus,
f (f 1 (y)) = y and f 1 (f (x)) = x.

Comments
(1) The terminology one-to-one and onto is getting increasingly outdated, I think.
(2) Surjectivity is a bit subtle because it depends on what we declare the codomain of the function to be. For
example, the function f : Z R given by f (x) = x is not surjective, but the function g : Z Z given by
g(x) = x is surjective.

1
Examples
Example. The function f : Z Z Z given by f (m, n) = m n is surjective. To see this, suppose that we have an
arbitrary element of the codomain n Z. Then f (n, 0) = n 0 = n, so the element (n, 0) Z Z is an element of
the domain mapping to n in the codomain. Thus f is surjective.
On the other hand, f is not injective. For example, note that f (3, 1) = f (2, 0) even though (3, 1) 6= (2, 1).

Example. Consider the function f : N N N given by f (m, n) = 2m 3n . This function is injective but not
surjective (which might be surprising, since it seems like N N is bigger than N in some loose sense of the word).
You should prove for yourself that f is injective but not surjective. You might find yourself using some very basic
number theory (nothing very harditll just be facts about numbers you learnt in grade school).

Exercise. For every positive integer n, give an example of an injective function f : Nn N. (Hint: generalize the
above example.)

Example. Prove that a function f : X Y is surjective if and only if f 1 (B) is nonempty for every nonempty
subset B Y .
Proof. Suppose f is surjective. Let B Y be an arbitrary nonempty subset. Since B is nonempty, there exists
some y B. Since f is surjective, there exists some x X such that f (x) = y. Since y B, we have f (x) B,
which means that x f 1 (B), so f 1 (B) is nonempty.
Conversely, suppose f 1 (B) is nonempty for every nonempty subset B Y . Let y Y be an arbitrary element.
Then B = {y} is a nonempty subset of Y , so f 1 ({y}) is nonempty. Let x be an element of f 1 ({y}). Then
f (x) {y}, which means that f (x) = y since y is the only element of {y}. Thus f is surjective.
Example. Prove that for any function f : X Y and any subset A X, we have A f 1 (f (A)). Furthermore,
prove that if f is injective, then A = f 1 (f (A)).

Proof. Suppose x A is an arbitrary element. Then f (x) f (A), so by definition of f 1 (f (A)) we have x
f 1 (f (A)). This proves that A f 1 (f (A)).
Now suppose f is injective. Suppose x f 1 (f (A)). This means that f (x) f (A). By definition of f (A), this
means that there exists an x0 A such that f (x0 ) = f (x). But f is injective, so x = x0 , which means that x A.
This proves that f 1 (f (A)) A also, proving the desired equality.

Exercise. Prove that f (f 1 (B)) B for any function f : X Y and any subset B Y . Furthermore, prove that
if f is surjective, then f (f 1 (B)) = B.

Vous aimerez peut-être aussi