]> gitweb.michael.orlitzky.com - mjotex.git/blob - mjo-common.tex
mjo-algebra: adopt \directsum and its variants from mjo-common.
[mjotex.git] / mjo-common.tex
1 %
2 % Only the most commonly-used macros. Needed by everything else.
3 %
4 \ifx\havemjocommon\undefined
5 \def\havemjocommon{1}
6
7 \ifx\mathbb\undefined
8 \usepackage{amsfonts}
9 \fi
10
11 % Place the argument in matching left/right parentheses.
12 \newcommand*{\of}[1]{ \left({#1}\right) }
13
14 % Group terms using parentheses.
15 \newcommand*{\qty}[1]{ \left({#1}\right) }
16
17 % Group terms using square brackets.
18 \newcommand*{\sqty}[1]{ \left[{#1}\right] }
19
20 % A pair of things.
21 \newcommand*{\pair}[2]{ \left({#1},{#2}\right) }
22
23 % A triple of things.
24 \newcommand*{\triple}[3]{ \left({#1},{#2},{#3}\right) }
25
26 % A four-tuple of things.
27 \newcommand*{\quadruple}[4]{ \left({#1},{#2},{#3},{#4}\right) }
28
29 % A five-tuple of things.
30 \newcommand*{\quintuple}[5]{ \left({#1},{#2},{#3},{#4},{#5}\right) }
31
32 % A six-tuple of things.
33 \newcommand*{\sextuple}[6]{ \left({#1},{#2},{#3},{#4},{#5},{#6}\right) }
34
35 % A seven-tuple of things.
36 \newcommand*{\septuple}[7]{ \left({#1},{#2},{#3},{#4},{#5},{#6},{#7}\right) }
37
38 % The factorial operator.
39 \newcommand*{\factorial}[1]{ {#1}! }
40
41 %
42 % Product spaces
43 %
44 % All of the product spaces (for example, R^n) that follow default to
45 % an exponent of ``n'', but that exponent can be changed by providing
46 % it as an optional argument. If the exponent given is ``1'', then it
47 % will be omitted entirely.
48 %
49
50 % The natural n-space, N x N x N x ... x N.
51 \newcommand*{\Nn}[1][n]{
52 \mathbb{N}\if\detokenize{#1}\detokenize{1}{}\else^{#1}\fi
53 }
54
55 \ifdefined\newglossaryentry
56 \newglossaryentry{N}{
57 name={\ensuremath{\Nn[1]}},
58 description={the set of natural numbers},
59 sort=N
60 }
61 \fi
62
63 % The integral n-space, Z x Z x Z x ... x Z.
64 \newcommand*{\Zn}[1][n]{
65 \mathbb{Z}\if\detokenize{#1}\detokenize{1}{}\else^{#1}\fi
66 }
67
68 \ifdefined\newglossaryentry
69 \newglossaryentry{Z}{
70 name={\ensuremath{\Zn[1]}},
71 description={the ring of integers},
72 sort=Z
73 }
74 \fi
75
76 % The rational n-space, Q x Q x Q x ... x Q.
77 \newcommand*{\Qn}[1][n]{
78 \mathbb{Q}\if\detokenize{#1}\detokenize{1}{}\else^{#1}\fi
79 }
80
81 \ifdefined\newglossaryentry
82 \newglossaryentry{Q}{
83 name={\ensuremath{\Qn[1]}},
84 description={the field of rational numbers},
85 sort=Q
86 }
87 \fi
88
89 % The real n-space, R x R x R x ... x R.
90 \newcommand*{\Rn}[1][n]{
91 \mathbb{R}\if\detokenize{#1}\detokenize{1}{}\else^{#1}\fi
92 }
93
94 \ifdefined\newglossaryentry
95 \newglossaryentry{R}{
96 name={\ensuremath{\Rn[1]}},
97 description={the field of real numbers},
98 sort=R
99 }
100 \fi
101
102
103 % The complex n-space, C x C x C x ... x C.
104 \newcommand*{\Cn}[1][n]{
105 \mathbb{C}\if\detokenize{#1}\detokenize{1}{}\else^{#1}\fi
106 }
107
108 \ifdefined\newglossaryentry
109 \newglossaryentry{C}{
110 name={\ensuremath{\Cn[1]}},
111 description={the field of complex numbers},
112 sort=C
113 }
114 \fi
115
116
117 % An indexed arbitrary binary operation such as the union or
118 % intersection of an infinite number of sets. The first argument is
119 % the operator symbol to use, such as \cup for a union. The second
120 % argument is the lower index, for example k=1. The third argument is
121 % the upper index, such as \infty. Finally the fourth argument should
122 % contain the things (e.g. indexed sets) to be operated on.
123 \newcommand*{\binopmany}[4]{
124 \mathchoice{ \underset{#2}{\overset{#3}{#1}}{#4} }
125 { {#1}_{#2}^{#3}{#4} }
126 { {#1}_{#2}^{#3}{#4} }
127 { {#1}_{#2}^{#3}{#4} }
128 }
129
130
131 % The four standard (UNLESS YOU'RE FRENCH) types of intervals along
132 % the real line.
133 \newcommand*{\intervaloo}[2]{ \left({#1},{#2}\right) } % open-open
134 \newcommand*{\intervaloc}[2]{ \left({#1},{#2}\right] } % open-closed
135 \newcommand*{\intervalco}[2]{ \left[{#1},{#2}\right) } % closed-open
136 \newcommand*{\intervalcc}[2]{ \left[{#1},{#2}\right] } % closed-closed
137
138
139 \fi