# Semicolon in set-builder notation

What is the best way to type ";" in the set-builder notation?

I think \{\, x \in X \mid P(x) \,\} is a common way to type the set-builder notation. Someone use ":" instead of "|". Anyway, these symbols frequently used in mathematics and I feel uncomfortable when I see the ones similar to the followings (\mid and \lvert or \colon and : are overlapping).

SL(V) = { L ∈ GL(V) | |L| = 1 } = { L : V → V : |L| = 1 }

A possible typesetting might be \{\, x \in X \,;\, P(x) \,\}. I'd like to ask, however, if there is a good practice like \mid for this. If there is another, what differs from the one that I showed? Thank you.

Edit for clarification The ones use "|" or ":" are just examples to explain why I dislike it. What I want to know is whether there is a better way to type ";" in this context or not.

-

First of all you should define a command for the separation symbol, so that you're sure it will be uniform in the whole document.

I propose four different choices, select the one which you like most.

\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator{\GL}{GL}
\DeclareMathOperator{\SL}{SL}

\begin{document}

\newcommand{\ssep}{\mid}

$\SL(V)=\{\, L\in\GL(V) \ssep \lvert L\rvert=1 \,\}= \{\, L\colon V\to V \ssep \lvert L\rvert=1 \,\}$

\medskip

\renewcommand{\ssep}{:}

$\SL(V)=\{\, L\in\GL(V) \ssep \lvert L\rvert=1 \,\}= \{\, L\colon V\to V \ssep \lvert L\rvert=1 \,\}$

\medskip

\renewcommand{\ssep}{\,;\,}

$\SL(V)=\{\, L\in\GL(V) \ssep \lvert L\rvert=1 \,\}= \{\, L\colon V\to V \ssep \lvert L\rvert=1 \,\}$

\medskip

\renewcommand{\ssep}{;}

$\SL(V)=\{\, L\in\GL(V) \ssep \lvert L\rvert=1 \,\}= \{\, L\colon V\to V \ssep \lvert L\rvert=1 \,\}$

\end{document}


My choice would be for the colon or the bar.

I would never denote by \lvert L\rvert the determinant of a matrix, which would avoid problems with two consecutive bars. Using \colon for the symbol in map denotations prevents confusion if the colon is used.

-
Thank you for answer. In short, defining new command recommended for unity but there is no shortcut like \mid, right? –  Taro Dec 18 '13 at 14:21
Minor point: if you change |V| to |L| and better answer doesn't appear in a day or so, I would accept this. (If you re-edit, I will delete this comment.) –  Taro Dec 18 '13 at 14:24
@Taro I don't see how the content of his sets in the examples can possibly affect your decision to accept this answer or not. –  Pål GD Dec 18 '13 at 14:43
@PålGD It is mathematically nonsense. So it may not good for him and me to accept it without correcting. In that sense, it is minor point. –  Taro Dec 18 '13 at 14:46

I agree with the rest, but would just like to show what I tend to do in recent projects.

I would like the code to make more sense in it self and I want to hide the symbol.

\usepackage{mathtools}
\newcommand\SetSymbol[1][]{\:#1\vert\:}
\providecommand\given{} % to make it exist
\DeclarePairedDelimiterX\Set[1]\{\}{\renewcommand\given{\SetSymbol[\delimsize]}#1}


Which is then used as

\Set{ x\in A \given x^2 \geq 3 }


Then in the same manner as we do with siunitx, the code makes sense when read aloud.

A similar construction can be used to define a probability operator with build in support for conditional probabilities.

-
Thank you for providing clean way to type the set-builder notation. Though it is not directly refer to the question that I asked, I love it. –  Taro Dec 18 '13 at 14:41
The whole idea is now just just build your symbol into the \SetSymbol macro, job done. Very much in the same line as the other answers. –  daleif Dec 18 '13 at 14:53

Your question does not seem to be about TeX, rather about math, but anyways, I'll try to give some points:

• You can use vertical bar, colon or semicolon.

• However, please! do not mix them in one paper!!!

• For the example with funtion definition, you can do

\{ L : L \text{ is a function } V \to V,\ \lvert L\rvert=1 \}

• I tend to use bold colon with the help of \usepackage{bm}, and I use \usepackage{mathtools}' \DeclarePairedDelimiterX:

\DeclarePairedDelimiterX\set[2]\lbrace\rbrace{#1 \bm: #2}
\DeclarePairedDelimiter\abs\lvert\rvert

...
\set{L}{L \text{ is a function } V \to V,\ \abs{L}=1}


-
Bold colon? No way. –  egreg Dec 18 '13 at 7:55
Thank you for answer. But the ones use "|" or ":" are just examples to explain why I dislike it. What I want to know is whether there is a better way to type ";" in this context or not. –  Taro Dec 18 '13 at 7:56
Also, L \text{ is a function } V \to V sounds awkward. Either write it all out, or use symbols all the way. –  Stephan Lehmke Dec 18 '13 at 10:01