Proving independence of 2 random variables from a 4-variable joint distribution A book I'm reading has the following problem. Even looking at the author's solution, I can't make heads or tails of it - it seems wrong to me, unless I'm missing something.

Problem
The joint probability $\Pr(w,x,y,z)$ over four variables factorizes as
$$
\Pr(w,x,y,z)=\Pr(w)\Pr(z|y)\Pr(y|x,w)\Pr(x).
$$
Demonstrate that $x$ is independent of $w$ by showing that $\Pr(x,w)=\Pr(x)\Pr(w)$.

Author's Solution
We compute the distribution $\Pr(x,w)$ by marginalizing the joint distribution $\Pr(w,x,y,z)$ with respect to the unwanted variables $y$ and $z$: 
$$
\begin{align}
\Pr(x,w)&=\int\int\Pr(w,x,y,z)\,dy\,dz\\
&=\int\int\Pr(w)\Pr(z|y)\Pr(y|x,w)\Pr(x)\,dy\,dz\\
&=\Pr(x)\Pr(w)
\end{align}
$$
where in the third line we have simply integrated over the unwanted variables $y$ and $z$, removing them from the equations.

My Objection
I'm obviously okay until the second line. I understand that $\Pr(x)$ and $\Pr(w)$ can be moved outside the integrals because they are not functions of $y$ and/or $z$. We're left with:
$$
\begin{align}
\Pr(x,w)=\Pr(x)\Pr(w)\int\int\Pr(z|y)\Pr(y|x,w)\,dy\,dz\\
\end{align}
$$
But in general, when we evaluate that integral we get a function of $x$ and $w$, because they're both present in the second factor. Why is this function necessarily equal to $1$?
 A: The conditional probability is also a probability - i.e. it satisfies the axioms of probability. The corresponding conditional pdf/pmf will also satisfy those general properties that ordinary pdf/pmf possess, including this one. So for all values of $x,w$ in the support of this conditional distribution $y|x,w$, $\Pr(y|x,w)$ is still a valid pdf/pmf and integrate/sum to 1 with respect to $y$. In this particular question it might be clearer to you if you integrate with respect to $z$ first
A: The exact derivation would be as follows:
\begin{align}
\Pr(x,w)&=\int\int\Pr(w,x,y,z)\,dy\,dz\\
&=\int\int\Pr(w)\Pr(z|y)\Pr(y|x,w)\Pr(x)\,dy\,dz\\
&=\Pr(x)\Pr(w)\int\int\frac{\Pr(z,y)}{\Pr(y)}\frac{\Pr(y,x,w)}{\Pr(x,w)}\,dy\,dz\\
&=\Pr(x)\Pr(w)\int\frac{\Pr(y,x,w)}{\Pr(x,w)}\left(\int\frac{\Pr(z,y)}
{\Pr(y)}\,dz\right)\,dy\\
&=\Pr(x)\Pr(w)\int\frac{\Pr(y,x,w)}{\Pr(x,w)}\frac{\Pr(y)}
{\Pr(y)}dy\\
&=\Pr(x)\Pr(w)\int\frac{\Pr(y,x,w)}{\Pr(x,w)}dy\\
&=\Pr(x)\Pr(w)\frac{\Pr(x,w)}{\Pr(x,w)}\\
&=\Pr(x)\Pr(w)
\end{align}
