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