# Mean stopping time of a Brownian motion

I came across the following proof of the fact that the mean stopping time of a Brownian motion to hit $$-1$$ or $$1$$ is $$1$$:

Let $$B$$ be a Brownian motion. We already know $$B_t^2-t$$ is a martingale. Let $$T=\min(t:B_t\in\{-1,1\})$$. A martingale stopped at a stopping time is still a martingale, so $$B_T^2-T$$ is a martingale. It follows that $$E(B_T^2-T)=0$$ so $$E(T)=E(B_T^2)=1$$.

I understand everything except for the notation $$B_T^2-T$$. What exactly is meant by this? Is it the martingale defined by $$W_t=B_t^2-t$$ if $$t and $$W_t=B_T^2-T$$ otherwise? If so, what does $$E(B_T^2-T)$$ mean? Is it $$E(W_T)$$ or $$\lim_{t\to\infty}E(W_t)$$?

If $$(X_t)_{t \geq0}$$ is any stochastic process and $$\tau$$ is any non-negative random variable then $$X_{\tau}$$ is defined by $$X_{\tau}(\omega)=X_{\tau(\omega)} (\omega)$$. This is well defined but it is not a random variable in general. If the process $$(X_t)_{t \geq0}$$ has continuous paths and $$\tau$$ is a stopping time it can be shown that this is a random variable. Of course, if $$\tau$$ happens to be a constant $$t$$ the $$X_{\tau}$$ is same as $$X_t$$.
The proof skipped a few steps. Applying the optional stopping theorem to $$W$$ with condition c makes it more complete.