> [!Definition] Definition (A Function is a Graphical Relation) > Suppose that $X$ and $Y$ are sets. A [[Binary Relation|binary relation]] $G: X\to Y$ is *graphical* if for every $x \in X,$ there is exactly one $y \in Y$ such that $(x,y) \in G.$ > > A *function (or map or mapping)* $f: X\to Y$ is a *graphical relation* $G$, from $X$ to $Y$. If $(x,y)$ lies in $G$, we may write $f(x) = y$. > [!Example] Examples > - [[Real Function]]. > - [[Vector-Valued Function of Real variable]]. # Properties **Composition**: Given two functions $f:X\to Y$ and $g:Y\to Z,$ their [[Function Composition|composition]] is the function $g\circ f:X\to Z$ defined by $(g\circ f)(x)=g(f(x)).$ **Image & Preimage**: If $A$ is any subset of $X,$ then the [[Image of a set under a function|image]] of $A$ under $f,$ denoted $f(A),$ is the subset of the codomain $Y$ consisting of all images of elements of $A.$ The _image_ of _f_ is the image of the whole domain $f(X)$ is called the **range** of $f.$ On the other hand, [[Preimage (of set under a function)|preimage]] under $f$ of an element $y$ of the codomain $Y$ is the set of all elements of the domain $X$ whose images under $f$ equal $y.$ **Inverse:** Given functions $f:X\to Y$ and $g:Y\to X$ such that $g \circ f = \text{Id}_{X},$ the [[Identity Function|identity function]] on $X,$ we say that $g$ is the *left inverse* of $f$ or $f$ is the *right inverse* of $g.$ If $g \circ f=\text{Id}_{X}$ and $f \circ g=\text{Id}_{Y}$ then $g$ is an *[[Function Inverse|inverse]]* for $y$ and vice versa. **Correspondence**: (1) A function [[Injection|injective]] if unique domain elements map to unique elements of the codomain. A function is [[Surjection|surjective]] if every element of the codomain is mapped to by some element of the domain. A [[Bijection|bijection]] is a function that is both injective and surjective (i.e. one-to-one). (2) Note that a function is injective iff it is a left-invertible. It also true that a function is surjective iff it is right-invertible - the idea being that for each element of the codomain we can pick an element from its preimage using the *axiom of choice*. Hence a function is one-to-one iff it has a unique inverse.