\usepackage{amsmath,amsbsy,amsfonts,amssymb,amsthm,color,dsfont,mleftright}
\usepackage{fullpage}
\usepackage{algorithm,algorithmic}

\usepackage{hyperref}


\def\ddefloop#1{\ifx\ddefloop#1\else\ddef{#1}\expandafter\ddefloop\fi}

% \bfA, \bfB, ...
\def\ddef#1{\expandafter\def\csname bf#1\endcsname{\ensuremath{\mathbf{#1}}}}
\ddefloop ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ddefloop

% \bbA, \bbB, ...
\def\ddef#1{\expandafter\def\csname bb#1\endcsname{\ensuremath{\mathbb{#1}}}}
\ddefloop ABCDEFGHIJKLMNOPQRSTUVWXYZ\ddefloop

% \cA, \cB, ...
\def\ddef#1{\expandafter\def\csname c#1\endcsname{\ensuremath{\mathcal{#1}}}}
\ddefloop ABCDEFGHIJKLMNOPQRSTUVWXYZ\ddefloop

% \vA, \vB, ..., \va, \vb, ...
\def\ddef#1{\expandafter\def\csname v#1\endcsname{\ensuremath{\boldsymbol{#1}}}}
\ddefloop ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ddefloop

% \valpha, \vbeta, ...,  \vGamma, \vDelta, ...,
\def\ddef#1{\expandafter\def\csname v#1\endcsname{\ensuremath{\boldsymbol{\csname #1\endcsname}}}}
\ddefloop {alpha}{beta}{gamma}{delta}{epsilon}{varepsilon}{zeta}{eta}{theta}{vartheta}{iota}{kappa}{lambda}{mu}{nu}{xi}{pi}{varpi}{rho}{varrho}{sigma}{varsigma}{tau}{upsilon}{phi}{varphi}{chi}{psi}{omega}{Gamma}{Delta}{Theta}{Lambda}{Xi}{Pi}{Sigma}{varSigma}{Upsilon}{Phi}{Psi}{Omega}{ell}\ddefloop

\newcommand\Sig{\ensuremath{\varSigma}}
\newcommand\vSig{\ensuremath{\vvarSigma}}
\newcommand\veps{\ensuremath{\varepsilon}}
\newcommand\eps{\ensuremath{\epsilon}}

\renewcommand\t{{\ensuremath{\scriptscriptstyle{\top}}}}

\DeclareMathOperator{\tr}{tr}
\DeclareMathOperator{\diag}{diag}
\DeclareMathOperator{\Diag}{Diag}
\DeclareMathOperator{\rank}{rank}
\DeclareMathOperator{\sign}{sign}
\DeclareMathOperator{\supp}{supp}
\DeclareMathOperator{\vol}{vol}

\DeclareMathOperator{\var}{var}
\DeclareMathOperator{\cov}{cov}

\DeclareMathOperator{\Bd}{bd}
\DeclareMathOperator{\Cl}{cl}
\DeclareMathOperator{\Conv}{conv}
\DeclareMathOperator{\Dom}{dom}
\DeclareMathOperator{\Epi}{epi}
\DeclareMathOperator{\Int}{int}
\DeclareMathOperator{\Null}{ker}
\DeclareMathOperator{\Span}{span}
\DeclareMathOperator{\Range}{ran}

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

\newcommand\wt{\ensuremath{\widetilde}}
\newcommand\wh{\ensuremath{\widehat}}
\renewcommand\v{\ensuremath{\boldsymbol}}

\newcommand\comment[1]{{\color{blue}\{\emph{Comment}:} #1{\color{blue}\}}}

\newtheorem{lemma}{Lemma}
\newtheorem{claim}{Claim}
\newtheorem{proposition}{Proposition}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}{Corollary}
\theoremstyle{remark}
\newtheorem{remark}{Remark}
\theoremstyle{definition}
\newtheorem{definition}{Definition}
\newtheorem{condition}{Condition}
\newtheorem{example}{Example}
\newtheorem{problem}{Problem}

\newcommand\parens[1]{(#1)}
\newcommand\norm[1]{\|#1\|}
\newcommand\braces[1]{\{#1\}}
\newcommand\brackets[1]{[#1]}
\newcommand\ceil[1]{\lceil#1\rceil}
\newcommand\abs[1]{|#1|}
\newcommand\ind[1]{\ensuremath{\mathds{1}\{#1\}}}
\newcommand\dotp[1]{\langle #1 \rangle}

\newcommand\Parens[1]{\mleft(#1\mright)}
\newcommand\Norm[1]{\mleft\|#1\mright\|}
\newcommand\Braces[1]{\mleft\{#1\mright\}}
\newcommand\Brackets[1]{\mleft[#1\mright]}
\newcommand\Ceil[1]{\mleft\lceil#1\mright\rceil}
\newcommand\Abs[1]{\mleft|#1\mright|}
\newcommand\Ind[1]{\mathds{1}\mleft\{#1\mright\}}
\newcommand\Dotp[1]{\mleft\langle#1\mright\rangle}

