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