]> gitweb.michael.orlitzky.com - mjotex.git/blob - examples.tex
mjo-common: add \tuple.
[mjotex.git] / examples.tex
1 \documentclass{report}
2
3 % Setting hypertexnames=false forces hyperref to use a consistent
4 % internal counter for proposition/equation references rather than
5 % being clever, which doesn't work after we reset those counters.
6 \usepackage[hypertexnames=false]{hyperref}
7 \hypersetup{
8 colorlinks=true,
9 linkcolor=blue,
10 citecolor=blue
11 }
12
13 % We have to load this after hyperref, so that links work, but before
14 % mjotex so that mjotex knows to define its glossary entries.
15 \usepackage[nonumberlist]{glossaries}
16 \makenoidxglossaries{}
17
18 % If you want an index, we can do that too. You'll need to define
19 % the "INDICES" variable in the GNUmakefile, though.
20 \usepackage{makeidx}
21 \makeindex
22
23 \usepackage{mjotex}
24 \usepackage{mathtools}
25
26 \begin{document}
27
28 \begin{section}{Algebra}
29 If $R$ is a commutative ring\index{commutative ring}, then
30 $\polyring{R}{X,Y,Z}$ is a multivariate polynomial ring with
31 indeterminates $X$, $Y$, and $Z$, and coefficients in $R$. If $R$
32 is a moreover an integral domain, then its fraction field is
33 $\Frac{R}$. If $x,y,z \in R$, then $\ideal{\set{x,y,z}}$ is the
34 ideal generated by $\set{x,y,z}$, which is defined to be the
35 smallest ideal in $R$ containing that set. Likewise, if we are in
36 an algebra $\mathcal{A}$ and if $x,y,z \in \mathcal{A}$, then
37 $\alg{\set{x,y,z}}$ is the smallest subalgebra of $\mathcal{A}$
38 containing the set $\set{x,y,z}$.
39
40 If $R$ has a multiplicative identity (that is, a unit) element,
41 then that element is denoted by $\unit{R}$. Its additive identity
42 element is $\zero{R}$.
43 \end{section}
44
45 \begin{section}{Algorithm}
46 An example of an algorithm (bogosort) environment.
47
48 \begin{algorithm}[H]
49 \caption{Sort a list of numbers}
50 \begin{algorithmic}
51 \Require{A list of numbers $L$}
52 \Ensure{A new, sorted copy $M$ of the list $L$}
53
54 \State{$M \gets L$}
55
56 \While{$M$ is not sorted}
57 \State{Rearrange $M$ randomly}
58 \EndWhile{}
59
60 \State{\Return{$M$}}
61 \end{algorithmic}
62 \end{algorithm}
63 \end{section}
64
65 \begin{section}{Arrow}
66 The constant function that always returns $a$ is $\const{a}$. The
67 identity operator on $V$ is $\identity{V}$. The composition of $f$
68 and $g$ is $\compose{f}{g}$. The inverse of $f$ is
69 $\inverse{f}$. If $f$ is a function and $A$ is a subset of its
70 domain, then the preimage under $f$ of $A$ is $\preimage{f}{A}$.
71 \end{section}
72
73 \begin{section}{Calculus}
74 The gradient of $f : \Rn \rightarrow \Rn[1]$ is $\gradient{f} :
75 \Rn \rightarrow \Rn$.
76 \end{section}
77
78 \begin{section}{Common}
79 The function $f$ applied to $x$ is $f\of{x}$, and the restriction
80 of $f$ to a subset $X$ of its domain is $\restrict{f}{X}$. We can
81 group terms like $a + \qty{b - c}$ or $a + \qty{b - \sqty{c -
82 d}}$. The tuples go up to seven, for now, and then we give up
83 and use the general construct:
84 %
85 \begin{itemize}
86 \begin{item}
87 Pair: $\pair{1}{2}$,
88 \end{item}
89 \begin{item}
90 Triple: $\triple{1}{2}{3}$,
91 \end{item}
92 \begin{item}
93 Quadruple: $\quadruple{1}{2}{3}{4}$,
94 \end{item}
95 \begin{item}
96 Qintuple: $\quintuple{1}{2}{3}{4}{5}$,
97 \end{item}
98 \begin{item}
99 Sextuple: $\sextuple{1}{2}{3}{4}{5}{6}$,
100 \end{item}
101 \begin{item}
102 Septuple: $\septuple{1}{2}{3}{4}{5}{6}{7}$.
103 \end{item}
104 \begin{item}
105 Tuple: $\tuple{1,2,\ldots,8675309}$.
106 \end{item}
107 \end{itemize}
108 %
109 The factorial of the number $10$ is $\factorial{10}$, and the
110 least common multiple of $4$ and $6$ is $\lcm{\set{4,6}} =
111 12$.
112
113 The direct sum of $V$ and $W$ is $\directsum{V}{W}$. Or three
114 things, $\directsumthree{U}{V}{W}$. How about more things? Like
115 $\directsummany{k=1}{\infty}{V_{k}}$. Those direct sums
116 adapt nicely to display equations:
117 %
118 \begin{equation*}
119 \directsummany{k=1}{\infty}{V_{k}} \ne \emptyset.
120 \end{equation*}
121 %
122 Here are a few common tuple spaces that should not have a
123 superscript when that superscript would be one: $\Nn[1]$,
124 $\Zn[1]$, $\Qn[1]$, $\Rn[1]$, $\Cn[1]$. However, if the
125 superscript is (say) two, then it appears: $\Nn[2]$, $\Zn[2]$,
126 $\Qn[2]$, $\Rn[2]$, $\Cn[2]$. The symbols $\Fn[1]$, $\Fn[2]$,
127 et cetera, are available for use with a generic field.
128
129 Finally, we have the four standard types of intervals in $\Rn[1]$,
130 %
131 \begin{align*}
132 \intervaloo{a}{b} &= \setc{ x \in \Rn[1]}{ a < x < b },\\
133 \intervaloc{a}{b} &= \setc{ x \in \Rn[1]}{ a < x \le b },\\
134 \intervalco{a}{b} &= \setc{ x \in \Rn[1]}{ a \le x < b }, \text{ and }\\
135 \intervalcc{a}{b} &= \setc{ x \in \Rn[1]}{ a \le x \le b }.
136 \end{align*}
137 \end{section}
138
139 \begin{section}{Complex}
140 We sometimes want to conjugate complex numbers like
141 $\compconj{a+bi} = a - bi$.
142 \end{section}
143
144 \begin{section}{Cone}
145 The dual cone of $K$ is $\dual{K}$. Some familiar symmetric cones
146 are $\Rnplus$, $\Rnplusplus$, $\Lnplus$, $\Snplus$, and $\Hnplus$.
147 If cones $K_{1}$ and $K_{2}$ are given, we can define
148 $\posops{K_{1}}$, $\posops[K_{2}]{K_{1}}$, $\Sof{K_{1}}$,
149 $\Zof{K_{1}}$, $\LL{K_{1}}$, and $\lyapunovrank{K_{1}}$. We can
150 also define $x \gecone_{K} y$, $x \gtcone_{K} y$, $x \lecone_{K}
151 y$, and $x \ltcone_{K} y$ with respect to a cone $K$.
152 \end{section}
153
154 \begin{section}{Convex}
155 The conic hull of a set $X$ is $\cone{X}$; its affine hull is
156 $\aff{X}$, and its convex hull is $\conv{X}$. If $K$ is a cone,
157 then its lineality space is $\linspace{K}$, its lineality is
158 $\lin{K}$, and its extreme directions are $\Ext{K}$. The fact that
159 $F$ is a face of $K$ is denoted by $F \faceof K$; if $F$ is a
160 proper face, then we write $F \properfaceof K$.
161 \end{section}
162
163 \begin{section}{Euclidean Jordan algebras}
164 The Jordan product of $x$ and $y$ in some Euclidean Jordan algebra
165 is $\jp{x}{y}$.
166 \end{section}
167
168 \begin{section}{Font}
169 We can write things like Carathéodory and Güler and
170 $\mathbb{R}$. The PostScript Zapf Chancery font is also available
171 in both upper- and lower-case:
172 %
173 \begin{itemize}
174 \begin{item}$\mathpzc{abcdefghijklmnopqrstuvwxyz}$\end{item}
175 \begin{item}$\mathpzc{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$\end{item}
176 \end{itemize}
177 \end{section}
178
179 \begin{section}{Hurwitz}
180 Here lies the Hurwitz algebras, like the quaternions
181 $\quaternions$ and octonions $\octonions$.
182 \end{section}
183
184 \begin{section}{Linear algebra}
185 The absolute value of $x$ is $\abs{x}$, or its norm is
186 $\norm{x}$. The inner product of $x$ and $y$ is $\ip{x}{y}$ and
187 their tensor product is $\tp{x}{y}$. The Kronecker product of
188 matrices $A$ and $B$ is $\kp{A}{B}$. The adjoint of the operator
189 $L$ is $\adjoint{L}$, or if it's a matrix, then its transpose is
190 $\transpose{L}$. Its trace is $\trace{L}$, and its spectrum---the
191 set of its eigenvalues---is $\spectrum{L}$. Another
192 matrix-specific concept is the Moore-Penrose pseudoinverse of $L$,
193 denoted by $\pseudoinverse{L}$. Finally, the rank of a matrix $L$
194 is $\rank{L}$. As far as matrix spaces go, we have the $n$-by-$n$
195 real-symmetric and complex-Hermitian matrices $\Sn$ and $\Hn$
196 respectively; however $\Sn[1]$ and $\Hn[1]$ do not automatically
197 simplify because the ``$n$'' does not indicate the arity of a
198 Cartesian product in this case. A handy way to represent the
199 matrix $A \in \Rn[n \times n]$ whose only non-zero entries are on
200 the diagonal is $\diag{\colvec{A_{11},A_{22},\ldots,A_{nn}}}$.
201
202 The span of a set $X$ is $\spanof{X}$, and its codimension is
203 $\codim{X}$. The projection of $X$ onto $V$ is $\proj{V}{X}$. The
204 automorphism group of $X$ is $\Aut{X}$, and its Lie algebra is
205 $\Lie{X}$. We can write a column vector $x \coloneqq
206 \colvec{x_{1},x_{2},x_{3},x_{4}}$ and turn it into a $2 \times 2$
207 matrix with $\matricize{x}$. To recover the vector, we use
208 $\vectorize{\matricize{x}}$.
209
210 The set of all bounded linear operators from $V$ to $W$ is
211 $\boundedops[W]{V}$. If $W = V$, then we write $\boundedops{V}$
212 instead.
213
214 If you want to solve a system of equations, try Cramer's
215 rule~\cite{ehrenborg}. Or at least the reduced row-echelon form of
216 the matrix, $\rref{A}$.
217
218 The direct sum of $V$ and $W$ is $\directsum{V}{W}$, of course,
219 but what if $W = V^{\perp}$? Then we wish to indicate that fact by
220 writing $\directsumperp{V}{W}$. That operator should survive a
221 display equation, too, and the weight of the circle should match
222 that of the usual direct sum operator.
223 %
224 \begin{align*}
225 Z = \directsumperp{V}{W}\\
226 \oplus \oplusperp \oplus \oplusperp
227 \end{align*}
228 %
229 Its form should also survive in different font sizes\ldots
230 \Large
231 \begin{align*}
232 Z = \directsumperp{V}{W}\\
233 \oplus \oplusperp \oplus \oplusperp
234 \end{align*}
235 \Huge
236 \begin{align*}
237 Z = \directsumperp{V}{W}\\
238 \oplus \oplusperp \oplus \oplusperp
239 \end{align*}
240 \normalsize
241 \end{section}
242
243 \begin{section}{Listing}
244 Here's an interactive SageMath prompt:
245
246 \begin{tcblisting}{listing only,
247 colback=codebg,
248 coltext=codefg,
249 listing options={language=sage,style=sage}}
250 sage: K = Cone([ (1,0), (0,1) ])
251 sage: K.positive_operator_gens()
252 [
253 [1 0] [0 1] [0 0] [0 0]
254 [0 0], [0 0], [1 0], [0 1]
255 ]
256 \end{tcblisting}
257
258 However, the smart way to display a SageMath listing is to load it
259 from an external file (under the ``listings'' subdirectory):
260
261 \sagelisting{example}
262
263 Keeping the listings in separate files makes it easy for the build
264 system to test them.
265 \end{section}
266
267 \begin{section}{Proof by cases}
268
269 \begin{proposition}
270 There are two cases in the following proof.
271
272 \begin{proof}
273 The result should be self-evident once we have considered the
274 following two cases.
275 \begin{pcases}
276 \begin{case}[first case]
277 Nothing happens in the first case.
278 \end{case}
279 \begin{case}[second case]
280 The same thing happens in the second case.
281 \end{case}
282 \end{pcases}
283
284 You see?
285 \end{proof}
286 \end{proposition}
287
288 Here's another one.
289
290 \renewcommand{\baselinestretch}{2}
291 \begin{proposition}
292 Cases should display intelligently even when the document is
293 double-spaced.
294
295 \begin{proof}
296 Here we go again.
297
298 \begin{pcases}
299 \begin{case}[first case]
300 Nothing happens in the first case.
301 \end{case}
302 \begin{case}[second case]
303 The same thing happens in the second case.
304 \end{case}
305 \end{pcases}
306
307 Now it's over.
308 \end{proof}
309 \end{proposition}
310 \renewcommand{\baselinestretch}{1}
311 \end{section}
312
313 \begin{section}{Set theory}
314 Here's a set $\set{1,2,3} = \setc{n \in \Nn[1]}{ n \le 3 }$. The
315 cardinality of the set $X \coloneqq \set{1,2,3}$ is $\card{X} =
316 3$, and its powerset is $\powerset{X}$.
317
318 We also have a few basic set operations, for example the union of
319 two or three sets: $\union{A}{B}$, $\unionthree{A}{B}{C}$. And of
320 course with union comes intersection: $\intersect{A}{B}$,
321 $\intersectthree{A}{B}{C}$. The Cartesian product of two sets $A$
322 and $B$ is there too: $\cartprod{A}{B}$. If we take the product
323 with $C$ as well, then we obtain $\cartprodthree{A}{B}{C}$.
324
325 We can also take an arbitrary (indexed) union, intersection, or
326 Cartesian product of things, like
327 $\unionmany{k=1}{\infty}{A_{k}}$,
328 $\intersectmany{k=1}{\infty}{B_{k}}$, or
329 $\cartprodmany{k=1}{\infty}{C_{k}}$. The best part about those is
330 that they do the right thing in a display equation:
331 %
332 \begin{equation*}
333 \unionmany{k=1}{\infty}{A_{k}}
334 \ne
335 \intersectmany{k=1}{\infty}{B_{k}}
336 \ne
337 \cartprodmany{k=1}{\infty}{C_{k}}.
338 \end{equation*}
339 %
340 \end{section}
341
342 \begin{section}{Theorems}
343 \begin{corollary}
344 The
345 \end{corollary}
346
347 \begin{lemma}
348 quick
349 \end{lemma}
350
351 \begin{proposition}
352 brown
353 \end{proposition}
354
355 \begin{theorem}
356 fox
357 \end{theorem}
358
359 \begin{exercise}
360 jumps
361 \end{exercise}
362
363 \begin{definition}
364 quod
365 \end{definition}
366
367 \begin{example}
368 erat
369 \end{example}
370
371 \begin{remark}
372 demonstradum.
373 \end{remark}
374 \end{section}
375
376 \begin{section}{Theorems (starred)}
377 \begin{corollary*}
378 The
379 \end{corollary*}
380
381 \begin{lemma*}
382 quick
383 \end{lemma*}
384
385 \begin{proposition*}
386 brown
387 \end{proposition*}
388
389 \begin{theorem*}
390 fox
391 \end{theorem*}
392
393 \begin{exercise*}
394 jumps
395 \end{exercise*}
396
397 \begin{definition*}
398 quod
399 \end{definition*}
400
401 \begin{example*}
402 erat
403 \end{example*}
404
405 \begin{remark*}
406 demonstradum.
407 \end{remark*}
408 \end{section}
409
410 \begin{section}{Topology}
411 The interior of a set $X$ is $\interior{X}$. Its closure is
412 $\closure{X}$ and its boundary is $\boundary{X}$.
413 \end{section}
414
415 \setlength{\glslistdottedwidth}{.3\linewidth}
416 \setglossarystyle{listdotted}
417 \glsaddall{}
418 \printnoidxglossaries{}
419
420 \bibliographystyle{mjo}
421 \bibliography{local-references}
422
423 \printindex
424 \end{document}