How to typeset the definition of a complicated bijection with nice horizontal alignment?

Here is a typical example of what I am talking about:

\begin{align*}
\mathcal{L}                        &\simeq     O^{-1}(T, S) \\
V                                  &\mapsto    f_V := \pi_S \circ \left(\pi_T |_V\right)^{-1} \\
V_f := \{t + f(t) | t \in T\} &\leftarrow f
\end{align*}


The result looks messy in my opinion. I would like everyting to be aligned in the center, and the arrows to extend accordingly --- something that would look like the following:

           ~
X ----------> Y
x |------> yyyyyyy
xxxxxxxxx <----| yyy


I suppose I could use the array environment, but how to typeset extensible arrows? A similar question was answered in Dynamically size arrow \mapsto in function definition ; but I do not understand that piece of code, so I do not know how to adapt it (and if it is at all possible).

-
Welcome to TeX.SX! Please, don't show code that needs guessing at the definitions of the commands used. Either simplify it or provide the definitions. – egreg May 18 '12 at 15:05
My mistake. Sorry about that! These macros are unessential for the point I wanted to make, I just removed them. – Ilia Smilga May 19 '12 at 21:26

You need a "diagram making" package. I know Xy-pic, but also tikz-cd can be used:

\documentclass{article}
\usepackage[all,cmtip]{xy}
\begin{document}

\xymatrix@R=3pt{
\mathcal{L} \ar@{<->}[r]^{\sim} &  O^{-1}(T, S) \\
V \ar@{|->}[r] & f_V := \pi_S \circ (\pi_T|_V)^{-1} \\
V_f := \{t + f(t)\mid t \in T\} & f \ar@{|->}[l]
}

\end{document}


Here's the version with tikz-cd:

\documentclass{article}
\usepackage{tikz-cd}

\begin{document}

\begin{tikzcd}[row sep=tiny]
\mathcal{L} \arrow[leftrightarrow]{r}{\sim} & O^{-1}(T, S) \\
V \arrow[mapsto]{r} & f_V := \pi_S \circ (\pi_T|_V)^{-1} \\
V_f := \{t + f(t)\mid t \in T\} & f \arrow[mapsto]{l}
\end{tikzcd}

\end{document}


-
OK, I will look into it. Thank you! – Ilia Smilga May 23 '12 at 7:25