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