# Inverse Functions: Definition and Horizontal Line Test (Part 3)

From MathWorld, a function $f: A \to B$  is an object $f$ such that every $a \in A$ is uniquely associated with an object $f(a) \in B$. Stated more pedantically, if $a_1, a_2 \in A$ and $a_1 = a_2$, then $f(a_1) = f(a_2)$. More colloquially, in the graphs that ordinarily appear in secondary school, every $x-$coordinate of the graph is associated with a unique $y-$coordinate.

For this reason, the figure below (taken from http://en.wikipedia.org/wiki/Vertical_line_test) is not a function. The three points share a common $x-$coordinate but have different $y-$coordinates. In school, we usually teach students to distinguish functions from non-functions by the Vertical Line Test.

It is possible for a function to be a function but not have an inverse. Also from MathWorld, a function $f$ is said to be an injection (or, in the lingo that I learned as a student, one-to-one) if, whenever $f(x_1) = f(x_2)$, it must be the case that $x_1=x_2$. Equivalently, $x_1 \ne x_2$ implies $f(x_1) \ne f(x_2)$.  In other words, $f$ is an injection if it maps distinct objects to distinct objects.

The following image (taken from http://en.wikipedia.org/wiki/Horizontal_line_test) illustrates a function that is not injective (or, more accurately, is not injective when using all of the function’s domain). The horizontal line intersects the graph of the function at three distinct points with three different $x-$intercepts which are associated with the same $y$-coordinate.

By ensuring that the range of $f$ is restricted to the values that are actually attained by $f$, the function $f$ may be considered as bijective and hence has an inverse function. The inverse function $f^{-1}$ is logically defined as

$f^{-1}(y) = x \quad \Longleftrightarrow \quad f(x) = y$

In this way, $f^{-1}(f(x)) = x$ and $f \left( f^{-1}(y) \right) = y$ for all $x$ in the domain of $f$ and all $y$ in the range of $f$. Becaise $(x,y)$ is on the graph of $f$ if and only if $(y,x)$ is on the graph of $f^{-1}$, the graph of $f^{-1}$ may be obtained by reflecting the graph of $y = f(x)$ through the line $y = x$. Stated another way, to ensure that $f^{-1}$ is a function that satisfies the horizontal line test, it must be the case (when looking at the reflection through $y= x$ that the original function satisfies the horizontal line test.