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