# Show that $\int_{[0,1]^2}g(y_1-y_2) \Bbb{1}_{\{y_1>y_2\}}dy_1dy_2 = \int_{[0,1]}g(m)(1-m)\, dm$

I am trying to prove the following equality

$$\int_{[0,1]^2}g(y_1-y_2) \Bbb{1}_{\{y_1>y_2\}}dy_1dy_2 = \int_{[0,1]}g(m)(1-m)\, dm$$

I tried to do the following: $\Bbb{1}_{\{y_1>y_2\}}=\begin{cases}1&if& y_1\gt y_2 \\0&otherwise \end{cases}$ $$\int_0^1\int_0^1g(y_1-y_2)\Bbb{1}_{\{y_1>y_2\}}dy_1dy_2 = \int_0^1\int_0^{1-y_2}g(y_1-y_2)dy_1dy_2$$ Now i can't find any substitution that brings me to the desired result, because naïvely i think i should substitute $y_1-y_2=m, -dm = dy_2$, but this brings me to the integral $$\int_{y_1}^{1-y_2}\int_0^{1-y_2}g(m)dy_1(-dm)$$ I'm really really confused, i would really appreciate if one of you could clear my head

This equality comes from a solution of an exercise

$$m=y_1-y_2,\ t=y_1\implies g(y_1-y_2)\mathbf 1_{0\lt y_2\lt y_1\lt1}=g(m)\mathbf 1_{0\lt m\lt t\lt1}$$
In your first step, it should be: $m=y_1 -y_2$
$$\int_0^1\int_0^1g(y_1-y_2)\Bbb{1}_{\{y_1>y_2\}}dy_1dy_2 = \int_0^1\int_{y_2}^{1}g(y_1-y_2)dy_1dy_2=\int_0^1\int_0^{1-y_2}g(m)dm dy_2=\int_0^1\int_0^1 g(m)I_{(0<m<1-y_2)}dmdy_2=\int_0^1\int_0^1 g(m)I_{(0<m<1-y_2)}dy_2 dm \quad=\int_0^1\int_0^1 g(m)I_{(0<y_2<1-m)}dy_2 dm =\int_0^1 g(m)(1-m)dm$$