Contents

Functions


In this article, we will go over what is a function and the different types of functions.

  • A function ff from AA to BB, denoted as f:ABf : A → B, is a relation from AA to BB that assigns each element of AA to exactly one element of BB.
  • AA is called the domain of ff. The domain is the set of all inputs.
  • BB is called the codomain of ff. The codomain is the set of all allowable outputs.
  • If ff maps element aAa∈A to element bBb∈B, we write f(a)=bf(a)=b.
  • If f(a)=bf(a)=b, bb is an image of aa and aa is a preimage of bb .
  • The range of ff is the set of all images of elements in AA.

1. Identifying a function

/images/post/MTH1114/function.png

2. Difference between codomain and range

/images/post/MTH1114/codomainrange.png

A function f(x)f(x) is called one-to-one or injective if and only if f(x)=f(y)f(x)=f(y) implies x=yx=y for every xx, yy in the domain of ff. In other words, one-to-one functions never assign different elements in the domain to the same element in the codomain.

There are a few methods to check if a function is injective:

1. Arrow diagram

We can draw arrow diagrams that represents the mapping of the relations from the domain to codomain in order to determine if the function is injective or not. However, this method is very difficult to use when the domain and codomain is large.

/images/post/MTH1114/injective.png

2. Horizontal line test

This method is easy and convenient. All we have to do is draw a horizontal line through the graph of a function and if it intersects the graph only once, then the function is one-to-one as shown in the example below:

/images/post/MTH1114/HLT.png

However, this method only works for graphs over real numbers.

3. Mathematical proof

This is the most commonly used method for proving injectivity as it is more general and straightforward.

Steps:

  1. Assume f(a)=f(b)f(a)=f(b) for all aa, bb in the domain.
  2. Some workings to show that a=ba=b
  3. Conclude that if f(a)=f(b)a=bf(a)=f(b) → a=b, then f(x)f(x) is injective

Example:

/images/post/MTH1114/injectiveproof.png

A function ff is called onto or surjective if and only if for every element yy in the codomain, there is an element xx in the domain such that f(x)=yf(x)=y. In this case, the range of ff is equal to the codomain.

There are also multiple ways to see if a function is surjective:

1. Arrow diagram

We can also use the arrow diagram method to prove surjectivity but same limitations apply.

/images/post/MTH1114/surjective.png

2. Comparing range and codomain

If we are given a graph, the easiest way to determine surjectivity is to compare the range with the codomain. If they are the same, then the function is surjective.

3. Mathematical proof

The key to proving a surjection using the proof method is to figure out what we’re after then work backwards from there.

Example: Prove that f(x) = x - 8 is a surjective function for any integer x.

Assume for any yZy∈ℤ, there exists an xZx∈ℤ such that x=y+8x=y+8.

Then f(x)=(y+8)8=yf(x) = (y+8)-8 = y by definition of f(x)f(x).

Hence f(x)=yf(x) = y for all xx, yy and ff is onto.

A function is bijective if it is both injective and surjective. To prove the bijectivity of a function, we have to prove both injectivity and surjectivity. Here’s a diagram to summarise what we have learnt so far:

/images/post/MTH1114/functiontypes.png

Given that AA and BB are finite sets, the function f:ABf : A → B is:

  • injective if AB|A| ≤ |B|,
  • surjective if BA|B| ≤ |A|,
  • bijective if A=B|A| = |B|.

Every bijection from set AA to set BB also has an inverse function.

  • The inverse of the bijection ff is denoted as ff-1.
  • The inverse function assigns an element aAa∈A to an element bBb∈B such that f(a)=bf(a)=b.

/images/post/MTH1114/inverse.png

  • A function that has an inverse is called an invertible function.
  • A function is invertible if and only if it is bijective. This is because the inverse will not fulfil the criterias of a function if it is not both injective and surjective.

Let gg be a function from AA to BB, and ff from BB to CC. The composition of ff and gg, denoted as fgf◦g, is defined by:

  • (fg)(x)=f(g(x))(f ◦ g)(x) = f (g(x))

Example 1:

Let ff and gg be functions from Z to Z such that f(x)=2x+3f(x)=2x+3 and g(x)=3x+2g(x) = 3x + 2.

(fg)(x)=f(g(x))=2(3x+2)+3=6x+7(f ◦ g)(x) = f (g(x)) = 2(3x+2) + 3 = 6x+7

Example 2:

Prove ff−1 f=I◦ f = I, where II is the identity function. The identify function for A, written as IIA: AAA → A, is defined by IIA(a)=a(a) = a for all aAa∈A.

  • Note that IIA(x)(x) = xx.

  • (f(f−1 f)◦ f)(x)(x) = ff−1(f(x)) (f(x))

  • Let f(x)f(x) be yy.

  • Then, ff−1(f(x)) (f(x)) = ff−1 (y)(y).

  • By definition of inverse, ff−1 (y)=x(y) = x if and only if f(x)=yf(x) = y.

  • Thus, ff−1(f(x)) (f(x)) = ff−1 (y)(y) = xx = IIA.