67

What symbol should I use for a set complement? It seems that the \complement isn't quite appropriate: it seems taller (perhaps a unary operator to appear before a set?). I guess for now \mathsf{c} works.

Martin Scharrer
  • 262,582
gatoatigrado
  • 1,439
  • 4
    The amsfonts symbol \complement is often used, but there's no general consensus about an "official" symbol. I've seen it denoted in several different ways (personally, I don't like \complement). – egreg Apr 17 '11 at 07:56
  • Have a look at “How to look up a math symbol?” for ideas how you can easily find a particular symbol. – Martin Scharrer Apr 17 '11 at 07:58
  • 9
    Since the notion of a complement requires a containing set, if that set has a name, say X, then you can simply write $X\setminus A$ where A is the set for which you want the complement. – TH. Apr 17 '11 at 08:06

1 Answers1

69

As the commenters have said, there isn't a strong consensus on this one. Here are a few conventions I know about:

\documentclass{minimal}
\usepackage{amsmath}
\usepackage{amssymb}

\newcommand{\eqn}{\[
    \stcomp{(A \cup B)} = \stcomp{A} \cap \stcomp{B}
\]}

\begin{document}

\newcommand{\stcomp}[1]{{#1}^\complement}  \eqn
\renewcommand{\stcomp}[1]{\overline{#1}}           \eqn
\renewcommand{\stcomp}[1]{{#1'}}           \eqn
\renewcommand{\stcomp}[1]{\widetilde{#1}}           \eqn
\renewcommand{\stcomp}[1]{{#1}^{\sim}}           \eqn
\renewcommand{\stcomp}[1]{{#1}^{\mathsf{c}}}           \eqn
\renewcommand{\stcomp}[1]{X\setminus{#1}}           \eqn

\end{document}

sample code

Of all of these I've used ^\complement the most, and the overbar is the one I've seen the most. I have to say I really like your ^\mathsf{c} implementation.

Matthew Leingang
  • 44,937
  • 14
  • 131
  • 195
  • 1
    My textbooks use the minus sign, so that $X - A$ picks out the set of members of X that aren't in A. Is the minus sign commonly used for something else? – twofeet Feb 18 '13 at 21:04
  • 5
    If X is an abelian monoid (i.e., has a subtraction operation) then X-A could be the set of all elements of X which can be expressed as difference of elements of X and A. But I can't say that's a very popular usage. I would be reluctant to use the minus sign when \setminus is available. – Matthew Leingang Feb 20 '13 at 20:40
  • 1
    Twofeet, do you mean that your textbooks write $-A$ for the complement of $A$ or simply that they write $X - A$ for the set difference? Either way, I suppose that $\setminus{A}$ (or $\setminus A$) would also be an option for the complement. – Toby Bartels Dec 05 '16 at 20:09