2 % Only the most commonly-used macros. Needed by everything else.
4 \ifx\havemjocommon\undefined
11 % Place the argument in matching left/right parentheses.
12 \newcommand*
{\of}[1]{ \left(
{#1}\right)
}
14 % Group terms using parentheses.
15 \newcommand*
{\qty}[1]{ \left(
{#1}\right)
}
17 % Group terms using square brackets.
18 \newcommand*
{\sqty}[1]{ \left[{#1}\right] }
20 % Create a set from the given elements
21 \newcommand*
{\set}[1]{\left\lbrace{#1}\right\rbrace}
23 % A set comprehension, where the ``such that...'' bar is added
24 % automatically. The bar was chosen over a colon to avoid ambiguity
25 % with the L : V -> V notation. We can't leverage \set here because \middle
26 % needs \left and \right present.
27 \newcommand*
{\setc}[2]{\left\lbrace{#1}\
\middle|\
{#2} \right\rbrace}
30 \newcommand*
{\pair}[2]{ \left(
{#1},
{#2}\right)
}
33 \newcommand*
{\triple}[3]{ \left(
{#1},
{#2},
{#3}\right)
}
35 % A four-tuple of things.
36 \newcommand*
{\quadruple}[4]{ \left(
{#1},
{#2},
{#3},
{#4}\right)
}
38 % A five-tuple of things.
39 \newcommand*
{\quintuple}[5]{ \left(
{#1},
{#2},
{#3},
{#4},
{#5}\right)
}
41 % A six-tuple of things.
42 \newcommand*
{\sextuple}[6]{ \left(
{#1},
{#2},
{#3},
{#4},
{#5},
{#6}\right)
}
44 % A seven-tuple of things.
45 \newcommand*
{\septuple}[7]{ \left(
{#1},
{#2},
{#3},
{#4},
{#5},
{#6},
{#7}\right)
}
47 % The direct sum of two things.
48 \newcommand*
{\directsum}[2]{ {#1}\oplus{#2} }
50 % The direct sum of three things.
51 \newcommand*
{\directsumthree}[3]{ \directsum{#1}{\directsum{#2}{#3}} }
53 % The factorial operator.
54 \newcommand*
{\factorial}[1]{ {#1}!
}
59 % All of the product spaces (for example, R^n) that follow default to
60 % an exponent of ``n'', but that exponent can be changed by providing
61 % it as an optional argument. If the exponent given is ``1'', then it
62 % will be omitted entirely.
65 % The natural n-space, N x N x N x ... x N.
66 \newcommand*
{\Nn}[1][n
]{
67 \mathbb{N
}\if\detokenize{#1}\detokenize{1}{}\else^
{#1}\fi
70 \ifdefined\newglossaryentry
72 name=
{\ensuremath{\Nn[1]}},
73 description=
{the set of natural numbers
},
78 % The integral n-space, Z x Z x Z x ... x Z.
79 \newcommand*
{\Zn}[1][n
]{
80 \mathbb{Z
}\if\detokenize{#1}\detokenize{1}{}\else^
{#1}\fi
83 \ifdefined\newglossaryentry
85 name=
{\ensuremath{\Zn[1]}},
86 description=
{the ring of integers
},
91 % The rational n-space, Q x Q x Q x ... x Q.
92 \newcommand*
{\Qn}[1][n
]{
93 \mathbb{Q
}\if\detokenize{#1}\detokenize{1}{}\else^
{#1}\fi
96 \ifdefined\newglossaryentry
98 name=
{\ensuremath{\Qn[1]}},
99 description=
{the field of rational numbers
},
104 % The real n-space, R x R x R x ... x R.
105 \newcommand*
{\Rn}[1][n
]{
106 \mathbb{R
}\if\detokenize{#1}\detokenize{1}{}\else^
{#1}\fi
109 \ifdefined\newglossaryentry
110 \newglossaryentry{R
}{
111 name=
{\ensuremath{\Rn[1]}},
112 description=
{the field of real numbers
},
118 % The complex n-space, C x C x C x ... x C.
119 \newcommand*
{\Cn}[1][n
]{
120 \mathbb{C
}\if\detokenize{#1}\detokenize{1}{}\else^
{#1}\fi
123 \ifdefined\newglossaryentry
124 \newglossaryentry{C
}{
125 name=
{\ensuremath{\Cn[1]}},
126 description=
{the field of complex numbers
},
132 % An indexed arbitrary binary operation such as the union or
133 % intersection of an infinite number of sets. The first argument is
134 % the operator symbol to use, such as \cup for a union. The second
135 % argument is the lower index, for example k=1. The third argument is
136 % the upper index, such as \infty. Finally the fourth argument should
137 % contain the things (e.g. indexed sets) to be operated on.
138 \newcommand*
{\binopmany}[4]{
139 \mathchoice{ \underset{#2}{\overset{#3}{#1}}{#4} }
140 { {#1}_
{#2}^
{#3}{#4} }
141 { {#1}_
{#2}^
{#3}{#4} }
142 { {#1}_
{#2}^
{#3}{#4} }
146 \newcommand*
{\directsummany}[3]{ \binopmany{\bigoplus}{#1}{#2}{#3} }
149 % The four standard (UNLESS YOU'RE FRENCH) types of intervals along
151 \newcommand*
{\intervaloo}[2]{ \left(
{#1},
{#2}\right)
} % open-open
152 \newcommand*
{\intervaloc}[2]{ \left(
{#1},
{#2}\right] } % open-closed
153 \newcommand*
{\intervalco}[2]{ \left[{#1},
{#2}\right)
} % closed-open
154 \newcommand*
{\intervalcc}[2]{ \left[{#1},
{#2}\right] } % closed-closed