How to compute conditional expectation using the definition? Let's suppose we have $N$ i.i.d. variables $x_{1},\ldots,x_{N}$. The task is to compute $\mathbb{E}[x_{1}|S_{N}]$, where $S_{N} = \displaystyle \sum\limits_{j=1}^{N}x_{j}$.
Is it true that $\mathbb{E}[x_{1}|S_{N}] = \mathbb{E}[x_{i}|S_{N}]$? If so (how to explain it rigorously?), one could proceed by constructing a simple equation to obtain $N\mathbb{E}[x_{1}|S_{N}] = \mathbb{E}[S_{N}|S_{N}] = S_{N}$(?) by linearity. Or maybe the linearity can be used in another way $$\mathbb{E}[x_{1}|S_{N}] = \mathbb{E}[x_{1}|S_{N}=y]\Big\vert_{y=S_{N}}=\mathbb{E}[y-x_{N}-\ldots-x_{2}] = \left[\mathbb{E}y-(N-1)\mathbb{E}x_{1}\right]\Big\rvert_{y=S_{N}} = S_{N}-(N-1)\dfrac{S_N}{N} = \dfrac{S_{N}}{N}$$ Is this approach correct? Can I compute, say, $\mathbb{E}[S_{N}|S_{N-1}]$ in the following way: $\mathbb{E}[S_{N}|S_{N-1}] = \mathbb{E}[S_{N}|S_{N-1}=y]\Big\rvert_{y=S_{N-1}} = \mathbb{E}[y+x_{N}|S_{N-1}=y]\Big\rvert_{y=S_{N-1}} = S_{N-1}+\mathbb{E}x_{N}$?
What is the most general defeinition of conditional expected value? I would like to see how to use this definition to provide an intuition how one can come up with the function and prove rigorously (and by definition) that it is indeed the desired conditional expectation.
 A: First of all, the reason why $\mathbf{E}[x_j | S_n]$ is independant of $j \in \{1,...,n\}$ is easy to see with an argument of symmetry.
$$\mathbf{E}[X_j | X_1+...+X_n]=\mathbf{E}[X_j | X_j+X_2+...+X_{j-1}+X_1+X_{j+1}...+X_n]$$
And, because $\mathcal{D}(X_1,...,X_n)=\mathcal{D}(X_j,X_2,...,X_1,...,X_n)$ (it's called exchangeability, and it's a weaker assumption than independance).
$$\mathbf{E}[X_j | X_j+X_2+...+X_{j-1}+X_1+X_{j+1}...+X_n]=\mathbf{E}[X_1 | X_1+X_2+...+X_{j-1}+X_j+X_{j+1}...+X_n]$$
And finally, $\mathbf{E}[x_j | S_n] = \mathbf{E}[x_1 | S_n]  $
A: Assume $1 \neq j$.  As both $E(X_1|S_N)$ and $E(X_j|S_N)$ are $\sigma(S_N)$-measurable, by the measure-theoretic definition of conditional expectation, it suffices to show that for any $G \in \sigma(S_N)$, it holds that
\begin{align*}
\int_G X_1 dP = \int_G E(X_j|S_N)dP. \tag{1}
\end{align*}
Using the conditional expectation definition again, the right-hand side of $(1)$ is simply $\int_G X_j dP$.  Therefore it suffices to show
\begin{align*}
\int_G X_1 dP = \int_G X_jdP. \tag{2}
\end{align*}
Since (see Probability and Measure, Theorem 20.1) the $\sigma$-field $\sigma(S_N)$ consists exactly of the sets $S_N^{-1}(H) = \{\omega \in \Omega: S_N(\omega) \in H\}$ for $H \in \mathscr{R}^1$, it suffices to show $(2)$ for $G = S_N^{-1}(H), H \in \mathscr{R}^1$.  By assumption, $(X_1, \ldots, X_N)$ has the product measure  $\pi := \underbrace{\mu \times \mu \times \cdots \times \mu}_{N \text{ times}}$, where $\mu$ is the common distribution of $X_1, \ldots, X_N$. It then follows by the change of variable theorem (Probability and Measure, Theorem 16.13) that
\begin{align}
& \int_G X_1 dP = 
\int_{\mathbb{R}^N} x_1I_H(x_1 + \cdots + x_N) \pi(d(x_1, \ldots, x_N)), \tag{3} \\  
& \int_G X_j dP = 
\int_{\mathbb{R}^N} x_jI_H(x_1 + \cdots + x_N) \pi(d(x_1, \ldots, x_N)). \tag{4}
\end{align}
Let $\nu = \underbrace{\mu * \mu * \cdots * \mu}_{N - 1 \text{ times}}$ be the distribution of $S_N - X_1$ (as well as $S_N - X_j$), where "$*$" stands for convolution. By Fubini's Theorem, the right-hand sides of $(3)$ and $(4)$ are respectively (where $H - x$ stands for the set $\{y \in \mathbb{R}^1: x + y \in H\}$):
\begin{align}
& \int_{\mathbb{R}^1}\left[\int_{\mathbb{R}^{N - 1}}x_1I_H(x_1 + \cdots + x_N)\mu^{N - 1}(d(x_2, \ldots, x_N))\right]\mu(dx_1) \\
=& \int_{\mathbb{R}^1}x_1P[x_1 + X_2 + \cdots + X_N \in H]\mu(dx_1) \\
=& \int_{\mathbb{R}^1}x_1P[X_2 + \cdots + X_N \in H - x_1]\mu(dx_1) \\
=& \int_{\mathbb{R}^1}x_1\nu(H - x_1)\mu(dx_1), \tag{5} \\  
& \int_{\mathbb{R}^1}\left[\int_{\mathbb{R}^{N - 1}}x_jI_H(x_1 + \cdots + x_N)\mu^{N - 1}(d(x_1, \ldots, x_{j - 1}, x_{j + 1}, \ldots x_N))\right]\mu(dx_j) \\
=& \int_{\mathbb{R}^1}x_jP[x_j + X_1 + \cdots + X_{j - 1} + X_{j + 1} + 
\cdots + X_N \in H]\mu(dx_j) \\
=& \int_{\mathbb{R}^1}x_jP[X_1 + \cdots + X_{j - 1} + X_{j + 1} + 
\cdots + X_N \in H - x_j]\mu(dx_j) \\
=& \int_{\mathbb{R}^1}x_j\nu(H - x_j)\mu(dx_j). \tag{6}
\end{align}
The right-hand sides of $(5)$ and $(6)$ are evidently identical (in that both "$x_1$" and "$x_j$" may be viewed as dummy integrating variables).  Therefore, $(2)$ holds, thus $E(X_1|S_N) = E(X_j|S_N)$. From here it is immediate by the linearity of the conditional expectation to conclude that
\begin{align}
S_N = E[S_N | S_N] = E[X_1 + \cdots + X_N | S_N]  =  \sum_{i = 1}^N E[X_i |S_N] = NE[X_1|S_N], 
\end{align}
i.e., $E[X_1|S_N] = N^{-1}S_N$.
