2 % Only the most commonly-used macros. Needed by everything else.
4 \ifx\havemjocommon\undefined
11 \ifx\restriction\undefined
15 % Place the argument in matching left/right parentheses.
16 \newcommand*
{\of}[1]{ \left(
{#1}\right)
}
18 % Group terms using parentheses.
19 \newcommand*
{\qty}[1]{ \left(
{#1}\right)
}
21 % Group terms using square brackets.
22 \newcommand*
{\sqty}[1]{ \left[{#1}\right] }
25 \newcommand*
{\pair}[2]{ \left(
{#1},
{#2}\right)
}
28 \newcommand*
{\triple}[3]{ \left(
{#1},
{#2},
{#3}\right)
}
30 % A four-tuple of things.
31 \newcommand*
{\quadruple}[4]{ \left(
{#1},
{#2},
{#3},
{#4}\right)
}
33 % A five-tuple of things.
34 \newcommand*
{\quintuple}[5]{ \left(
{#1},
{#2},
{#3},
{#4},
{#5}\right)
}
36 % A six-tuple of things.
37 \newcommand*
{\sextuple}[6]{ \left(
{#1},
{#2},
{#3},
{#4},
{#5},
{#6}\right)
}
39 % A seven-tuple of things.
40 \newcommand*
{\septuple}[7]{ \left(
{#1},
{#2},
{#3},
{#4},
{#5},
{#6},
{#7}\right)
}
42 % The factorial operator.
43 \newcommand*
{\factorial}[1]{ {#1}!
}
45 % Restrict the first argument (a function) to the second argument (a
46 % subset of that functions domain). Abused for polynomials to specify
47 % an associated function with a particular domain (also its codomain,
48 % in the case of univariate polynomials).
49 \newcommand*
{\restrict}[2]{{#1}{\restriction}_
{#2}}
50 \ifdefined\newglossaryentry
51 \newglossaryentry{restriction
}{
52 name=
{\ensuremath{\restrict{f
}{X
}}},
53 description=
{the restriction of $f$ to $X$
},
61 % All of the product spaces (for example, R^n) that follow default to
62 % an exponent of ``n'', but that exponent can be changed by providing
63 % it as an optional argument. If the exponent given is ``1'', then it
64 % will be omitted entirely.
67 % The natural n-space, N x N x N x ... x N.
68 \newcommand*
{\Nn}[1][n
]{
69 \mathbb{N
}\if\detokenize{#1}\detokenize{1}{}\else^
{#1}\fi
72 \ifdefined\newglossaryentry
74 name=
{\ensuremath{\Nn[1]}},
75 description=
{the set of natural numbers
},
80 % The integral n-space, Z x Z x Z x ... x Z.
81 \newcommand*
{\Zn}[1][n
]{
82 \mathbb{Z
}\if\detokenize{#1}\detokenize{1}{}\else^
{#1}\fi
85 \ifdefined\newglossaryentry
87 name=
{\ensuremath{\Zn[1]}},
88 description=
{the ring of integers
},
93 % The rational n-space, Q x Q x Q x ... x Q.
94 \newcommand*
{\Qn}[1][n
]{
95 \mathbb{Q
}\if\detokenize{#1}\detokenize{1}{}\else^
{#1}\fi
98 \ifdefined\newglossaryentry
100 name=
{\ensuremath{\Qn[1]}},
101 description=
{the field of rational numbers
},
106 % The real n-space, R x R x R x ... x R.
107 \newcommand*
{\Rn}[1][n
]{
108 \mathbb{R
}\if\detokenize{#1}\detokenize{1}{}\else^
{#1}\fi
111 \ifdefined\newglossaryentry
112 \newglossaryentry{R
}{
113 name=
{\ensuremath{\Rn[1]}},
114 description=
{the field of real numbers
},
120 % The complex n-space, C x C x C x ... x C.
121 \newcommand*
{\Cn}[1][n
]{
122 \mathbb{C
}\if\detokenize{#1}\detokenize{1}{}\else^
{#1}\fi
125 \ifdefined\newglossaryentry
126 \newglossaryentry{C
}{
127 name=
{\ensuremath{\Cn[1]}},
128 description=
{the field of complex numbers
},
134 % An indexed arbitrary binary operation such as the union or
135 % intersection of an infinite number of sets. The first argument is
136 % the operator symbol to use, such as \cup for a union. The second
137 % argument is the lower index, for example k=1. The third argument is
138 % the upper index, such as \infty. Finally the fourth argument should
139 % contain the things (e.g. indexed sets) to be operated on.
140 \newcommand*
{\binopmany}[4]{
141 \mathchoice{ \underset{#2}{\overset{#3}{#1}}{#4} }
142 { {#1}_
{#2}^
{#3}{#4} }
143 { {#1}_
{#2}^
{#3}{#4} }
144 { {#1}_
{#2}^
{#3}{#4} }
148 % The four standard (UNLESS YOU'RE FRENCH) types of intervals along
150 \newcommand*
{\intervaloo}[2]{ \left(
{#1},
{#2}\right)
} % open-open
151 \newcommand*
{\intervaloc}[2]{ \left(
{#1},
{#2}\right] } % open-closed
152 \newcommand*
{\intervalco}[2]{ \left[{#1},
{#2}\right)
} % closed-open
153 \newcommand*
{\intervalcc}[2]{ \left[{#1},
{#2}\right] } % closed-closed