Formal definition for conditional expectation of $\mathbb{E}[X\mid X>a]$ I would like to know why is it true that for any random variable $X$ discrete, continues, or any other case with cumulative distribution function $F_X(x)$ it happens that, for example that the expectation of $X|X>a$ can be written as:
$$
\mathbb{E}[X\mid X>a] =\frac{\int_{a}^\infty x\,dF_X(x)}{\mathbb{P}[X>a]}.
$$
And the general case, $X\in C\subset \mathbb{R}$ then
$$
\mathbb{E}[X\mid X\in C] =\frac{\int_{C} x\,dF_X(x)}{\mathbb{P}[X\in C]}.
$$
I'd like to know a formal argument... but all I found is formal definitions such using random variables such as $\mathbb{E}[X|\mathcal{F}]$, but not any explanation that why is this happening.
 A: The conditional expectation of $X$ given an event $A$ with $\mathsf{P}(A)>0$ is defined as
$$
\mathsf{E}[X\mid A]=\frac{\mathsf{E}[X1_A]}{\mathsf{P}(A)}.
$$
The numerator on the right-hand side is nothing but $\int_Ax\,dF_X(x)$. If you define $\mathcal{F}=\sigma(A)=\{\emptyset,A,A^c,\Omega\}$, i.e., the $\sigma$-algebra generated by $A$ with $0<\mathsf{P}(A)<1$,
$$
\mathsf{E}[X\mid \mathcal{F}](\omega)=\frac{\mathsf{E}[X1_A]}{\mathsf{P}(A)}1_A(\omega)+\frac{\mathsf{E}[X1_{A^c}]}{\mathsf{P}(A^c)}1_{A^c}(\omega),
$$
that is, $\mathsf{E}[X\mid \mathcal{F}](\omega)=\mathsf{E}[X\mid A]$ for every $\omega\in A$.
A: Let the probability space be $(\Omega,\mathscr{F},P)$, with a measurable random variable $X:\Omega \to \mathbb{R}$ s.t. $E[|X|]<\infty$. For the general case, we must prove that for fixed $B \in \mathscr{F}$ s.t. $P(B)\in (0,1)$
$$Y:=\sum_{C_j \in \{B,B^c\}}\frac{E[\mathbb{I}_{C_j}X]}{P(C_j)}\mathbb{I}_{C_j}=E[X|\sigma(B)],\,\ \ P\textrm{-a.s.}$$
where $\sigma(B)=\{\emptyset,B,B^c,\Omega\}$. We have that $Y$ is $\sigma(B)$-measurable as
$$\begin{aligned}\{Y=E[\mathbb{I}_BX]/P(B)\}&=B\in \mathscr{F}\\
\{Y=E[\mathbb{I}_{B^c}X]/P(B^c)\}&=B^c\in \mathscr{F}\\
\{Y\neq E[\mathbb{I}_{B^c}X]/P(B^c)\vee E[\mathbb{I}_BX]/P(B) \}&=\emptyset\in \mathscr{F}\\
\{Y= E[\mathbb{I}_{B^c}X]/P(B^c)\vee E[\mathbb{I}_BX]/P(B) \}&=\Omega\in \mathscr{F}\end{aligned}$$
and we have $E[|Y|]<\infty$. We have for $C_k \in \sigma(B)$
$$E[Y\mathbb{I}_{C_k}]=E\bigg[\sum_{C_j \in \{B,B^c\}}\frac{E[\mathbb{I}_{C_j}X]}{P(C_j)}\mathbb{I}_{C_j\cap C_k}\bigg]=\sum_{C_j \in \{B,B^c\}}E[\mathbb{I}_{C_j}X]\frac{P(C_j\cap C_k)}{P(C_j)}=E[X\mathbb{I}_{C_k}]$$
this is because the sets $B,B^c$ are disjoint. If $B=\{X>a\}$ then the above implies that if $\omega^* \in \{X>a\}$ then
$$Y(\omega^*)=\frac{E[\mathbb{I}_{\{X>a\}}X]}{P(X>a)}=E[X|X>a]$$
