let $(M_t)_{t \geq 0}$ be a positive, continuous martingale starting from $0$
let $a > 0$ and $\tau$ be the stopping time defined as follows :
$$\tau =\{ t\geq0 \,| \, M_t \geq a\}$$
by use of Doob's optional stopping theorem and the dominated convergence theorem we have that :
$M_{\tau} = a, \, \mathbb{E}[M_{t \wedge\tau}] = 0,\, a \mathbb{P}(\tau \leq t) + \mathbb{E}[M_{t} |\{\tau > t\}]\mathbb{P}(\tau > t) = 0 $
so basically we have to prove that :
$- \mathbb{E}[M_{t} |\{\tau > t\}](\mathbb{P}(\tau > t)) = \mathbb{E}[M_t \mathbb{1}_{\{\tau \leq t\}}] $
on the one hand we have :
$\mathbb{E}[M_t \mathbb{1}_{\{\tau \leq t\}}] = \mathbb{E}[M_t | \{\tau \leq t\}]\mathbb{P}(\tau \leq t)$
so at the end it all comes down to proving that :
$$\mathbb{E}[M_t | \{\tau \leq t\}]\mathbb{P}(\tau \leq t) +\mathbb{E}[M_{t} |\{\tau > t\}](\mathbb{P}(\tau > t)) = 0 $$
but don't we have by the law of total probabilities that :
$$\mathbb{E}[M_t | \{\tau \leq t\}]\mathbb{P}(\tau \leq t) +\mathbb{E}[M_{t} |\{\tau > t\}](\mathbb{P}(\tau > t)) = \mathbb{E}[M_t]$$
I'm really confused to what I'm doing wrong.
$EM_t$ is independent of $t$ by definition of a martingale. Since $M_0=0$ it follows that $EM_t=0$ for all $t$ Hence there is no contradiction!