%%%%% NEW MATH DEFINITIONS %%%%%
\usepackage{amsmath, amsthm,amssymb, amsfonts, xcolor, tikz, float, url, algorithm,algpseudocode, bm, bbm, mathtools}
\usepackage{thmtools}
\usepackage{algorithm}
\usepackage{algpseudocode}
%\usepackage{autonum}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{lipsum}
\usepackage{wrapfig}
\usepackage{xpatch}
%\usepackage{nomencl}
\usepackage{xspace}
\usepackage{bookmark}
\usepackage{hyperref}
\usepackage[capitalise]{cleveref}


\usepackage{xr}
\makeatletter

\newcommand*{\addFileDependency}[1]{% argument=file name and extension
\typeout{(#1)}% latexmk will find this if $recorder=0
% however, in that case, it will ignore #1 if it is a .aux or 
% .pdf file etc and it exists! If it doesn't exist, it will appear 
% in the list of dependents regardless)
%
% Write the following if you want it to appear in \listfiles 
% --- although not really necessary and latexmk doesn't use this
%
\@addtofilelist{#1}
%
% latexmk will find this message if #1 doesn't exist (yet)
\IfFileExists{#1}{}{\typeout{No file #1.}}
}\makeatother

\newcommand*{\myexternaldocument}[1]{%
\externaldocument{#1}%
\addFileDependency{#1.tex}%
\addFileDependency{#1.aux}%
}
\myexternaldocument{schur_138-supp}


\definecolor{hanblue}{rgb}{0.27, 0.42, 0.81}
\hypersetup{
hidelinks,
    colorlinks=true,
    linkcolor=hanblue,
    urlcolor=hanblue,
    citecolor=hanblue,
    anchorcolor=black}
\usetikzlibrary{decorations, calligraphy, positioning}
\usepackage{multirow}

\newcommand\norm[1]{\|#1 \|}


\newtheorem{theorem}{Theorem}[section]
\newtheorem{remark}[theorem]{Remark}
\newtheorem{assumption}[theorem]{Assumption}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}

\newtheorem{innercustomthm}{Theorem}
\newenvironment{mythm}[1]
  {\renewcommand\theinnercustomthm{#1}\innercustomthm}
  {\endinnercustomthm}
  
\DeclareMathOperator{\diag}{diag}
\DeclareMathOperator{\trace}{tr}
\DeclareMathOperator{\Lap}{Lap}
\DeclareMathOperator{\asvec}{vec}
\DeclareMathOperator{\asmatrix}{mat}

% colors
\definecolor{parnian}{rgb}{0.36, 0.54, 0.66}
\definecolor{oracle}{HTML}{4f7992}
\definecolor{naive}{HTML}{d33f49}
\definecolor{meta}{HTML}{419d78}
\definecolor{federated}{HTML}{f9a620}
\definecolor{grey}{rgb}{0.7, 0.75, 0.71}
\definecolor{optimalrate}{HTML}{69C498}%{rgb}{0.67, 0.88, 0.69}
\definecolor{notopt}{HTML}{d33f49}%{ff0a47}%{CD515F}


% Highlight a newly defined term
\newcommand{\newterm}[1]{{\bf #1}}


% Figure reference, lower-case.
\def\figref#1{figure~\ref{#1}}
% Figure reference, capital. For start of sentence
\def\Figref#1{Figure~\ref{#1}}
\def\twofigref#1#2{figures \ref{#1} and \ref{#2}}
\def\quadfigref#1#2#3#4{figures \ref{#1}, \ref{#2}, \ref{#3} and \ref{#4}}
% Section reference, lower-case.
\def\secref#1{section~\ref{#1}}
% Section reference, capital.
\def\Secref#1{Section~\ref{#1}}
% Reference to two sections.
\def\twosecrefs#1#2{sections \ref{#1} and \ref{#2}}
% Reference to three sections.
\def\secrefs#1#2#3{sections \ref{#1}, \ref{#2} and \ref{#3}}
% Reference to an equation, lower-case.
\def\eqref#1{equation~\ref{#1}}
% Reference to an equation, upper case
\def\Eqref#1{Equation~\ref{#1}}
% A raw reference to an equation---avoid using if possible
\def\plaineqref#1{\ref{#1}}
% Reference to a chapter, lower-case.
\def\chapref#1{chapter~\ref{#1}}
% Reference to an equation, upper case.
\def\Chapref#1{Chapter~\ref{#1}}
% Reference to a range of chapters
\def\rangechapref#1#2{chapters\ref{#1}--\ref{#2}}
% Reference to an algorithm, lower-case.
\def\algref#1{algorithm~\ref{#1}}
% Reference to an algorithm, upper case.
\def\Algref#1{Algorithm~\ref{#1}}
\def\twoalgref#1#2{algorithms \ref{#1} and \ref{#2}}
\def\Twoalgref#1#2{Algorithms \ref{#1} and \ref{#2}}
% Reference to a part, lower case
\def\partref#1{part~\ref{#1}}
% Reference to a part, upper case
\def\Partref#1{Part~\ref{#1}}
\def\twopartref#1#2{parts \ref{#1} and \ref{#2}}

\def\ceil#1{\lceil #1 \rceil}
\def\floor#1{\lfloor #1 \rfloor}
\def\1{\bm{1}}
\newcommand{\train}{\mathcal{D}}
\newcommand{\valid}{\mathcal{D_{\mathrm{valid}}}}
\newcommand{\test}{\mathcal{D_{\mathrm{test}}}}

\def\eps{{\epsilon}}




% Vectors
\def\bzero{{\bm{0}}}
\def\bone{{\bm{1}}}
\def\bmu{{\bm{\mu}}}
\def\btheta{{\bm{\theta}}}
\def\ba{{\bm{a}}}
\def\bb{{\bm{b}}}
\def\bc{{\bm{c}}}
\def\bd{{\bm{d}}}
\def\be{{\bm{e}}}
\def\bf{{\bm{f}}}
\def\bg{{\bm{g}}}
\def\bh{{\bm{h}}}
\def\bi{{\bm{i}}}
\def\bj{{\bm{j}}}
\def\bk{{\bm{k}}}
\def\bl{{\bm{l}}}
\def\bn{{\bm{n}}}
\def\bo{{\bm{o}}}
\def\bp{{\bm{p}}}
\def\bq{{\bm{q}}}
\def\br{{\bm{r}}}
\def\bs{{\bm{s}}}
\def\bt{{\bm{t}}}
\def\bu{{\bm{u}}}
\def\bv{{\bm{v}}}
\def\bw{{\bm{w}}}
\def\bx{{\bm{x}}}
\def\by{{\bm{y}}}
\def\bz{{\bm{z}}}




% Matrix
\def\mA{{\bm{A}}}
\def\mB{{\bm{B}}}
\def\mC{{\bm{C}}}
\def\mD{{\bm{D}}}
\def\mE{{\bm{E}}}
\def\mF{{\bm{F}}}
\def\mG{{\bm{G}}}
\def\mH{{\bm{H}}}
\def\mI{{\bm{I}}}
\def\mJ{{\bm{J}}}
\def\mK{{\bm{K}}}
\def\mL{{\bm{L}}}
\def\mM{{\bm{M}}}
\def\mN{{\bm{N}}}
\def\mO{{\bm{O}}}
\def\mP{{\bm{P}}}
\def\mQ{{\bm{Q}}}
\def\mR{{\bm{R}}}
\def\mS{{\bm{S}}}
\def\mT{{\bm{T}}}
\def\mU{{\bm{U}}}
\def\mV{{\bm{V}}}
\def\mW{{\bm{W}}}
\def\mX{{\bm{X}}}
\def\mY{{\bm{Y}}}
\def\mZ{{\bm{Z}}}
\def\mBeta{{\bm{\beta}}}
\def\mPhi{{\bm{\Phi}}}
\def\mLambda{{\bm{\Lambda}}}
\def\mSigma{{\bm{\Sigma}}}




% Graph
\def\calA{{\mathcal{A}}}
\def\calB{{\mathcal{B}}}
\def\calC{{\mathcal{C}}}
\def\calD{{\mathcal{D}}}
\def\calE{{\mathcal{E}}}
\def\calF{{\mathcal{F}}}
\def\calG{{\mathcal{G}}}
\def\calH{{\mathcal{H}}}
\def\calI{{\mathcal{I}}}
\def\calJ{{\mathcal{J}}}
\def\calK{{\mathcal{K}}}
\def\calL{{\mathcal{L}}}
\def\calM{{\mathcal{M}}}
\def\calN{{\mathcal{N}}}
\def\calO{{\mathcal{O}}}
\def\calP{{\mathcal{P}}}
\def\calQ{{\mathcal{Q}}}
\def\calR{{\mathcal{R}}}
\def\calS{{\mathcal{S}}}
\def\calT{{\mathcal{T}}}
\def\calU{{\mathcal{U}}}
\def\calV{{\mathcal{V}}}
\def\calW{{\mathcal{W}}}
\def\calX{{\mathcal{X}}}
\def\calY{{\mathcal{Y}}}
\def\calZ{{\mathcal{Z}}}

% Sets
\def\sA{{\mathbb{A}}}
\def\sB{{\mathbb{B}}}
\def\sC{{\mathbb{C}}}
\def\sD{{\mathbb{D}}}
% Don't use a set called E, because this would be the same as our symbol
% for expectation.
\def\sF{{\mathbb{F}}}
\def\sG{{\mathbb{G}}}
\def\sH{{\mathbb{H}}}
\def\sI{{\mathbb{I}}}
\def\sJ{{\mathbb{J}}}
\def\sK{{\mathbb{K}}}
\def\sL{{\mathbb{L}}}
\def\sM{{\mathbb{M}}}
\def\sN{{\mathbb{N}}}
\def\sO{{\mathbb{O}}}
\def\sP{{\mathbb{P}}}
\def\sQ{{\mathbb{Q}}}
\def\sR{{\mathbb{R}}}
\def\sS{{\mathbb{S}}}
\def\sT{{\mathbb{T}}}
\def\sU{{\mathbb{U}}}
\def\sV{{\mathbb{V}}}
\def\sW{{\mathbb{W}}}
\def\sX{{\mathbb{X}}}
\def\sY{{\mathbb{Y}}}
\def\sZ{{\mathbb{Z}}}





% The true underlying data generating distribution
\newcommand{\pdata}{p_{\rm{data}}}
% The empirical distribution defined by the training set
\newcommand{\ptrain}{\hat{p}_{\rm{data}}}
\newcommand{\Ptrain}{\hat{P}_{\rm{data}}}
% The model distribution
\newcommand{\pmodel}{p_{\rm{model}}}
\newcommand{\Pmodel}{P_{\rm{model}}}
\newcommand{\ptildemodel}{\tilde{p}_{\rm{model}}}
% Stochastic autoencoder distributions
\newcommand{\pencode}{p_{\rm{encoder}}}
\newcommand{\pdecode}{p_{\rm{decoder}}}
\newcommand{\precons}{p_{\rm{reconstruct}}}

\newcommand{\laplace}{\mathrm{Laplace}} % Laplace distribution

\newcommand{\ubar}[1]{\text{\b{$#1$}}}

\newcommand{\E}{\mathbb{E}}
\newcommand{\Ls}{\mathcal{L}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\emp}{\tilde{p}}
\newcommand{\lr}{\alpha}
\newcommand{\reg}{\lambda}
\newcommand{\rect}{\mathrm{rectifier}}
\newcommand{\softmax}{\mathrm{softmax}}
\newcommand{\sigmoid}{\sigma}
\newcommand{\softplus}{\zeta}
\newcommand{\KL}{D_{\mathrm{KL}}}
\newcommand{\Var}{\mathrm{Var}}
\newcommand{\standarderror}{\mathrm{SE}}
\newcommand{\Cov}{\mathrm{Cov}}
% Wolfram Mathworld says $L^2$ is for function spaces and $\ell^2$ is for vectors
% But then they seem to use $L^2$ for vectors throughout the site, and so does
% wikipedia.
\newcommand{\normlzero}{L^0}
\newcommand{\normlone}{L^1}
\newcommand{\normltwo}{L^2}
\newcommand{\normlp}{L^p}
\newcommand{\normmax}{L^\infty}

\newcommand{\parents}{Pa} % See usage in notation.tex. Chosen to match Daphne's book.

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

\DeclareMathOperator{\sign}{sign}
\DeclareMathOperator{\Tr}{Tr}
\let\ab\allowbreak


% Algo names
\def\algoff{{\textsc{Meta-KGL}}\xspace}
\def\algon{{\textsc{LiBO}}\xspace}
\def\falgoff{{\textsc{F-Meta-KGL}}\xspace}
\def\falgon{{\textsc{F-LiBO}}\xspace}
\def\gpucb{{\textsc{GP-UCB}}\xspace}
\def\bba{{\textsc{BaseBO}}\xspace}

% Variable names
\def\tH{{\calH_{k^\star}}}
\def\Hhat{{\calH_{\hat{k}}}}
\def\Hfull{{\calH_{k_\mathrm{full}}}}
\def\tk{{k^\star}}
\def\tbeta{\beta^\star}
\def\tvbeta{\bm{\beta}^\star}
\def\khat{{\hat{k}}}
\def\betahat{{\hat{\beta}}}
\def\vbetahat{\hat{\bm{\beta}}}
\def\vvarepsilon{{\bm{\varepsilon}}}
\def\vbeta{{\bm{\beta}}}
\def\vphi{{\bm{\phi}}}
\def\gj{{^{(j)}}}
\def\tJ{{J^\star}}
\def\Jhat{{\hat{J}}}
\def\dmax{{d_{\mathrm{max}}}}
\def\kfull{{k^\mathrm{full}}}
\def\Roracle{{R^\star}} %_\mathrm{oracle}}}
\def\Dexp{\calD^{\mathrm{exp}}}
\def\fed{{^{(\mathrm{fed})}}}

% delta value for the differntial privacy analysis
\def\ddp{{\delta_{\mathrm{dp}}}}
% epsilon value for the differntial privacy analysis
\def\edp{{\epsilon_{\mathrm{dp}}}}
% sigma value for the differntial privacy analysis
\def\sdp{{\sigma_{\mathrm{dp}}}}
% known upper bound on s^*
\def\cdp{{c_{s^\star}}}



\newcommand{\vspacefigure}{\vspace{-10pt}}
\newcommand{\vspaceparagraph}{\vspace{-4pt}}
\newcommand{\vspaceequation}{\vspace{-2pt}}

\newcommand{\vspacecaption}{\vspace{-5pt}}
\newcommand{\vspacecaptionlow}{\vspace{-4pt}}
\newcommand{\vspacesubcaption}{\vspace{-3pt}}
\newcommand{\vspacesubcaptionlow}{\vspace{-2pt}}


\makeatletter
\def\munderbar#1{\underline{\sbox\tw@{$#1$}\dp\tw@\z@\box\tw@}}
\makeatother

\usepackage{multicol}
\newcommand*{\myalign}[2]{\multicolumn{1}{#1}{#2}}

\usepackage{colortbl}

\usepackage{pifont}
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
\usepackage{makecell}

\makeatletter
\newcommand{\printfnsymbol}[1]{%
  \textsuperscript{\@fnsymbol{#1}}%
}
\makeatother
