\usepackage{hyperref,aliascnt}
%\makeatletter
%\thm@headfont{\bfseries\scshape}
%\makeatother
\usepackage{latexsym,euscript}
\usepackage{amsbsy,amscd,amsfonts,amsmath,amsopn,amssymb,amstext,amsthm,amsxtra,enumitem,bbm}

\usepackage{epsf,epsfig,graphics, color}
\usepackage{ float, xargs, pdfsync}
%\usepackage[latin1]{inputenc}
\usepackage{appendix}


\providecommand*{\definitionautorefname}{Definition}
\providecommand*{\lemmaautorefname}{Lemma}
\providecommand*{\exampleautorefname}{Example}
\providecommand*{\propositionautorefname}{Proposition}
\providecommand*{\exerciseautorefname}{Exercise}
\providecommand*{\corollaryautorefname}{Corollary}
\providecommand*{\chapterautorefname}{Chapter}
\providecommand*{\partautorefname}{Part}
\providecommand*{\remarkautorefname}{Remark}
\providecommand*{\algorithmautorefname}{Algorithm}



\def\chapterautorefname{Chapter}
\def\sectionautorefname{Section}
\def\subsectionautorefname{Section}
\def\appendixautorefname{Appendix}


%%%%%%%%French
%\providecommand*{\thmfrautorefname}{Th\'eor\`eme}
%\providecommand*{\deffrautorefname}{D\'efinition}
%\providecommand*{\lemfrautorefname}{Lemme}
%\providecommand*{\exempfrautorefname}{Exemple}
%%\providecommand*{\propositionautorefname}{Proposition}
%%\providecommand*{\exerciseautorefname}{Exercise}
%\providecommand*{\corofrautorefname}{Corollaire}
%%\providecommand*{\chapterautorefname}{Chapter}
%%\providecommand*{\partautorefname}{Part}
%\providecommand*{\remfrautorefname}{Remarque}
%%\providecommand*{\algorithmautorefname}{Algorithm}


\usepackage{fancybox,ifthen,twoopt}
%\pagestyle{plain}
%\usepackage[notref,notcite]{showkeys}  %  comment out for final version
%\renewcommand*\showkeyslabelformat[1]{\fbox{\normalfont\scriptsize\sffamily#1}}   % for showkeys
%\usepackage{showidx}                   % use to check the index - comment out for final version  %%%%%%%%%

\newcommand{\fr}[1]{\todo[color=green!20]{{\bf FR:} #1}}
\newcommand{\rd}[1]{\todo[color=blue!20]{{\bf RD:} #1}}
\newcommand{\mo}[1]{\todo[color=yellow!20]{{\bf Mony:} #1}}


\newtheorem{theorem}{Theorem}
%\numberwithin{theorem}{section}   %added for thesis


\newaliascnt{proposition}{theorem}
\newtheorem{proposition}[proposition]{Proposition}
\aliascntresetthe{proposition}

\newaliascnt{lemma}{theorem}
\newtheorem{lemma}[lemma]{Lemma}
\aliascntresetthe{lemma}

\newaliascnt{corollary}{theorem}
\newtheorem{corollary}[corollary]{Corollary}
\aliascntresetthe{corollary}

%%%%French
%\newaliascnt{thmfr}{theorem}
%\newtheorem{thmfr}[thmfr]{Th\'{e}or\`eme}
%\aliascntresetthe{thmfr}
%
%\newaliascnt{lemfr}{theorem}
%\newtheorem{lemfr}[lemfr]{Lemme}
%\aliascntresetthe{lemfr}
%
%\newaliascnt{corofr}{theorem}
%\newtheorem{corofr}[corollary]{Corollaire}
%\aliascntresetthe{corofr}



%\newcounter{exa}
%\setcounter{exa}{1}
%\newaliascnt{example}{theorem}
%\newenvironment{example}[1][]{\medskip \noindent \begin{sf}\textbf{Example
%\arabic{exa}.} \stepcounter{exa} }{\end{sf}}
\theoremstyle{definition}
%\newaliascnt{example}{theorem}
\newtheorem{example}{Example}
%\newtheorem{exempfr}[example]{Exemple}
%\aliascntresetthe{example}

%\newaliascnt{remark}{theorem}
\newtheorem{remark}{Remark}
%\newtheorem{remfr}[remark]{Remarque}
%\aliascntresetthe{remark}


\newaliascnt{definition}{theorem}
\newtheorem{definition}[definition]{Definition}
\aliascntresetthe{definition}


%%%%French
%\newaliascnt{deffr}{theorem}
%\newtheorem{deffr}[deffr]{D\'{e}finition}
%\aliascntresetthe{deffr}



\newcounter{hypA}
\newcounter{hypA'}
\newcounter{hypB}
\newcounter{hypC}
\newcounter{hypD}
\newcounter{hypE}

\newcounter{hypI}

\newenvironment{hyp}[1]{%\begin{sf}\refstepcounter{hyp#1}
\begin{enumerate}[label=(\textbf{\sf #1}-\arabic*),resume=hyp#1]\begin{sf}}
{\end{sf}\end{enumerate}}%\end{sf}}

\newenvironment{resumhyp}[1]{%\begin{sf}\refstepcounter{resumhyp#1}
\begin{enumerate}[label=(\textbf{\sf #1}-\arabic*),resume=resumhyp#1]\begin{sf}}
{\end{sf}\end{enumerate}}%\end{sf}}


%\newenvironment{hyp}[1]{%\begin{sf}\refstepcounter{hyp#1}
%\begin{enumerate}[label=(\textbf{\sf #1}-\arabic*)]
% \addtocounter{enumi}{1}\begin{sf}}
%{\end{sf}\end{enumerate}}%\end{sf}}


%
%
%\newenvironment{nhyp}[1]{
%\begin{enumerate}[label=(\textbf{#1}-\arabic*),series=nhyp#1]}
%{\end{enumerate}}


%\newenvironment{hypName}[1]{\begin{sf}\begin{itemize}
%  \item[$\mathbf{(\tilde A#1)}$]}{\end{itemize}\end{sf}}
%
%\newenvironment{hyp*}[1]{\begin{sf}\refstepcounter{hyp#1}\begin{itemize}
%  \item[({\bf #1\arabic{hyp#1}})]}{\end{itemize}\end{sf}}
%
%\newcommand{\refhyp}[2][A]{$\mathbf{(#1\ref{#2})}$}
%\newcommand{\refhyps}[3][A]{$\mathbf{(#1\ref{#2}\-\ref{#3})}$}
%\newcommand{\refhypName}[1]{$\mathbf{(\tilde A#1)}$}
\renewcommand{\-}{\mbox{-}}
\newenvironment{subproof}[1]
{\textbf{\em #1}.}{\hfill $\blacktriangleleft$ \newline \indent}



\overfullrule=4pt
\frenchspacing
%--------------------------------------------------------
%------------------------------------------------------
\def\rme{\mathrm{e}}
\def\Cset{\mathsf{C}}
\def\Kset{\mathsf{K}}
\def\Xset{\mathsf{X}}
\def\Yset{\mathsf{Y}}
\def\Eset{\mathsf{E}}
\def\Zset{\mathsf{Z}}
\def\Tset{\mathsf{T}}
%\def\Uset{\mathsf{U}}

\def\Xsigma{\mathcal{X}}
\def\Ysigma{\mathcal{Y}}
\def\Zsigma{\mathcal{Z}}
\def\Esigma{\mathcal{E}}
\def\Tsigma{\mathcal{T}}
%\def\Usigma{\mathcal{U}}

\def\met{\Delta}
%%% definitions of sets
\def\rset{\ensuremath{\mathbb{R}}}
\def\nset{\ensuremath{\mathbb{N}}}
\def\zset{\ensuremath{\mathbb{Z}}}
\def\cset{\ensuremath{\mathbb{C}}}
\def\lipshitz{\mathrm{Lip}}


\def\mcf{\mathcal{F}}
\def\mcm{\mathcal{M}}
\def\mcp{\mathcal{P}}
\def\mcn{\mathcal{N}}

\def\Cov{\mathrm{Cov}}
\def\eqsp{}	%\def\eqsp{\;}
\def\PE{\mathbb{E}}
\def\PEv{\mathbb{E}_\star}
\def\PP{\mathbb{P}}
\def\PPv{\mathbb{P}_\star}
\def\rmd{\mathrm{d}}
\newcommandx\LogInt[5][1=\theta,4=,5=Y]{\upsilon_{#4}^{#1}\langle {#5}_{#2:#3} \rangle}
\newcommand{\ball}[2]{\mathsf{B}(#1, #2)}
%%%
\newcommand{\etal}{et al.}
\newcommand{\wrt}{with respect to}
\newcommand{\rhs}{right-hand side}
\newcommand{\lhs}{left-hand side}
\newcommand{\iid}{i.i.d.}
\newcommand{\as}{\mbox{-a.s.}}
\newcommand{\mae}{\mbox{-a.e.}}
\newcommand{\ie}{i.e.}
\newcommand{\eg}{e.g.}
\newcommand{\cf}{cf.}
%%%%
\newcommand{\eqd}{\ensuremath{\stackrel{\mathrm{d}}{=}}}
\newcommand{\dlim}{\ensuremath{\stackrel{\mathcal{D}}{\longrightarrow}}}
\newcommand{\plim}{\ensuremath{\stackrel{\mathrm{P}}{\longrightarrow}}}
\newcommandx{\aslim}[1]{\ensuremath{\stackrel{#1-\text{a.s.}}{\longrightarrow}}}
\newcommand{\mcb}[1]{\ensuremath{\mathcal{F}_{\mathrm{b}}\left(#1\right)}}

\newcommandx\sequence[3][2=n,3=\zset]{\ensuremath{\{ #1_{#2}\,:\, #2 \in #3\}}}
\newcommand\nsequence[2]{\ensuremath{\{ #1\,:\, #2\}}}
\newcommandx\dsequence[4][3=n,4=\zset]{\ensuremath{\{ (#1_{#3},#2_{#3})\,:\,#3 \in #4\}}}



\newcommand{\CPE}[3][]
{\ifthenelse{\equal{#1}{}}%
{\mathbb{E}\left[\left. #2 \, \right| #3 \right]}
{\mathbb{E}_{#1}\left[\left. #2 \, \right| #3 \right]}
}
\newcommand{\CPEu}[4][]
{\ifthenelse{\equal{#1}{}}%
{\mathbb{E}\left[\left. #2 \, \right| #3 \right]}
{\mathbb{E}^{#1}_{#2}\left[\left. #3 \, \right| #4 \right]}
}


\newcommand{\CPEv}[3][]
{\ifthenelse{\equal{#1}{}}%
{\mathbb{E}_\star\left[\left. #2 \, \right| #3 \right]}
{\mathbb{E}_\star_{#1}\left[\left. #2 \, \right| #3 \right]}
}

\newcommand{\CPP}[3][]
{\ifthenelse{\equal{#1}{}}%
{\mathbb{P}\left[\left. #2 \, \right| #3 \right]}
{\mathbb{P}_{#1}\left[\left. #2 \, \right| #3 \right]}
}

\newcommand{\CPPu}[3][]
{\ifthenelse{\equal{#1}{}}%
{\mathbb{P}\left[\left. #2 \, \right| #3 \right]}
{\mathbb{P}^{#1}\left[\left. #2 \, \right| #3 \right]}
}


\newcommandx{\chunk}[3]%
{\ensuremath{#1}_{#2:#3}}

\newcommand{\coint}[1]{\left[#1\right[}
\newcommand{\ocint}[1]{\left]#1\right]}
\newcommand{\ooint}[1]{\left]#1\right[}
\newcommand{\ccint}[1]{\left[#1\right]}
\def\1{\mathbbm{1}}




%\newcommand{\Xsigma}{\mathcal{X}}
\newcommandx\proj[2][1=,2=]{
\ifthenelse{\equal{#1}{}}
{\operatorname{X}}
{\operatorname{X}_{#1:#2}}i
}

\newcommand{\eqdef}{:=}
\newcommand{\set}[2]{\left\{#1\, : \, #2\right\}}
\newcommand{\ensemble}[1]{\mathsf{#1}}

\newcommand{\field}[1]{{\mathcal{#1}}}
\newcommand{\shift}{\ensuremath{\operatorname{S}}}

\newcommandx\lkdM[3][1=,3=]{
\ifthenelse{\equal{#2}{}}
{ \mathsf{L}_{#1}^{#3}}
{ \mathsf{L}_{#1}^{#3}\langle #2\rangle}
}
\newcommandx\lkdMStat[3][1=,3=]{
\ifthenelse{\equal{#2}{}}
{ \bar{\mathsf{L}}_{#1}^{#3}}
{ \bar{\mathsf{L}}_{#1}^{#3}\langle #2 \rangle}
}



\newcommandx\lkd[3][1=,3=]{
\ifthenelse{\equal{#2}{}}
{ \ell_{#1}^{#3}}
{ \ell_{#1}^{#3}\langle #2\rangle}
}
\newcommandx\lkdStat[3][1=,3=]{
\ifthenelse{\equal{#2}{}}
{ \bar \ell_{#1}^{#3}}
{ \bar \ell_{#1}^{#3}\langle #2 \rangle}
}



\newcommand{\mlStat}[1]{\bar \theta_{#1}}
\newcommand{\ml}[1]{\theta_{#1}}
\newcommand{\mlY}[1]{\hat\theta_{#1}}
\newcommand{\argmax}{\mathop{\mathrm{argmax}}}
%\newcommand{\existLim}[1]{\underset{#1}{\rightsquigarrow}}
\newcommand{\existLim}[1]{\to_{#1}}
\newcommand{\mlL}[1]{\hat \theta_{#1}^{L}}

\newcommandx{\normLip}[2][1=]{\mathrm{Lip}(#2;#1)}
\newcommandx{\wass}[2][1]{\lVert #2\rVert_{#1}}

\newcommand{\marginal}[2]{\mathcal{M}\left(#1,#2\right)}
\newcommandx{\wasser}[3][1=]{\mathcal{W}_{#1}\left(#2,#3\right)}
\newcommandx{\proho}[3][1=]{\mathcal{P}_{#1}\left(#2,#3\right)}

\newcommandx{\dobru}[2][1=]{\dobrush_{#1}\left( #2\right)}
\newcommand{\dobrush}{\Delta}
\newcommand{\distmeasureset}[2]{\mathbb{S}(#1,#2)}
\newcommand{\Uset}{\mathrm U}
\newcommand{\Usigma}{\mathcal U}
\newcommand{\dist}{\Upsilon}
\newcommandx{\Pcan}[2][1=,2=]{\mathbb{P}_{#1}^{#2}}
\newcommandx{\Ecan}[2][1=,2=]{\mathbb{E}_{#1}^{#2}}
\newcommand{\Xinit}{\xi}
\newcommand{\Xinitp}{\chi}
\newcommand{\lone}{\mathrm{L}_1}
\newcommandx\cesp[4][1=,2=]{\ensuremath{{\mathbb E}_{#1}^{#2}\left[ \left. #3 \right| #4 \right]}}

\newcommandx{\f}[2][1=\theta]{\psi^{#1}\langle #2 \rangle}
\newcommandx{\F}[2][1=\theta]{\Psi^{#1}\langle #2 \rangle}
\newcommand{\thv}{{\theta_\star}}
\newcommandx{\kap}[3][1=\theta]{
\ifthenelse{\equal{#3}{}}
{\kappa^{#1}\langle #2\rangle }
{\kappa^{#1}\langle #2\rangle (#3)}
}

\def\lnp{\ln^{+}}

\def\zsetp{\zset_{+}}
\def\zsetn{\zset_{-}}
\def\zsetpnz{\zset_{+}^*}
\def\zsetnnz{\zset_{-}^*}

\def\rsetp{\rset_{+}}
\def\rsetn{\rset_{-}}
\def\rsetnz{\rset^*}
\def\rsetpnz{\rset_{+}^*}
\def\rsetnnz{\rset_{-}^*}

\newcommandx{\probdoeblin}[3][1=]{\mu^{#1}_{#2}\langle #3 \rangle}
\newcommand{\Pblock}[2][]
{\ifthenelse{\equal{#1}{}}{\boldsymbol{\operatorname{L}}\langle#2\rangle}{\boldsymbol{\operatorname{L}}^{#1}\langle#2\rangle}
}

\newcommand{\ConPblock}[3][]
{\ifthenelse{\equal{#1}{}}{\boldsymbol{\operatorname{L}}\langle#2|#3\rangle}{\boldsymbol{\operatorname{L}}^{#1}\langle#2|#3\rangle}
}

\newcommand{\pblock}[2][]
{\ifthenelse{\equal{#1}{}}{\mathbf{\ell}\langle#2\rangle}{\mathbf{\ell}^{#1}\langle #2\rangle}
}

\newcommand{\mdr}{\mathcal{M}(\set{D},r)}
\newcommand{\Sset}{\mathsf{S}}
\newcommand{\Ssigma}{\mathcal{S}}
\newcommand{\Wset}{\mathsf{W}}
\newcommand{\Wsigma}{\mathcal{W}}

\def\simplex{\mathsf{P}}

\newcommandx{\limlike}[4][1=\theta, 2=\theta_\star]{p^{#1,#2}\left( #3 | #4 \right)}
\newcommand{\PEY}{\tilde{\mathbb{E}}^{\theta_\star}}
\newcommand{\PPY}{\tilde{\mathbb{P}}^{\theta_\star}}
\def\PrBlock{\mathbb{P}_Z}
\def\ExBlock{\mathbb{E}_Z}


\def\radius{|\lambda|_{\max}}

\newcommand{\diag}{\mathop{\mathrm{diag}}\nolimits}
\def\Xmet{\rmd_\Xset}
\def\Ymet{\rmd_\Yset}
\def\Zmet{\rmd_\Zset}
\def\Tmet{\rmd_\Tset}
\def\Umet{\rmd_\Uset}
\newcommand{\Proj}[2]{\Pi_{#1}(#2)}
%\newcommand{\Proj}[2]{\Pi_{#1}\left(#2\right)}

\def\fun{f}   %\def\fun{\mathbbm{1}_\mathsf{X}}

