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