]> gitweb.michael.orlitzky.com - mjotex.git/blob - examples.tex
Whitespace cleanup.
[mjotex.git] / examples.tex
1 \documentclass{report}
2
3 \usepackage{mjotex}
4 \usepackage{mathtools}
5
6 \begin{document}
7
8 \begin{section}{Algorithm}
9 An example of an algorithm (bogosort) environment.
10
11 \begin{algorithm}[H]
12 \caption{Sort a list of numbers}
13 \begin{algorithmic}
14 \Require{A list of numbers $L$}
15 \Ensure{A new, sorted copy $M$ of the list $L$}
16
17 \State{$M \gets L$}
18
19 \While{$M$ is not sorted}
20 \State{Rearrange $M$ randomly}
21 \EndWhile
22
23 \Return{$M$}
24 \end{algorithmic}
25 \end{algorithm}
26 \end{section}
27
28 \begin{section}{Arrow}
29 The identity operator on $V$ is $\identity{V}$. The composition of
30 $f$ and $g$ is $\compose{f}{g}$. The inverse of $f$ is
31 $\inverse{f}$. If $f$ is a function and $A$ is a subset of its
32 domain, then the preimage under $f$ of $A$ is $\preimage{f}{A}$.
33 \end{section}
34
35 \begin{section}{Common}
36 The function $f$ applied to $x$ is $f\of{x}$. We can group terms
37 like $a + \qty{b - c}$ or $a + \qty{b - \sqty{c - d}}$. Here's a
38 set $\set{1,2,3} = \setc{n \in \Nn[1]}{ n \le 3 }$. Here's a pair
39 of things $\pair{1}{2}$ or a triple of them
40 $\triple{1}{2}{3}$. The Cartesian product of two sets $A$ and $B$
41 is $\cartprod{A}{B}$; if we take the product with $C$ as well,
42 then we obtain $\cartprodthree{A}{B}{C}$. The direct sum of $V$
43 and $W$ is $\directsum{V}{W}$ and the factorial of the number $10$
44 is $\factorial{10}$.
45
46 Here are a few common tuple spaces that should not have a
47 superscript when that superscript would be one: $\Nn[1]$,
48 $\Zn[1]$, $\Qn[1]$, $\Rn[1]$, $\Cn[1]$. However, if the
49 superscript is (say) two, then it appears: $\Nn[2]$, $\Zn[2]$,
50 $\Qn[2]$, $\Rn[2]$, $\Cn[2]$.
51
52 We also have a few basic set operations, for example the union of
53 two or three sets: $\union{A}{B}$, $\unionthree{A}{B}{C}$. And of
54 course with union comes intersection: $\intersect{A}{B}$,
55 $\intersectthree{A}{B}{C}$. We can also take an arbitrary
56 (indexed) union and intersections of things, like
57 $\unionmany{k=1}{\infty}{A_{k}}$ or
58 $\intersectmany{k=1}{\infty}{B_{k}}$. The best part about those
59 is that they do the right thing in a display equation:
60 %
61 \begin{equation*}
62 \unionmany{k=1}{\infty}{A_{k}} = \intersectmany{k=1}{\infty}{B_{k}}
63 \end{equation*}
64 %
65 \end{section}
66
67 \begin{section}{Cone}
68 The dual cone of $K$ is $\dual{K}$. Some familiar symmetric cones
69 are $\Rnplus$, $\Lnplus$, $\Snplus$, and $\Hnplus$. If cones
70 $K_{1}$ and $K_{2}$ are given, we can define $\posops{K_{1}}$,
71 $\posops[K_{2}]{K_{1}}$, $\Sof{K_{1}}$, $\Zof{K_{1}}$,
72 $\LL{K_{1}}$, and $\lyapunovrank{K_{1}}$. We can also define $x
73 \gecone_{K} y$, $x \gtcone_{K} y$, $x \lecone_{K} y$, and $x
74 \ltcone_{K} y$ with respect to a cone $K$.
75 \end{section}
76
77 \begin{section}{Convex}
78 The conic hull of a set $X$ is $\cone{X}$; its affine hull is
79 $\aff{X}$, and its convex hull is $\conv{X}$. If $K$ is a cone,
80 then its lineality space is $\linspace{K}$, its lineality is
81 $\lin{K}$, and its extreme directions are $\Ext{K}$.
82 \end{section}
83
84 \begin{section}{Font}
85 We can write things like Carathéodory and Güler and $\mathbb{R}$.
86 \end{section}
87
88 \begin{section}{Linear algebra}
89 The absolute value of $x$ is $\abs{x}$, or its norm is
90 $\norm{x}$. The inner product of $x$ and $y$ is $\ip{x}{y}$ and
91 their tensor product is $\tp{x}{y}$. The Kronecker product of
92 matrices $A$ and $B$ is $\kp{A}{B}$. The adjoint of the operator
93 $L$ is $\adjoint{L}$, or if it's a matrix, then its transpose is
94 $\transpose{L}$. Its trace is $\trace{L}$.
95
96 The span of a set $X$ is $\spanof{X}$, and its codimension is
97 $\codim{X}$. The projection of $X$ onto $V$ is $\proj{V}{X}$. The
98 automorphism group of $X$ is $\Aut{X}$, and its Lie algebra is
99 $\Lie{X}$. We can write a column vector $x \coloneqq
100 \colvec{x_{1},x_{2},x_{3},x_{4}}$ and turn it into a $2 \times 2$
101 matrix with $\matricize{x}$. To recover the vector, we use
102 $\vectorize{\matricize{x}}$.
103
104 The set of all bounded linear operators from $V$ to $W$ is
105 $\boundedops[W]{V}$. If $W = V$, then we write $\boundedops{V}$
106 instead.
107
108 The direct sum of $V$ and $W$ is $\directsum{V}{W}$, of course,
109 but what if $W = V^{\perp}$? Then we wish to indicate that fact by
110 writing $\directsumperp{V}{W}$. That operator should survive a
111 display equation, too, and the weight of the circle should match
112 that of the usual direct sum operator.
113 %
114 \begin{align*}
115 Z = \directsumperp{V}{W}\\
116 \oplus \oplusperp \oplus \oplusperp
117 \end{align*}
118 %
119 Its form should also survive in different font sizes...
120 \Large
121 \begin{align*}
122 Z = \directsumperp{V}{W}\\
123 \oplus \oplusperp \oplus \oplusperp
124 \end{align*}
125 \Huge
126 \begin{align*}
127 Z = \directsumperp{V}{W}\\
128 \oplus \oplusperp \oplus \oplusperp
129 \end{align*}
130 \normalsize
131 \end{section}
132
133 \begin{section}{Listing}
134 Here's an interactive sage prompt:
135
136 \begin{tcblisting}{listing only,
137 colback=codebg,
138 coltext=codefg,
139 listing options={language=sage,style=sage}}
140 sage: K = Cone([ (1,0), (0,1) ])
141 sage: K.positive_operator_gens()
142 [
143 [1 0] [0 1] [0 0] [0 0]
144 [0 0], [0 0], [1 0], [0 1]
145 ]
146 \end{tcblisting}
147 \end{section}
148
149 \begin{section}{Miscellaneous}
150 The cardinality of the set $X \coloneqq \set{1,2,3}$ is $\card{X}
151 = 3$.
152 \end{section}
153
154 \begin{section}{Proof by cases}
155
156 \begin{proposition}
157 There are two cases in the following proof.
158
159 \begin{proof}
160 The result should be self-evident once we have considered the
161 following two cases.
162 \begin{pcases}
163 \begin{case}[first case]
164 Nothing happens in the first case.
165 \end{case}
166 \begin{case}[second case]
167 The same thing happens in the second case.
168 \end{case}
169 \end{pcases}
170
171 You see?
172 \end{proof}
173 \end{proposition}
174
175 Here's another one.
176
177 \renewcommand{\baselinestretch}{2}
178 \begin{proposition}
179 Cases should display intelligently even when the document is
180 double-spaced.
181
182 \begin{proof}
183 Here we go again.
184
185 \begin{pcases}
186 \begin{case}[first case]
187 Nothing happens in the first case.
188 \end{case}
189 \begin{case}[second case]
190 The same thing happens in the second case.
191 \end{case}
192 \end{pcases}
193
194 Now it's over.
195 \end{proof}
196 \end{proposition}
197 \renewcommand{\baselinestretch}{1}
198 \end{section}
199
200 \begin{section}{Theorems}
201 \begin{corollary}
202 The
203 \end{corollary}
204
205 \begin{lemma}
206 quick
207 \end{lemma}
208
209 \begin{proposition}
210 brown
211 \end{proposition}
212
213 \begin{theorem}
214 fox
215 \end{theorem}
216
217 \begin{definition}
218 quod
219 \end{definition}
220
221 \begin{example}
222 erat
223 \end{example}
224
225 \begin{remark}
226 demonstradum.
227 \end{remark}
228 \end{section}
229
230 \begin{section}{Theorems (starred)}
231 \begin{corollary*}
232 The
233 \end{corollary*}
234
235 \begin{lemma*}
236 quick
237 \end{lemma*}
238
239 \begin{proposition*}
240 brown
241 \end{proposition*}
242
243 \begin{theorem*}
244 fox
245 \end{theorem*}
246
247 \begin{definition*}
248 quod
249 \end{definition*}
250
251 \begin{example*}
252 erat
253 \end{example*}
254
255 \begin{remark*}
256 demonstradum.
257 \end{remark*}
258 \end{section}
259
260 \begin{section}{Topology}
261 The interior of a set $X$ is $\interior{X}$. Its closure is
262 $\closure{X}$ and its boundary is $\boundary{X}$.
263 \end{section}
264
265 \end{document}