2

Resuming Using \colon or : in formulas? and Set notation: \colon vs :, let us take a look into Knuth's TeXbook on p. 174:

$\{\,x\mid x>5\,\}$    { x | x > 5 }
$\{\,x:x>5\,\}$        { x : x > 5 }

And on p. 438 we see:

f : A → B            $f\colon A\rightarrow B$
L(a, b; c: x, y; z)  $L(a,b;c\colon x,y;z)$

The AMS short math guide for LaTeX says (p. 12): “The command \colon produces special spacing for use in constructions such as f\colon A\to B f : A → B.”

In summary, these works advise you to use different commands for the colon (i.e., to use different spacing) in { x : x > 5 } and in f : A → B.

Now, let's assume that you do use the colon (with whichever spacing produced by whichever command) as a separator inside class terms (e.g., because the vertical bar | or the spot ⦁ are heavily used for other purposes). Purely syntactically, the term “{ x : p }” is a variable-binding construction: the curly brackets are a variable binder, and the colon is a separator. The term belongs formula-wise to the same class as “∀ x ⦁ p” / “∀ x : p”, where the quantifier is a variable binder and the spot / colon is a separator, or as “λ x. p”, where the small lambda is a variable binder and the period is a separator. So, it is overly logical that all these terms are typeset similarly, contradicting Knuth's TeXbook. But this would IMHO break the tradition: I never saw equal spacing around the separator in all three terms in the same text. Now, if you still do insist on consistency, which spacing would you choose and how would you implement this?

Some tests (partially meaningless):

\documentclass{article}
\pagestyle{empty}
\usepackage{amssymb}
\begin{document}\noindent
\(\{\,x\in\mathrm{Nat}\mathpunct{:} p\,\}\)\\
\(\forall\, x\in\mathrm{Nat}\mathpunct{:} p\)\\
\(\mathrm{\lambda}\, x\in\mathrm{Nat}\mathpunct{.} p\)\\\\
\(\{\,x\in\mathrm{Nat}\mathrel{:} p\,\}\)\\
\(\forall\, x\in\mathrm{Nat}\mathrel{:} p\)\\
\(\mathrm{\lambda}\, x\in\mathrm{Nat}\mathrel{.} p\)\\\\
\(\{\,x\in\mathrm{Nat}\mathpunct{\colon} p\,\}\)\\
\(\forall\, x\in\mathrm{Nat}\mathpunct{:} p\)\\
\(\mathrm{\lambda}\, x\in\mathrm{Nat}\mathpunct{.} p\)\\\\
\(\{\,x\in\mathrm{Nat}\mathrel{\colon} p\,\}\)\\
\(\forall\, x\in\mathrm{Nat}\mathrel{:} p\)\\
\(\mathrm{\lambda}\, x\in\mathrm{Nat}\mathrel{.} p\)
\end{document}

output

  • 4
    That's a question of personal taste and beliefs, I'm afraid. Choose your preferred notation, based on whatever consideration you see fit, and stick to it for the duration of the paper or book. – egreg Sep 14 '20 at 19:26
  • @egreg Thanks! Alright, I believe that there is nothing unique. But if I have to choose based on my beliefs and preferences, what would be at least the *set* of options I can choose from without reservation? It is clear to me that the set of *all* options (without reservations or with reservations, i.e., including the bad choices) would be huge; we are not talking about this huge set. –  Sep 15 '20 at 19:09

0 Answers0