]> gitweb.michael.orlitzky.com - mjotex.git/blob - examples.tex
mjo-linear_algebra: add the \rank{} of a matrix (or EJA, or...).
[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}}$. Here's a
77 set $\set{1,2,3} = \setc{n \in \Nn[1]}{ n \le 3 }$. The tuples go
78 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 Cartesian product of two sets $A$ and $B$ is
104 $\cartprod{A}{B}$; if we take the product with $C$ as well, then
105 we obtain $\cartprodthree{A}{B}{C}$. The direct sum of $V$ and $W$
106 is $\directsum{V}{W}$. Or three things,
107 $\directsumthree{U}{V}{W}$. How about more things? Like
108 $\directsummany{k=1}{\infty}{V_{k}} \ne
109 \cartprodmany{k=1}{\infty}{V_{k}}$. Those direct sums and
110 cartesian products adapt nicely to display equations:
111 %
112 \begin{equation*}
113 \directsummany{k=1}{\infty}{V_{k}} \ne \cartprodmany{k=1}{\infty}{V_{k}}.
114 \end{equation*}
115 Here are a few common tuple spaces that should not have a
116 superscript when that superscript would be one: $\Nn[1]$,
117 $\Zn[1]$, $\Qn[1]$, $\Rn[1]$, $\Cn[1]$. However, if the
118 superscript is (say) two, then it appears: $\Nn[2]$, $\Zn[2]$,
119 $\Qn[2]$, $\Rn[2]$, $\Cn[2]$.
120
121 We also have a few basic set operations, for example the union of
122 two or three sets: $\union{A}{B}$, $\unionthree{A}{B}{C}$. And of
123 course with union comes intersection: $\intersect{A}{B}$,
124 $\intersectthree{A}{B}{C}$. We can also take an arbitrary
125 (indexed) union and intersections of things, like
126 $\unionmany{k=1}{\infty}{A_{k}}$ or
127 $\intersectmany{k=1}{\infty}{B_{k}}$. The best part about those
128 is that they do the right thing in a display equation:
129 %
130 \begin{equation*}
131 \unionmany{k=1}{\infty}{A_{k}} = \intersectmany{k=1}{\infty}{B_{k}}
132 \end{equation*}
133
134 Finally, we have the four standard types of intervals in $\Rn[1]$,
135 %
136 \begin{align*}
137 \intervaloo{a}{b} &= \setc{ x \in \Rn[1]}{ a < x < b },\\
138 \intervaloc{a}{b} &= \setc{ x \in \Rn[1]}{ a < x \le b },\\
139 \intervalco{a}{b} &= \setc{ x \in \Rn[1]}{ a \le x < b }, \text{ and }\\
140 \intervalcc{a}{b} &= \setc{ x \in \Rn[1]}{ a \le x \le b }.
141 \end{align*}
142 \end{section}
143
144 \begin{section}{Complex}
145 We sometimes want to conjugate complex numbers like
146 $\compconj{a+bi} = a - bi$.
147 \end{section}
148
149 \begin{section}{Cone}
150 The dual cone of $K$ is $\dual{K}$. Some familiar symmetric cones
151 are $\Rnplus$, $\Lnplus$, $\Snplus$, and $\Hnplus$. If cones
152 $K_{1}$ and $K_{2}$ are given, we can define $\posops{K_{1}}$,
153 $\posops[K_{2}]{K_{1}}$, $\Sof{K_{1}}$, $\Zof{K_{1}}$,
154 $\LL{K_{1}}$, and $\lyapunovrank{K_{1}}$. We can also define $x
155 \gecone_{K} y$, $x \gtcone_{K} y$, $x \lecone_{K} y$, and $x
156 \ltcone_{K} y$ with respect to a cone $K$.
157 \end{section}
158
159 \begin{section}{Convex}
160 The conic hull of a set $X$ is $\cone{X}$; its affine hull is
161 $\aff{X}$, and its convex hull is $\conv{X}$. If $K$ is a cone,
162 then its lineality space is $\linspace{K}$, its lineality is
163 $\lin{K}$, and its extreme directions are $\Ext{K}$. The fact that
164 $F$ is a face of $K$ is denoted by $F \faceof K$; if $F$ is a
165 proper face, then we write $F \properfaceof K$.
166 \end{section}
167
168 \begin{section}{Euclidean Jordan algebras}
169 The Jordan product of $x$ and $y$ in some Euclidean Jordan algebra
170 is $\jp{x}{y}$.
171 \end{section}
172
173 \begin{section}{Font}
174 We can write things like Carathéodory and Güler and $\mathbb{R}$.
175 \end{section}
176
177 \begin{section}{Linear algebra}
178 The absolute value of $x$ is $\abs{x}$, or its norm is
179 $\norm{x}$. The inner product of $x$ and $y$ is $\ip{x}{y}$ and
180 their tensor product is $\tp{x}{y}$. The Kronecker product of
181 matrices $A$ and $B$ is $\kp{A}{B}$. The adjoint of the operator
182 $L$ is $\adjoint{L}$, or if it's a matrix, then its transpose is
183 $\transpose{L}$. Its trace is $\trace{L}$. Another matrix-specific
184 concept is the Moore-Penrose pseudoinverse of $L$, denoted by
185 $\pseudoinverse{L}$. Finally, the rank of a matrix $L$ is
186 $\rank{L}$.
187
188 The span of a set $X$ is $\spanof{X}$, and its codimension is
189 $\codim{X}$. The projection of $X$ onto $V$ is $\proj{V}{X}$. The
190 automorphism group of $X$ is $\Aut{X}$, and its Lie algebra is
191 $\Lie{X}$. We can write a column vector $x \coloneqq
192 \colvec{x_{1},x_{2},x_{3},x_{4}}$ and turn it into a $2 \times 2$
193 matrix with $\matricize{x}$. To recover the vector, we use
194 $\vectorize{\matricize{x}}$.
195
196 The set of all bounded linear operators from $V$ to $W$ is
197 $\boundedops[W]{V}$. If $W = V$, then we write $\boundedops{V}$
198 instead.
199
200 If you want to solve a system of equations, try Cramer's
201 rule~\cite{ehrenborg}.
202
203 The direct sum of $V$ and $W$ is $\directsum{V}{W}$, of course,
204 but what if $W = V^{\perp}$? Then we wish to indicate that fact by
205 writing $\directsumperp{V}{W}$. That operator should survive a
206 display equation, too, and the weight of the circle should match
207 that of the usual direct sum operator.
208 %
209 \begin{align*}
210 Z = \directsumperp{V}{W}\\
211 \oplus \oplusperp \oplus \oplusperp
212 \end{align*}
213 %
214 Its form should also survive in different font sizes...
215 \Large
216 \begin{align*}
217 Z = \directsumperp{V}{W}\\
218 \oplus \oplusperp \oplus \oplusperp
219 \end{align*}
220 \Huge
221 \begin{align*}
222 Z = \directsumperp{V}{W}\\
223 \oplus \oplusperp \oplus \oplusperp
224 \end{align*}
225 \normalsize
226 \end{section}
227
228 \begin{section}{Listing}
229 Here's an interactive SageMath prompt:
230
231 \begin{tcblisting}{listing only,
232 colback=codebg,
233 coltext=codefg,
234 listing options={language=sage,style=sage}}
235 sage: K = Cone([ (1,0), (0,1) ])
236 sage: K.positive_operator_gens()
237 [
238 [1 0] [0 1] [0 0] [0 0]
239 [0 0], [0 0], [1 0], [0 1]
240 ]
241 \end{tcblisting}
242
243 However, the smart way to display a SageMath listing is to load it
244 from an external file (under the ``listings'' subdirectory):
245
246 \sagelisting{example}
247
248 Keeping the listings in separate files makes it easy for the build
249 system to test them.
250 \end{section}
251
252 \begin{section}{Miscellaneous}
253 The cardinality of the set $X \coloneqq \set{1,2,3}$ is $\card{X}
254 = 3$.
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}{Theorems}
304 \begin{corollary}
305 The
306 \end{corollary}
307
308 \begin{lemma}
309 quick
310 \end{lemma}
311
312 \begin{proposition}
313 brown
314 \end{proposition}
315
316 \begin{theorem}
317 fox
318 \end{theorem}
319
320 \begin{exercise}
321 jumps
322 \end{exercise}
323
324 \begin{definition}
325 quod
326 \end{definition}
327
328 \begin{example}
329 erat
330 \end{example}
331
332 \begin{remark}
333 demonstradum.
334 \end{remark}
335 \end{section}
336
337 \begin{section}{Theorems (starred)}
338 \begin{corollary*}
339 The
340 \end{corollary*}
341
342 \begin{lemma*}
343 quick
344 \end{lemma*}
345
346 \begin{proposition*}
347 brown
348 \end{proposition*}
349
350 \begin{theorem*}
351 fox
352 \end{theorem*}
353
354 \begin{exercise*}
355 jumps
356 \end{exercise*}
357
358 \begin{definition*}
359 quod
360 \end{definition*}
361
362 \begin{example*}
363 erat
364 \end{example*}
365
366 \begin{remark*}
367 demonstradum.
368 \end{remark*}
369 \end{section}
370
371 \begin{section}{Topology}
372 The interior of a set $X$ is $\interior{X}$. Its closure is
373 $\closure{X}$ and its boundary is $\boundary{X}$.
374 \end{section}
375
376 \setlength{\glslistdottedwidth}{.3\linewidth}
377 \setglossarystyle{listdotted}
378 \glsaddall
379 \printnoidxglossaries
380
381 \bibliographystyle{mjo}
382 \bibliography{local-references}
383
384 \printindex
385 \end{document}