Brownian motion proof of Dirichlet problem I am reading the proof of the Dirichlet theorem stated in the following form:

Theorem:
  Let $D$ be a bounded domain in $\mathbb{R}^d$ such that every boundary point satisfies the Poincare cone condition. Suppose that $\varphi$ is a continuous function on $\partial D$ . We let $\tau ( \partial D) = \inf \{ t \geq 0 : B_t \in \partial D \}$, which is an almost surely finite stopping time when starting in $D$. Then the function $u: \overline{D} \rightarrow \mathbb{R}$ given by $u(x) = \mathbb{E}_x [ \varphi( B_{\tau(\partial D)}) ]$, for $x \in \overline{D}$, is the unique continuous function satisfying 
  $$
\Delta  u =0 \, \, \text{ on } \, D, \quad u(x) = \varphi (x) \, \, \text{ for } x \in \partial D.
$$

The proof that $u$ is harmonic in $D$ goes as follows (using Markov property):

Let $x \in D$ and $\delta >0$ be such that $\overline{B} (x, \delta) \subseteq D$. Also, let $\tau= \inf \{t > 0 : B_t \in \partial B (x, \delta) \}$. Then
  $$u(x) = \mathbb{E}_x [ \varphi(B_{\tau(\partial D)}) ]= \mathbb{E}_{x} [ \mathbb{E}_{B_{\tau}} [ \varphi(B_{\tau({\partial D})} ) ] \,] = \mathbb{E}_x [ u(B_{\tau}) ].$$
  Hence, $u$ satisfies the mean value property and is hence harmonic.

However, I don't get the same expression in the second equality in the proof:
Let $\tilde{B}$ be a standard Brownian motion. Then, noting that $\tilde{B}_{\tau(\partial D)} - \tilde{B}_{\tau}$ is independent of $\mathcal{F}_{\tau}$, and $\tilde{B}_\tau$ is $\mathcal{F}_{\tau}$-measurable,
\begin{eqnarray}
u(x) & = & \mathbb{E} \,[ \,\mathbb{E} [ \varphi(\tilde{B}_{\tau(\partial D)} +x)  \,| \,\mathcal{F}_\tau ] \,]\\
& = & \mathbb{E} \,[ \,\mathbb{E} [  \varphi(\tilde{B}_{\tau(\partial D)} - \tilde{B}_{\tau} +  \tilde{B}_{\tau} +x)  \,| \,\mathcal{F}_\tau ]\, ]\\
& = & \mathbb{E} \, [ \, \mathbb{E} [  \varphi(\tilde{B}_{\tau(\partial D)} - \tilde{B}_{\tau} + v) |_{v = \tilde{B}_{\tau} +x} \, ] \, ]\\
& = & \mathbb{E}_{x} [ \mathbb{E}_{B_{\tau}} [ \varphi(B_{\tau({\partial D})} - B_{\tau} ) ]].
\end{eqnarray}
Why is there an extra term involving $B_{\tau}$ in my calculations? What have I done wrong?
 A: My writeup of this in a previous project, with slightly different notation, looks like this:
$$u(x) = \Bbb E[f(x+W_{\tau_{\partial D},x})] \\
= \Bbb E[\Bbb E[f(x+W_{\tau_{\partial D},x})|W_{\tau_r}]] \\
= \Bbb E[u(x+W_{\tau_r})] \\
= \int_{\partial B(x,r)} u(y) dS(y).$$
In the first step, we use the tower property, inserting a conditional expectation in the middle so that we can get to the next step. In the last step we use an important fact that as best I can tell is omitted in your proof: Brownian motion is rotationally symmetric, so if $\tau$ is the first time to hit a certain sphere centered at zero, then $W_\tau$ is uniformly distributed on the sphere. Hence expectations of that sort are just the surface integral over the sphere.
At any rate, the middle step seems to be your concern. By the strong Markov property of Brownian motion, the behavior of $f(x+W_{\tau_{\partial D,x}})$ given a value of $W_{\tau_r}$ is determined entirely by the value of $W_{\tau_r}$. Hence when we average a quantity which depends on the future over such possible values of $W_{\tau_r}$, we get $u(x+W_{\tau_r})$ on the inside. Then we average over the possible values of $W_{\tau_r}$, which as I said before are uniformly distributed on the sphere.
My reference in this project was http://www.ntu.edu.sg/home/nprivault/papers/greifswald_potential.pdf. This proof is there on page 46.
A: Given a ball $\bar B_r(x)\subset D$,  consider the stopping time: 
$$\tau = \min\{t\geq 0;~ x+B_t\not\in B_r(x)\}$$ 
and also for each $z\in D$ let $\tau_z = \min\{t\geq 0;~ z+B_t\not\in
D\}$. We introduce two random variables $X_1$ and $X_2$ on the
probability space $(\Omega,\mathcal{F}, \mathbb{P})$ on which the
standard Brownian motion $\{B_t\}_{t\geq 0}$ is defined. The first
random variable is simply: $X_1=x+B_{\tau}$, taking values in the
measurable space $(D, \mathcal{F}_1)$ with the usual $\sigma$-algebra
$\mathcal{F}_1$ of Borel subsets of $D$.  
The second random variable $X_2$ is given by the paths of $B_{\tau+t} -
B_\tau$, almost surely belonging to $E_0=C[0,\infty),
\mathbb{R}^n)$. We make $E_0$ a measurable space by equipping it with
the $\sigma$-algebra $\mathcal{B}(E_0)$ of its Borel subsets with
respect to the topology of uniform convergence on compact
intervals. In fact, $X_2$ takes values in a measurable subset $E$ of
$E_0$, consisting of these $f\in E$ which satisfy:
$f(0)=0$ and $|f(T)|>\mbox{diam} \, D$ for some $T>0$. We name
$\mathcal{F}_2$ the $\sigma$-algebra $\mathcal{B}(E_0)$ restricted to $E$. 
Checking the measurability property of $E$ in $E_0$, as well as
measurability of $X_2$ with respect to $(E,\mathcal{F}_2)$ relies on
observing that $\mathcal{B}(E_0)$ is generated by the countable family
of sets of the type $A_{g,T,r} = \{f\in E_0;~
\|f-g\|_{L^\infty[0,T]}\leq r\}$, where $g$ are polynomials with
rational coefficients, and $T,r>0$ are rationals. 
Now, the crucial observation is that $X_1$ and $X_2$ are
independent. Indeed, $X_1$ is clearly $\mathcal{F}_\tau$-measurable,
whereas $X_2$ is $\mathcal{F}_\tau$-independent. This last statement
is a direct consequence of the strong Markov property for the shifted
Brownian motion $\{B_{\tau+t} - B_\tau\}_{t\geq 0}$ and can be checked
directly on the preimages of sets $A_{g,T,r}$. 
We call $\mu_1$ the push-forward measure of $\mathbb{P}$ via $X_1$
and $\mu_2$ the push-forward of $\mathbb{P}$ via $X_2$.
Thus $(D,\mathcal{F}_1,\mu_1)$ and $(E,\mathcal{F}_2,\mu_2)$ 
are two probability spaces, and the independence of $X_1$ and $X_2$
  is equivalent to the product $\mu_1\times
\mu_2$ equaling the push-forward of $\mathbb{P}$ on $D\times E$
via $(X_1, X_2)$. 
Finally, consider the following random variable on $D\times E$, valued in $\mathbb{R}$:
$$F(z,f) = \varphi\big(z+f(\min\{t\geq 0;~ z+f(t)\not\in D\})\big).$$
We write:
\begin{equation*}
\begin{split}
u(x) & = \mathbb{E}[\varphi(x+B_{\tau_x}] = \mathbb{E}[F\circ (X_1,
X_2)] = \int_{D\times E} F \;d(\mu_1\times\mu_2) \\ & = 
\int_D\int_E F(z,f)\;d\mu_2(f) \;d\mu_1(z)=\int_D \mathbb{E}[F(z,X_2)]\;d\mu_1(z),
\end{split}
\end{equation*}
where we simply used Fubini's theorem. In conclusion:
\begin{equation*}
\begin{split} 
u(x) & = \int_D \varphi(z+B_{\tau_z}) \;d\mu_1(z) = \int_D u(z)
\;d\mu_1(z) \\ & = \mathbb{E}[u\circ X_1] = \mathbb{E}[u(x+B_{\tau})], 
\end{split}
\end{equation*}
as claimed.
