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