How can I prove the following equality
$$\left(S_{1}-S_{2}-K\right)^{+}=\intop_{0}^{\infty}1_{\left\{ S_{1}>x+K\right\} }\left(x\right)1_{\left\{ S_{2}<x\right\} }\left(x\right)dx$$
Here $S_1$ and $S_2$ are two real variables and $K$ is a constant. I can prove a similar equality involving only one variable.
$$\left(S_{1}-K\right)^{+}=\intop_{0}^{\left(S_{1}-K\right)^{+}}dx=\intop_{0}^{\infty}1_{\left\{ x<\left(S_{1}-K\right)^{+}\right\} }\left(x\right)dx=\intop_{0}^{\infty}1_{\left\{ S_{1}>x+K\right\} }\left(x\right)dx$$
but having difficulty proving the 2 variable case. Some help would be appreciated with this.
$S_2 < x \iff S_2 + K < x + K$.
Hence $S_2 < x$ and $x + K < S_1 \iff S_2 < x < S_1 - K$. So,
$$\mathbb{1}_{\{S_1 > x + K\}}(x)\cdot \mathbb{1}_{\{S_2 < x\}}(x) = \mathbb{1}_{\{S_2 < x < S_1 - K\}}(x)$$
Now
$$ \int_0^\infty \mathbb{1}_{\{S_1 > x + K\}}(x)\cdot \mathbb{1}_{\{S_2 < x\}}(x) \ dx = \int_0^\infty \mathbb{1}_{\{S_2 < x < S_1 - K\}}(x) \ dx \\= \int_{S_2}^{S_1-K}\ dx = S_1 - S_2 - K $$