% LaTeX hacks
\tracingonline=0

% standard abbreviations
\newcommand{\etc}{{\it etc.}}
\newcommand{\ie}{{\it i.e.}}
\newcommand{\eg}{{\it e.g.}}
\newcommand{\cf}{{\it cf.}}
\newcommand{\vs}{{\it vs.}}
\newcommand{\etal}{{\it et.~al.}}
\newcommand{\st}{{\it s.t.}}

% fix up colon conventions
%\mathcode`:="003A		% ordinary colon (tight spacing)
%\mathchardef\colon="303A	% relation colon
%\mathchardef\punctcolon="603A	% colon as a punctuation mark
\mathchardef\colon="003A	% colon as ordinary symbol

% to omit stuff
\long\def\comment#1{}
\long\def\Omit#1{}

% notes
%\newcommand{\note}[1]{\fbox{#1}}

% environments
\newtheorem{thm}{Theorem}[section]
\newtheorem{theorem}[thm]{Theorem}
\newtheorem{lemma}[thm]{Lemma}
\newtheorem{cor}[thm]{Corollary}
\newtheorem{corollary}[thm]{Corollary}
\newtheorem{claim}[thm]{Claim}
\newtheorem{prop}[thm]{Proposition}
\newtheorem{proposition}[thm]{Proposition}
\newtheorem{conj}[thm]{Conjecture}
\newtheorem{conjecture}[thm]{Conjecture}
\newtheorem{defn}[thm]{Definition}
\newtheorem{definition}[thm]{Definition}
\newtheorem{exercise}[thm]{Exercise}
\newtheorem{example}[thm]{Example}
\newtheorem{remark}[thm]{Remark}
\newtheorem{open}[thm]{Open Problem}
\newtheorem{notation}[thm]{Notation}
\newtheorem{counterexample}[thm]{Counterexample}
\newtheorem{ctx}[thm]{Counterexample}

% proof / qed
\newcommand{\proof}{\\{\bf Proof}\ }
\newcommand{\blob}{\mbox{\rule[-1.5pt]{5pt}{10.5pt}}}
\newcommand{\qed}{\quad\hfill\mbox{$\Box$}}
%\newcommand{\qed}{{\quad\hfill\hbox{\vrule width1.0ex height1.0ex}\parfillskip 0pt}}

% kludge to fix problem about enumerate and itemize in a theorem
\newcommand{\thmkludge}{\hfill\setlength{\leftmargin}{\parindent}}

% math mode symbols
%\newcommand{\eqdef}{\stackrel{{\rm def}}{=}}
\newcommand{\eqdef}{\mathrel{\colon=}}
\newcommand{\simeqdef}{\mathrel{\colon\simeq}}
\newcommand{\is}{\equiv}
\newcommand{\isdef}{\mathrel{\colon\equiv}}

\newcommand{\pto}{\rightharpoonup}	% partial function
\newcommand{\inclu}{\hookrightarrow}	% inclusion
\newcommand{\mono}{\tailrightarrow}	% monomorphism
\newcommand{\epi}{\doubleheadedrightarrow} % epimorphism
%\newcommand{\natto}{\stackrel{\cdot}{\to}} % natural transformation
\newcommand{\natto}{\mathop{\hspace{0.2em}\raisebox{0.75ex}{.}\hspace{-0.8em}\rightarrow}{}}
\newcommand{\iso}{\cong}		% isomorphism
\newcommand{\natiso}{\stackrel{\cdot}{\iso}} % natural isomorphism

\newcommand{\cross}{\times}		% cartesian doubts

\newcommand{\id}{\mathop{\it id}\nolimits}	% identity function

\newcommand{\Dmn}{\mathop{\rm dom}}
\newcommand{\Rng}{\mathop{\rm rng}}
\newcommand{\Pow}{\mathop{{\cal P}{\it ow}}}
\newcommand{\Img}{\mathop{\rm img}\nolimits}

\newcommand{\Powcov}{\mathop{\Pow_{\rightarrow}}\nolimits}
\newcommand{\Powcon}{\mathop{\Pow_{\leftarrow}}\nolimits}

\newcommand{\FV}{\mathop{\rm FV}\nolimits}

\newcommand{\union}{\cup}
\newcommand{\intersect}{\cap}
\newcommand{\subs}{\subseteq}
\newcommand{\el}{\in}
\newcommand{\nel}{\not\in}

\newcommand{\infinity}{\infty}

\newcommand{\defd}{\mathord{\downarrow}}	% ``is defined'' symbol

\newcommand{\ts}{\vdash}
\newcommand{\dts}{\models}

\newcommand{\bottom}{\perp}

\newcommand{\lam}{\lambda}

\newcommand{\fa}{\forall}
\newcommand{\te}{\exists}
\newcommand{\imp}{\mathrel\supset}
\newcommand{\implies}{\mathrel\supset}
\newcommand{\Iff}{\mathrel{\Leftrightarrow}}
%\newcommand{\Iff}{\mathrel{\mathord{\supset}\mathord{\subset}}}
\renewcommand{\iff}{\Iff}

% meaning function
\newcommand{\dlb}{\lbrack\!\lbrack}
\newcommand{\ldb}{\dlb}
\newcommand{\drb}{\rbrack\!\rbrack}
\newcommand{\rdb}{\drb}
\newcommand{\mean}[1]{\mathop{\dlb #1\drb}\nolimits}

% sequence of #1's, numbered up to #2  (e.g., seq{x}{n} for x1 ... xn   )
\newcommand{\seq}[2]{#1_{1} \ldots #1_{#2}}  

% comma--separated sequence
\newcommand{\cseq}[2]{#1_{1},\ldots,#1_{#2}}

% set braces
\newcommand{\set}[2]{\{\,#1\,\mid\,#2\,\}}
\newcommand{\singleton}[1]{\{\,#1\,\}}

% families
\newcommand{\family}[2]{\langle\,#1\,\rangle_{#2}}

% syntactic substitution of #1 for #2 in #3
\newcommand{\subst}[3]{[#1/#2]#3}

% context-free grammars
\newcommand{\GoesTo}{\mathop{\colon\colon\mathord{=}}\nolimits}
\newcommand{\Or}{\mathrel{\mid}}
