[Tex/LaTex] Double align in equation environment

alignmath-mode

I have four lines inside an equation environment, and I'd like to align the first with the third and the second with the fourth. This is what I got so far:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}

\newcommand{\R}{\mathbb R}
\newcommand{\Rn}{\R^n}

\begin{document}
    \[
        \begin{aligned}
            &\begin{aligned}
                (+)~:&~\ \Rn \times \Rn \longrightarrow \Rn\\
                     &~\ (a_1,\,\dots,\,a_n),\,(b_1,\,\dots,\,b_n) \longmapsto
                    (a_1 + b_1,\,\dots,\,a_n + b_n)
            \end{aligned}\\
            &\begin{aligned}
                (\star)~:&~\ \R \times \Rn \longrightarrow \Rn\\
                         &~\ \lambda,\,(a_1,\,\dots,\,a_n) \longmapsto
                    (\lambda a_1,\,\dots,\,\lambda a_n)
            \end{aligned}
        \end{aligned}
    \]
\end{document}

This is the result:
result

However, I'd like to align the colons instead of the start of the line. Is that possible? I tried to use a tabular environment, but the result was terrible.

Best Answer

A single align* (or aligned inside equation*) will suffice.

Note that all of your added spacing commands ~ and \, are wrong. Also \longrightarrow and \longmapsto are, in my opinion, too prominent and add nothing to clarity.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}

\newcommand{\R}{\mathbb{R}}
\newcommand{\Rn}{\R^n}

\begin{document}

\begin{align*}
(+)\colon& \Rn \times \Rn \rightarrow \Rn \\
         & \bigl( (a_1,\dots,a_n),(b_1,\dots,b_n) \bigr) \mapsto (a_1 + b_1,\dots,a_n + b_n)
\\
(\star)\colon& \R \times \Rn \rightarrow \Rn \\
             & \bigl( \lambda,(a_1,\dots,a_n) \bigr) \mapsto (\lambda a_1,\dots,\lambda a_n)
\end{align*}

\end{document}

enter image description here

A possible refinement is instead adding some vertical space between the two map definitions:

\begin{align*}
(+)\colon& \Rn \times \Rn \rightarrow \Rn \\
         & \bigl( (a_1,\dots,a_n),(b_1,\dots,b_n) \bigr) \mapsto (a_1 + b_1,\dots,a_n + b_n)
\\[1ex]
(\star)\colon& \R \times \Rn \rightarrow \Rn \\
             & \bigl( \lambda,(a_1,\dots,a_n) \bigr) \mapsto (\lambda a_1,\dots,\lambda a_n)
\end{align*}

enter image description here