-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmacros.tex
More file actions
365 lines (333 loc) · 14.7 KB
/
macros.tex
File metadata and controls
365 lines (333 loc) · 14.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Custom LaTeX additions
% Ananth Raghunathan
% ananthr@cs.stanford.edu
% Also available at:
% http://github.com/ananthr/tex-macros/blob/master/macros.tex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% -- uncomment to enable centered section titles --
%\usepackage[bf, center]{titlesec}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{color}
\usepackage{amsmath,amssymb,amsthm}
\usepackage[colorlinks=true, linkcolor=blue, citecolor=blue]{hyperref}
% -- only use if you want back references --
%\usepackage[colorlinks=true, linkcolor=blue, citecolor=blue, backref=section]{hyperref}
\usepackage{fullpage}
\usepackage{enumerate}
\usepackage{verbatim}
% -- place /squish in the beginning of itemize to squish
% -- end with /squishend
\newcommand{\squish}{
\setlength{\topsep}{0pt}
\setlength{\itemsep}{0ex}
\vspace{-1ex}
\setlength{\parskip}{0pt}}
\newcommand{\squishend}{\vskip -1ex\relax}
% -- using autoref nicely; requires hyperref
\newcommand{\secref}[1]{\hyperref[#1]{\textbf{\S}\ref*{#1}}} % nice section ref
\def\sectionautorefname{Section}
\def\claimautorefname{Claim}
\def\theoremautorefname{Theorem}
\def\lemmaautorefname{Lemma}
\def\subsectionautorefname{Section}
\def\figureautorefname{Figure}
\def\equationautorefname{Eq.}
\def\appendixautorefname{App.}
\def\footnoteautorefname{Footnote}
% -- various font styles --
%\usepackage{times}
%\usepackage{sansmath}
%\sansmath
%\usepackage{mathptmx}
%\usepackage[charter]{mathdesign}
% -- nicer typewriter text --
\renewcommand{\ttdefault}{cmtt}
\renewcommand{\sfdefault}{cmss}
% -- custom header/footer stuff --
\newcommand{\mysec}[1]{\noindent{\large{\bf #1}} \bigskip}
\newcommand{\mypar}[1]{\noindent{\bf #1} \medskip}
\newcommand{\myipar}[1]{\noindent \textbf{\emph{#1}} \medskip}
\newcommand{\mybf}[1]{\medskip \noindent{\bf #1}\ }
\newcommand{\myendsec}{\begin{center} {\bf ------------ $\S$ ------------} \end{center}}
% -- my line for delineating sections --
\newcommand{\myline}{\begin{center} --------- \S\ --------- \end{center}}
% -- better template for solutions and sub-parts in solutions --
% -- usage: \answer{ \subanswer{Part 1 answer} \subanswer{Part 2 subanswer
% ...}}
% -- counter begins at zero, to start at 1, enter
% \stepcounter{answercounter} at the beginning of file
\newcounter{answercounter}
\newcounter{subcounter}
\stepcounter{subcounter}
\newcommand{\answer}[1]{{\bf Answer
\theanswercounter.}\stepcounter{answercounter}\setcounter{subcounter}{1}
#1 \begin{flushright}\qed \end{flushright} \bigskip}
\newcommand{\subanswer}[1]{{\bf
(\alph{subcounter})}\stepcounter{subcounter} #1 \medskip}
% -- misc stuff --
%\newcommand{\comment}[1]{}
%\newcommand{\debug}[1]{$\big($\textcolor{red}{{\bf Comment: }#1}$\big)$}
\newcommand{\debug}[1]{}
% -- amsthm package additions --
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}{Lemma}[section]
\newtheorem{claim}{Claim}[section]
\newtheorem{proposition}{Proposition}[section]
\newtheorem{corollary}{Corollary}[section]
\newtheorem{assumption}{Assumption}[section]
\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
\newtheorem{conjecture}{Conjecture}[section]
\newtheorem{example}{Example}[section]
\theoremstyle{remark}
\newtheorem{note}{Note}
\newtheorem{fact}{Fact}
\newtheorem{remark}{Remark}
\newtheorem{case}{Case}
% -- better proof environment --
%\renewenvironment{proof}{\begin{trivlist} \item[\hspace{\labelsep}{\bf
%\noindent Proof.\/}] }{\qedsymb\end{trivlist}}
% -- better QED symbol --
%\renewcommand{\qedsymbol}{\ensuremath{\blackrectangle}}
\renewcommand{\qedsymbol}{\hspace{1pt}\rule[-1pt]{5pt}{9pt}}
% -- footnote with symbols --
\long\def\symbolfootnote[#1]#2{\begingroup%
\def\thefootnote{\fnsymbol{footnote}}\footnote[#1]{#2}\endgroup}
\newcommand{\cfootnote}[2]{\symbolfootnote[#1]{#2}}
% -- neater label items --
%\renewcommand{\labelitemi}{\textbf{--}}
% -- Better \mod support with amstex -- now called \imod --
\makeatletter
\def\imod#1{\allowbreak\mkern2mu({\operator@font mod}\,\,#1)}
% -- tabbed environment for algorithm descriptions --
\newenvironment{vbx}{\vbox\bgroup}{\egroup}
\newenvironment{RawAlg}{\begin{tabbing}%
000000 \= 000 \= 000 \= 000 \= 000 \= 000 \= 000 \= 000 \= 000 \= 000 \= \kill}%
{\end{tabbing}}
\newenvironment{alg}
{\begin{quote}\begin{RawAlg}}
{\end{RawAlg} \end{quote}}
% -- for shading text --
% usage is: \colorbox{mygray}{Shaded text goes here}
\usepackage{xcolor}
\usepackage{framed}
\colorlet{shadecolor}{gray!50}
\definecolor{mygray}{gray}{0.90}
% -- author notes --
\newcommand{\authnote}[2]{\begin{center}\fbox{\begin{minipage}{5.0in}
\textbf{\textcolor{magenta}{#1 says:}} #2\end{minipage}}\end{center}}
\newcommand{\Ananth}[1]{\begin{center} \framebox{ \parbox{ 15cm }
{\textcolor[rgb]{0.1,0.3,0.7}{{\bf Ananth:} #1}}} \end{center}}
% -- math symbols --
\newcommand{\ME}[1]{\mathbf{H}_{\infty}\! \left( #1 \right)} % min-entropy
\newcommand{\Z}{\ensuremath{\mathbb{Z}}} % integers
\newcommand{\F}{\ensuremath{\mathbb{F}}} % field
\newcommand{\R}{\ensuremath{\mathbb{R}}} % reals
\newcommand{\ring}{\ensuremath{\mathbf{R}}} % ring
\newcommand{\C}{\ensuremath{\mathbb{C}}} % complex numbers
\newcommand{\Q}{\ensuremath{\mathbb{Q}}} % rationals
\newcommand{\G}{\ensuremath{\mathbb{G}}} % group
\newcommand{\zo}{\ensuremath{\{0,1\}}} % binary alphabet
\renewcommand{\iff}{\ensuremath{\Leftrightarrow}}
\newcommand{\Iff}{\ensuremath{\Longleftrightarrow}}
\newcommand{\xor}{\ensuremath{\oplus}}
\newcommand{\Xor}{\ensuremath{\bigoplus}}
\newcommand{\andl}{\ensuremath{\wedge}}
\newcommand{\orl}{\ensuremath{\vee}}
\newcommand{\union}{\ensuremath{\cup}}
\newcommand{\intersect}{\ensuremath{\cap}}
\newcommand{\Union}{\ensuremath{\bigcup}}
\newcommand{\Intersect}{\ensuremath{\bigcap}}
\renewcommand{\implies}{\ensuremath{\Rightarrow}}
\newcommand{\Implies}{\ensuremath{\Longrightarrow}}
\newcommand{\deq}{\ensuremath{:=}} % defined as equal to
%\newcommand{\deq}{\ensuremath{\stackrel{\sf def}{=}}} % defined as equal to
\renewcommand{\phi}{\ensuremath{\varphi}}
\newcommand{\dfrom}{\ensuremath{\stackrel{R}{\leftarrow}}} % drawn from
\newcommand{\eps}{\ensuremath{\varepsilon}}
\newcommand{\set}[1]{\ensuremath{\left[#1\right]}}
\newcommand{\opt}{\ensuremath{\textsc{Opt}}}
\newcommand{\innerp}[2]{\ensuremath{\left\langle#1,#2\right\rangle}} % inner product
\newcommand{\norm}[1]{\ensuremath{\left\|#1 \right\|}} % vector norm
\newcommand{\maxnorm}[1]{\ensuremath{\left\|#1 \right\|}} % max norm
\newcommand{\gsnorm}[1]{\ensuremath{\|\widetilde{#1}\|}} % gram schmidt norm
\newcommand{\transpose}[1]{\ensuremath{{#1}^{\top}}}
\newcommand{\divides}{\ensuremath{\,|\,}} % number theory divides
\newcommand{\st}[1]{\ensuremath{{#1}^*}}
% -- bold math symbols, for some reason --
\newcommand{\boldstar}{\ensuremath{\mathbf{*}}}
\newcommand{\bolda}{\ensuremath{\boldsymbol{a}}}
\newcommand{\boldb}{\ensuremath{\boldsymbol{b}}}
\newcommand{\boldc}{\ensuremath{\boldsymbol{c}}}
\newcommand{\boldd}{\ensuremath{\boldsymbol{d}}}
\newcommand{\bolde}{\ensuremath{\boldsymbol{e}}}
\newcommand{\boldf}{\ensuremath{\boldsymbol{f}}}
\newcommand{\boldg}{\ensuremath{\boldsymbol{g}}}
\newcommand{\boldh}{\ensuremath{\boldsymbol{h}}}
\newcommand{\boldi}{\ensuremath{\boldsymbol{i}}}
\newcommand{\boldj}{\ensuremath{\boldsymbol{j}}}
\newcommand{\boldk}{\ensuremath{\boldsymbol{k}}}
\newcommand{\boldl}{\ensuremath{\boldsymbol{l}}}
\newcommand{\boldm}{\ensuremath{\boldsymbol{m}}}
\newcommand{\boldn}{\ensuremath{\boldsymbol{n}}}
\newcommand{\boldo}{\ensuremath{\boldsymbol{o}}}
\newcommand{\boldp}{\ensuremath{\boldsymbol{p}}}
\newcommand{\boldq}{\ensuremath{\boldsymbol{q}}}
\newcommand{\boldr}{\ensuremath{\boldsymbol{r}}}
\newcommand{\bolds}{\ensuremath{\boldsymbol{s}}}
\newcommand{\boldt}{\ensuremath{\boldsymbol{t}}}
\newcommand{\boldu}{\ensuremath{\boldsymbol{u}}}
\newcommand{\boldv}{\ensuremath{\boldsymbol{v}}}
\newcommand{\boldw}{\ensuremath{\boldsymbol{w}}}
\newcommand{\boldx}{\ensuremath{\boldsymbol{x}}}
\newcommand{\boldy}{\ensuremath{\boldsymbol{y}}}
\newcommand{\boldz}{\ensuremath{\boldsymbol{z}}}
\newcommand{\boldzero}{\ensuremath{\boldsymbol{0}}}
\newcommand{\boldone}{\ensuremath{\boldsymbol{1}}}
\newcommand{\boldA}{\ensuremath{\boldsymbol{A}}}
\newcommand{\boldB}{\ensuremath{\boldsymbol{B}}}
\newcommand{\boldC}{\ensuremath{\boldsymbol{C}}}
\newcommand{\boldD}{\ensuremath{\boldsymbol{D}}}
\newcommand{\boldE}{\ensuremath{\boldsymbol{E}}}
\newcommand{\boldF}{\ensuremath{\boldsymbol{F}}}
\newcommand{\boldG}{\ensuremath{\boldsymbol{G}}}
\newcommand{\boldH}{\ensuremath{\boldsymbol{H}}}
\newcommand{\boldI}{\ensuremath{\boldsymbol{I}}}
\newcommand{\boldJ}{\ensuremath{\boldsymbol{J}}}
\newcommand{\boldK}{\ensuremath{\boldsymbol{K}}}
\newcommand{\boldL}{\ensuremath{\boldsymbol{L}}}
\newcommand{\boldM}{\ensuremath{\boldsymbol{M}}}
\newcommand{\boldN}{\ensuremath{\boldsymbol{N}}}
\newcommand{\boldO}{\ensuremath{\boldsymbol{O}}}
\newcommand{\boldP}{\ensuremath{\boldsymbol{P}}}
\newcommand{\boldQ}{\ensuremath{\boldsymbol{Q}}}
\newcommand{\boldR}{\ensuremath{\boldsymbol{R}}}
\newcommand{\boldS}{\ensuremath{\boldsymbol{S}}}
\newcommand{\boldT}{\ensuremath{\boldsymbol{T}}}
\newcommand{\boldU}{\ensuremath{\boldsymbol{U}}}
\newcommand{\boldV}{\ensuremath{\boldsymbol{V}}}
\newcommand{\boldW}{\ensuremath{\boldsymbol{W}}}
\newcommand{\boldX}{\ensuremath{\boldsymbol{X}}}
\newcommand{\boldY}{\ensuremath{\boldsymbol{Y}}}
\newcommand{\boldZ}{\ensuremath{\boldsymbol{Z}}}
\newcommand{\bfA}{\ensuremath{\mathbf{A}}}
\newcommand{\bfB}{\ensuremath{\mathbf{B}}}
\newcommand{\bfC}{\ensuremath{\mathbf{C}}}
\newcommand{\bfD}{\ensuremath{\mathbf{D}}}
\newcommand{\bfE}{\ensuremath{\mathbf{E}}}
\newcommand{\bfF}{\ensuremath{\mathbf{F}}}
\newcommand{\bfG}{\ensuremath{\mathbf{G}}}
\newcommand{\bfH}{\ensuremath{\mathbf{H}}}
\newcommand{\bfI}{\ensuremath{\mathbf{I}}}
\newcommand{\bfJ}{\ensuremath{\mathbf{J}}}
\newcommand{\bfK}{\ensuremath{\mathbf{K}}}
\newcommand{\bfL}{\ensuremath{\mathbf{L}}}
\newcommand{\bfM}{\ensuremath{\mathbf{M}}}
\newcommand{\bfN}{\ensuremath{\mathbf{N}}}
\newcommand{\bfO}{\ensuremath{\mathbf{O}}}
\newcommand{\bfP}{\ensuremath{\mathbf{P}}}
\newcommand{\bfQ}{\ensuremath{\mathbf{Q}}}
\newcommand{\bfR}{\ensuremath{\mathbf{R}}}
\newcommand{\bfS}{\ensuremath{\mathbf{S}}}
\newcommand{\bfT}{\ensuremath{\mathbf{T}}}
\newcommand{\bfU}{\ensuremath{\mathbf{U}}}
\newcommand{\bfV}{\ensuremath{\mathbf{V}}}
\newcommand{\bfW}{\ensuremath{\mathbf{W}}}
\newcommand{\bfX}{\ensuremath{\mathbf{X}}}
\newcommand{\bfY}{\ensuremath{\mathbf{Y}}}
\newcommand{\bfZ}{\ensuremath{\mathbf{Z}}}
\newcommand{\bfa}{\ensuremath{\mathbf{a}}}
\newcommand{\bfb}{\ensuremath{\mathbf{b}}}
\newcommand{\bfc}{\ensuremath{\mathbf{c}}}
\newcommand{\bfd}{\ensuremath{\mathbf{d}}}
\newcommand{\bfe}{\ensuremath{\mathbf{e}}}
\newcommand{\bff}{\ensuremath{\mathbf{f}}}
\newcommand{\bfg}{\ensuremath{\mathbf{g}}}
\newcommand{\bfh}{\ensuremath{\mathbf{h}}}
\newcommand{\bfi}{\ensuremath{\mathbf{i}}}
\newcommand{\bfj}{\ensuremath{\mathbf{j}}}
\newcommand{\bfk}{\ensuremath{\mathbf{k}}}
\newcommand{\bfl}{\ensuremath{\mathbf{l}}}
\newcommand{\bfm}{\ensuremath{\mathbf{m}}}
\newcommand{\bfn}{\ensuremath{\mathbf{n}}}
\newcommand{\bfo}{\ensuremath{\mathbf{o}}}
\newcommand{\bfp}{\ensuremath{\mathbf{p}}}
\newcommand{\bfq}{\ensuremath{\mathbf{q}}}
\newcommand{\bfr}{\ensuremath{\mathbf{r}}}
\newcommand{\bfs}{\ensuremath{\mathbf{s}}}
\newcommand{\bft}{\ensuremath{\mathbf{t}}}
\newcommand{\bfu}{\ensuremath{\mathbf{u}}}
\newcommand{\bfv}{\ensuremath{\mathbf{v}}}
\newcommand{\bfw}{\ensuremath{\mathbf{w}}}
\newcommand{\bfx}{\ensuremath{\mathbf{x}}}
\newcommand{\bfy}{\ensuremath{\mathbf{y}}}
\newcommand{\bfz}{\ensuremath{\mathbf{z}}}
\newcommand{\calA}{\ensuremath{\mathcal{A}}}
\newcommand{\calB}{\ensuremath{\mathcal{B}}}
\newcommand{\calC}{\ensuremath{\mathcal{C}}}
\newcommand{\calD}{\ensuremath{\mathcal{D}}}
\newcommand{\calE}{\ensuremath{\mathcal{E}}}
\newcommand{\calF}{\ensuremath{\mathcal{F}}}
\newcommand{\calG}{\ensuremath{\mathcal{G}}}
\newcommand{\calH}{\ensuremath{\mathcal{H}}}
\newcommand{\calI}{\ensuremath{\mathcal{I}}}
\newcommand{\calJ}{\ensuremath{\mathcal{J}}}
\newcommand{\calK}{\ensuremath{\mathcal{K}}}
\newcommand{\calL}{\ensuremath{\mathcal{L}}}
\newcommand{\calM}{\ensuremath{\mathcal{M}}}
\newcommand{\calN}{\ensuremath{\mathcal{N}}}
\newcommand{\calO}{\ensuremath{\mathcal{O}}}
\newcommand{\calP}{\ensuremath{\mathcal{P}}}
\newcommand{\calQ}{\ensuremath{\mathcal{Q}}}
\newcommand{\calR}{\ensuremath{\mathcal{R}}}
\newcommand{\calS}{\ensuremath{\mathcal{S}}}
\newcommand{\calT}{\ensuremath{\mathcal{T}}}
\newcommand{\calU}{\ensuremath{\mathcal{U}}}
\newcommand{\calV}{\ensuremath{\mathcal{V}}}
\newcommand{\calW}{\ensuremath{\mathcal{W}}}
\newcommand{\calX}{\ensuremath{\mathcal{X}}}
\newcommand{\calY}{\ensuremath{\mathcal{Y}}}
\newcommand{\calZ}{\ensuremath{\mathcal{Z}}}
% -- text in math mode --
\newcommand{\textpoly}[0]{{\rm poly}}
\newcommand{\poly}[1]{\ensuremath{{\rm poly}\left(#1\right)}}
\newcommand{\polylog}[1]{\ensuremath{{\rm polylog}\left(#1\right)}}
\renewcommand{\Pr}{\ensuremath{{\rm Pr}}} % probability
\renewcommand{\th}{\ensuremath{^{\rm th}}} % ordinal numbers
\newcommand{\mystar}[1]{\ensuremath{#1^*}}
\newcommand{\myexp}{\ensuremath{\mathbb{E}}} %expectation
% -- complexity classes --
\newcommand{\NP}{\ensuremath{\mathbf{NP}}}
\newcommand{\coNP}{\ensuremath{\mathbf{co{\sf -}NP}}}
\newcommand{\BPP}{\ensuremath{\mathbf{BPP}}}
\newcommand{\RP}{\ensuremath{\mathbf{RP}}}
\newcommand{\PSPACE}{\ensuremath{\mathbf{PSPACE}}}
\newcommand{\PH}{\ensuremath{\mathbf{PH}}}
\newcommand{\sharpP}{\ensuremath{\mathbf{\# P}}}
\newcommand{\E}{\ensuremath{\mathbf{E}}}
\renewcommand{\P}{\ensuremath{\mathbf{P}}}
\newcommand{\EXP}{\ensuremath{\mathbf{EXP}}}
\newcommand{\SAT}{\ensuremath{{\sf SAT}}}
\newcommand{\TQBF}{\ensuremath{{\sf TQBF}}}
\newcommand{\psp}{\ensuremath{\P/\ppoly}}
\newcommand{\logvc}{\textsc{Log-VC}~}
\newcommand{\logis}{\textsc{Log-IS}~}
% -- crypto related stuff --
\newcommand{\Exper}{\ensuremath{\mathsf{Exp}}} % experiment
\newcommand{\Funs}{\ensuremath{\mathsf{Funs}}} % functions
\newcommand{\Adv}{\ensuremath{\mathsf{Adv}}} % advantage
\newcommand{\PRFAdv}{\ensuremath{\mathsf{PRFAdv}}} % prf advantage
\newcommand{\TrapGen}{\ensuremath{\mathsf{TrapGen}}}
\newcommand{\kSIS}{$k$-SIS\ } %k-SIS macro
\newcommand{\pp}{\ensuremath \mathsf{pp}} % public params
\newcommand{\pk}{\ensuremath \mathsf{pk}} % public key
\newcommand{\sk}{\ensuremath \mathsf{sk}} % secret key
\newcommand{\id}{\ensuremath \mathsf{id}} % secret key
\newcommand{\Enc}{\ensuremath \mathsf{Enc}} % encryption
\newcommand{\Dec}{\ensuremath \mathsf{Dec}} % decryption
\newcommand{\lperp}{\ensuremath{\Lambda^\perp_q}} % lambda perp
\newcommand{\lperpq}[1]{\ensuremath{\Lambda^\perp_{#1}}}
\newcommand{\Coset}{\ensuremath{\mathbf{C}}}
\newcommand{\pair}{\ensuremath{\hat{e}}} % Weil pairing on Elliptic curves