%%
%%
%%  Latex style file for generic math writing.
%%	Use with amsart class.
%%  by Qixian Zhao
%%

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{zzzams}[2023/02/25 Style file for generic math writing with amsart]

%%% || Options usage ||
% - For an <option> of type "toggle", change its value by passing <option>=true or <option>=false to zzzams. For example, \usepackage[moddedop=false]{zzzams}.
% - For an <option> of type "value", change its value by passing <option>={value} to zzzams. For example, \usepackage[numberbasedon={subsection}]{zzzams}.
% - Default values of options are described in || Options summary ||.

%%% || Options summary ||
% - moddedfootnotes: add footnote customizationstegers, without correlation with section numbers. See << Footnotes >> below for details. Default is true. 
% - moddedbib: customizes how bibliography items appear in text. See << Referencing and Citation >> below for details. Default is false. 
% - moddedsymb: enables symbol modifications/shortcuts. See << Math >> below for details. Default is true. 
% - moddedop: enables shortcuts for math operators/functors like "coker". See << Math >> below for details. Default is true.
% - fontshortcuts: enables font shortcuts. See << Fonts >> below for details. Default is true. 
% - extgraphics: loads the packages graphicx and wrapfig. Default is false.
% - eulatino: sets math font to Euler and text font to Palatino Linotype. Requires XeLaTeX. Default is false.
% - addressfirstpage: displays adress and contact information on the first page, instead of the last page. Default is true.
% - articlesectitle: make the section titles appear in the style of article document class. Default is false.
% - numberbasedon: change the level based on which equations are numbered. Since all environments are numbered based on equations, this also determines how environments are numbered. Accepted values are integer (meaning numbering with integers), section, subsection, and subsubsection. Default is section.
% - bibfile: change the bibliography file to use. Default is References.bib.
% - linespreadvalue: this value is fed into \linespread{-}. Default is 1.0.
% - marginvalue: this value is fed into \geometry{margin= - }. Default is 1in.
% - tableofcontentdepth: determines how deep the table of contents go. Accepted values are section, subsection, subsubsection, paragraph, subparagraph. Default is paragraph.

\RequirePackage{options}
\options{
	/styleoptions/.new                      family,  
	/styleoptions/moddedfootnotes/.new      toggle,
	/styleoptions/moddedbib/.new            toggle,
	/styleoptions/moddedsymb/.new           toggle,
	/styleoptions/moddedop/.new             toggle,
	/styleoptions/fontshortcuts/.new        toggle,
	/styleoptions/extgraphics/.new          toggle,
	/styleoptions/eulatino/.new             toggle,
	/styleoptions/addressfirstpage/.new     toggle,
	/styleoptions/articlesectitle/.new      toggle,
	/styleoptions/numberbasedon/.new        value = {section},
	/styleoptions/bibfile/.new              value = {References.bib},
	/styleoptions/linespreadvalue/.new      value = {1.0},
	/styleoptions/marginvalue/.new          value = {1in},
	/styleoptions/tableofcontentdepth/.new  value = {paragraph},
}

% Sets the following options to be true, unless user declares otherwise.
\options{/styleoptions/moddedfootnotes}
\options{/styleoptions/moddedsymb}
\options{/styleoptions/moddedop}
\options{/styleoptions/fontshortcuts}
\options{/styleoptions/addressfirstpage}

\options@ProcessOptions{/styleoptions}
%\ProcessOptions\relax


%%% << Why do I need to load these first? >>
%=====================================================
%[P] Math and Symbol packages --------------------
\RequirePackage{amssymb, mathtools, mathabx, extpfeil}

%[O][P] Option that uses Euler + Palatino fonts; requires XeLaTeX
\iftoggle{/styleoptions/eulatino}{%
	\RequirePackage{euler}
	\RequirePackage{fontspec}
	\setmainfont{Palatino Linotype}%
}{}
%-------------------------------------------------

%%% << Spacing and Layout>>
%==================================================
%[P] Geometry -------------------------------
\RequirePackage{geometry}
\linespread{\option{/styleoptions/linespreadvalue}}
\geometry{margin=\option{/styleoptions/marginvalue}}

%[O] Table of Contents ------------------------
% -- Set depth of printed sections 
%-1 part     1 section     3 subsubsection  5 subparagraph
% 0 chapter  2 subsection  4 paragraph
% tocdepth determines to which level the sectioning commands are printed in the ToC;
% secnumdepth determines to what level the sectioning titles are numbered.
\ifoptionequal{/styleoptions/tableofcontentdepth}{section}{%
	\setcounter{tocdepth}{1}}{}
\ifoptionequal{/styleoptions/tableofcontentdepth}{subsection}{%
	\setcounter{tocdepth}{2}}{}
\ifoptionequal{/styleoptions/tableofcontentdepth}{subsubsection}{%
	\setcounter{tocdepth}{3}}{}
\ifoptionequal{/styleoptions/tableofcontentdepth}{paragraph}{%
	\setcounter{tocdepth}{4}}{}
\ifoptionequal{/styleoptions/tableofcontentdepth}{subparagraph}{%
	\setcounter{tocdepth}{5}}{}
%\setcounter{secnumdepth}{4}

%[O] Put address on the first page
\iftoggle{/styleoptions/addressfirstpage}{
	\RequirePackage[foot]{amsaddr}}{}

%[O] Change section title styles to those in article document class
\iftoggle{/styleoptions/articlesectitle}{
	\usepackage[indentafter]{titlesec}
	\titleformat{name=\section}{}{\bfseries\thetitle.}{0.8em}{\large\centering\bfseries}
	}{}
%----------------------------------------------------

%%% << Footnotes >>
%==================================================
%[O][P] Option that refines footnotes
\iftoggle{/styleoptions/moddedfootnotes}{
	\RequirePackage[hang,flushmargin]{footmisc}
	%\RequirePackage[numberlinked=false]{footnotebackref}
	%\RequirePackage{bigfoot}
	%\addtolength{\footnotesep}{-1mm} % add space between two footnotes
	\renewcommand{\thefootnote}{[\arabic{footnote}]} % change footnote style
	%\interfootnotelinepenalty=100000 % Prevent footnote split, requires bigfoot package%
}{}
%--------------------------------------------------------------


%%% << Referencing and Citation >>
%===============================================================
%[P] Hyperref ------------------------------------
% Should be loaded after footnote packages to ensure the links go to the correct places.
\RequirePackage[bookmarks, bookmarksdepth=2, colorlinks=true, linkcolor=blue, citecolor=blue, urlcolor=blue, unicode]{hyperref}

%[P] Citation -------------------------------------
\RequirePackage[hyperref=true, style=alphabetic, isbn=false, url=false, giveninits=true, sorting=nyt]{biblatex}
\addbibresource{\option{/styleoptions/bibfile}} % Put your .bib file here
\RequirePackage{mathscinet}

%[O] Bibliography style customization
\iftoggle{/styleoptions/moddedbib}{%
	\DeclareLabelalphaTemplate{
		\labelelement{
			\field[final]{shorthand}
		}
		\labelelement{
			\field[ifnames=1, strwidth=3]{labelname}
			\field[ifnames=2, varwidth, strwidthmax=2]{labelname}
			\field[ifnames={3-}, varwidthlist, strwidthmax=2, names=4]{labelname}
		}
		\labelelement{
			\field[strwidth=2,strside=right]{year}
		}
	}
}{}

% -- Suppress page prefix ("p.") in citations
\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}
%--------------------------------------------------------------


%%% << Graphing >>
%========================================================
%[P] Tikz ----------------------------
\RequirePackage{tikz, tikz-cd}
\usetikzlibrary{matrix,positioning,arrows}
\tikzset{>=stealth}
\tikzcdset{arrow style=tikz, diagrams={>=stealth}}

% -- Vertical arrow label
\tikzset{rot90/.style={anchor=south, rotate=90, inner sep=.5mm}}

%[P] External graphics ------------------
%[O] Option that loads packages dealing with external graphics
\iftoggle{/styleoptions/extgraphics}{\RequirePackage{graphicx, wrapfig}}{}
%--------------------------------------------------


%%% << Math >>
%==================================================

% - Modifications/shortcuts ------------------------
%[O] Option that disables everything under "Modifications/shortcuts"
\iftoggle{/styleoptions/moddedsymb}{
	% -- Miscellaneous modifications and shortcuts
	\newcommand{\inv}{^{-1}}
	\renewcommand{\le}{\leqslant}
	\renewcommand{\ge}{\geqslant}
	\newcommand{\widesim}[2][1.5]{\mathrel{\overset{#2}{\scalebox{#1}[1]{$\sim$}}}}
	\renewcommand{\forany}{\,\forall\,} 
	\newcommand{\thereis}{\,\exists\,}
	\newcommand{\modulo}{\mathbin{\text{mod}}}
	\newcommand{\surj}{\twoheadrightarrow}
	\newcommand{\surjects}{\xtwoheadrightarrow{}}
	\newcommand{\inj}{\hookrightarrow}
	\newcommand{\injects}{\xhookrightarrow{\;\;\;\;\;}}
	\newcommand{\bij}{\xrightarrow{\raisebox{-1.2ex}[0ex][1ex]{$\sim$}}}
	\newcommand{\bijects}{\xrightarrow{\,\raisebox{-1.2ex}[0ex][1ex]{$\widesim[1]{}$\,}}}
	\newcommand{\aro}{\xrightarrow{\;\;\;\;\;}}
	\newcommand{\acts}{\mathrel{\reflectbox{$\righttoleftarrow$}}}
	\newcommand{\racts}{\righttoleftarrow}
	\newcommand{\mapsfrom}{\reflectbox{$\mapsto$}}
	\newcommand{\eps}{\varepsilon}
	\newcommand{\xmapsfrom}[2][]{\ext@arrow3095\leftarrowfill@{#1}{#2}\mapsfromchar}
	%\newcommand{\cle}{\preccurlyeq}
	%\newcommand{\cge}{\succcurlyeq}
	%\newcommand{\xeq}[1]{\overset{\mathrm{#1}}{=\joinrel=}}
	%\newcommand{\xlongeq}[1]{\overset{\mathrm{#1}}{=\joinrel=\joinrel=\joinrel=}}
	%\newcommand{\Iaro}{\xmapsto{\,\,\,\,\,\,\,}}
	
	% -- [P] dotimes/lotimes: otimes with subscripts on the bottom. The l-version has "L" on top
	\RequirePackage{xparse}
	\NewDocumentCommand{\dotimes}{t_}{\IfBooleanTF{#1}{\otimeop}{\otimes}}
	\NewDocumentCommand{\otimeop}{m}{\mathbin{\mathop{\otimes}\displaylimits_{#1}}}
	\NewDocumentCommand{\lotimes}{t_}{\IfBooleanTF{#1}{\lotimeop}{\otimes}}
	\NewDocumentCommand{\lotimeop}{m}{\mathbin{\mathop{\overset{\mathrm{L}}{\otimes}}\displaylimits_{#1}}}
	
	% -- Squiggley arrow
	\usetikzlibrary{calc,decorations.pathmorphing,shapes}
	\newcounter{sarrow}
	\newcommand\xrsquigarrow[1]{%
		\stepcounter{sarrow}%
		\mathrel{\begin{tikzpicture}[baseline= {( $ (current bounding box.south) + (0,-0.5ex) $ )}]
			\node[inner sep=.5ex] (\thesarrow) {$\scriptstyle #1$};
			\path[draw,<-,decorate,
			decoration={zigzag,amplitude=0.7pt,segment length=1.2mm,pre=lineto,pre length=4pt}] 
			(\thesarrow.south east) -- (\thesarrow.south west);
			\end{tikzpicture}}%
	}
	
	% -- Double arrow with text
	\newextarrow{\xtwoarrows}{{20}{20}{20}{20}}
	{\bigRelbar\bigRelbar{\bigtwoarrowsleft\rightarrow\rightarrow}}
	
	% -- Exterior Product with the correct size
	\newcommand{\Exterior}{\mathchoice{{\textstyle\bigwedge}}%
		{{\bigwedge}}%
		{{\textstyle\wedge}}%
		{{\scriptstyle\wedge}}%
	}

	% -- Small matrix
	\newcommand\SmallMatrix[1]{{%
			\tiny\arraycolsep=0.3\arraycolsep\ensuremath{\begin{pmatrix}#1\end{pmatrix}}}}
	
	% -- Subalign: substack but with an alignment point
	\makeatletter
	\newcommand{\subalign}[1]{%
		\vcenter{%
			\Let@ \restore@math@cr \default@tag
			\baselineskip\fontdimen10 \scriptfont\tw@
			\advance\baselineskip\fontdimen12 \scriptfont\tw@
			\lineskip\thr@@\fontdimen8 \scriptfont\thr@@
			\lineskiplimit\lineskip
			\ialign{\hfil$\m@th\scriptstyle##$&$\m@th\scriptstyle{}##$\hfil\crcr
				#1\crcr
			}%
		}%
	}
	\makeatother
}{}

% - Operators --------------------------------------
%[O] Option that disables everything under "Operators"
\iftoggle{/styleoptions/moddedop}{
	\DeclareMathOperator{\Ad}{Ad}
	\DeclareMathOperator{\ad}{ad}
	\DeclareMathOperator{\im}{im} 
	\DeclareMathOperator{\codim}{codim}
	\DeclareMathOperator{\coker}{coker}
	\newcommand{\Hom}{\operatorname{Hom}}
	\newcommand{\cHom}{\mathcal{H}om}
	\DeclareMathOperator{\supp}{Supp} 
	\DeclareMathOperator{\rad}{rad} 
	\DeclareMathOperator{\Ass}{Ass}
	\DeclareMathOperator{\Ann}{Ann}
	\DeclareMathOperator{\norm}{Norm}
	\DeclareMathOperator{\trace}{Tr}
	\DeclareMathOperator{\diag}{diag}
	\DeclareMathOperator{\rank}{rank}
	\DeclareMathOperator{\Ext}{Ext}
	\DeclareMathOperator{\reg}{reg}
	\DeclareMathOperator{\End}{End}
	\DeclareMathOperator{\Pf}{Pf}
	\DeclareMathOperator{\Sym}{Sym}
	\DeclareMathOperator{\Der}{Der}
	\DeclareMathOperator{\Aut}{Aut}
	\DeclareMathOperator{\depth}{depth}
	\DeclareMathOperator{\Tor}{Tor}
	\DeclareMathOperator{\pdim}{pdim}
	\DeclareMathOperator{\idim}{idim}
	\DeclareMathOperator{\gldim}{gldim}
	\DeclareMathOperator{\Spec}{Spec}
	\DeclareMathOperator{\grade}{grade}
	\DeclareMathOperator{\mult}{mult}
	\DeclareMathOperator{\ind}{ind}
	\DeclareMathOperator{\Ind}{Ind}
	\DeclareMathOperator{\res}{res}
	\DeclareMathOperator{\Res}{Res}
	\DeclareMathOperator{\sgn}{sgn}
	\DeclareMathOperator{\Jac}{Jac}
	\DeclareMathOperator{\Pic}{Pic}
	\DeclareMathOperator{\gr}{gr}
	\DeclareMathOperator{\Mod}{Mod}
}{}
%--------------------------------------------------



%%% << Environments and Numbering >>
%=====================================================
% - Enumeration 
\usepackage{enumitem}


% - Equations ---------------------------
%[O] Option that changes how numbering works. 

%\ifoptionequal{/styleoptions/numberbasedon}{integer}{}{}
\ifoptionequal{/styleoptions/numberbasedon}{section}{%
	\numberwithin{equation}{section}}{}
\ifoptionequal{/styleoptions/numberbasedon}{subsection}{%
	\numberwithin{equation}{subsection}}{}
\ifoptionequal{/styleoptions/numberbasedon}{subsubsection}{%
	\numberwithin{equation}{subsubsection}}{}



% - Theorems ---------------------------------------
\newtheorem{theorem}[equation]{Theorem}
\newtheorem{deftheorem}[equation]{Definition/Theorem}
\newtheorem{proposition}[equation]{Proposition}
\newtheorem{corollary}[equation]{Corollary}
\newtheorem{lemma}[equation]{Lemma}
\newtheorem*{thm}{Theorem}
\newtheorem*{prop}{Proposition}
\newtheorem*{cor}{Corollary}
\newtheorem*{lem}{Lemma}
\renewcommand\qedsymbol{$\centerdot$}

% -- Named Theorem: ``\begin{namedtheorem}[Name of the Theorem]''
\newtheoremstyle{named}{}{}{\itshape}{}{\bfseries}{.}{.5em}{\thmname{#3} \thmnumber{#2}}
\theoremstyle{named}
\newtheorem{namedtheorem}[equation]{Theorem}

% -- Tagged Theorem: ``\begin{taggedtheorem}{NewTag}[subtitle]''
\theoremstyle{theorem}
\newtheorem{taggedtheoremx}{Theorem}
\newenvironment{taggedtheorem}[1]
	{\renewcommand\thetaggedtheoremx{#1}\taggedtheoremx}
	{\endtaggedtheoremx}
	
% - Definitions --------------------------------
\theoremstyle{definition}
\newtheorem{definition}[equation]{Definition}
\newtheorem*{defn}{Definition}
\newtheorem{example}[equation]{Example}
\newtheorem*{eg}{Example}
\newtheorem{claim}[equation]{Claim}
\newtheorem*{clm}{Claim}
\newtheorem{exercise}[equation]{Exercise}
\newtheorem*{exer}{Exercise}
\newtheorem{problem}[equation]{Problem}
\newtheorem*{prob}{Problem}
\newtheorem{notation}[equation]{Notation}
\newtheorem*{notn}{Notation}
\newtheorem{question}[equation]{Question}
\newtheorem*{questn}{Question}

% - Remarks -------------------------------------
\theoremstyle{remark}
\newtheorem{remark}[equation]{Remark}
%--------------------------------------------------




%%% << Fonts >>
%============================================

%[P] Fonts: Ralph Smith’s Script
\RequirePackage{mathrsfs}

%[O] Option that disables the following font shortcuts
\iftoggle{/styleoptions/fontshortcuts}{
	% - Letters ---------------------------
	\newcommand{\BA}{\mathbb{A}}
	\newcommand{\BB}{\mathbb{B}}
	\newcommand{\BC}{\mathbb{C}}
	\newcommand{\BD}{\mathbb{D}}
	\newcommand{\BE}{\mathbb{E}}
	\newcommand{\BF}{\mathbb{F}}
	\newcommand{\BG}{\mathbb{G}}
	\newcommand{\BH}{\mathbb{H}}
	\newcommand{\BI}{\mathbb{I}}
	\newcommand{\BJ}{\mathbb{J}}
	\newcommand{\BK}{\mathbb{K}}
	\newcommand{\BL}{\mathbb{L}}
	\newcommand{\BM}{\mathbb{M}}
	\newcommand{\BN}{\mathbb{N}}
	\newcommand{\BO}{\mathbb{O}}
	\newcommand{\BP}{\mathbb{P}}
	\newcommand{\BQ}{\mathbb{Q}}
	\newcommand{\BR}{\mathbb{R}}
	\newcommand{\BS}{\mathbb{S}}
	\newcommand{\BT}{\mathbb{T}}
	\newcommand{\BU}{\mathbb{U}}
	\newcommand{\BV}{\mathbb{V}}
	\newcommand{\BW}{\mathbb{W}}
	\newcommand{\BX}{\mathbb{X}}
	\newcommand{\BY}{\mathbb{Y}}
	\newcommand{\BZ}{\mathbb{Z}}
	
	\newcommand{\bA}{\mathbf{A}}
	\newcommand{\cA}{\mathcal{A}}
	\newcommand{\fA}{\mathfrak{A}}
	\newcommand{\rA}{\mathrm{A}}
	\newcommand{\sA}{\mathscr{A}}
	\newcommand{\bB}{\mathbf{B}}
	\newcommand{\cB}{\mathcal{B}}
	\newcommand{\fB}{\mathfrak{B}}
	\newcommand{\rB}{\mathrm{B}}
	\newcommand{\sB}{\mathscr{B}}
	\newcommand{\bC}{\mathbf{C}}
	\newcommand{\cC}{\mathcal{C}}
	\newcommand{\fC}{\mathfrak{C}}
	\newcommand{\rC}{\mathrm{C}}
	\newcommand{\sC}{\mathscr{C}}
	\newcommand{\bD}{\mathbf{D}}
	\newcommand{\cD}{\mathcal{D}}
	\newcommand{\fD}{\mathfrak{D}}
	\newcommand{\rD}{\mathrm{D}}
	\newcommand{\sD}{\mathscr{D}}
	\newcommand{\bE}{\mathbf{E}}
	\newcommand{\cE}{\mathcal{E}}
	\newcommand{\fE}{\mathfrak{E}}
	\newcommand{\rE}{\mathrm{E}}
	\newcommand{\sE}{\mathscr{E}}
	\newcommand{\bF}{\mathbf{F}}
	\newcommand{\cF}{\mathcal{F}}
	\newcommand{\fF}{\mathfrak{F}}
	\newcommand{\rF}{\mathrm{F}}
	\newcommand{\sF}{\mathscr{F}}
	\newcommand{\bG}{\mathbf{G}}
	\newcommand{\cG}{\mathcal{G}}
	\newcommand{\fG}{\mathfrak{G}}
	\newcommand{\rG}{\mathrm{G}}
	\newcommand{\sG}{\mathscr{G}}
	\newcommand{\bH}{\mathbf{H}}
	\newcommand{\cH}{\mathcal{H}}
	\newcommand{\fH}{\mathfrak{H}}
	\newcommand{\rH}{\mathrm{H}}
	\newcommand{\sH}{\mathscr{H}}
	\newcommand{\bI}{\mathbf{I}}
	\newcommand{\cI}{\mathcal{I}}
	\newcommand{\fI}{\mathfrak{I}}
	\newcommand{\rI}{\mathrm{I}}
	\newcommand{\sI}{\mathscr{I}}
	\newcommand{\bJ}{\mathbf{J}}
	\newcommand{\cJ}{\mathcal{J}}
	\newcommand{\fJ}{\mathfrak{J}}
	\newcommand{\rJ}{\mathrm{J}}
	\newcommand{\sJ}{\mathscr{J}}
	\newcommand{\bK}{\mathbf{K}}
	\newcommand{\cK}{\mathcal{K}}
	\newcommand{\fK}{\mathfrak{K}}
	\newcommand{\rK}{\mathrm{K}}
	\newcommand{\sK}{\mathscr{K}}
	\newcommand{\bL}{\mathbf{L}}
	\newcommand{\cL}{\mathcal{L}}
	\newcommand{\fL}{\mathfrak{L}}
	\newcommand{\rL}{\mathrm{L}}
	\newcommand{\sL}{\mathscr{L}}
	\newcommand{\bM}{\mathbf{M}}
	\newcommand{\cM}{\mathcal{M}}
	\newcommand{\fM}{\mathfrak{M}}
	\newcommand{\rM}{\mathrm{M}}
	\newcommand{\sM}{\mathscr{M}}
	\newcommand{\bN}{\mathbf{N}}
	\newcommand{\cN}{\mathcal{N}}
	\newcommand{\fN}{\mathfrak{N}}
	\newcommand{\rN}{\mathrm{N}}
	\newcommand{\sN}{\mathscr{N}}
	\newcommand{\bO}{\mathbf{O}}
	\newcommand{\cO}{\mathcal{O}}
	\newcommand{\fO}{\mathfrak{O}}
	\newcommand{\rO}{\mathrm{O}}
	\newcommand{\sO}{\mathscr{O}}
	\newcommand{\bP}{\mathbf{P}}
	\newcommand{\cP}{\mathcal{P}}
	\newcommand{\fP}{\mathfrak{P}}
	\newcommand{\rP}{\mathrm{P}}
	\newcommand{\sP}{\mathscr{P}}
	\newcommand{\bQ}{\mathbf{Q}}
	\newcommand{\cQ}{\mathcal{Q}}
	\newcommand{\fQ}{\mathfrak{Q}}
	\newcommand{\rQ}{\mathrm{Q}}
	\newcommand{\sQ}{\mathscr{Q}}
	\newcommand{\bR}{\mathbf{R}}
	\newcommand{\cR}{\mathcal{R}}
	\newcommand{\fR}{\mathfrak{R}}
	\newcommand{\rR}{\mathrm{R}}
	\newcommand{\sR}{\mathscr{R}}
	\newcommand{\bS}{\mathbf{S}}
	\newcommand{\cS}{\mathcal{S}}
	\newcommand{\fS}{\mathfrak{S}}
	\newcommand{\rS}{\mathrm{S}}
	\newcommand{\sS}{\mathscr{S}}
	\newcommand{\bT}{\mathbf{T}}
	\newcommand{\cT}{\mathcal{T}}
	\newcommand{\fT}{\mathfrak{T}}
	\newcommand{\rT}{\mathrm{T}}
	\newcommand{\sT}{\mathscr{T}}
	\newcommand{\bU}{\mathbf{U}}
	\newcommand{\cU}{\mathcal{U}}
	\newcommand{\fU}{\mathfrak{U}}
	\newcommand{\rU}{\mathrm{U}}
	\newcommand{\sU}{\mathscr{U}}
	\newcommand{\bV}{\mathbf{V}}
	\newcommand{\cV}{\mathcal{V}}
	\newcommand{\fV}{\mathfrak{V}}
	\newcommand{\rV}{\mathrm{V}}
	\newcommand{\sV}{\mathscr{V}}
	\newcommand{\bW}{\mathbf{W}}
	\newcommand{\cW}{\mathcal{W}}
	\newcommand{\fW}{\mathfrak{W}}
	\newcommand{\rW}{\mathrm{W}}
	\newcommand{\sW}{\mathscr{W}}
	\newcommand{\bX}{\mathbf{X}}
	\newcommand{\cX}{\mathcal{X}}
	\newcommand{\fX}{\mathfrak{X}}
	\newcommand{\rX}{\mathrm{X}}
	\newcommand{\sX}{\mathscr{X}}
	\newcommand{\bY}{\mathbf{Y}}
	\newcommand{\cY}{\mathcal{Y}}
	\newcommand{\fY}{\mathfrak{Y}}
	\newcommand{\rY}{\mathrm{Y}}
	\newcommand{\sY}{\mathscr{Y}}
	\newcommand{\bZ}{\mathbf{Z}}
	\newcommand{\cZ}{\mathcal{Z}}
	\newcommand{\fZ}{\mathfrak{Z}}
	\newcommand{\rZ}{\mathrm{Z}}
	\newcommand{\sZ}{\mathscr{Z}}
	
	\newcommand{\ba}{\mathbf{a}}
	\newcommand{\fa}{\mathfrak{a}}
	\newcommand{\ra}{\mathrm{a}}
	\newcommand{\bb}{\mathbf{b}}
	\newcommand{\fb}{\mathfrak{b}}
	\newcommand{\rb}{\mathrm{b}}
	\newcommand{\bc}{\mathbf{c}}
	\newcommand{\fc}{\mathfrak{c}}
	\newcommand{\rc}{\mathrm{c}}
	\newcommand{\bd}{\mathbf{d}}
	\newcommand{\fd}{\mathfrak{d}}
	\newcommand{\rd}{\mathrm{d}}
	\newcommand{\be}{\mathbf{e}}
	\newcommand{\fe}{\mathfrak{e}}
	\newcommand{\re}{\mathrm{e}}
	%\renewcommand{\bf}{\mathbf{f}}
	\newcommand{\ff}{\mathfrak{f}}
	\newcommand{\rf}{\mathrm{f}}
	\newcommand{\bg}{\mathbf{g}}
	\newcommand{\fg}{\mathfrak{g}}
	\newcommand{\rg}{\mathrm{g}}
	\newcommand{\bh}{\mathbf{h}}
	\newcommand{\fh}{\mathfrak{h}}
	\newcommand{\rh}{\mathrm{h}}
	\newcommand{\bi}{\mathbf{i}}
	%\renewcommand{\fi}{\mathfrak{i}}
	\newcommand{\ri}{\mathrm{i}}
	\newcommand{\bj}{\mathbf{j}}
	\newcommand{\fj}{\mathfrak{j}}
	\newcommand{\rj}{\mathrm{j}}
	\newcommand{\bk}{\mathbf{k}}
	\newcommand{\fk}{\mathfrak{k}}
	\newcommand{\rk}{\mathrm{k}}
	\newcommand{\bl}{\mathbf{l}}
	\newcommand{\fl}{\mathfrak{l}}
	\newcommand{\rl}{\mathrm{l}}
	\newcommand{\bm}{\mathbf{m}}
	\newcommand{\fm}{\mathfrak{m}}
	%\renewcommand{\rm}{\mathrm{m}}
	\newcommand{\bn}{\mathbf{n}}
	\newcommand{\fn}{\mathfrak{n}}
	\newcommand{\rn}{\mathrm{n}}
	\newcommand{\bo}{\mathbf{o}}
	\newcommand{\fo}{\mathfrak{o}}
	\newcommand{\ro}{\mathrm{o}}
	\newcommand{\bp}{\mathbf{p}}
	\newcommand{\fp}{\mathfrak{p}}
	\newcommand{\rp}{\mathrm{p}}
	\newcommand{\bq}{\mathbf{q}}
	\newcommand{\fq}{\mathfrak{q}}
	%\renewcommand{\rq}{\mathrm{q}}
	\newcommand{\br}{\mathbf{r}}
	\newcommand{\fr}{\mathfrak{r}}
	\newcommand{\rr}{\mathrm{r}}
	\newcommand{\bs}{\mathbf{s}}
	\newcommand{\fs}{\mathfrak{s}}
	\newcommand{\rs}{\mathrm{s}}
	\newcommand{\bt}{\mathbf{t}}
	\newcommand{\ft}{\mathfrak{t}}
	\newcommand{\rt}{\mathrm{t}}
	\newcommand{\bu}{\mathbf{u}}
	\newcommand{\fu}{\mathfrak{u}}
	\newcommand{\ru}{\mathrm{u}}
	\newcommand{\bv}{\mathbf{v}}
	\newcommand{\fv}{\mathfrak{v}}
	\newcommand{\rv}{\mathrm{v}}
	\newcommand{\bw}{\mathbf{w}}
	\newcommand{\fw}{\mathfrak{w}}
	\newcommand{\rw}{\mathrm{w}}
	\newcommand{\bx}{\mathbf{x}}
	\newcommand{\fx}{\mathfrak{x}}
	\newcommand{\rx}{\mathrm{x}}
	\newcommand{\by}{\mathbf{y}}
	\newcommand{\fy}{\mathfrak{y}}
	\newcommand{\ry}{\mathrm{y}}
	\newcommand{\bz}{\mathbf{z}}
	\newcommand{\fz}{\mathfrak{z}}
	\newcommand{\rz}{\mathrm{z}}
	
	% - Lie theory ----------------------------
	% -- Lie groups
	\newcommand{\GL}{\mathbf{GL}}
	\newcommand{\PGL}{\mathbf{PGL}}
	\newcommand{\SL}{\mathbf{SL}}
	\newcommand{\PSL}{\mathbf{PSL}}
	\newcommand{\Sp}{\mathbf{Sp}}
	\newcommand{\SO}{\mathbf{SO}}
	\newcommand{\PSO}{\mathbf{PSO}}
	\newcommand{\SU}{\mathbf{SU}}
	\newcommand{\Gr}{\mathbf{Gr}}
	\newcommand{\IGr}{\mathbf{IGr}}
	\newcommand{\OGr}{\mathbf{OGr}}
	\newcommand{\spin}{\mathbf{spin}}
	\newcommand{\Spin}{\mathbf{Spin}}
	
	% -- Lie algebras
	\newcommand{\fsl}{\mathfrak{sl}}
	\newcommand{\fgl}{\mathfrak{gl}}
	\newcommand{\fso}{\mathfrak{so}}
	\newcommand{\fsu}{\mathfrak{su}}
	\newcommand{\fsp}{\mathfrak{sp}}
	\newcommand{\fpe}{\mathfrak{pe}}
	\newcommand{\fosp}{\mathfrak{osp}}
}{}
%----------------------------------------------------


