\documentclass{article}
\input{../../lib.sty}

\title{\texttt{CompositionMeasure for Approximate<MaxDivergence>}}
\author{Michael Shoemate}
\date{}

\begin{document}

\maketitle

\contrib
Proves soundness of the implementation of \rustdoc{combinators/sequential_composition/trait}{CompositionMeasure} 
for \texttt{Approximate<MaxDivergence>} in \asOfCommit{mod.rs}{f5bb719}.

\section{Hoare Triple}
\subsection*{Precondition}
\subsubsection*{Compiler-Verified}
Types matching pseudocode.


\subsubsection*{Caller-Verified}
None

\subsection*{Pseudocode}
\lstinputlisting[language=Python,firstline=2,escapechar=|]{./pseudocode/CompositionMeasure_for_ApproximateMaxDivergence.py}

\subsection*{Postcondition}
\begin{theorem}
  \texttt{composability} returns \texttt{Ok(out)} if the composition of a vector of privacy parameters \texttt{d\_mids} 
  is bounded above by \texttt{self.compose(d\_mids)} under \texttt{adaptivity} adaptivity and \texttt{out}-composability.
  Otherwise returns an error.
\end{theorem}

\begin{proof}
  By the postcondition of \rustdoc{traits/trait}{InfAdd} we have that $\sum_i \texttt{d\_mids}_i \le \texttt{compose(d\_mids)}$,
  where the summation is applied independently to epsilons and deltas, and the comparison applies to both the global epsilon and global delta.

  \begin{center}
    \begin{tabular}{ r | l l }
      Adaptivity & Sequential & Concurrent \\ 
      \hline
      Non-Adaptive & Theorem~1\cite{dwork2006gaussian} & Theorem~1.3\cite{vadhan2023concurrent} \\  
      Adaptive & Theorem~1\cite{dwork2006gaussian} & Theorem~1.3\cite{vadhan2023concurrent} \\
      Fully-Adaptive & Lemma~3.5\cite{rogers2021payasyougo} & Theorem~1.3\cite{vadhan2023concurrent}
    \end{tabular}

    The reference for fully adaptive sequential composition is specifically for the version of the paper prior to correction (v1, not v2).
    The correction is not necessary for the privacy proof when odometers are defined in terms of a truncated view.

    This table is reflected in the implementation of \texttt{composability} on line~\ref{line:composability}.
  \end{center}
  
\end{proof}

\bibliographystyle{alpha}
\bibliography{ref}

\end{document}