# Other than $\setminus$ and $-$, are there any other notations for the set-theoretic difference of sets?

Let $X$ denote a set, and suppose that $B$ and $A$ are subsets thereof. Then the set-theoretic difference of $B$ and $A$ may be denoted in any of the following ways:

$$B \setminus A, \qquad B - A, \qquad B \cap A^c$$

I'm not entirely happy with any of these options, however:

1. $B \setminus A$ "looks" contravariant in the first argument and covariant in the second, but in actuality the opposite is true. Furthermore, if $A$ and $B$ are subsets of a non-commutative monoid $M$, I like to write $B \setminus A$ for the set of all $c \in M$ such that $Bc \subseteq A$. Notice that this is contravariant in the first argument and covariant in the second.

2. $B - A$ is a good option unless $X$ has an Abelian group structure, in which case there's a potential notational conflict with $\{b-a \mid b \in B, a \in A\}$.

3. $B \cap A^c$ is a good way of proving things about set-differences algebraically, but I don't think its a good idea to get rid of a symbol for set-theoretic difference altogether. It would be like getting rid of "$p$ if $q$" in favor of "$p$ or not $q$." Although this algebraic reduction can be useful, I think it kind of undermines clarity and readability.

I'm currently using $\setminus$, but I'd like to replace it with something else. The notation $A / B$ isn't a good option, because it looks like a quotient of the structure $A$ by the subobject $B$.

Question. Other than $\setminus$ and $-$, are there any other notations for the set-theoretic difference of sets?

• I agree with your objection to $B - A$. I find $B \cap A^c$ problematic: it suggests that $A^c$ is a set, but it is a proper class in any formulation of set theory that doesn't have a universal set (and set theories of that sort are not generally accepted). I see what you mean now about $B \mathop{\backslash} A$, but I think it is the "least worst" of the three. I suggest you think of a new symbol for your operator on subsets of a monoid. – Rob Arthan Sep 4 '15 at 20:48
• I have seen $B\sim A$ for the difference. – GEdgar Sep 4 '15 at 20:52
• @GEdgar: that looks too symmetric and too much like some kind of equivalence relation fro my tastes. – Rob Arthan Sep 4 '15 at 20:53
• Interestingly, contrary to @RobArthan, the objection against $B\setminus A$ made me consistently use $B-A$ instead, since it's only very rarely confusing, whereas the difference between right- and left cosets can be thoroughly confusing in several different situations. This might depend on the area of mathematics you're working in, though. I'd expect that for each subject at least one of the notations 1 and 2 should be clear. – HSN Sep 4 '15 at 20:55
• Ah. So it's an artefact of your experience with residuated lattices. No wonder I had no idea what you meant! – Cameron Buie Sep 5 '15 at 1:56

## 4 Answers

As stated in my comment, an alternative notation that I have started using is to write $A \, \lnot \, B$ for $A\setminus B$. This makes sense from my point of view as I've always read $A\setminus B$ as '$A$ not $B$', anyway. You might need to define your own command in LaTeX to get the spacing right, but that takes only a second.

There's a notation that I've seen in a point-set topology book: $\mathrm{C}_S \,(\mathrm{T})$ is notation for the complement of $\mathrm{T}$ relative to $\mathrm{S}$, or $\mathrm{S} \setminus \mathrm{T}$. See https://proofwiki.org/wiki/Definition:Relative_Complement.

I would suggest $A \nrightarrow B$ or $A\nRightarrow B$ because that is really what it is: The negation of the implication $A\to B := A^c \cup B$.

• I thought about this too, the problem is really the confusion with exponential objects: $A \rightarrow B$ is easy to mistake for $B^A$. – goblin Nov 20 '16 at 10:37
• How is that a problem? This is an exponential object (and $A \nrightarrow B$ is a coexponential) – Stefan Perko Nov 20 '16 at 10:38
• It's a bit like saying: why not write $A \times B$ in place of $A \cap B$? After all, they're both categorial products. – goblin Nov 20 '16 at 10:39
• @goblin I'm not. I use $A\to B$ in posets and $B^A$ in non-thin categories. How else are you going to denote implication in a Heyting algebra? – Stefan Perko Nov 20 '16 at 10:40
• It sounds like, subject to the conventions you personally use, there's no ambiguity, because $A \rightarrow B$ never means "the set of functions from $A$ to $B$" for you. But, according to your conventions, we have to be very careful not to analyse $f : A \rightarrow B$ as $f \in A \rightarrow B$, since $A \rightarrow B$ doesn't make sense. I'm not sure I like that. – goblin Nov 20 '16 at 10:45

A standard notation in Boolean calculus is to use $\bar A$ for the complement of $A$, $AB$ for $A \cap B$ and $A + B$ for $A \cup B$ and hence $B\bar A$ for $B \setminus A$ .

That being said, the most appropriate notation depends on the context. If you are working on Hausdorff's nested difference hierarchy, the notation $B - A$ proves to be very convenient (together with $B + A$ for the union). Actually, I tend to use more and more $B - A$ instead of $B \setminus A$. If $X$ has a group structure, there is ambiguity only if you use the group operation and the set difference at the same time. In this event, you may wish to use some temporary notation like $\dot{-}$ with a dot on top.