]> gitweb.michael.orlitzky.com - mjotex.git/blob - examples.tex
mjo-theorem{,-star}.tex: add the "exercise" environment.
[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 $\triple{1}{2}{3}$,
40 and the factorial of the number $10$ is $\factorial{10}$.
41
42 The Cartesian product of two sets $A$ and $B$ is
43 $\cartprod{A}{B}$; if we take the product with $C$ as well, then
44 we obtain $\cartprodthree{A}{B}{C}$. The direct sum of $V$ and $W$
45 is $\directsum{V}{W}$. Or three things,
46 $\directsumthree{U}{V}{W}$. How about more things? Like
47 $\directsummany{k=1}{\infty}{V_{k}} \ne
48 \cartprodmany{k=1}{\infty}{V_{k}}$. Those direct sums and
49 cartesian products adapt nicely to display equations:
50 %
51 \begin{equation*}
52 \directsummany{k=1}{\infty}{V_{k}} \ne \cartprodmany{k=1}{\infty}{V_{k}}.
53 \end{equation*}
54 Here are a few common tuple spaces that should not have a
55 superscript when that superscript would be one: $\Nn[1]$,
56 $\Zn[1]$, $\Qn[1]$, $\Rn[1]$, $\Cn[1]$. However, if the
57 superscript is (say) two, then it appears: $\Nn[2]$, $\Zn[2]$,
58 $\Qn[2]$, $\Rn[2]$, $\Cn[2]$.
59
60 We also have a few basic set operations, for example the union of
61 two or three sets: $\union{A}{B}$, $\unionthree{A}{B}{C}$. And of
62 course with union comes intersection: $\intersect{A}{B}$,
63 $\intersectthree{A}{B}{C}$. We can also take an arbitrary
64 (indexed) union and intersections of things, like
65 $\unionmany{k=1}{\infty}{A_{k}}$ or
66 $\intersectmany{k=1}{\infty}{B_{k}}$. The best part about those
67 is that they do the right thing in a display equation:
68 %
69 \begin{equation*}
70 \unionmany{k=1}{\infty}{A_{k}} = \intersectmany{k=1}{\infty}{B_{k}}
71 \end{equation*}
72
73 Finally, we have the four standard types of intervals in $\Rn[1]$,
74 %
75 \begin{align*}
76 \intervaloo{a}{b} &= \setc{ x \in \Rn[1]}{ a < x < b },\\
77 \intervaloc{a}{b} &= \setc{ x \in \Rn[1]}{ a < x \le b },\\
78 \intervalco{a}{b} &= \setc{ x \in \Rn[1]}{ a \le x < b }, \text{ and }\\
79 \intervalcc{a}{b} &= \setc{ x \in \Rn[1]}{ a \le x \le b }.
80 \end{align*}
81 \end{section}
82
83 \begin{section}{Complex}
84 We sometimes want to conjugate complex numbers like
85 $\compconj{a+bi} = a - bi$.
86 \end{section}
87
88 \begin{section}{Cone}
89 The dual cone of $K$ is $\dual{K}$. Some familiar symmetric cones
90 are $\Rnplus$, $\Lnplus$, $\Snplus$, and $\Hnplus$. If cones
91 $K_{1}$ and $K_{2}$ are given, we can define $\posops{K_{1}}$,
92 $\posops[K_{2}]{K_{1}}$, $\Sof{K_{1}}$, $\Zof{K_{1}}$,
93 $\LL{K_{1}}$, and $\lyapunovrank{K_{1}}$. We can also define $x
94 \gecone_{K} y$, $x \gtcone_{K} y$, $x \lecone_{K} y$, and $x
95 \ltcone_{K} y$ with respect to a cone $K$.
96 \end{section}
97
98 \begin{section}{Convex}
99 The conic hull of a set $X$ is $\cone{X}$; its affine hull is
100 $\aff{X}$, and its convex hull is $\conv{X}$. If $K$ is a cone,
101 then its lineality space is $\linspace{K}$, its lineality is
102 $\lin{K}$, and its extreme directions are $\Ext{K}$.
103 \end{section}
104
105 \begin{section}{Font}
106 We can write things like Carathéodory and Güler and $\mathbb{R}$.
107 \end{section}
108
109 \begin{section}{Linear algebra}
110 The absolute value of $x$ is $\abs{x}$, or its norm is
111 $\norm{x}$. The inner product of $x$ and $y$ is $\ip{x}{y}$ and
112 their tensor product is $\tp{x}{y}$. The Kronecker product of
113 matrices $A$ and $B$ is $\kp{A}{B}$. The adjoint of the operator
114 $L$ is $\adjoint{L}$, or if it's a matrix, then its transpose is
115 $\transpose{L}$. Its trace is $\trace{L}$. Another matrix-specific
116 concept is the Moore-Penrose pseudoinverse of $L$, denoted by
117 $\pseudoinverse{L}$.
118
119 The span of a set $X$ is $\spanof{X}$, and its codimension is
120 $\codim{X}$. The projection of $X$ onto $V$ is $\proj{V}{X}$. The
121 automorphism group of $X$ is $\Aut{X}$, and its Lie algebra is
122 $\Lie{X}$. We can write a column vector $x \coloneqq
123 \colvec{x_{1},x_{2},x_{3},x_{4}}$ and turn it into a $2 \times 2$
124 matrix with $\matricize{x}$. To recover the vector, we use
125 $\vectorize{\matricize{x}}$.
126
127 The set of all bounded linear operators from $V$ to $W$ is
128 $\boundedops[W]{V}$. If $W = V$, then we write $\boundedops{V}$
129 instead.
130
131 The direct sum of $V$ and $W$ is $\directsum{V}{W}$, of course,
132 but what if $W = V^{\perp}$? Then we wish to indicate that fact by
133 writing $\directsumperp{V}{W}$. That operator should survive a
134 display equation, too, and the weight of the circle should match
135 that of the usual direct sum operator.
136 %
137 \begin{align*}
138 Z = \directsumperp{V}{W}\\
139 \oplus \oplusperp \oplus \oplusperp
140 \end{align*}
141 %
142 Its form should also survive in different font sizes...
143 \Large
144 \begin{align*}
145 Z = \directsumperp{V}{W}\\
146 \oplus \oplusperp \oplus \oplusperp
147 \end{align*}
148 \Huge
149 \begin{align*}
150 Z = \directsumperp{V}{W}\\
151 \oplus \oplusperp \oplus \oplusperp
152 \end{align*}
153 \normalsize
154 \end{section}
155
156 \begin{section}{Listing}
157 Here's an interactive sage prompt:
158
159 \begin{tcblisting}{listing only,
160 colback=codebg,
161 coltext=codefg,
162 listing options={language=sage,style=sage}}
163 sage: K = Cone([ (1,0), (0,1) ])
164 sage: K.positive_operator_gens()
165 [
166 [1 0] [0 1] [0 0] [0 0]
167 [0 0], [0 0], [1 0], [0 1]
168 ]
169 \end{tcblisting}
170 \end{section}
171
172 \begin{section}{Miscellaneous}
173 The cardinality of the set $X \coloneqq \set{1,2,3}$ is $\card{X}
174 = 3$.
175 \end{section}
176
177 \begin{section}{Proof by cases}
178
179 \begin{proposition}
180 There are two cases in the following proof.
181
182 \begin{proof}
183 The result should be self-evident once we have considered the
184 following two cases.
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 You see?
195 \end{proof}
196 \end{proposition}
197
198 Here's another one.
199
200 \renewcommand{\baselinestretch}{2}
201 \begin{proposition}
202 Cases should display intelligently even when the document is
203 double-spaced.
204
205 \begin{proof}
206 Here we go again.
207
208 \begin{pcases}
209 \begin{case}[first case]
210 Nothing happens in the first case.
211 \end{case}
212 \begin{case}[second case]
213 The same thing happens in the second case.
214 \end{case}
215 \end{pcases}
216
217 Now it's over.
218 \end{proof}
219 \end{proposition}
220 \renewcommand{\baselinestretch}{1}
221 \end{section}
222
223 \begin{section}{Theorems}
224 \begin{corollary}
225 The
226 \end{corollary}
227
228 \begin{lemma}
229 quick
230 \end{lemma}
231
232 \begin{proposition}
233 brown
234 \end{proposition}
235
236 \begin{theorem}
237 fox
238 \end{theorem}
239
240 \begin{exercise}
241 jumps
242 \end{exercise}
243
244 \begin{definition}
245 quod
246 \end{definition}
247
248 \begin{example}
249 erat
250 \end{example}
251
252 \begin{remark}
253 demonstradum.
254 \end{remark}
255 \end{section}
256
257 \begin{section}{Theorems (starred)}
258 \begin{corollary*}
259 The
260 \end{corollary*}
261
262 \begin{lemma*}
263 quick
264 \end{lemma*}
265
266 \begin{proposition*}
267 brown
268 \end{proposition*}
269
270 \begin{theorem*}
271 fox
272 \end{theorem*}
273
274 \begin{exercise*}
275 jumps
276 \end{exercise*}
277
278 \begin{definition*}
279 quod
280 \end{definition*}
281
282 \begin{example*}
283 erat
284 \end{example*}
285
286 \begin{remark*}
287 demonstradum.
288 \end{remark*}
289 \end{section}
290
291 \begin{section}{Topology}
292 The interior of a set $X$ is $\interior{X}$. Its closure is
293 $\closure{X}$ and its boundary is $\boundary{X}$.
294 \end{section}
295
296 \end{document}