\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{mathtools}
% \mathtoolsset{showonlyrefs}
\mathtoolsset{showmanualtags}
\usepackage{amsthm}
\usepackage{xcolor}
\usepackage{tabularx}
\usepackage{bbm}
\usepackage{todonotes}
\usepackage{amsmath}
\usepackage{makecell}
\usepackage{subcaption}
\usepackage{tablefootnote}
\usepackage{amsfonts}

\usepackage{xspace}

% \usepackage{algorithm}
% \usepackage{algorithmic}
%\usepackage[noend]{algpseudocode}
\usepackage{verbatim}

\usepackage{nicefrac} % graphicx

% \graphicspath{{code/plot/}} 

% \usepackage[pagebackref=true]{hyperref}
% \renewcommand*{\backrefalt}[4]{%
%     \ifcase #1 \footnotesize{(Not cited.)}%
%     \or        \footnotesize{(Cited on page~#2)}%
%     \else      \footnotesize{(Cited on pages~#2)}%
%     \fi}

% \newcommand{\squeeze}{\textstyle} % when deployed
% \newcommand{\squeeze}{}  % when not in use

% \DeclarePairedDelimiter\ceil{\lceil}{\rceil}
% \DeclarePairedDelimiter\floor{\lfloor}{\rfloor}

\newcommand{\egor}[1]{\todo[inline]{\footnotesize Egor: #1}}
\newcommand{\peter}[1]{\todo[inline]{\footnotesize Peter: #1}}
\newcommand{\as}[1]{{\color{green} #1}}
\newcommand{\asnote}[1]{\todo[color=green!]{#1}}

\newcommand{\TODO}[1]{{\color{green}\todo[inline]{TODO: #1}}}

\allowdisplaybreaks[1]

% \newcommand{\libname}[1]{{\sf \color{libcolor} \small #1}\xspace}
% \newcommand{\algname}[1]{{\sf\color{blue}#1}\xspace}%{{\sf \color{blue} #1}\xspace}
\newcommand{\algname}[1]{{\sf#1}\xspace}

\newcommand{\cmark}{{\color{teal}\ding{51}}}
\newcommand{\xmark}{{\color{red}\ding{55}}}

\newcommand{\Be}{\mathcal{B}\textit{e}}

\newcommand{\CGD}{\algname{CGD}}
\newcommand{\DCGD}{\algname{DCGD}}
\newcommand{\DIANA}{\algname{DIANA}}
\newcommand{\RDIANA}{\algname{Rand-DIANA}}
\newcommand{\DIANAA}{\algname{DIANA-2}}
\newcommand{\GDCI}{\algname{GDCI}}

\newtheorem{definition}{Definition}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\newtheorem{corollary}{Corollary}
\newtheorem{remark}{Remark}
\newtheorem{assumption}{Assumption}

\newcommand{\AG}{\mathrm{AG}}

\newcommand{\prox}{\mathrm{prox}}
\newcommand{\range}{\mathrm{range}}
\newcommand{\Comp}{\mathrm{Comp}}
\newcommand{\Comm}{\mathrm{Comm}}
\newcommand{\Span}{\mathrm{Span}}
\newcommand{\Sp}{\mathrm{Sp}}

\DeclareMathOperator{\E}{\mathbf{E}}
\newcommand{\Exp}[1]{{\mathbf E}\left[#1\right]}
\DeclareMathOperator{\Var}{{\bf Var}}

\newcommand{\bg}{\mathrm{D}}

\newcommand{\Rd}{\mathbb{R}^d}

\newcommand{\eps}{\varepsilon}

\def\<#1,#2>{\langle #1,#2\rangle}

\newcommand{\Dotprod}[1]{\left\langle#1\right\rangle}


\newcommand{\norm}[1]{\|#1\|}
\newcommand{\sqn}[1]{\norm{#1}^2}
\newcommand{\Norm}[1]{\left\|#1\right\|}
\newcommand{\sqN}[1]{\Norm{#1}^2}
\newcommand{\vect}[1]{\begin{bmatrix*}[l]#1\end{bmatrix*}}
\newcommand{\ecn}[1]{\Exp{\sqn{#1}}}
\newcommand\br[1]{\left ( #1 \right )}
\newcommand\sbr[1]{\left[#1\right]}


\newcommand{\cR}{\mathcal{R}}
\newcommand{\cG}{\mathcal{G}}
\newcommand{\cV}{\mathcal{V}}
\newcommand{\cE}{\mathcal{E}}
\newcommand{\cL}{\mathcal{L}}
\newcommand{\cC}{\mathcal{C}}
\newcommand{\cQ}{\mathcal{Q}}
\newcommand{\cZ}{\mathcal{Z}}
\newcommand{\cY}{\mathcal{Y}}
\newcommand{\cX}{\mathcal{X}}
\newcommand{\sX}{{\mathsf E}}
\newcommand{\cO}{\mathcal{O}}
\newcommand{\cT}{\mathcal{T}}
\newcommand{\Lag}{\mathcal{L}}
\newcommand{\mA}{\mathbf{A}}
\newcommand{\mW}{\mathbf{W}}
\newcommand{\mL}{\mathbf{L}}
\newcommand{\mI}{\mathbf{I}}
\newcommand{\mP}{\mathbf{P}}
\newcommand{\mM}{\mathbf{M}}
\newcommand{\mWp}{\mathbf{W}^{\dagger}}

\newcommand{\bR}{\mathbb{R}}
\newcommand{\bN}{\mathbb{N}}
\newcommand{\bB}{\mathbb{B}}
\newcommand{\bU}{\mathbb{U}}
\newcommand{\bC}{\mathbb{C}}

\newcommand{\sqnw}[1]{\sqn{#1}_{\mWp}}
\newcommand{\eqdef}{\coloneqq}
\DeclareMathOperator*{\argmin}{arg\,min}
