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