What I want to do is having functions aligned properly with :
[Name of the function] : [First set] -> [Second set] and then [First variable(s)] -> [Second variable(s)].
The problem is it is either I use just one "&" to align or it is going to put an enourmous space before the second one (I also tried with "&" and then "&&"). I'm sure there is an easy way to do that since it is a pretty common thing to write

Here is my code :
Code: Select all
\documentclass{article}
\usepackage[frenchb]{babel}
\usepackage[utf8]{inputenc}
\usepackage{dsfont}
\usepackage{amsmath}
\usepackage[T1]{fontenc}
\begin{document}
\begin{align*}
Z : \mathds{N} &\longrightarrow \mathds{N} \\
x & \longrightarrow Z(x) = 0
\end{align*}
\begin{align*}
Z : & \mathds{N} &&\longrightarrow \mathds{N} \\
& x && \longrightarrow Z(x) = 0
\end{align*}
\end{document}