Consider the real-valued random variables $X,Y,Z,W$ defined on the same probability space and taking value respectively in $\mathcal{X}, \mathcal{Y}, \mathcal{Z}, \mathcal{W}$.
Assume that $$ X| Z=z,W=w \overset{d}{\sim} Y| Z=z,W=w $$ $\forall z\in \mathcal{Z}, \forall w\in \mathcal{W}$, where $\overset{d}{\sim}$ means "has equal distribution"
Does this imply $X\overset{d}{\sim}Y$?
I think it does by the law of total probability, but I would like to get some formal confirmation.
Yes. For any bounded measurable $g$, $$ \mathbb E[g(X)] = \mathbb E\left[\mathbb E[g(X) | Z, W]\right] = \mathbb E[\left[\mathbb E[g(Y)|Z,W]\right] = \mathbb E[g(Y)]$$