[Tex/LaTex] Aligning definition of a function that maps into a function space

alignmath-modespacing

I'm writing a proof that the dual of l^p is l^q, and in that process, I define a function from l^q to (l^p)*. My current function definition looks like this:

\begin{align*}
  \varphi:\ell^q\longrightarrow (\ell^p)^*& \\
  \mathbf{x}\longmapsto f_{\mathbf{x}}:&\ell^p \longrightarrow\mathbb{C} \\
  &\mathbf{y}\longmapsto\sum_{k=1}^\infty x_k y_k
\end{align*}

This produces the following result:

Typeset isomorphism

I would like to align the definition so that the arrows are directly above each other. I have tried to do this using alignment characters in the following manner:

\begin{align*}
  \varphi:\ell^q&\longrightarrow& (\ell^p)^*& \\
  \mathbf{x}&\longmapsto& f_{\mathbf{x}}:\ell^p &\longrightarrow&\mathbb{C} \\
  &&\mathbf{y}&\longmapsto&\sum_{k=1}^\infty x_k y_k
\end{align*}

This gives the desired alignment, but mucks up the spacing:
enter image description here

I wonder if there's a way to typeset this so that the arrows are aligned, but no additional spacing is produced.

Best Answer

Use alignat*:

\documentclass{article}
\usepackage{amsmath,amssymb}
\begin{document}
  \begin{alignat*}{2}
  \varphi:\ell^q&\longrightarrow& (\ell^p)^* \\
  \mathbf{x}&\longmapsto& f_{\mathbf{x}}:\ell^p &\longrightarrow\mathbb{C} \\
  &&\mathbf{y}&\longmapsto\sum_{k=1}^\infty x_k y_k
\end{alignat*}
\end{document}

enter image description here

Related Question