\def\web{http://drorbn.net/AcademicPensieve/Projects/WKO4}
\def\citeweb#1{{\cite{WKO4}/\href{\web/#1}{\tt #1}}}

\def\draftcut{\if\draft y \cleardoublepage \fi}
%\def\draftcut{\cleardoublepage}

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{principle}[theorem]{Principle}
\newtheorem{axiom}[theorem]{Axiom}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{defprop}[theorem]{Definition-Proposition}
\newtheorem{fact}[theorem]{Fact}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{Truth}[theorem]{Truth}
\newtheorem{AlmostTruth}[theorem]{Almost Truth}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{slogan}[theorem]{Slogan}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{defwarn}[theorem]{Definition and Warning}
\newtheorem{figcap}[theorem]{Figure}
\newtheorem{image}[theorem]{Image}
\newtheorem{lemmadefinition}[theorem]{Lemma-Definition}
\newtheorem{problem}[theorem]{Problem}
\newtheorem{question}[theorem]{Question}
\newtheorem{solution}[theorem]{Solution}
\newtheorem{prize}[theorem]{Prize}

\theoremstyle{remark}
\newtheorem{comment}[theorem]{Comment}
\newtheorem{comments}[theorem]{Comments}
\newtheorem{discussion}[theorem]{Discussion}
\newtheorem{example}[theorem]{Example}
\newtheorem{exercise}[theorem]{Exercise}
\newtheorem{hint}[theorem]{Hint}
\newtheorem{interpretation}[theorem]{Interpretation}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{warning}[theorem]{Warning}

\newcommand{\prtag}[1]{\tag*{\llap{$#1$\hskip-\displaywidth}}}

\newcommand{\mathmode}[1]{$#1$}
\newlength{\standardunitlength}
\setlength{\standardunitlength}{0.00083333in}

\newcommand{\eepic}[2]{
  \setlength{\unitlength}{#2\standardunitlength}
  \begin{array}{c}
    {\input #1.eepic } 
  \end{array}
}
\newcommand{\seepic}[2]{
  \setlength{\unitlength}{#2\standardunitlength}
  \begin{array}{c}  \hspace{-1.7mm}
    \raisebox{-2pt}{\input #1.eepic }
    \hspace{-1.9mm}
  \end{array}
}

\newcommand{\fig}[1]{figure~\ref{#1}}
\def\smily{{
  \setlength{\unitlength}{0.4\standardunitlength}
  \begin{array}{c}  \hspace{-1.7mm} \raisebox{-2pt}{
    \begin{picture}(616,629)(0,-10)
    \thicklines
    \put(308.000,344.500){\arc{375.000}{0.6435}{2.4981}}
    \put(308,307){\ellipse{600}{600}}
    \put(195,382){\blacken\ellipse{76}{76}}
    \put(195,382){\ellipse{76}{76}}
    \put(420,382){\blacken\ellipse{76}{76}}
    \put(420,382){\ellipse{76}{76}}
    \end{picture}
  }
  \hspace{-1.9mm}
  \end{array}
}}

\newcommand{\ad}{\operatorname{ad}}
\newcommand{\Ad}{\operatorname{Ad}}
\newcommand{\Alt}{\operatorname{Alt}}
\newcommand{\Aut}{\operatorname{Aut}}
\newcommand{\Diff}{\operatorname{Diff}}
\newcommand{\End}{\operatorname{End}}
\newcommand{\gr}{\operatorname{gr}}
\newcommand{\im}{\operatorname{im}}
\newcommand{\mor}{\operatorname{mor}}
\newcommand{\Span}{\operatorname{span}}
\newcommand{\sign}{\operatorname{sign}}
\newcommand{\sym}{\operatorname{sym}}
\newcommand{\tr}{\operatorname{tr}}

\def\qed{{\linebreak[1]\null\hfill\text{$\Box$}}}

\newlength{\globalparindent}
\setlength{\globalparindent}{\parindent}

%\newcommand{\udot}{{\mathaccent\cdot\cup}}

\def\proof{{\par\noindent {\em Proof. } }}

\newenvironment{myitemize}{
        \begin{list}{$\bullet$}{\setlength{\leftmargin}{16pt}
        \setlength{\labelwidth}{12pt}
        \setlength{\labelsep}{4pt}}
}{
        \end{list}
}

\def\arXiv#1{{\href{http://front.math.ucdavis.edu/#1}{arXiv:\linebreak[0]#1}}}

\catcode`\@=11
\long\def\@makecaption#1#2{%
    \vskip 10pt
    \setbox\@tempboxa\hbox{%\ifvoid\tinybox\else\box\tinybox\fi
      \small\sf{\bfcaptionfont #1. }\ignorespaces #2}%
    \ifdim \wd\@tempboxa >\captionwidth {%
        \rightskip=\@captionmargin\leftskip=\@captionmargin
        \unhbox\@tempboxa\par}%
      \else
        \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
    \fi}
\font\bfcaptionfont=cmssbx10 scaled \magstephalf
\newdimen\@captionmargin\@captionmargin=2\parindent
\newdimen\captionwidth\captionwidth=\hsize
\catcode`\@=12

\definecolor{lightred}{RGB}{255, 217, 217}
\def\lightred#1{\setlength{\fboxsep}{0pt}\colorbox{lightred}{#1}}
\def\gray{\color{gray}}
\def\yellowm#1{{\setlength{\fboxsep}{0pt}\colorbox{yellow}{$#1$}}}
\def\yellowt#1{{\setlength{\fboxsep}{0pt}\colorbox{yellow}{#1}}}

\def\aAS{{\overrightarrow{AS}}}
\def\act{{\hspace{-1pt}\sslash\hspace{-0.75pt}}}
\def\aIHX{{\overrightarrow{IHX}}}
\def\aSTU{{\overrightarrow{STU}}}
\def\atder{\operatorname{\mathfrak{der}}}
\def\atdiv{\operatorname{div}}
\def\atsder{\operatorname{\mathfrak{sder}}}
\def\attder{\operatorname{\mathfrak{tder}}}
\def\attr{\operatorname{\mathfrak{tr}}}
\def\bbN{{\mathbb N}}
\def\bbQ{{\mathbb Q}}
\def\bbR{{\mathbb R}}
\def\bbZ{{\mathbb Z}}
\def\BCH{\operatorname{BCH}}
\def\calA{{\mathcal A}}
\def\calB{{\mathcal B}}
\def\calE{{\mathcal E}}
\def\calK{{\mathcal K}}
\def\calP{{\mathcal P}}
\def\calS{{\mathcal S}}
\def\calU{{\mathcal U}}
\def\Cap{{\mathit C\!a\!p}}
\def\cl{\operatorname{cl}}
\def\CW{\text{\it CW}}
\def\dA{\text{\it dA}}
\def\der{\operatorname{der}}
\def\dS{\text{\it dS}}
\def\endpar#1{~\hfill\fbox{\footnotesize\ref{#1}}}
\def\FA{\text{\it FA}}
\def\FG{\text{\it FG}}
\def\FL{\text{\it FL}}
\def\fraka{{\mathfrak a}}
\def\frakg{{\mathfrak g}}
\def\frakt{{\mathfrak t}}
\def\lie{\operatorname{\mathfrak{lie}}}
\def\PuB{{\mathit P\!u\!B}}
\def\PwB{{\mathit P\!w\!B}}
\def\remove{\setminus}
\def\sKTG{{\mathit s\!K\!T\!G}}
\def\SolKV{\text{SolKV}}
\def\sder{\operatorname{sder}}
\def\TAut{\operatorname{TAut}}
\def\tder{\operatorname{tder}}
\def\TW{\text{\it TW}}
\def\uKTG{{\mathit u\!K\!T\!G}}
\def\upcap{{\raisebox{-1mm}{\input{figs/SmallCap.pstex_t}}}}
\def\uT{{\mathit u\!T}}
\def\wTFe{{\widetilde{\mathit w\!T\!F}}}
\def\wTFo{{\mathit w\!T\!F^o}}
\def\wTF{{\mathit w\!T\!F}}

% Following
% http://tex.stackexchange.com/questions/23521/tabular-vertical-alignment-to-top
\def\imagetop#1{\vtop{\null\hbox{#1}}}

\def\face{\input{figs/face.pstex_t}}
\def\human{\input{figs/human.pstex_t}}
\def\machine{\input{figs/machine.pstex_t}}
\def\shortmathinclude#1{{%
  \newline\vspace{0mm}
  {\imagetop{\face}\
  \imagetop{\includegraphics[scale=0.16]{ComputerTalk/#1.eps}}}
  \newline\vskip 1mm
}}
\def\mathinclude#1{{\label{C:#1}%
  \newline\vspace{0mm}
  {\imagetop{\human}\
  \imagetop{\includegraphics[scale=0.16]{ComputerTalk/#1.eps}}}
  \newline\vskip 1mm
}}
\def\shortdialoginclude#1{{\label{C:#1}%
  \noindent
  \imagetop{\face}\
\imagetop{\includegraphics[scale=0.16]{ComputerTalk/Human-#1.eps}}
  \newline
  \vskip 1mm\noindent
  \imagetop{\machine}\
\imagetop{\includegraphics[scale=0.16]{ComputerTalk/Machine-#1.eps}}
  \newline
}}
\def\shortdialogincludewithlink#1{{\label{C:#1}%
  \noindent
  \imagetop{\face}\
\imagetop{\includegraphics[scale=0.16]{ComputerTalk/Human-#1.eps}}
  \newline
  \vskip 1mm\noindent
  \imagetop{\machine}\
\imagetop{\includegraphics[scale=0.16]{ComputerTalk/Machine-#1.eps}}
  \hfill\parbox[t]{1in}{
    \rightline{Fuller output:}
    \rightline{\citeweb{#1.nb}}
  }
  \newline
}}
\def\dialoginclude#1{{\label{C:#1}%
  \noindent
  \imagetop{\human}\
\imagetop{\includegraphics[scale=0.16]{ComputerTalk/Human-#1.eps}}
  \newline
  \vskip 1mm\noindent
  \imagetop{\machine}\
\imagetop{\includegraphics[scale=0.16]{ComputerTalk/Machine-#1.eps}}
  \newline
}}
\def\dialogincludewithlink#1{{\label{C:#1}%
  \noindent
  \imagetop{\human}\
\imagetop{\includegraphics[scale=0.16]{ComputerTalk/Human-#1.eps}}
  \newline
  \vskip 1mm\noindent
  \imagetop{\machine}\
\imagetop{\includegraphics[scale=0.16]{ComputerTalk/Machine-#1.eps}}
  \hfill\hspace{-1in}\parbox[t]{1in}{
    \rightline{Fuller output:}
    \rightline{\citeweb{#1.nb}}
  }
  \newline
}}
\def\ACQuote#1{{\label{C:#1}%
  \newline
  \null%
  \imagetop{\includegraphics[width=6mm]{figs/NotebookIcon.eps}}%
  \raisebox{-2mm}{\href{\web/AwCalculus.m}{\tiny\tt AC}}%
  \ \imagetop{\includegraphics[scale=0.16]{ComputerTalk/AC#1.eps}}%
  \newline
}}
\def\FLQuote#1{{\label{C:#1}%
  \newline
  \null%
  \imagetop{\includegraphics[width=6mm]{figs/NotebookIcon.eps}}%
  \raisebox{-2mm}{\href{\web/FreeLie.m}{\tiny\tt FL}}%
  \ \imagetop{\includegraphics[scale=0.16]{ComputerTalk/FL#1.eps}}%
  \newline
}}

\def\Topology{%
  \parpic[l]{\input{figs/Topology.pstex_t}%
  \hspace{-6pt}}%
  \noindent%
}
\def\Lie{%
  \parpic[l]{\input{figs/Lie.pstex_t}%
  \hspace{-6pt}}%
  \noindent%
}
\def\AT{%
  \parpic[l]{\input{figs/AT.pstex_t}%
  \hspace{-8pt}}%
  \noindent%
}
\def\NotLie{%
  \parpic[l]{\input{figs/NotLie.pstex_t}%
  \hspace{-6pt}}%
  \noindent%
}
\def\TopLie{%
  \parpic[l]{\input{figs/Topology.pstex_t}\,\input{figs/Lie.pstex_t}%
  \hspace{-6pt}}%
  \noindent%
}
\def\TopLieSmall{%
  \parpic[l]{\scalebox{0.6}{%
    \input{figs/Topology.pstex_t}\,\input{figs/Lie.pstex_t}%
    \hspace{-6pt}}}%
  \noindent%
}
\def\TopLieAT{%
  \parpic[l]{\input{figs/Topology.pstex_t}\,\input{figs/Lie.pstex_t}%
  \,\,\input{figs/AT.pstex_t}
  \hspace{-6pt}}%
  \noindent%
}

\def\ds{\displaystyle}
\def\inlineeq{\refstepcounter{equation}{\rm(\theequation)}}

\def\ob#1{\overbracket[0.5pt][1pt]{#1}}

% From
% http://tex.stackexchange.com/questions/224805/i-want-a-really-small-underbrace
\makeatletter
\def\smallunderbrace#1{\mathop{\vtop{\m@th\ialign{##\crcr
   $\hfil\displaystyle{#1}\hfil$\crcr
   \noalign{\kern3\p@\nointerlineskip}%
   \tiny\upbracefill\crcr\noalign{\kern3\p@}}}}\limits}
\makeatother

\def\glosm#1#2{{\label{g:#1}\yellowm{#2}}}
\def\glosi#1#2#3{{\item[{#2}] #3~\hfill\pageref{g:#1}}}

\newcounter{tunnel}
