In Causal Inference in Statistics: an Overview, Pearl presents an equation describing distribution from a graphical model presented in figure 3:
The author arrives at equality (20) - see image above. This is fine, I understand this. However, later on , the author derives equation (23):
I cannot seem to get that, here is my shot at the problem: $ \begin{align} \begin{split} P(y |do(x_0)) &= \sum_{z_1,z_2,z_3} P(z_1) P(z_2) P(z_3 |z_1,z_2) P(y |z_2,z_3,x_0) \text{ equation (20)}\\ &=\sum P(z_1) P(z_3,z_2 |z_1) P(y |z_2,z_3,x_0) \text{ since $z_2 \perp z_1$}\\ &=\sum_{z_1,z_2,z_3} P(z_1) P(y,z_2,z_3 |x_0,z_1) \text{ not sure why}\\ &=\sum_{z_1,z_2,z_3} P(z_1) P(y,z_3 |x_0, z_1) \text{ marginalize over $z_2$}\\ &=\sum_{z_1,z_2,z_3} P(z_1) P(y|z_1,z_3,x_0)P(z_3|z_1,x_0) \text{ cond. probability} \\ &= \sum_{z_1,z_3} P(z_1) P(z_3 |z_1) P(y |z_1,z_3,x_0) \text{ I doubt this step is correct} \end{split} \end{align} $