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