\ProvidesPackage{jscommands}

\DeclareMathOperator{\GL}{\mathrm{GL}}
\renewcommand{\O}{\mathrm{O}}
\DeclareMathOperator{\R}{\mathbb{R}}
\DeclareMathOperator{\mt}{\longmapsto}
\newcommand{\Sy} {\mathcal{S}}
\newcommand{\D} {\mathcal{D}}
\DeclareMathOperator{\HO}{\mathcal{H}}
\newcommand{\linspan}[1]{\mathrm{span}\left\{#1\right\}}

\newcommand*\centermathcell[1]{\omit\hfil$\displaystyle#1$\hfil\ignorespaces}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{conjecture}[theorem]{Conjecture}
\theoremstyle{definition}
\newtheorem{xexample}[theorem]{Example}
\newtheorem{xremark}[theorem]{Remark}
\newtheorem{xdefinition}[theorem]{Definition}
\newenvironment{definition}
  {\pushQED{\qed}\renewcommand{\qedsymbol}{$\blacktriangle$}\xdefinition}
  {\popQED\endxdefinition}
\newenvironment{remark}
  {\pushQED{\qed}\renewcommand{\qedsymbol}{$\lozenge$}\xremark}
  {\popQED\endxexample}
\newenvironment{example}
  {\pushQED{\qed}\renewcommand{\qedsymbol}{$\blacklozenge$}\xexample}
  {\popQED\endxexample}
\renewcommand\qedsymbol{\hfill$\blacksquare$}
\DeclareMathOperator{\cuts}{\mathrm{cuts}}
\newcommand{\nimplies}{\ \;\not\!\!\!\!\implies}
\newcommand{\totimes}{\!\otimes\!}
\newcommand\todo[1]{\textcolor{red}{[\textit{#1}]}}
\newcommand\todonobrac[1]{\textcolor{red}{\textit{#1}}}
\newcommand\code[1]{\texttt{#1}}
\newcommand{\zed}{\mathbf{z}}

\newcommand\citepair[1]{\citeauthor{#1} \cite{#1}}

\newcommand{\lp}{(}
\newcommand{\rp}{)}
\newcommand{\lb}{[}
\newcommand{\rb}{]}
\newcommand{\lc}{\{}
\newcommand{\rc}{\}}
\DeclarePairedDelimiter\brac{\lb}{\rb}
\DeclarePairedDelimiter\paren{\lp}{\rp}
\DeclarePairedDelimiter\set{\lc}{\rc}
\DeclarePairedDelimiter\ceil{\lceil}{\rceil}
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}

% Better over-bars
\newcommand\ncoverline[1]{\mkern1mu\overline{\mkern-1mu#1\mkern-1mu}\mkern1mu}
\newcommand\ncol[1]{\mkern1mu\overline{\mkern-1mu#1\mkern-1mu}\mkern1mu}


% Wide hat 
\usepackage{scalerel,stackengine}
\stackMath
\newcommand\reallywidehat[1]{%
\savestack{\tmpbox}{\stretchto{%
  \scaleto{%
    \scalerel*[\widthof{\ensuremath{#1}}]{\kern-.6pt\bigwedge\kern-.6pt}%
    {\rule[-\textheight/2]{1ex}{\textheight}}%WIDTH-LIMITED BIG WEDGE
  }{\textheight}% 
}{0.5ex}}%
\stackon[1pt]{#1}{\tmpbox}%
}
%%%


% Less wasteful toc spacing
\usepackage{tocloft}
\setlength{\cftbeforesecskip}{0.001cm}
\setlength{\cftbeforesubsecskip}{0.001cm}

\usepackage{float}
\usepackage{caption}
\usepackage{enumerate}
\usepackage{setspace}
\onehalfspacing
\captionsetup{width=0.85\textwidth}

\usepackage{array}
\newcolumntype{P}[1]{>{\raggedright\arraybackslash}p{#1}}