# Functions

Millions of years ago, people started noticing that some quantities in nature depend on the others. They studied these dependencies in a chaotic way, and one day they decided enough is enough and they need a unified theory, and that’s how the theory of functions started to exist, at least according to history books.

If you think that you already know enough about functions, feel free to scroll to the bottom of this document, and follow the link to a mutliple-choice quiz that you can use to test your knowledge.

We will use Cartesian product of sets to define functions in an elegant way. Since it is quite hard to understand the definition when you are seeing it for the first time, we will start by examples of functions and by pointing out the most important properties that the function must satisfy.

We can think of a function as a rule. To each input value we assign exactly one output value according to this rule.

## Definition

Definition of Function

If $$X$$ and $$Y$$ are two sets, any subset $$f\subseteq X\times Y$$ is called a function from $$X$$ to $$Y$$ if it satisfies the following condition:

For every $$x\in X$$ there exists exactly one $$y\in Y$$ such that $$(x,y)\in f$$.

The set $$X$$ is called domain of function. The set $$Y$$ is called co-domain (or range).

Every function is given by its domain, co-domain, and some rule describing how elements from domain are mapped to the co-domain.

## Image and pre-image of a function

Assume that $$f:X\to Y$$ is a function.

Assume that $$A\subseteq X$$. We define the image of $$A$$ (and denote it by $$f(A)$$) in the following way: $f(A)=\left\{ f(x): x\in A\right\}.$
Consider the function $$h$$ from Example 1. Then we have $h\left(\{3,25\}\right)=\{-14,8\}, h\left(\{5,17,35\}\right)=\{-12,0,18\}.$

Assume that $$B\subseteq Y$$. We define the pre-image of $$B$$ (and denote it by $$f^{-1}(B)$$ as the set of all elements from $$X$$ that get mapped to $$B$$. The precise definition is the following: $f^{-1}(B)=\left\{x\in X: f(x)\in B\right\}.$
Again, consider the function $$h$$ from Example 1. $h^{-1}\left(\{7,8,11)\}\right)=\{24,25,38\},\;\; h^{-1}\left(\{-5\}\right)=\{12\},\;\; h^{-1}\left(\{-33\}\right)=\emptyset.$

The experience has shown that you have a better chance of remembering the following theorem if it is stated in a rather unconventional way, as a multiple-choice question.

Pre-image ABCD question

Assume that $$P$$ and $$Q$$ are two sets. Then one of the following propositions is false, while the others are true. Prove those that are true, and find a counter-example for the false one.

(A) $$f(P \cup Q)=f(P)\cup f(Q)$$.

(B) $$f(P\cap Q)=f(P)\cap f(Q)$$.

(C) $$f^{-1}(P \cup Q)=f^{-1}(P)\cup f^{-1}(Q)$$.

(D) $$f^{-1}(P\cap Q)=f^{-1}(P)\cap f^{-1}(Q)$$.

## Injective, surjective, and bijective functions

Definition of injective functions

A function $$f:X\to Y$$ is called one-to-one (or injective) if: $x_1,x_2\in X\mbox{ and } f(x_1)=f(x_2) \;\;\Rightarrow \;\; x_1=x_2.$

In other words no two different values from $$X$$ are mapped to the same value in $$Y$$.

Definition of surjective functions

A function $$f:X\to Y$$ is called onto (or surjective) if for every $$y\in Y$$ there exists $$x\in X$$ such that $$f(x)=y$$.

Definition of bijective functions

A function $$f:A\to B$$ is called bijective if it is both one-to-one and onto.

## Composition of functions

Assume that $$f:X\to Y$$ and $$g:Y\to Z$$ are two functions. We define their composition $$g\circ f$$ as a function $$g\circ f:X\to Z$$ in the following way: For $$x\in X$$ we have: $g\circ f(x)= g\big(f(x)\big).$
Theorem.

Assume that $$f:X\to Y$$ and $$g:Y\to Z$$ are two functions. Then the following statements are true:

(a) If $$f$$ and $$g$$ are injective, then so is $$g\circ f$$;

(b) If $$f$$ and $$g$$ are surjective, then $$g\circ f$$ is surjective;

(c) If $$g\circ f$$ is injective, then $$f$$ is injective;

(d) If $$g\circ f$$ is surjective, then $$g$$ is surjective.

If a function $$f:X\to Y$$ is bijective then it has an inverse. In other words, there exists a bijective function $$g:Y\to X$$ such that $$g(f(x))=x$$ for all $$x\in X$$. Then we have $$g(f(y))=y$$ for all $$y\in Y$$.

The inverse of a function is denoted by $$f^{-1}$$.

You may have noticed that the symbol $$f^{-1}$$ is already used in this page. We used it to denote the pre-image of a set. Pre-image of the set exists always, while the inverse is a privilege of bijective functions only. From the context it is usually clear what we mean when we write $$f^{-1}($$ something$$)$$. For example, if that something’’ is a set, we mean the pre-image. If it is a number we are talking about inverse function.

2005-2020 IMOmath.com | imomath"at"gmail.com | Math rendered by MathJax