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 % A free-form tuple of things. Useful for when the exact number is not
43 % known, such as when \ldots will be stuck in the middle of the list,
44 % and when you don't want to think in column-vector terms, e.g. with
45 % elements of an abstract Cartesian product space.
46 \newcommand*
{\tuple}[1]{ \left(
{#1}\right)
}
48 % The "least common multiple of" function. Takes a nonempty set of
49 % things that can be multiplied and ordered as its argument. Name
50 % chosen for synergy with \gcd, which *does* exist already.
51 \newcommand*
{\lcm}[1]{ \operatorname{lcm
}\of{{#1}} }
52 \ifdefined\newglossaryentry
53 \newglossaryentry{lcm
}{
54 name=
{\ensuremath{\lcm{X
}}},
55 description=
{the least common multiple of the elements of $X$
},
60 % The factorial operator.
61 \newcommand*
{\factorial}[1]{ {#1}!
}
63 % Restrict the first argument (a function) to the second argument (a
64 % subset of that functions domain). Abused for polynomials to specify
65 % an associated function with a particular domain (also its codomain,
66 % in the case of univariate polynomials).
67 \newcommand*
{\restrict}[2]{{#1}{\restriction}_
{#2}}
68 \ifdefined\newglossaryentry
69 \newglossaryentry{restriction
}{
70 name=
{\ensuremath{\restrict{f
}{X
}}},
71 description=
{the restriction of $f$ to $X$
},
79 % All of the product spaces (for example, R^n) that follow default to
80 % an exponent of ``n'', but that exponent can be changed by providing
81 % it as an optional argument. If the exponent given is ``1'', then it
82 % will be omitted entirely.
85 % The natural n-space, N x N x N x ... x N.
86 \newcommand*
{\Nn}[1][n
]{
87 \mathbb{N
}\if\detokenize{#1}\detokenize{1}{}\else^
{#1}\fi
90 \ifdefined\newglossaryentry
92 name=
{\ensuremath{\Nn[1]}},
93 description=
{the set of natural numbers
},
98 % The integral n-space, Z x Z x Z x ... x Z.
99 \newcommand*
{\Zn}[1][n
]{
100 \mathbb{Z
}\if\detokenize{#1}\detokenize{1}{}\else^
{#1}\fi
103 \ifdefined\newglossaryentry
104 \newglossaryentry{Z
}{
105 name=
{\ensuremath{\Zn[1]}},
106 description=
{the ring of integers
},
111 % The rational n-space, Q x Q x Q x ... x Q.
112 \newcommand*
{\Qn}[1][n
]{
113 \mathbb{Q
}\if\detokenize{#1}\detokenize{1}{}\else^
{#1}\fi
116 \ifdefined\newglossaryentry
117 \newglossaryentry{Q
}{
118 name=
{\ensuremath{\Qn[1]}},
119 description=
{the field of rational numbers
},
124 % The real n-space, R x R x R x ... x R.
125 \newcommand*
{\Rn}[1][n
]{
126 \mathbb{R
}\if\detokenize{#1}\detokenize{1}{}\else^
{#1}\fi
129 \ifdefined\newglossaryentry
130 \newglossaryentry{R
}{
131 name=
{\ensuremath{\Rn[1]}},
132 description=
{the field of real numbers
},
138 % The complex n-space, C x C x C x ... x C.
139 \newcommand*
{\Cn}[1][n
]{
140 \mathbb{C
}\if\detokenize{#1}\detokenize{1}{}\else^
{#1}\fi
143 \ifdefined\newglossaryentry
144 \newglossaryentry{C
}{
145 name=
{\ensuremath{\Cn[1]}},
146 description=
{the field of complex numbers
},
151 % The n-dimensional product space of a generic field F.
152 \newcommand*
{\Fn}[1][n
]{
153 \mathbb{F
}\if\detokenize{#1}\detokenize{1}{}\else^
{#1}\fi
156 \ifdefined\newglossaryentry
157 \newglossaryentry{F
}{
158 name=
{\ensuremath{\Fn[1]}},
159 description=
{a generic field
},
165 % An indexed arbitrary binary operation such as the union or
166 % intersection of an infinite number of sets. The first argument is
167 % the operator symbol to use, such as \cup for a union. The second
168 % argument is the lower index, for example k=1. The third argument is
169 % the upper index, such as \infty. Finally the fourth argument should
170 % contain the things (e.g. indexed sets) to be operated on.
171 \newcommand*
{\binopmany}[4]{
172 \mathchoice{ \underset{#2}{\overset{#3}{#1}}{#4} }
173 { {#1}_
{#2}^
{#3}{#4} }
174 { {#1}_
{#2}^
{#3}{#4} }
175 { {#1}_
{#2}^
{#3}{#4} }
179 % The four standard (UNLESS YOU'RE FRENCH) types of intervals along
181 \newcommand*
{\intervaloo}[2]{ \left(
{#1},
{#2}\right)
} % open-open
182 \newcommand*
{\intervaloc}[2]{ \left(
{#1},
{#2}\right] } % open-closed
183 \newcommand*
{\intervalco}[2]{ \left[{#1},
{#2}\right)
} % closed-open
184 \newcommand*
{\intervalcc}[2]{ \left[{#1},
{#2}\right] } % closed-closed