Is there a way to produce a space that disappears at the beginning or end of a math formula?
Idea: For the formula-final case, something that looks ahead or takes an obligatory argument might be a start. I remember that commands whose obligatory arguments are terminated by the end of a math formula will be fed empty arguments.
Some practical examples:
Example 1
The uniqueness quantifier ("there exists exactly one") is often written "∃!".
Out of visual considerations I would like the following variable to be a bit away from the exclamation mark, to make it clearer that "∃!" is considered a single token ("token" here in the sense of parsing in a programming language). I can define something like \newcommand*{\existsunique}{\exists!\mskip1.5mu\relax}, but the space of 1.5mu remains if the symbol is used by itself:
\documentclass{article}
\usepackage{amsmath} % better spacing behavior for \colon
\usepackage{dsfont}
\newcommand*{\existsunique}{\exists!\mskip1.5mu\relax}
\begin{document}
% spacing (1.5mu) as desired
\(\forall x \in \mathds{R}^{+}_{0} \colon
\existsunique y \in \mathds{R}^{+}_{0} \colon
y^2 = x\)
% spacing (0mu) too tight
\(\forall x \in \mathds{R}^{+}_{0} \colon
\exists! y \in \mathds{R}^{+}_{0} \colon
y^2 = x\)
% spacing (1.5mu) superfluous
The quantifier \(\existsunique\) means ``there is exactly one''.
% spacing (0mu) as desired
The quantifier \(\exists!\) means ``there is exactly one''.
\end{document}

Here the first lines of each pair have additional spacing of 1.5mu after the uniqueness quantifier "∃!", while the second lines of each pair don't. For the first pair, the added spacing is as desired; for the second pair, it doesn't look good.
In this example, I would like a 1.5mu space that disappears at the end of a formula: the same macro should produce lines 1 and 4 above. Perhaps there is a different approach to "∃!", but this serves as one practical example to my general question above.
Example 2
For Heiko Oberdiek's intermediate-length arrows
\Implies(between\Rightarrowand\impliesin length)\Impliedby(between\Leftarrowand\impliedbyin length)\Iff(between\Leftrightarrowand\iffin length)
defined here, contextual deletion of spacing is desirable on both sides.


\existsuniquecommand, such like\,or\:(if you prefer it bigger). – Aradnix Dec 25 '13 at 04:46\mathbin{\exists!}works... somewhat. – Werner Dec 25 '13 at 05:32\mathop, but I'd like narrower spacing. – Lover of Structure Dec 25 '13 at 12:46$\mathop{\exists!}x$, the space between the exclamation mark and the variable is a thin space. Less than this would be almost indistinguishable from no space. Your "idea" is not really correct. – egreg Dec 25 '13 at 20:23\existsuniqueas\exists\mkern-1.5mu!, rather than adding the space at the right. – egreg Dec 25 '13 at 21:07$\mathop{\exists!}x$: The distance there is too wide for my taste. (One could argue whether one should think of it as a kern – as in "kerning table" – but I wrote\mskipinstead of\mkernsince conceptually spaces are the things that can disappear or change in certain places.) // About\exists\mkern-1.5mu!: That's a very good idea, though it leaves the general question unsolved. I picked "∃!" instead of "∃" for my example since it seemed easier to argue visually, but bare "∃" has a similar problem because the dual "∀"appears visually further away from what follows. – Lover of Structure Dec 26 '13 at 00:31$\forall\mathrm{X}$you can easily see there is no added space. I believe you're finding problems where there aren't. – egreg Dec 26 '13 at 11:42\mathrmfor variables. 4. Most importantly: If you compare\(\forall x\)and\(\exists x\), it's obvious that the kerning is bad (the ∃ appears too close, especially in contrast with ∀). But modifying kerning tables is a hassle, and it has to do with the lettershapes of these two quantifiers (it's a consistent difference between the two), so one working approach would be to deal with it consistently on the character level (as opposed to kerning pairs, for example). – Lover of Structure Dec 26 '13 at 19:00\foralland letters is defined. Good luck with that. – yo' Dec 30 '13 at 23:33\existsisn't so close to a following letter" -1muor1.5muof kerning can be enough. (In any case - yes, I agree ultimately it's a font design (kerning) issue.) – Lover of Structure Dec 31 '13 at 17:20