Let


* $f\in C^3(\mathbb R)$ with $f>0$ and $$\int f(x)\:{\rm d}x=1$$
* $g:=\ln f$ (and assume $g'$ is Lipschitz continuous)
* $n\in\mathbb N$, $$s(x,y):=\sum\_{i=1}^n\left(g(y\_i)-g(x\_i)\right)$$ and $$h(x,y):=\min\left(1,e^{s(x,\:y)}\right)$$ for $x,y\in\mathbb R^n$
* $x\in\mathbb R^n$ and $Y$ be a $\mathbb R^n$-valued normally distributed random variable on a probability space $(\Omega,\mathcal A,\operatorname P)$ with mean vector $x$ and covariance matrix $\sigma I\_n$ for some $\sigma>0$ ($I\_n$ denoting the $n\times n$ identity matrix)



> 
> I want to make the following argumentation rigorous: By Taylor's theorem, \begin{equation}\begin{split}h(x,Y)-h(x,(x\_1,Y\_2,\ldots,Y\_n))&=\frac{\partial h}{\partial y\_1}(x,(x\_1,Y\_2,\ldots,Y\_n))(Y\_1-x\_1)\\&+\frac12\frac{\partial^2h}{\partial y\_1^2}(x,(Z\_1,Y\_2,\ldots,Y\_n))(Y\_1-x\_1)^2\end{split}\tag1\end{equation} for some real-valued random variable $Z\_1$ with $Z\_1\in[\min(x\_1,Y\_1),\max(x\_1,Y\_1)]$. Thus, \begin{equation}\begin{split}\left.\operatorname E\left[h(x,(y\_1,Y\_2,\ldots,Y\_n))\right]\right|\_{y\_1\:=\:Y\_1}&=\operatorname E\left[\min\left(1,e^A\right)\right]+g'(x\_1)\operatorname E\left[1\_{\left\{\:A\:<\:0\:\right\}}e^A\right](Y\_1-x\_1)\\&+\frac12(g''(Z\_1)+\left|g'(Z\_1)\right|^2)\left.\operatorname E\left[1\_{\left\{\:B\:<\:0\:\right\}}e^B\right]\right|\_{z\_1\:=\:Z\_1}(Y\_1-x\_1)^2.\end{split}\tag2\end{equation} Above, I wrote $$A:=\sum\_{i=2}^n(g(Y\_i)-g(x\_i))$$ and $$B:=g(z\_1)-g(x\_1)+\sum\_{i=2}^n(g(Y\_i)-g(x\_i))$$ in order to make the equation more readable (you need to replace them where they occur).
> 
> 
> 


**Question 1**: There are two issues: The first one is that $(x,y)\mapsto\min(x,y)$ is partially differentiable in both arguments except on the diagonal $\Delta\_2:=\left\{(x,y)\in\mathbb R^2:x=y\right\}$. Are we able to conclude the existence of $Z\_1$ anyway? Note that $$\frac{\partial h}{\partial y\_1}(x,y)=\begin{cases}\displaystyle g'(y\_1)e^{s(x,\:y)}&\text{, if }s(x,y)<0\\0&\text{, if }s(x,y)>0\end{cases}\tag3$$ and $$\frac{\partial^2h}{\partial y\_1^2}(x,y)=\begin{cases}\displaystyle(g''(y\_1)+|g'(y\_1)|^2)e^{s(x,\:y)}&\text{, if }s(x,y)<0\\0&\text{, if }s(x,y)>0\end{cases}\tag4$$ for all $y\in\mathbb R^n$.


**Question 2**: The second issue is the case $s(x,y)=0$. In order for $(3)$ to hold, we need to show that the probability of the corresponding event is $0$ (this seems to be related to the question whether the set on which the occurring function is not differentiable has Lebesgue measure $0$; and it's clear that $\Delta$ has Lebesgue measure $0$). How can we do that?


While it's clear that [$h$ is partially differentiable with respect to the second variable except on a countable set](https://mathoverflow.net/q/330399/91890), it is not clear to me why $h$ is even twice differentiable with respect to the second variable except on a set (at least) of Lebesgue measure $0$ (see [this related question](https://mathoverflow.net/q/330682/91890)).


**EDIT**: Please take note of [this related question](https://math.stackexchange.com/q/3218625/47771) which might yield a solution for question 2.



Taylor's theorem for a composition with $\min:\mathbb R^2\to\mathbb R$ and differentiability Lebesgue almost everywhere
Obviously in the case that $n=1$, we have $s(x,x)=0$ and so if $f'(x) \neq 0$ then $\frac{\partial h}{\partial y\_1}$ doesn't exist at $(x,x)$. So I will assume that $n \geq 2$.


**Answer to Question 1.** The random variable $Z\_1$ will pretty much never exist. As an example, take $f$ to be the pdf of a normal distribution of standard deviation $1$, take $n=2$, and take $(x\_1,x\_2)=(1,0)$; then on the event $\left\{Y\_2 \in (-1,1), f(Y\_1)>\frac{f(1)f(0)}{f(Y\_2)}\right\}$, we have that the LHS of (1) is strictly positive, but the RHS of (1) is nonpositive when $Z\_1$ is replaced by any number between $x\_1$ and $Y\_1$.


**Answer to Question 2.** By "the corresponding event", I guess you mean the event $\{ s(x,(x\_1,Y\_2,\ldots,Y\_n)) = 0 \}$? This is the same as the event
$$ \left\{ \sum\_{i=2}^n g(Y\_i) = c \right\} $$
where $c=\sum\_{i=2}^n g(x\_i)$. If there exist $p\_1,\ldots,p\_{n-1} \in \mathbb{R}$ such that $\sum\_{i=1}^{n-1} p\_i = c$ and $g^{-1}(\{p\_i\})$ has positive Lebesgue measure for each $i$, then clearly this event has positive probability. Otherwise, this event has zero probability:


**Theorem.** *Let $X\_1,\ldots,X\_N$ be independent random variables each with law equivalent to the Lebesgue measure, and fix any $c \in \mathbb{R}$. Let $g \colon \mathbb{R} \to \mathbb{R}$ be a measurable function and suppose the event*
$$ E := \left\{ \sum\_{i=1}^N g(X\_i) = c \right\} $$
*has positive probability. Then there exists $(p\_1,\ldots,p\_N) \in \mathbb{R}^N$ such that $\sum\_{i=1}^N p\_i = c$ and $g^{-1}(\{p\_i\})$ has positive Lebesgue measure for each $i$.*


*Proof:* The statement is obvious for $N=1$ so assume $N \geq 2$. Let $S:=\{p \in \mathbb{R} : \mathrm{Leb}(g^{-1}(\{p\}))>0 \}$. Obviously $S$ is at most countable. We recursively construct $(p\_1,\ldots,p\_i) \in S^i$, $i \in \{1,\ldots,N-1\}$, such that the event
$$ \left\{ \sum\_{j=i+1}^N g(X\_j) \ = \ c - \sum\_{j=1}^i p\_j \right\} $$
has positive probability. For $i=N-1$ we then simply define $p\_N=c-\sum\_{j=1}^{N-1} p\_j$, and we are done.


For $i=1$: Fubini's theorem gives that
$$ \mathbb{P}\left( c - \sum\_{j=2}^N g(X\_j) \in S \right) > 0. $$
So since $S$ is at most countable, there exists $p\_1 \in S$ such that
$$ \mathbb{P}\left( \sum\_{j=2}^N g(X\_j) = c - p\_1 \right) > 0. $$


Now suppose we have $i \in \{1,\ldots,N-2\}$ and $(p\_1,\ldots,p\_i) \in S^i$ such that the event
$$ \left\{ \sum\_{j=i+1}^N g(X\_j) \ = \ c - \sum\_{j=1}^i p\_j \right\} $$
has positive probability. Then Fubini's theorem gives that
$$ \mathbb{P}\left( c - \left( \sum\_{j=1}^i p\_j \ \; + \, \sum\_{j=i+2}^N g(X\_j) \right) \in S \right) > 0. $$
So since $S$ is at most countable, there exists $p\_{i+1} \in S$ such that
$$ \mathbb{P}\left( \sum\_{j=i+2}^N g(X\_j) \ = \ c - \sum\_{j=1}^{i+1} p\_j \right) > 0. $$
So we are done. $\square$


