TITLE: $(\int f(x,y)\lambda(dy))^{-1}$ is a density of the absolutely continuous part of Lebesgue measure w.r.t. $P_X$?
QUESTION [5 upvotes]: Consider the following example from Achim Klenke's Probability theory

I have two questions:
1) How is it that $(f_X(x))^{-1}$ is a density of the absolute continuous part of the Lebesgue measure w.r.t. $P_X$?
2) The regular conditional distribution of $Y$ given $X$ is a transition kernel such that for every $x$ the map $B \mapsto P[Y\in B|X=x]$ is a measure on $\mathbb R$. Thus a density of this measure would rather be a map such that $P[Y\in B|X=x]=\int _B g_x(y)\lambda (dy)$ But the equation seems to show something else? What does it say?
( It looks more like $\int f_{Y|X}(x,y)\lambda (dy)$ is a density of $P_{(X,Y)}$ w.r.t. $P_X$)
Thanks in advance!

REPLY [3 votes]: Let us start with the definitions here. First of all , $X$ and $Y$ are random variables,  so they are measurable maps from (could be different) probability spaces to $\mathbb R$. We use $P$ to denote the measures on both these probability spaces.

$X,Y$ are random variables having joint density $f$, with respect to the Lebesgue measure $\lambda^2$.

What does this mean? It means that for any $A \subset \mathbb R^2$, we have :
$$
P((X,Y) \in A) = \int_{A} f(x,y) \lambda^2(dxdy)
$$

Now we are defining $f_X(x) = \int_{\mathbb R}f(x,y) \lambda(dy)$ i.e. we are integrating $f$ over only $y$, keeping $x$ fixed. Clearly $f_X(x) > 0$ for $P_X$-a.a.

Why is that statement true? First, what is $P_X$? It is the measure on $\mathbb R$, given by $P_X(A) = P(X \in A)$. Now, how do we show that $f_X(x) > 0$ a.a. $P_X$? 
Let $A$ be $P_X$ measurable.
$$
P(X \in A) = P((X, Y) \in A \times \mathbb R) = \int_{A \times \mathbb R} f(x,y) \lambda^2(dxdy)
$$
But now we use Fubini's theorem:
$$
\int_{A \times \mathbb R} f(x,y) \lambda^2(dxdy) = \int_{A} \left(\int_{\mathbb R} f(x,y) \lambda(dy)\right) dx = \int_A f_X(x)\lambda( dx)
$$
In conclusion, we have the following useful identity :
$$ \bbox[yellow , 5px, border:2px solid red]{
P_X(A) = P(X \in A) = \int_{A} f_X(x) \lambda(dx) 
}\tag{1}
$$
For every $A$ which is $P_X$ measurable. Note that using simple functions, MCT and positive-negative splitting, one obtains the following for any $g$ which is $P_X$ measurable we have :
$$
\int_{\mathbb R} g(x)P_X(dx) = \int_{\mathbb R} g(x)f_X(x) \lambda(dx)  \tag{2}
$$
Now, let $N$ be the set on which $f_X(x) = 0$. From $(1)$, we get  :
$$
P_X(N) = \int_{N} f_X(x) \lambda(dx) = \int_N 0 \lambda(dx) = 0
$$
and therefore we get that $f_X > 0$ almost everywhere $P_X$. 
Next, the "doubtful" statement :

The absolutely continuous part of $\lambda$ with respect to $P_X$, has density $f_X^{-1}$.

You will know that $\lambda$ splits uniquely, with respect to $P_X$, into an absolutely continuous part and a mutually singular part i.e. there are two measures $\mu_1$ and $\mu_2$ such that $\lambda = \mu_1 + \mu_2$, and $\mu_1 << P_X$ and $\mu_2 \perp P_X$. We are claiming that $\mu_1 << P_X$ has the density $f_X^{-1}$. 
Now note that for every $A$, we have $\lambda(A) = \lambda(A \cap N) + \lambda(A \cap N^c)$ where $N$ is the set on which $f_X$ is zero. Now, note that $P_X(A \cap N) = 0$, so if we define $\mu_2(A) = \lambda(A \cap N)$ then this is mutually singular to $P_X$, since $P_X(N) = \mu_2(N^c) = 0$. 
Our candidate for $\mu_1$ is thus $\mu_1(A) = \lambda(A \cap N^c)$. To see that this is absolutely continuous with respect to $P_X$, we use the fact that $f_X$ is invertible on $N^c$. More precisely,
$$
\lambda(A \cap N^c) = \int_{A \cap N^c} 1 \lambda(dx) = \int_{A \cap N^c} \frac{1}{f_X(x)} f_X(x) \lambda(dx) \overset{(2)}{=} \int_{A \cap N^c} \frac{1}{f_X(x)} dP_X  
$$
and therefore, since $A$ is arbitrary, the candidate for $\mu_1$ is correct, and it is clear that the density is $\frac 1{f_X(x)}$, or $f_X^{-1}$, of the absolutely continuous part of $\lambda$, which is $\mu_1$, with respect to $P_X$.

Essentially, an argument finding the regular conditional distribution of $Y$ with respect to $X$.

Let us define a regular conditional distribution of $Y$ given $X$. In this case, it is a map $K$ from $\mathbb R \times \mathcal B(\mathbb R) \to [0,1]$ such that three things are satisfied : 

$K(r, \cdot) : \mathcal B(\mathbb R) \to [0,1]$ is a probability measure on Borel sets for all $r \in \mathbb R$.
$K(\cdot , A) : \mathbb R \to [0,1]$ is a Borel measurable function for every Borel $A$.
We have $K(x,A) = P((Y \in A) | X = x)$ almost surely $P_X$ i.e. the set of $x$ for which the above inequality does not hold for some $A$, has $P_X$ measure zero.

We need to do is some decoding here. The point is, it is true that for fixed $x$ the map $B \to K(x,B)$ is a probability measure on $\mathbb R$. The point is, with respect to which measure are we calculating the density? I think Klenke has been a bit loose here, since there are many measures on $\mathbb R$ currently in context. However, let us anyway probe into Klenke's argument. 
He first defines the function $f_{Y | X}(x,y) = \frac{f(x,y)}{f_X(x)}$. This cannot be defined if $x \in N$ so he says this is defined almost everywhere with respect to $P_X$. Now if this has to be the density, then the integration of this function has got to be happening over the measure $P_X$, because $P_X$ ignores the set where the above is undefined, since $P_X(N) = 0$.
Now, Klenke has this notation $P[X \in dx]$, well that is the same as $P_X(dx)$. That is to say, 
$$
\int_{A} P(X \in dx) \int_B f_{Y|X} (x,y) \lambda(dy) = \int_{A} \color{blue}{\left(\int_{B} f_{Y|X}(x,y) \lambda(dy)\right)} P_X(dx)
$$
so essentially what Klenke wants to show is that the blue part above is $K(x,B)$. Now, the blue part is an integral with respect to the Lebesgue measure, so the density of $K(x,\cdot)$ as a measure is indeed being described with respect to the Lebesgue measure. The function $g_x(y)$ is $f_{Y | X}(x,y)$. That is , for every $B$ we have :
$$
K(x,B) = \int_{B} g_x(y) \lambda(dy) = \int_B f_{Y|X}(x,y) \lambda(dy) 
$$
Now let us understand Klenke's argument, and where the first line of his argument comes from. For this I will go through the whole thing.

Let us first write down what Klenke thinks is the regular conditional probability explicitly :
$$
K(x,A) = \int_{A} f_{Y|X}(x,y) \lambda(dy)
$$ 
Now, we must verify the three things (why does it take values in $[0,1]$?). Let us go step by step :

Fix $x$. Then, $K(x,\cdot)$ is a measure simply because the integral is countably additive. 
Fix $A$. Then, the map $x \to \int_A f_{Y|X}(x,y) \lambda(dy)$ is measurable, which is shown in the proof of Fubini's theorem  (that's why we are able to integrate it to get the well-definedness of one side of Fubini). Therefore, measurability follows.
The third part is checking that $P(Y \in B | X = x) = K(x,B)$ almost surely $P_X$. The point is, what is $P(Y \in B | X = x)$? The thing is, that $Y \in B$ is an event, so $P(Y \in B | X)$ is the same as $E[1_{Y \in B} | X]$ which is a conditional expectation. Now, this conditional expectation is by definition $\sigma(X)$ - measurable, and hence it can be seen that it must be a Borel function of $X$ a.e. $P_X$, say $E[1_{Y \in B} | X] = \phi(X)$ for some Borel $\phi$. Now, $P(Y \in B | X = x) = \phi(x)$.

So what we essentially have is a candidate for the conditional expectation of $1_{Y \in B}$ given $X$, namely $\omega \to K(X(\omega),B)$ (as a map from the domain of $X$ to $[0,1]$), and we are verifying it. 
Therefore, we do what we do usually to verify conditional expectations : find the integral of $K(x,B)$ over a set $A$ and verify that is equals the integral of $1_{Y \in B}$ over $A$. Integral with respect to which measure? Indeed, the rcd is with respect to $X$, so the measure is $P_X$!
Thus, we start with $\int_{A} K(x,B) P_X(dx)$ Expand this, and see that it matches with the first line of Klenke's  argument, which is the line that got you confused about the density of $K(x,B)$ and so on.
We expand : $$
\int_A P_X(dx) \int_B \frac{f(x,y)}{f_X(x)} \lambda(dy)
$$
Now we remove the $f_X(x)$ part from the first term, and use $(1)$ :
$$
\int_{A} f_{X}(x)^{-1}P_X(dx) \color{green}{\int_B f(x,y) \lambda(dy)} \overset{\mu_1 << P_X}{=} \int_A \int_B f(x,y) \lambda^2(dxdy) = P(X \in A,Y \in B)
$$
However, we also note that :
$$
P(X \in A, Y \in B) = \int_A 1_{Y \in B} P_X(dx)
$$
Therefore, we get the following equality for all $P_X$ measurable $A$ :
$$
\int_{A} 1_{Y \in B} P_X(dx) = \int_A K(x,B) P_X(dx)
$$
which tells us that $K(x,B) = P(Y \in B | X = x)$ a.e. $P_X$, as desired!

I think this is a difficult topic, you know, and you should really take the time to grind out each detail to the dust. Also, you will frequently be using stochastic kernels if you proceed further into stochastic processes (Markov processes etc. are defined via kernels, and theorems like the Ionescu-Tulcea extension theorem are stated in this language), so be comfortable before wading into deep waters.