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