Consider the sets \begin{align*} \mathcal{A} &= \{1,2,3,5,7\}\\ \mathcal{B} &= \{2,4,6,8\}\\ \mathcal{R} &= \{2,5\} \end{align*}

I want to remove the elements in $\mathcal{R}$ from $\mathcal{A}$ and $\mathcal{B}$.

Does it make sense to write: \begin{align*} \mathcal{A}\backslash\mathcal{R} &= \{1,3,7\}\\ \mathcal{B}\backslash\mathcal{R} &= \{4,6,8\} \end{align*} even though $\mathcal{B}$ does not contain element $5$? I am asking because I have multiple sets that I want to remove a set of elements from, but I do not know if the sets contain the elements to remove. I cannot think of an alternative notation.

  • $\begingroup$ @Hurkyl Yes, thank you, edited. $\endgroup$
    – jonem
    Commented Nov 5, 2014 at 23:35
  • 1
    $\begingroup$ Yeah it's just perfect write it this way! $\endgroup$
    – brick
    Commented Nov 5, 2014 at 23:38

2 Answers 2


Your notation is perfect.

By definition, $X\setminus Y$ is the set of elements that belong to $X$ but not to $Y$.
It is irrelevant whether $Y$ is a subset of $X$ or not.

BTW, the correct TeX macro is \setminus, not \backslash. See also this.

  • 1
    $\begingroup$ I've always wondered: is there a historical reason (or a reason at all) to notate the subtraction of sets as $A \setminus B$ instead of just $A-B$? (Also, small edit: "Your notation" instead of "you notation") $\endgroup$ Commented Nov 6, 2014 at 0:01
  • 2
    $\begingroup$ @Miguelgondu, perhaps to avoid confusion in case subtraction makes sense for elements of $A$ and $B$. For instance, in the real line or in a vector space. But I don't know the historical reason. $\endgroup$
    – lhf
    Commented Nov 6, 2014 at 0:04
  • $\begingroup$ I'm mostly self taught but my impression is that using the same syntax for similar concepts can be a double-edged sword. You can make a lot of accurate connections/generalizations while the analogy holds, but where it doesn't, the familiarity works against you. If I were designing the notation I might think of a few counter-intuitive examples - like 0-A=0 and A-B-B=A-B, in the spirit of this question - and pick some obscure symbol to avoid creating so many pitfalls. These days you have options - perhaps A🍆B? A💩B? No? $\endgroup$
    – John P
    Commented Sep 27, 2019 at 16:17

This notation is usually shorthand for $B\cap R^c$. So this works fine if you imagine all your sets are subsets of some common set: in this case they're all subsets of $\mathbf{N}$ the natural numbers. It's also possible to write $B\setminus (R\cap B)$ if the situation worries you.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .