Dynamically size arrow \mapsto in function definition

Personaly, I think it is better to use:

enter image description here

\begin{align*}
  \xi \colon L^\infty(T) &\to \mathcal{L}(H^2)\\
  \phi &\mapsto T_\phi.
\end{align*}

Anyway, you can obtain what you want through

\documentclass{article}

\usepackage{amsmath}

\newcommand\phantomarrow[2]{%
  \setbox0=\hbox{$\displaystyle #1\to$}%
  \hbox to \wd0{%
    $#2\mapstochar
     \cleaders\hbox{$\mkern-1mu\relbar\mkern-3mu$}\hfill
     \mkern-7mu\rightarrow$}%
  \,}

\begin{document}

\begin{align*}
  \xi \colon &L^\infty(T) \to \mathcal{L}(H^2)\\
  &\phantomarrow{L^\infty(T)}{\phi} T_\phi.
\end{align*}

\end{document}

enter image description here


You may also want to try mathtools:

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}

\begin{document}

\begin{align*}
      \xi \colon &L^\infty(T) \to \mathcal{L}(H^2)\\
       &\phi \xmapsto{\phantom{L^\infty(T)}} T_\phi
\end{align*}

\end{document}

The output looks like:

mathtools output