27
$\begingroup$

I remember once hearing offhandedly that in set builder notation, there was a difference between using a colon versus a vertical line, e.g. $\{x: x \in A\}$ as opposed to $\{x\mid x \in A\}$. I've tried searching for the distinction, but have come up empty-handed.

$\endgroup$
  • 3
    $\begingroup$ It seems that some people use semicolon. $\endgroup$ – Martin Sleziak Oct 28 '15 at 15:00
  • 2
    $\begingroup$ @MartinSleziak Yes; in a paper I was the copy editor of, all three notations were used. The paper had three authors. ;-) $\endgroup$ – egreg Oct 28 '15 at 22:11
  • 1
    $\begingroup$ No difference, as others have stated. Just be consistent: in a paper or book always use the same. $\endgroup$ – egreg Oct 28 '15 at 22:12
40
$\begingroup$

There is no difference that I've ever heard of. I do strongly prefer "$\vert$" to "$\colon$", though, because I'm often interested in sets of maps, and e.g. $$\{f \mid f\colon \mathbb{R}\rightarrow\mathbb{C}\text{ with $f(6)=24$}\}$$ is easier to read than $$\{f: f\colon \mathbb{R}\rightarrow\mathbb{C}\text{ with $f(6)=24$}\}$$.

EDIT: Note that as Mike Pierce's answer shows, sometimes "$:$" is clearer. At the end of the day, use whichever notation is most clear for your context.

$\endgroup$
  • 19
    $\begingroup$ Except perhaps if the conditions require absolute values… $\endgroup$ – Bernard Oct 28 '15 at 2:05
  • $\begingroup$ @Bernard Certainly neither is perfect. (I rarely deal with absolute values, though.) I've seen a period, ".", used, and I like it - but I've never seen that used in a publication, so I wouldn't use it. $\endgroup$ – Noah Schweber Oct 28 '15 at 2:09
  • 2
    $\begingroup$ As an example where the colon might be preferable, take a set where membership is defined by divisibility conditions: $\{ d \in \mathbb{Z}^+: d|m \; \land \; d|n\}$. $\endgroup$ – Chester Oct 28 '15 at 12:25
  • 2
    $\begingroup$ $\{f \colon \mathbb{R} \to \mathbb{C} : f(6) =24 \}$ is also readable - double colon, but no double "f" $\endgroup$ – Carl Mummert Oct 28 '15 at 16:25
  • 1
    $\begingroup$ Oh, boy -- finally a legitimate excuse for me to drag out those $f \in \{ \mathbb{R} \to \mathbb{C} \}$ or $f \in \mathbb{C}^\mathbb{R}$ notations! (Admittedly the former involves adding more brackets, but for some reason it doesn't bother me in the least, I guess because the nesting is so shallow (edit: and because the enclosed expression is tiny).) $\endgroup$ – Vandermonde Oct 28 '15 at 19:15
25
$\begingroup$

There is no difference. The bar is just often easier to read than the colon (like in the example in Noah Schweber's answer). However in analysis and probability, the bar is used in other notation. In analysis it is used for absolute value (or distance or norms) and in probability it is used in conditional statements (the probability of $A$ given $B$ is $\operatorname{P}(A \mid B)$). So looking at bar versus colon in sets with these notations $$ \{x \in X \mid ||x|-|y_0||<\varepsilon\} \quad\text{vs}\quad \{x \in X : ||x|-|y_0||<\varepsilon\} $$ $$ \{A \subset X \mid \operatorname{P}(B \mid A) > 0.42\} \quad\text{vs}\quad \{A \subset X : \operatorname{P}(B \mid A) > 0.42\} $$ it can be better to use the colon just to avoid overloading the bar.

$\endgroup$
  • 3
    $\begingroup$ In such cases I use different sizes of the vertical bar, e.g. $$\Big\{x\in X \ \Big|\ \big||x|-|y_0|\big| < \varepsilon \Big\}.$$ $\endgroup$ – dtldarek Oct 29 '15 at 14:29
  • 2
    $\begingroup$ @dtldarek, yeah, yours is clear to read (and I think looks better than with a colon). My only problem is that by making the bar taller, you can't really have this typed in-line or else the line-spread will start to look weird (like what happens when you see sums or products with $\sum$ or $\prod$ typed in-line). $\endgroup$ – Mike Pierce Oct 29 '15 at 14:59
9
$\begingroup$

It seems many good answers and examples have been provided, but I didn't see it mentioned above that regardless of which symbol you choose to use, in the set builder context both would be read aloud as "such that".

As for my example of preference, I am often working in number theory so I use the colon, ":", to avoid the bar being misinterpreted as "divides", or aesthetic reasons if I am also going to use the bar to mean divides in the specification of the set.

$\endgroup$
3
$\begingroup$

Both are acceptable means and practices within the community. Most people I know prefer the line method because it provides a clear separation and can be used if you are defining your set on multiple lines of scratch work.

$\endgroup$
  • $\begingroup$ There is also the semi-colon. $\endgroup$ – Bernard Oct 28 '15 at 2:06
  • 2
    $\begingroup$ And there's the old Principia notation $\hat{x}(\phi)$ which doesn't allow decorating the $x$, but otherwise is as clear as the notation in $\phi$. Or would be if anyone still recognized it. $\endgroup$ – Malice Vidrine Oct 28 '15 at 9:34
  • 2
    $\begingroup$ If anyone still recognized it, indeed $\endgroup$ – Carl Mummert Oct 28 '15 at 16:26
  • $\begingroup$ My multi-variable calculus professor used that notation last year. Haven't seen it pretty much anywhere else though :( $\endgroup$ – Brandon Klein Oct 29 '15 at 1:49
1
$\begingroup$

I recently realized I read them differently. To me | acts more like a "filter" over a larger set, whereas : acts more like a "generator" from a smaller expression.
This isn't 100% accurate though. I'm usually fine with : acting like a filter as well... but less so with | acting like a generator.

For example, this looks jarring to me:

\begin{align} t^* = \max \left\{ t_i\ \middle|\ \frac{\partial f_i}{\partial x_i} = 0 \right\} \end{align}

whereas this looks fine to me:

\begin{align} t^* = \max \left\{ t_i : \frac{\partial f_i}{\partial x_i} = 0 \right\} \end{align}

This is because when I read $t_i\ |\ \ldots$ I expect the right-hand side to contain some constraints on the possible values of $t_i$, which I otherwise assume to be all reasonable values (e.g. all real numbers).
But when I read $t_i : \ldots$ I expect to see an expression that tells me how to generate the set of $t_i$, and that need not involve $t_i$ itself at all.

I don't know if everyone reads them like this, but for me they are not quite always interchangeable, even though they frequently are.

$\endgroup$
  • 1
    $\begingroup$ Both look jarring, since $t_i$ is not even a variable in the RHS statement. $\endgroup$ – Asaf Karagila Mar 3 '17 at 6:59
  • $\begingroup$ @AsafKaragila: Aw really? How would you have written it...? $\endgroup$ – Mehrdad Mar 3 '17 at 7:09
  • 1
    $\begingroup$ I don't know what you're trying to write, so I can't quite tell you. $\endgroup$ – Asaf Karagila Mar 3 '17 at 9:18
  • $\begingroup$ @AsafKaragila: I already have $t_1, \ldots, t_n$ and I have $f_i, \ldots, f_n$ and I have $x_1, \ldots, x_n$ (with the obvious correspondence across the sequences based on the indices). I'm trying to say "the $\max$ of all $t$'s corresponding to the $f$'s whose partial derivatives with respect to the corresponding $x$'s are zero". How would you say that? $\endgroup$ – Mehrdad Mar 3 '17 at 10:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.