Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
823 lines (768 sloc) 31.2 KB
\usepackage{amssymb,amsmath,stmaryrd,mathrsfs}
%% Set this to true before loading if we're using the TAC style file.
%% Note that eventually, TAC requires everything to be in one source file.
\def\definetac{\newif\iftac} % Can't define a \newif inside another \if!
\ifx\tactrue\undefined
\definetac
%% Guess whether we're using TAC by whether \state is defined.
\ifx\state\undefined\tacfalse\else\tactrue\fi
\fi
% Similarly detect beamer
\def\definebeamer{\newif\ifbeamer}
\ifx\beamertrue\undefined
\definebeamer
%% Guess whether we're using Beamer by whether \uncover is defined.
\ifx\uncover\undefined\beamerfalse\else\beamertrue\fi
\fi
% And cleveref
\def\definecref{\newif\ifcref}
\ifx\creftrue\undefined
\definecref
% Default to false
\creffalse
\fi
\iftac\else\usepackage{amsthm}\fi
%\usepackage[all,2cell]{xy}
%\UseAllTwocells
\usepackage{tikz,tikz-cd}
\usetikzlibrary{arrows}
\ifbeamer\else
\usepackage{enumitem}
\usepackage{xcolor}
\definecolor{darkgreen}{rgb}{0,0.45,0}
\iftac\else\usepackage[pagebackref,colorlinks,citecolor=darkgreen,linkcolor=darkgreen]{hyperref}
\renewcommand*{\backref}[1]{}
\renewcommand*{\backrefalt}[4]{({%
\ifcase #1 Not cited.%
\or On p.~#2%
\else On pp.~#2%
\fi%
})}\fi
\fi
\usepackage{mathtools} % for all sorts of things
%\usepackage{graphics}
\usepackage{ifmtarg} % used in \jd
\usepackage{microtype}
%\usepackage{color,epsfig}
%\usepackage{fullpage}
%\usepackage{eucal}
%\usepackage{wasysym}
%\usepackage{txfonts} % for \invamp, or for the nice fonts
\usepackage{braket} % for \Set, etc.
\let\setof\Set
\usepackage{url} % for citations to web sites
\usepackage{xspace} % put spaces after a \command in text
%\usepackage{cite} % compress and sort grouped citations (only use with numbered citations)
\ifcref\usepackage{cleveref,aliascnt}\fi
\usepackage[status=draft,author=]{fixme}
\fxusetheme{color}
\usepackage{mathpartir}
%% If you want to use biblatex, e.g. if a journal requires (Author name YEAR) citations.
%% You also need to remove the pagebackref option and \backref commands above.
% \usepackage[style=authoryear,
% backend=biber, bibencoding=utf8,
% backref=true,
% maxnames=4,
% maxbibnames=99,
% uniquename=false,
% firstinits=true
% ]{biblatex}
% \addbibresource{all.bib}
% \let\cite\parencite
% \DeclareNameAlias{sortname}{last-first}
\makeatletter
\let\ea\expandafter
%% Defining commands that are always in math mode.
\def\mdef#1#2{\ea\ea\ea\gdef\ea\ea\noexpand#1\ea{\ea\ensuremath\ea{#2}\xspace}}
\def\alwaysmath#1{\ea\ea\ea\global\ea\ea\ea\let\ea\ea\csname your@#1\endcsname\csname #1\endcsname
\ea\def\csname #1\endcsname{\ensuremath{\csname your@#1\endcsname}\xspace}}
%% SIMPLE COMMANDS FOR FONTS AND DECORATIONS
\newcount\foreachcount
\def\foreachletter#1#2#3{\foreachcount=#1
\ea\loop\ea\ea\ea#3\@alph\foreachcount
\advance\foreachcount by 1
\ifnum\foreachcount<#2\repeat}
\def\foreachLetter#1#2#3{\foreachcount=#1
\ea\loop\ea\ea\ea#3\@Alph\foreachcount
\advance\foreachcount by 1
\ifnum\foreachcount<#2\repeat}
% Script: \sA is \mathscr{A}
\def\definescr#1{\ea\gdef\csname s#1\endcsname{\ensuremath{\mathscr{#1}}\xspace}}
\foreachLetter{1}{27}{\definescr}
% Calligraphic: \cA is \mathcal{A}
\def\definecal#1{\ea\gdef\csname c#1\endcsname{\ensuremath{\mathcal{#1}}\xspace}}
\foreachLetter{1}{27}{\definecal}
% Bold: \bA is \mathbf{A}
\def\definebold#1{\ea\gdef\csname b#1\endcsname{\ensuremath{\mathbf{#1}}\xspace}}
\foreachLetter{1}{27}{\definebold}
% Blackboard Bold: \dA is \mathbb{A}
\def\definebb#1{\ea\gdef\csname d#1\endcsname{\ensuremath{\mathbb{#1}}\xspace}}
\foreachLetter{1}{27}{\definebb}
% Fraktur: \fa is \mathfrak{a}, except for \fi; \fA is \mathfrak{A}
\def\definefrak#1{\ea\gdef\csname f#1\endcsname{\ensuremath{\mathfrak{#1}}\xspace}}
\foreachletter{1}{9}{\definefrak}
\foreachletter{10}{27}{\definefrak}
\foreachLetter{1}{27}{\definefrak}
% Sans serif: \ia is \mathsf{a}, except for \if and \in and \it
\def\definesf#1{\ea\gdef\csname i#1\endcsname{\ensuremath{\mathsf{#1}}\xspace}}
\foreachletter{1}{6}{\definesf}
\foreachletter{7}{14}{\definesf}
\foreachletter{15}{20}{\definesf}
\foreachletter{21}{27}{\definesf}
\foreachLetter{1}{27}{\definesf}
% Bar: \Abar is \overline{A}, \abar is \overline{a}
\def\definebar#1{\ea\gdef\csname #1bar\endcsname{\ensuremath{\overline{#1}}\xspace}}
\foreachLetter{1}{27}{\definebar}
\foreachletter{1}{8}{\definebar} % \hbar is something else!
\foreachletter{9}{15}{\definebar} % \obar is something else!
\foreachletter{16}{27}{\definebar}
% Tilde: \Atil is \widetilde{A}, \atil is \widetilde{a}
\def\definetil#1{\ea\gdef\csname #1til\endcsname{\ensuremath{\widetilde{#1}}\xspace}}
\foreachLetter{1}{27}{\definetil}
\foreachletter{1}{27}{\definetil}
% Hats: \Ahat is \widehat{A}, \ahat is \widehat{a}
\def\definehat#1{\ea\gdef\csname #1hat\endcsname{\ensuremath{\widehat{#1}}\xspace}}
\foreachLetter{1}{27}{\definehat}
\foreachletter{1}{27}{\definehat}
% Checks: \Achk is \widecheck{A}, \achk is \widecheck{a}
\def\definechk#1{\ea\gdef\csname #1chk\endcsname{\ensuremath{\widecheck{#1}}\xspace}}
\foreachLetter{1}{27}{\definechk}
\foreachletter{1}{27}{\definechk}
% Underline: \uA is \underline{A}, \ua is \underline{a}
\def\defineul#1{\ea\gdef\csname u#1\endcsname{\ensuremath{\underline{#1}}\xspace}}
\foreachLetter{1}{27}{\defineul}
\foreachletter{1}{27}{\defineul}
% Particular commands for typefaces, sometimes with the first letter
% different.
\def\autofmt@n#1\autofmt@end{\mathrm{#1}}
\def\autofmt@b#1\autofmt@end{\mathbf{#1}}
\def\autofmt@d#1#2\autofmt@end{\mathbb{#1}\mathsf{#2}}
\def\autofmt@c#1#2\autofmt@end{\mathcal{#1}\mathit{#2}}
\def\autofmt@s#1#2\autofmt@end{\mathscr{#1}\mathit{#2}}
\def\autofmt@f#1\autofmt@end{\mathsf{#1}}
\def\autofmt@k#1\autofmt@end{\mathfrak{#1}}
% Particular commands for decorations.
\def\autofmt@u#1\autofmt@end{\underline{\smash{\mathsf{#1}}}}
\def\autofmt@U#1\autofmt@end{\underline{\underline{\smash{\mathsf{#1}}}}}
\def\autofmt@h#1\autofmt@end{\widehat{#1}}
\def\autofmt@r#1\autofmt@end{\overline{#1}}
\def\autofmt@t#1\autofmt@end{\widetilde{#1}}
\def\autofmt@k#1\autofmt@end{\check{#1}}
% Defining multi-letter commands. Use this like so:
% \autodefs{\bSet\cCat\cCAT\kBicat\lProf}
\def\auto@drop#1{}
\def\autodef#1{\ea\ea\ea\@autodef\ea\ea\ea#1\ea\auto@drop\string#1\autodef@end}
\def\@autodef#1#2#3\autodef@end{%
\ea\def\ea#1\ea{\ea\ensuremath\ea{\csname autofmt@#2\endcsname#3\autofmt@end}\xspace}}
\def\autodefs@end{blarg!}
\def\autodefs#1{\@autodefs#1\autodefs@end}
\def\@autodefs#1{\ifx#1\autodefs@end%
\def\autodefs@next{}%
\else%
\def\autodefs@next{\autodef#1\@autodefs}%
\fi\autodefs@next}
%% FONTS AND DECORATION FOR GREEK LETTERS
%% the package `mathbbol' gives us blackboard bold greek and numbers,
%% but it does it by redefining \mathbb to use a different font, so that
%% all the other \mathbb letters look different too. Here we import the
%% font with bb greek and numbers, but assign it a different name,
%% \mathbbb, so as not to replace the usual one.
\DeclareSymbolFont{bbold}{U}{bbold}{m}{n}
\DeclareSymbolFontAlphabet{\mathbbb}{bbold}
\newcommand{\dDelta}{\ensuremath{\mathbbb{\Delta}}\xspace}
\newcommand{\done}{\ensuremath{\mathbbb{1}}\xspace}
\newcommand{\dtwo}{\ensuremath{\mathbbb{2}}\xspace}
\newcommand{\dthree}{\ensuremath{\mathbbb{3}}\xspace}
% greek with bars
\newcommand{\albar}{\ensuremath{\overline{\alpha}}\xspace}
\newcommand{\bebar}{\ensuremath{\overline{\beta}}\xspace}
\newcommand{\gmbar}{\ensuremath{\overline{\gamma}}\xspace}
\newcommand{\debar}{\ensuremath{\overline{\delta}}\xspace}
\newcommand{\phibar}{\ensuremath{\overline{\varphi}}\xspace}
\newcommand{\psibar}{\ensuremath{\overline{\psi}}\xspace}
\newcommand{\xibar}{\ensuremath{\overline{\xi}}\xspace}
\newcommand{\ombar}{\ensuremath{\overline{\omega}}\xspace}
% greek with tildes
\newcommand{\altil}{\ensuremath{\widetilde{\alpha}}\xspace}
\newcommand{\betil}{\ensuremath{\widetilde{\beta}}\xspace}
\newcommand{\gmtil}{\ensuremath{\widetilde{\gamma}}\xspace}
\newcommand{\phitil}{\ensuremath{\widetilde{\varphi}}\xspace}
\newcommand{\psitil}{\ensuremath{\widetilde{\psi}}\xspace}
\newcommand{\xitil}{\ensuremath{\widetilde{\xi}}\xspace}
\newcommand{\omtil}{\ensuremath{\widetilde{\omega}}\xspace}
% MISCELLANEOUS SYMBOLS
\let\del\partial
\mdef\delbar{\overline{\partial}}
\let\sm\wedge
\newcommand{\dd}[1]{\ensuremath{\frac{\partial}{\partial {#1}}}}
\newcommand{\inv}{^{-1}}
\newcommand{\dual}{^{\vee}}
\mdef\hf{\textstyle\frac12 }
\mdef\thrd{\textstyle\frac13 }
\mdef\qtr{\textstyle\frac14 }
\let\meet\wedge
\let\join\vee
\let\dn\downarrow
\newcommand{\op}{^{\mathrm{op}}}
\newcommand{\co}{^{\mathrm{co}}}
\newcommand{\coop}{^{\mathrm{coop}}}
\let\adj\dashv
\let\iso\cong
\let\eqv\simeq
\let\cng\equiv
\mdef\Id{\mathrm{Id}}
\mdef\id{\mathrm{id}}
\alwaysmath{ell}
\alwaysmath{infty}
\let\oo\infty
\def\io{\ensuremath{(\infty,1)}}
\alwaysmath{odot}
\def\frc#1/#2.{\frac{#1}{#2}} % \frc x^2+1 / x^2-1 .
\mdef\ten{\mathrel{\otimes}}
\let\bigten\bigotimes
\mdef\sqten{\mathrel{\boxtimes}}
\def\lt{<} % For iTex compatibility
\def\gt{>}
%%% Blanks (shorthand for lambda abstractions)
\newcommand{\blank}{\mathord{\hspace{1pt}\text{--}\hspace{1pt}}}
%%% Nameless objects
\newcommand{\nameless}{\mathord{\hspace{1pt}\underline{\hspace{1ex}}\hspace{1pt}}}
% Hiragana "yo" for the Yoneda embedding, from https://arxiv.org/abs/1506.08870
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand{\yon}{\!\text{\usefont{U}{min}{m}{n}\symbol{'210}}\!}
%% Get some new symbols from mathabx, without changing the old ones by
%% importing the package. Font declarations copied from mathabx.sty:
\DeclareFontFamily{U}{mathb}{\hyphenchar\font45}
\DeclareFontShape{U}{mathb}{m}{n}{
<5> <6> <7> <8> <9> <10> gen * mathb
<10.95> mathb10 <12> <14.4> <17.28> <20.74> <24.88> mathb12
}{}
\DeclareSymbolFont{mathb}{U}{mathb}{m}{n}
\DeclareFontSubstitution{U}{mathb}{m}{n}
\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
\DeclareFontShape{U}{mathx}{m}{n}{
<5> <6> <7> <8> <9> <10>
<10.95> <12> <14.4> <17.28> <20.74> <24.88>
mathx10
}{}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareFontSubstitution{U}{mathx}{m}{n}
%% And now the symbols we want, copied from mathabx.dcl
\DeclareMathSymbol{\dotplus} {2}{mathb}{"00}% name to be checked
\DeclareMathSymbol{\dotdiv} {2}{mathb}{"01}% name to be checked
\DeclareMathSymbol{\dottimes} {2}{mathb}{"02}% name to be checked
\DeclareMathSymbol{\divdot} {2}{mathb}{"03}% name to be checked
\DeclareMathSymbol{\udot} {2}{mathb}{"04}% name to be checked
\DeclareMathSymbol{\square} {2}{mathb}{"05}% name to be checked
\DeclareMathSymbol{\Asterisk} {2}{mathb}{"06}
\DeclareMathSymbol{\bigast} {1}{mathb}{"06}
\DeclareMathSymbol{\coAsterisk} {2}{mathb}{"07}
\DeclareMathSymbol{\bigcoast} {1}{mathb}{"07}
\DeclareMathSymbol{\circplus} {2}{mathb}{"08}% name to be checked
\DeclareMathSymbol{\pluscirc} {2}{mathb}{"09}% name to be checked
\DeclareMathSymbol{\convolution} {2}{mathb}{"0A}% name to be checked
\DeclareMathSymbol{\divideontimes} {2}{mathb}{"0B}% name to be checked
\DeclareMathSymbol{\blackdiamond} {2}{mathb}{"0C}% name to be checked
\DeclareMathSymbol{\sqbullet} {2}{mathb}{"0D}% name to be checked
\DeclareMathSymbol{\bigstar} {2}{mathb}{"0E}
\DeclareMathSymbol{\bigvarstar} {2}{mathb}{"0F}
\DeclareMathSymbol{\corresponds} {3}{mathb}{"1D}% name to be checked
\DeclareMathSymbol{\boxleft} {2}{mathb}{"68}
\DeclareMathSymbol{\boxright} {2}{mathb}{"69}
\DeclareMathSymbol{\boxtop} {2}{mathb}{"6A}
\DeclareMathSymbol{\boxbot} {2}{mathb}{"6B}
\DeclareMathSymbol{\updownarrows} {3}{mathb}{"D6}
\DeclareMathSymbol{\downuparrows} {3}{mathb}{"D7}
\DeclareMathSymbol{\Lsh} {3}{mathb}{"E8}
\DeclareMathSymbol{\Rsh} {3}{mathb}{"E9}
\DeclareMathSymbol{\dlsh} {3}{mathb}{"EA}
\DeclareMathSymbol{\drsh} {3}{mathb}{"EB}
\DeclareMathSymbol{\looparrowdownleft} {3}{mathb}{"EE}
\DeclareMathSymbol{\looparrowdownright} {3}{mathb}{"EF}
% \DeclareMathSymbol{\curvearrowleft} {3}{mathb}{"F0}
% \DeclareMathSymbol{\curvearrowright} {3}{mathb}{"F1}
\DeclareMathSymbol{\curvearrowleftright} {3}{mathb}{"F2}
\DeclareMathSymbol{\curvearrowbotleft} {3}{mathb}{"F3}
\DeclareMathSymbol{\curvearrowbotright} {3}{mathb}{"F4}
\DeclareMathSymbol{\curvearrowbotleftright}{3}{mathb}{"F5}
% \DeclareMathSymbol{\circlearrowleft} {3}{mathb}{"F6}
% \DeclareMathSymbol{\circlearrowright} {3}{mathb}{"F7}
\DeclareMathSymbol{\leftsquigarrow} {3}{mathb}{"F8}
\DeclareMathSymbol{\rightsquigarrow} {3}{mathb}{"F9}
\DeclareMathSymbol{\leftrightsquigarrow} {3}{mathb}{"FA}
\DeclareMathSymbol{\lefttorightarrow} {3}{mathb}{"FC}
\DeclareMathSymbol{\righttoleftarrow} {3}{mathb}{"FD}
\DeclareMathSymbol{\uptodownarrow} {3}{mathb}{"FE}
\DeclareMathSymbol{\downtouparrow} {3}{mathb}{"FF}
\DeclareMathSymbol{\varhash} {0}{mathb}{"23}
\DeclareMathSymbol{\sqSubset} {3}{mathb}{"94}
\DeclareMathSymbol{\sqSupset} {3}{mathb}{"95}
\DeclareMathSymbol{\nsqSubset} {3}{mathb}{"96}
\DeclareMathSymbol{\nsqSupset} {3}{mathb}{"97}
% WIDECHECK
\DeclareMathAccent{\widecheck} {0}{mathx}{"71}
%% OPERATORS
\DeclareMathOperator\lan{Lan}
\DeclareMathOperator\ran{Ran}
\DeclareMathOperator\colim{colim}
\DeclareMathOperator\coeq{coeq}
\DeclareMathOperator\ob{ob}
\DeclareMathOperator\cod{cod}
\DeclareMathOperator\dom{dom}
\DeclareMathOperator\eq{eq}
\DeclareMathOperator\Tot{Tot}
\DeclareMathOperator\cosk{cosk}
\DeclareMathOperator\sk{sk}
%\DeclareMathOperator\im{im}
\DeclareMathOperator\Spec{Spec}
\DeclareMathOperator\Ho{Ho}
\DeclareMathOperator\Aut{Aut}
\DeclareMathOperator\End{End}
\DeclareMathOperator\Hom{Hom}
\DeclareMathOperator\Map{Map}
%% ARROWS
% \to already exists
\newcommand{\too}[1][]{\ensuremath{\overset{#1}{\longrightarrow}}}
\newcommand{\ot}{\ensuremath{\leftarrow}}
\newcommand{\oot}[1][]{\ensuremath{\overset{#1}{\longleftarrow}}}
\let\toot\rightleftarrows
\let\otto\leftrightarrows
\let\Impl\Rightarrow
\let\imp\Rightarrow
\let\toto\rightrightarrows
\let\into\hookrightarrow
\let\xinto\xhookrightarrow
\mdef\we{\overset{\sim}{\longrightarrow}}
\mdef\leftwe{\overset{\sim}{\longleftarrow}}
\let\mono\rightarrowtail
\let\leftmono\leftarrowtail
\let\cof\rightarrowtail
\let\leftcof\leftarrowtail
\let\epi\twoheadrightarrow
\let\leftepi\twoheadleftarrow
\let\fib\twoheadrightarrow
\let\leftfib\twoheadleftarrow
\let\cohto\rightsquigarrow
\let\maps\colon
\newcommand{\spam}{\,:\!} % \maps for left arrows
\def\acof{\mathrel{\mathrlap{\hspace{3pt}\raisebox{4pt}{$\scriptscriptstyle\sim$}}\mathord{\rightarrowtail}}}
% diagxy redefines \to, along with \toleft, \two, \epi, and \mon.
%% EXTENSIBLE ARROWS
\let\xto\xrightarrow
\let\xot\xleftarrow
% See Voss' Mathmode.tex for instructions on how to create new
% extensible arrows.
\def\rightarrowtailfill@{\arrowfill@{\Yright\joinrel\relbar}\relbar\rightarrow}
\newcommand\xrightarrowtail[2][]{\ext@arrow 0055{\rightarrowtailfill@}{#1}{#2}}
\let\xmono\xrightarrowtail
\let\xcof\xrightarrowtail
\def\twoheadrightarrowfill@{\arrowfill@{\relbar\joinrel\relbar}\relbar\twoheadrightarrow}
\newcommand\xtwoheadrightarrow[2][]{\ext@arrow 0055{\twoheadrightarrowfill@}{#1}{#2}}
\let\xepi\xtwoheadrightarrow
\let\xfib\xtwoheadrightarrow
% Let's leave the left-going ones until I need them.
%% EXTENSIBLE SLASHED ARROWS
% Making extensible slashed arrows, by modifying the underlying AMS code.
% Arguments are:
% 1 = arrowhead on the left (\relbar or \Relbar if none)
% 2 = fill character (usually \relbar or \Relbar)
% 3 = slash character (such as \mapstochar or \Mapstochar)
% 4 = arrowhead on the left (\relbar or \Relbar if none)
% 5 = display mode (\displaystyle etc)
\def\slashedarrowfill@#1#2#3#4#5{%
$\m@th\thickmuskip0mu\medmuskip\thickmuskip\thinmuskip\thickmuskip
\relax#5#1\mkern-7mu%
\cleaders\hbox{$#5\mkern-2mu#2\mkern-2mu$}\hfill
\mathclap{#3}\mathclap{#2}%
\cleaders\hbox{$#5\mkern-2mu#2\mkern-2mu$}\hfill
\mkern-7mu#4$%
}
% Here's the idea: \<slashed>arrowfill@ should be a box containing
% some stretchable space that is the "middle of the arrow". This
% space is created as a "leader" using \cleader<thing>\hfill, which
% fills an \hfill of space with copies of <thing>. Here instead of
% just one \cleader, we use two, with the slash in between (and an
% extra copy of the filler, to avoid extra space around the slash).
\def\rightslashedarrowfill@{%
\slashedarrowfill@\relbar\relbar\mapstochar\rightarrow}
\newcommand\xslashedrightarrow[2][]{%
\ext@arrow 0055{\rightslashedarrowfill@}{#1}{#2}}
\mdef\hto{\xslashedrightarrow{}}
\mdef\htoo{\xslashedrightarrow{\quad}}
\let\xhto\xslashedrightarrow
%% To get a slashed arrow in XYmatrix, do
% \[\xymatrix{A \ar[r]|-@{|} & B}\]
%% To get it in diagxy, do
% \morphism/{@{>}|-*@{|}}/[A`B;p]
%% Here is an \hto for diagxy:
% \def\htopppp/#1/<#2>^#3_#4{\:%
% \ifnum#2=0%
% \setwdth{#3}{#4}\deltax=\wdth \divide \deltax by \ul%
% \advance \deltax by \defaultmargin \ratchet{\deltax}{100}%
% \else \deltax #2%
% \fi%
% \xy\ar@{#1}|-@{|}^{#3}_{#4}(\deltax,0) \endxy%
% \:}%
% \def\htoppp/#1/<#2>^#3{\ifnextchar_{\htopppp/#1/<#2>^{#3}}{\htopppp/#1/<#2>^{#3}_{}}}%
% \def\htopp/#1/<#2>{\ifnextchar^{\htoppp/#1/<#2>}{\htoppp/#1/<#2>^{}}}%
% \def\htoop/#1/{\ifnextchar<{\htopp/#1/}{\htopp/#1/<0>}}%
% \def\hto{\ifnextchar/{\htoop}{\htoop/>/}}%
% LABELED ISOMORPHISMS
\def\xiso#1{\mathrel{\mathrlap{\smash{\xto[\smash{\raisebox{1.3mm}{$\scriptstyle\sim$}}]{#1}}}\hphantom{\xto{#1}}}}
\def\toiso{\xto{\smash{\raisebox{-.5mm}{$\scriptstyle\sim$}}}}
% SHADOWS
\def\shvar#1#2{{\ensuremath{%
\hspace{1mm}\makebox[-1mm]{$#1\langle$}\makebox[0mm]{$#1\langle$}\hspace{1mm}%
{#2}%
\makebox[1mm]{$#1\rangle$}\makebox[0mm]{$#1\rangle$}%
}}}
\def\sh{\shvar{}}
\def\scriptsh{\shvar{\scriptstyle}}
\def\bigsh{\shvar{\big}}
\def\Bigsh{\shvar{\Big}}
\def\biggsh{\shvar{\bigg}}
\def\Biggsh{\shvar{\Bigg}}
% TYPING JUDGMENTS
% Call this macro as \jd{x:A, y:B |- c:C}. It adds (what I think is)
% appropriate spacing, plus auto-sized parentheses around each typing judgment.
\def\jd#1{\@jd#1\ej}
\def\@jd#1|-#2\ej{\@@jd#1,,\;\vdash\;\left(#2\right)}
\def\@@jd#1,{\@ifmtarg{#1}{\let\next=\relax}{\left(#1\right)\let\next=\@@@jd}\next}
\def\@@@jd#1,{\@ifmtarg{#1}{\let\next=\relax}{,\,\left(#1\right)\let\next=\@@@jd}\next}
% Here's a version which puts a line break before the turnstyle.
\def\jdm#1{\@jdm#1\ej}
\def\@jdm#1|-#2\ej{\@@jd#1,,\\\vdash\;\left(#2\right)}
% Make an actual comma that doesn't separate typing judgments (e.g. A,B,C : Type).
\def\cm{,}
% 2-(CO)MONAD STUFF
\def\alg{\text{-}\mathcal{A}\mathit{lg}}
\def\algs{\text{-}\mathcal{A}\mathit{lg}_s}
\def\algl{\text{-}\mathcal{A}\mathit{lg}_l}
\def\algc{\text{-}\mathcal{A}\mathit{lg}_c}
\def\algw{\text{-}\mathcal{A}\mathit{lg}_w}
\def\psalg{\text{-}\mathcal{P}\mathit{s}\mathcal{A}\mathit{lg}}
\def\dalg{\text{-}\mathbb{A}\mathsf{lg}}
\def\coalg{\text{-}\mathcal{C}\mathit{oalg}}
\def\coalgs{\text{-}\mathcal{C}\mathit{oalg}_s}
\def\coalgl{\text{-}\mathcal{C}\mathit{oalg}_l}
\def\coalgc{\text{-}\mathcal{C}\mathit{oalg}_c}
\def\coalgw{\text{-}\mathcal{C}\mathit{oalg}_w}
\def\pscoalg{\text{-}\mathcal{P}\mathit{s}\mathcal{C}\mathit{oalg}}
\def\dcoalg{\text{-}\mathbb{C}\mathsf{oalg}}
%% SKIPIT in TikZ
% See http://tex.stackexchange.com/questions/3513/draw-only-some-segments-of-a-path-in-tikz
\long\def\my@drawfill#1#2;{%
\@skipfalse
\fill[#1,draw=none] #2;
\@skiptrue
\draw[#1,fill=none] #2;
}
\newif\if@skip
\newcommand{\skipit}[1]{\if@skip\else#1\fi}
\newcommand{\drawfill}[1][]{\my@drawfill{#1}}
%% TWOCELLS AND PULLBACKS in TIKZ-CD
\newcounter{nodemaker}
\setcounter{nodemaker}{0}
\newcommand{\twocell}[2][]{%
\global\edef\mynodeone{twocell\arabic{nodemaker}}%
\stepcounter{nodemaker}%
\global\edef\mynodetwo{twocell\arabic{nodemaker}}%
\stepcounter{nodemaker}%
\ar[#2,phantom,shift left=3,""{name=\mynodeone}]%
\ar[#2,phantom,shift right=3,""'{name=\mynodetwo}]%
\ar[Rightarrow,from=\mynodeone,to=\mynodetwo,"{#1}"]%
}
\newcommand{\twocellop}[2][]{%
\global\edef\mynodeone{twocell\arabic{nodemaker}}%
\stepcounter{nodemaker}%
\global\edef\mynodetwo{twocell\arabic{nodemaker}}%
\stepcounter{nodemaker}%
\ar[#2,phantom,shift left=3,""{name=\mynodeone}]%
\ar[#2,phantom,shift right=3,""'{name=\mynodetwo}]%
\ar[Rightarrow,from=\mynodetwo,to=\mynodeone,"{#1}"]%
}
\newcommand{\drpullback}[1][dr]{\ar[#1,phantom,near start,"\lrcorner"]}
\newcommand{\dlpullback}[1][dl]{\ar[#1,phantom,near start,"\llcorner"]}
\newcommand{\urpullback}[1][ur]{\ar[#1,phantom,near start,"\urcorner"]}
\newcommand{\ulpullback}[1][ul]{\ar[#1,phantom,near start,"\ulcorner"]}
%% TODO: This \autoref in TAC doesn't work with figures (and anything
%% else other than theorems).
%%%% THEOREM-TYPE ENVIRONMENTS, hacked to
%%% (a) number all with the same numbers, and
%%% (b) have the right names.
%% The following code should work in TAC or out of it, and with
%% hyperref or without it. In all cases, we use \label to label
%% things and \autoref to refer to them (ordinary \ref declines to
%% include names). The non-hyperref label and reference hack is from
%% Mike Mandell, I believe.
\newif\ifhyperref
\@ifpackageloaded{hyperref}{\hyperreftrue}{\hyperreffalse}
\iftac
%% In the TAC style, all theorems are actually subsections. So
%% the hyperref \autoref doesn't work and we have to use our own code
%% in any case. We also have to hook into the \state macros instead
%% of \@thm since those are what know about the current theorem type.
\let\your@state\state
\def\state#1{\my@state#1}
\def\my@state#1.{\gdef\currthmtype{#1}\your@state{#1.}}
\let\your@staterm\staterm
\def\staterm#1{\my@staterm#1}
\def\my@staterm#1.{\gdef\currthmtype{#1}\your@staterm{#1.}}
\let\@defthm\newtheorem
\def\switchtotheoremrm{\let\@defthm\newtheoremrm}
\def\defthm#1#2#3{\@defthm{#1}{#2}} % Ignore the third argument (for cleveref only)
% The following allows us to use \cref for sections too, as if it
% were cleveref. (But not for subsections, and also not for
% multiple references at once.)
\let\your@section\section
\def\section{\gdef\currthmtype{section}\your@section}
% Start out \currthmtype as empty
\def\currthmtype{}
% In a bit, we're going to redefine \label so that \label{athm} will
% also make a label "label@name@athm" which is the current value of
% \currthmtype. Now \autoref{athm} just adds a reference to this in
% front of the reference.
\ifhyperref
\def\autoref#1{\ref*{label@name@#1}~\ref{#1}}
\else
\def\autoref#1{\ref{label@name@#1}~\ref{#1}}
\fi
% This has to go AFTER the \begin{document} because apparently
% hyperref resets the definition of \label at that point.
\AtBeginDocument{%
% Save the old definition of \label
\let\old@label\label%
% Redefine \label so that \label{athm} will also make a label
% "label@name@athm" which is the current value of \currthmtype.
\def\label#1{%
{\let\your@currentlabel\@currentlabel%
\edef\@currentlabel{\currthmtype}%
\old@label{label@name@#1}}%
\old@label{#1}}
}
% TODO: This doesn't work for references to figures!
\let\cref\autoref
\else\ifcref
% Cleveref does most of it for us.
\def\defthm#1#2#3{%
%% Ensure all theorem types are numbered with the same counter
\newaliascnt{#1}{thm}
\newtheorem{#1}[#1]{#2}
\aliascntresetthe{#1}
%% This command tells cleveref's \cref what to call things
\crefname{#1}{#2}{#3}% following brace must be on separate line to support poorman cleveref sed file
}
% \let\autoref\cref % May want to use \autoref for xr-ed links
\else
% In non-TAC styles without cleveref, theorems have their own counters and so the
% hyperref \autoref works, if hyperref is loaded.
\ifhyperref
%% If we have hyperref, then we have to make sure all the theorem
%% types appear to use different counters so that hyperref can tell
%% them apart. However, we want them actually to use the same
%% counter, so we don't have both Theorem 9.1 and Definition 9.1.
\def\defthm#1#2#3{% Ignore the third argument (for cleveref only)
%% All types of theorems are number inside sections
\newtheorem{#1}{#2}[section]%
%% This command tells hyperref's \autoref what to call things
\expandafter\def\csname #1autorefname\endcsname{#2}%
%% This makes all the theorem counters actually the same counter
\expandafter\let\csname c@#1\endcsname\c@thm}
\else
%% Without hyperref, we have to roll our own. This code is due to
%% Mike Mandell. First, all theorems can now "officially" use the
%% same counter.
\def\defthm#1#2#3{\newtheorem{#1}[thm]{#2}} % Ignore the third argument (for cleveref only)
%% Save the label- and theorem-making commands
\ifx\SK@label\undefined\let\SK@label\label\fi
\let\old@label\label
\let\your@thm\@thm
%% Save the current type of theorem whenever we start one
\def\@thm#1#2#3{\gdef\currthmtype{#3}\your@thm{#1}{#2}{#3}}
%% Start that out as empty
\def\currthmtype{}
%% Redefine \label so that \label{athm} defines, in addition to a
%% label "athm" pointing to "9.1," a label "athm@" pointing to
%% "Theorem 9.1."
\def\label#1{{\let\your@currentlabel\@currentlabel\def\@currentlabel%
{\currthmtype~\your@currentlabel}%
\SK@label{#1@}}\old@label{#1}}
%% Now \autoref just looks at "athm@" instead of "athm."
\def\autoref#1{\ref{#1@}}
\fi
\let\cref\autoref
\fi\fi
%% Now the code that works in all cases. Note that TAC allows the
%% optional arguments, but ignores them. It also defines environments
%% called "theorem," etc.
\newtheorem{thm}{Theorem}[section]
\ifcref
\crefname{thm}{Theorem}{Theorems}
\else
\newcommand{\thmautorefname}{Theorem}
\fi
\defthm{cor}{Corollary}{Corollaries}
\defthm{prop}{Proposition}{Propositions}
\defthm{lem}{Lemma}{Lemmas}
\defthm{sch}{Scholium}{Scholia}
\defthm{assume}{Assumption}{Assumptions}
\defthm{claim}{Claim}{Claims}
\defthm{conj}{Conjecture}{Conjectures}
\defthm{hyp}{Hypothesis}{Hypotheses}
\iftac\switchtotheoremrm\else\theoremstyle{definition}\fi
\defthm{defn}{Definition}{Definitions}
\defthm{notn}{Notation}{Notations}
\iftac\switchtotheoremrm\else\theoremstyle{remark}\fi
\defthm{rmk}{Remark}{Remarks}
\defthm{eg}{Example}{Examples}
\defthm{egs}{Examples}{Examples}
\defthm{ex}{Exercise}{Exercises}
\defthm{ceg}{Counterexample}{Counterexamples}
\ifcref
% Display format for sections
\crefformat{section}{\S#2#1#3}
\Crefformat{section}{Section~#2#1#3}
\crefrangeformat{section}{\S\S#3#1#4--#5#2#6}
\Crefrangeformat{section}{Sections~#3#1#4--#5#2#6}
\crefmultiformat{section}{\S\S#2#1#3}{ and~#2#1#3}{, #2#1#3}{ and~#2#1#3}
\Crefmultiformat{section}{Sections~#2#1#3}{ and~#2#1#3}{, #2#1#3}{ and~#2#1#3}
\crefrangemultiformat{section}{\S\S#3#1#4--#5#2#6}{ and~#3#1#4--#5#2#6}{, #3#1#4--#5#2#6}{ and~#3#1#4--#5#2#6}
\Crefrangemultiformat{section}{Sections~#3#1#4--#5#2#6}{ and~#3#1#4--#5#2#6}{, #3#1#4--#5#2#6}{ and~#3#1#4--#5#2#6}
% Display format for appendices
\crefformat{appendix}{Appendix~#2#1#3}
\Crefformat{appendix}{Appendix~#2#1#3}
\crefrangeformat{appendix}{Appendices~#3#1#4--#5#2#6}
\Crefrangeformat{appendix}{Appendices~#3#1#4--#5#2#6}
\crefmultiformat{appendix}{Appendices~#2#1#3}{ and~#2#1#3}{, #2#1#3}{ and~#2#1#3}
\Crefmultiformat{appendix}{Appendices~#2#1#3}{ and~#2#1#3}{, #2#1#3}{ and~#2#1#3}
\crefrangemultiformat{appendix}{Appendices~#3#1#4--#5#2#6}{ and~#3#1#4--#5#2#6}{, #3#1#4--#5#2#6}{ and~#3#1#4--#5#2#6}
\Crefrangemultiformat{appendix}{Appendices~#3#1#4--#5#2#6}{ and~#3#1#4--#5#2#6}{, #3#1#4--#5#2#6}{ and~#3#1#4--#5#2#6}
\crefformat{subappendix}{\S#2#1#3}
\Crefformat{subappendix}{Section~#2#1#3}
\crefrangeformat{subappendix}{\S\S#3#1#4--#5#2#6}
\Crefrangeformat{subappendix}{Sections~#3#1#4--#5#2#6}
\crefmultiformat{subappendix}{\S\S#2#1#3}{ and~#2#1#3}{, #2#1#3}{ and~#2#1#3}
\Crefmultiformat{subappendix}{Sections~#2#1#3}{ and~#2#1#3}{, #2#1#3}{ and~#2#1#3}
\crefrangemultiformat{subappendix}{\S\S#3#1#4--#5#2#6}{ and~#3#1#4--#5#2#6}{, #3#1#4--#5#2#6}{ and~#3#1#4--#5#2#6}
\Crefrangemultiformat{subappendix}{Sections~#3#1#4--#5#2#6}{ and~#3#1#4--#5#2#6}{, #3#1#4--#5#2#6}{ and~#3#1#4--#5#2#6}
% Display format for parts
\crefname{part}{Part}{Parts}
% Display format for figures
\crefname{figure}{Figure}{Figures}
\fi
% \qedhere for TAC
\iftac
\let\qed\endproof
\let\your@endproof\endproof
\def\my@endproof{\your@endproof}
\def\endproof{\my@endproof\gdef\my@endproof{\your@endproof}}
\def\qedhere{\tag*{\endproofbox}\gdef\my@endproof{\relax}}
\fi
% Make the optional arguments to TAC's \proof behave like everyone else's
\iftac
\def\pr@@f[#1]{\subsubsection*{\sc #1.}}
\fi
% How to get QED symbols inside equations at the end of the statements
% of theorems. AMS LaTeX knows how to do this inside equations at the
% end of *proofs* with \qedhere, and at the end of the statement of a
% theorem with \qed (meaning no proof will be given), but it can't
% seem to combine the two. Use this instead.
\def\thmqedhere{\expandafter\csname\csname @currenvir\endcsname @qed\endcsname}
% Number numbered lists as (i), (ii), ...
\ifbeamer\else
\renewcommand{\theenumi}{(\roman{enumi})}
\renewcommand{\labelenumi}{\theenumi}
\fi
% Left margins for enumitem
\ifbeamer\else
\setitemize[1]{leftmargin=2em}
\setenumerate[1]{leftmargin=*}
\fi
% Also number formulas with the theorem counter
\iftac
\let\c@equation\c@subsection
\else
\let\c@equation\c@thm
\fi
\numberwithin{equation}{section}
% Only show numbers for equations that are actually referenced (or
% whose tags are specified manually) - uses mathtools. All equations
% need to be referenced with \eqref, not \ref, for this to work!
\ifcref\else
\@ifpackageloaded{mathtools}{\mathtoolsset{showonlyrefs,showmanualtags}}{}
\fi
% GREEK LETTERS, ETC.
\alwaysmath{alpha}
\alwaysmath{beta}
\alwaysmath{gamma}
\alwaysmath{Gamma}
\alwaysmath{delta}
\alwaysmath{Delta}
\alwaysmath{epsilon}
\mdef\ep{\varepsilon}
\alwaysmath{zeta}
\alwaysmath{eta}
\alwaysmath{theta}
\alwaysmath{Theta}
\alwaysmath{iota}
\alwaysmath{kappa}
\alwaysmath{lambda}
\alwaysmath{Lambda}
\alwaysmath{mu}
\alwaysmath{nu}
\alwaysmath{xi}
\alwaysmath{pi}
\alwaysmath{rho}
\alwaysmath{sigma}
\alwaysmath{Sigma}
\alwaysmath{tau}
\alwaysmath{upsilon}
\alwaysmath{Upsilon}
\alwaysmath{phi}
\alwaysmath{Pi}
\alwaysmath{Phi}
\mdef\ph{\varphi}
\alwaysmath{chi}
\alwaysmath{psi}
\alwaysmath{Psi}
\alwaysmath{omega}
\alwaysmath{Omega}
\let\al\alpha
\let\be\beta
\let\gm\gamma
\let\Gm\Gamma
\let\de\delta
\let\De\Delta
\let\si\sigma
\let\Si\Sigma
\let\om\omega
\let\ka\kappa
\let\la\lambda
\let\La\Lambda
\let\ze\zeta
\let\th\theta
\let\Th\Theta
\let\vth\vartheta
\let\Om\Omega
%% Include or exclude solutions
% This code is basically copied from version.sty, except that when the
% solutions are included, we put them in a `proof' environment as
% well. To include solutions, say \includesolutions; to exclude them
% say \excludesolutions.
% \begingroup
%
% \catcode`{=12\relax\catcode`}=12\relax%
% \catcode`(=1\relax \catcode`)=2\relax%
% \gdef\includesolutions(\newenvironment(soln)(\begin(proof)[Solution])(\end(proof)))%
% \gdef\excludesolutions(%
% \gdef\soln(\@bsphack\catcode`{=12\relax\catcode`}=12\relax\soln@NOTE)%
% \long\gdef\soln@NOTE##1\end{soln}(\solnEND@NOTE)%
% \gdef\solnEND@NOTE(\@esphack\end(soln))%
% )%
% \endgroup
\makeatother
% Local Variables:
% mode: latex
% TeX-master: ""
% End:
You can’t perform that action at this time.