]> gitweb.michael.orlitzky.com - mjotex.git/blobdiff - mjo-set.tex
mjo-set: adopt basic set operations from mjo-common.
[mjotex.git] / mjo-set.tex
index 23ea691b6654dc54200dcdeea4aa91ac65e029f2..2134e640c51d7edfb62d8cdef726efe39bde7922 100644 (file)
@@ -4,18 +4,25 @@
 \ifx\havemjoset\undefined
 \def\havemjoset{1}
 
+\input{mjo-common} % binopmany
 \input{mjo-font} % amsfonts and \mathpzc
 
 \ifx\operatorname\undefined
   \usepackage{amsopn}
 \fi
 
+\ifx\bigtimes\undefined
+  \usepackage{mathtools}
+\fi
+
+
 % The cardinality of a set. The |X| notation conflicts with the
 % absolute value, and the meaning of card(X) is clear at once, so we
 % prefer the latter.
 \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}{
 \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} }
+
+
 \fi