# Spacing in \colon

Following this question the consistent way to write a function is f\colon A\to B, but if I want to write a cospan like the following

\documentclass[border=1mm]{standalone}
\usepackage{mathtools}

\begin{document}
$$0\colon 1\to I\leftarrow 1\colon 1$$
\end{document}


it gives this result in which the second \colon has not the correct spacing. So, is there a way to be consistent with the document and have correct spacing?

You can use the \noloc command I defined for a similar purpose

\newcommand\noloc{%
\nobreak
\mspace{6mu plus 1mu}
{:}
\nonscript\mkern-\thinmuskip
\mathpunct{}
\mspace{2mu}
}


Full example:

\documentclass{article}
\usepackage{amsmath}

\newcommand\noloc{%
\nobreak
\mspace{6mu plus 1mu}
{:}
\nonscript\mkern-\thinmuskip
\mathpunct{}
\mspace{2mu}
}

\begin{document}

$$0\colon 1\to I\leftarrow 1\noloc 1$$

\end{document}