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