1.4. Functions#

Definition 1.47 (Function)

A partial function (or simply function) from a set A to a set B, in symbols f:AB (or AfB or xf(x)) is a specific rule that assigns a unique element yB to an element xA.

The rule need not be defined for every element in A.

Note

Following [17], our definition of functions is somewhat different from the traditional definition. In particular, we don’t require that f maps each element of A to an element of B. It may map only some elements of A to B.

See also : total function below.

Definition 1.48 (Function value or image)

If f maps an element xA to an element yB, We say that the element y is the value of the function f at x (or the image of x under f) and denote as f(x), that is, y=f(x). We also say that f attains or assumes the value y at x. We also sometimes say that y is the output of f when the input is x.

Definition 1.49 (Domain of a function)

For a function f:AB the domain of the function is the subset of A for which the function is defined. It is denoted by domf.

domf{xA|yB such that y=f(x)}.

Definition 1.50 (Total function)

A function f:AB is called a total function if domf=A.

The normal set-theoretic definition of a function coincides with the definition of total function above.

Definition 1.51 (Range of a function)

The set {yB|xA such that y=f(x)} is called the range of f denoted by rangef.

In other words, the set of values attained by f is called its range.

The domain is a subset of A and the range is a subset of B.

Definition 1.52 (Equality of functions)

Two functions f:AB and g:AB are said to be equal, in symbols f=g if domf=domg and f(x)=g(x)xdomf.

In words, they map the same elements of A to same elements of B.

Definition 1.53 (Surjective function)

A function f:AB is called onto or surjective if rangef is all of B. i.e. for every yB, there exists (at least one) xA such that y=f(x).

Definition 1.54 (Injective function)

A function f:AB is called one-one or injective if x1x2f(x1)f(x2).

Definition 1.55 (Bijective function)

A total function f:AB is called one-one onto or bijective if it is injective as well as surjective.

For a bijective function domf=A, rangef=B, the elements of A and B are in one-to-one mapping.

Example 1.10 (Square root)

Let f:RR be defined as:

f(x)=x.

domf=[0,). rangef=[0,).

f is partial and injective. It is neither surjective nor bijective.

Example 1.11 (Logarithm)

Let f:RR be defined as:

f(x)=log(x).

domf=(0,). rangef=(,)=R.

f is partial, injective and surjective (but not bijective).

Example 1.12 (Exponential)

Let f:RR be defined as:

f(x)=ex.

domf=(,)=R. rangef=(0,)=R.

f is total and injective but not surjective.

Example 1.13 (Extended value extension of exponential)

Let f:R{,}R{,} be defined as:

f(x)={exxR0x=x=.

domf=[,]. rangef=[0,]=R.

f is total and injective but not surjective.

Example 1.14 (Dirichlet’s unruly indicator function for rational numbers)

Let g:RR be defined as:

g(x){1if xQ;0if xQ.

domg=R, rangeg={0, 1 }$.

Example 1.15 (Absolute value function)

f(x)=|x|={xif x0;xif x<0.

The domain is R and the range is R+=[0,).

f is total. It is not injective. It is not surjective.

Example 1.16 (Logarithm of the determinant)

The set of n×n real symmetric matrices is denoted by Sn. The set of positive semidefinite symmetric matrices is denoted by S+n. The set of positive definite symmetric matrices is denoted by S++n.

Consider the function f:SnR given by

f(X)=logdet(X).

The domain of the function is domf=S++n. The function is not defined for matrices which are not positive definite.

In summary, for a function f:AB:

  • If domf=A then, the function is total.

  • If rangef=B then, the function is surjective.

  • If f(x1)=f(x2)x1=x2, then the function is injective.

  • If f is total, injective and surjective, then it is bijective.

1.4.1. Image under a function#

Let f:XY be a (partial) function.

Definition 1.56 (Image of a set under a function)

If AX, then image of A under f denoted as f(A) (a subset of Y) is defined by

f(A)={yY|xA such that y=f(x)}.

Note that the definition is valid even if some elements of the subset A may not belong to domf.

Definition 1.57 (Inverse image )

If B is a subset of Y then the inverse image f1(B) of B under f is the subset of X defined by

f1(B)={xX|f(x)B}.

Remark 1.5

If Brangef= then f1(B)=.

Proposition 1.7

Let {Ai}iI be a family of subsets of X. Let {Bi}iI be a family of subsets of Y.

Then, the following results hold:

Image of the union of Ai is the union of the images of Ai.

f(iIAi)=iIf(Ai).

Image of the intersection of Ai is a subset of the intersection of the images of Ai.

f(iIAi)iIf(Ai).

Inverse image of the union of Bi is the union of the inverse images of Bi.

f1(iIBi)=iIf1(Bi).

Inverse image of the intersection of Bi is the intersection of the inverse images of Bi.

f1(iIBi)=iIf1(Bi).

Let BY. Inverse image of complement of B (w.r.t. Y) is the complement of the inverse image of B w.r.t. the domain of f.

f1(YB)=domff1(B)Xf1(B).

1.4.2. Function Composition#

Definition 1.58 (Composition)

Given two functions f:XY and g:YZ, their composition gf is the function gf:XZ defined by

(gf)(x)=g(f(x))xdomf such that f(x)domg.

Remark 1.6

domgfdomfX.

The domain of the composition may be smaller than the domain of f as g may not be defined for every y in rangef.

Theorem 1.1

Given two one-one functions f:XY and g:YZ, their composition gf is one-one.

Proof. Let x1,x2domgf. We need to show that g(f(x1))=g(f(x2))x1=x2. Since g is one-one, hence

g(f(x1))=g(f(x2))f(x1)=f(x2).

Further, since f is one-one, hence

f(x1)=f(x2)x1=x2.

Theorem 1.2

Given two onto functions f:XY and g:YZ, their composition gf is onto.

Proof. Let zZ. We need to show that there exists xX such that g(f(x))=z. Since g is on-to, hence for every zZ, there exists yY such that z=g(y). Further, since f is onto, for every yY, there exists xX such that y=f(x). Combining the two, for every zZ, there exists xX such that z=g(f(x)).

Theorem 1.3

Given two one-one onto functions f:XY and g:YZ, their composition gf is one-one onto.

Proof. This is a direct result of combining Theorem 1.1 and Theorem 1.2.

Corollary 1.1

Given two bijective (total) functions f:XY and g:YZ, their composition gf is bijective.

Definition 1.59 (Composition of total functions)

Given two total functions f:XY and g:YZ, their composition gf is the function gf:XZ defined by

(gf)(x)=g(f(x))xX.

Since domf=X and domg=Y, hence composition is well defined over all of X.

1.4.3. Inverse Function#

Definition 1.60 (Inverse function)

If a function f:XY is one-one, then for every y in rangef, there exists a unique xX such that y=f(x).
This unique element is denoted by f1(y). Thus, a function f1:YX can be defined by

f1(y)=x whenever f(x)=y.

The function f1 is called the inverse of f.

Note that we don’t require f to be onto since our definition of a function allows domf1 to be a subset of Y (which happens to be rangef).

Remark 1.7

We can see that (ff1)(y)=y for all yrangef. Also (f1f)(x)=x for all xdomf.

domf1=rangef.
domf=rangef1.

Remark 1.8

The inverse of an injective (partial) function is injective.

Definition 1.61 (Inverse of a total function)

If a total function f:XY is bijective, then for every y in Y, there exists a unique xX such that y=f(x).
This unique element is denoted by f1(y). Thus, a total function f1:YX can be defined by

f1(y)=x whenever f(x)=y.

The total function f1 is called the inverse of f.

Remark 1.9

The inverse of a bijective function is bijective.

Definition 1.62 (Identity function)

We define an identity function on a set X denoted by IX:XX as:

IX(x)=xxX

Remark 1.10

Identify function is one-one and onto. It is a total function and is bijective.

Remark 1.11 (Composition of a total function with its inverse)

For a total function f:XY:

ff1=IY.f1f=IX.

1.4.4. Schröder-Bernstein Theorem#

Theorem 1.4 (Schröder-Bernstein Theorem)

Given two one-one total functions f:XY and g:YX, there exists a bijective total function h:XY.

Proof. Clearly, we can define a one-one onto function f1:f(X)X and another one-one onto function g1:g(Y)Y. Let the two-sided sequence Cx be defined as

,f1(g1(x)),g1(x),x,f(x),g(f(x)),f(g(f(x))),.

Note that the elements in the sequence alternate between X and Y. On the left side, the sequence stops whenever f1(y) or g1(x) is not defined. On the right side the sequence goes on infinitely.

We call the sequence as X stopper if it stops at an element of X or as Y stopper if it stops at an element of Y. If any element in the left side repeats, then the sequence on the left will keep on repeating. We call the sequence doubly infinite if all the elements (on the left) are distinct, or cyclic if the elements repeat. Define Z=XY If an element zZ occurs in two sequences, then the two sequences must be identical by definition. Otherwise, the two sequences must be disjoint. Thus the sequences form a partition on Z. All elements within one equivalence class of Z are reachable from each other through one such sequence. The elements from different sequences are not reachable from each other at all. Thus, we need to define bijections between elements of X and Y which belong to same sequence separately.

For an X-stopper sequence C, every element yCY is reachable from f. Hence f serves as the bijection between elements of X and Y. For an Y-stopper sequence C, every element xCX is reachable from g. Hence g serves as the bijection between elements of X and Y. For a cyclic or doubly infinite sequence C, every element yCY is reachable from f and every element xCX is reachable from g. Thus either of f and g can serve as a bijection.

1.4.5. Restriction and Extension#

Definition 1.63 (Restriction of a function)

Let f:AB be a function. Let C be a subset of A. Then, the restriction of f to C is the function f|C:AB given by

f|C(x)=f(x)xCdomf.

In other words, the domain of f gets restricted to Cdomf and f is no longer defined for any xdomfC.

Remark 1.12

For total functions, the convention is to change the signature from f:AB to f|C:CB. This way, the restriction f|C is also a total function.

Definition 1.64 (Extension of a function)

An extension of a function f is any function g such that f is a restriction of g.

If g is an extension of f then domfdomg.

1.4.6. Graph#

Definition 1.65 (Graph of a function)

Given a function f:XY, the set of ordered pairs (x,y) where xdomf and y=f(x), is known as the graph of a function.

graf{(x,f(x))|xX}

The graph of a function is the subset of the Cartesian product X×Y.

1.4.7. Set Valued Functions#

For a set X, the notation 2X denotes the power set of X.

Definition 1.66 (Set valued function/operator)

The notation A:X2Y means that A maps every element of X to a subset of Y. In other words, A(x)Y. A is a mapping from X to the power set of Y. Such a mapping A is called a set valued function or set valued operator.

Observation 1.1

If A is not defined on some values of X, we can simply say that A maps those values to which is a subset of Y.

If f:XY is a partial function with domfX, then, the corresponding set valued function A:X2Y is:

A(x)={{f(x)} if xdomf if xdomf.

Remark 1.13

Let A:X2Y be a set valued function. Then, A is characterized by its graph

graA={(x,y)X×Y|yA(x)}.

Definition 1.67 (Image of a subset under a set valued function)

Let A:X2Y be a set valued function and let CX. Then:

A(C)xCA(x).

Definition 1.68 (Composition of set valued functions)

Let A:X2Y and B:Y2Z be set valued functions.

Then the composition BA:X2Z is defined as:

(BA)(x)B(A(x))=yA(x)B(y).

Definition 1.69 (Domain of a set valued function)

The domain of a set valued function A:X2Y is defined as:

domA{xX|A(x)}.

Definition 1.70 (Range of a set valued function)

The range of a set valued function A:X2Y is defined as:

rangeAA(X)=xXA(x).

Note that A(X)Y.

Remark 1.14

A set valued function A:X2Y is:

  1. partial if domAX.

  2. total if domA=X.

  3. onto if rangeA=Y.

Definition 1.71 (Inverse of a set valued function)

The inverse of a set valued function A:X2Y is defined using its graph as:

graA1={(y,x)Y×X|(x,y)graA}.

For every (x,y)X×Y, yA(x)xA1(y).

The inverse of a set valued function is a set valued function and it always exists.

Definition 1.72 (Single valued function)

Let A:X2Y be a set valued function. If for every xdomA, A(x) is a singleton, then A is called an at most single valued function from X to Y.

This can be identified with a partial function.

Definition 1.73 (Selection of a set valued function)

Let A:X2Y be a set valued function. A function f:XY is called a selection of A if f(x)A(x) for every xdomA.

In other words, for every xdomA, we select one value from the set A(x). Domain of a selection f is same as the domain of A.