\usepackage{graphicx}
\usepackage{apptools}
\usepackage[flushleft]{threeparttable}
\usepackage{array,booktabs,makecell}
\usepackage{multirow}
\usepackage{nicefrac}
\usepackage{amsthm}
\usepackage{amsmath,amsfonts,bm,amssymb}
\usepackage{wrapfig}
\usepackage{caption}
% \usepackage{subcaption}
\usepackage{siunitx}
\usepackage{thm-restate}
\usepackage{nccmath}
\usepackage{empheq}
\usepackage{bbm}
\usepackage{tabularx}

\usepackage{algorithmic}
\usepackage{algorithm}
\usepackage{filecontents}

\usepackage[capitalize,noabbrev]{cleveref}

% COLORS
\usepackage{color}
\usepackage{colortbl}
\definecolor{bgcolor}{rgb}{0.76,0.88,0.50}
\definecolor{bgcolor0}{rgb}{0.93,0.99,1}
\definecolor{bgcolor1}{rgb}{0.8,1,1}
\definecolor{bgcolor2}{rgb}{0.8,1,0.8}
\definecolor{bgcolor3}{rgb}{0.50,0.90,0.50}
\usepackage{tcolorbox}
\usepackage{pifont}

\definecolor{mydarkgreen}{RGB}{39,130,67}
\definecolor{mydarkorange}{RGB}{236,147,14}
\definecolor{mydarkred}{RGB}{192,47,25}
\definecolor{ruby}{RGB}{155,17,30}
\definecolor{chili}{RGB}{191,0,0}
\definecolor{sangria}{RGB}{146,0,10}
\definecolor{burgundy}{RGB}{128,0,32} 
\definecolor{darkred}{RGB}{132,0,0} 
\definecolor{cherry}{RGB}{192,0,0} 

\definecolor{blue}{RGB}{0,0,255}
\newcommand{\green}{\color{mydarkgreen}}
\newcommand{\orange}{\color{mydarkorange}}
\newcommand{\blue}{\color{blue}}
\newcommand{\red}{\color{cherry}}

\newcommand{\markchanges}{}

\usepackage[textsize=tiny]{todonotes}
\newcommand{\arto}[1]{\todo[inline]{\textbf{Arto: }#1}}
\newcommand{\peter}[1]{\todo[inline]{\textbf{Peter: }#1}}
\newcommand{\omar}[1]{\todo[inline]{\textbf{Omar: }#1}}

\usepackage{xspace}
\newcommand{\algname}[1]{{\sf\footnotesize\red#1}\xspace}
\newcommand{\algnameS}[1]{{\sf\scriptsize\red#1}\xspace}
\newcommand{\dataname}[1]{{\tt\footnotesize\color{blue}#1}\xspace}


\newcommand{\ind}{\perp\!\!\!\!\perp}
\newcommand{\norm}[1]{\left\| #1 \right\|}
\newcommand{\sqnorm}[1]{\left\| #1 \right\|^2}
\newcommand{\lin}[1]{\left\langle #1\right\rangle} % inner product
\newcommand{\inp}[2]{\left\langle#1,#2\right\rangle} % inner product
\newcommand{\abs}[1]{\left| #1 \right|}

\newcommand{\R}{\mathbb{R}} % reals
\newcommand{\N}{\mathbb{N}} % reals
\newcommand{\E}[1]{\mathbb{E}\left[#1\right]}
\newcommand{\Med}[1]{\mathrm{Med}\left[#1\right]}
\newcommand{\Var}[1]{\mathrm{Var}\left(#1\right)}

\newcommand{\Exp}[1]{{\mathbb{E}}\left[#1\right]}
\newcommand{\ExpSub}[2]{{\mathbb{E}}_{#1}\left[#2\right]}
\newcommand{\ExpCond}[2]{{\mathbb{E}}\left[\left.#1\right\vert#2\right]}

\newcommand{\Prob}[1]{\mathbb{P}\left(#1\right)} % probability
\newcommand{\ProbCond}[2]{\mathbb{P}\left(#1\middle\vert#2\right)}

% caligraphic
\newcommand{\cA}{\mathcal{A}}
\newcommand{\cB}{\mathcal{B}}
\newcommand{\cC}{\mathcal{C}}
\newcommand{\cD}{\mathcal{D}}
\newcommand{\cF}{\mathcal{F}}
\newcommand{\cH}{\mathcal{H}}
\newcommand{\cL}{\mathcal{L}}
\newcommand{\cT}{\mathcal{T}}
\newcommand{\cO}{\mathcal{O}}
\newcommand{\cP}{\mathcal{P}}
\newcommand{\cQ}{\mathcal{Q}}
\newcommand{\cS}{\mathcal{S}}
\newcommand{\cW}{\mathcal{W}}
\newcommand{\cY}{\mathcal{Y}}
\newcommand{\cZ}{\mathcal{Z}}
\newcommand{\cJ}{\mathcal{J}}

% bold matrices
\newcommand{\mA}{\mathbf{A}}
\newcommand{\mX}{\mathbf{X}}
\newcommand{\mM}{\mathbf{M}}
\newcommand{\mN}{\mathbf{N}}
\newcommand{\mI}{\mathbf{I}}
\newcommand{\mJ}{\mathbf{J}}
\newcommand{\mL}{\mathbf{L}}
\newcommand{\mD}{\mathbf{D}}
\newcommand{\mO}{\mathbf{O}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% THEOREMS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{assumption}[theorem]{Assumption}
\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{example}[theorem]{Example}

\newcommand{\eqdef}{:=} 

\newcommand{\Mod}[1]{\ (\mathrm{mod}\ #1)}

\makeatletter
\newcommand{\vast}{\bBigg@{4}}

\DeclareMathOperator*{\argmin}{arg\,min}


\def\<{\left\langle}
\def\>{\right\rangle}
\def\[{\left[}
\def\]{\right]}
\def\({\left(}
\def\){\right)}



\usepackage{thmtools}
\usepackage{thm-restate}

\theoremstyle{theorem}
\newtheorem{innercustomthm}{Theorem}
\newenvironment{restate-theorem}[1]
{\renewcommand\theinnercustomthm{#1}\innercustomthm}
{\endinnercustomthm}

\newtheorem{innercustomlemma}{Lemma}
\newenvironment{restate-lemma}[1]
{\renewcommand\theinnercustomlemma{#1}\innercustomlemma}
{\endinnercustomlemma}

\newtheorem{innercustomproposition}{Proposition}
\newenvironment{restate-proposition}[1]
{\renewcommand\theinnercustomproposition{#1}\innercustomproposition}
{\endinnercustomproposition}

\newcommand*{\sketchproofname}{Sketch of Proof}
\newenvironment{sketchproof}[1][\sketchproofname]{
  \begin{proof}[#1] } {
  \end{proof}
}


\usepackage{longtable}
