# How to prove $\left\{ \omega|X(\omega)=Y(\omega)\right\} \in\mathcal{F}$ is measurable, if $X$ and $Y$ are measurable?

Given a probability space $(\Omega ,\mathcal{F} ,\mu)$. Let $X$ and $Y$ be $\mathcal{F}$-measurable real valued random variables. How would one proove that $\left\{ \omega|X(\omega)=Y(\omega)\right\} \in\mathcal{F}$ is measurable.

My thoughts: Since $X$ and $Y$ are measurable, it is true, that for each $x\in\mathbb{R}:$ $\left\{ \omega|X(\omega)<x\right\} \in\mathcal{F}$ and $\left\{ \omega|Y(\omega)<x\right\} \in\mathcal{F}$.

It follows that $\left\{ \omega|X(\omega)-Y(\omega)\leq x\right\} \in\mathcal{F}$

Therefore $\left\{ -\frac{1}{n}\leq\omega|X(\omega)-Y(\omega)\leq \frac{1}{n} \right\} \in\mathcal{F}$, for $n\in\mathbb{N}$.

Therefore $0=\bigcap_{n\in\mathbb{N}}\left\{ -\frac{1}{n}\leq\omega|X(\omega)-Y(\omega)\leq \frac{1}{n} \right\} \in\mathcal{F}$.

Am working towards the correct direction? I appreciate any constructive answer!

-
If you know that the difference of two measurable function is measurable, it's almost correct (in the last line, the LHS is the set $\{X=Y\}$, not $0$), but in this case you just have to show that $\{Z=0\}$ is measurable for $Z$ measurable. –  Davide Giraudo May 2 '12 at 11:20

$$[X\ne Y]=\bigcup_{q\in\mathbb Q}\left([X\lt q]\cap[Y\geqslant q]\right)\cup\left([X\geqslant q]\cap[Y\lt q]\right)=\bigcup_{q\in\mathbb Q}\left([X\lt q]\Delta[Y\lt q]\right)$$
Let $Z\colon \Omega\to\mathbb R^2$ defined by $Z(\omega)=(X(\omega),Y(\omega))$, where $\mathbb R^2$ is endowed with the Borel $\sigma$-algebra $\mathcal B(\mathbb R^2)$.
• Show that the fact that the projections are measurable implies that so is $Z$.
• Show that the set $\{(x,x)\in\Bbb R\times \Bbb R)$ is $\mathcal B(\mathbb R^2)$-measurable.