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 "least common multiple of" function. Takes a nonempty set of
43 % things that can be multiplied and ordered as its argument. Name
44 % chosen for synergy with \gcd, which *does* exist already.
45 \newcommand*
{\lcm}[1]{ \operatorname{lcm
}\of{{#1}} }
46 \ifdefined\newglossaryentry
47 \newglossaryentry{lcm
}{
48 name=
{\ensuremath{\lcm{X
}}},
49 description=
{the least common multiple of the elements of $X$
},
54 % The factorial operator.
55 \newcommand*
{\factorial}[1]{ {#1}!
}
57 % Restrict the first argument (a function) to the second argument (a
58 % subset of that functions domain). Abused for polynomials to specify
59 % an associated function with a particular domain (also its codomain,
60 % in the case of univariate polynomials).
61 \newcommand*
{\restrict}[2]{{#1}{\restriction}_
{#2}}
62 \ifdefined\newglossaryentry
63 \newglossaryentry{restriction
}{
64 name=
{\ensuremath{\restrict{f
}{X
}}},
65 description=
{the restriction of $f$ to $X$
},
73 % All of the product spaces (for example, R^n) that follow default to
74 % an exponent of ``n'', but that exponent can be changed by providing
75 % it as an optional argument. If the exponent given is ``1'', then it
76 % will be omitted entirely.
79 % The natural n-space, N x N x N x ... x N.
80 \newcommand*
{\Nn}[1][n
]{
81 \mathbb{N
}\if\detokenize{#1}\detokenize{1}{}\else^
{#1}\fi
84 \ifdefined\newglossaryentry
86 name=
{\ensuremath{\Nn[1]}},
87 description=
{the set of natural numbers
},
92 % The integral n-space, Z x Z x Z x ... x Z.
93 \newcommand*
{\Zn}[1][n
]{
94 \mathbb{Z
}\if\detokenize{#1}\detokenize{1}{}\else^
{#1}\fi
97 \ifdefined\newglossaryentry
99 name=
{\ensuremath{\Zn[1]}},
100 description=
{the ring of integers
},
105 % The rational n-space, Q x Q x Q x ... x Q.
106 \newcommand*
{\Qn}[1][n
]{
107 \mathbb{Q
}\if\detokenize{#1}\detokenize{1}{}\else^
{#1}\fi
110 \ifdefined\newglossaryentry
111 \newglossaryentry{Q
}{
112 name=
{\ensuremath{\Qn[1]}},
113 description=
{the field of rational numbers
},
118 % The real n-space, R x R x R x ... x R.
119 \newcommand*
{\Rn}[1][n
]{
120 \mathbb{R
}\if\detokenize{#1}\detokenize{1}{}\else^
{#1}\fi
123 \ifdefined\newglossaryentry
124 \newglossaryentry{R
}{
125 name=
{\ensuremath{\Rn[1]}},
126 description=
{the field of real numbers
},
132 % The complex n-space, C x C x C x ... x C.
133 \newcommand*
{\Cn}[1][n
]{
134 \mathbb{C
}\if\detokenize{#1}\detokenize{1}{}\else^
{#1}\fi
137 \ifdefined\newglossaryentry
138 \newglossaryentry{C
}{
139 name=
{\ensuremath{\Cn[1]}},
140 description=
{the field of complex numbers
},
145 % The n-dimensional product space of a generic field F.
146 \newcommand*
{\Fn}[1][n
]{
147 \mathbb{F
}\if\detokenize{#1}\detokenize{1}{}\else^
{#1}\fi
150 \ifdefined\newglossaryentry
151 \newglossaryentry{F
}{
152 name=
{\ensuremath{\Fn[1]}},
153 description=
{a generic field
},
159 % An indexed arbitrary binary operation such as the union or
160 % intersection of an infinite number of sets. The first argument is
161 % the operator symbol to use, such as \cup for a union. The second
162 % argument is the lower index, for example k=1. The third argument is
163 % the upper index, such as \infty. Finally the fourth argument should
164 % contain the things (e.g. indexed sets) to be operated on.
165 \newcommand*
{\binopmany}[4]{
166 \mathchoice{ \underset{#2}{\overset{#3}{#1}}{#4} }
167 { {#1}_
{#2}^
{#3}{#4} }
168 { {#1}_
{#2}^
{#3}{#4} }
169 { {#1}_
{#2}^
{#3}{#4} }
173 % The four standard (UNLESS YOU'RE FRENCH) types of intervals along
175 \newcommand*
{\intervaloo}[2]{ \left(
{#1},
{#2}\right)
} % open-open
176 \newcommand*
{\intervaloc}[2]{ \left(
{#1},
{#2}\right] } % open-closed
177 \newcommand*
{\intervalco}[2]{ \left[{#1},
{#2}\right)
} % closed-open
178 \newcommand*
{\intervalcc}[2]{ \left[{#1},
{#2}\right] } % closed-closed