Suppose $X$, $Y$, $X'$ and $Y'$ are random variables whose probability density follows the following relations.
\begin{align}
\|p\_X-p\_{X'}\|\_{\mathrm{TV}}&\leq\epsilon\_1,\\
\|p\_Y-p\_{Y'}\|\_{\mathrm{TV}}&\leq\epsilon\_2,
\end{align}


where $\|\cdot\|\_{\mathrm{TV}}$ is the total variation distance. Moreover, $X$ is independent of $Y$ and $X'$ is independent of $Y'$. Also, suppose that $Z$ and $Z'$ are the outputs of the function $f(\cdot,\cdot)$ as
\begin{align}
Z&=f(X,Y),\\
Z'&=f(X',Y').
\end{align}
We also know that
\begin{align}
\|p\_{Z,X}-p\_{Z}p\_{X}\|\_{\mathrm{TV}}&\leq\delta.
\end{align}
Will the quantity below also be small?
\begin{align}
\|p\_{Z',X'}-p\_{Z'}p\_{X'}\|\_{\mathrm{TV}}&\leq ?.
\end{align}



The effect of a small change of the probability distribution on the output of the function
$\newcommand{\TV}[2]{\left\| #1 - #2\right\|}$


Sure. You know that $X,Y$ are independent, as are $X',Y'$. So
\begin{align\*}
\TV{p\_{X,Y}}{p\_{X',Y'}}
&=\TV{p\_Xp\_Y}{p\_{X'}p\_{Y'}}\\
&\leq \TV{p\_X}{p\_{X'}}+\TV{p\_Y}{p\_{Y'}}\\
&\leq \epsilon\_1+\epsilon\_2.
\end{align\*}


But $(Z,X)$ is a function of $(X,Y)$, and similarly $(Z',X')$ is a function of $(X', Y')$, so
\begin{align\*}
\TV{p\_{Z,X}}{p\_{Z',X'}}
&\leq \TV{p\_{X,Y}}{p\_{X',Y'}}\\
&\leq 
\epsilon\_1+\epsilon\_2.
\end{align\*}


Hence also $p\_Z$ and $p\_{Z'}$ are within $\epsilon\_1+\epsilon\_2$ in TV distance.
So it follows that
\begin{align\*}
\TV{p\_Zp\_X}{p\_{Z'}p\_{X'}}
&\leq \TV{p\_Z}{p\_{Z'}}+\TV{p\_X}{p\_{X'}}\\
&\leq 2\epsilon\_1+\epsilon\_2.
\end{align\*}


But you also assumed $p\_{Z,X}$ and $p\_Zp\_X$ are within $\delta$. So you get that
$p\_{Z'}p\_{X'}$ and $p\_{Z',X'}$ are also close (I think this gives a bound of
$3\epsilon\_1+2\epsilon\_2+\delta$; maybe with more care you could do better).


