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:
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*
(oraligned
insideequation*
) 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.A possible refinement is instead adding some vertical space between the two map definitions: