# 1.2: Functions

$$\newcommand{\vecs}{\overset { \rightharpoonup} {\mathbf{#1}} }$$ $$\newcommand{\vecd}{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$$$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}{\| #1 \|}$$ $$\newcommand{\inner}{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}{\| #1 \|}$$ $$\newcommand{\inner}{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$$$\newcommand{\AA}{\unicode[.8,0]{x212B}}$$

If $$A$$ and $$B$$ are sets, we call a relation $$R \subset A \times B$$ a function with domain $$A$$ if for every $$a \in A$$ there exists one, and only one, $$b \in B$$ such that $$(a, b) \in R .$$ We typically indicate such a relation with the notation $$f: A \rightarrow B,$$ and write $$f(a)=b$$ to indicate that $$(a, b) \in R .$$ We call the set of all $$b \in B$$ such that $$f(a)=b$$ for some $$a \in A$$ the range of $$f .$$ With this notation, we often refer to $$R$$ as the graph of $$f$$.

We say $$f: A \rightarrow B$$ is one-to-one if for every $$b$$ in the range of $$f$$ there exists a unique $$a \in A$$ such that $$f(a)=b .$$ We say $$f$$ is onto if for every $$b \in B$$ there exists at least one $$a \in A$$ such that $$f(a)=b .$$ For example, the function $$f: \mathbb{Z}^{+} \rightarrow \mathbb{Z}^{+}$$ defined by $$f(z)=z^{2}$$ is one-to-one, but not onto, whereas the function $$f: \mathbb{Z} \rightarrow \mathbb{Z}$$ defined by $$f(z)=z+1$$ is both one-to-one and onto.

Given two functions, $$g: A \rightarrow B$$ and $$f: B \rightarrow C,$$ we define the composition, denoted $$f \circ g: A \rightarrow C,$$ to be the function defined by $$f \circ g(a)=f(g(a))$$.

If $$f: A \rightarrow B$$ is both one-to-one and onto, then we may define a function $$f^{-1}: B \rightarrow A$$ by requiring $$f^{-1}(b)=a$$ if and only if $$f(a)=b$$. Note that this implies that $$f \circ f^{-1}(b)=b$$ for all $$b \in B$$ and $$f^{-1} \circ f(a)=a$$ for all $$a \in A .$$ We call $$f^{-1}$$ the inverse of $$f$$.

Given any collection of nonempty sets, $$\left\{A_{\alpha}\right\}, \alpha \in I,$$ we assume the existence of a function $$\phi: I \rightarrow B=\bigcup_{\alpha \in I} A_{\alpha},$$ with the property that $$\phi(\alpha) \in A_{\alpha} .$$ We call such a function a choice function. The assumption that choice functions always exist is known as the Axiom of Choice.

This page titled 1.2: Functions is shared under a CC BY-NC-SA 1.0 license and was authored, remixed, and/or curated by Dan Sloughter via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.