% Packages
\usepackage{amsmath}              % provides \underset, etc.
\usepackage{accents}              % provides \accentset, etc.; must be loaded after amsmath
\usepackage{amsopn,amssymb}       % provides \DeclareMathOperator, \mathbb, etc.
\usepackage{bbm}                  % provides \mathbbm, eg. for lower-case blackboard bold characters
\usepackage{makeidx}              % make an index
\usepackage{enumerate}            % more powerful enumerate environments
\usepackage[margin=1in]{geometry} % margins only
\usepackage{microtype}            % nicer text spacing
\usepackage[intoc,refpage]{nomencl}         % make a symbol list
\usepackage{multicol}             % put lists with many short entries into multiple columns
\usepackage{ntheorem}             % theorem-like environments, modified heavily below
\usepackage{shuffle}              % provides \shuffle and \cshuffle
\usepackage{soul}
\usepackage{tikz-cd}              % nice commutative diagrams; see cd environment below
\usepackage{xifthen}              % \ifthenelse, \isempty, etc.
\usepackage{hyperref}             % url's, clickable table of contents
\hypersetup{
    colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=black,
    urlcolor=black
}

% Math operators
\DeclareMathOperator{\Ab}{\textit{Ab}}
\DeclareMathOperator{\ad}{ad}
\DeclareMathOperator{\Alg}{-Alg}
\DeclareMathOperator{\Ann}{Ann}
\DeclareMathOperator{\Ass}{Ass}
\DeclareMathOperator{\Aut}{Aut}
\DeclareMathOperator{\ch}{ch}
\DeclareMathOperator{\Char}{char}
\DeclareMathOperator{\cHom}{\mathcal{H}\textit{om}}
\DeclareMathOperator{\coker}{coker}
\DeclareMathOperator{\cycle}{cycle}
\DeclareMathOperator{\diag}{diag}
\DeclareMathOperator{\Der}{Der}
\DeclareMathOperator{\Des}{Des}
\DeclareMathOperator{\End}{End}
\DeclareMathOperator{\Ext}{Ext}
\DeclareMathOperator{\fl}{fl}
\DeclareMathOperator{\Frac}{Frac}
\DeclareMathOperator{\id}{id}
\DeclareMathOperator{\im}{im}
\DeclareMathOperator{\Ind}{Ind}
\DeclareMathOperator{\Gal}{Gal}
\DeclareMathOperator{\GL}{GL}
\DeclareMathOperator{\gldim}{gldim}
\DeclareMathOperator{\GKdim}{GKdim}
\DeclareMathOperator{\gr}{gr}
\DeclareMathOperator{\GrSch}{-GrSch}
\DeclareMathOperator{\Groups}{Groups}
\DeclareMathOperator{\hgt}{ht}
\DeclareMathOperator{\Hom}{Hom}
\DeclareMathOperator{\Inj}{Inj}
\DeclareMathOperator{\injdim}{injdim}
\DeclareMathOperator{\Kdim}{Kdim}
\DeclareMathOperator{\Lie}{Lie}
\DeclareMathOperator{\maj}{maj}
\DeclareMathOperator{\Mod}{-mod}
\DeclareMathOperator{\Mor}{Mor}
\DeclareMathOperator{\Nil}{Nil}
\DeclareMathOperator{\nil}{nil}
\DeclareMathOperator{\NSYM}{NSYM}
\DeclareMathOperator{\Perm}{Perm}
\DeclareMathOperator{\Perms}{Perms}
\DeclareMathOperator{\Pre}{pre}
\DeclareMathOperator{\projdim}{projdim}
\DeclareMathOperator{\pt}{pt}
\DeclareMathOperator{\QSYM}{QSYM}
\DeclareMathOperator{\rk}{rank}
\DeclareMathOperator{\Res}{Res}
\DeclareMathOperator{\Rings}{Rings}
\DeclareMathOperator{\RSK}{RSK}
\DeclareMathOperator{\rw}{rw}
\DeclareMathOperator{\Sets}{Sets}
\DeclareMathOperator{\sgn}{sgn}
\DeclareMathOperator{\sh}{sh}
\DeclareMathOperator{\SIT}{SIT}
\DeclareMathOperator{\SL}{SL}
\DeclareMathOperator{\SO}{SO}
\DeclareMathOperator{\soc}{soc}
\DeclareMathOperator{\sort}{sort}
\DeclareMathOperator{\Span}{Span}
\DeclareMathOperator{\spec}{spec}
\DeclareMathOperator{\spin}{spin}
\DeclareMathOperator{\str}{str}
\DeclareMathOperator{\Supp}{Supp}
\DeclareMathOperator{\SST}{SST}
\DeclareMathOperator{\SSYT}{SSYT}
\DeclareMathOperator{\Stab}{Stab}
\DeclareMathOperator{\std}{std}
\DeclareMathOperator{\SYT}{SYT}
\DeclareMathOperator{\SYM}{SYM}
\DeclareMathOperator{\TL}{TL}
\DeclareMathOperator{\Tot}{Tot}
\DeclareMathOperator{\trdeg}{trdeg}
\DeclareMathOperator{\Words}{Words}
% Named ``ilim'' for ``inverse limit'' to avoid conflicting with \lim
\newcommand{\ilim}{\operatornamewithlimits{\underset{\longleftarrow}{lim}}}
% ``dlim'' for ``direct limit''
\newcommand{\dlim}{\operatornamewithlimits{\underset{\longrightarrow}{lim}}}

% Convenient shortcuts
\newcommand{\bA}{\mathbb{A}}
\newcommand{\bC}{\mathbb{C}}
\newcommand{\bE}{\mathbb{E}}
\newcommand{\bF}{\mathbb{F}}
\newcommand{\bG}{\mathbb{G}}
\newcommand{\bk}{\mathbbm{k}}
\newcommand{\bM}{\mathbb{M}}
\newcommand{\bN}{\mathbb{N}}
\newcommand{\bP}{\mathbb{P}}
\newcommand{\bQ}{\mathbb{Q}}
\newcommand{\bR}{\mathbb{R}}
\newcommand{\bS}{\mathbb{S}}
\newcommand{\bV}{\mathbb{V}}
\newcommand{\bZ}{\mathbb{Z}}
\newcommand{\cA}{\mathcal{A}}
\newcommand{\cB}{\mathcal{B}}
\newcommand{\cC}{\mathcal{C}}
\newcommand{\cD}{\mathcal{D}}
\newcommand{\cE}{\mathcal{E}}
\newcommand{\cF}{\mathcal{F}}
\newcommand{\cG}{\mathcal{G}}
\newcommand{\cH}{\mathcal{H}}
\newcommand{\cI}{\mathcal{I}}
\newcommand{\cL}{\mathcal{L}}
\newcommand{\cM}{\mathcal{M}}
\newcommand{\cO}{\mathcal{O}}
\newcommand{\cP}{\mathcal{P}}
\newcommand{\cS}{\mathcal{S}}
\newcommand{\cU}{\mathcal{U}}
\newcommand{\fg}{\mathfrak{g}}
\newcommand{\fgl}{\mathfrak{gl}}
\newcommand{\fm}{\mathfrak{m}}
\newcommand{\fn}{\mathfrak{n}}
\newcommand{\fp}{\mathfrak{p}}
\newcommand{\fq}{\mathfrak{q}}
\newcommand{\fS}{\mathfrak{S}}
\newcommand{\fu}{\mathfrak{u}}
\newcommand{\fU}{\mathfrak{U}}
\newcommand{\tsub}{\mathrel{\unlhd}}

% Convenient general macros
\newcommand{\too}[1]{\stackrel{#1}{\to}}
\newcommand{\tooo}[2]{\underset{#2}{\overset{#1}{\to}}}
\newcommand{\oo}[3]{\underset{#3}{\overset{#2}{#1}}}
\newcommand{\sline}{\noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}}
\newcommand{\mdy}[1]{\sline\vspace{0.19cm}\\\centering{\Large{\textbf{#1}}}\\\sline}
\newcommand{\ind}{\!\!\uparrow}
\newcommand{\res}{\!\!\downarrow}
\newcommand{\sep}{\text{sep}}
\newcommand{\f}{\frac}
\newcommand{\lm}{\lambda}
\newcommand{\pa}[1]{{\left( {#1}\right)}}
\newcommand{\ha}{\f{1}{2}}
\newcommand{\sub}{\subset}
\newcommand{\al}{\alpha}
\newcommand{\8}{\infty}
\newcommand{\bs}{\bigskip}
\newcommand{\D}{\Delta}
\newcommand{\s}{\sigma}
\newcommand{\dd}{\cdot}
\newcommand{\inv}{^{-1}}
\newcommand{\zhat}{\widehat{0}}
\newcommand{\ohat}{\widehat{1}}
\newcommand{\idd}{\accentset{\bullet}{\iota}}

\newenvironment{cd}[1][]
  {\begin{center}\begin{tikzcd}[#1]}
  {\end{tikzcd}\end{center}}

% Index/nomenclature configuration and macros
\renewcommand\nomname{List of Symbols}
\newcommand{\bu}[2][]{\framebox{#2}\ifthenelse{\isempty{#1}}{\index{#2}}{\index{#1@#2}}}
\newcommand{\mbu}[3][]{\boxed{#2}\nomenclature[$#1$]{$#2$}{#3}}
\newcommand{\mapsfrom}{\mathrel{\reflectbox{\ensuremath{\mapsto}}}}

% Section macros
\newcommand{\Section}[1]{\begin{samepage}\sline\vspace{-0.5cm}\section*{\centering{#1}}\vspace{-0.5cm}\sline
  \addcontentsline{toc}{subsection}{#1}\end{samepage}}
\newcommand{\Subsection}[1]{\subsection*{\centering\color{teal}#1}
  \addcontentsline{toc}{subsection}{#1}}
\newcommand{\Subsubsection}[1]{\subsubsection*{\centering\color{teal}#1}
  \addcontentsline{toc}{subsubsection}{#1}}

% Modify standard distance between paragraphs; makes them lookmuch better inside
%   ntheorem environments
\setlength{\parskip}{0.3cm}

% Modify standard ntheorem environments; include eg. indentation
\theoremindent=1cm

\theoremheaderfont{\kern-1cm\normalfont\bfseries}\theorembodyfont{\slshape}

\theoremstyle{changebreak}

\theoremsymbol{\ensuremath{\diamondsuit}}
\newtheorem{Theorem}{Theorem}

\theoremsymbol{\ensuremath{\heartsuit}}
\newtheorem{Lemma}[Theorem]{Lemma}
\newtheorem{Proposition}[Theorem]{Proposition}

\theoremsymbol{\ensuremath{\spadesuit}}
\newtheorem{Corollary}[Theorem]{Corollary}

\theoremstyle{changebreak}
\theorembodyfont{\upshape}
\theoremsymbol{\ensuremath{\ast}}
\theoremseparator{}
\newtheorem{Example}[Theorem]{Example}
\newtheorem{Remark}[Theorem]{Remark}
\newtheorem{Motivation}[Theorem]{Motivation}
\newtheorem{Aside}[Theorem]{Aside}
\newtheorem{Notation}[Theorem]{Notation}
\newtheorem{Fact}[Theorem]{Fact}
\newtheorem{Open}[Theorem]{Open Problem}
\newtheorem{Exercise}[Theorem]{Exercise}
\newtheorem{Homework}[Theorem]{Homework}
\newtheorem{Conjecture}[Theorem]{Conjecture}

\theoremstyle{nonumberplain}
\newtheorem{Summary}{Summary}

\theoremstyle{plain}
\theoremsymbol{\ensuremath{\clubsuit}}
\theoremseparator{.}
\newtheorem{Definition}[Theorem]{Definition}

\theoremheaderfont{\kern-1cm\sc}\theorembodyfont{\upshape}
\theoremstyle{nonumberplain}
\theoremseparator{}
\theoremsymbol{\rule{1ex}{1ex}}
\newtheorem{Proof}{Proof}

