Show that for stopping times two conditional expectations are equal. Let $(\Omega, \mathcal S, P)$ be a probability space with a filtration $\mathfrak F = \{\mathcal F(t)\}_{t \in \mathcal T}$. Let $\tau, \sigma : \Omega \to \mathcal T \cup \{\infty\}$ be stopping times, $X$ a random variable with $E[|X|] < \infty$. Show that
$$
 1_{\{\sigma = \tau\}} E[X \mid \mathfrak F(\sigma)] = 1_{\{\sigma = \tau\}} E[X \mid \mathfrak F(\tau)] \quad a.s.
$$
where $1_{\{\sigma = \tau\}}$ denotes the indicator function, the expectation are condititional expectations, and $\mathfrak F(\sigma)$ denotes the $\sigma$-algebra of the stopping time past, given by
$$
 \mathfrak F(\sigma) := \{ A \in \mathcal S : S \cap \{\sigma \le t \} \le \mathfrak F(t) \mbox{ for all } t \in \mathcal T \}
$$
see for example Definition 20 here.

How to show this?

I tried to use the definition of conditional expectation, with this we have
$$
 E[1_F X] = E[1_F E[X\mid \mathfrak F(\sigma)]]
$$
for each $F \in \mathfrak F(\sigma)$, and similar
$$
 E[1_F X] = E[1_F E[X\mid \mathfrak F(\tau)]]
$$
for each $F \in \mathfrak F(\tau)$. Also as $\{ \sigma = \tau \} \in \mathfrak F(\sigma) \cap \mathfrak F(\tau)$ we have
$$
 1_{\{\sigma = \tau\}} E[X \mid \mathfrak F(\sigma)] = E[ 1_{\{\sigma = \tau\}}X \mid \mathfrak F(\sigma) ].
$$
But I am unsure how to combine these facts? One way to show equality a.s. is to show that one conditional expectation fulfills the definitional equation of the other, but I just see that this could be applied for sets $F \in \mathfrak F(\sigma) \cap F(\tau)$, but not for the whole of one of those $\sigma$-algebras.
 A: First of all, note that $$\{\sigma=\tau\} \cap A \in \mathcal{F}_{\tau} \qquad \text{for all $A \in \mathcal{F}_{\sigma}$}. \tag{1}$$
This follows from
$$\{\sigma=\tau\} \cap A \cap \{\tau \leq t\} = \underbrace{\{\sigma = \tau\} \cap A}_{\in \mathcal{F}_{\sigma}} \cap \{\sigma \leq t\} \in \mathcal{F}_t.$$
Similarly,
$$\{\sigma=\tau\} \cap A \in \mathcal{F}_{\sigma} \qquad \text{for all $A \in \mathcal{F}_{\tau}$}. \tag{2}$$
By $(1)$,
$$\int_A 1_{\{\sigma=\tau\}} X \, d\mathbb{P} = \int_A 1_{\{\sigma=\tau\}} \mathbb{E}(X \mid \mathcal{F}_{\tau}) \, d\mathbb{P} $$
for all $A \in \mathcal{F}_{\sigma}$. If we can show that $Y:= 1_{\{\sigma=\tau\}} \mathbb{E}(X \mid \mathcal{F}_{\tau})$ is $\mathcal{F}_{\sigma}$-measurable, this proves
$$1_{\{\sigma=\tau\}} \mathbb{E}(X \mid \mathcal{F}_{\tau}) = \mathbb{E}(1_{\{\sigma=\tau\}} X \mid \mathcal{F}_{\sigma}) \qquad \text{a.s.}$$
and this gives the assertion. To prove that $Y$ is $\mathcal{F}_{\sigma}$-measurable, recall that $\mathbb{E}(X \mid \mathcal{F}_{\tau})$ is $\mathcal{F}_{\tau}$-measurable. Therefore, by (2),
$$\{Y \in B\} = \{\sigma=\tau\} \cap \underbrace{\{\mathbb{E}(X \mid \mathcal{F}_{\tau}) \in B\}}_{\in \mathcal{F}_{\tau}} \in \mathcal{F}_{\sigma}$$
for any Borel set $B$ such that $0 \notin B$. On the other hand, we have
$$\{Y=0\} = \underbrace{\{\sigma \neq \tau\}}_{\in \mathcal{F}_{\sigma}} \cup \bigg( \{\sigma=\tau\} \cap \{\mathbb{E}(X \mid \mathcal{F}_{\tau})=0\} \bigg) \in \mathcal{F}_{\sigma}.$$
Combining both considerations gives that $Y$ is $\mathcal{F}_{\sigma}$-measurable.
A: Take $F$ to be the event $\{E[X\mid\mathfrak F(\sigma)]<E[X\mid\mathfrak F(\tau)]\}\cap\{\sigma=\tau\}$. This event is both $\mathfrak F(\sigma)$- and $\mathfrak F(\tau)$-measurable. A contradiction will result from your first two displayed identities unless $P(F)=0$. Likewise $P(\{E[X\mid\mathfrak F(\sigma)]>E[X\mid\mathfrak F(\tau)]\}\cap\{\sigma=\tau\})=0$.
