# Difference between {… | …} and {… : …}

Is there a difference between the following two set related notations:

$$\{~\dots~:~\dots~\}~\text{vs.}~\{~\dots~|~\dots~\}?$$

I take it they both mean "such that" but I was wondering why some authors prefer one to the other, maybe there is a historical background to it?

• I usually prefer the latter, but in some texts use the former (esp. when the conditions are full of $|x|$ and $y\mid z$) – Hagen von Eitzen Sep 21 '15 at 10:29
• @HagenvonEitzen In a paper I was making up for a conference proceeding volume, the separator was $|$, $:$ or $;$, with no apparent reason, except for the fact that the paper had three authors. – egreg Sep 21 '15 at 10:35
• What is the difference between $]a,b[$ and $(a,b)$ and why do some authors prefer one to the other? – Asaf Karagila Sep 21 '15 at 10:39
• Note that "such that" is not what the symbol means, but merely how the notation is pronounced. The meaning of the symbol $\{x\mid \phi(x)\}$ is the unique set $y$ with the property $\forall x(x\in y\leftrightarrow \phi(x))$. – Henning Makholm Sep 21 '15 at 10:41
• @AsafKaragila Same here, I guess. I was raised with the former, but mostly use the latter (esp. because you need \left and \right to get good spacing with the former), but am unhappy with it if I need ordered pairs in the same text ... :) – Hagen von Eitzen Sep 21 '15 at 10:41

it's exactly the same. But if you need a "such that " twice, it's better to use $\mid$ and then $:$. For example, $$\{y\mid \exists x\in \mathbb R: y=f(x)\}$$

• why is $| \ldots :$ better than $:\ldots |$? – Matthew Towers Sep 21 '15 at 16:38
• Well, graphically it looks better :-) – idm Sep 22 '15 at 9:52

They are the same, but there are occasion where one would be less practical to use. For example the $|$ sign has uses that makes $|$ non-practical for set building. For example $\{P|ab: P\in X\}$ (ie the set of distances to the line $ab$ for points in $X$) and $\{f|_A: f\in X\}$ (ie the set of restrictions to $A$ for functions in $X$) would be less obvious if you used $|$ sign instead of $:$ sign. There are other uses for the $:$ sign to (fx mappings which would lead to constructs like $\{f:\mathbb R\to \mathbb Z|\, f(-x)=f(x)\}$) so if there's risk of running into these cases the author should select the notation that results in the least confusing set-building notation.

There is no difference between both notation. One author may prefer the first one, the other the second one. See https://en.wikipedia.org/wiki/Set-builder_notation for more details.