+\newcommand*{\card}[1]{ \operatorname{card}\of{{#1}} }
+
+
+% The powerset of (that is, the set of all subsets of) its argument.
+\newcommand*{\powerset}[1]{\mathpzc{P}\of{{#1}}}
+\ifdefined\newglossaryentry
+ \newglossaryentry{powerset}{
+ name={\ensuremath{\powerset{X}}},
+ description={the ``powerset,'' or set of all subsets of $X$},
+ sort=p
+ }
+\fi
+
+
+%
+% Basic set operations
+%
+
+% The union of its two arguments.
+\newcommand*{\union}[2]{ {#1}\cup{#2} }
+
+% A three-argument union.
+\newcommand*{\unionthree}[3]{ \union{\union{#1}{#2}}{#3} }
+
+% The indexed union of many things.
+\newcommand*{\unionmany}[3]{ \binopmany{\bigcup}{#1}{#2}{#3} }
+
+% The intersection of its two arguments.
+\newcommand*{\intersect}[2]{ {#1}\cap{#2} }
+
+% A three-argument intersection.
+\newcommand*{\intersectthree}[3]{ \intersect{\intersect{#1}{#2}}{#3} }
+
+% The indexed intersection of many things.
+\newcommand*{\intersectmany}[3]{ \binopmany{\bigcap}{#1}{#2}{#3} }
+
+% The Cartesian product of two things.
+\newcommand*{\cartprod}[2]{ {#1}\times{#2} }
+
+% The Cartesian product of three things.
+\newcommand*{\cartprodthree}[3]{ \cartprod{{#1}}{\cartprod{{#2}}{{#3}}} }
+
+% The indexed Cartesian product of many things.
+\newcommand*{\cartprodmany}[3]{ \binopmany{\bigtimes}{#1}{#2}{#3} }