I would like to define a mathematical function by its action. Something like
\documentclass{article}
\begin{document}
\[
\begin{array}{cccc}
f\colon & R\times R & \rightarrow & R\times R\\
& v & \mapsto & f(v)
\end{array}
\]
\end{document}
In this way, spacing is horrible. What is the best way to produce it?
I want the elements in the second line centered with respect to the element of the first line.

