]> gitweb.michael.orlitzky.com - mjotex.git/blob - mjo-common.tex
mjo-common.tex: fix typo in comment.
[mjotex.git] / mjo-common.tex
1 %
2 % Only the most commonly-used macros. Needed by everything else.
3 %
4
5 % Needed for \mathbb.
6 \usepackage{amsfonts}
7
8 % Needed for \bigtimes.
9 \usepackage{mathtools}
10
11 % Place the argument in matching left/right parentheses.
12 \providecommand*{\of}[1]{ \left({#1}\right) }
13
14 % Group terms using parentheses.
15 \providecommand*{\qty}[1]{ \left({#1}\right) }
16
17 % Group terms using square brackets.
18 \providecommand*{\sqty}[1]{ \left[{#1}\right] }
19
20 % Create a set from the given elements
21 \providecommand*{\set}[1]{\left\lbrace{#1}\right\rbrace}
22
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 \providecommand*{\setc}[2]{\left\lbrace{#1}\ \middle|\ {#2} \right\rbrace}
28
29 % A pair of things.
30 \providecommand*{\pair}[2]{ \left({#1},{#2}\right) }
31
32 % A triple of things.
33 \providecommand*{\triple}[3]{ \left({#1},{#2},{#3}\right) }
34
35 % The Cartesian product of two things.
36 \providecommand*{\cartprod}[2]{ {#1}\times{#2} }
37
38 % The Cartesian product of three things.
39 \providecommand*{\cartprodthree}[3]{ \cartprod{{#1}}{\cartprod{{#2}}{{#3}}} }
40
41 % The direct sum of two things.
42 \providecommand*{\directsum}[2]{ {#1}\oplus{#2} }
43
44 % The direct sum of three things.
45 \providecommand*{\directsumthree}[3]{ \directsum{#1}{\directsum{#2}{#3}} }
46
47 % The factorial operator.
48 \providecommand*{\factorial}[1]{ {#1}! }
49
50 %
51 % Product spaces
52 %
53 % All of the product spaces (for example, R^n) that follow default to
54 % an exponent of ``n'', but that exponent can be changed by providing
55 % it as an optional argument. If the exponent given is ``1'', then it
56 % will be omitted entirely.
57 %
58
59 % The natural n-space, N x N x N x ... x N.
60 \providecommand*{\Nn}[1][n]{
61 \mathbb{N}\if\detokenize{#1}\detokenize{1}{}\else^{#1}\fi
62 }
63
64 % The integral n-space, Z x Z x Z x ... x Z.
65 \providecommand*{\Zn}[1][n]{
66 \mathbb{Z}\if\detokenize{#1}\detokenize{1}{}\else^{#1}\fi
67 }
68
69 % The rational n-space, Q x Q x Q x ... x Q.
70 \providecommand*{\Qn}[1][n]{
71 \mathbb{Q}\if\detokenize{#1}\detokenize{1}{}\else^{#1}\fi
72 }
73
74 % The real n-space, R x R x R x ... x R.
75 \providecommand*{\Rn}[1][n]{
76 \mathbb{R}\if\detokenize{#1}\detokenize{1}{}\else^{#1}\fi
77 }
78
79 % The complex n-space, C x C x C x ... x C.
80 \providecommand*{\Cn}[1][n]{
81 \mathbb{C}\if\detokenize{#1}\detokenize{1}{}\else^{#1}\fi
82 }
83
84 % The space of real symmetric n-by-n matrices.
85 \providecommand*{\Sn}[1][n]{
86 \mathcal{S}\if\detokenize{#1}\detokenize{1}{}\else^{#1}\fi
87 }
88
89 % The space of complex Hermitian n-by-n matrices.
90 \providecommand*{\Hn}[1][n]{
91 \mathcal{H}\if\detokenize{#1}\detokenize{1}{}\else^{#1}\fi
92 }
93
94 %
95 % Basic set operations
96 %
97
98 % The union of its two arguments.
99 \providecommand*{\union}[2]{ {#1}\cup{#2} }
100
101 % A three-argument union.
102 \providecommand*{\unionthree}[3]{ \union{\union{#1}{#2}}{#3} }
103
104 % The intersection of its two arguments.
105 \providecommand*{\intersect}[2]{ {#1}\cap{#2} }
106
107 % A three-argument intersection.
108 \providecommand*{\intersectthree}[3]{ \intersect{\intersect{#1}{#2}}{#3} }
109
110 % An indexed arbitrary binary operation such as the union or
111 % intersection of an infinite number of sets. The first argument is
112 % the operator symbol to use, such as \cup for a union. The second
113 % argument is the lower index, for example k=1. The third argument is
114 % the upper index, such as \infty. Finally the fourth argument should
115 % contain the things (e.g. indexed sets) to be operated on.
116 \providecommand*{\binopmany}[4]{
117 \mathchoice{ \underset{#2}{\overset{#3}{#1}}{#4} }
118 { {#1}_{#2}^{#3}{#4} }
119 { {#1}_{#2}^{#3}{#4} }
120 { {#1}_{#2}^{#3}{#4} }
121 }
122
123 \providecommand*{\intersectmany}[3]{ \binopmany{\bigcap}{#1}{#2}{#3} }
124 \providecommand*{\cartprodmany}[3]{ \binopmany{\bigtimes}{#1}{#2}{#3} }
125 \providecommand*{\directsummany}[3]{ \binopmany{\bigoplus}{#1}{#2}{#3} }
126 \providecommand*{\unionmany}[3]{ \binopmany{\bigcup}{#1}{#2}{#3} }
127
128
129 % The four standard (UNLESS YOU'RE FRENCH) types of intervals along
130 % the real line.
131 \providecommand*{\intervaloo}[2]{ \left({#1},{#2}\right) } % open-open
132 \providecommand*{\intervaloc}[2]{ \left({#1},{#2}\right] } % open-closed
133 \providecommand*{\intervalco}[2]{ \left[{#1},{#2}\right) } % closed-open
134 \providecommand*{\intervalcc}[2]{ \left[{#1},{#2}\right] } % closed-closed