]> gitweb.michael.orlitzky.com - mjotex.git/blob - examples.tex
mjo-common: add higher tuples, up to septuple.
[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}$.
33 \end{section}
34
35 \begin{section}{Algorithm}
36 An example of an algorithm (bogosort) environment.
37
38 \begin{algorithm}[H]
39 \caption{Sort a list of numbers}
40 \begin{algorithmic}
41 \Require{A list of numbers $L$}
42 \Ensure{A new, sorted copy $M$ of the list $L$}
43
44 \State{$M \gets L$}
45
46 \While{$M$ is not sorted}
47 \State{Rearrange $M$ randomly}
48 \EndWhile
49
50 \Return{$M$}
51 \end{algorithmic}
52 \end{algorithm}
53 \end{section}
54
55 \begin{section}{Arrow}
56 The constant function that always returns $a$ is $\const{a}$. The
57 identity operator on $V$ is $\identity{V}$. The composition of $f$
58 and $g$ is $\compose{f}{g}$. The inverse of $f$ is
59 $\inverse{f}$. If $f$ is a function and $A$ is a subset of its
60 domain, then the preimage under $f$ of $A$ is $\preimage{f}{A}$.
61 \end{section}
62
63 \begin{section}{Calculus}
64 The gradient of $f : \Rn \rightarrow \Rn[1]$ is $\gradient{f} :
65 \Rn \rightarrow \Rn$.
66 \end{section}
67
68 \begin{section}{Common}
69 The function $f$ applied to $x$ is $f\of{x}$. We can group terms
70 like $a + \qty{b - c}$ or $a + \qty{b - \sqty{c - d}}$. Here's a
71 set $\set{1,2,3} = \setc{n \in \Nn[1]}{ n \le 3 }$. The tuples go
72 up to seven, for now:
73 %
74 \begin{itemize}
75 \begin{item}
76 Pair: $\pair{1}{2}$,
77 \end{item}
78 \begin{item}
79 Triple: $\triple{1}{2}{3}$,
80 \end{item}
81 \begin{item}
82 Quadruple: $\quadruple{1}{2}{3}{4}$,
83 \end{item}
84 \begin{item}
85 Qintuple: $\quintuple{1}{2}{3}{4}{5}$,
86 \end{item}
87 \begin{item}
88 Sextuple: $\sextuple{1}{2}{3}{4}{5}{6}$,
89 \end{item}
90 \begin{item}
91 Septuple: $\septuple{1}{2}{3}{4}{5}{6}{7}$.
92 \end{item}
93 \end{itemize}
94 %
95 The factorial of the number $10$ is $\factorial{10}$.
96
97 The Cartesian product of two sets $A$ and $B$ is
98 $\cartprod{A}{B}$; if we take the product with $C$ as well, then
99 we obtain $\cartprodthree{A}{B}{C}$. The direct sum of $V$ and $W$
100 is $\directsum{V}{W}$. Or three things,
101 $\directsumthree{U}{V}{W}$. How about more things? Like
102 $\directsummany{k=1}{\infty}{V_{k}} \ne
103 \cartprodmany{k=1}{\infty}{V_{k}}$. Those direct sums and
104 cartesian products adapt nicely to display equations:
105 %
106 \begin{equation*}
107 \directsummany{k=1}{\infty}{V_{k}} \ne \cartprodmany{k=1}{\infty}{V_{k}}.
108 \end{equation*}
109 Here are a few common tuple spaces that should not have a
110 superscript when that superscript would be one: $\Nn[1]$,
111 $\Zn[1]$, $\Qn[1]$, $\Rn[1]$, $\Cn[1]$. However, if the
112 superscript is (say) two, then it appears: $\Nn[2]$, $\Zn[2]$,
113 $\Qn[2]$, $\Rn[2]$, $\Cn[2]$.
114
115 We also have a few basic set operations, for example the union of
116 two or three sets: $\union{A}{B}$, $\unionthree{A}{B}{C}$. And of
117 course with union comes intersection: $\intersect{A}{B}$,
118 $\intersectthree{A}{B}{C}$. We can also take an arbitrary
119 (indexed) union and intersections of things, like
120 $\unionmany{k=1}{\infty}{A_{k}}$ or
121 $\intersectmany{k=1}{\infty}{B_{k}}$. The best part about those
122 is that they do the right thing in a display equation:
123 %
124 \begin{equation*}
125 \unionmany{k=1}{\infty}{A_{k}} = \intersectmany{k=1}{\infty}{B_{k}}
126 \end{equation*}
127
128 Finally, we have the four standard types of intervals in $\Rn[1]$,
129 %
130 \begin{align*}
131 \intervaloo{a}{b} &= \setc{ x \in \Rn[1]}{ a < x < b },\\
132 \intervaloc{a}{b} &= \setc{ x \in \Rn[1]}{ a < x \le b },\\
133 \intervalco{a}{b} &= \setc{ x \in \Rn[1]}{ a \le x < b }, \text{ and }\\
134 \intervalcc{a}{b} &= \setc{ x \in \Rn[1]}{ a \le x \le b }.
135 \end{align*}
136 \end{section}
137
138 \begin{section}{Complex}
139 We sometimes want to conjugate complex numbers like
140 $\compconj{a+bi} = a - bi$.
141 \end{section}
142
143 \begin{section}{Cone}
144 The dual cone of $K$ is $\dual{K}$. Some familiar symmetric cones
145 are $\Rnplus$, $\Lnplus$, $\Snplus$, and $\Hnplus$. If cones
146 $K_{1}$ and $K_{2}$ are given, we can define $\posops{K_{1}}$,
147 $\posops[K_{2}]{K_{1}}$, $\Sof{K_{1}}$, $\Zof{K_{1}}$,
148 $\LL{K_{1}}$, and $\lyapunovrank{K_{1}}$. We can also define $x
149 \gecone_{K} y$, $x \gtcone_{K} y$, $x \lecone_{K} y$, and $x
150 \ltcone_{K} y$ with respect to a cone $K$.
151 \end{section}
152
153 \begin{section}{Convex}
154 The conic hull of a set $X$ is $\cone{X}$; its affine hull is
155 $\aff{X}$, and its convex hull is $\conv{X}$. If $K$ is a cone,
156 then its lineality space is $\linspace{K}$, its lineality is
157 $\lin{K}$, and its extreme directions are $\Ext{K}$. The fact that
158 $F$ is a face of $K$ is denoted by $F \faceof K$; if $F$ is a
159 proper face, then we write $F \properfaceof K$.
160 \end{section}
161
162 \begin{section}{Euclidean Jordan algebras}
163 The Jordan product of $x$ and $y$ in some Euclidean Jordan algebra
164 is $\jp{x}{y}$.
165 \end{section}
166
167 \begin{section}{Font}
168 We can write things like Carathéodory and Güler and $\mathbb{R}$.
169 \end{section}
170
171 \begin{section}{Linear algebra}
172 The absolute value of $x$ is $\abs{x}$, or its norm is
173 $\norm{x}$. The inner product of $x$ and $y$ is $\ip{x}{y}$ and
174 their tensor product is $\tp{x}{y}$. The Kronecker product of
175 matrices $A$ and $B$ is $\kp{A}{B}$. The adjoint of the operator
176 $L$ is $\adjoint{L}$, or if it's a matrix, then its transpose is
177 $\transpose{L}$. Its trace is $\trace{L}$. Another matrix-specific
178 concept is the Moore-Penrose pseudoinverse of $L$, denoted by
179 $\pseudoinverse{L}$.
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}{Miscellaneous}
246 The cardinality of the set $X \coloneqq \set{1,2,3}$ is $\card{X}
247 = 3$.
248 \end{section}
249
250 \begin{section}{Proof by cases}
251
252 \begin{proposition}
253 There are two cases in the following proof.
254
255 \begin{proof}
256 The result should be self-evident once we have considered the
257 following two cases.
258 \begin{pcases}
259 \begin{case}[first case]
260 Nothing happens in the first case.
261 \end{case}
262 \begin{case}[second case]
263 The same thing happens in the second case.
264 \end{case}
265 \end{pcases}
266
267 You see?
268 \end{proof}
269 \end{proposition}
270
271 Here's another one.
272
273 \renewcommand{\baselinestretch}{2}
274 \begin{proposition}
275 Cases should display intelligently even when the document is
276 double-spaced.
277
278 \begin{proof}
279 Here we go again.
280
281 \begin{pcases}
282 \begin{case}[first case]
283 Nothing happens in the first case.
284 \end{case}
285 \begin{case}[second case]
286 The same thing happens in the second case.
287 \end{case}
288 \end{pcases}
289
290 Now it's over.
291 \end{proof}
292 \end{proposition}
293 \renewcommand{\baselinestretch}{1}
294 \end{section}
295
296 \begin{section}{Theorems}
297 \begin{corollary}
298 The
299 \end{corollary}
300
301 \begin{lemma}
302 quick
303 \end{lemma}
304
305 \begin{proposition}
306 brown
307 \end{proposition}
308
309 \begin{theorem}
310 fox
311 \end{theorem}
312
313 \begin{exercise}
314 jumps
315 \end{exercise}
316
317 \begin{definition}
318 quod
319 \end{definition}
320
321 \begin{example}
322 erat
323 \end{example}
324
325 \begin{remark}
326 demonstradum.
327 \end{remark}
328 \end{section}
329
330 \begin{section}{Theorems (starred)}
331 \begin{corollary*}
332 The
333 \end{corollary*}
334
335 \begin{lemma*}
336 quick
337 \end{lemma*}
338
339 \begin{proposition*}
340 brown
341 \end{proposition*}
342
343 \begin{theorem*}
344 fox
345 \end{theorem*}
346
347 \begin{exercise*}
348 jumps
349 \end{exercise*}
350
351 \begin{definition*}
352 quod
353 \end{definition*}
354
355 \begin{example*}
356 erat
357 \end{example*}
358
359 \begin{remark*}
360 demonstradum.
361 \end{remark*}
362 \end{section}
363
364 \begin{section}{Topology}
365 The interior of a set $X$ is $\interior{X}$. Its closure is
366 $\closure{X}$ and its boundary is $\boundary{X}$.
367 \end{section}
368
369 \setlength{\glslistdottedwidth}{.3\linewidth}
370 \setglossarystyle{listdotted}
371 \glsaddall
372 \printnoidxglossaries
373
374 \bibliographystyle{mjo}
375 \bibliography{local-references}
376
377 \printindex
378 \end{document}