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